#440 disable the Settings menu action when server is active

This commit is contained in:
Miguel Jacq 2017-06-03 18:55:09 +10:00
parent c6b19a2864
commit 22971fc205
No known key found for this signature in database
GPG Key ID: EEA4341C6D97A0B6

View File

@ -152,12 +152,12 @@ class OnionShareGui(QtWidgets.QMainWindow):
system = common.get_platform()
menu = QtWidgets.QMenu()
settingsAction = menu.addAction(strings._('gui_settings_window_title', True))
settingsAction.triggered.connect(self.open_settings)
helpAction = menu.addAction(strings._('gui_settings_button_help', True))
helpAction.triggered.connect(SettingsDialog.help_clicked)
exitAction = menu.addAction(strings._('systray_menu_exit', True))
exitAction.triggered.connect(self.close)
self.settingsAction = menu.addAction(strings._('gui_settings_window_title', True))
self.settingsAction.triggered.connect(self.open_settings)
self.helpAction = menu.addAction(strings._('gui_settings_button_help', True))
self.helpAction.triggered.connect(SettingsDialog.help_clicked)
self.exitAction = menu.addAction(strings._('systray_menu_exit', True))
self.exitAction.triggered.connect(self.close)
self.systemTray = QtWidgets.QSystemTrayIcon(self)
# The convention is Mac systray icons are always grayscale
@ -443,6 +443,7 @@ class OnionShareGui(QtWidgets.QMainWindow):
Disable the Settings button while an OnionShare server is active.
"""
self.settings_button.setEnabled(not active)
self.settingsAction.setEnabled(not active)
def closeEvent(self, e):
common.log('OnionShareGui', 'closeEvent')