Skip to content

Commit

Permalink
Add a waiting cursor when saving the CFG file
Browse files Browse the repository at this point in the history
  • Loading branch information
Gustry committed Dec 4, 2023
1 parent 70283c4 commit f57d266
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
* Fix translations about checks/rules/explanations
* Add new blocker rule when the layer or group has a trailing space
* Fix some casting issue with SIP about the legend
* Add a waiting cursor when saving the CFG file

## 4.0.1 - 2023-11-27

Expand Down
9 changes: 7 additions & 2 deletions lizmap/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -1030,7 +1030,7 @@ def initGui(self):

# connect Lizmap signals and functions
self.dlg.buttonBox.button(QDialogButtonBox.Cancel).clicked.connect(self.dlg.close)
self.dlg.buttonBox.button(QDialogButtonBox.Apply).clicked.connect(self.save_cfg_file)
self.dlg.buttonBox.button(QDialogButtonBox.Apply).clicked.connect(self.save_cfg_file_cursor)
self.dlg.buttonBox.button(QDialogButtonBox.Ok).clicked.connect(self.ok_button_clicked)
self.dlg.buttonBox.button(QDialogButtonBox.Help).clicked.connect(self.show_help_question)

Expand Down Expand Up @@ -3584,12 +3584,17 @@ def check_global_project_options(self) -> Tuple[bool, str]:

def ok_button_clicked(self):
"""When the OK button is press, we 'apply' and close the dialog."""
if not self.save_cfg_file():
if not self.save_cfg_file_cursor():
return

# Only close the dialog if no error
self.dlg.close()

def save_cfg_file_cursor(self) -> bool:
""" Save CFG file with a waiting cursor. """
with OverrideCursor(Qt.WaitCursor):
return self.save_cfg_file()

def save_cfg_file(
self,
lwc_version: LwcVersions = None,
Expand Down

0 comments on commit f57d266

Please sign in to comment.