本文整理汇总了Python中ninja_ide.gui.ide.IDE.register_service方法的典型用法代码示例。如果您正苦于以下问题:Python IDE.register_service方法的具体用法?Python IDE.register_service怎么用?Python IDE.register_service使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ninja_ide.gui.ide.IDE
的用法示例。
在下文中一共展示了IDE.register_service方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from ninja_ide.gui.ide import IDE [as 别名]
# 或者: from ninja_ide.gui.ide.IDE import register_service [as 别名]
def __init__(self, parent=None):
super().__init__(parent)
# Register signals connections
layout = QHBoxLayout(self)
layout.setContentsMargins(0, 0, 0, 0)
layout.setSpacing(0)
self.__buttons = []
self.__action_number = 1
self.__buttons_visibility = {}
self.__current_widget = None
self.__last_index = -1
self._stack_widgets = QStackedWidget()
layout.addWidget(self._stack_widgets)
# Buttons Widget
self.buttons_widget = QWidget()
self.buttons_widget.setObjectName("tools_dock")
self.buttons_widget.setFixedHeight(26)
self.buttons_widget.setLayout(QHBoxLayout())
self.buttons_widget.layout().setContentsMargins(2, 2, 5, 2)
self.buttons_widget.layout().setSpacing(10)
IDE.register_service("tools_dock", self)
_ToolsDock.__created = True
示例2: __init__
# 需要导入模块: from ninja_ide.gui.ide import IDE [as 别名]
# 或者: from ninja_ide.gui.ide.IDE import register_service [as 别名]
def __init__(self):
QTreeWidget.__init__(self)
self.header().setHidden(True)
self.setSelectionMode(self.SingleSelection)
self.setAnimated(True)
self.header().setHorizontalScrollMode(QAbstractItemView.ScrollPerPixel)
self.header().setResizeMode(0, QHeaderView.ResizeToContents)
self.header().setStretchLastSection(False)
self.actualSymbols = ('', {})
self.docstrings = {}
self.collapsedItems = {}
self.connect(self, SIGNAL("itemClicked(QTreeWidgetItem *, int)"),
self._go_to_definition)
self.connect(self, SIGNAL("itemActivated(QTreeWidgetItem *, int)"),
self._go_to_definition)
self.setContextMenuPolicy(Qt.CustomContextMenu)
self.connect(self,
SIGNAL("customContextMenuRequested(const QPoint &)"),
self._menu_context_tree)
self.connect(self, SIGNAL("itemCollapsed(QTreeWidgetItem *)"),
self._item_collapsed)
self.connect(self, SIGNAL("itemExpanded(QTreeWidgetItem *)"),
self._item_expanded)
IDE.register_service('symbols_explorer', self)
ExplorerContainer.register_tab(translations.TR_TAB_SYMBOLS, self)
示例3: __init__
# 需要导入模块: from ninja_ide.gui.ide import IDE [as 别名]
# 或者: from ninja_ide.gui.ide.IDE import register_service [as 别名]
def __init__(self, parent=None):
super(ProjectTreeColumn, self).__init__(parent,
Qt.WindowStaysOnTopHint)
vbox = QVBoxLayout(self)
vbox.setSizeConstraint(QVBoxLayout.SetDefaultConstraint)
vbox.setContentsMargins(0, 0, 0, 0)
self._buttons = []
self._combo_project = QComboBox()
self._combo_project.setMinimumHeight(30)
self._combo_project.setContextMenuPolicy(Qt.CustomContextMenu)
vbox.addWidget(self._combo_project)
self._projects_area = QStackedLayout()
logger.debug("This is the projects area")
logger.debug(self._projects_area)
vbox.addLayout(self._projects_area)
self.projects = []
self._combo_project.currentIndexChanged[int].connect(self._change_current_project)
self._combo_project.customContextMenuRequested['const QPoint &'].connect(self.context_menu_for_root)
connections = (
{'target': 'main_container',
'signal_name': 'addToProject',#(QString)
'slot': self._add_file_to_project},
{'target': 'main_container',
'signal_name': 'showFileInExplorer',#(QString)
'slot': self._show_file_in_explorer},
)
IDE.register_service('projects_explorer', self)
IDE.register_signals('projects_explorer', connections)
ExplorerContainer.register_tab(translations.TR_TAB_PROJECTS, self)
示例4: __init__
# 需要导入模块: from ninja_ide.gui.ide import IDE [as 别名]
# 或者: from ninja_ide.gui.ide.IDE import register_service [as 别名]
def __init__(self, parent=None):
super(CentralWidget, self).__init__(parent)
self.parent = parent
#This variables are used to save the splitter sizes before hide
self._splitterBaseSizes = None
self._splitterInsideSizes = None
self.lateralPanel = LateralPanel()
self._add_functions = {
"central": self._insert_widget_region0,
"lateral": self._insert_widget_region1,
}
self._items = {}
hbox = QHBoxLayout(self)
hbox.setContentsMargins(0, 0, 0, 0)
hbox.setSpacing(0)
#Create Splitters to divide the UI 3 regions
self._splitterBase = dynamic_splitter.DynamicSplitter(Qt.Horizontal)
self._splitterInside = dynamic_splitter.DynamicSplitter(Qt.Vertical)
self._splitterBase.addWidget(self._splitterInside)
#Add to Main Layout
hbox.addWidget(self._splitterBase)
connects = (
{"target": "main_container",
"signal_name": "cursorPositionChange(int, int)",
"slot": self.update_column_number},
)
IDE.register_service('central_container', self)
IDE.register_signals("central_container", connects)
示例5: __init__
# 需要导入模块: from ninja_ide.gui.ide import IDE [as 别名]
# 或者: from ninja_ide.gui.ide.IDE import register_service [as 别名]
def __init__(self, parent=None):
super(CentralWidget, self).__init__(parent)
self.parent = parent
main_container = QHBoxLayout(self)
main_container.setContentsMargins(0, 0, 0, 0)
main_container.setSpacing(0)
# This variables are used to save the spliiter sizes
self.lateral_panel = LateralPanel()
self._add_functions = {
"central": self._insert_widget_inside,
"lateral": self._insert_widget_base
}
self._items = {}
# Toolbar
self._toolbar = ntoolbar.NToolBar(self)
main_container.addWidget(self._toolbar)
# Create Splitters to divide the UI 3 regions
self._splitter_base = dynamic_splitter.DynamicSplitter(Qt.Horizontal)
self._splitter_inside = dynamic_splitter.DynamicSplitter(Qt.Vertical)
self._splitter_base.addWidget(self._splitter_inside)
vbox = QVBoxLayout()
vbox.setContentsMargins(0, 0, 0, 0)
vbox.setSpacing(0)
vbox.addWidget(self._splitter_base)
tools_dock = IDE.get_service("tools_dock")
vbox.addWidget(tools_dock.buttons_widget)
main_container.addLayout(vbox)
# main_container.addWidget(self._splitter_base)
IDE.register_service("central_container", self)
示例6: __init__
# 需要导入模块: from ninja_ide.gui.ide import IDE [as 别名]
# 或者: from ninja_ide.gui.ide.IDE import register_service [as 别名]
def __init__(self, parent=None):
super(_ToolsDock, self).__init__(parent)
#Register signals connections
connections = (
{'target': 'main_container',
'signal_name': "findOcurrences(QString)",
'slot': self.show_find_occurrences},
{'target': 'main_container',
'signal_name': "updateFileMetadata()",
'slot': self.show_find_occurrences},
{'target': 'main_container',
'signal_name': "findOcurrences(QString)",
'slot': self.show_find_occurrences},
{'target': 'main_container',
'signal_name': "runFile(QString)",
'slot': self.execute_file},
{'target': 'explorer_container',
'signal_name': "removeProjectFromConsole(QString)",
'slot': self.remove_project_from_console},
{'target': 'explorer_container',
'signal_name': "addProjectToConsole(QString)",
'slot': self.add_project_to_console},
)
IDE.register_signals('tools_dock', connections)
IDE.register_service("tools_dock", self)
示例7: __init__
# 需要导入模块: from ninja_ide.gui.ide import IDE [as 别名]
# 或者: from ninja_ide.gui.ide.IDE import register_service [as 别名]
def __init__(self):
super().__init__()
self.current_status = _STATUSBAR_STATE_SEARCH
vbox = QVBoxLayout(self)
title = QLabel(translations.TR_SEARCH_TITLE)
font = title.font()
font.setPointSize(9)
title.setFont(font)
vbox.addWidget(title)
spacing = 3
if settings.IS_MAC_OS:
spacing = 0
vbox.setSpacing(spacing)
# Search Layout
self._search_widget = SearchWidget()
vbox.addWidget(self._search_widget)
# Replace Layout
self._replace_widget = ReplaceWidget()
self._replace_widget.hide()
vbox.addWidget(self._replace_widget)
# Not configurable shortcuts
short_esc_status = QShortcut(QKeySequence(Qt.Key_Escape), self)
short_esc_status.activated.connect(self.hide_status_bar)
IDE.register_service("status_bar", self)
示例8: __init__
# 需要导入模块: from ninja_ide.gui.ide import IDE [as 别名]
# 或者: from ninja_ide.gui.ide.IDE import register_service [as 别名]
def __init__(self, parent=None):
super(TreeSymbolsWidget, self).__init__(parent,
Qt.WindowStaysOnTopHint)
vbox = QVBoxLayout(self)
vbox.setContentsMargins(0, 0, 0, 0)
vbox.setSpacing(0)
self.tree = QTreeWidget()
vbox.addWidget(self.tree)
self.tree.header().setHidden(True)
self.tree.setSelectionMode(self.tree.SingleSelection)
self.tree.setAnimated(True)
self.tree.header().setHorizontalScrollMode(
QAbstractItemView.ScrollPerPixel)
self.tree.header().setResizeMode(0, QHeaderView.ResizeToContents)
self.tree.header().setStretchLastSection(False)
self.actualSymbols = ('', {})
self.docstrings = {}
self.collapsedItems = {}
self.connect(self, SIGNAL("itemClicked(QTreeWidgetItem *, int)"),
self._go_to_definition)
self.connect(self, SIGNAL("itemActivated(QTreeWidgetItem *, int)"),
self._go_to_definition)
self.tree.setContextMenuPolicy(Qt.CustomContextMenu)
self.connect(self,
SIGNAL("customContextMenuRequested(const QPoint &)"),
self._menu_context_tree)
self.connect(self, SIGNAL("itemCollapsed(QTreeWidgetItem *)"),
self._item_collapsed)
self.connect(self, SIGNAL("itemExpanded(QTreeWidgetItem *)"),
self._item_expanded)
IDE.register_service('symbols_explorer', self)
ExplorerContainer.register_tab(translations.TR_TAB_SYMBOLS, self)
示例9: __init__
# 需要导入模块: from ninja_ide.gui.ide import IDE [as 别名]
# 或者: from ninja_ide.gui.ide.IDE import register_service [as 别名]
def __init__(self, parent=None):
super(MigrationWidget, self).__init__(parent, Qt.WindowStaysOnTopHint)
self._migration = {}
vbox = QVBoxLayout(self)
lbl_title = QLabel(self.tr("Current code:"))
self.current_list = QListWidget()
lbl_suggestion = QLabel(self.tr("Suggested changes:"))
self.suggestion = QPlainTextEdit()
self.suggestion.setReadOnly(True)
self.btn_apply = QPushButton(self.tr("Apply change!"))
hbox = QHBoxLayout()
hbox.addSpacerItem(QSpacerItem(1, 0, QSizePolicy.Expanding))
hbox.addWidget(self.btn_apply)
vbox.addWidget(lbl_title)
vbox.addWidget(self.current_list)
vbox.addWidget(lbl_suggestion)
vbox.addWidget(self.suggestion)
vbox.addLayout(hbox)
self.connect(self.current_list,
SIGNAL("itemClicked(QListWidgetItem*)"), self.load_suggestion)
self.connect(self.btn_apply, SIGNAL("clicked()"), self.apply_changes)
IDE.register_service('tab_migration', self)
ExplorerContainer.register_tab(translations.TR_TAB_MIGRATION, self)
示例10: __init__
# 需要导入模块: from ninja_ide.gui.ide import IDE [as 别名]
# 或者: from ninja_ide.gui.ide.IDE import register_service [as 别名]
def __init__(self, parent=None):
super(ExplorerContainer, self).__init__(Qt.Vertical, parent)
self.create_tab_widget()
IDE.register_service('explorer_container', self)
connections = (
{'target': 'central_container',
'signal_name': "splitterBaseRotated()",
'slot': self.rotate_tab_position},
{'target': 'central_container',
'signal_name': 'splitterBaseRotated()',
'slot': self.rotate_tab_position},
)
self._point = None
self._widget_index = 0
self.menu = QMenu()
self.actionSplit = self.menu.addAction(translations.TR_SPLIT_TAB)
self.connect(
self.actionSplit, SIGNAL("triggered()"), self._split_widget)
self.actionUndock = self.menu.addAction(translations.TR_UNDOCK)
self.connect(
self.actionUndock, SIGNAL("triggered()"), self._undock_widget)
self.actionCloseSplit = self.menu.addAction(translations.TR_CLOSE_SPLIT)
self.connect(
self.actionCloseSplit, SIGNAL("triggered()"), self._close_split)
self.menuMoveToSplit = self.menu.addMenu(translations.TR_MOVE_TO_SPLIT)
IDE.register_signals('explorer_container', connections)
self.__created = True
示例11: __init__
# 需要导入模块: from ninja_ide.gui.ide import IDE [as 别名]
# 或者: from ninja_ide.gui.ide.IDE import register_service [as 别名]
def __init__(self, parent=None):
super(CentralWidget, self).__init__(parent)
self.parent = parent
#This variables are used to save the splitter sizes before hide
self.lateralPanel = LateralPanel()
self._add_functions = {
"central": self._insert_widget_inside,
"lateral": self._insert_widget_base,
}
self._items = {}
hbox = QHBoxLayout(self)
hbox.setContentsMargins(0, 0, 0, 0)
hbox.setSpacing(0)
#Create Splitters to divide the UI 3 regions
self._splitterBase = dynamic_splitter.DynamicSplitter(Qt.Horizontal)
self._splitterBase.setOpaqueResize(True)
self._splitterInside = dynamic_splitter.DynamicSplitter(Qt.Vertical)
self._splitterInside.setOpaqueResize(True)
self._splitterBase.addWidget(self._splitterInside)
#Add to Main Layout
hbox.addWidget(self._splitterBase)
IDE.register_service('central_container', self)
示例12: __init__
# 需要导入模块: from ninja_ide.gui.ide import IDE [as 别名]
# 或者: from ninja_ide.gui.ide.IDE import register_service [as 别名]
def __init__(self, parent=None):
super(MigrationWidget, self).__init__(parent, Qt.WindowStaysOnTopHint)
self._migration, vbox, hbox = {}, QVBoxLayout(self), QHBoxLayout()
lbl_title = QLabel(translations.TR_CURRENT_CODE)
lbl_suggestion = QLabel(translations.TR_SUGGESTED_CHANGES)
self.current_list, self.suggestion = QListWidget(), QPlainTextEdit()
self.suggestion.setReadOnly(True)
self.btn_apply = QPushButton(translations.TR_APPLY_CHANGES + " !")
self.suggestion.setToolTip(translations.TR_SAVE_BEFORE_APPLY + " !")
self.btn_apply.setToolTip(translations.TR_SAVE_BEFORE_APPLY + " !")
# pack up all widgets
hbox.addSpacerItem(QSpacerItem(1, 0, QSizePolicy.Expanding))
hbox.addWidget(self.btn_apply)
vbox.addWidget(lbl_title)
vbox.addWidget(self.current_list)
vbox.addWidget(lbl_suggestion)
vbox.addWidget(self.suggestion)
vbox.addLayout(hbox)
# connections
self.connect(
self.current_list, SIGNAL("itemClicked(QListWidgetItem*)"),
self.load_suggestion)
self.connect(self.btn_apply, SIGNAL("clicked()"), self.apply_changes)
# registers
IDE.register_service('tab_migration', self)
ExplorerContainer.register_tab(translations.TR_TAB_MIGRATION, self)
示例13: __init__
# 需要导入模块: from ninja_ide.gui.ide import IDE [as 别名]
# 或者: from ninja_ide.gui.ide.IDE import register_service [as 别名]
def __init__(self):
QObject.__init__(self)
self.__providers = {}
self.__thread = None
# self._main_container = IDE.get_service("main_container")
# Register service
IDE.register_service("intellisense", self)
示例14: __init__
# 需要导入模块: from ninja_ide.gui.ide import IDE [as 别名]
# 或者: from ninja_ide.gui.ide.IDE import register_service [as 别名]
def __init__(self, parent=None):
super(_MainContainer, self).__init__(parent)
self._parent = parent
self.stack = QStackedLayout(self)
self.stack.setStackingMode(QStackedLayout.StackAll)
self.splitter = dynamic_splitter.DynamicSplitter()
self.setAcceptDrops(True)
self.tabs_handler = tabs_handler.TabsHandler(self)
#documentation browser
self.docPage = None
#Code Navigation
self._locator = locator.GoToDefinition()
self.__codeBack = []
self.__codeForward = []
self.__bookmarksFile = ''
self.__bookmarksPos = -1
self.__breakpointsFile = ''
self.__breakpointsPos = -1
self.__operations = {
0: self._navigate_code_jumps,
1: self._navigate_bookmarks,
2: self._navigate_breakpoints}
self.connect(self, SIGNAL("locateFunction(QString, QString, bool)"),
self.locate_function)
IDE.register_service('main_container', self)
#Register signals connections
connections = (
{'target': 'menu_file',
'signal_name': 'openFile(QString)',
'slot': self.open_file},
{'target': 'explorer_container',
'signal_name': 'goToDefinition(int)',
'slot': self.editor_go_to_line},
{'target': 'explorer_container',
'signal_name': 'pep8Activated(bool)',
'slot': self.reset_pep8_warnings},
{'target': 'explorer_container',
'signal_name': 'lintActivated(bool)',
'slot': self.reset_lint_warnings},
)
IDE.register_signals('main_container', connections)
self.selector = main_selector.MainSelector(self)
self.add_widget(self.selector)
if settings.SHOW_START_PAGE:
self.show_start_page()
self.connect(self.selector, SIGNAL("changeCurrent(int)"),
self._change_current_stack)
self.connect(self.selector, SIGNAL("ready()"),
self._selector_ready)
示例15: __init__
# 需要导入模块: from ninja_ide.gui.ide import IDE [as 别名]
# 或者: from ninja_ide.gui.ide.IDE import register_service [as 别名]
def __init__(self):
super(_StatusBar, self).__init__()
self._widgetStatus = QWidget()
vbox = QVBoxLayout(self._widgetStatus)
vbox.setContentsMargins(0, 0, 0, 0)
vbox.setSpacing(0)
#Search Layout
self._searchWidget = SearchWidget(self)
vbox.addWidget(self._searchWidget)
#Replace Layout
self._replaceWidget = ReplaceWidget(self)
vbox.addWidget(self._replaceWidget)
self._replaceWidget.setVisible(False)
#Code Locator
self._codeLocator = locator.CodeLocatorWidget(self)
vbox.addWidget(self._codeLocator)
self._codeLocator.setVisible(False)
#File system completer
self._fileSystemOpener = FileSystemOpener()
vbox.addWidget(self._fileSystemOpener)
self._fileSystemOpener.setVisible(False)
self.addWidget(self._widgetStatus)
# Not Configurable Shortcuts
shortEscStatus = QShortcut(QKeySequence(Qt.Key_Escape), self)
self.connect(self, SIGNAL("messageChanged(QString)"), self.message_end)
self.connect(self._replaceWidget._btnCloseReplace, SIGNAL("clicked()"),
lambda: self._replaceWidget.setVisible(False))
self.connect(self._replaceWidget._btnReplace, SIGNAL("clicked()"),
self.replace)
self.connect(self._replaceWidget._btnReplaceAll, SIGNAL("clicked()"),
self.replace_all)
self.connect(self._replaceWidget._btnReplaceSelection,
SIGNAL("clicked()"), self.replace_selected)
self.connect(self._fileSystemOpener.btnClose, SIGNAL("clicked()"),
self.hide_status)
self.connect(self._fileSystemOpener, SIGNAL("requestHide()"),
self.hide_status)
self.connect(shortEscStatus, SIGNAL("activated()"), self.hide_status)
IDE.register_service('status_bar', self)
#Register signals connections
connections = (
{'target': 'main_container',
'signal_name': 'currentEditorChanged(QString)',
'slot': self.handle_tab_changed},
{'target': 'main_container',
'signal_name': 'updateLocator(QString)',
'slot': self.explore_file_code},
{'target': 'explorer_container',
'signal_name': 'updateLocator()',
'slot': self.explore_code},
)
IDE.register_signals('status_bar', connections)