Files
test2/scripts/startup/bl_ui/space_statusbar.py

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

42 lines
820 B
Python
Raw Normal View History

# SPDX-FileCopyrightText: 2018-2023 Blender Authors
#
# SPDX-License-Identifier: GPL-2.0-or-later
from bpy.types import Header
class STATUSBAR_HT_header(Header):
bl_space_type = 'STATUSBAR'
def draw(self, context):
layout = self.layout
# input status
layout.template_input_status()
layout.separator_spacer()
# Messages
layout.template_reports_banner()
# Progress Bar
layout.template_running_jobs()
layout.separator_spacer()
row = layout.row()
row.alignment = 'RIGHT'
# Stats & Info
Core: Implement new blendfile compatibility handling. This implements the main aspects of changes to blendfile compatibility as designed in #109151: * Blender files which file minversion is newer than current Blender executable won't be loaded at all. * Blender files which file version is newer than current Blender will triger systematic warning to user: * In the status info bar (lower right corner in default UI). * When attempting to save (overwrite) them. This means that the file minversion becomes a hard limit, and not a soft, warning-only as it used to be. Further more, forward compatibility warning is now systematic (instead of depending on file minversion), and more visible for users. See also https://wiki.blender.org/wiki/Process/Compatibility_Handling for details over the new policy. Technically: * Opening any file with a minversion newer than current Blender file one now triggers an early abort, with an error message reported to the user. This is handled by a new utils called from `blo_decode_and_check`. * Any file newer than current Blender version sets a new `has_forward_compatibility_issues` flag in Main struct at read time. * Status bar info area is turned into a template, which uses this flag to display special warning UI and tooltip when set. * A new confirmation popup appears when user tries to save (overwrite) such a 'newer' blendfile, stating potential loos of data, and proposing by default to 'save as' instead. * The 'quit unsaved' popup has also been updated to 'save as' instead of 'save' when the edited file is has potential forward compitibility issues. Part of #109151 (PR !110109).
2023-07-24 14:18:22 +02:00
layout.template_status_info()
classes = (
STATUSBAR_HT_header,
)
if __name__ == "__main__": # only for live edit.
from bpy.utils import register_class
for cls in classes:
register_class(cls)