Skip to content

Commit

Permalink
ui,prefs: better feedback when saving options
Browse files Browse the repository at this point in the history
  • Loading branch information
gustavo-iniguez-goya committed Dec 15, 2024
1 parent 4e8b222 commit 80ab972
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion ui/opensnitch/dialogs/preferences.py
Original file line number Diff line number Diff line change
Expand Up @@ -730,6 +730,7 @@ def _save_settings(self):
return
self._save_nodes_config()

self._set_status_successful(QC.translate("preferences", "Configuration applied."))
self.saved.emit()
self._settingsSaved = True
self._needs_restart()
Expand Down Expand Up @@ -770,7 +771,8 @@ def _save_ui_config(self):
self._save_ui_columns_config()

maxmsgsize = self.comboGrpcMsgSize.currentText()
if maxmsgsize != "":
mmsize_saved = self._cfg.getSettings(Config.DEFAULT_SERVER_MAX_MESSAGE_LENGTH)
if maxmsgsize != "" and mmsize_saved != maxmsgsize:
self._cfg.setSettings(Config.DEFAULT_SERVER_MAX_MESSAGE_LENGTH, maxmsgsize.replace(" ", ""))
self._changes_needs_restart = QC.translate("preferences", "Server options changed")

Expand Down Expand Up @@ -997,20 +999,25 @@ def _set_status_error(self, msg):
self._show_status_label()
self.statusLabel.setStyleSheet('color: red')
self.statusLabel.setText(msg)
QtWidgets.QApplication.processEvents()

def _set_status_successful(self, msg):
self._show_status_label()
self.statusLabel.setStyleSheet('color: green')
self.statusLabel.setText(msg)
QtWidgets.QApplication.processEvents()

def _set_status_message(self, msg):
self._show_status_label()
self.statusLabel.setStyleSheet('color: darkorange')
self.statusLabel.setText(msg)
QtWidgets.QApplication.processEvents()

def _reset_status_message(self):
self.statusLabel.setText("")
self._hide_status_label()
# force widgets repainting
QtWidgets.QApplication.processEvents()

def _enable_db_cleaner_options(self, enable, db_max_days):
self.checkDBMaxDays.setChecked(enable)
Expand Down

0 comments on commit 80ab972

Please sign in to comment.