eric6/UI/UserInterface.py

changeset 6998
a63ca2373f44
parent 6987
3371a03ed0a7
child 7005
342819f05839
equal deleted inserted replaced
6997:24eabcea4c59 6998:a63ca2373f44
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(
807 self.rToolboxDock = self.__createDockWindow("rToolboxDock") 808 self.rToolboxDock = self.__createDockWindow("rToolboxDock")
808 self.rToolbox = E5VerticalToolBox(self.rToolboxDock) 809 self.rToolbox = E5VerticalToolBox(self.rToolboxDock)
809 self.__setupDockWindow(self.rToolboxDock, Qt.RightDockWidgetArea, 810 self.__setupDockWindow(self.rToolboxDock, Qt.RightDockWidgetArea,
810 self.rToolbox, self.tr("Right Toolbox")) 811 self.rToolbox, self.tr("Right Toolbox"))
811 812
813 ####################################################
814 ## Populate the left toolbox
815 ####################################################
816
812 # Create the project browser 817 # Create the project browser
813 logging.debug("Creating Project Browser...") 818 logging.debug("Creating Project Browser...")
814 from Project.ProjectBrowser import ProjectBrowser 819 from Project.ProjectBrowser import ProjectBrowser
815 self.projectBrowser = ProjectBrowser(self.project) 820 self.projectBrowser = ProjectBrowser(self.project)
816 self.lToolbox.addItem(self.projectBrowser, 821 self.lToolbox.addItem(self.projectBrowser,
834 self.viewmanager) 839 self.viewmanager)
835 self.lToolbox.addItem(self.templateViewer, 840 self.lToolbox.addItem(self.templateViewer,
836 UI.PixmapCache.getIcon("templateViewer.png"), 841 UI.PixmapCache.getIcon("templateViewer.png"),
837 self.tr("Template-Viewer")) 842 self.tr("Template-Viewer"))
838 843
844 ####################################################
845 ## Populate the right toolbox
846 ####################################################
847
839 if Preferences.getUI("ShowCodeDocumentationViewer"): 848 if Preferences.getUI("ShowCodeDocumentationViewer"):
840 # Create the code documentation viewer 849 # Create the code documentation viewer
841 logging.debug("Creating Code Documentation Viewer...") 850 logging.debug("Creating Code Documentation Viewer...")
842 from .CodeDocumentationViewer import CodeDocumentationViewer 851 from .CodeDocumentationViewer import CodeDocumentationViewer
843 self.codeDocumentationViewer = CodeDocumentationViewer(self) 852 self.codeDocumentationViewer = CodeDocumentationViewer(self)
887 self.irc = IrcWidget(self) 896 self.irc = IrcWidget(self)
888 self.rToolbox.addItem(self.irc, 897 self.rToolbox.addItem(self.irc,
889 UI.PixmapCache.getIcon("irc.png"), 898 UI.PixmapCache.getIcon("irc.png"),
890 self.tr("IRC")) 899 self.tr("IRC"))
891 900
901 ####################################################
902 ## Populate the bottom toolbox
903 ####################################################
904
892 # Create the task viewer part of the user interface 905 # Create the task viewer part of the user interface
893 logging.debug("Creating Task Viewer...") 906 logging.debug("Creating Task Viewer...")
894 from Tasks.TaskViewer import TaskViewer 907 from Tasks.TaskViewer import TaskViewer
895 self.taskViewer = TaskViewer(None, self.project) 908 self.taskViewer = TaskViewer(None, self.project)
896 self.hToolbox.addItem(self.taskViewer, 909 self.hToolbox.addItem(self.taskViewer,
903 self.logViewer = LogViewer(self) 916 self.logViewer = LogViewer(self)
904 self.hToolbox.addItem(self.logViewer, 917 self.hToolbox.addItem(self.logViewer,
905 UI.PixmapCache.getIcon("logViewer.png"), 918 UI.PixmapCache.getIcon("logViewer.png"),
906 self.tr("Log-Viewer")) 919 self.tr("Log-Viewer"))
907 920
908 # Create the shell
909 # TODO: shell should be available in left or right toolbox
910 # alternatively
911 logging.debug("Creating Shell...")
912 from QScintilla.Shell import ShellAssembly
913 self.shellAssembly = \
914 ShellAssembly(debugServer, self.viewmanager, self.project, True)
915 self.shell = self.shellAssembly.shell()
916 self.hToolbox.insertItem(0, self.shellAssembly,
917 UI.PixmapCache.getIcon("shell.png"),
918 self.tr("Shell"))
919
920 if Preferences.getUI("ShowFileBrowser"): 921 if Preferences.getUI("ShowFileBrowser"):
921 # Create the file browser 922 # Create the file browser
922 logging.debug("Creating File Browser...") 923 logging.debug("Creating File Browser...")
923 from .Browser import Browser 924 from .Browser import Browser
924 self.browser = Browser() 925 self.browser = Browser()
942 self.numbersViewer = NumbersWidget() 943 self.numbersViewer = NumbersWidget()
943 self.hToolbox.addItem(self.numbersViewer, 944 self.hToolbox.addItem(self.numbersViewer,
944 UI.PixmapCache.getIcon("numbers.png"), 945 UI.PixmapCache.getIcon("numbers.png"),
945 self.tr("Numbers")) 946 self.tr("Numbers"))
946 947
948 ####################################################
949 ## Populate the configurable widgets
950 ####################################################
951
952 # Create the shell
953 logging.debug("Creating Shell...")
954 self.__shellPosition = Preferences.getUI("ShellPosition")
955 if self.__shellPosition == "left":
956 self.__shellParent = self.lToolboxDock
957 elif self.__shellPosition == "right":
958 self.__shellParent = self.rToolboxDock
959 else:
960 self.__shellParent = self.hToolboxDock
961 from QScintilla.Shell import ShellAssembly
962 self.shellAssembly = \
963 ShellAssembly(debugServer, self.viewmanager, self.project, True)
964 self.shell = self.shellAssembly.shell()
965 self.__shellParent.widget().insertItem(
966 0, self.shellAssembly, UI.PixmapCache.getIcon("shell.png"),
967 self.tr("Shell"))
968
969 ####################################################
970 ## Set the start index of each toolbox
971 ####################################################
972
973 self.lToolbox.setCurrentIndex(0)
974 self.rToolbox.setCurrentIndex(0)
947 self.hToolbox.setCurrentIndex(0) 975 self.hToolbox.setCurrentIndex(0)
948 976
949 def __createSidebarsLayout(self, debugServer): 977 def __createSidebarsLayout(self, debugServer):
950 """ 978 """
951 Private method to create the Sidebars layout. 979 Private method to create the Sidebars layout.
963 # Create the bottom sidebar 991 # Create the bottom sidebar
964 self.bottomSidebar = E5SideBar(E5SideBar.South, delay) 992 self.bottomSidebar = E5SideBar(E5SideBar.South, delay)
965 993
966 # Create the right sidebar 994 # Create the right sidebar
967 self.rightSidebar = E5SideBar(E5SideBar.East, delay) 995 self.rightSidebar = E5SideBar(E5SideBar.East, delay)
996
997 ####################################################
998 ## Populate the left side bar
999 ####################################################
968 1000
969 # Create the project browser 1001 # Create the project browser
970 logging.debug("Creating Project Browser...") 1002 logging.debug("Creating Project Browser...")
971 from Project.ProjectBrowser import ProjectBrowser 1003 from Project.ProjectBrowser import ProjectBrowser
972 self.projectBrowser = ProjectBrowser(self.project) 1004 self.projectBrowser = ProjectBrowser(self.project)
994 self.leftSidebar.addTab( 1026 self.leftSidebar.addTab(
995 self.templateViewer, 1027 self.templateViewer,
996 UI.PixmapCache.getIcon("templateViewer.png"), 1028 UI.PixmapCache.getIcon("templateViewer.png"),
997 self.tr("Template-Viewer")) 1029 self.tr("Template-Viewer"))
998 1030
1031 ####################################################
1032 ## Populate the right side bar
1033 ####################################################
1034
999 if Preferences.getUI("ShowCodeDocumentationViewer"): 1035 if Preferences.getUI("ShowCodeDocumentationViewer"):
1000 # Create the code documentation viewer 1036 # Create the code documentation viewer
1001 logging.debug("Creating Code Documentation Viewer...") 1037 logging.debug("Creating Code Documentation Viewer...")
1002 from .CodeDocumentationViewer import CodeDocumentationViewer 1038 from .CodeDocumentationViewer import CodeDocumentationViewer
1003 self.codeDocumentationViewer = CodeDocumentationViewer(self) 1039 self.codeDocumentationViewer = CodeDocumentationViewer(self)
1048 self.irc = IrcWidget(self) 1084 self.irc = IrcWidget(self)
1049 self.rightSidebar.addTab( 1085 self.rightSidebar.addTab(
1050 self.irc, UI.PixmapCache.getIcon("irc.png"), 1086 self.irc, UI.PixmapCache.getIcon("irc.png"),
1051 self.tr("IRC")) 1087 self.tr("IRC"))
1052 1088
1089 ####################################################
1090 ## Populate the bottom side bar
1091 ####################################################
1092
1053 # Create the task viewer part of the user interface 1093 # Create the task viewer part of the user interface
1054 logging.debug("Creating Task Viewer...") 1094 logging.debug("Creating Task Viewer...")
1055 from Tasks.TaskViewer import TaskViewer 1095 from Tasks.TaskViewer import TaskViewer
1056 self.taskViewer = TaskViewer(None, self.project) 1096 self.taskViewer = TaskViewer(None, self.project)
1057 self.bottomSidebar.addTab(self.taskViewer, 1097 self.bottomSidebar.addTab(self.taskViewer,
1063 from .LogView import LogViewer 1103 from .LogView import LogViewer
1064 self.logViewer = LogViewer(self) 1104 self.logViewer = LogViewer(self)
1065 self.bottomSidebar.addTab(self.logViewer, 1105 self.bottomSidebar.addTab(self.logViewer,
1066 UI.PixmapCache.getIcon("logViewer.png"), 1106 UI.PixmapCache.getIcon("logViewer.png"),
1067 self.tr("Log-Viewer")) 1107 self.tr("Log-Viewer"))
1068
1069 # Create the shell
1070 # TODO: shell should be available in left or right sidebar
1071 # alternatively
1072 logging.debug("Creating Shell...")
1073 from QScintilla.Shell import ShellAssembly
1074 self.shellAssembly = \
1075 ShellAssembly(debugServer, self.viewmanager, self.project, True)
1076 self.shell = self.shellAssembly.shell()
1077 self.bottomSidebar.insertTab(0, self.shellAssembly,
1078 UI.PixmapCache.getIcon("shell.png"),
1079 self.tr("Shell"))
1080 1108
1081 if Preferences.getUI("ShowFileBrowser"): 1109 if Preferences.getUI("ShowFileBrowser"):
1082 # Create the file browser 1110 # Create the file browser
1083 logging.debug("Creating File Browser...") 1111 logging.debug("Creating File Browser...")
1084 from .Browser import Browser 1112 from .Browser import Browser
1103 self.numbersViewer = NumbersWidget() 1131 self.numbersViewer = NumbersWidget()
1104 self.bottomSidebar.addTab(self.numbersViewer, 1132 self.bottomSidebar.addTab(self.numbersViewer,
1105 UI.PixmapCache.getIcon("numbers.png"), 1133 UI.PixmapCache.getIcon("numbers.png"),
1106 self.tr("Numbers")) 1134 self.tr("Numbers"))
1107 1135
1136 ####################################################
1137 ## Populate the configurable widgets
1138 ####################################################
1139
1140 # Create the shell
1141 logging.debug("Creating Shell...")
1142 self.__shellPosition = Preferences.getUI("ShellPosition")
1143 if self.__shellPosition == "left":
1144 self.__shellParent = self.leftSidebar
1145 elif self.__shellPosition == "right":
1146 self.__shellParent = self.rightSidebar
1147 else:
1148 self.__shellParent = self.bottomSidebar
1149 from QScintilla.Shell import ShellAssembly
1150 self.shellAssembly = \
1151 ShellAssembly(debugServer, self.viewmanager, self.project, True)
1152 self.shell = self.shellAssembly.shell()
1153 self.__shellParent.insertTab(0, self.shellAssembly,
1154 UI.PixmapCache.getIcon("shell.png"),
1155 self.tr("Shell"))
1156
1157 ####################################################
1158 ## Set the start index of each side bar
1159 ####################################################
1160
1161 self.leftSidebar.setCurrentIndex(0)
1162 self.rightSidebar.setCurrentIndex(0)
1108 self.bottomSidebar.setCurrentIndex(0) 1163 self.bottomSidebar.setCurrentIndex(0)
1109 1164
1110 # create the central widget 1165 # create the central widget
1111 logging.debug("Creating central widget...") 1166 logging.debug("Creating central widget...")
1112 cw = self.centralWidget() # save the current central widget 1167 cw = self.centralWidget() # save the current central widget
2831 try: 2886 try:
2832 self.__menus["subwindow"].addSection(self.tr("Left Side")) 2887 self.__menus["subwindow"].addSection(self.tr("Left Side"))
2833 except AttributeError: 2888 except AttributeError:
2834 # Qt4 2889 # Qt4
2835 pass 2890 pass
2891 if self.__shellPosition == "left":
2892 self.__menus["subwindow"].addAction(self.shellActivateAct)
2836 self.__menus["subwindow"].addAction(self.pbActivateAct) 2893 self.__menus["subwindow"].addAction(self.pbActivateAct)
2837 self.__menus["subwindow"].addAction(self.mpbActivateAct) 2894 self.__menus["subwindow"].addAction(self.mpbActivateAct)
2838 if self.templateViewer is not None: 2895 if self.templateViewer is not None:
2839 self.__menus["subwindow"].addAction(self.templateViewerActivateAct) 2896 self.__menus["subwindow"].addAction(self.templateViewerActivateAct)
2840 if self.browser is not None: 2897 if self.browser is not None:
2845 try: 2902 try:
2846 self.__menus["subwindow"].addSection(self.tr("Bottom Side")) 2903 self.__menus["subwindow"].addSection(self.tr("Bottom Side"))
2847 except AttributeError: 2904 except AttributeError:
2848 # Qt4 2905 # Qt4
2849 self.__menus["subwindow"].addSeparator() 2906 self.__menus["subwindow"].addSeparator()
2850 self.__menus["subwindow"].addAction(self.shellActivateAct) 2907 if self.__shellPosition == "bottom":
2908 self.__menus["subwindow"].addAction(self.shellActivateAct)
2851 self.__menus["subwindow"].addAction(self.taskViewerActivateAct) 2909 self.__menus["subwindow"].addAction(self.taskViewerActivateAct)
2852 self.__menus["subwindow"].addAction(self.logViewerActivateAct) 2910 self.__menus["subwindow"].addAction(self.logViewerActivateAct)
2853 if self.numbersViewer is not None: 2911 if self.numbersViewer is not None:
2854 self.__menus["subwindow"].addAction(self.numbersViewerActivateAct) 2912 self.__menus["subwindow"].addAction(self.numbersViewerActivateAct)
2855 try: 2913 try:
2856 self.__menus["subwindow"].addSection(self.tr("Right Side")) 2914 self.__menus["subwindow"].addSection(self.tr("Right Side"))
2857 except AttributeError: 2915 except AttributeError:
2858 # Qt4 2916 # Qt4
2859 self.__menus["subwindow"].addSeparator() 2917 self.__menus["subwindow"].addSeparator()
2860 # right side 2918 # right side
2919 if self.__shellPosition == "right":
2920 self.__menus["subwindow"].addAction(self.shellActivateAct)
2861 if self.codeDocumentationViewer is not None: 2921 if self.codeDocumentationViewer is not None:
2862 self.__menus["subwindow"].addAction( 2922 self.__menus["subwindow"].addAction(
2863 self.tr("Code Documentation Viewer"), 2923 self.tr("Code Documentation Viewer"),
2864 self.activateCodeDocumentationViewer) 2924 self.activateCodeDocumentationViewer)
2865 self.__menus["subwindow"].addAction(self.debugViewerActivateAct) 2925 self.__menus["subwindow"].addAction(self.debugViewerActivateAct)
4187 self.lToolboxDock.show() 4247 self.lToolboxDock.show()
4188 self.lToolbox.setCurrentWidget(self.projectBrowser) 4248 self.lToolbox.setCurrentWidget(self.projectBrowser)
4189 elif self.__layoutType == "Sidebars": 4249 elif self.__layoutType == "Sidebars":
4190 self.leftSidebar.show() 4250 self.leftSidebar.show()
4191 self.leftSidebar.setCurrentWidget(self.projectBrowser) 4251 self.leftSidebar.setCurrentWidget(self.projectBrowser)
4192 else:
4193 self.projectBrowser.show()
4194 self.projectBrowser.currentWidget().setFocus( 4252 self.projectBrowser.currentWidget().setFocus(
4195 Qt.ActiveWindowFocusReason) 4253 Qt.ActiveWindowFocusReason)
4196 4254
4197 def __activateMultiProjectBrowser(self): 4255 def __activateMultiProjectBrowser(self):
4198 """ 4256 """
4202 self.lToolboxDock.show() 4260 self.lToolboxDock.show()
4203 self.lToolbox.setCurrentWidget(self.multiProjectBrowser) 4261 self.lToolbox.setCurrentWidget(self.multiProjectBrowser)
4204 elif self.__layoutType == "Sidebars": 4262 elif self.__layoutType == "Sidebars":
4205 self.leftSidebar.show() 4263 self.leftSidebar.show()
4206 self.leftSidebar.setCurrentWidget(self.multiProjectBrowser) 4264 self.leftSidebar.setCurrentWidget(self.multiProjectBrowser)
4207 else:
4208 self.multiProjectBrowser.show()
4209 self.multiProjectBrowser.setFocus(Qt.ActiveWindowFocusReason) 4265 self.multiProjectBrowser.setFocus(Qt.ActiveWindowFocusReason)
4210 4266
4211 def activateDebugViewer(self): 4267 def activateDebugViewer(self):
4212 """ 4268 """
4213 Public slot to handle the activation of the debug viewer. 4269 Public slot to handle the activation of the debug viewer.
4216 self.rToolboxDock.show() 4272 self.rToolboxDock.show()
4217 self.rToolbox.setCurrentWidget(self.debugViewer) 4273 self.rToolbox.setCurrentWidget(self.debugViewer)
4218 elif self.__layoutType == "Sidebars": 4274 elif self.__layoutType == "Sidebars":
4219 self.rightSidebar.show() 4275 self.rightSidebar.show()
4220 self.rightSidebar.setCurrentWidget(self.debugViewer) 4276 self.rightSidebar.setCurrentWidget(self.debugViewer)
4221 else:
4222 self.debugViewer.show()
4223 self.debugViewer.currentWidget().setFocus(Qt.ActiveWindowFocusReason) 4277 self.debugViewer.currentWidget().setFocus(Qt.ActiveWindowFocusReason)
4224 4278
4225 def __activateShell(self): 4279 def __activateShell(self):
4226 """ 4280 """
4227 Private slot to handle the activation of the Shell window. 4281 Private slot to handle the activation of the Shell window.
4228 """ 4282 """
4229 if self.__layoutType == "Toolboxes": 4283 if self.__layoutType == "Toolboxes":
4230 self.hToolboxDock.show() 4284 self.__shellParent.show()
4231 self.hToolbox.setCurrentWidget(self.shellAssembly) 4285 self.__shellParent.widget().setCurrentWidget(self.shellAssembly)
4232 elif self.__layoutType == "Sidebars": 4286 elif self.__layoutType == "Sidebars":
4233 self.bottomSidebar.show() 4287 self.__shellParent.show()
4234 self.bottomSidebar.setCurrentWidget(self.shellAssembly) 4288 self.__shellParent.setCurrentWidget(self.shellAssembly)
4235 else:
4236 self.shell.show()
4237 self.shell.setFocus(Qt.ActiveWindowFocusReason) 4289 self.shell.setFocus(Qt.ActiveWindowFocusReason)
4238 4290
4239 def __activateLogViewer(self): 4291 def __activateLogViewer(self):
4240 """ 4292 """
4241 Private slot to handle the activation of the Log Viewer. 4293 Private slot to handle the activation of the Log Viewer.
4244 self.hToolboxDock.show() 4296 self.hToolboxDock.show()
4245 self.hToolbox.setCurrentWidget(self.logViewer) 4297 self.hToolbox.setCurrentWidget(self.logViewer)
4246 elif self.__layoutType == "Sidebars": 4298 elif self.__layoutType == "Sidebars":
4247 self.bottomSidebar.show() 4299 self.bottomSidebar.show()
4248 self.bottomSidebar.setCurrentWidget(self.logViewer) 4300 self.bottomSidebar.setCurrentWidget(self.logViewer)
4249 else:
4250 self.logViewer.show()
4251 self.logViewer.setFocus(Qt.ActiveWindowFocusReason) 4301 self.logViewer.setFocus(Qt.ActiveWindowFocusReason)
4252 4302
4253 def __activateTaskViewer(self): 4303 def __activateTaskViewer(self):
4254 """ 4304 """
4255 Private slot to handle the activation of the Task Viewer. 4305 Private slot to handle the activation of the Task Viewer.
4258 self.hToolboxDock.show() 4308 self.hToolboxDock.show()
4259 self.hToolbox.setCurrentWidget(self.taskViewer) 4309 self.hToolbox.setCurrentWidget(self.taskViewer)
4260 elif self.__layoutType == "Sidebars": 4310 elif self.__layoutType == "Sidebars":
4261 self.bottomSidebar.show() 4311 self.bottomSidebar.show()
4262 self.bottomSidebar.setCurrentWidget(self.taskViewer) 4312 self.bottomSidebar.setCurrentWidget(self.taskViewer)
4263 else:
4264 self.taskViewer.show()
4265 self.taskViewer.setFocus(Qt.ActiveWindowFocusReason) 4313 self.taskViewer.setFocus(Qt.ActiveWindowFocusReason)
4266 4314
4267 def __activateTemplateViewer(self): 4315 def __activateTemplateViewer(self):
4268 """ 4316 """
4269 Private slot to handle the activation of the Template Viewer. 4317 Private slot to handle the activation of the Template Viewer.
4273 self.lToolboxDock.show() 4321 self.lToolboxDock.show()
4274 self.lToolbox.setCurrentWidget(self.templateViewer) 4322 self.lToolbox.setCurrentWidget(self.templateViewer)
4275 elif self.__layoutType == "Sidebars": 4323 elif self.__layoutType == "Sidebars":
4276 self.leftSidebar.show() 4324 self.leftSidebar.show()
4277 self.leftSidebar.setCurrentWidget(self.templateViewer) 4325 self.leftSidebar.setCurrentWidget(self.templateViewer)
4278 else:
4279 self.templateViewer.show()
4280 self.templateViewer.setFocus(Qt.ActiveWindowFocusReason) 4326 self.templateViewer.setFocus(Qt.ActiveWindowFocusReason)
4281 4327
4282 def __activateBrowser(self): 4328 def __activateBrowser(self):
4283 """ 4329 """
4284 Private slot to handle the activation of the file browser. 4330 Private slot to handle the activation of the file browser.
4288 self.lToolboxDock.show() 4334 self.lToolboxDock.show()
4289 self.lToolbox.setCurrentWidget(self.browser) 4335 self.lToolbox.setCurrentWidget(self.browser)
4290 elif self.__layoutType == "Sidebars": 4336 elif self.__layoutType == "Sidebars":
4291 self.leftSidebar.show() 4337 self.leftSidebar.show()
4292 self.leftSidebar.setCurrentWidget(self.browser) 4338 self.leftSidebar.setCurrentWidget(self.browser)
4293 else:
4294 self.browser.show()
4295 self.browser.setFocus(Qt.ActiveWindowFocusReason) 4339 self.browser.setFocus(Qt.ActiveWindowFocusReason)
4296 4340
4297 def __toggleLeftToolbox(self): 4341 def __toggleLeftToolbox(self):
4298 """ 4342 """
4299 Private slot to handle the toggle of the Left Toolbox window. 4343 Private slot to handle the toggle of the Left Toolbox window.
4378 self.rToolboxDock.show() 4422 self.rToolboxDock.show()
4379 self.rToolbox.setCurrentWidget(self.cooperation) 4423 self.rToolbox.setCurrentWidget(self.cooperation)
4380 elif self.__layoutType == "Sidebars": 4424 elif self.__layoutType == "Sidebars":
4381 self.rightSidebar.show() 4425 self.rightSidebar.show()
4382 self.rightSidebar.setCurrentWidget(self.cooperation) 4426 self.rightSidebar.setCurrentWidget(self.cooperation)
4383 else:
4384 self.cooperation.show()
4385 self.cooperation.setFocus(Qt.ActiveWindowFocusReason) 4427 self.cooperation.setFocus(Qt.ActiveWindowFocusReason)
4386 4428
4387 def __activateIRC(self): 4429 def __activateIRC(self):
4388 """ 4430 """
4389 Private slot to handle the activation of the IRC window. 4431 Private slot to handle the activation of the IRC window.
4393 self.rToolboxDock.show() 4435 self.rToolboxDock.show()
4394 self.rToolbox.setCurrentWidget(self.irc) 4436 self.rToolbox.setCurrentWidget(self.irc)
4395 elif self.__layoutType == "Sidebars": 4437 elif self.__layoutType == "Sidebars":
4396 self.rightSidebar.show() 4438 self.rightSidebar.show()
4397 self.rightSidebar.setCurrentWidget(self.irc) 4439 self.rightSidebar.setCurrentWidget(self.irc)
4398 else:
4399 self.irc.show()
4400 self.irc.setFocus(Qt.ActiveWindowFocusReason) 4440 self.irc.setFocus(Qt.ActiveWindowFocusReason)
4401 4441
4402 def __activateSymbolsViewer(self): 4442 def __activateSymbolsViewer(self):
4403 """ 4443 """
4404 Private slot to handle the activation of the Symbols Viewer. 4444 Private slot to handle the activation of the Symbols Viewer.
4408 self.lToolboxDock.show() 4448 self.lToolboxDock.show()
4409 self.lToolbox.setCurrentWidget(self.symbolsViewer) 4449 self.lToolbox.setCurrentWidget(self.symbolsViewer)
4410 elif self.__layoutType == "Sidebars": 4450 elif self.__layoutType == "Sidebars":
4411 self.leftSidebar.show() 4451 self.leftSidebar.show()
4412 self.leftSidebar.setCurrentWidget(self.symbolsViewer) 4452 self.leftSidebar.setCurrentWidget(self.symbolsViewer)
4413 else:
4414 self.symbolsViewer.show()
4415 self.symbolsViewer.setFocus(Qt.ActiveWindowFocusReason) 4453 self.symbolsViewer.setFocus(Qt.ActiveWindowFocusReason)
4416 4454
4417 def __activateNumbersViewer(self): 4455 def __activateNumbersViewer(self):
4418 """ 4456 """
4419 Private slot to handle the activation of the Numbers Viewer. 4457 Private slot to handle the activation of the Numbers Viewer.
4423 self.hToolboxDock.show() 4461 self.hToolboxDock.show()
4424 self.hToolbox.setCurrentWidget(self.numbersViewer) 4462 self.hToolbox.setCurrentWidget(self.numbersViewer)
4425 elif self.__layoutType == "Sidebars": 4463 elif self.__layoutType == "Sidebars":
4426 self.bottomSidebar.show() 4464 self.bottomSidebar.show()
4427 self.bottomSidebar.setCurrentWidget(self.numbersViewer) 4465 self.bottomSidebar.setCurrentWidget(self.numbersViewer)
4428 else:
4429 self.numbersViewer.show()
4430 self.numbersViewer.setFocus(Qt.ActiveWindowFocusReason) 4466 self.numbersViewer.setFocus(Qt.ActiveWindowFocusReason)
4431 4467
4432 def __activateViewmanager(self): 4468 def __activateViewmanager(self):
4433 """ 4469 """
4434 Private slot to handle the activation of the current editor. 4470 Private slot to handle the activation of the current editor.
4450 self.rToolbox.setCurrentWidget(self.codeDocumentationViewer) 4486 self.rToolbox.setCurrentWidget(self.codeDocumentationViewer)
4451 elif self.__layoutType == "Sidebars": 4487 elif self.__layoutType == "Sidebars":
4452 self.rightSidebar.show() 4488 self.rightSidebar.show()
4453 self.rightSidebar.setCurrentWidget( 4489 self.rightSidebar.setCurrentWidget(
4454 self.codeDocumentationViewer) 4490 self.codeDocumentationViewer)
4455 else:
4456 self.codeDocumentationViewer.show()
4457 if switchFocus: 4491 if switchFocus:
4458 self.codeDocumentationViewer.setFocus( 4492 self.codeDocumentationViewer.setFocus(
4459 Qt.ActiveWindowFocusReason) 4493 Qt.ActiveWindowFocusReason)
4460 4494
4461 def __activatePipWidget(self): 4495 def __activatePipWidget(self):
4467 self.rToolboxDock.show() 4501 self.rToolboxDock.show()
4468 self.rToolbox.setCurrentWidget(self.pipWidget) 4502 self.rToolbox.setCurrentWidget(self.pipWidget)
4469 elif self.__layoutType == "Sidebars": 4503 elif self.__layoutType == "Sidebars":
4470 self.rightSidebar.show() 4504 self.rightSidebar.show()
4471 self.rightSidebar.setCurrentWidget(self.pipWidget) 4505 self.rightSidebar.setCurrentWidget(self.pipWidget)
4472 else:
4473 self.pipWidget.show()
4474 self.pipWidget.setFocus(Qt.ActiveWindowFocusReason) 4506 self.pipWidget.setFocus(Qt.ActiveWindowFocusReason)
4475 4507
4476 def __activateCondaWidget(self): 4508 def __activateCondaWidget(self):
4477 """ 4509 """
4478 Private slot to handle the activation of the Conda manager widget. 4510 Private slot to handle the activation of the Conda manager widget.
4482 self.rToolboxDock.show() 4514 self.rToolboxDock.show()
4483 self.rToolbox.setCurrentWidget(self.condaWidget) 4515 self.rToolbox.setCurrentWidget(self.condaWidget)
4484 elif self.__layoutType == "Sidebars": 4516 elif self.__layoutType == "Sidebars":
4485 self.rightSidebar.show() 4517 self.rightSidebar.show()
4486 self.rightSidebar.setCurrentWidget(self.condaWidget) 4518 self.rightSidebar.setCurrentWidget(self.condaWidget)
4487 else:
4488 self.condaWidget.show()
4489 self.condaWidget.setFocus(Qt.ActiveWindowFocusReason) 4519 self.condaWidget.setFocus(Qt.ActiveWindowFocusReason)
4490 4520
4491 def __toggleWindow(self, w): 4521 def __toggleWindow(self, w):
4492 """ 4522 """
4493 Private method to toggle a workspace editor window. 4523 Private method to toggle a workspace editor window.
5844 """ 5874 """
5845 Public slot to set the preferences. 5875 Public slot to set the preferences.
5846 5876
5847 @param pageName name of the configuration page to show (string) 5877 @param pageName name of the configuration page to show (string)
5848 """ 5878 """
5849 from Preferences.ConfigurationDialog import ConfigurationDialog 5879 if self.__configurationDialog is None:
5850 dlg = ConfigurationDialog( 5880 # only one invocation at a time is allowed
5851 self, 'Configuration', 5881 from Preferences.ConfigurationDialog import ConfigurationDialog
5852 expandedEntries=self.__expandedConfigurationEntries, 5882 self.__configurationDialog = ConfigurationDialog(
5853 ) 5883 self, 'Configuration',
5854 dlg.preferencesChanged.connect(self.__preferencesChanged) 5884 expandedEntries=self.__expandedConfigurationEntries,
5855 dlg.masterPasswordChanged.connect(self.__masterPasswordChanged) 5885 )
5856 dlg.show() 5886 self.__configurationDialog.preferencesChanged.connect(
5857 if pageName is not None: 5887 self.__preferencesChanged)
5858 dlg.showConfigurationPageByName(pageName) 5888 self.__configurationDialog.masterPasswordChanged.connect(
5859 elif self.__lastConfigurationPageName: 5889 self.__masterPasswordChanged)
5860 dlg.showConfigurationPageByName(self.__lastConfigurationPageName) 5890 self.__configurationDialog.show()
5861 else: 5891 if pageName is not None:
5862 dlg.showConfigurationPageByName("empty") 5892 self.__configurationDialog.showConfigurationPageByName(
5863 dlg.exec_() 5893 pageName)
5864 QApplication.processEvents() 5894 elif self.__lastConfigurationPageName:
5865 if dlg.result() == QDialog.Accepted: 5895 self.__configurationDialog.showConfigurationPageByName(
5866 dlg.setPreferences() 5896 self.__lastConfigurationPageName)
5867 Preferences.syncPreferences() 5897 else:
5868 self.__preferencesChanged() 5898 self.__configurationDialog.showConfigurationPageByName("empty")
5869 self.__lastConfigurationPageName = dlg.getConfigurationPageName() 5899 self.__configurationDialog.exec_()
5870 self.__expandedConfigurationEntries = dlg.getExpandedEntries() 5900 QApplication.processEvents()
5901 if self.__configurationDialog.result() == QDialog.Accepted:
5902 self.__configurationDialog.setPreferences()
5903 Preferences.syncPreferences()
5904 self.__preferencesChanged()
5905 self.__lastConfigurationPageName = \
5906 self.__configurationDialog.getConfigurationPageName()
5907 self.__expandedConfigurationEntries = \
5908 self.__configurationDialog.getExpandedEntries()
5909
5910 self.__configurationDialog.deleteLater()
5911 self.__configurationDialog = None
5871 5912
5872 def __exportPreferences(self): 5913 def __exportPreferences(self):
5873 """ 5914 """
5874 Private slot to export the current preferences. 5915 Private slot to export the current preferences.
5875 """ 5916 """

eric ide

mercurial