def keyPressEvent(self, event): """The four tabs can be selected with CTRL-1 .. CTRL-4""" mod = event.modifiers() key = chr(event.key()%128) if Qt.ControlModifier | mod and key in '1234': self.setCurrentPage(self.pages[int(key)-1]) return KConfigDialog.keyPressEvent(self, event)
def keyPressEvent(self, event): """The four tabs can be selected with CTRL-1 .. CTRL-4""" mod = event.modifiers() key = chr(event.key() % 128) if Qt.ControlModifier | mod and key in '1234': self.setCurrentPage(self.pages[int(key) - 1]) return KConfigDialog.keyPressEvent(self, event)
def __init__(self, parent, name): # pylint: disable=super-init-not-called KConfigDialog.__init__(self, parent, name, Internal.Preferences) StateSaver(self) self.pages = [ self.addPage(PlayConfigTab(self), i18nc('kajongg', 'Play'), "arrow-right"), self.addPage(TilesetSelector(self), i18n("Tiles"), "games-config-tiles"), self.addPage(BackgroundSelector(self), i18n("Backgrounds"), "games-config-background") ]
def __init__(self, parent, name): # pylint: disable=super-init-not-called KConfigDialog.__init__( self, parent, QString(name), Internal.Preferences) StateSaver(self) self.pages = [ self.addPage( PlayConfigTab(self), m18nc('kajongg', 'Play'), "arrow-right"), self.addPage( TilesetSelector(self), m18n("Tiles"), "games-config-tiles"), self.addPage( BackgroundSelector(self), m18n("Backgrounds"), "games-config-background")]
def showSettings(self): """show preferences dialog. If it already is visible, do nothing""" if KConfigDialog.showDialog("settings"): return # if an animation is running, Qt segfaults somewhere deep # in the SVG renderer rendering the wind tiles for the tile # preview afterCurrentAnimationDo(self.__showSettings2)