diff options
Diffstat (limited to 'desktop/src/onionshare/main_window.py')
-rw-r--r-- | desktop/src/onionshare/main_window.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/desktop/src/onionshare/main_window.py b/desktop/src/onionshare/main_window.py index 86258de9..f4f333d9 100644 --- a/desktop/src/onionshare/main_window.py +++ b/desktop/src/onionshare/main_window.py @@ -289,6 +289,20 @@ class MainWindow(QtWidgets.QMainWindow): self.system_tray.hide() e.accept() + def event(self, event): + # Check if color mode switched while onionshare was open, if so, ask user to restart + if event.type() == QtCore.QEvent.Type.ApplicationPaletteChange: + QtCore.QTimer.singleShot(1, self.color_mode_warning) + return True + return QtWidgets.QMainWindow.event(self, event) + + def color_mode_warning(self): + """ + Open the color mode warning alert. + """ + notice = strings._("gui_color_mode_changed_notice") + Alert(self.common, notice, QtWidgets.QMessageBox.Information) + def cleanup(self): self.common.log("MainWindow", "cleanup") self.tabs.cleanup() |