def save(self): tray = self.tray_box.isChecked() old_tray_value = conf.get_tray_available() conf.set_tray_available(tray) if tray != old_tray_value: signals.show_or_hide_tray.emit() switch_tab = self.switch_tab_box.isChecked() conf.set_auto_switch_tab(switch_tab)
def __init__(self, parent): self.parent = parent self.available = False if QSystemTrayIcon.isSystemTrayAvailable(): self.tray_icon = QSystemTrayIcon(parent) self.tray_icon.setIcon(QIcon(os.path.join(cons.MEDIA_PATH, "misc", "ochd.ico"))) self.tray_icon.setToolTip(cons.APP_TITLE) self.tray_icon.activated.connect(self.restore) self.context_menu() #QApplication.setQuitOnLastWindowClosed(False) if conf.get_tray_available(): self.available = True self.tray_icon.show()
def __init__(self, parent): self.parent = parent self.available = False if QSystemTrayIcon.isSystemTrayAvailable(): self.tray_icon = QSystemTrayIcon(parent) self.tray_icon.setIcon( QIcon(os.path.join(cons.MEDIA_PATH, "misc", "ochd.ico"))) self.tray_icon.setToolTip(cons.APP_TITLE) self.tray_icon.activated.connect(self.restore) self.context_menu() #QApplication.setQuitOnLastWindowClosed(False) if conf.get_tray_available(): self.available = True self.tray_icon.show()
def load(self): if conf.get_tray_available(): self.tray_box.toggle()
def load(self): if conf.get_tray_available(): self.tray_box.toggle() if conf.get_auto_switch_tab(): self.switch_tab_box.toggle()
def show_or_hide_tray(self): if self.tray.is_available() and conf.get_tray_available(): self.tray.show() else: self.tray.hide()