eric6/UI/UserInterface.py

branch
maintenance
changeset 7035
d2036d7f5ef6
parent 6989
8b8cadf8d7e9
parent 7008
e1b80fb11cc7
child 7051
a6dbc7c847cb
equal deleted inserted replaced
6991:68256afbba26 7035:d2036d7f5ef6
314 self.findFilesDialog = None 314 self.findFilesDialog = None
315 self.replaceFilesDialog = None 315 self.replaceFilesDialog = None
316 self.__notification = None 316 self.__notification = None
317 self.__readingSession = False 317 self.__readingSession = False
318 self.__versionsDialog = None 318 self.__versionsDialog = None
319 self.__configurationDialog = None
319 320
320 # now setup the connections 321 # now setup the connections
321 splash.showMessage(self.tr("Setting up connections...")) 322 splash.showMessage(self.tr("Setting up connections..."))
322 323
323 self.debugViewer.exceptionLogger.sourceFile.connect( 324 self.debugViewer.exceptionLogger.sourceFile.connect(
721 # set the keyboard input interval 722 # set the keyboard input interval
722 interval = Preferences.getUI("KeyboardInputInterval") 723 interval = Preferences.getUI("KeyboardInputInterval")
723 if interval > 0: 724 if interval > 0:
724 QApplication.setKeyboardInputInterval(interval) 725 QApplication.setKeyboardInputInterval(interval)
725 726
727 def networkAccessManager(self):
728 """
729 Public method to get a reference to the network access manager object.
730
731 @return reference to the network access manager object
732 @rtype QNetworkAccessManager
733 """
734 return self.__networkManager
735
726 def __createLayout(self, debugServer): 736 def __createLayout(self, debugServer):
727 """ 737 """
728 Private method to create the layout of the various windows. 738 Private method to create the layout of the various windows.
729 739
730 @param debugServer reference to the debug server object 740 @param debugServer reference to the debug server object
806 self.rToolboxDock = self.__createDockWindow("rToolboxDock") 816 self.rToolboxDock = self.__createDockWindow("rToolboxDock")
807 self.rToolbox = E5VerticalToolBox(self.rToolboxDock) 817 self.rToolbox = E5VerticalToolBox(self.rToolboxDock)
808 self.__setupDockWindow(self.rToolboxDock, Qt.RightDockWidgetArea, 818 self.__setupDockWindow(self.rToolboxDock, Qt.RightDockWidgetArea,
809 self.rToolbox, self.tr("Right Toolbox")) 819 self.rToolbox, self.tr("Right Toolbox"))
810 820
821 ####################################################
822 ## Populate the left toolbox
823 ####################################################
824
811 # Create the project browser 825 # Create the project browser
812 logging.debug("Creating Project Browser...") 826 logging.debug("Creating Project Browser...")
813 from Project.ProjectBrowser import ProjectBrowser 827 from Project.ProjectBrowser import ProjectBrowser
814 self.projectBrowser = ProjectBrowser(self.project) 828 self.projectBrowser = ProjectBrowser(self.project)
815 self.lToolbox.addItem(self.projectBrowser, 829 self.lToolbox.addItem(self.projectBrowser,
833 self.viewmanager) 847 self.viewmanager)
834 self.lToolbox.addItem(self.templateViewer, 848 self.lToolbox.addItem(self.templateViewer,
835 UI.PixmapCache.getIcon("templateViewer.png"), 849 UI.PixmapCache.getIcon("templateViewer.png"),
836 self.tr("Template-Viewer")) 850 self.tr("Template-Viewer"))
837 851
852 ####################################################
853 ## Populate the right toolbox
854 ####################################################
855
838 if Preferences.getUI("ShowCodeDocumentationViewer"): 856 if Preferences.getUI("ShowCodeDocumentationViewer"):
839 # Create the code documentation viewer 857 # Create the code documentation viewer
840 logging.debug("Creating Code Documentation Viewer...") 858 logging.debug("Creating Code Documentation Viewer...")
841 from .CodeDocumentationViewer import CodeDocumentationViewer 859 from .CodeDocumentationViewer import CodeDocumentationViewer
842 self.codeDocumentationViewer = CodeDocumentationViewer(self) 860 self.codeDocumentationViewer = CodeDocumentationViewer(self)
886 self.irc = IrcWidget(self) 904 self.irc = IrcWidget(self)
887 self.rToolbox.addItem(self.irc, 905 self.rToolbox.addItem(self.irc,
888 UI.PixmapCache.getIcon("irc.png"), 906 UI.PixmapCache.getIcon("irc.png"),
889 self.tr("IRC")) 907 self.tr("IRC"))
890 908
909 ####################################################
910 ## Populate the bottom toolbox
911 ####################################################
912
891 # Create the task viewer part of the user interface 913 # Create the task viewer part of the user interface
892 logging.debug("Creating Task Viewer...") 914 logging.debug("Creating Task Viewer...")
893 from Tasks.TaskViewer import TaskViewer 915 from Tasks.TaskViewer import TaskViewer
894 self.taskViewer = TaskViewer(None, self.project) 916 self.taskViewer = TaskViewer(None, self.project)
895 self.hToolbox.addItem(self.taskViewer, 917 self.hToolbox.addItem(self.taskViewer,
902 self.logViewer = LogViewer(self) 924 self.logViewer = LogViewer(self)
903 self.hToolbox.addItem(self.logViewer, 925 self.hToolbox.addItem(self.logViewer,
904 UI.PixmapCache.getIcon("logViewer.png"), 926 UI.PixmapCache.getIcon("logViewer.png"),
905 self.tr("Log-Viewer")) 927 self.tr("Log-Viewer"))
906 928
907 # Create the shell
908 # TODO: shell should be available in left or right toolbox
909 # alternatively
910 logging.debug("Creating Shell...")
911 from QScintilla.Shell import ShellAssembly
912 self.shellAssembly = \
913 ShellAssembly(debugServer, self.viewmanager, self.project, True)
914 self.shell = self.shellAssembly.shell()
915 self.hToolbox.insertItem(0, self.shellAssembly,
916 UI.PixmapCache.getIcon("shell.png"),
917 self.tr("Shell"))
918
919 if Preferences.getUI("ShowFileBrowser"): 929 if Preferences.getUI("ShowFileBrowser"):
920 # Create the file browser 930 # Create the file browser
921 logging.debug("Creating File Browser...") 931 logging.debug("Creating File Browser...")
922 from .Browser import Browser 932 from .Browser import Browser
923 self.browser = Browser() 933 self.browser = Browser()
941 self.numbersViewer = NumbersWidget() 951 self.numbersViewer = NumbersWidget()
942 self.hToolbox.addItem(self.numbersViewer, 952 self.hToolbox.addItem(self.numbersViewer,
943 UI.PixmapCache.getIcon("numbers.png"), 953 UI.PixmapCache.getIcon("numbers.png"),
944 self.tr("Numbers")) 954 self.tr("Numbers"))
945 955
956 ####################################################
957 ## Populate the configurable widgets
958 ####################################################
959
960 # Create the shell
961 logging.debug("Creating Shell...")
962 self.__shellPosition = Preferences.getUI("ShellPosition")
963 if self.__shellPosition == "left":
964 self.__shellParent = self.lToolboxDock
965 elif self.__shellPosition == "right":
966 self.__shellParent = self.rToolboxDock
967 else:
968 self.__shellParent = self.hToolboxDock
969 from QScintilla.Shell import ShellAssembly
970 self.shellAssembly = \
971 ShellAssembly(debugServer, self.viewmanager, self.project, True)
972 self.shell = self.shellAssembly.shell()
973 self.__shellParent.widget().insertItem(
974 0, self.shellAssembly, UI.PixmapCache.getIcon("shell.png"),
975 self.tr("Shell"))
976
977 ####################################################
978 ## Set the start index of each toolbox
979 ####################################################
980
981 self.lToolbox.setCurrentIndex(0)
982 self.rToolbox.setCurrentIndex(0)
946 self.hToolbox.setCurrentIndex(0) 983 self.hToolbox.setCurrentIndex(0)
947 984
948 def __createSidebarsLayout(self, debugServer): 985 def __createSidebarsLayout(self, debugServer):
949 """ 986 """
950 Private method to create the Sidebars layout. 987 Private method to create the Sidebars layout.
962 # Create the bottom sidebar 999 # Create the bottom sidebar
963 self.bottomSidebar = E5SideBar(E5SideBar.South, delay) 1000 self.bottomSidebar = E5SideBar(E5SideBar.South, delay)
964 1001
965 # Create the right sidebar 1002 # Create the right sidebar
966 self.rightSidebar = E5SideBar(E5SideBar.East, delay) 1003 self.rightSidebar = E5SideBar(E5SideBar.East, delay)
1004
1005 ####################################################
1006 ## Populate the left side bar
1007 ####################################################
967 1008
968 # Create the project browser 1009 # Create the project browser
969 logging.debug("Creating Project Browser...") 1010 logging.debug("Creating Project Browser...")
970 from Project.ProjectBrowser import ProjectBrowser 1011 from Project.ProjectBrowser import ProjectBrowser
971 self.projectBrowser = ProjectBrowser(self.project) 1012 self.projectBrowser = ProjectBrowser(self.project)
993 self.leftSidebar.addTab( 1034 self.leftSidebar.addTab(
994 self.templateViewer, 1035 self.templateViewer,
995 UI.PixmapCache.getIcon("templateViewer.png"), 1036 UI.PixmapCache.getIcon("templateViewer.png"),
996 self.tr("Template-Viewer")) 1037 self.tr("Template-Viewer"))
997 1038
1039 ####################################################
1040 ## Populate the right side bar
1041 ####################################################
1042
998 if Preferences.getUI("ShowCodeDocumentationViewer"): 1043 if Preferences.getUI("ShowCodeDocumentationViewer"):
999 # Create the code documentation viewer 1044 # Create the code documentation viewer
1000 logging.debug("Creating Code Documentation Viewer...") 1045 logging.debug("Creating Code Documentation Viewer...")
1001 from .CodeDocumentationViewer import CodeDocumentationViewer 1046 from .CodeDocumentationViewer import CodeDocumentationViewer
1002 self.codeDocumentationViewer = CodeDocumentationViewer(self) 1047 self.codeDocumentationViewer = CodeDocumentationViewer(self)
1047 self.irc = IrcWidget(self) 1092 self.irc = IrcWidget(self)
1048 self.rightSidebar.addTab( 1093 self.rightSidebar.addTab(
1049 self.irc, UI.PixmapCache.getIcon("irc.png"), 1094 self.irc, UI.PixmapCache.getIcon("irc.png"),
1050 self.tr("IRC")) 1095 self.tr("IRC"))
1051 1096
1097 ####################################################
1098 ## Populate the bottom side bar
1099 ####################################################
1100
1052 # Create the task viewer part of the user interface 1101 # Create the task viewer part of the user interface
1053 logging.debug("Creating Task Viewer...") 1102 logging.debug("Creating Task Viewer...")
1054 from Tasks.TaskViewer import TaskViewer 1103 from Tasks.TaskViewer import TaskViewer
1055 self.taskViewer = TaskViewer(None, self.project) 1104 self.taskViewer = TaskViewer(None, self.project)
1056 self.bottomSidebar.addTab(self.taskViewer, 1105 self.bottomSidebar.addTab(self.taskViewer,
1062 from .LogView import LogViewer 1111 from .LogView import LogViewer
1063 self.logViewer = LogViewer(self) 1112 self.logViewer = LogViewer(self)
1064 self.bottomSidebar.addTab(self.logViewer, 1113 self.bottomSidebar.addTab(self.logViewer,
1065 UI.PixmapCache.getIcon("logViewer.png"), 1114 UI.PixmapCache.getIcon("logViewer.png"),
1066 self.tr("Log-Viewer")) 1115 self.tr("Log-Viewer"))
1067
1068 # Create the shell
1069 # TODO: shell should be available in left or right sidebar
1070 # alternatively
1071 logging.debug("Creating Shell...")
1072 from QScintilla.Shell import ShellAssembly
1073 self.shellAssembly = \
1074 ShellAssembly(debugServer, self.viewmanager, self.project, True)
1075 self.shell = self.shellAssembly.shell()
1076 self.bottomSidebar.insertTab(0, self.shellAssembly,
1077 UI.PixmapCache.getIcon("shell.png"),
1078 self.tr("Shell"))
1079 1116
1080 if Preferences.getUI("ShowFileBrowser"): 1117 if Preferences.getUI("ShowFileBrowser"):
1081 # Create the file browser 1118 # Create the file browser
1082 logging.debug("Creating File Browser...") 1119 logging.debug("Creating File Browser...")
1083 from .Browser import Browser 1120 from .Browser import Browser
1102 self.numbersViewer = NumbersWidget() 1139 self.numbersViewer = NumbersWidget()
1103 self.bottomSidebar.addTab(self.numbersViewer, 1140 self.bottomSidebar.addTab(self.numbersViewer,
1104 UI.PixmapCache.getIcon("numbers.png"), 1141 UI.PixmapCache.getIcon("numbers.png"),
1105 self.tr("Numbers")) 1142 self.tr("Numbers"))
1106 1143
1144 ####################################################
1145 ## Populate the configurable widgets
1146 ####################################################
1147
1148 # Create the shell
1149 logging.debug("Creating Shell...")
1150 self.__shellPosition = Preferences.getUI("ShellPosition")
1151 if self.__shellPosition == "left":
1152 self.__shellParent = self.leftSidebar
1153 elif self.__shellPosition == "right":
1154 self.__shellParent = self.rightSidebar
1155 else:
1156 self.__shellParent = self.bottomSidebar
1157 from QScintilla.Shell import ShellAssembly
1158 self.shellAssembly = \
1159 ShellAssembly(debugServer, self.viewmanager, self.project, True)
1160 self.shell = self.shellAssembly.shell()
1161 self.__shellParent.insertTab(0, self.shellAssembly,
1162 UI.PixmapCache.getIcon("shell.png"),
1163 self.tr("Shell"))
1164
1165 ####################################################
1166 ## Set the start index of each side bar
1167 ####################################################
1168
1169 self.leftSidebar.setCurrentIndex(0)
1170 self.rightSidebar.setCurrentIndex(0)
1107 self.bottomSidebar.setCurrentIndex(0) 1171 self.bottomSidebar.setCurrentIndex(0)
1108 1172
1109 # create the central widget 1173 # create the central widget
1110 logging.debug("Creating central widget...") 1174 logging.debug("Creating central widget...")
1111 cw = self.centralWidget() # save the current central widget 1175 cw = self.centralWidget() # save the current central widget
2726 mb = self.menuBar() 2790 mb = self.menuBar()
2727 if Utilities.isLinuxPlatform() and \ 2791 if Utilities.isLinuxPlatform() and \
2728 not Preferences.getUI("UseNativeMenuBar"): 2792 not Preferences.getUI("UseNativeMenuBar"):
2729 mb.setNativeMenuBar(False) 2793 mb.setNativeMenuBar(False)
2730 2794
2795 ##############################################################
2796 ## File menu
2797 ##############################################################
2798
2731 self.__menus["file"] = self.viewmanager.initFileMenu() 2799 self.__menus["file"] = self.viewmanager.initFileMenu()
2732 mb.addMenu(self.__menus["file"]) 2800 mb.addMenu(self.__menus["file"])
2733 self.__menus["file"].addSeparator() 2801 self.__menus["file"].addSeparator()
2734 self.__menus["file"].addAction(self.saveSessionAct) 2802 self.__menus["file"].addAction(self.saveSessionAct)
2735 self.__menus["file"].addAction(self.loadSessionAct) 2803 self.__menus["file"].addAction(self.loadSessionAct)
2739 act = self.__menus["file"].actions()[0] 2807 act = self.__menus["file"].actions()[0]
2740 sep = self.__menus["file"].insertSeparator(act) 2808 sep = self.__menus["file"].insertSeparator(act)
2741 self.__menus["file"].insertAction(sep, self.newWindowAct) 2809 self.__menus["file"].insertAction(sep, self.newWindowAct)
2742 self.__menus["file"].aboutToShow.connect(self.__showFileMenu) 2810 self.__menus["file"].aboutToShow.connect(self.__showFileMenu)
2743 2811
2812 ##############################################################
2813 ## Edit menu
2814 ##############################################################
2815
2744 self.__menus["edit"] = self.viewmanager.initEditMenu() 2816 self.__menus["edit"] = self.viewmanager.initEditMenu()
2745 mb.addMenu(self.__menus["edit"]) 2817 mb.addMenu(self.__menus["edit"])
2746 2818
2819 ##############################################################
2820 ## Search menu
2821 ##############################################################
2822
2823 self.__menus["search"] = self.viewmanager.initSearchMenu()
2824 mb.addMenu(self.__menus["search"])
2825
2826 ##############################################################
2827 ## View menu
2828 ##############################################################
2829
2747 self.__menus["view"] = self.viewmanager.initViewMenu() 2830 self.__menus["view"] = self.viewmanager.initViewMenu()
2748 mb.addMenu(self.__menus["view"]) 2831 mb.addMenu(self.__menus["view"])
2832
2833 ##############################################################
2834 ## Bookmarks menu
2835 ##############################################################
2836
2837 self.__menus["bookmarks"] = self.viewmanager.initBookmarkMenu()
2838 mb.addMenu(self.__menus["bookmarks"])
2839 self.__menus["bookmarks"].setTearOffEnabled(True)
2840
2841 ##############################################################
2842 ## Multiproject menu
2843 ##############################################################
2844
2845 self.__menus["multiproject"] = self.multiProject.initMenu()
2846 mb.addMenu(self.__menus["multiproject"])
2847
2848 ##############################################################
2849 ## Project menu
2850 ##############################################################
2851
2852 self.__menus["project"], self.__menus["project_tools"] = \
2853 self.project.initMenus()
2854 mb.addMenu(self.__menus["project"])
2855 mb.addMenu(self.__menus["project_tools"])
2856
2857 ##############################################################
2858 ## Start and Debug menus
2859 ##############################################################
2749 2860
2750 self.__menus["start"], self.__menus["debug"] = \ 2861 self.__menus["start"], self.__menus["debug"] = \
2751 self.debuggerUI.initMenus() 2862 self.debuggerUI.initMenus()
2752 mb.addMenu(self.__menus["start"]) 2863 mb.addMenu(self.__menus["start"])
2753 mb.addMenu(self.__menus["debug"]) 2864 mb.addMenu(self.__menus["debug"])
2754 2865
2866 ##############################################################
2867 ## Extras menu
2868 ##############################################################
2869
2870 self.__menus["extras"] = QMenu(self.tr('E&xtras'), self)
2871 self.__menus["extras"].setTearOffEnabled(True)
2872 self.__menus["extras"].aboutToShow.connect(self.__showExtrasMenu)
2873 mb.addMenu(self.__menus["extras"])
2874 self.viewmanager.addToExtrasMenu(self.__menus["extras"])
2875
2876 ##############################################################
2877 ## Extras/Wizards menu
2878 ##############################################################
2879
2880 self.__menus["wizards"] = QMenu(self.tr('Wi&zards'), self)
2881 self.__menus["wizards"].setTearOffEnabled(True)
2882 self.__menus["wizards"].aboutToShow.connect(self.__showWizardsMenu)
2883 self.wizardsMenuAct = self.__menus["extras"].addMenu(
2884 self.__menus["wizards"])
2885 self.wizardsMenuAct.setEnabled(False)
2886
2887 ##############################################################
2888 ## Extras/Macros menu
2889 ##############################################################
2890
2891 self.__menus["macros"] = self.viewmanager.initMacroMenu()
2892 self.__menus["extras"].addMenu(self.__menus["macros"])
2893 self.__menus["extras"].addSeparator()
2894
2895 ##############################################################
2896 ## Extras/VirtualEnv Manager menu entries
2897 ##############################################################
2898
2899 self.__menus["extras"].addAction(self.virtualenvManagerAct)
2900 self.__menus["extras"].addAction(self.virtualenvConfigAct)
2901 self.__menus["extras"].addSeparator()
2902
2903 ##############################################################
2904 ## Extras/Plugins menu
2905 ##############################################################
2906
2907 pluginsMenu = QMenu(self.tr('P&lugins'), self)
2908 pluginsMenu.setIcon(UI.PixmapCache.getIcon("plugin.png"))
2909 pluginsMenu.setTearOffEnabled(True)
2910 pluginsMenu.addAction(self.pluginInfoAct)
2911 pluginsMenu.addAction(self.pluginInstallAct)
2912 pluginsMenu.addAction(self.pluginDeinstallAct)
2913 pluginsMenu.addSeparator()
2914 pluginsMenu.addAction(self.pluginRepoAct)
2915 pluginsMenu.addSeparator()
2916 pluginsMenu.addAction(
2917 self.tr("Configure..."), self.__pluginsConfigure)
2918
2919 self.__menus["extras"].addMenu(pluginsMenu)
2920 self.__menus["extras"].addSeparator()
2921
2922 ##############################################################
2923 ## Extras/Unittest menu
2924 ##############################################################
2925
2755 self.__menus["unittest"] = QMenu(self.tr('&Unittest'), self) 2926 self.__menus["unittest"] = QMenu(self.tr('&Unittest'), self)
2756 self.__menus["unittest"].setTearOffEnabled(True) 2927 self.__menus["unittest"].setTearOffEnabled(True)
2757 mb.addMenu(self.__menus["unittest"])
2758 self.__menus["unittest"].addAction(self.utDialogAct) 2928 self.__menus["unittest"].addAction(self.utDialogAct)
2759 self.__menus["unittest"].addSeparator() 2929 self.__menus["unittest"].addSeparator()
2760 self.__menus["unittest"].addAction(self.utRestartAct) 2930 self.__menus["unittest"].addAction(self.utRestartAct)
2761 self.__menus["unittest"].addAction(self.utRerunFailedAct) 2931 self.__menus["unittest"].addAction(self.utRerunFailedAct)
2762 self.__menus["unittest"].addSeparator() 2932 self.__menus["unittest"].addSeparator()
2763 self.__menus["unittest"].addAction(self.utScriptAct) 2933 self.__menus["unittest"].addAction(self.utScriptAct)
2764 self.__menus["unittest"].addAction(self.utProjectAct) 2934 self.__menus["unittest"].addAction(self.utProjectAct)
2765 2935
2766 self.__menus["multiproject"] = self.multiProject.initMenu() 2936 self.__menus["extras"].addMenu(self.__menus["unittest"])
2767 mb.addMenu(self.__menus["multiproject"])
2768
2769 self.__menus["project"] = self.project.initMenu()
2770 mb.addMenu(self.__menus["project"])
2771
2772 self.__menus["extras"] = QMenu(self.tr('E&xtras'), self)
2773 self.__menus["extras"].setTearOffEnabled(True)
2774 self.__menus["extras"].aboutToShow.connect(self.__showExtrasMenu)
2775 mb.addMenu(self.__menus["extras"])
2776 self.viewmanager.addToExtrasMenu(self.__menus["extras"])
2777 self.__menus["wizards"] = QMenu(self.tr('Wi&zards'), self)
2778 self.__menus["wizards"].setTearOffEnabled(True)
2779 self.__menus["wizards"].aboutToShow.connect(self.__showWizardsMenu)
2780 self.wizardsMenuAct = self.__menus["extras"].addMenu(
2781 self.__menus["wizards"])
2782 self.wizardsMenuAct.setEnabled(False)
2783 self.__menus["macros"] = self.viewmanager.initMacroMenu()
2784 self.__menus["extras"].addMenu(self.__menus["macros"])
2785 self.__menus["extras"].addSeparator() 2937 self.__menus["extras"].addSeparator()
2786 self.__menus["extras"].addAction(self.virtualenvManagerAct) 2938
2787 self.__menus["extras"].addAction(self.virtualenvConfigAct) 2939 ##############################################################
2940 ## Extras/Builtin,Plugin,User tools menus
2941 ##############################################################
2942
2788 self.toolGroupsMenu = QMenu(self.tr("Select Tool Group"), self) 2943 self.toolGroupsMenu = QMenu(self.tr("Select Tool Group"), self)
2789 self.toolGroupsMenu.aboutToShow.connect(self.__showToolGroupsMenu) 2944 self.toolGroupsMenu.aboutToShow.connect(self.__showToolGroupsMenu)
2790 self.toolGroupsMenu.triggered.connect(self.__toolGroupSelected) 2945 self.toolGroupsMenu.triggered.connect(self.__toolGroupSelected)
2791 self.toolGroupsMenuTriggered = False 2946 self.toolGroupsMenuTriggered = False
2792 self.__menus["extras"].addSeparator()
2793 self.__initToolsMenus(self.__menus["extras"]) 2947 self.__initToolsMenus(self.__menus["extras"])
2794 self.__menus["extras"].addSeparator() 2948 self.__menus["extras"].addSeparator()
2949
2950 ##############################################################
2951 ## Settings menu
2952 ##############################################################
2795 2953
2796 self.__menus["settings"] = QMenu(self.tr('Se&ttings'), self) 2954 self.__menus["settings"] = QMenu(self.tr('Se&ttings'), self)
2797 mb.addMenu(self.__menus["settings"]) 2955 mb.addMenu(self.__menus["settings"])
2798 self.__menus["settings"].setTearOffEnabled(True) 2956 self.__menus["settings"].setTearOffEnabled(True)
2957
2799 self.__menus["settings"].addAction(self.prefAct) 2958 self.__menus["settings"].addAction(self.prefAct)
2800 self.__menus["settings"].addAction(self.prefExportAct) 2959 self.__menus["settings"].addAction(self.prefExportAct)
2801 self.__menus["settings"].addAction(self.prefImportAct) 2960 self.__menus["settings"].addAction(self.prefImportAct)
2802 self.__menus["settings"].addSeparator() 2961 self.__menus["settings"].addSeparator()
2803 self.__menus["settings"].addAction(self.reloadAPIsAct) 2962 self.__menus["settings"].addAction(self.reloadAPIsAct)
2816 self.__menus["settings"].addSeparator() 2975 self.__menus["settings"].addSeparator()
2817 self.__menus["settings"].addAction(self.editMessageFilterAct) 2976 self.__menus["settings"].addAction(self.editMessageFilterAct)
2818 self.__menus["settings"].addSeparator() 2977 self.__menus["settings"].addSeparator()
2819 self.__menus["settings"].addAction(self.clearPrivateDataAct) 2978 self.__menus["settings"].addAction(self.clearPrivateDataAct)
2820 2979
2980 ##############################################################
2981 ## Window menu
2982 ##############################################################
2983
2821 self.__menus["window"] = QMenu(self.tr('&Window'), self) 2984 self.__menus["window"] = QMenu(self.tr('&Window'), self)
2822 mb.addMenu(self.__menus["window"]) 2985 mb.addMenu(self.__menus["window"])
2823 self.__menus["window"].setTearOffEnabled(True) 2986 self.__menus["window"].setTearOffEnabled(True)
2824 self.__menus["window"].aboutToShow.connect(self.__showWindowMenu) 2987 self.__menus["window"].aboutToShow.connect(self.__showWindowMenu)
2988
2989 ##############################################################
2990 ## Window/Windows menu
2991 ##############################################################
2825 2992
2826 self.__menus["subwindow"] = QMenu(self.tr("&Windows"), 2993 self.__menus["subwindow"] = QMenu(self.tr("&Windows"),
2827 self.__menus["window"]) 2994 self.__menus["window"])
2828 self.__menus["subwindow"].setTearOffEnabled(True) 2995 self.__menus["subwindow"].setTearOffEnabled(True)
2829 # left side 2996 # left side
2830 try: 2997 try:
2831 self.__menus["subwindow"].addSection(self.tr("Left Side")) 2998 self.__menus["subwindow"].addSection(self.tr("Left Side"))
2832 except AttributeError: 2999 except AttributeError:
2833 # Qt4 3000 # Qt4
2834 pass 3001 pass
3002 if self.__shellPosition == "left":
3003 self.__menus["subwindow"].addAction(self.shellActivateAct)
2835 self.__menus["subwindow"].addAction(self.pbActivateAct) 3004 self.__menus["subwindow"].addAction(self.pbActivateAct)
2836 self.__menus["subwindow"].addAction(self.mpbActivateAct) 3005 self.__menus["subwindow"].addAction(self.mpbActivateAct)
2837 if self.templateViewer is not None: 3006 if self.templateViewer is not None:
2838 self.__menus["subwindow"].addAction(self.templateViewerActivateAct) 3007 self.__menus["subwindow"].addAction(self.templateViewerActivateAct)
2839 if self.browser is not None: 3008 if self.browser is not None:
2844 try: 3013 try:
2845 self.__menus["subwindow"].addSection(self.tr("Bottom Side")) 3014 self.__menus["subwindow"].addSection(self.tr("Bottom Side"))
2846 except AttributeError: 3015 except AttributeError:
2847 # Qt4 3016 # Qt4
2848 self.__menus["subwindow"].addSeparator() 3017 self.__menus["subwindow"].addSeparator()
2849 self.__menus["subwindow"].addAction(self.shellActivateAct) 3018 if self.__shellPosition == "bottom":
3019 self.__menus["subwindow"].addAction(self.shellActivateAct)
2850 self.__menus["subwindow"].addAction(self.taskViewerActivateAct) 3020 self.__menus["subwindow"].addAction(self.taskViewerActivateAct)
2851 self.__menus["subwindow"].addAction(self.logViewerActivateAct) 3021 self.__menus["subwindow"].addAction(self.logViewerActivateAct)
2852 if self.numbersViewer is not None: 3022 if self.numbersViewer is not None:
2853 self.__menus["subwindow"].addAction(self.numbersViewerActivateAct) 3023 self.__menus["subwindow"].addAction(self.numbersViewerActivateAct)
2854 try: 3024 try:
2855 self.__menus["subwindow"].addSection(self.tr("Right Side")) 3025 self.__menus["subwindow"].addSection(self.tr("Right Side"))
2856 except AttributeError: 3026 except AttributeError:
2857 # Qt4 3027 # Qt4
2858 self.__menus["subwindow"].addSeparator() 3028 self.__menus["subwindow"].addSeparator()
2859 # right side 3029 # right side
3030 if self.__shellPosition == "right":
3031 self.__menus["subwindow"].addAction(self.shellActivateAct)
2860 if self.codeDocumentationViewer is not None: 3032 if self.codeDocumentationViewer is not None:
2861 self.__menus["subwindow"].addAction( 3033 self.__menus["subwindow"].addAction(
2862 self.tr("Code Documentation Viewer"), 3034 self.tr("Code Documentation Viewer"),
2863 self.activateCodeDocumentationViewer) 3035 self.activateCodeDocumentationViewer)
2864 self.__menus["subwindow"].addAction(self.debugViewerActivateAct) 3036 self.__menus["subwindow"].addAction(self.debugViewerActivateAct)
2879 self.__menus["subwindow"].addSection(self.tr("Plug-ins")) 3051 self.__menus["subwindow"].addSection(self.tr("Plug-ins"))
2880 except AttributeError: 3052 except AttributeError:
2881 # Qt4 3053 # Qt4
2882 self.__menus["subwindow"].addSeparator() 3054 self.__menus["subwindow"].addSeparator()
2883 3055
3056 ##############################################################
3057 ## Window/Toolbars menu
3058 ##############################################################
3059
2884 self.__menus["toolbars"] = \ 3060 self.__menus["toolbars"] = \
2885 QMenu(self.tr("&Toolbars"), self.__menus["window"]) 3061 QMenu(self.tr("&Toolbars"), self.__menus["window"])
2886 self.__menus["toolbars"].setTearOffEnabled(True) 3062 self.__menus["toolbars"].setTearOffEnabled(True)
2887 self.__menus["toolbars"].aboutToShow.connect(self.__showToolbarsMenu) 3063 self.__menus["toolbars"].aboutToShow.connect(self.__showToolbarsMenu)
2888 self.__menus["toolbars"].triggered.connect(self.__TBMenuTriggered) 3064 self.__menus["toolbars"].triggered.connect(self.__TBMenuTriggered)
2889 3065
2890 self.__showWindowMenu() # to initialize these actions 3066 self.__showWindowMenu() # to initialize these actions
2891 3067
2892 self.__menus["bookmarks"] = self.viewmanager.initBookmarkMenu()
2893 mb.addMenu(self.__menus["bookmarks"])
2894 self.__menus["bookmarks"].setTearOffEnabled(True)
2895
2896 self.__menus["plugins"] = QMenu(self.tr('P&lugins'), self)
2897 mb.addMenu(self.__menus["plugins"])
2898 self.__menus["plugins"].setTearOffEnabled(True)
2899 self.__menus["plugins"].addAction(self.pluginInfoAct)
2900 self.__menus["plugins"].addAction(self.pluginInstallAct)
2901 self.__menus["plugins"].addAction(self.pluginDeinstallAct)
2902 self.__menus["plugins"].addSeparator()
2903 self.__menus["plugins"].addAction(self.pluginRepoAct)
2904 self.__menus["plugins"].addSeparator()
2905 self.__menus["plugins"].addAction(
2906 self.tr("Configure..."), self.__pluginsConfigure)
2907
2908 mb.addSeparator() 3068 mb.addSeparator()
2909 3069
3070 ##############################################################
3071 ## Help menu
3072 ##############################################################
3073
2910 self.__menus["help"] = QMenu(self.tr('&Help'), self) 3074 self.__menus["help"] = QMenu(self.tr('&Help'), self)
2911 mb.addMenu(self.__menus["help"]) 3075 mb.addMenu(self.__menus["help"])
2912 self.__menus["help"].setTearOffEnabled(True) 3076 self.__menus["help"].setTearOffEnabled(True)
2913 if self.helpviewerAct: 3077 if self.helpviewerAct:
2914 self.__menus["help"].addAction(self.helpviewerAct) 3078 self.__menus["help"].addAction(self.helpviewerAct)
4186 self.lToolboxDock.show() 4350 self.lToolboxDock.show()
4187 self.lToolbox.setCurrentWidget(self.projectBrowser) 4351 self.lToolbox.setCurrentWidget(self.projectBrowser)
4188 elif self.__layoutType == "Sidebars": 4352 elif self.__layoutType == "Sidebars":
4189 self.leftSidebar.show() 4353 self.leftSidebar.show()
4190 self.leftSidebar.setCurrentWidget(self.projectBrowser) 4354 self.leftSidebar.setCurrentWidget(self.projectBrowser)
4191 else:
4192 self.projectBrowser.show()
4193 self.projectBrowser.currentWidget().setFocus( 4355 self.projectBrowser.currentWidget().setFocus(
4194 Qt.ActiveWindowFocusReason) 4356 Qt.ActiveWindowFocusReason)
4195 4357
4196 def __activateMultiProjectBrowser(self): 4358 def __activateMultiProjectBrowser(self):
4197 """ 4359 """
4201 self.lToolboxDock.show() 4363 self.lToolboxDock.show()
4202 self.lToolbox.setCurrentWidget(self.multiProjectBrowser) 4364 self.lToolbox.setCurrentWidget(self.multiProjectBrowser)
4203 elif self.__layoutType == "Sidebars": 4365 elif self.__layoutType == "Sidebars":
4204 self.leftSidebar.show() 4366 self.leftSidebar.show()
4205 self.leftSidebar.setCurrentWidget(self.multiProjectBrowser) 4367 self.leftSidebar.setCurrentWidget(self.multiProjectBrowser)
4206 else:
4207 self.multiProjectBrowser.show()
4208 self.multiProjectBrowser.setFocus(Qt.ActiveWindowFocusReason) 4368 self.multiProjectBrowser.setFocus(Qt.ActiveWindowFocusReason)
4209 4369
4210 def activateDebugViewer(self): 4370 def activateDebugViewer(self):
4211 """ 4371 """
4212 Public slot to handle the activation of the debug viewer. 4372 Public slot to handle the activation of the debug viewer.
4215 self.rToolboxDock.show() 4375 self.rToolboxDock.show()
4216 self.rToolbox.setCurrentWidget(self.debugViewer) 4376 self.rToolbox.setCurrentWidget(self.debugViewer)
4217 elif self.__layoutType == "Sidebars": 4377 elif self.__layoutType == "Sidebars":
4218 self.rightSidebar.show() 4378 self.rightSidebar.show()
4219 self.rightSidebar.setCurrentWidget(self.debugViewer) 4379 self.rightSidebar.setCurrentWidget(self.debugViewer)
4220 else:
4221 self.debugViewer.show()
4222 self.debugViewer.currentWidget().setFocus(Qt.ActiveWindowFocusReason) 4380 self.debugViewer.currentWidget().setFocus(Qt.ActiveWindowFocusReason)
4223 4381
4224 def __activateShell(self): 4382 def __activateShell(self):
4225 """ 4383 """
4226 Private slot to handle the activation of the Shell window. 4384 Private slot to handle the activation of the Shell window.
4227 """ 4385 """
4228 if self.__layoutType == "Toolboxes": 4386 if self.__layoutType == "Toolboxes":
4229 self.hToolboxDock.show() 4387 self.__shellParent.show()
4230 self.hToolbox.setCurrentWidget(self.shellAssembly) 4388 self.__shellParent.widget().setCurrentWidget(self.shellAssembly)
4231 elif self.__layoutType == "Sidebars": 4389 elif self.__layoutType == "Sidebars":
4232 self.bottomSidebar.show() 4390 self.__shellParent.show()
4233 self.bottomSidebar.setCurrentWidget(self.shellAssembly) 4391 self.__shellParent.setCurrentWidget(self.shellAssembly)
4234 else:
4235 self.shell.show()
4236 self.shell.setFocus(Qt.ActiveWindowFocusReason) 4392 self.shell.setFocus(Qt.ActiveWindowFocusReason)
4237 4393
4238 def __activateLogViewer(self): 4394 def __activateLogViewer(self):
4239 """ 4395 """
4240 Private slot to handle the activation of the Log Viewer. 4396 Private slot to handle the activation of the Log Viewer.
4243 self.hToolboxDock.show() 4399 self.hToolboxDock.show()
4244 self.hToolbox.setCurrentWidget(self.logViewer) 4400 self.hToolbox.setCurrentWidget(self.logViewer)
4245 elif self.__layoutType == "Sidebars": 4401 elif self.__layoutType == "Sidebars":
4246 self.bottomSidebar.show() 4402 self.bottomSidebar.show()
4247 self.bottomSidebar.setCurrentWidget(self.logViewer) 4403 self.bottomSidebar.setCurrentWidget(self.logViewer)
4248 else:
4249 self.logViewer.show()
4250 self.logViewer.setFocus(Qt.ActiveWindowFocusReason) 4404 self.logViewer.setFocus(Qt.ActiveWindowFocusReason)
4251 4405
4252 def __activateTaskViewer(self): 4406 def __activateTaskViewer(self):
4253 """ 4407 """
4254 Private slot to handle the activation of the Task Viewer. 4408 Private slot to handle the activation of the Task Viewer.
4257 self.hToolboxDock.show() 4411 self.hToolboxDock.show()
4258 self.hToolbox.setCurrentWidget(self.taskViewer) 4412 self.hToolbox.setCurrentWidget(self.taskViewer)
4259 elif self.__layoutType == "Sidebars": 4413 elif self.__layoutType == "Sidebars":
4260 self.bottomSidebar.show() 4414 self.bottomSidebar.show()
4261 self.bottomSidebar.setCurrentWidget(self.taskViewer) 4415 self.bottomSidebar.setCurrentWidget(self.taskViewer)
4262 else:
4263 self.taskViewer.show()
4264 self.taskViewer.setFocus(Qt.ActiveWindowFocusReason) 4416 self.taskViewer.setFocus(Qt.ActiveWindowFocusReason)
4265 4417
4266 def __activateTemplateViewer(self): 4418 def __activateTemplateViewer(self):
4267 """ 4419 """
4268 Private slot to handle the activation of the Template Viewer. 4420 Private slot to handle the activation of the Template Viewer.
4272 self.lToolboxDock.show() 4424 self.lToolboxDock.show()
4273 self.lToolbox.setCurrentWidget(self.templateViewer) 4425 self.lToolbox.setCurrentWidget(self.templateViewer)
4274 elif self.__layoutType == "Sidebars": 4426 elif self.__layoutType == "Sidebars":
4275 self.leftSidebar.show() 4427 self.leftSidebar.show()
4276 self.leftSidebar.setCurrentWidget(self.templateViewer) 4428 self.leftSidebar.setCurrentWidget(self.templateViewer)
4277 else:
4278 self.templateViewer.show()
4279 self.templateViewer.setFocus(Qt.ActiveWindowFocusReason) 4429 self.templateViewer.setFocus(Qt.ActiveWindowFocusReason)
4280 4430
4281 def __activateBrowser(self): 4431 def __activateBrowser(self):
4282 """ 4432 """
4283 Private slot to handle the activation of the file browser. 4433 Private slot to handle the activation of the file browser.
4287 self.lToolboxDock.show() 4437 self.lToolboxDock.show()
4288 self.lToolbox.setCurrentWidget(self.browser) 4438 self.lToolbox.setCurrentWidget(self.browser)
4289 elif self.__layoutType == "Sidebars": 4439 elif self.__layoutType == "Sidebars":
4290 self.leftSidebar.show() 4440 self.leftSidebar.show()
4291 self.leftSidebar.setCurrentWidget(self.browser) 4441 self.leftSidebar.setCurrentWidget(self.browser)
4292 else:
4293 self.browser.show()
4294 self.browser.setFocus(Qt.ActiveWindowFocusReason) 4442 self.browser.setFocus(Qt.ActiveWindowFocusReason)
4295 4443
4296 def __toggleLeftToolbox(self): 4444 def __toggleLeftToolbox(self):
4297 """ 4445 """
4298 Private slot to handle the toggle of the Left Toolbox window. 4446 Private slot to handle the toggle of the Left Toolbox window.
4377 self.rToolboxDock.show() 4525 self.rToolboxDock.show()
4378 self.rToolbox.setCurrentWidget(self.cooperation) 4526 self.rToolbox.setCurrentWidget(self.cooperation)
4379 elif self.__layoutType == "Sidebars": 4527 elif self.__layoutType == "Sidebars":
4380 self.rightSidebar.show() 4528 self.rightSidebar.show()
4381 self.rightSidebar.setCurrentWidget(self.cooperation) 4529 self.rightSidebar.setCurrentWidget(self.cooperation)
4382 else:
4383 self.cooperation.show()
4384 self.cooperation.setFocus(Qt.ActiveWindowFocusReason) 4530 self.cooperation.setFocus(Qt.ActiveWindowFocusReason)
4385 4531
4386 def __activateIRC(self): 4532 def __activateIRC(self):
4387 """ 4533 """
4388 Private slot to handle the activation of the IRC window. 4534 Private slot to handle the activation of the IRC window.
4392 self.rToolboxDock.show() 4538 self.rToolboxDock.show()
4393 self.rToolbox.setCurrentWidget(self.irc) 4539 self.rToolbox.setCurrentWidget(self.irc)
4394 elif self.__layoutType == "Sidebars": 4540 elif self.__layoutType == "Sidebars":
4395 self.rightSidebar.show() 4541 self.rightSidebar.show()
4396 self.rightSidebar.setCurrentWidget(self.irc) 4542 self.rightSidebar.setCurrentWidget(self.irc)
4397 else:
4398 self.irc.show()
4399 self.irc.setFocus(Qt.ActiveWindowFocusReason) 4543 self.irc.setFocus(Qt.ActiveWindowFocusReason)
4400 4544
4401 def __activateSymbolsViewer(self): 4545 def __activateSymbolsViewer(self):
4402 """ 4546 """
4403 Private slot to handle the activation of the Symbols Viewer. 4547 Private slot to handle the activation of the Symbols Viewer.
4407 self.lToolboxDock.show() 4551 self.lToolboxDock.show()
4408 self.lToolbox.setCurrentWidget(self.symbolsViewer) 4552 self.lToolbox.setCurrentWidget(self.symbolsViewer)
4409 elif self.__layoutType == "Sidebars": 4553 elif self.__layoutType == "Sidebars":
4410 self.leftSidebar.show() 4554 self.leftSidebar.show()
4411 self.leftSidebar.setCurrentWidget(self.symbolsViewer) 4555 self.leftSidebar.setCurrentWidget(self.symbolsViewer)
4412 else:
4413 self.symbolsViewer.show()
4414 self.symbolsViewer.setFocus(Qt.ActiveWindowFocusReason) 4556 self.symbolsViewer.setFocus(Qt.ActiveWindowFocusReason)
4415 4557
4416 def __activateNumbersViewer(self): 4558 def __activateNumbersViewer(self):
4417 """ 4559 """
4418 Private slot to handle the activation of the Numbers Viewer. 4560 Private slot to handle the activation of the Numbers Viewer.
4422 self.hToolboxDock.show() 4564 self.hToolboxDock.show()
4423 self.hToolbox.setCurrentWidget(self.numbersViewer) 4565 self.hToolbox.setCurrentWidget(self.numbersViewer)
4424 elif self.__layoutType == "Sidebars": 4566 elif self.__layoutType == "Sidebars":
4425 self.bottomSidebar.show() 4567 self.bottomSidebar.show()
4426 self.bottomSidebar.setCurrentWidget(self.numbersViewer) 4568 self.bottomSidebar.setCurrentWidget(self.numbersViewer)
4427 else:
4428 self.numbersViewer.show()
4429 self.numbersViewer.setFocus(Qt.ActiveWindowFocusReason) 4569 self.numbersViewer.setFocus(Qt.ActiveWindowFocusReason)
4430 4570
4431 def __activateViewmanager(self): 4571 def __activateViewmanager(self):
4432 """ 4572 """
4433 Private slot to handle the activation of the current editor. 4573 Private slot to handle the activation of the current editor.
4449 self.rToolbox.setCurrentWidget(self.codeDocumentationViewer) 4589 self.rToolbox.setCurrentWidget(self.codeDocumentationViewer)
4450 elif self.__layoutType == "Sidebars": 4590 elif self.__layoutType == "Sidebars":
4451 self.rightSidebar.show() 4591 self.rightSidebar.show()
4452 self.rightSidebar.setCurrentWidget( 4592 self.rightSidebar.setCurrentWidget(
4453 self.codeDocumentationViewer) 4593 self.codeDocumentationViewer)
4454 else:
4455 self.codeDocumentationViewer.show()
4456 if switchFocus: 4594 if switchFocus:
4457 self.codeDocumentationViewer.setFocus( 4595 self.codeDocumentationViewer.setFocus(
4458 Qt.ActiveWindowFocusReason) 4596 Qt.ActiveWindowFocusReason)
4459 4597
4460 def __activatePipWidget(self): 4598 def __activatePipWidget(self):
4466 self.rToolboxDock.show() 4604 self.rToolboxDock.show()
4467 self.rToolbox.setCurrentWidget(self.pipWidget) 4605 self.rToolbox.setCurrentWidget(self.pipWidget)
4468 elif self.__layoutType == "Sidebars": 4606 elif self.__layoutType == "Sidebars":
4469 self.rightSidebar.show() 4607 self.rightSidebar.show()
4470 self.rightSidebar.setCurrentWidget(self.pipWidget) 4608 self.rightSidebar.setCurrentWidget(self.pipWidget)
4471 else:
4472 self.pipWidget.show()
4473 self.pipWidget.setFocus(Qt.ActiveWindowFocusReason) 4609 self.pipWidget.setFocus(Qt.ActiveWindowFocusReason)
4474 4610
4475 def __activateCondaWidget(self): 4611 def __activateCondaWidget(self):
4476 """ 4612 """
4477 Private slot to handle the activation of the Conda manager widget. 4613 Private slot to handle the activation of the Conda manager widget.
4481 self.rToolboxDock.show() 4617 self.rToolboxDock.show()
4482 self.rToolbox.setCurrentWidget(self.condaWidget) 4618 self.rToolbox.setCurrentWidget(self.condaWidget)
4483 elif self.__layoutType == "Sidebars": 4619 elif self.__layoutType == "Sidebars":
4484 self.rightSidebar.show() 4620 self.rightSidebar.show()
4485 self.rightSidebar.setCurrentWidget(self.condaWidget) 4621 self.rightSidebar.setCurrentWidget(self.condaWidget)
4486 else:
4487 self.condaWidget.show()
4488 self.condaWidget.setFocus(Qt.ActiveWindowFocusReason) 4622 self.condaWidget.setFocus(Qt.ActiveWindowFocusReason)
4489 4623
4490 def __toggleWindow(self, w): 4624 def __toggleWindow(self, w):
4491 """ 4625 """
4492 Private method to toggle a workspace editor window. 4626 Private method to toggle a workspace editor window.
5843 """ 5977 """
5844 Public slot to set the preferences. 5978 Public slot to set the preferences.
5845 5979
5846 @param pageName name of the configuration page to show (string) 5980 @param pageName name of the configuration page to show (string)
5847 """ 5981 """
5848 from Preferences.ConfigurationDialog import ConfigurationDialog 5982 if self.__configurationDialog is None:
5849 dlg = ConfigurationDialog( 5983 # only one invocation at a time is allowed
5850 self, 'Configuration', 5984 from Preferences.ConfigurationDialog import ConfigurationDialog
5851 expandedEntries=self.__expandedConfigurationEntries, 5985 self.__configurationDialog = ConfigurationDialog(
5852 ) 5986 self, 'Configuration',
5853 dlg.preferencesChanged.connect(self.__preferencesChanged) 5987 expandedEntries=self.__expandedConfigurationEntries,
5854 dlg.masterPasswordChanged.connect(self.__masterPasswordChanged) 5988 )
5855 dlg.show() 5989 self.__configurationDialog.preferencesChanged.connect(
5856 if pageName is not None: 5990 self.__preferencesChanged)
5857 dlg.showConfigurationPageByName(pageName) 5991 self.__configurationDialog.masterPasswordChanged.connect(
5858 elif self.__lastConfigurationPageName: 5992 self.__masterPasswordChanged)
5859 dlg.showConfigurationPageByName(self.__lastConfigurationPageName) 5993 self.__configurationDialog.show()
5860 else: 5994 if pageName is not None:
5861 dlg.showConfigurationPageByName("empty") 5995 self.__configurationDialog.showConfigurationPageByName(
5862 dlg.exec_() 5996 pageName)
5863 QApplication.processEvents() 5997 elif self.__lastConfigurationPageName:
5864 if dlg.result() == QDialog.Accepted: 5998 self.__configurationDialog.showConfigurationPageByName(
5865 dlg.setPreferences() 5999 self.__lastConfigurationPageName)
5866 Preferences.syncPreferences() 6000 else:
5867 self.__preferencesChanged() 6001 self.__configurationDialog.showConfigurationPageByName("empty")
5868 self.__lastConfigurationPageName = dlg.getConfigurationPageName() 6002 self.__configurationDialog.exec_()
5869 self.__expandedConfigurationEntries = dlg.getExpandedEntries() 6003 QApplication.processEvents()
6004 if self.__configurationDialog.result() == QDialog.Accepted:
6005 self.__configurationDialog.setPreferences()
6006 Preferences.syncPreferences()
6007 self.__preferencesChanged()
6008 self.__lastConfigurationPageName = \
6009 self.__configurationDialog.getConfigurationPageName()
6010 self.__expandedConfigurationEntries = \
6011 self.__configurationDialog.getExpandedEntries()
6012
6013 self.__configurationDialog.deleteLater()
6014 self.__configurationDialog = None
5870 6015
5871 def __exportPreferences(self): 6016 def __exportPreferences(self):
5872 """ 6017 """
5873 Private slot to export the current preferences. 6018 Private slot to export the current preferences.
5874 """ 6019 """

eric ide

mercurial