예제 #1
0
    def load_ui(self, centralWidget):
        #Set Application Font for ToolTips
        QToolTip.setFont(QFont(settings.FONT_FAMILY, 10))
        #Create Main Container to manage Tabs
        self.mainContainer = main_container.MainContainer(self)
        self.connect(self.mainContainer, SIGNAL("currentTabChanged(QString)"),
                     self.change_window_title)
        self.connect(self.mainContainer,
                     SIGNAL("locateFunction(QString, QString, bool)"),
                     self.actions.locate_function)
        self.connect(self.mainContainer, SIGNAL("navigateCode(bool, int)"),
                     self.actions.navigate_code_history)
        self.connect(self.mainContainer, SIGNAL("addBackItemNavigation()"),
                     self.actions.add_back_item_navigation)
        self.connect(self.mainContainer, SIGNAL("updateFileMetadata()"),
                     self.actions.update_explorer)
        self.connect(self.mainContainer, SIGNAL("updateLocator(QString)"),
                     self.actions.update_explorer)
        self.connect(self.mainContainer, SIGNAL("openPreferences()"),
                     self._show_preferences)
        self.connect(self.mainContainer, SIGNAL("dontOpenStartPage()"),
                     self._dont_show_start_page_again)
        self.connect(self.mainContainer, SIGNAL("currentTabChanged(QString)"),
                     self.status.handle_tab_changed)
        # Update symbols
        self.connect(self.mainContainer, SIGNAL("updateLocator(QString)"),
                     self.status.explore_file_code)
        #Create Explorer Panel
        self.explorer = explorer_container.ExplorerContainer(self)
        self.connect(self.central, SIGNAL("splitterCentralRotated()"),
                     self.explorer.rotate_tab_position)
        self.connect(self.explorer, SIGNAL("updateLocator()"),
                     self.status.explore_code)
        self.connect(self.explorer, SIGNAL("goToDefinition(int)"),
                     self.actions.editor_go_to_line)
        self.connect(self.explorer, SIGNAL("projectClosed(QString)"),
                     self.actions.close_files_from_project)
        #Create Misc Bottom Container
        self.misc = misc_container.MiscContainer(self)
        self.connect(self.mainContainer, SIGNAL("findOcurrences(QString)"),
                     self.misc.show_find_occurrences)

        centralWidget.insert_central_container(self.mainContainer)
        centralWidget.insert_lateral_container(self.explorer)
        centralWidget.insert_bottom_container(self.misc)
        self.connect(self.mainContainer,
                     SIGNAL("cursorPositionChange(int, int)"),
                     self.central.lateralPanel.update_line_col)
        # TODO: Change current symbol on move
        #self.connect(self.mainContainer,
        #SIGNAL("cursorPositionChange(int, int)"),
        #self.explorer.update_current_symbol)
        self.connect(self.mainContainer, SIGNAL("enabledFollowMode(bool)"),
                     self.central.enable_follow_mode_scrollbar)

        if settings.SHOW_START_PAGE:
            self.mainContainer.show_start_page()
예제 #2
0
 def _load_results(self):
     if len(self._thread.results) == 1:
         main_container.MainContainer().open_file(
             filename=self._thread.results[0][1],
             cursorPosition=self._thread.results[0][2],
             positionIsLineNumber=True)
     elif len(self._thread.results) == 0:
         QMessageBox.information(main_container.MainContainer(),
             self.tr("Definition Not Found"),
             self.tr("This Definition does not belong to this Project."))
     else:
         misc_container.MiscContainer().show_results(self._thread.results)
예제 #3
0
 def _show_find_in_files(self):
     misc_container.MiscContainer().show_find_in_files_widget()