diff -r b2c4c2f3fda7 -r f25cd4b94eb0 eric7/UI/UserInterface.py --- a/eric7/UI/UserInterface.py Fri Sep 24 17:37:38 2021 +0200 +++ b/eric7/UI/UserInterface.py Fri Sep 24 20:09:58 2021 +0200 @@ -953,6 +953,13 @@ self.viewmanager.openSourceFile) self.__findFileWidget.designerFile.connect(self.__designer) + # Create the find location (file) widget + from .FindLocationWidget import FindLocationWidget + self.__findLocationWidget = FindLocationWidget(self.project, self) + self.__findLocationWidget.sourceFile.connect( + self.viewmanager.openSourceFile) + self.__findLocationWidget.designerFile.connect(self.__designer) + # Create the VCS Status widget from VCS.StatusWidget import StatusWidget self.__vcsStatusWidget = StatusWidget( @@ -1085,6 +1092,10 @@ UI.PixmapCache.getIcon("find"), self.tr("Find/Replace In Files")) + self.rToolbox.addItem(self.__findLocationWidget, + UI.PixmapCache.getIcon("findLocation"), + self.tr("Find File")) + self.rToolbox.addItem(self.pluginRepositoryViewer, UI.PixmapCache.getIcon("pluginRepository"), self.tr("Plugin Repository")) @@ -1238,6 +1249,11 @@ self.tr("Find/Replace In Files")) self.rightSidebar.addTab( + self.__findLocationWidget, + UI.PixmapCache.getIcon("sbFindLocation96"), + self.tr("Find File")) + + self.rightSidebar.addTab( self.pluginRepositoryViewer, UI.PixmapCache.getIcon("sbPluginRepository96"), self.tr("Plugin Repository")) @@ -2260,6 +2276,24 @@ self.actions.append(self.findFileActivateAct) self.addAction(self.findFileActivateAct) + self.findLocationActivateAct = EricAction( + self.tr("Find File"), + self.tr("Find File"), + QKeySequence(self.tr("Ctrl+Alt+Shift+L")), + 0, self, + 'find_location_activate') + self.findLocationActivateAct.setStatusTip(self.tr( + "Switch the input focus to the Find File window.")) + self.findLocationActivateAct.setWhatsThis(self.tr( + """<b>Find File</b>""" + """<p>This switches the input focus to the Find File window.""" + """</p>""" + )) + self.findLocationActivateAct.triggered.connect( + self.__activateFindLocationWidget) + self.actions.append(self.findLocationActivateAct) + self.addAction(self.findLocationActivateAct) + self.vcsStatusListActivateAct = EricAction( self.tr("VCS Status List"), self.tr("VCS Status List"), @@ -3380,6 +3414,7 @@ self.codeDocumentationViewerActivateAct) self.__menus["subwindow"].addAction(self.debugViewerActivateAct) self.__menus["subwindow"].addAction(self.findFileActivateAct) + self.__menus["subwindow"].addAction(self.findLocationActivateAct) self.__menus["subwindow"].addAction( self.pluginRepositoryViewerActivateAct) self.__menus["subwindow"].addAction(self.virtualenvManagerActivateAct) @@ -6914,6 +6949,27 @@ self.__findFileWidget.activate() + def showFindLocationWidget(self): + """ + Public method to show the Find File widget. + """ + self.__activateFindLocationWidget() + + def __activateFindLocationWidget(self): + """ + Private method to activate the Find File widget. + """ + if self.__layoutType == "Toolboxes": + self.rToolboxDock.show() + self.rToolbox.setCurrentWidget(self.__findLocationWidget) + elif self.__layoutType == "Sidebars": + self.rightSidebar.show() + self.rightSidebar.setCurrentWidget(self.__findLocationWidget) + self.__findLocationWidget.setFocus( + Qt.FocusReason.ActiveWindowFocusReason) + + self.__findLocationWidget.activate() + def __activateVcsStatusList(self): """ Private slot to activate the VCS Status List.