If tray is not available, disable settings group "Tray"
and related checkboxes; set checkBoxMinimizeToTray to false by default
This commit is contained in:
parent
a69732f060
commit
c79636863d
|
@ -47,20 +47,33 @@ class SettingsDialog(QtGui.QDialog):
|
||||||
def adjust_from_config(self, config):
|
def adjust_from_config(self, config):
|
||||||
"""Adjust all widgets state according to config settings"""
|
"""Adjust all widgets state according to config settings"""
|
||||||
# pylint: disable=too-many-branches,too-many-statements
|
# pylint: disable=too-many-branches,too-many-statements
|
||||||
self.checkBoxStartOnLogon.setChecked(
|
if not self.parent.tray.isSystemTrayAvailable():
|
||||||
config.getboolean('bitmessagesettings', 'startonlogon'))
|
self.groupBoxTray.setEnabled(False)
|
||||||
|
self.groupBoxTray.setTitle(_translate(
|
||||||
|
"MainWindow", "Tray (not available in your system)"))
|
||||||
|
for setting in (
|
||||||
|
'minimizetotray', 'trayonclose', 'startintray'):
|
||||||
|
config.set('bitmessagesettings', setting, 'false')
|
||||||
|
else:
|
||||||
self.checkBoxMinimizeToTray.setChecked(
|
self.checkBoxMinimizeToTray.setChecked(
|
||||||
config.getboolean('bitmessagesettings', 'minimizetotray'))
|
config.getboolean('bitmessagesettings', 'minimizetotray'))
|
||||||
self.checkBoxTrayOnClose.setChecked(
|
self.checkBoxTrayOnClose.setChecked(
|
||||||
config.safeGetBoolean('bitmessagesettings', 'trayonclose'))
|
config.safeGetBoolean('bitmessagesettings', 'trayonclose'))
|
||||||
self.checkBoxHideTrayConnectionNotifications.setChecked(
|
|
||||||
config.getboolean("bitmessagesettings", "hidetrayconnectionnotifications"))
|
|
||||||
self.checkBoxShowTrayNotifications.setChecked(
|
|
||||||
config.getboolean('bitmessagesettings', 'showtraynotifications'))
|
|
||||||
self.checkBoxStartInTray.setChecked(
|
self.checkBoxStartInTray.setChecked(
|
||||||
config.getboolean('bitmessagesettings', 'startintray'))
|
config.getboolean('bitmessagesettings', 'startintray'))
|
||||||
|
|
||||||
|
self.checkBoxHideTrayConnectionNotifications.setChecked(
|
||||||
|
config.getboolean(
|
||||||
|
'bitmessagesettings', 'hidetrayconnectionnotifications'))
|
||||||
|
self.checkBoxShowTrayNotifications.setChecked(
|
||||||
|
config.getboolean('bitmessagesettings', 'showtraynotifications'))
|
||||||
|
|
||||||
|
self.checkBoxStartOnLogon.setChecked(
|
||||||
|
config.getboolean('bitmessagesettings', 'startonlogon'))
|
||||||
|
|
||||||
self.checkBoxWillinglySendToMobile.setChecked(
|
self.checkBoxWillinglySendToMobile.setChecked(
|
||||||
config.safeGetBoolean('bitmessagesettings', 'willinglysendtomobile'))
|
config.safeGetBoolean(
|
||||||
|
'bitmessagesettings', 'willinglysendtomobile'))
|
||||||
self.checkBoxUseIdenticons.setChecked(
|
self.checkBoxUseIdenticons.setChecked(
|
||||||
config.safeGetBoolean('bitmessagesettings', 'useidenticons'))
|
config.safeGetBoolean('bitmessagesettings', 'useidenticons'))
|
||||||
self.checkBoxReplyBelow.setChecked(
|
self.checkBoxReplyBelow.setChecked(
|
||||||
|
@ -82,10 +95,12 @@ class SettingsDialog(QtGui.QDialog):
|
||||||
"MainWindow", "Start-on-login not yet supported on your OS."))
|
"MainWindow", "Start-on-login not yet supported on your OS."))
|
||||||
self.checkBoxMinimizeToTray.setDisabled(True)
|
self.checkBoxMinimizeToTray.setDisabled(True)
|
||||||
self.checkBoxMinimizeToTray.setText(_translate(
|
self.checkBoxMinimizeToTray.setText(_translate(
|
||||||
"MainWindow", "Minimize-to-tray not yet supported on your OS."))
|
"MainWindow",
|
||||||
|
"Minimize-to-tray not yet supported on your OS."))
|
||||||
self.checkBoxShowTrayNotifications.setDisabled(True)
|
self.checkBoxShowTrayNotifications.setDisabled(True)
|
||||||
self.checkBoxShowTrayNotifications.setText(_translate(
|
self.checkBoxShowTrayNotifications.setText(_translate(
|
||||||
"MainWindow", "Tray notifications not yet supported on your OS."))
|
"MainWindow",
|
||||||
|
"Tray notifications not yet supported on your OS."))
|
||||||
elif 'linux' in sys.platform:
|
elif 'linux' in sys.platform:
|
||||||
self.checkBoxStartOnLogon.setDisabled(True)
|
self.checkBoxStartOnLogon.setDisabled(True)
|
||||||
self.checkBoxStartOnLogon.setText(_translate(
|
self.checkBoxStartOnLogon.setText(_translate(
|
||||||
|
|
|
@ -75,7 +75,7 @@
|
||||||
<string>Minimize to tray</string>
|
<string>Minimize to tray</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="checked">
|
<property name="checked">
|
||||||
<bool>true</bool>
|
<bool>false</bool>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user