def __init__(self, parent=None): KStatusNotifierItem.__init__(self, parent) self.setTitle('synaptiks') self.setIconByName('synaptiks') self.setCategory(KStatusNotifierItem.Hardware) self.setStatus(KStatusNotifierItem.Passive) self.setup_actions() self._config = SynaptiksTrayConfiguration(self) try: self.touchpad = Touchpad.find_first(Display.from_qt()) except Exception as error: # show an error message from synaptiks.kde.error import get_localized_error_message error_message = get_localized_error_message(error) options = KMessageBox.Options(KMessageBox.Notify | KMessageBox.AllowLink) KMessageBox.error(None, error_message, '', options) # disable all touchpad related actions for act in (self.touchpad_on_action, self.preferences_action): act.setEnabled(False) # disable synaptiks autostart, the user can still start synaptiks # manually again, if the reason of the error is fixed self._config.findItem('Autostart').setProperty(False) self._config.writeConfig() else: self.activateRequested.connect(self.show_configuration_dialog) # setup the touchpad manager self.setup_manager(self.touchpad)
def __init__(self, icon, parent): KStatusNotifierItem.__init__(self, parent) self.icon = icon self.parent = parent self.setIconByPixmap(icon) self.setCategory(1) self.setStatus(2)
def __init__(self, icon, parent): KStatusNotifierItem.__init__(self, parent) self.setStandardActionsEnabled(False) self.connect(self.contextMenu(), SIGNAL('aboutToShow()'), self.__buildMenu) self.actionQuit = KStandardAction.quit(parent.app, SLOT("quit()"), self) self.hideResoreAction = QAction('Minimize', self.contextMenu()) self.connect(self.hideResoreAction, SIGNAL('triggered()'), SIGNAL("activate()")) self.icon = icon self.parent = parent self.setIconByName(icon) self.setCategory(1) self.setStatus(2)
def __init__(self, icon, parent): KStatusNotifierItem.__init__(self, parent) self.setStandardActionsEnabled(False) self.connect(self.contextMenu(), SIGNAL('aboutToShow()'), self.__buildMenu) self.actionQuit = KStandardAction.quit(parent.app, SLOT("quit()"), self) self.hideResoreAction = QAction('Minimize', self.contextMenu()) self.connect(self.hideResoreAction, SIGNAL('triggered()'), SIGNAL("activate()")) self.icon = icon self.parent = parent self.setIconByPixmap(icon) self.setCategory(1) self.setStatus(2)