66 CHECK_IMAGES_PATHS , DISPLAY_QUICK_OPTIONS , DISABLE_IMPORT_CALLBACKS ,
77 INSERT_TAB_AFTER_CURRENT , NAMESPACE_TOOLBAR , SYNCHRONYZE_SELECTION ,
88 TRIGGER_REPLACE_ON_MIRROR , USE_BASE64_DATA_ENCODING ,
9- USE_ICON_FOR_UNSAVED_TAB , ZOOM_SENSITIVITY , ZOOM_BUTTON , ZOOM_BUTTONS )
9+ USE_ICON_FOR_UNSAVED_TAB , WARN_ON_TAB_CLOSED , ZOOM_SENSITIVITY ,
10+ ZOOM_BUTTON , ZOOM_BUTTONS )
1011
1112
1213MAX_SENSITIVITY = 500
@@ -37,6 +38,8 @@ def __init__(self, callback=None, parent=None):
3738 self .unsaved_tab_icon = QtWidgets .QCheckBox (text )
3839 text = "Insert new tab after current tab."
3940 self .insert_after_current = QtWidgets .QCheckBox (text )
41+ text = "Warning before closing a tab."
42+ self .warn_on_tab_close = QtWidgets .QCheckBox (text )
4043 self .ui_group = QtWidgets .QGroupBox ("Ui" )
4144 self .ui_layout = QtWidgets .QVBoxLayout (self .ui_group )
4245 self .ui_layout .addWidget (self .namespace_toolbar )
@@ -47,6 +50,7 @@ def __init__(self, callback=None, parent=None):
4750 self .ui_layout .addWidget (self .check_images_paths )
4851 self .ui_layout .addWidget (self .unsaved_tab_icon )
4952 self .ui_layout .addWidget (self .insert_after_current )
53+ self .ui_layout .addWidget (self .warn_on_tab_close )
5054
5155 text = "Encode in-scene data as base64."
5256 self .use_base64_encoding = QtWidgets .QCheckBox (text )
@@ -101,6 +105,7 @@ def __init__(self, callback=None, parent=None):
101105 self .unsaved_tab_icon .released .connect (self .save_ui_states )
102106 self .sychronize .released .connect (self .save_ui_states )
103107 self .search_on_mirror .released .connect (self .save_ui_states )
108+ self .warn_on_tab_close .released .connect (self .save_ui_states )
104109 self .zoom_sensitivity .valueChanged .connect (self .save_ui_states )
105110 self .zoom_button .currentIndexChanged .connect (self .save_ui_states )
106111
@@ -121,6 +126,8 @@ def load_ui_states(self):
121126 self .use_base64_encoding .setChecked (state )
122127 state = bool (cmds .optionVar (query = USE_ICON_FOR_UNSAVED_TAB ))
123128 self .unsaved_tab_icon .setChecked (state )
129+ state = bool (cmds .optionVar (query = WARN_ON_TAB_CLOSED ))
130+ self .warn_on_tab_close .setChecked (state )
124131 state = bool (cmds .optionVar (query = INSERT_TAB_AFTER_CURRENT ))
125132 self .insert_after_current .setChecked (state )
126133 value = cmds .optionVar (query = AUTO_FOCUS_BEHAVIOR )
@@ -155,6 +162,8 @@ def save_ui_states(self, *_):
155162 save_optionvar (AUTO_FOCUS_BEHAVIOR , value )
156163 value = int (self .search_on_mirror .isChecked ())
157164 save_optionvar (TRIGGER_REPLACE_ON_MIRROR , value )
165+ value = int (self .warn_on_tab_close .isChecked ())
166+ save_optionvar (WARN_ON_TAB_CLOSED , value )
158167 save_optionvar (ZOOM_BUTTON , self .zoom_button .currentText ())
159168 value = MAX_SENSITIVITY - int (self .zoom_sensitivity .value ()) + 1
160169 save_optionvar (ZOOM_SENSITIVITY , value )
0 commit comments