Ejemplo n.º 1
0
    def setDefaultShortcuts(self):
        reply = QtGui.QMessageBox.warning(
            self,
            "Default Keymap",
            "Setting keymap to default will wipe away your current keymap.\n\nProceed?",
            QtGui.QMessageBox.Yes | QtGui.QMessageBox.No,
        )
        if reply == QtGui.QMessageBox.Yes:
            for key, value in self.useData.DEFAULT_SHORTCUTS["Ide"].items():
                default = self.useData.DEFAULT_SHORTCUTS["Ide"][key]
                self.useData.CUSTOM_SHORTCUTS["Ide"][key] = default

            sc = QsciScintilla()
            standardCommands = sc.standardCommands()

            for key, value in self.useData.DEFAULT_SHORTCUTS["Editor"].items():
                default = self.useData.DEFAULT_SHORTCUTS["Editor"][key]
                command = standardCommands.find(default[1])
                keyValue = command.key()
                self.useData.CUSTOM_SHORTCUTS["Editor"][key] = [default[0], keyValue]
            self.save()
            self.useData.loadKeymap()
            self.updateShortcutsView()
        else:
            return
Ejemplo n.º 2
0
    def setDefaultShortcuts(self):
        reply = QtGui.QMessageBox.warning(self, "Default Keymap",
                                          "Setting keymap to default will wipe away your current keymap.\n\nProceed?",
                                          QtGui.QMessageBox.Yes | QtGui.QMessageBox.No)
        if reply == QtGui.QMessageBox.Yes:
            for key, value in self.useData.DEFAULT_SHORTCUTS['Ide'].items():
                default = self.useData.DEFAULT_SHORTCUTS['Ide'][key]
                self.useData.CUSTOM_SHORTCUTS['Ide'][key] = default

            sc = QsciScintilla()
            standardCommands = sc.standardCommands()

            for key, value in self.useData.DEFAULT_SHORTCUTS['Editor'].items():
                default = self.useData.DEFAULT_SHORTCUTS['Editor'][key]
                command = standardCommands.find(default[1])
                keyValue = command.key()
                self.useData.CUSTOM_SHORTCUTS[
                    'Editor'][key] = [default[0], keyValue]
            self.save()
            self.useData.loadKeymap()
            self.updateShortcutsView()
        else:
            return
Ejemplo n.º 3
0
	def editorDefaultCmd(self):
		editor = QsciScintilla()
		cmds = editor.standardCommands().commands()
		return {str(cmd.command()): [QKeySequence(cmd.key()).toString(),cmd.description()] for i, cmd in enumerate(cmds)}