当前位置: 首页>>代码示例>>Python>>正文


Python QShortcut.setKey方法代码示例

本文整理汇总了Python中PyQt4.QtGui.QShortcut.setKey方法的典型用法代码示例。如果您正苦于以下问题:Python QShortcut.setKey方法的具体用法?Python QShortcut.setKey怎么用?Python QShortcut.setKey使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PyQt4.QtGui.QShortcut的用法示例。


在下文中一共展示了QShortcut.setKey方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: from PyQt4.QtGui import QShortcut [as 别名]
# 或者: from PyQt4.QtGui.QShortcut import setKey [as 别名]
    def __init__(self, name):
        QWebView.__init__(self)
        self.setPage(PlotWebPage(name))
        self.setRenderHint(QPainter.Antialiasing, True)
        self.setContextMenuPolicy(Qt.NoContextMenu)
        self.settings().setAttribute(QWebSettings.JavascriptEnabled, True)
        self.settings().setAttribute(QWebSettings.LocalContentCanAccessFileUrls, True)
        self.settings().setAttribute(QWebSettings.LocalContentCanAccessRemoteUrls, True)
        self.settings().clearMemoryCaches()

        self.__inspector_window = None

        shortcut = QShortcut(self)
        shortcut.setKey(Qt.Key_F12)
        shortcut.activated.connect(self.toggleInspector)
开发者ID:YingfangZhou,项目名称:ert,代码行数:17,代码来源:plot_panel.py

示例2: __Actions

# 需要导入模块: from PyQt4.QtGui import QShortcut [as 别名]
# 或者: from PyQt4.QtGui.QShortcut import setKey [as 别名]

#.........这里部分代码省略.........
            else:
                short = TabShortcuts(QKeySequence(Qt.ALT + key), self.ide, i)
            key += 1
            self.connect(short, SIGNAL("activated()"), self._change_tab_index)
        short = TabShortcuts(QKeySequence(Qt.ALT + Qt.Key_0), self.ide, 10)
        self.connect(short, SIGNAL("activated()"), self._change_tab_index)

        #Connect SIGNALs from other objects
        self.connect(self.ide.mainContainer._tabMain,
            SIGNAL("runFile()"), self.execute_file)
        self.connect(self.ide.mainContainer._tabSecondary,
            SIGNAL("runFile()"), self.execute_file)
        self.connect(self.ide.mainContainer._tabMain,
            SIGNAL("addToProject(QString)"), self._add_file_to_project)
        self.connect(self.ide.mainContainer._tabSecondary,
            SIGNAL("addToProject(QString)"), self._add_file_to_project)
        self.connect(self.ide.mainContainer,
            SIGNAL("openProject(QString)"), self.open_project)

        # Not Configurable Shortcuts
        self._shortEscStatus = QShortcut(QKeySequence(Qt.Key_Escape),
            self.ide.status)
        self._shortEscMisc = QShortcut(QKeySequence(Qt.Key_Escape),
            self.ide.misc)
        self.connect(self._shortEscStatus, SIGNAL("activated()"),
            self.ide.status.hide_status)
        self.connect(self._shortEscMisc, SIGNAL("activated()"),
            self.ide.misc.hide)

    def update_shortcuts(self):
        """If the user update the key binded to any shortcut, update them."""
        resources.load_shortcuts()
        short = resources.get_shortcut
        self.shortDuplicate.setKey(short("Duplicate"))
        self.shortRemove.setKey(short("Remove-line"))
        self.shortMoveUp.setKey(short("Move-up"))
        self.shortMoveDown.setKey(short("Move-down"))
        self.shortCloseTab.setKey(short("Close-tab"))
        self.shortNew.setKey(short("New-file"))
        self.shortNewProject.setKey(short("New-project"))
        self.shortOpen.setKey(short("Open-file"))
        self.shortOpenProject.setKey(short("Open-project"))
        self.shortSave.setKey(short("Save-file"))
        self.shortSaveProject.setKey(short("Save-project"))
        self.shortPrint.setKey(short("Print-file"))
        self.shortRedo.setKey(short("Redo"))
        self.shortComment.setKey(short("Comment"))
        self.shortHorizontalLine.setKey(short("Horizontal-line"))
        self.shortTitleComment.setKey(short("Title-comment"))
        self.shortIndentLess.setKey(short("Indent-less"))
        self.shortHideMisc.setKey(short("Hide-misc"))
        self.shortHideEditor.setKey(short("Hide-editor"))
        self.shortHideExplorer.setKey(short("Hide-explorer"))
        self.shortRunFile.setKey(short("Run-file"))
        self.shortRunProject.setKey(short("Run-project"))
        self.shortSwitchFocus.setKey(short("Switch-Focus"))
        self.shortStopExecution.setKey(short("Stop-execution"))
        self.shortHideAll.setKey(short("Hide-all"))
        self.shortFullscreen.setKey(short("Full-screen"))
        self.shortFind.setKey(short("Find"))
        self.shortFindNext.setKey(short("Find-next"))
        self.shortFindPrevious.setKey(short("Find-previous"))
        self.shortFindReplace.setKey(short("Find-replace"))
        self.shortFindWithWord.setKey(short("Find-with-word"))
        self.shortHelp.setKey(short("Help"))
        self.shortSplitHorizontal.setKey(short("Split-horizontal"))
开发者ID:SlashRoot,项目名称:ninja-ide,代码行数:70,代码来源:actions.py

示例3: __init__

# 需要导入模块: from PyQt4.QtGui import QShortcut [as 别名]
# 或者: from PyQt4.QtGui.QShortcut import setKey [as 别名]

#.........这里部分代码省略.........
                self, self.tr('Quit'), 'Ctrl+Q', None,
                self.tr('Quit'), self.close
                )
        edit_presetsAction = utils.create_action(
                self, self.tr('Edit Presets'), 'Ctrl+P', None,
                self.tr('Edit Presets'), self.open_dialog_presets
                )
        importAction = utils.create_action(
                self, self.tr('Import'), None, None,
                self.tr('Import presets'), self.import_presets
                )
        exportAction = utils.create_action(
                self, self.tr('Export'), None, None,
                self.tr('Export presets'), self.export_presets
                )
        resetAction = utils.create_action(
                self, self.tr('Reset'), None, None,
                self.tr('Reset presets'), self.reset_presets
                )
        syncAction = utils.create_action(
                self, self.tr('Synchronize'), None, None,
                self.tr('Synchronize presets'), self.sync_presets
                )
        removeoldAction = utils.create_action(
                self, self.tr('Remove old'), None, None,
                self.tr('Remove old presets'), self.removeold_presets
                )
        clearallAction = utils.create_action(
                self, self.tr('Clear All'), None, None,
                self.tr('Clear form'), self.clear_all
                )
        preferencesAction = utils.create_action(
                self, self.tr('Preferences'), 'Alt+Ctrl+P',
                None, self.tr('Preferences'), self.open_dialog_preferences
                )
        trackerAction = utils.create_action(
                self, 'Issue tracker', None, None, None,
                lambda: webbrowser.open(
                    "https://github.com/Ilias95/FF-Multi-Converter/issues")
                )
        wikiAction = utils.create_action(
                self, 'Wiki', None, None, None,
                lambda: webbrowser.open(
                    "https://github.com/Ilias95/FF-Multi-Converter/wiki")
                )
        ffmpegdocAction = utils.create_action(
                self, 'FFmpeg ' + self.tr('documentation'), None, None, None,
                lambda: webbrowser.open(
                    "https://www.ffmpeg.org/documentation.html")
                )
        imagemagickdocAction = utils.create_action(
                self, 'ImageMagick ' + self.tr('documentation'), None, None,
                None, lambda: webbrowser.open(
                    "http://www.imagemagick.org/script/convert.php")
                )
        aboutAction = utils.create_action(
                self, self.tr('About'), 'Ctrl+?', None,
                self.tr('About'), self.open_dialog_about
                )

        fileMenu = self.menuBar().addMenu(self.tr('File'))
        editMenu = self.menuBar().addMenu(self.tr('Edit'))
        presetsMenu = self.menuBar().addMenu(self.tr('Presets'))
        helpMenu = self.menuBar().addMenu(self.tr('Help'))

        utils.add_actions(
                fileMenu, [openAction, convertAction, None, quitAction])
        utils.add_actions(
                presetsMenu,
                [edit_presetsAction, importAction, exportAction, resetAction,
                 None, syncAction, removeoldAction]
                )
        utils.add_actions(editMenu, [clearallAction, None, preferencesAction])
        utils.add_actions(
                helpMenu,
                [trackerAction, wikiAction, None, ffmpegdocAction,
                imagemagickdocAction, None, aboutAction]
                )

        self.filesList.dropped.connect(self.add_files_dropped)
        addQPB.clicked.connect(self.add_files)
        delQPB.clicked.connect(self.delete_files)
        clearQPB.clicked.connect(self.clear_fileslist)
        self.tabWidget.currentChanged.connect(
                lambda: self.tabs[0].moreQPB.setChecked(False))
        self.origQCB.toggled.connect(
                lambda: self.toQLE.setEnabled(not self.origQCB.isChecked()))
        self.toQTB.clicked.connect(self.open_dir)
        convertQPB.clicked.connect(convertAction.triggered)

        del_shortcut = QShortcut(self)
        del_shortcut.setKey(Qt.Key_Delete)
        del_shortcut.activated.connect(self.delete_files)

        self.setWindowTitle('FF Multi Converter')

        QTimer.singleShot(0, self.check_for_dependencies)
        QTimer.singleShot(0, self.load_settings)
        QTimer.singleShot(0, self.audiovideo_tab.set_default_command)
        QTimer.singleShot(0, self.update_filesList)
开发者ID:Tidefan35967,项目名称:FF-Multi-Converter,代码行数:104,代码来源:ffmulticonverter.py

示例4: __init__

# 需要导入模块: from PyQt4.QtGui import QShortcut [as 别名]
# 或者: from PyQt4.QtGui.QShortcut import setKey [as 别名]

#.........这里部分代码省略.........
        self.deleteQCB = QCheckBox(self.tr('Delete original'))
        convertQPB = QPushButton(self.tr('&Convert'))

        hlayout3 = utils.add_to_layout('h', self.origQCB, self.deleteQCB, None)
        hlayout4 = utils.add_to_layout('h', None, convertQPB)
        final_layout = utils.add_to_layout(
                'v', hlayout1, self.tabWidget, hlayout2, hlayout3, hlayout4)

        self.dependenciesQL = QLabel()
        self.statusBar().addPermanentWidget(self.dependenciesQL, stretch=1)

        widget = QWidget()
        widget.setLayout(final_layout)
        self.setCentralWidget(widget)

        openAction = utils.create_action(
                self, self.tr('Open'), QKeySequence.Open, None,
                self.tr('Open a file'), self.add_files
                )
        convertAction = utils.create_action(
                self, self.tr('Convert'), 'Ctrl+C', None,
                self.tr('Convert files'), self.start_conversion
                )
        quitAction = utils.create_action(
                self, self.tr('Quit'), 'Ctrl+Q', None,
                self.tr('Quit'), self.close
                )
        edit_presetsAction = utils.create_action(
                self, self.tr('Edit Presets'), 'Ctrl+P', None,
                self.tr('Edit Presets'), self.presets
                )
        importAction = utils.create_action(
                self, self.tr('Import'), None, None,
                self.tr('Import presets'), self.import_presets
                )
        exportAction = utils.create_action(
                self, self.tr('Export'), None, None,
                self.tr('Export presets'), self.export_presets
                )
        resetAction = utils.create_action(
                self, self.tr('Reset'), None, None,
                self.tr('Reset presets'), self.reset_presets
                )
        syncAction = utils.create_action(
                self, self.tr('Synchronize'), None, None,
                self.tr('Synchronize presets'), self.sync_presets
                )
        removeoldAction = utils.create_action(
                self, self.tr('Remove old'), None, None,
                self.tr('Remove old presets'), self.removeold_presets
                )
        clearallAction = utils.create_action(
                self, self.tr('Clear All'), None, None,
                self.tr('Clear form'), self.clear_all
                )
        preferencesAction = utils.create_action(
                self, self.tr('Preferences'), 'Alt+Ctrl+P',
                None, self.tr('Preferences'), self.preferences
                )
        aboutAction = utils.create_action(
                self, self.tr('About'), 'Ctrl+?', None,
                self.tr('About'), self.about
                )

        fileMenu = self.menuBar().addMenu(self.tr('File'))
        editMenu = self.menuBar().addMenu(self.tr('Edit'))
        presetsMenu = self.menuBar().addMenu(self.tr('Presets'))
        helpMenu = self.menuBar().addMenu(self.tr('Help'))
        utils.add_actions(
                fileMenu, [openAction, convertAction, None, quitAction])
        utils.add_actions(
                presetsMenu,
                [edit_presetsAction, importAction, exportAction, resetAction,
                 None, syncAction, removeoldAction]
                )
        utils.add_actions(editMenu, [clearallAction, None, preferencesAction])
        utils.add_actions(helpMenu, [aboutAction])

        self.filesList.dropped.connect(self.url_dropped)
        addQPB.clicked.connect(self.add_files)
        delQPB.clicked.connect(self.delete_files)
        clearQPB.clicked.connect(self.clear_fileslist)
        self.tabWidget.currentChanged.connect(
                lambda: self.tabs[0].moreQPB.setChecked(False))
        self.origQCB.clicked.connect(
                lambda: self.toQLE.setEnabled(not self.origQCB.isChecked()))
        self.toQTB.clicked.connect(self.open_dir)
        convertQPB.clicked.connect(convertAction.triggered)

        del_shortcut = QShortcut(self)
        del_shortcut.setKey(Qt.Key_Delete)
        del_shortcut.activated.connect(self.delete_files)

        self.resize(self.main_width, self.main_height)
        self.setWindowTitle('FF Multi Converter')

        QTimer.singleShot(0, self.check_for_dependencies)
        QTimer.singleShot(0, self.load_settings)
        QTimer.singleShot(0, self.audiovideo_tab.set_default_command)
        QTimer.singleShot(0, self.update_filesList)
开发者ID:eldevil1,项目名称:FF-Multi-Converter,代码行数:104,代码来源:ffmulticonverter.py

示例5: __Actions

# 需要导入模块: from PyQt4.QtGui import QShortcut [as 别名]
# 或者: from PyQt4.QtGui.QShortcut import setKey [as 别名]

#.........这里部分代码省略.........
        self.connect(self.shortHighlightWord, SIGNAL("activated()"),
            self.editor_highlight_word)
        self.connect(self.shortChangeSplitFocus, SIGNAL("activated()"),
            self.ide.mainContainer.change_split_focus)

        key = Qt.Key_1
        for i in xrange(10):
            if sys.platform == "darwin":
                short = TabShortcuts(
                    QKeySequence(Qt.CTRL + Qt.ALT + key), self.ide, i)
            else:
                short = TabShortcuts(QKeySequence(Qt.ALT + key), self.ide, i)
            key += 1
            self.connect(short, SIGNAL("activated()"), self._change_tab_index)
        short = TabShortcuts(QKeySequence(Qt.ALT + Qt.Key_0), self.ide, 10)
        self.connect(short, SIGNAL("activated()"), self._change_tab_index)

        #Connect SIGNALs from other objects
        self.connect(self.ide.mainContainer._tabMain,
            SIGNAL("runFile()"), self.execute_file)
        self.connect(self.ide.mainContainer._tabSecondary,
            SIGNAL("runFile()"), self.execute_file)
        self.connect(self.ide.mainContainer._tabMain,
            SIGNAL("addToProject(QString)"), self._add_file_to_project)
        self.connect(self.ide.mainContainer._tabSecondary,
            SIGNAL("addToProject(QString)"), self._add_file_to_project)
        self.connect(self.ide.mainContainer,
            SIGNAL("openProject(QString)"), self.open_project)

    def update_shortcuts(self):
        """If the user update the key binded to any shortcut, update them."""
        resources.load_shortcuts()
        short = resources.get_shortcut
        self.shortDuplicate.setKey(short("Duplicate"))
        self.shortRemove.setKey(short("Remove-line"))
        self.shortMoveUp.setKey(short("Move-up"))
        self.shortMoveDown.setKey(short("Move-down"))
        self.shortCloseTab.setKey(short("Close-tab"))
        self.shortNew.setKey(short("New-file"))
        self.shortNewProject.setKey(short("New-project"))
        self.shortOpen.setKey(short("Open-file"))
        self.shortOpenProject.setKey(short("Open-project"))
        self.shortSave.setKey(short("Save-file"))
        self.shortSaveProject.setKey(short("Save-project"))
        self.shortPrint.setKey(short("Print-file"))
        self.shortRedo.setKey(short("Redo"))
        self.shortComment.setKey(short("Comment"))
        self.shortHorizontalLine.setKey(short("Horizontal-line"))
        self.shortTitleComment.setKey(short("Title-comment"))
        self.shortIndentLess.setKey(short("Indent-less"))
        self.shortHideMisc.setKey(short("Hide-misc"))
        self.shortHideEditor.setKey(short("Hide-editor"))
        self.shortHideExplorer.setKey(short("Hide-explorer"))
        self.shortRunFile.setKey(short("Run-file"))
        self.shortRunProject.setKey(short("Run-project"))
        self.shortSwitchFocus.setKey(short("Switch-Focus"))
        self.shortStopExecution.setKey(short("Stop-execution"))
        self.shortHideAll.setKey(short("Hide-all"))
        self.shortFullscreen.setKey(short("Full-screen"))
        self.shortFind.setKey(short("Find"))
        self.shortFindNext.setKey(short("Find-next"))
        self.shortFindPrevious.setKey(short("Find-previous"))
        self.shortFindReplace.setKey(short("Find-replace"))
        self.shortFindWithWord.setKey(short("Find-with-word"))
        self.shortHelp.setKey(short("Help"))
        self.shortSplitHorizontal.setKey(short("Split-horizontal"))
开发者ID:alekibango,项目名称:ninja-ide,代码行数:70,代码来源:actions.py

示例6: __init__

# 需要导入模块: from PyQt4.QtGui import QShortcut [as 别名]
# 或者: from PyQt4.QtGui.QShortcut import setKey [as 别名]

#.........这里部分代码省略.........
        self.toToolButton.setText('...')
        hlayout2 = pyqttools.add_to_layout(QHBoxLayout(), output_label,
                                           self.toLineEdit, self.toToolButton)

        self.audiovideo_tab = AudioVideoTab(self)
        self.image_tab = ImageTab(self)
        self.document_tab = DocumentTab(self)

        self.tabs = [self.audiovideo_tab, self.image_tab, self.document_tab]
        tab_names = [self.tr('Audio/Video'), self.tr('Images'),
                     self.tr('Documents')]
        self.TabWidget = QTabWidget()
        for num, tab in enumerate(tab_names):
            self.TabWidget.addTab(self.tabs[num], tab)
        self.TabWidget.setCurrentIndex(0)

        self.origCheckBox = QCheckBox(
                   self.tr('Save each file in the same\nfolder as input file'))
        self.deleteCheckBox = QCheckBox(self.tr('Delete original'))
        self.convertPushButton = QPushButton(self.tr('&Convert'))

        hlayout3 = pyqttools.add_to_layout(QHBoxLayout(), self.origCheckBox,
                                           self.deleteCheckBox, None)
        hlayout4 = pyqttools.add_to_layout(QHBoxLayout(), None,
                                          self.convertPushButton)
        final_layout = pyqttools.add_to_layout(QVBoxLayout(), hlayout1,
                                               self.TabWidget, hlayout2,
                                               hlayout3, hlayout4)

        self.statusBar = self.statusBar()
        self.dependenciesLabel = QLabel()
        self.statusBar.addPermanentWidget(self.dependenciesLabel, stretch=1)

        Widget = QWidget()
        Widget.setLayout(final_layout)
        self.setCentralWidget(Widget)

        c_act = pyqttools.create_action
        openAction = c_act(self, self.tr('Open'), QKeySequence.Open, None,
                           self.tr('Open a file'), self.add_files)
        convertAction = c_act(self, self.tr('Convert'), 'Ctrl+C', None,
                              self.tr('Convert files'), self.start_conversion)
        quitAction = c_act(self, self.tr('Quit'), 'Ctrl+Q', None,
                           self.tr('Quit'), self.close)
        edit_presetsAction = c_act(self, self.tr('Edit Presets'), 'Ctrl+P',
                                   None, self.tr('Edit Presets'), self.presets)
        importAction = c_act(self, self.tr('Import'), None, None,
                             self.tr('Import presets'), self.import_presets)
        exportAction = c_act(self, self.tr('Export'), None, None,
                             self.tr('Export presets'), self.export_presets)
        resetAction = c_act(self, self.tr('Reset'), None, None,
                            self.tr('Reset presets'), self.reset_presets)
        syncAction = c_act(self, self.tr('Synchronize'), None, None,
                                  self.tr('Synchronize presets'),
                                  self.sync_presets)
        removeoldAction = c_act(self, self.tr('Remove old'), None, None,
                                self.tr('Remove old presets'),
                                self.removeold_presets)
        clearallAction = c_act(self, self.tr('Clear All'), None, None,
                               self.tr('Clear form'), self.clear_all)
        preferencesAction = c_act(self, self.tr('Preferences'), 'Alt+Ctrl+P',
                                  None, self.tr('Preferences'), self.preferences)
        aboutAction = c_act(self, self.tr('About'), 'Ctrl+?', None,
                            self.tr('About'), self.about)

        fileMenu = self.menuBar().addMenu(self.tr('File'))
        editMenu = self.menuBar().addMenu(self.tr('Edit'))
        presetsMenu = self.menuBar().addMenu(self.tr('Presets'))
        helpMenu = self.menuBar().addMenu(self.tr('Help'))
        pyqttools.add_actions(fileMenu,
                              [openAction, convertAction, None, quitAction])
        pyqttools.add_actions(presetsMenu, [edit_presetsAction, importAction,
                                            exportAction, resetAction, None,
                                            syncAction, removeoldAction])
        pyqttools.add_actions(editMenu,
                              [clearallAction, None, preferencesAction])
        pyqttools.add_actions(helpMenu, [aboutAction])

        self.filesList.dropped.connect(self.url_dropped)
        addButton.clicked.connect(self.add_files)
        delButton.clicked.connect(self.delete_files)
        clearButton.clicked.connect(self.clear_fileslist)
        self.TabWidget.currentChanged.connect(lambda:
                                     self.tabs[0].moreButton.setChecked(False))
        self.origCheckBox.clicked.connect(lambda:
                 self.toLineEdit.setEnabled(not self.origCheckBox.isChecked()))
        self.toToolButton.clicked.connect(self.open_dir)
        self.convertPushButton.clicked.connect(convertAction.triggered)

        del_shortcut = QShortcut(self)
        del_shortcut.setKey(Qt.Key_Delete)
        del_shortcut.activated.connect(self.delete_files)

        self.resize(MAIN_WIDTH, MAIN_HEIGHT)
        self.setWindowTitle('FF Multi Converter')

        QTimer.singleShot(0, self.check_for_dependencies)
        QTimer.singleShot(0, self.load_settings)
        QTimer.singleShot(0, self.audiovideo_tab.set_default_command)
        QTimer.singleShot(0, self.update_filesList)
开发者ID:caohong,项目名称:FF-Multi-Converter,代码行数:104,代码来源:ffmulticonverter.py

示例7: __Actions

# 需要导入模块: from PyQt4.QtGui import QShortcut [as 别名]
# 或者: from PyQt4.QtGui.QShortcut import setKey [as 别名]

#.........这里部分代码省略.........
            self.ide.mainContainer.actualTab.change_tab)
        self.connect(self.shortChangeTabReverse, SIGNAL("activated()"),
            self.ide.mainContainer.actualTab.change_tab_reverse)
        self.connect(self.shortShowCodeNav, SIGNAL("activated()"),
            self.ide.mainContainer.actualTab.navigator._show_code_nav)
        self.connect(self.shortShowBookmarksNav, SIGNAL("activated()"),
            self.ide.mainContainer.actualTab.navigator._show_bookmarks)
        self.connect(self.shortShowBreakpointsNav, SIGNAL("activated()"),
            self.ide.mainContainer.actualTab.navigator._show_breakpoints)
        self.connect(self.shortAddBookmark, SIGNAL("activated()"),
            self._add_bookmark_breakpoint)
        self.connect(self.shortShowPasteHistory, SIGNAL("activated()"),
            self.ide.central.lateralPanel.combo.showPopup)
        self.connect(self.shortCopyHistory, SIGNAL("activated()"),
            self._copy_history)
        self.connect(self.shortPasteHistory, SIGNAL("activated()"),
            self._paste_history)

        #Connect SIGNALs from other objects
        self.connect(self.ide.mainContainer._tabMain,
            SIGNAL("runFile()"), self.execute_file)
        self.connect(self.ide.mainContainer._tabSecondary,
            SIGNAL("runFile()"), self.execute_file)
        self.connect(self.ide.mainContainer._tabMain,
            SIGNAL("addToProject(QString)"), self._add_file_to_project)
        self.connect(self.ide.mainContainer._tabSecondary,
            SIGNAL("addToProject(QString)"), self._add_file_to_project)
        self.connect(self.ide.mainContainer,
            SIGNAL("openProject(QString)"), self.open_project)

    def update_shortcuts(self):
        resources.load_shortcuts()
        short = resources.get_shortcut
        self.shortDuplicate.setKey(short("Duplicate"))
        self.shortRemove.setKey(short("Remove-line"))
        self.shortMoveUp.setKey(short("Move-up"))
        self.shortMoveDown.setKey(short("Move-down"))
        self.shortCloseTab.setKey(short("Close-tab"))
        self.shortNew.setKey(short("New-file"))
        self.shortNewProject.setKey(short("New-project"))
        self.shortOpen.setKey(short("Open-file"))
        self.shortOpenProject.setKey(short("Open-project"))
        self.shortSave.setKey(short("Save-file"))
        self.shortSaveProject.setKey(short("Save-project"))
        self.shortPrint.setKey(short("Print-file"))
        self.shortRedo.setKey(short("Redo"))
        self.shortComment.setKey(short("Comment"))
        self.shortHorizontalLine.setKey(short("Horizontal-line"))
        self.shortTitleComment.setKey(short("Title-comment"))
        self.shortIndentLess.setKey(short("Indent-less"))
        self.shortHideMisc.setKey(short("Hide-misc"))
        self.shortHideEditor.setKey(short("Hide-editor"))
        self.shortHideExplorer.setKey(short("Hide-explorer"))
        self.shortRunFile.setKey(short("Run-file"))
        self.shortRunProject.setKey(short("Run-project"))
        self.shortStopExecution.setKey(short("Stop-execution"))
        self.shortHideAll.setKey(short("Hide-all"))
        self.shortFullscreen.setKey(short("Full-screen"))
        self.shortFind.setKey(short("Find"))
        self.shortFindReplace.setKey(short("Find-replace"))
        self.shortFindWithWord.setKey(short("Find-with-word"))
        self.shortHelp.setKey(short("Help"))
        self.shortSplitHorizontal.setKey(short("Split-horizontal"))
        self.shortSplitVertical.setKey(short("Split-vertical"))
        self.shortFollowMode.setKey(short("Follow-mode"))
        self.shortReloadFile.setKey(short("Reload-file"))
开发者ID:sanyaade,项目名称:ninja-ide,代码行数:70,代码来源:actions.py

示例8: __init__

# 需要导入模块: from PyQt4.QtGui import QShortcut [as 别名]
# 或者: from PyQt4.QtGui.QShortcut import setKey [as 别名]
    def __init__(self, parent=None):
        super(ShowPresets, self).__init__(parent)

        self.original_presets_file = config.find_presets_file(
                config.presets_file_name)
        self.current_presets_file = config.presets_file

        self.presQLW = QListWidget()
        labelQL = QLabel(self.tr('Preset label'))
        self.labelQLE = QLineEdit()
        self.labelQLE.setReadOnly(True)
        commandQL = QLabel(self.tr('Preset command line parameters'))
        self.commandQLE = QLineEdit()
        self.commandQLE.setReadOnly(True)
        extQL = QLabel(self.tr('Output file extension'))
        self.extQLE = QLineEdit()
        self.extQLE.setReadOnly(True)
        addQPB = QPushButton(self.tr('Add'))
        self.deleteQPB = QPushButton(self.tr('Delete'))
        self.delete_allQPB = QPushButton(self.tr('Delete all'))
        self.editQPB = QPushButton(self.tr('Edit'))
        searchQL = QLabel(self.tr('Search'))
        self.searchQLE = QLineEdit()
        okQPB = QPushButton(self.tr('OK'))
        okQPB.setDefault(True)

        spc1 = QSpacerItem(40, 20, QSizePolicy.Expanding, QSizePolicy.Minimum)
        spc2 = QSpacerItem(40, 20, QSizePolicy.Expanding, QSizePolicy.Minimum)
        spc3 = QSpacerItem(40, 20, QSizePolicy.Expanding, QSizePolicy.Minimum)

        grid = utils.add_to_grid(
                [self.delete_allQPB, addQPB, spc1],
                [self.deleteQPB, self.editQPB, spc2]
                )

        hlayout = utils.add_to_layout(
                'h', searchQL, self.searchQLE, None, okQPB)

        final_layout = utils.add_to_layout(
                'v', self.presQLW, labelQL, self.labelQLE, commandQL,
                self.commandQLE, extQL, self.extQLE, grid, spc3, hlayout
                )

        self.setLayout(final_layout)

        okQPB.clicked.connect(self.accept)
        self.presQLW.currentRowChanged.connect(self.show_preset)
        addQPB.clicked.connect(self.add_preset)
        self.deleteQPB.clicked.connect(self.delete_preset)
        self.delete_allQPB.clicked.connect(self.delete_all_presets)
        self.editQPB.clicked.connect(self.edit_preset)
        self.searchQLE.textEdited.connect(self.search)

        del_shortcut = QShortcut(self)
        del_shortcut.setKey(Qt.Key_Delete)
        del_shortcut.activated.connect(self.delete_preset)

        self.resize(430, 480)
        self.setWindowTitle(self.tr('Edit Presets'))

        QTimer.singleShot(0, self.load_xml)
        QTimer.singleShot(0, self.fill_presQLW)
开发者ID:eldevil1,项目名称:FF-Multi-Converter,代码行数:64,代码来源:presets_dlgs.py

示例9: __init__

# 需要导入模块: from PyQt4.QtGui import QShortcut [as 别名]
# 或者: from PyQt4.QtGui.QShortcut import setKey [as 别名]
    def __init__(self, parent=None, choose=False):
        super(ShowPresets, self).__init__(parent)

        self.original_presets_file = utils.find_presets_file(
            config.presets_file_name, config.presets_lookup_dirs, config.presets_lookup_virtenv
        )
        self.current_presets_file = config.presets_file

        self.presQLW = QListWidget()
        labelQL = QLabel(self.tr("Preset label"))
        self.labelQLE = QLineEdit()
        self.labelQLE.setReadOnly(True)
        commandQL = QLabel(self.tr("Preset command line parameters"))
        self.commandQLE = QLineEdit()
        self.commandQLE.setReadOnly(True)
        extQL = QLabel(self.tr("Output file extension"))
        self.extQLE = QLineEdit()
        self.extQLE.setReadOnly(True)
        addQPB = QPushButton(self.tr("Add"))
        self.deleteQPB = QPushButton(self.tr("Delete"))
        self.delete_allQPB = QPushButton(self.tr("Delete all"))
        self.editQPB = QPushButton(self.tr("Edit"))
        searchQL = QLabel(self.tr("Search"))
        self.searchQLE = QLineEdit()
        okQPB = QPushButton(self.tr("OK"))
        okQPB.setDefault(True)

        spc1 = QSpacerItem(40, 20, QSizePolicy.Expanding, QSizePolicy.Minimum)
        spc2 = QSpacerItem(40, 20, QSizePolicy.Expanding, QSizePolicy.Minimum)
        spc3 = QSpacerItem(40, 20, QSizePolicy.Expanding, QSizePolicy.Minimum)

        grid = utils.add_to_grid([self.delete_allQPB, addQPB, spc1], [self.deleteQPB, self.editQPB, spc2])

        hlayout = utils.add_to_layout("h", searchQL, self.searchQLE, None, okQPB)

        final_layout = utils.add_to_layout(
            "v",
            self.presQLW,
            labelQL,
            self.labelQLE,
            commandQL,
            self.commandQLE,
            extQL,
            self.extQLE,
            grid,
            spc3,
            hlayout,
        )

        self.setLayout(final_layout)

        okQPB.clicked.connect(self.accept)
        self.presQLW.currentRowChanged.connect(self.show_preset)
        addQPB.clicked.connect(self.add_preset)
        self.deleteQPB.clicked.connect(self.delete_preset)
        self.delete_allQPB.clicked.connect(self.delete_all_presets)
        self.editQPB.clicked.connect(self.edit_preset)
        self.searchQLE.textEdited.connect(self.search)
        if choose:
            self.presQLW.doubleClicked.connect(okQPB.click)

        del_shortcut = QShortcut(self)
        del_shortcut.setKey(Qt.Key_Delete)
        del_shortcut.activated.connect(self.delete_preset)

        self.resize(430, 480)
        self.setWindowTitle(self.tr("Edit Presets"))

        QTimer.singleShot(0, self.load_xml)
        QTimer.singleShot(0, self.fill_presQLW)
开发者ID:houzhenggang,项目名称:FF-Multi-Converter,代码行数:72,代码来源:presets_dlgs.py

示例10: __init__

# 需要导入模块: from PyQt4.QtGui import QShortcut [as 别名]
# 或者: from PyQt4.QtGui.QShortcut import setKey [as 别名]
    def __init__(self, parent=None):
        super(ShowPresets, self).__init__(parent)
        self.original_presets_file = '/usr/share/ffmulticonverter/presets.xml'
        self.config_folder = os.getenv('HOME') + '/.config/ffmulticonverter/'
        self.current_presets_file = self.config_folder + 'presets.xml'

        self.presListWidget = QListWidget()
        labelLabel = QLabel(self.tr('Preset label'))
        self.labelLineEdit = QLineEdit()
        self.labelLineEdit.setReadOnly(True)
        commandLabel = QLabel(self.tr('Preset command line parameters'))
        self.commandLineEdit = QLineEdit()
        self.commandLineEdit.setReadOnly(True)
        extLabel = QLabel(self.tr('Output file extension'))
        self.extLineEdit = QLineEdit()
        self.extLineEdit.setReadOnly(True)
        addButton = QPushButton(self.tr('Add'))
        self.deleteButton = QPushButton(self.tr('Delete'))
        self.delete_allButton = QPushButton(self.tr('Delete all'))
        self.editButton = QPushButton(self.tr('Edit'))
        searchLabel = QLabel(self.tr('Search'))
        self.searchLineEdit = QLineEdit()
        okButton = QPushButton(self.tr('OK'))
        okButton.setDefault(True)

        spc1 = QSpacerItem(40, 20, QSizePolicy.Expanding, QSizePolicy.Minimum)
        spc2 = QSpacerItem(40, 20, QSizePolicy.Expanding, QSizePolicy.Minimum)
        spc3 = QSpacerItem(40, 20, QSizePolicy.Expanding, QSizePolicy.Minimum)

        grid = pyqttools.add_to_grid(QGridLayout(),
                          [self.delete_allButton, addButton, spc1],
                          [self.deleteButton, self.editButton, spc2])

        hlayout = pyqttools.add_to_layout(QHBoxLayout(), searchLabel,
                                          self.searchLineEdit, None, okButton)

        final_layout = pyqttools.add_to_layout(QVBoxLayout(),
                                               self.presListWidget, labelLabel,
                                               self.labelLineEdit, commandLabel,
                                               self.commandLineEdit, extLabel,
                                               self.extLineEdit, grid, spc3,
                                               hlayout)

        self.setLayout(final_layout)

        okButton.clicked.connect(self.accept)
        self.presListWidget.currentRowChanged.connect(self.show_preset)
        addButton.clicked.connect(self.add_preset)
        self.deleteButton.clicked.connect(self.delete_preset)
        self.delete_allButton.clicked.connect(self.delete_all_presets)
        self.editButton.clicked.connect(self.edit_preset)
        self.searchLineEdit.textEdited.connect(self.search)

        del_shortcut = QShortcut(self)
        del_shortcut.setKey(Qt.Key_Delete)
        del_shortcut.activated.connect(self.delete_preset)

        self.resize(430, 480)
        self.setWindowTitle(self.tr('Edit Presets'))

        QTimer.singleShot(0, self.load_xml)
        QTimer.singleShot(0, self.fill_presListWidget)
开发者ID:caohong,项目名称:FF-Multi-Converter,代码行数:64,代码来源:presets_dlgs.py


注:本文中的PyQt4.QtGui.QShortcut.setKey方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。