def __init__(self, mainwin): KDialog.__init__(self, mainwin) ShortcutClient.__init__(self, mainwin.charSelectShortcuts) self.mainwin = mainwin self.setButtons(KDialog.ButtonCode( KDialog.Help | KDialog.Apply | KDialog.Ok | KDialog.Close)) self.setCaption(i18n("Special Characters")) self.setHelp("charselect") # trick key button in the DialogButtonBox self.keySelector = key = KKeySequenceWidget() key.layout().setContentsMargins(20, 0, 0, 0) self.findChild(QDialogButtonBox).layout().insertWidget(1, key) self.charSelect = KCharSelect(None) self.setMainWidget(self.charSelect) self.charSelect.charSelected.connect(self.insertText) self.charSelect.currentCharChanged.connect(self.slotCurrentCharChanged) self.keySelector.keySequenceChanged.connect(self.slotKeySequenceChanged) self.okClicked.connect(self.insertCurrentChar) self.applyClicked.connect(self.insertCurrentChar) self.finished.connect(self.saveSettings) self.loadSettings()
def __init__(self, mainwin): self.mainwin = mainwin ShortcutClient.__init__(self, mainwin.expansionShortcuts) self.expansions = KConfig("expansions", KConfig.NoGlobals, "appdata") # delete shortcut actions that do not exist here anymore self.shakeHands(self.expansionsList())