Skip to content

Commit 522e0e3

Browse files
committed
Alternate approach to indicate script editing in progress.
1 parent 54f234a commit 522e0e3

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

picard/ui/mainwindow/__init__.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,8 @@ def __init__(self, parent=None, disable_player=False):
229229
webservice_manager.authenticationRequired.connect(self._show_password_dialog)
230230
webservice_manager.proxyAuthenticationRequired.connect(self._show_proxy_dialog)
231231

232+
self._options_open = False
233+
232234
def register_suspend_while_loading(self, on_enter=None, on_exit=None):
233235
funcs = SuspendWhileLoadingFuncs(on_enter=on_enter, on_exit=on_exit)
234236
self._suspend_while_loading_funcs.append(funcs)
@@ -1174,6 +1176,7 @@ def show_about(self):
11741176

11751177
def show_options(self, page=None):
11761178
ReadTheDocs.update_documentation_items() # Retry updates if required
1179+
self._options_open = True
11771180
options_dialog = OptionsDialog.show_instance(page, self)
11781181
options_dialog.finished.connect(self._options_closed)
11791182
if self.script_editor_dialog is not None:
@@ -1184,6 +1187,7 @@ def show_options(self, page=None):
11841187
return options_dialog
11851188

11861189
def _options_closed(self):
1190+
self._options_open = False
11871191
if self.script_editor_dialog is not None:
11881192
self.open_file_naming_script_editor()
11891193
self.script_editor_dialog.show()
@@ -1193,6 +1197,9 @@ def _options_closed(self):
11931197
self._make_script_selector_menu()
11941198
self._make_settings_selector_menu()
11951199

1200+
def is_editing_scripts(self) -> bool:
1201+
return self._options_open or self.script_editor_dialog is not None
1202+
11961203
def show_help(self):
11971204
webbrowser2.open('documentation')
11981205

0 commit comments

Comments
 (0)