Пример #1
0
    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)
Пример #2
0
    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)
Пример #3
0
    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)
    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)
Пример #5
0
    def __init__(self, parent=None):
        super(ExplorerContainer, self).__init__(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.menu = QMenu()
        actionUndock = self.menu.addAction(translations.TR_UNDOCK)
        self.connect(actionUndock, SIGNAL("activated()"), self._undock_widget)

        IDE.register_signals('explorer_container', connections)
        self.__created = True
Пример #6
0
    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)
Пример #7
0
 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()",
         '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)
Пример #8
0
 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)
Пример #9
0
 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)
Пример #10
0
    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)
Пример #11
0
 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)
Пример #12
0
    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)
Пример #13
0
    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)
Пример #14
0
    def __init__(self):
        QObject.__init__(self)
        self.__providers = {}
        self.__thread = None

        # Register service
        IDE.register_service("intellisense", self)
Пример #15
0
    def __init__(self, parent=None):
        super().__init__(parent, Qt.WindowStaysOnTopHint)
        box = QVBoxLayout(self)
        box.setContentsMargins(0, 0, 0, 0)
        box.setSpacing(0)
        # PEP8
        self._list_pep8 = QListWidget()
        self._list_pep8.setWordWrap(True)
        self._list_pep8.setSortingEnabled(True)
        hbox = QHBoxLayout()
        hbox.setContentsMargins(5, 3, 5, 3)
        if settings.CHECK_STYLE:
            self._btn_pep8 = QPushButton("PEP8: ON")
        else:
            self._btn_pep8 = QPushButton("PEP8: OFF")
        self._pep8_label = QLabel("PEP8 Errors: %s" % 0)
        hbox.addWidget(self._pep8_label)
        hbox.addSpacerItem(QSpacerItem(1, 0, QSizePolicy.Expanding))
        hbox.addWidget(self._btn_pep8)
        box.addLayout(hbox)
        box.addWidget(self._list_pep8)

        # Connections
        self._list_pep8.clicked.connect(self.__on_pep8_item_selected)
        self._btn_pep8.clicked.connect(self._turn_on_off_pep8)
        # Register service
        IDE.register_service("tab_errors", self)
Пример #16
0
    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
    def __init__(self, parent=None):
        super().__init__(parent)
        hbox = QHBoxLayout(self)
        hbox.setContentsMargins(5, 0, 5, 0)
        self._line_search = TextLine(self)
        self._line_search.setPlaceholderText(translations.TR_LINE_FIND)
        hbox.addWidget(self._line_search)
        self._btn_find_previous = QPushButton(translations.TR_FIND_PREVIOUS)
        hbox.addWidget(self._btn_find_previous)
        self._btn_find_next = QPushButton(translations.TR_FIND_NEXT)
        hbox.addWidget(self._btn_find_next)

        self._check_sensitive = QCheckBox(
            translations.TR_SEARCH_CASE_SENSITIVE)
        hbox.addWidget(self._check_sensitive)
        self._check_whole_word = QCheckBox(translations.TR_SEARCH_WHOLE_WORDS)
        hbox.addWidget(self._check_whole_word)

        # Connections
        self._line_search.textChanged.connect(self.find)
        self._line_search.returnPressed.connect(self.find_next)
        self._check_sensitive.stateChanged.connect(self.find)
        self._check_whole_word.stateChanged.connect(self.find)
        self._btn_find_next.clicked.connect(self.find_next)
        self._btn_find_previous.clicked.connect(self.find_previous)

        IDE.register_service("status_search", self)
Пример #18
0
    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)
Пример #19
0
    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)
Пример #20
0
    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
Пример #21
0
    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)
Пример #22
0
    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)
Пример #23
0
    def __init__(self, parent=None):
        super(CentralWidget, self).__init__(parent)
        self.parent = parent
        vbox = QVBoxLayout(self)
        vbox.setContentsMargins(0, 0, 0, 0)
        vbox.setSpacing(0)
        # This variables are used to save the splitter sizes before hide
        self.lateral_panel = LateralPanel()

        self._add_functions = {
            "central": self._insert_widget_inside,
            "lateral": self._insert_widget_base,
        }
        self._items = {}

        hbox = QHBoxLayout()
        hbox.setContentsMargins(0, 0, 0, 0)
        hbox.setSpacing(0)
        # Main Toolbar
        # main_toolbar = maintoolbar.MainToolbar(self)
        # hbox.addWidget(main_toolbar)
        # Create Splitters to divide the UI 3 regions
        self._splitter_base = dynamic_splitter.DynamicSplitter(Qt.Horizontal)
        self._splitter_base.setOpaqueResize(True)
        self._splitter_inside = dynamic_splitter.DynamicSplitter(Qt.Vertical)
        self._splitter_inside.setOpaqueResize(True)
        self._splitter_base.addWidget(self._splitter_inside)

        # Add to Main Layout        pass
        hbox.addWidget(self._splitter_base)
        vbox.addLayout(hbox)
        # w = IDE.get_service("tools_dock")
        tool = IDE.get_service('tools_dock')
        vbox.addWidget(tool._buttons_widget)
        IDE.register_service('central_container', self)
Пример #24
0
    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
Пример #25
0
    def __init__(self):
        super(_StatusBar, self).__init__()
        self.current_status = _STATUSBAR_STATE_SEARCH

        self._widgetStatus = QWidget()
        vbox = QVBoxLayout(self._widgetStatus)
        vbox.setContentsMargins(0, 0, 0, 0)
        vbox.setSpacing(0)
        #Search Layout
        self._searchWidget = SearchWidget()
        vbox.addWidget(self._searchWidget)
        #Replace Layout
        self._replaceWidget = ReplaceWidget()
        vbox.addWidget(self._replaceWidget)
        self._replaceWidget.setVisible(False)
        #Code Locator
        self._codeLocator = locator.CodeLocatorWidget()
        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(shortEscStatus, SIGNAL("activated()"), self.hide_status)
        self.connect(self._searchWidget._btnClose, SIGNAL("clicked()"),
                     self.hide_status)
        self.connect(self._replaceWidget._btnCloseReplace, SIGNAL("clicked()"),
                     lambda: self._replaceWidget.setVisible(False))
        self.connect(self._fileSystemOpener.btnClose, SIGNAL("clicked()"),
                     self.hide_status)
        self.connect(self._fileSystemOpener, SIGNAL("requestHide()"),
                     self.hide_status)
        self.connect(self._codeLocator, SIGNAL("hidden()"), self.hide_status)

        #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': 'projects_explorer',
                'signal_name': 'updateLocator()',
                'slot': self._explore_code
            },
        )

        IDE.register_signals('status_bar', connections)
        IDE.register_service('status_bar', self)
Пример #26
0
    def __init__(self):
        QObject.__init__(self)
        self.__services = {}
        self.__thread = QThreadPool()
        self._main_container = IDE.get_service("main_container")

        IDE.register_service("intellisense", self)
Пример #27
0
    def __init__(self, orientation=Qt.Vertical):
        super(ExplorerContainer, self).__init__(orientation)
        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.__splitted_tabs = {}
        self.menu = QMenu()
        action_split = self.menu.addAction(translations.TR_SPLIT_TAB)
        action_split.triggered.connect(self._split_widget)
        self.action_undock = self.menu.addAction(translations.TR_UNDOCK)
        self.action_undock.triggered.connect(self._undock_widget)
        self.actionCloseSplit = self.menu.addAction(
            translations.TR_CLOSE_SPLIT)
        self.actionCloseSplit.triggered.connect(self._close_split)
        self.menu_move_to_split = self.menu.addMenu(
            translations.TR_MOVE_TO_SPLIT)

        IDE.register_signals('explorer_container', connections)
        self.__created = True
Пример #28
0
    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)
Пример #29
0
    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)
Пример #30
0
    def __init__(self, parent=None):
        super().__init__(parent)
        hbox = QHBoxLayout(self)
        hbox.setContentsMargins(5, 0, 5, 0)
        self._line_search = TextLine(self)
        self._line_search.setPlaceholderText(translations.TR_LINE_FIND)
        hbox.addWidget(self._line_search)
        self._btn_find_previous = QToolButton(self)
        self._btn_find_previous.setText("Find Previous")
        hbox.addWidget(self._btn_find_previous)
        self._btn_find_next = QToolButton(self)
        self._btn_find_next.setText("Find Next")
        hbox.addWidget(self._btn_find_next)

        self._check_sensitive = QCheckBox(
            translations.TR_SEARCH_CASE_SENSITIVE)
        hbox.addWidget(self._check_sensitive)
        self._check_whole_word = QCheckBox(translations.TR_SEARCH_WHOLE_WORDS)
        hbox.addWidget(self._check_whole_word)
        # Timer
        self._timer = QTimer()
        self._timer.setSingleShot(True)
        self._timer.setInterval(150)
        self._timer.timeout.connect(self.execute_search)
        # Connections
        self._line_search.textChanged.connect(self._timer.start)
        self._line_search.returnPressed.connect(self.find_next)
        self._btn_find_previous.clicked.connect(self.find_previous)
        self._btn_find_next.clicked.connect(self.find_next)

        IDE.register_service("status_search", self)
Пример #31
0
    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)
Пример #32
0
    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)
Пример #33
0
    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.files_handler = files_handler.FilesHandler(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)
Пример #34
0
    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)
Пример #35
0
    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)
Пример #36
0
 def __init__(self, parent=None):
     super().__init__(parent)
     IDE.register_service("errors_tree", self)
     box = QVBoxLayout(self)
     box.setContentsMargins(0, 0, 0, 0)
     self._tree = QTreeWidget()
     self._tree.header().setHidden(True)
     self._tree.setAnimated(True)
     box.addWidget(self._tree)
Пример #37
0
 def __init__(self, parent=None):
     super().__init__(parent)
     IDE.register_service("errors_tree", self)
     box = QVBoxLayout(self)
     box.setContentsMargins(0, 0, 0, 0)
     self._tree = QTreeWidget()
     self._tree.header().setHidden(True)
     self._tree.setAnimated(True)
     box.addWidget(self._tree)
Пример #38
0
    def __init__(self):
        super(_MenuBar, self).__init__()
        self._roots = {}
        self._children = {}
        self._submenu = {}
        self._menu_refs = {}
        self._toolbar_index = {}

        IDE.register_service('menu_bar', self)
Пример #39
0
    def __init__(self):
        super(_MenuBar, self).__init__()
        self._roots = {}
        self._children = {}
        self._submenu = {}
        self._menu_refs = {}
        self._toolbar_index = {}

        IDE.register_service('menu_bar', self)
Пример #40
0
    def __init__(self, parent=None):
        super(ProjectTreeColumn, self).__init__(parent)
        vbox = QVBoxLayout(self)
        vbox.setSizeConstraint(QVBoxLayout.SetDefaultConstraint)
        vbox.setContentsMargins(0, 0, 0, 0)
        vbox.setSpacing(0)
        self._buttons = []
        frame = QFrame()
        frame.setObjectName("actionbar")
        box = QVBoxLayout(frame)
        box.setContentsMargins(1, 1, 1, 1)
        box.setSpacing(0)

        self._combo_project = QComboBox()
        self._combo_project.setSizePolicy(QSizePolicy.Expanding,
                                          QSizePolicy.Fixed)
        self._combo_project.setSizeAdjustPolicy(
            QComboBox.AdjustToMinimumContentsLengthWithIcon)
        self._combo_project.setObjectName("combo_projects")
        box.addWidget(self._combo_project)
        vbox.addWidget(frame)
        self._combo_project.setContextMenuPolicy(Qt.CustomContextMenu)
        self._projects_area = QStackedLayout()
        logger.debug("This is the projects area")
        vbox.addLayout(self._projects_area)

        # Empty widget
        self._empty_proj = QLabel(translations.TR_NO_PROJECTS)
        self._empty_proj.setAlignment(Qt.AlignCenter)
        self._empty_proj.setAutoFillBackground(True)
        self._empty_proj.setBackgroundRole(QPalette.Base)
        self._projects_area.addWidget(self._empty_proj)
        self._projects_area.setCurrentWidget(self._empty_proj)

        self.projects = []

        self._combo_project.currentIndexChanged.connect(
            self._change_current_project)
        self._combo_project.customContextMenuRequested[
            'const QPoint&'].connect(self.context_menu_for_root)

        connections = (
            {
                "target": "main_container",
                "signal_name": "addToProject",
                "slot": self._add_file_to_project
            },
            {
                "target": "main_container",
                "signal_name": "showFileInExplorer",
                "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)
Пример #41
0
    def __init__(self, parent=None):
        super(ProjectTreeColumn, self).__init__(parent)
        vbox = QVBoxLayout(self)
        vbox.setSizeConstraint(QVBoxLayout.SetDefaultConstraint)
        vbox.setContentsMargins(0, 0, 0, 0)
        vbox.setSpacing(0)
        self._buttons = []
        frame = QFrame()
        frame.setObjectName("actionbar")
        box = QVBoxLayout(frame)
        box.setContentsMargins(1, 1, 1, 1)
        box.setSpacing(0)

        self._combo_project = QComboBox()
        self._combo_project.setSizePolicy(
            QSizePolicy.Expanding, QSizePolicy.Fixed)
        self._combo_project.setSizeAdjustPolicy(
            QComboBox.AdjustToMinimumContentsLengthWithIcon)
        self._combo_project.setObjectName("combo_projects")
        box.addWidget(self._combo_project)
        vbox.addWidget(frame)
        self._combo_project.setContextMenuPolicy(Qt.CustomContextMenu)
        self._projects_area = QStackedLayout()
        logger.debug("This is the projects area")
        vbox.addLayout(self._projects_area)

        # Empty widget
        self._empty_proj = QLabel(translations.TR_NO_PROJECTS)
        self._empty_proj.setAlignment(Qt.AlignCenter)
        self._empty_proj.setAutoFillBackground(True)
        self._empty_proj.setBackgroundRole(QPalette.Base)
        self._projects_area.addWidget(self._empty_proj)
        self._projects_area.setCurrentWidget(self._empty_proj)

        self.projects = []

        self._combo_project.activated.connect(
            self._change_current_project)
        self._combo_project.customContextMenuRequested[
            'const QPoint&'].connect(self.context_menu_for_root)

        connections = (
            {
                "target": "main_container",
                "signal_name": "addToProject",
                "slot": self._add_file_to_project
            },
            {
                "target": "main_container",
                "signal_name": "showFileInExplorer",
                "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)
Пример #42
0
    def __init__(self, parent=None):
        super().__init__(parent)
        self.setAcceptDrops(True)
        self._vbox = QVBoxLayout(self)
        self._vbox.setContentsMargins(0, 0, 0, 0)
        self._vbox.setSpacing(0)
        self.stack = QStackedLayout()
        self.stack.setStackingMode(QStackedLayout.StackAll)
        self._vbox.addLayout(self.stack)
        self.splitter = dynamic_splitter.DynamicSplitter()
        self._files_handler = files_handler.FilesHandler(self)

        # Code Navigation
        self.__code_back = []
        self.__code_forward = []
        self.__operations = {
            0: self._navigate_code_jumps,
            1: self._navigate_bookmarks
        }
        # Recent files list
        self.__last_opened_files = []
        # QML UI
        self._add_file_folder = add_file_folder.AddFileFolderWidget(self)

        if settings.SHOW_START_PAGE:
            self.show_start_page()

        IDE.register_service("main_container", self)
        # Register signals connections
        connections = (
            # {
            #     "target": "main_container",
            #     "signal_name": "updateLocator",
            #     "slot": self._explore_code
            # },
            {
                "target": "filesystem",
                "signal_name": "projectOpened",
                "slot": self._explore_code
            },
            # {
            #     "target": "projects_explore",
            #     "signal_name": "updateLocator",
            #     "slot": self._explore_code
            # }
            {
                "target": "filesystem",
                "signal_name": "projectClosed",
                "slot": self._explore_code
            }
        )

        IDE.register_signals("main_container", connections)

        fhandler_short = QShortcut(QKeySequence(Qt.CTRL + Qt.Key_Tab), self)
        fhandler_short.activated.connect(self.show_files_handler)
Пример #43
0
    def __init__(self, parent):
        QWidget.__init__(self, parent)
        vbox = QVBoxLayout(self)
        self._webInspector = QWebInspector(self)
        vbox.addWidget(self._webInspector)
        self.btnDock = QPushButton(translations.TR_UNDOCK)
        vbox.addWidget(self.btnDock)

        ExplorerContainer.register_tab(translations.TR_TAB_WEB_INSPECTOR, self)
        IDE.register_service('web_inspector', self)
Пример #44
0
    def __init__(self, parent):
        QWidget.__init__(self, parent)
        vbox = QVBoxLayout(self)
        self._webInspector = QWebInspector(self)
        vbox.addWidget(self._webInspector)
        self.btnDock = QPushButton(translations.TR_UNDOCK)
        vbox.addWidget(self.btnDock)

        ExplorerContainer.register_tab(translations.TR_TAB_WEB_INSPECTOR, self)
        IDE.register_service('web_inspector', self)
Пример #45
0
    def __init__(self):
        super(_StatusBar, self).__init__()
        self.current_status = _STATUSBAR_STATE_SEARCH

        vbox = QVBoxLayout(self)
        vbox.setContentsMargins(0, 0, 0, 0)
        if settings.IS_MAC_OS:
            vbox.setSpacing(0)
        else:
            vbox.setSpacing(3)
        #Search Layout
        self._searchWidget = SearchWidget()
        vbox.addWidget(self._searchWidget)
        #Replace Layout
        self._replaceWidget = ReplaceWidget()
        vbox.addWidget(self._replaceWidget)
        self._replaceWidget.setVisible(False)
        #File system completer
        self._fileSystemOpener = FileSystemOpener()
        vbox.addWidget(self._fileSystemOpener)
        self._fileSystemOpener.setVisible(False)

        # Not Configurable Shortcuts
        shortEscStatus = QShortcut(QKeySequence(Qt.Key_Escape), self)

        shortEscStatus.activated.connect(self.hide_status)
        self._searchWidget._btnClose.clicked['bool'].connect(
            lambda s: self.hide_status())
        self._replaceWidget._btnCloseReplace.clicked['bool'].connect(
            lambda s: self._replaceWidget.setVisible(False))
        self._fileSystemOpener.btnClose.clicked['bool'].connect(
            lambda s: self.hide_status())
        self._fileSystemOpener.requestHide.connect(self.hide_status)

        #Register signals connections
        connections = (
            {
                'target': 'main_container',
                'signal_name': 'updateLocator',  #(QString)
                'slot': self._explore_file_code
            },
            {
                'target': 'filesystem',
                'signal_name': 'projectOpened',  #(QString)
                'slot': self._explore_code
            },
            {
                'target': 'filesystem',
                'signal_name': 'projectClosed',  #(QString)
                'slot': self._explore_code
            },
        )

        IDE.register_signals('status_bar', connections)
        IDE.register_service('status_bar', self)
Пример #46
0
    def __init__(self):
        super(_StatusBar, self).__init__()
        self.current_status = _STATUSBAR_STATE_SEARCH

        vbox = QVBoxLayout(self)
        vbox.setContentsMargins(0, 0, 0, 0)
        if settings.IS_MAC_OS:
            vbox.setSpacing(0)
        else:
            vbox.setSpacing(3)
        #Search Layout
        self._searchWidget = SearchWidget()
        vbox.addWidget(self._searchWidget)
        #Replace Layout
        self._replaceWidget = ReplaceWidget()
        vbox.addWidget(self._replaceWidget)
        self._replaceWidget.setVisible(False)
        #File system completer
        self._fileSystemOpener = FileSystemOpener()
        vbox.addWidget(self._fileSystemOpener)
        self._fileSystemOpener.setVisible(False)

        # Not Configurable Shortcuts
        shortEscStatus = QShortcut(QKeySequence(Qt.Key_Escape), self)

        self.connect(shortEscStatus, SIGNAL("activated()"), self.hide_status)
        self.connect(self._searchWidget._btnClose, SIGNAL("clicked()"),
                     self.hide_status)
        self.connect(self._replaceWidget._btnCloseReplace, SIGNAL("clicked()"),
                     lambda: self._replaceWidget.setVisible(False))
        self.connect(self._fileSystemOpener.btnClose, SIGNAL("clicked()"),
                     self.hide_status)
        self.connect(self._fileSystemOpener, SIGNAL("requestHide()"),
                     self.hide_status)

        #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': 'filesystem',
             'signal_name': 'projectOpened(QString)',
             'slot': self._explore_code},
            {'target': 'filesystem',
             'signal_name': 'projectClosed(QString)',
             'slot': self._explore_code},
            )

        IDE.register_signals('status_bar', connections)
        IDE.register_service('status_bar', self)
Пример #47
0
    def __init__(self, parent=None):
        super(_MainContainer, self).__init__(parent)
        self._parent = parent
        self._vbox = QVBoxLayout(self)
        self._vbox.setContentsMargins(0, 0, 0, 0)
        self._vbox.setSpacing(0)
        self.stack = QStackedLayout()
        self.stack.setStackingMode(QStackedLayout.StackAll)
        self._vbox.addLayout(self.stack)

        self.splitter = dynamic_splitter.DynamicSplitter()
        self.setAcceptDrops(True)
        self._files_handler = files_handler.FilesHandler(self)
        self._add_file_folder = add_file_folder.AddFileFolderWidget(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._opening_dialog = False
        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("removeWidget(int)"), self._remove_item_from_stack)
        self.connect(self.selector, SIGNAL("ready()"), self._selector_ready)
        self.connect(self.selector, SIGNAL("animationCompleted()"), self._selector_animation_completed)
        self.connect(self, SIGNAL("closeDialog(PyQt_PyObject)"), self.remove_widget)
Пример #48
0
    def __init__(self, parent=None):
        super().__init__(parent)
        layout = QVBoxLayout(self)
        layout.setContentsMargins(0, 0, 1, 0)
        layout.setSpacing(0)

        self._toolbar = ToolBar(self)
        layout.addWidget(self._toolbar)

        self._action_bar = ActionBar(self)
        self.add_corner_widget(self._action_bar)

        IDE.register_service("toolbar", self)
Пример #49
0
 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': "runFile(QString)",
         'slot': self.execute_file},
     )
     IDE.register_signals('tools_dock', connections)
     IDE.register_service("tools_dock", self)
Пример #50
0
    def __init__(self, parent=None):
        super().__init__(parent, Qt.WindowStaysOnTopHint)
        box = QVBoxLayout(self)
        box.setContentsMargins(0, 0, 0, 0)
        box.setSpacing(0)
        hbox = QHBoxLayout()
        hbox.setContentsMargins(0, 0, 0, 0)
        self._list = ErrorsList()
        hbox.addWidget(self._list)
        box.addLayout(hbox)

        IDE.register_service("tab_errors", self)
        ExplorerContainer.register_tab(translations.TR_TAB_ERRORS, self)
Пример #51
0
    def __init__(self, parent=None):
        super().__init__(parent)
        layout = QVBoxLayout(self)
        layout.setContentsMargins(0, 0, 1, 0)
        layout.setSpacing(0)

        self._toolbar = ToolBar(self)
        layout.addWidget(self._toolbar)

        self._action_bar = ActionBar(self)
        self.add_corner_widget(self._action_bar)

        IDE.register_service("toolbar", self)
Пример #52
0
    def __init__(self, parent=None):
        super(SearchWidget, self).__init__(parent)
        hSearch = QHBoxLayout(self)
        hSearch.setContentsMargins(0, 0, 0, 0)
        self._checkSensitive = QCheckBox(translations.TR_SEARCH_CASE_SENSITIVE)
        self._checkWholeWord = QCheckBox(translations.TR_SEARCH_WHOLE_WORDS)
        self._line = TextLine(self)
        self._line.setMinimumWidth(250)
        self._btnClose = QPushButton(
            self.style().standardIcon(QStyle.SP_DialogCloseButton), '')
        self._btnClose.setIconSize(QSize(16, 16))
        self._btnFind = QPushButton(QIcon(":img/find"), '')
        self._btnFind.setIconSize(QSize(16, 16))
        self.btnPrevious = QPushButton(
            self.style().standardIcon(QStyle.SP_ArrowLeft), '')
        self.btnPrevious.setIconSize(QSize(16, 16))
        self.btnPrevious.setToolTip(
            self.trUtf8("Press %s") %
            resources.get_shortcut("Find-previous").toString(
                QKeySequence.NativeText))
        self.btnNext = QPushButton(
            self.style().standardIcon(QStyle.SP_ArrowRight), '')
        self.btnNext.setIconSize(QSize(16, 16))
        self.btnNext.setToolTip(
            self.trUtf8("Press %s") %
            resources.get_shortcut("Find-next").toString(
                QKeySequence.NativeText))
        hSearch.addWidget(self._btnClose)
        hSearch.addWidget(self._line)
        hSearch.addWidget(self._btnFind)
        hSearch.addWidget(self.btnPrevious)
        hSearch.addWidget(self.btnNext)
        hSearch.addWidget(self._checkSensitive)
        hSearch.addWidget(self._checkWholeWord)

        self.totalMatches = 0
        self.index = 0
        self._line.counter.update_count(self.index, self.totalMatches)

        self.connect(self._btnFind, SIGNAL("clicked()"),
                     self.find)
        self.connect(self.btnNext, SIGNAL("clicked()"),
                     self.find_next)
        self.connect(self.btnPrevious, SIGNAL("clicked()"),
                     self.find_previous)
        self.connect(self._checkSensitive, SIGNAL("stateChanged(int)"),
                     self._states_changed)
        self.connect(self._checkWholeWord, SIGNAL("stateChanged(int)"),
                     self._states_changed)

        IDE.register_service('status_search', self)
Пример #53
0
    def __init__(self, parent=None):
        super(ExplorerContainer, self).__init__(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},
        )

        IDE.register_signals('explorer_container', connections)
        self.__created = True
Пример #54
0
    def __init__(self):
        QWidget.__init__(self)
        self.__programs = []

        vbox = QVBoxLayout(self)
        vbox.setContentsMargins(0, 0, 0, 0)
        vbox.setSpacing(0)

        connections = (
            {
                "target": "tools_dock",
                "signal_name": "executeFile",
                "slot": self.execute_file
            },
            {
                "target": "tools_dock",
                "signal_name": "executeProject",
                "slot": self.execute_project
            },
            {
                "target": "tools_dock",
                "signal_name": "executeSelection",
                "slot": self.execute_selection
            },
            {
                "target": "tools_dock",
                "signal_name": "stopApplication",
                "slot": self.kill_application
            }
        )
        IDE.register_signals("tools_dock", connections)

        self._tabs = QTabWidget()
        self._tabs.setTabsClosable(True)
        self._tabs.setMovable(True)
        self._tabs.setDocumentMode(True)
        vbox.addWidget(self._tabs)
        # Menu for tab
        self._tabs.tabBar().setContextMenuPolicy(Qt.CustomContextMenu)
        self._tabs.tabBar().customContextMenuRequested.connect(
            self._menu_for_tabbar)
        self._tabs.tabCloseRequested.connect(self.close_tab)

        IDE.register_service("run_widget", self)
        _ToolsDock.register_widget(translations.TR_OUTPUT, self)
Пример #55
0
    def __init__(self, parent=None):
        super().__init__(parent)
        hbox = QHBoxLayout(self)
        hbox.setContentsMargins(5, 0, 5, 0)
        # Toggle Buttons
        self._btn_case_sensitive = QPushButton("Aa")
        self._btn_case_sensitive.setToolTip(
            translations.TR_SEARCH_CASE_SENSITIVE)
        self._btn_case_sensitive.setCheckable(True)
        self._btn_case_sensitive.setObjectName("status")
        self._btn_whole_word = QPushButton("WO")
        self._btn_whole_word.setToolTip(translations.TR_SEARCH_WHOLE_WORDS)
        self._btn_whole_word.setCheckable(True)
        self._btn_whole_word.setObjectName("status")
        self._btn_regex = QPushButton(".*")
        self._btn_regex.setToolTip(translations.TR_SEARCH_REGEX)
        self._btn_regex.setCheckable(True)
        self._btn_regex.setObjectName("status")
        self._btn_highlight = QPushButton("\u25A3")
        self._btn_highlight.setCheckable(True)
        self._btn_highlight.setChecked(True)
        self._btn_highlight.setObjectName("status")
        hbox.addWidget(self._btn_case_sensitive)
        hbox.addWidget(self._btn_whole_word)
        hbox.addWidget(self._btn_regex)
        hbox.addWidget(self._btn_highlight)
        # Search line
        self._line_search = TextLine(self)
        self._line_search.setPlaceholderText(translations.TR_LINE_FIND)
        hbox.addWidget(self._line_search)
        # Previous and next search buttons
        self._btn_find_previous = QPushButton(translations.TR_FIND_PREVIOUS)
        hbox.addWidget(self._btn_find_previous)
        self._btn_find_next = QPushButton(translations.TR_FIND_NEXT)
        hbox.addWidget(self._btn_find_next)
        # Connections
        self._line_search.textChanged.connect(self.find)
        self._line_search.returnPressed.connect(self.find_next)
        self._btn_case_sensitive.toggled.connect(self.find)
        self._btn_whole_word.toggled.connect(self.find)
        self._btn_find_next.clicked.connect(self.find_next)
        self._btn_highlight.toggled.connect(self._toggle_highlighting)
        self._btn_find_previous.clicked.connect(self.find_previous)

        IDE.register_service("status_search", self)
Пример #56
0
    def __init__(self):
        super(ErrorsWidget, self).__init__()
        self.pep8 = None
        self._outRefresh = True

        vbox = QVBoxLayout(self)
        self.listErrors = QListWidget()
        self.listErrors.setSortingEnabled(True)
        self.listPep8 = QListWidget()
        self.listPep8.setSortingEnabled(True)
        hbox_lint = QHBoxLayout()
        if settings.FIND_ERRORS:
            self.btn_lint_activate = QPushButton(self.tr("Lint: ON"))
        else:
            self.btn_lint_activate = QPushButton(self.tr("Lint: OFF"))
        self.errorsLabel = QLabel(self.tr("Static Errors: %s") % 0)
        hbox_lint.addWidget(self.errorsLabel)
        hbox_lint.addSpacerItem(QSpacerItem(1, 0, QSizePolicy.Expanding))
        hbox_lint.addWidget(self.btn_lint_activate)
        vbox.addLayout(hbox_lint)
        vbox.addWidget(self.listErrors)
        hbox_pep8 = QHBoxLayout()
        if settings.CHECK_STYLE:
            self.btn_pep8_activate = QPushButton(self.tr("PEP8: ON"))
        else:
            self.btn_pep8_activate = QPushButton(self.tr("PEP8: OFF"))
        self.pep8Label = QLabel(self.tr("PEP8 Errors: %s") % 0)
        hbox_pep8.addWidget(self.pep8Label)
        hbox_pep8.addSpacerItem(QSpacerItem(1, 0, QSizePolicy.Expanding))
        hbox_pep8.addWidget(self.btn_pep8_activate)
        vbox.addLayout(hbox_pep8)
        vbox.addWidget(self.listPep8)

        self.connect(self.listErrors, SIGNAL("itemSelectionChanged()"),
            self.errors_selected)
        self.connect(self.listPep8, SIGNAL("itemSelectionChanged()"),
            self.pep8_selected)
        self.connect(self.btn_lint_activate, SIGNAL("clicked()"),
            self._turn_on_off_lint)
        self.connect(self.btn_pep8_activate, SIGNAL("clicked()"),
            self._turn_on_off_pep8)

        IDE.register_service('tab_errors', self)
        ExplorerContainer.register_tab(translations.TR_TAB_ERRORS, self)