UI/UserInterface.py

branch
maintenance
changeset 6455
22a6fc33ab6d
parent 6395
613e37fabd96
parent 6434
872d10fa686a
child 6487
d3ca83d691e7
equal deleted inserted replaced
6409:913a08004977 6455:22a6fc33ab6d
207 self.__noOpenAtStartup = noOpenAtStartup 207 self.__noOpenAtStartup = noOpenAtStartup
208 self.__noCrashOpenAtStartup = noCrashOpenAtStartup 208 self.__noCrashOpenAtStartup = noCrashOpenAtStartup
209 self.__disableCrashSession = disableCrashSession 209 self.__disableCrashSession = disableCrashSession
210 self.__disabledPlugins = disabledPlugins[:] 210 self.__disabledPlugins = disabledPlugins[:]
211 211
212 self.layoutType, self.embeddedShell, self.embeddedFileBrowser = \ 212 self.__layoutType = Preferences.getUI("LayoutType")
213 Preferences.getUILayout()
214 213
215 self.passiveMode = Preferences.getDebugger("PassiveDbgEnabled") 214 self.passiveMode = Preferences.getDebugger("PassiveDbgEnabled")
216 215
217 g = Preferences.getGeometry("MainGeometry") 216 g = Preferences.getGeometry("MainGeometry")
218 if g.isEmpty(): 217 if g.isEmpty():
265 from PluginManager.PluginManager import PluginManager 264 from PluginManager.PluginManager import PluginManager
266 self.pluginManager = PluginManager(self, self.__disabledPlugins, 265 self.pluginManager = PluginManager(self, self.__disabledPlugins,
267 develPlugin=plugin) 266 develPlugin=plugin)
268 267
269 splash.showMessage(self.tr("Generating Main User Interface...")) 268 splash.showMessage(self.tr("Generating Main User Interface..."))
269
270 self.codeDocumentationViewer = None
271 self.cooperation = None
272 self.irc = None
273 self.symbolsViewer = None
274 self.browser = None
275 self.templateViewer = None
276 self.numbersViewer = None
270 277
271 # Create the main window now so that we can connect QActions to it. 278 # Create the main window now so that we can connect QActions to it.
272 logging.debug("Creating Layout...") 279 logging.debug("Creating Layout...")
273 self.__createLayout(debugServer) 280 self.__createLayout(debugServer)
274 self.__currentRightWidget = None 281 self.__currentRightWidget = None
299 self.__readingSession = False 306 self.__readingSession = False
300 self.__versionsDialog = None 307 self.__versionsDialog = None
301 308
302 # now setup the connections 309 # now setup the connections
303 splash.showMessage(self.tr("Setting up connections...")) 310 splash.showMessage(self.tr("Setting up connections..."))
304 self.browser.sourceFile[str].connect(
305 self.viewmanager.openSourceFile)
306 self.browser.sourceFile[str, int].connect(
307 self.viewmanager.openSourceFile)
308 self.browser.sourceFile[str, list].connect(
309 self.viewmanager.openSourceFile)
310 self.browser.sourceFile[str, int, str].connect(
311 self.viewmanager.openSourceFile)
312 self.browser.designerFile.connect(self.__designer)
313 self.browser.linguistFile.connect(self.__linguist4)
314 self.browser.projectFile.connect(self.project.openProject)
315 self.browser.multiProjectFile.connect(
316 self.multiProject.openMultiProject)
317 self.browser.pixmapEditFile.connect(self.__editPixmap)
318 self.browser.pixmapFile.connect(self.__showPixmap)
319 self.browser.svgFile.connect(self.__showSvg)
320 self.browser.binaryFile.connect(self.__openHexEditor)
321 self.browser.unittestOpen.connect(self.__unittestScript)
322 self.browser.trpreview.connect(self.__TRPreviewer)
323 311
324 self.debugViewer.exceptionLogger.sourceFile.connect( 312 self.debugViewer.exceptionLogger.sourceFile.connect(
325 self.viewmanager.openSourceFile) 313 self.viewmanager.openSourceFile)
326 314
327 self.debugViewer.sourceFile.connect(self.viewmanager.showDebugSource) 315 self.debugViewer.sourceFile.connect(self.viewmanager.showDebugSource)
424 412
425 self.debuggerUI.resetUI.connect(self.viewmanager.handleResetUI) 413 self.debuggerUI.resetUI.connect(self.viewmanager.handleResetUI)
426 self.debuggerUI.resetUI.connect(self.debugViewer.handleResetUI) 414 self.debuggerUI.resetUI.connect(self.debugViewer.handleResetUI)
427 self.debuggerUI.resetUI.connect(self.__debuggingDone) 415 self.debuggerUI.resetUI.connect(self.__debuggingDone)
428 self.debuggerUI.debuggingStarted.connect( 416 self.debuggerUI.debuggingStarted.connect(
429 self.browser.handleProgramChange)
430 self.debuggerUI.debuggingStarted.connect(
431 self.debugViewer.exceptionLogger.debuggingStarted) 417 self.debugViewer.exceptionLogger.debuggingStarted)
432 self.debuggerUI.debuggingStarted.connect( 418 self.debuggerUI.debuggingStarted.connect(
433 self.debugViewer.handleDebuggingStarted) 419 self.debugViewer.handleDebuggingStarted)
434 self.debuggerUI.debuggingStarted.connect(self.__programChange) 420 self.debuggerUI.debuggingStarted.connect(self.__programChange)
435 self.debuggerUI.debuggingStarted.connect(self.__debuggingStarted) 421 self.debuggerUI.debuggingStarted.connect(self.__debuggingStarted)
448 self.debugViewer.exceptionLogger.addException) 434 self.debugViewer.exceptionLogger.addException)
449 debugServer.clientLine.connect( 435 debugServer.clientLine.connect(
450 self.debugViewer.breakpointViewer.highlightBreakpoint) 436 self.debugViewer.breakpointViewer.highlightBreakpoint)
451 debugServer.clientProcessStdout.connect(self.appendToStdout) 437 debugServer.clientProcessStdout.connect(self.appendToStdout)
452 debugServer.clientProcessStderr.connect(self.appendToStderr) 438 debugServer.clientProcessStderr.connect(self.appendToStderr)
453 debugServer.clientInterpreterChanged.connect(
454 self.browser.handleInterpreterChanged)
455 debugServer.appendStdout.connect(self.appendToStdout) 439 debugServer.appendStdout.connect(self.appendToStdout)
456 440
457 self.stdout.appendStdout.connect(self.appendToStdout) 441 self.stdout.appendStdout.connect(self.appendToStdout)
458 self.stderr.appendStderr.connect(self.appendToStderr) 442 self.stderr.appendStderr.connect(self.appendToStderr)
459 443
478 self.projectBrowser.piBrowser.handlePreferencesChanged) 462 self.projectBrowser.piBrowser.handlePreferencesChanged)
479 self.preferencesChanged.connect( 463 self.preferencesChanged.connect(
480 self.projectBrowser.ppBrowser.handlePreferencesChanged) 464 self.projectBrowser.ppBrowser.handlePreferencesChanged)
481 self.preferencesChanged.connect( 465 self.preferencesChanged.connect(
482 self.projectBrowser.poBrowser.handlePreferencesChanged) 466 self.projectBrowser.poBrowser.handlePreferencesChanged)
483 self.preferencesChanged.connect(self.browser.handlePreferencesChanged)
484 self.preferencesChanged.connect( 467 self.preferencesChanged.connect(
485 self.taskViewer.handlePreferencesChanged) 468 self.taskViewer.handlePreferencesChanged)
486 self.preferencesChanged.connect(self.pluginManager.preferencesChanged) 469 self.preferencesChanged.connect(self.pluginManager.preferencesChanged)
487 self.preferencesChanged.connect(debugServer.preferencesChanged) 470 self.preferencesChanged.connect(debugServer.preferencesChanged)
488 self.preferencesChanged.connect(self.debugViewer.preferencesChanged) 471 self.preferencesChanged.connect(self.debugViewer.preferencesChanged)
489 self.preferencesChanged.connect(self.cooperation.preferencesChanged)
490 self.preferencesChanged.connect( 472 self.preferencesChanged.connect(
491 self.backgroundService.preferencesOrProjectChanged) 473 self.backgroundService.preferencesOrProjectChanged)
492 self.preferencesChanged.connect( 474
493 self.codeDocumentationViewer.preferencesChanged) 475 if self.browser is not None:
476 self.browser.sourceFile[str].connect(
477 self.viewmanager.openSourceFile)
478 self.browser.sourceFile[str, int].connect(
479 self.viewmanager.openSourceFile)
480 self.browser.sourceFile[str, list].connect(
481 self.viewmanager.openSourceFile)
482 self.browser.sourceFile[str, int, str].connect(
483 self.viewmanager.openSourceFile)
484 self.browser.designerFile.connect(self.__designer)
485 self.browser.linguistFile.connect(self.__linguist4)
486 self.browser.projectFile.connect(self.project.openProject)
487 self.browser.multiProjectFile.connect(
488 self.multiProject.openMultiProject)
489 self.browser.pixmapEditFile.connect(self.__editPixmap)
490 self.browser.pixmapFile.connect(self.__showPixmap)
491 self.browser.svgFile.connect(self.__showSvg)
492 self.browser.binaryFile.connect(self.__openHexEditor)
493 self.browser.unittestOpen.connect(self.__unittestScript)
494 self.browser.trpreview.connect(self.__TRPreviewer)
495
496 self.debuggerUI.debuggingStarted.connect(
497 self.browser.handleProgramChange)
498
499 debugServer.clientInterpreterChanged.connect(
500 self.browser.handleInterpreterChanged)
501
502 self.preferencesChanged.connect(
503 self.browser.handlePreferencesChanged)
504
505 if self.codeDocumentationViewer is not None:
506 self.preferencesChanged.connect(
507 self.codeDocumentationViewer.preferencesChanged)
494 508
495 self.viewmanager.editorSaved.connect(self.project.repopulateItem) 509 self.viewmanager.editorSaved.connect(self.project.repopulateItem)
496 self.viewmanager.lastEditorClosed.connect(self.__lastEditorClosed) 510 self.viewmanager.lastEditorClosed.connect(self.__lastEditorClosed)
497 self.viewmanager.editorOpened.connect(self.__editorOpened) 511 self.viewmanager.editorOpened.connect(self.__editorOpened)
498 self.viewmanager.changeCaption.connect(self.__setWindowCaption) 512 self.viewmanager.changeCaption.connect(self.__setWindowCaption)
499 self.viewmanager.checkActions.connect(self.__checkActions) 513 self.viewmanager.checkActions.connect(self.__checkActions)
500 self.viewmanager.editorChanged.connect( 514 self.viewmanager.editorChanged.connect(
501 self.projectBrowser.handleEditorChanged) 515 self.projectBrowser.handleEditorChanged)
502 self.viewmanager.editorLineChanged.connect( 516 self.viewmanager.editorLineChanged.connect(
503 self.projectBrowser.handleEditorLineChanged) 517 self.projectBrowser.handleEditorLineChanged)
504 self.viewmanager.checkActions.connect(
505 self.cooperation.checkEditorActions)
506 self.viewmanager.editorOpened.connect(self.__writeCrashSession) 518 self.viewmanager.editorOpened.connect(self.__writeCrashSession)
507 self.viewmanager.editorClosed.connect(self.__writeCrashSession) 519 self.viewmanager.editorClosed.connect(self.__writeCrashSession)
508 self.viewmanager.editorRenamed.connect(self.__writeCrashSession) 520 self.viewmanager.editorRenamed.connect(self.__writeCrashSession)
509 self.viewmanager.editorChanged.connect(self.__writeCrashSession) 521 self.viewmanager.editorChanged.connect(self.__writeCrashSession)
510 522
511 self.shell.zoomValueChanged.connect( 523 self.shell.zoomValueChanged.connect(
512 lambda v: self.viewmanager.zoomValueChanged(v, self.shell)) 524 lambda v: self.viewmanager.zoomValueChanged(v, self.shell))
513 525
514 self.cooperation.shareEditor.connect(self.viewmanager.shareEditor) 526 if self.cooperation is not None:
515 self.cooperation.startEdit.connect(self.viewmanager.startSharedEdit) 527 self.viewmanager.checkActions.connect(
516 self.cooperation.sendEdit.connect(self.viewmanager.sendSharedEdit) 528 self.cooperation.checkEditorActions)
517 self.cooperation.cancelEdit.connect(self.viewmanager.cancelSharedEdit) 529 self.preferencesChanged.connect(
518 self.cooperation.connected.connect(self.viewmanager.shareConnected) 530 self.cooperation.preferencesChanged)
519 self.cooperation.editorCommand.connect(self.viewmanager.receive) 531 self.cooperation.shareEditor.connect(
520 self.viewmanager.setCooperationClient(self.cooperation.getClient()) 532 self.viewmanager.shareEditor)
521 533 self.cooperation.startEdit.connect(
522 self.symbolsViewer.insertSymbol.connect(self.viewmanager.insertSymbol) 534 self.viewmanager.startSharedEdit)
523 535 self.cooperation.sendEdit.connect(
524 self.numbersViewer.insertNumber.connect(self.viewmanager.insertNumber) 536 self.viewmanager.sendSharedEdit)
525 537 self.cooperation.cancelEdit.connect(
526 self.irc.autoConnected.connect(self.__ircAutoConnected) 538 self.viewmanager.cancelSharedEdit)
539 self.cooperation.connected.connect(
540 self.viewmanager.shareConnected)
541 self.cooperation.editorCommand.connect(
542 self.viewmanager.receive)
543 self.viewmanager.setCooperationClient(
544 self.cooperation.getClient())
545
546 if self.symbolsViewer is not None:
547 self.symbolsViewer.insertSymbol.connect(
548 self.viewmanager.insertSymbol)
549
550 if self.numbersViewer is not None:
551 self.numbersViewer.insertNumber.connect(
552 self.viewmanager.insertNumber)
553
554 if self.irc is not None:
555 self.irc.autoConnected.connect(self.__ircAutoConnected)
527 556
528 # create the toolbar manager object 557 # create the toolbar manager object
529 self.toolbarManager = E5ToolBarManager(self, self) 558 self.toolbarManager = E5ToolBarManager(self, self)
530 self.toolbarManager.setMainWindow(self) 559 self.toolbarManager.setMainWindow(self)
531 560
561 e5App().registerObject("ViewManager", self.viewmanager) 590 e5App().registerObject("ViewManager", self.viewmanager)
562 e5App().registerObject("Project", self.project) 591 e5App().registerObject("Project", self.project)
563 e5App().registerObject("ProjectBrowser", self.projectBrowser) 592 e5App().registerObject("ProjectBrowser", self.projectBrowser)
564 e5App().registerObject("MultiProject", self.multiProject) 593 e5App().registerObject("MultiProject", self.multiProject)
565 e5App().registerObject("TaskViewer", self.taskViewer) 594 e5App().registerObject("TaskViewer", self.taskViewer)
566 e5App().registerObject("TemplateViewer", self.templateViewer) 595 if self.templateViewer is not None:
596 e5App().registerObject("TemplateViewer", self.templateViewer)
567 e5App().registerObject("Shell", self.shell) 597 e5App().registerObject("Shell", self.shell)
568 if self.dummyHelpViewer is not None: 598 if self.dummyHelpViewer is not None:
569 e5App().registerObject("DummyHelpViewer", self.dummyHelpViewer) 599 e5App().registerObject("DummyHelpViewer", self.dummyHelpViewer)
570 e5App().registerObject("PluginManager", self.pluginManager) 600 e5App().registerObject("PluginManager", self.pluginManager)
571 e5App().registerObject("ToolbarManager", self.toolbarManager) 601 e5App().registerObject("ToolbarManager", self.toolbarManager)
572 e5App().registerObject("Cooperation", self.cooperation) 602 if self.cooperation is not None:
573 e5App().registerObject("IRC", self.irc) 603 e5App().registerObject("Cooperation", self.cooperation)
574 e5App().registerObject("Symbols", self.symbolsViewer) 604 if self.irc is not None:
575 e5App().registerObject("Numbers", self.numbersViewer) 605 e5App().registerObject("IRC", self.irc)
576 e5App().registerObject("DocuViewer", self.codeDocumentationViewer) 606 if self.symbolsViewer is not None:
607 e5App().registerObject("Symbols", self.symbolsViewer)
608 if self.numbersViewer is not None:
609 e5App().registerObject("Numbers", self.numbersViewer)
610 if self.codeDocumentationViewer is not None:
611 e5App().registerObject("DocuViewer", self.codeDocumentationViewer)
577 612
578 # list of web addresses serving the versions file 613 # list of web addresses serving the versions file
579 self.__httpAlternatives = Preferences.getUI("VersionsUrls6") 614 self.__httpAlternatives = Preferences.getUI("VersionsUrls6")
580 self.__inVersionCheck = False 615 self.__inVersionCheck = False
581 self.__versionCheckProgress = None 616 self.__versionCheckProgress = None
640 # restore toolbar manager state 675 # restore toolbar manager state
641 splash.showMessage(self.tr("Restoring Toolbarmanager...")) 676 splash.showMessage(self.tr("Restoring Toolbarmanager..."))
642 self.toolbarManager.restoreState( 677 self.toolbarManager.restoreState(
643 Preferences.getUI("ToolbarManagerState")) 678 Preferences.getUI("ToolbarManagerState"))
644 679
645 # finalize the initialization of the code documentation viewer 680 if self.codeDocumentationViewer is not None:
646 self.codeDocumentationViewer.finalizeSetup() 681 # finalize the initialization of the code documentation viewer
682 self.codeDocumentationViewer.finalizeSetup()
647 683
648 # now activate the initial view profile 684 # now activate the initial view profile
649 splash.showMessage(self.tr("Setting View Profile...")) 685 splash.showMessage(self.tr("Setting View Profile..."))
650 self.__setEditProfile() 686 self.__setEditProfile()
651 687
652 # now read the saved tasks 688 # now read the saved tasks
653 splash.showMessage(self.tr("Reading Tasks...")) 689 splash.showMessage(self.tr("Reading Tasks..."))
654 self.__readTasks() 690 self.__readTasks()
655 691
656 # now read the saved templates 692 if self.templateViewer is not None:
657 splash.showMessage(self.tr("Reading Templates...")) 693 # now read the saved templates
658 self.templateViewer.readTemplates() 694 splash.showMessage(self.tr("Reading Templates..."))
695 self.templateViewer.readTemplates()
659 696
660 # now start the debug client 697 # now start the debug client
661 splash.showMessage(self.tr("Starting Debugger...")) 698 splash.showMessage(self.tr("Starting Debugger..."))
662 debugServer.startClient(False) 699 debugServer.startClient(False)
663 700
722 from .Previewer import Previewer 759 from .Previewer import Previewer
723 self.__previewer = Previewer(self.viewmanager, splitter) 760 self.__previewer = Previewer(self.viewmanager, splitter)
724 splitter.addWidget(self.__previewer) 761 splitter.addWidget(self.__previewer)
725 762
726 # Create layout with toolbox windows embedded in dock windows 763 # Create layout with toolbox windows embedded in dock windows
727 if self.layoutType == "Toolboxes": 764 if self.__layoutType == "Toolboxes":
728 logging.debug("Creating toolboxes...") 765 logging.debug("Creating toolboxes...")
729 self.__createToolboxesLayout(debugServer) 766 self.__createToolboxesLayout(debugServer)
730 767
731 # Create layout with sidebar windows embedded in dock windows 768 # Create layout with sidebar windows embedded in dock windows
732 elif self.layoutType == "Sidebars": 769 elif self.__layoutType == "Sidebars":
733 logging.debug("Creating sidebars...") 770 logging.debug("Creating sidebars...")
734 self.__createSidebarsLayout(debugServer) 771 self.__createSidebarsLayout(debugServer)
735 772
736 else: 773 else:
737 raise ValueError("Wrong layout type given ({0})".format( 774 raise ValueError("Wrong layout type given ({0})".format(
738 self.layoutType)) 775 self.__layoutType))
739 logging.debug("Created Layout") 776 logging.debug("Created Layout")
740 777
741 def __createToolboxesLayout(self, debugServer): 778 def __createToolboxesLayout(self, debugServer):
742 """ 779 """
743 Private method to create the Toolboxes layout. 780 Private method to create the Toolboxes layout.
768 self.rToolbox, self.tr("Right Toolbox")) 805 self.rToolbox, self.tr("Right Toolbox"))
769 806
770 # Create the project browser 807 # Create the project browser
771 logging.debug("Creating Project Browser...") 808 logging.debug("Creating Project Browser...")
772 from Project.ProjectBrowser import ProjectBrowser 809 from Project.ProjectBrowser import ProjectBrowser
773 self.projectBrowser = ProjectBrowser( 810 self.projectBrowser = ProjectBrowser(self.project)
774 self.project, None,
775 embeddedBrowser=(self.embeddedFileBrowser == 2))
776 self.lToolbox.addItem(self.projectBrowser, 811 self.lToolbox.addItem(self.projectBrowser,
777 UI.PixmapCache.getIcon("projectViewer.png"), 812 UI.PixmapCache.getIcon("projectViewer.png"),
778 self.tr("Project-Viewer")) 813 self.tr("Project-Viewer"))
779 814
780 # Create the multi project browser 815 # Create the multi project browser
783 self.multiProjectBrowser = MultiProjectBrowser(self.multiProject, 818 self.multiProjectBrowser = MultiProjectBrowser(self.multiProject,
784 self.project) 819 self.project)
785 self.lToolbox.addItem(self.multiProjectBrowser, 820 self.lToolbox.addItem(self.multiProjectBrowser,
786 UI.PixmapCache.getIcon("multiProjectViewer.png"), 821 UI.PixmapCache.getIcon("multiProjectViewer.png"),
787 self.tr("Multiproject-Viewer")) 822 self.tr("Multiproject-Viewer"))
788 823
789 # Create the template viewer part of the user interface 824 if Preferences.getUI("ShowTemplateViewer"):
790 logging.debug("Creating Template Viewer...") 825 # Create the template viewer part of the user interface
791 from Templates.TemplateViewer import TemplateViewer 826 logging.debug("Creating Template Viewer...")
792 self.templateViewer = TemplateViewer(None, 827 from Templates.TemplateViewer import TemplateViewer
793 self.viewmanager) 828 self.templateViewer = TemplateViewer(None,
794 self.lToolbox.addItem(self.templateViewer, 829 self.viewmanager)
795 UI.PixmapCache.getIcon("templateViewer.png"), 830 self.lToolbox.addItem(self.templateViewer,
796 self.tr("Template-Viewer")) 831 UI.PixmapCache.getIcon("templateViewer.png"),
797 832 self.tr("Template-Viewer"))
798 # Create the code documentation viewer 833
799 logging.debug("Creating Code Documentation Viewer...") 834 if Preferences.getUI("ShowCodeDocumentationViewer"):
800 from .CodeDocumentationViewer import CodeDocumentationViewer 835 # Create the code documentation viewer
801 self.codeDocumentationViewer = CodeDocumentationViewer(self) 836 logging.debug("Creating Code Documentation Viewer...")
802 self.rToolbox.addItem(self.codeDocumentationViewer, 837 from .CodeDocumentationViewer import CodeDocumentationViewer
803 UI.PixmapCache.getIcon("codeDocuViewer.png"), 838 self.codeDocumentationViewer = CodeDocumentationViewer(self)
804 self.tr("Code Documentation Viewer")) 839 self.rToolbox.addItem(self.codeDocumentationViewer,
840 UI.PixmapCache.getIcon("codeDocuViewer.png"),
841 self.tr("Code Documentation Viewer"))
805 842
806 # Create the debug viewer maybe without the embedded shell 843 # Create the debug viewer maybe without the embedded shell
807 logging.debug("Creating Debug Viewer...") 844 logging.debug("Creating Debug Viewer...")
808 from Debugger.DebugViewer import DebugViewer 845 from Debugger.DebugViewer import DebugViewer
809 self.debugViewer = DebugViewer( 846 self.debugViewer = DebugViewer(debugServer, True, self.viewmanager)
810 debugServer, True, self.viewmanager, None,
811 embeddedShell=self.embeddedShell,
812 embeddedBrowser=(self.embeddedFileBrowser == 1))
813 self.rToolbox.addItem(self.debugViewer, 847 self.rToolbox.addItem(self.debugViewer,
814 UI.PixmapCache.getIcon("debugViewer.png"), 848 UI.PixmapCache.getIcon("debugViewer.png"),
815 self.tr("Debug-Viewer")) 849 self.tr("Debug-Viewer"))
816 850
817 # Create the chat part of the user interface 851 if Preferences.getUI("ShowCooperation"):
818 logging.debug("Creating Chat Widget...") 852 # Create the chat part of the user interface
819 from Cooperation.ChatWidget import ChatWidget 853 logging.debug("Creating Chat Widget...")
820 self.cooperation = ChatWidget(self) 854 from Cooperation.ChatWidget import ChatWidget
821 self.rToolbox.addItem(self.cooperation, 855 self.cooperation = ChatWidget(self)
822 UI.PixmapCache.getIcon("cooperation.png"), 856 self.rToolbox.addItem(self.cooperation,
823 self.tr("Cooperation")) 857 UI.PixmapCache.getIcon("cooperation.png"),
824 858 self.tr("Cooperation"))
825 # Create the IRC part of the user interface 859
826 logging.debug("Creating IRC Widget...") 860 if Preferences.getUI("ShowIrc"):
827 from Network.IRC.IrcWidget import IrcWidget 861 # Create the IRC part of the user interface
828 self.irc = IrcWidget(self) 862 logging.debug("Creating IRC Widget...")
829 self.rToolbox.addItem(self.irc, 863 from Network.IRC.IrcWidget import IrcWidget
830 UI.PixmapCache.getIcon("irc.png"), 864 self.irc = IrcWidget(self)
831 self.tr("IRC")) 865 self.rToolbox.addItem(self.irc,
866 UI.PixmapCache.getIcon("irc.png"),
867 self.tr("IRC"))
832 868
833 # Create the task viewer part of the user interface 869 # Create the task viewer part of the user interface
834 logging.debug("Creating Task Viewer...") 870 logging.debug("Creating Task Viewer...")
835 from Tasks.TaskViewer import TaskViewer 871 from Tasks.TaskViewer import TaskViewer
836 self.taskViewer = TaskViewer(None, self.project) 872 self.taskViewer = TaskViewer(None, self.project)
844 self.logViewer = LogViewer(self) 880 self.logViewer = LogViewer(self)
845 self.hToolbox.addItem(self.logViewer, 881 self.hToolbox.addItem(self.logViewer,
846 UI.PixmapCache.getIcon("logViewer.png"), 882 UI.PixmapCache.getIcon("logViewer.png"),
847 self.tr("Log-Viewer")) 883 self.tr("Log-Viewer"))
848 884
849 if self.embeddedShell: 885 # Create the shell
850 self.shell = self.debugViewer.shell 886 logging.debug("Creating Shell...")
851 else: 887 from QScintilla.Shell import ShellAssembly
852 # Create the shell 888 self.shellAssembly = \
853 logging.debug("Creating Shell...") 889 ShellAssembly(debugServer, self.viewmanager, True)
854 from QScintilla.Shell import ShellAssembly 890 self.shell = self.shellAssembly.shell()
855 self.shellAssembly = \ 891 self.hToolbox.insertItem(0, self.shellAssembly,
856 ShellAssembly(debugServer, self.viewmanager, True) 892 UI.PixmapCache.getIcon("shell.png"),
857 self.shell = self.shellAssembly.shell() 893 self.tr("Shell"))
858 self.hToolbox.insertItem(0, self.shellAssembly, 894
859 UI.PixmapCache.getIcon("shell.png"), 895 if Preferences.getUI("ShowFileBrowser"):
860 self.tr("Shell"))
861
862 if self.embeddedFileBrowser == 0: # separate window
863 # Create the file browser 896 # Create the file browser
864 logging.debug("Creating File Browser...") 897 logging.debug("Creating File Browser...")
865 from .Browser import Browser 898 from .Browser import Browser
866 self.browser = Browser() 899 self.browser = Browser()
867 self.lToolbox.addItem(self.browser, 900 self.lToolbox.addItem(self.browser,
868 UI.PixmapCache.getIcon("browser.png"), 901 UI.PixmapCache.getIcon("browser.png"),
869 self.tr("File-Browser")) 902 self.tr("File-Browser"))
870 elif self.embeddedFileBrowser == 1: # embedded in debug browser 903
871 self.browser = self.debugViewer.browser 904 if Preferences.getUI("ShowSymbolsViewer"):
872 else: # embedded in project browser 905 # Create the symbols viewer
873 self.browser = self.projectBrowser.fileBrowser 906 logging.debug("Creating Symbols Viewer...")
874 907 from .SymbolsWidget import SymbolsWidget
875 # Create the symbols viewer 908 self.symbolsViewer = SymbolsWidget()
876 logging.debug("Creating Symbols Viewer...") 909 self.lToolbox.addItem(self.symbolsViewer,
877 from .SymbolsWidget import SymbolsWidget 910 UI.PixmapCache.getIcon("symbols.png"),
878 self.symbolsViewer = SymbolsWidget() 911 self.tr("Symbols"))
879 self.lToolbox.addItem(self.symbolsViewer, 912
880 UI.PixmapCache.getIcon("symbols.png"), 913 if Preferences.getUI("ShowNumbersViewer"):
881 self.tr("Symbols")) 914 # Create the numbers viewer
882 915 logging.debug("Creating Numbers Viewer...")
883 # Create the numbers viewer 916 from .NumbersWidget import NumbersWidget
884 logging.debug("Creating Numbers Viewer...") 917 self.numbersViewer = NumbersWidget()
885 from .NumbersWidget import NumbersWidget 918 self.hToolbox.addItem(self.numbersViewer,
886 self.numbersViewer = NumbersWidget() 919 UI.PixmapCache.getIcon("numbers.png"),
887 self.hToolbox.addItem(self.numbersViewer, 920 self.tr("Numbers"))
888 UI.PixmapCache.getIcon("numbers.png"),
889 self.tr("Numbers"))
890 921
891 self.hToolbox.setCurrentIndex(0) 922 self.hToolbox.setCurrentIndex(0)
892 923
893 def __createSidebarsLayout(self, debugServer): 924 def __createSidebarsLayout(self, debugServer):
894 """ 925 """
911 self.rightSidebar = E5SideBar(E5SideBar.East, delay) 942 self.rightSidebar = E5SideBar(E5SideBar.East, delay)
912 943
913 # Create the project browser 944 # Create the project browser
914 logging.debug("Creating Project Browser...") 945 logging.debug("Creating Project Browser...")
915 from Project.ProjectBrowser import ProjectBrowser 946 from Project.ProjectBrowser import ProjectBrowser
916 self.projectBrowser = ProjectBrowser( 947 self.projectBrowser = ProjectBrowser(self.project)
917 self.project, None,
918 embeddedBrowser=(self.embeddedFileBrowser == 2))
919 self.leftSidebar.addTab( 948 self.leftSidebar.addTab(
920 self.projectBrowser, 949 self.projectBrowser,
921 UI.PixmapCache.getIcon("projectViewer.png"), 950 UI.PixmapCache.getIcon("projectViewer.png"),
922 self.tr("Project-Viewer")) 951 self.tr("Project-Viewer"))
923 952
929 self.leftSidebar.addTab( 958 self.leftSidebar.addTab(
930 self.multiProjectBrowser, 959 self.multiProjectBrowser,
931 UI.PixmapCache.getIcon("multiProjectViewer.png"), 960 UI.PixmapCache.getIcon("multiProjectViewer.png"),
932 self.tr("Multiproject-Viewer")) 961 self.tr("Multiproject-Viewer"))
933 962
934 # Create the template viewer part of the user interface 963 if Preferences.getUI("ShowTemplateViewer"):
935 logging.debug("Creating Template Viewer...") 964 # Create the template viewer part of the user interface
936 from Templates.TemplateViewer import TemplateViewer 965 logging.debug("Creating Template Viewer...")
937 self.templateViewer = TemplateViewer(None, 966 from Templates.TemplateViewer import TemplateViewer
938 self.viewmanager) 967 self.templateViewer = TemplateViewer(None,
939 self.leftSidebar.addTab( 968 self.viewmanager)
940 self.templateViewer, 969 self.leftSidebar.addTab(
941 UI.PixmapCache.getIcon("templateViewer.png"), 970 self.templateViewer,
942 self.tr("Template-Viewer")) 971 UI.PixmapCache.getIcon("templateViewer.png"),
943 972 self.tr("Template-Viewer"))
944 # Create the code documentation viewer 973
945 logging.debug("Creating Code Documentation Viewer...") 974 if Preferences.getUI("ShowCodeDocumentationViewer"):
946 from .CodeDocumentationViewer import CodeDocumentationViewer 975 # Create the code documentation viewer
947 self.codeDocumentationViewer = CodeDocumentationViewer(self) 976 logging.debug("Creating Code Documentation Viewer...")
948 self.rightSidebar.addTab( 977 from .CodeDocumentationViewer import CodeDocumentationViewer
949 self.codeDocumentationViewer, 978 self.codeDocumentationViewer = CodeDocumentationViewer(self)
950 UI.PixmapCache.getIcon("codeDocuViewer.png"), 979 self.rightSidebar.addTab(
951 self.tr("Code Documentation Viewer")) 980 self.codeDocumentationViewer,
981 UI.PixmapCache.getIcon("codeDocuViewer.png"),
982 self.tr("Code Documentation Viewer"))
952 983
953 # Create the debug viewer maybe without the embedded shell 984 # Create the debug viewer maybe without the embedded shell
954 logging.debug("Creating Debug Viewer...") 985 logging.debug("Creating Debug Viewer...")
955 from Debugger.DebugViewer import DebugViewer 986 from Debugger.DebugViewer import DebugViewer
956 self.debugViewer = DebugViewer( 987 self.debugViewer = DebugViewer(debugServer, True, self.viewmanager)
957 debugServer, True, self.viewmanager, None,
958 embeddedShell=self.embeddedShell,
959 embeddedBrowser=(self.embeddedFileBrowser == 1))
960 self.rightSidebar.addTab( 988 self.rightSidebar.addTab(
961 self.debugViewer, UI.PixmapCache.getIcon("debugViewer.png"), 989 self.debugViewer, UI.PixmapCache.getIcon("debugViewer.png"),
962 self.tr("Debug-Viewer")) 990 self.tr("Debug-Viewer"))
963 991
964 # Create the chat part of the user interface 992 if Preferences.getUI("ShowCooperation"):
965 logging.debug("Creating Chat Widget...") 993 # Create the chat part of the user interface
966 from Cooperation.ChatWidget import ChatWidget 994 logging.debug("Creating Chat Widget...")
967 self.cooperation = ChatWidget(self) 995 from Cooperation.ChatWidget import ChatWidget
968 self.rightSidebar.addTab( 996 self.cooperation = ChatWidget(self)
969 self.cooperation, UI.PixmapCache.getIcon("cooperation.png"), 997 self.rightSidebar.addTab(
970 self.tr("Cooperation")) 998 self.cooperation, UI.PixmapCache.getIcon("cooperation.png"),
971 999 self.tr("Cooperation"))
972 # Create the IRC part of the user interface 1000
973 logging.debug("Creating IRC Widget...") 1001 if Preferences.getUI("ShowIrc"):
974 from Network.IRC.IrcWidget import IrcWidget 1002 # Create the IRC part of the user interface
975 self.irc = IrcWidget(self) 1003 logging.debug("Creating IRC Widget...")
976 self.rightSidebar.addTab( 1004 from Network.IRC.IrcWidget import IrcWidget
977 self.irc, UI.PixmapCache.getIcon("irc.png"), self.tr("IRC")) 1005 self.irc = IrcWidget(self)
1006 self.rightSidebar.addTab(
1007 self.irc, UI.PixmapCache.getIcon("irc.png"),
1008 self.tr("IRC"))
978 1009
979 # Create the task viewer part of the user interface 1010 # Create the task viewer part of the user interface
980 logging.debug("Creating Task Viewer...") 1011 logging.debug("Creating Task Viewer...")
981 from Tasks.TaskViewer import TaskViewer 1012 from Tasks.TaskViewer import TaskViewer
982 self.taskViewer = TaskViewer(None, self.project) 1013 self.taskViewer = TaskViewer(None, self.project)
990 self.logViewer = LogViewer(self) 1021 self.logViewer = LogViewer(self)
991 self.bottomSidebar.addTab(self.logViewer, 1022 self.bottomSidebar.addTab(self.logViewer,
992 UI.PixmapCache.getIcon("logViewer.png"), 1023 UI.PixmapCache.getIcon("logViewer.png"),
993 self.tr("Log-Viewer")) 1024 self.tr("Log-Viewer"))
994 1025
995 if self.embeddedShell: 1026 # Create the shell
996 self.shell = self.debugViewer.shell 1027 logging.debug("Creating Shell...")
997 else: 1028 from QScintilla.Shell import ShellAssembly
998 # Create the shell 1029 self.shellAssembly = \
999 logging.debug("Creating Shell...") 1030 ShellAssembly(debugServer, self.viewmanager, True)
1000 from QScintilla.Shell import ShellAssembly 1031 self.shell = self.shellAssembly.shell()
1001 self.shellAssembly = \ 1032 self.bottomSidebar.insertTab(0, self.shellAssembly,
1002 ShellAssembly(debugServer, self.viewmanager, True) 1033 UI.PixmapCache.getIcon("shell.png"),
1003 self.shell = self.shellAssembly.shell() 1034 self.tr("Shell"))
1004 self.bottomSidebar.insertTab(0, self.shellAssembly, 1035
1005 UI.PixmapCache.getIcon("shell.png"), 1036 if Preferences.getUI("ShowFileBrowser"):
1006 self.tr("Shell"))
1007
1008 if self.embeddedFileBrowser == 0: # separate window
1009 # Create the file browser 1037 # Create the file browser
1010 logging.debug("Creating File Browser...") 1038 logging.debug("Creating File Browser...")
1011 from .Browser import Browser 1039 from .Browser import Browser
1012 self.browser = Browser() 1040 self.browser = Browser()
1013 self.leftSidebar.addTab(self.browser, 1041 self.leftSidebar.addTab(self.browser,
1014 UI.PixmapCache.getIcon("browser.png"), 1042 UI.PixmapCache.getIcon("browser.png"),
1015 self.tr("File-Browser")) 1043 self.tr("File-Browser"))
1016 elif self.embeddedFileBrowser == 1: # embedded in debug browser 1044
1017 self.browser = self.debugViewer.browser 1045 if Preferences.getUI("ShowSymbolsViewer"):
1018 else: # embedded in project browser 1046 # Create the symbols viewer
1019 self.browser = self.projectBrowser.fileBrowser 1047 logging.debug("Creating Symbols Viewer...")
1020 1048 from .SymbolsWidget import SymbolsWidget
1021 # Create the symbols viewer 1049 self.symbolsViewer = SymbolsWidget()
1022 logging.debug("Creating Symbols Viewer...") 1050 self.leftSidebar.addTab(self.symbolsViewer,
1023 from .SymbolsWidget import SymbolsWidget 1051 UI.PixmapCache.getIcon("symbols.png"),
1024 self.symbolsViewer = SymbolsWidget() 1052 self.tr("Symbols"))
1025 self.leftSidebar.addTab(self.symbolsViewer, 1053
1026 UI.PixmapCache.getIcon("symbols.png"), 1054 if Preferences.getUI("ShowNumbersViewer"):
1027 self.tr("Symbols")) 1055 # Create the numbers viewer
1028 1056 logging.debug("Creating Numbers Viewer...")
1029 # Create the numbers viewer 1057 from .NumbersWidget import NumbersWidget
1030 logging.debug("Creating Numbers Viewer...") 1058 self.numbersViewer = NumbersWidget()
1031 from .NumbersWidget import NumbersWidget 1059 self.bottomSidebar.addTab(self.numbersViewer,
1032 self.numbersViewer = NumbersWidget() 1060 UI.PixmapCache.getIcon("numbers.png"),
1033 self.bottomSidebar.addTab(self.numbersViewer, 1061 self.tr("Numbers"))
1034 UI.PixmapCache.getIcon("numbers.png"),
1035 self.tr("Numbers"))
1036 1062
1037 self.bottomSidebar.setCurrentIndex(0) 1063 self.bottomSidebar.setCurrentIndex(0)
1038 1064
1039 # create the central widget 1065 # create the central widget
1040 logging.debug("Creating central widget...") 1066 logging.debug("Creating central widget...")
1085 @param icon icon to be used (QIcon) 1111 @param icon icon to be used (QIcon)
1086 @param label label text to be shown (string) 1112 @param label label text to be shown (string)
1087 """ 1113 """
1088 assert side in [UserInterface.LeftSide, UserInterface.BottomSide] 1114 assert side in [UserInterface.LeftSide, UserInterface.BottomSide]
1089 1115
1090 if self.layoutType == "Toolboxes": 1116 if self.__layoutType == "Toolboxes":
1091 if side == UserInterface.LeftSide: 1117 if side == UserInterface.LeftSide:
1092 self.lToolbox.addItem(widget, icon, label) 1118 self.lToolbox.addItem(widget, icon, label)
1093 elif side == UserInterface.BottomSide: 1119 elif side == UserInterface.BottomSide:
1094 self.hToolbox.addItem(widget, icon, label) 1120 self.hToolbox.addItem(widget, icon, label)
1095 elif side == UserInterface.RightSide: 1121 elif side == UserInterface.RightSide:
1096 self.rToolbox.addItem(widget, icon, label) 1122 self.rToolbox.addItem(widget, icon, label)
1097 elif self.layoutType == "Sidebars": 1123 elif self.__layoutType == "Sidebars":
1098 if side == UserInterface.LeftSide: 1124 if side == UserInterface.LeftSide:
1099 self.leftSidebar.addTab(widget, icon, label) 1125 self.leftSidebar.addTab(widget, icon, label)
1100 elif side == UserInterface.BottomSide: 1126 elif side == UserInterface.BottomSide:
1101 self.bottomSidebar.addTab(widget, icon, label) 1127 self.bottomSidebar.addTab(widget, icon, label)
1102 elif side == UserInterface.RightSide: 1128 elif side == UserInterface.RightSide:
1106 """ 1132 """
1107 Public method to remove a widget added using addSideWidget(). 1133 Public method to remove a widget added using addSideWidget().
1108 1134
1109 @param widget reference to the widget to remove (QWidget) 1135 @param widget reference to the widget to remove (QWidget)
1110 """ 1136 """
1111 if self.layoutType == "Toolboxes": 1137 if self.__layoutType == "Toolboxes":
1112 for container in [self.lToolbox, self.hToolbox, self.rToolbox]: 1138 for container in [self.lToolbox, self.hToolbox, self.rToolbox]:
1113 index = container.indexOf(widget) 1139 index = container.indexOf(widget)
1114 if index != -1: 1140 if index != -1:
1115 container.removeItem(index) 1141 container.removeItem(index)
1116 elif self.layoutType == "Sidebars": 1142 elif self.__layoutType == "Sidebars":
1117 for container in [self.leftSidebar, self.bottomSidebar, 1143 for container in [self.leftSidebar, self.bottomSidebar,
1118 self.rightSidebar]: 1144 self.rightSidebar]:
1119 index = container.indexOf(widget) 1145 index = container.indexOf(widget)
1120 if index != -1: 1146 if index != -1:
1121 container.removeTab(index) 1147 container.removeTab(index)
1123 def showLogViewer(self): 1149 def showLogViewer(self):
1124 """ 1150 """
1125 Public method to show the Log-Viewer. 1151 Public method to show the Log-Viewer.
1126 """ 1152 """
1127 if Preferences.getUI("LogViewerAutoRaise"): 1153 if Preferences.getUI("LogViewerAutoRaise"):
1128 if self.layoutType == "Toolboxes": 1154 if self.__layoutType == "Toolboxes":
1129 self.hToolboxDock.show() 1155 self.hToolboxDock.show()
1130 self.hToolbox.setCurrentWidget(self.logViewer) 1156 self.hToolbox.setCurrentWidget(self.logViewer)
1131 self.hToolboxDock.raise_() 1157 self.hToolboxDock.raise_()
1132 elif self.layoutType == "Sidebars": 1158 elif self.__layoutType == "Sidebars":
1133 self.bottomSidebar.show() 1159 self.bottomSidebar.show()
1134 self.bottomSidebar.setCurrentWidget(self.logViewer) 1160 self.bottomSidebar.setCurrentWidget(self.logViewer)
1135 self.bottomSidebar.raise_() 1161 self.bottomSidebar.raise_()
1136 if self.bottomSidebar.isAutoHiding(): 1162 if self.bottomSidebar.isAutoHiding():
1137 self.bottomSidebar.setFocus() 1163 self.bottomSidebar.setFocus()
1364 )) 1390 ))
1365 self.exitAct.triggered.connect(self.__quit) 1391 self.exitAct.triggered.connect(self.__quit)
1366 self.exitAct.setMenuRole(QAction.QuitRole) 1392 self.exitAct.setMenuRole(QAction.QuitRole)
1367 self.actions.append(self.exitAct) 1393 self.actions.append(self.exitAct)
1368 1394
1395 self.restartAct = E5Action(
1396 self.tr('Restart'),
1397 UI.PixmapCache.getIcon("restart.png"),
1398 self.tr('Restart'),
1399 QKeySequence(self.tr("Ctrl+Shift+Q", "File|Quit")),
1400 0, self, 'restart_eric')
1401 self.restartAct.setStatusTip(self.tr('Restart the IDE'))
1402 self.restartAct.setWhatsThis(self.tr(
1403 """<b>Restart the IDE</b>"""
1404 """<p>This restarts the IDE. Any unsaved changes may be saved"""
1405 """ first. Any Python program being debugged will be stopped"""
1406 """ and the preferences will be written to disc.</p>"""
1407 ))
1408 self.restartAct.triggered.connect(self.__restart)
1409 self.actions.append(self.restartAct)
1410
1369 self.saveSessionAct = E5Action( 1411 self.saveSessionAct = E5Action(
1370 self.tr('Save session'), 1412 self.tr('Save session'),
1371 self.tr('Save session...'), 1413 self.tr('Save session...'),
1372 0, 0, self, 'save_session_to_file') 1414 0, 0, self, 'save_session_to_file')
1373 self.saveSessionAct.setStatusTip(self.tr('Save session')) 1415 self.saveSessionAct.setStatusTip(self.tr('Save session'))
1511 """<p>This switches the input focus to the Shell window.</p>""" 1553 """<p>This switches the input focus to the Shell window.</p>"""
1512 )) 1554 ))
1513 self.shellActivateAct.triggered.connect(self.__activateShell) 1555 self.shellActivateAct.triggered.connect(self.__activateShell)
1514 self.actions.append(self.shellActivateAct) 1556 self.actions.append(self.shellActivateAct)
1515 self.addAction(self.shellActivateAct) 1557 self.addAction(self.shellActivateAct)
1516 1558
1517 self.browserActivateAct = E5Action( 1559 if self.browser is not None:
1518 self.tr('File-Browser'), 1560 self.browserActivateAct = E5Action(
1519 self.tr('&File-Browser'), 1561 self.tr('File-Browser'),
1520 QKeySequence(self.tr("Alt+Shift+F")), 1562 self.tr('&File-Browser'),
1521 0, self, 1563 QKeySequence(self.tr("Alt+Shift+F")),
1522 'file_browser_activate') 1564 0, self,
1523 self.browserActivateAct.setStatusTip(self.tr( 1565 'file_browser_activate')
1524 "Switch the input focus to the File-Browser window.")) 1566 self.browserActivateAct.setStatusTip(self.tr(
1525 self.browserActivateAct.setWhatsThis(self.tr( 1567 "Switch the input focus to the File-Browser window."))
1526 """<b>Activate File-Browser</b>""" 1568 self.browserActivateAct.setWhatsThis(self.tr(
1527 """<p>This switches the input focus to the File-Browser""" 1569 """<b>Activate File-Browser</b>"""
1528 """ window.</p>""" 1570 """<p>This switches the input focus to the File-Browser"""
1529 )) 1571 """ window.</p>"""
1530 self.browserActivateAct.triggered.connect(self.__activateBrowser) 1572 ))
1531 self.actions.append(self.browserActivateAct) 1573 self.browserActivateAct.triggered.connect(self.__activateBrowser)
1532 self.addAction(self.browserActivateAct) 1574 self.actions.append(self.browserActivateAct)
1575 self.addAction(self.browserActivateAct)
1533 1576
1534 self.logViewerActivateAct = E5Action( 1577 self.logViewerActivateAct = E5Action(
1535 self.tr('Log-Viewer'), 1578 self.tr('Log-Viewer'),
1536 self.tr('Lo&g-Viewer'), 1579 self.tr('Lo&g-Viewer'),
1537 QKeySequence(self.tr("Alt+Shift+G")), 1580 QKeySequence(self.tr("Alt+Shift+G")),
1564 )) 1607 ))
1565 self.taskViewerActivateAct.triggered.connect( 1608 self.taskViewerActivateAct.triggered.connect(
1566 self.__activateTaskViewer) 1609 self.__activateTaskViewer)
1567 self.actions.append(self.taskViewerActivateAct) 1610 self.actions.append(self.taskViewerActivateAct)
1568 self.addAction(self.taskViewerActivateAct) 1611 self.addAction(self.taskViewerActivateAct)
1569 1612
1570 self.templateViewerActivateAct = E5Action( 1613 if self.templateViewer is not None:
1571 self.tr('Template-Viewer'), 1614 self.templateViewerActivateAct = E5Action(
1572 self.tr('Templ&ate-Viewer'), 1615 self.tr('Template-Viewer'),
1573 QKeySequence(self.tr("Alt+Shift+A")), 1616 self.tr('Templ&ate-Viewer'),
1574 0, self, 1617 QKeySequence(self.tr("Alt+Shift+A")),
1575 'template_viewer_activate') 1618 0, self,
1576 self.templateViewerActivateAct.setStatusTip(self.tr( 1619 'template_viewer_activate')
1577 "Switch the input focus to the Template-Viewer window.")) 1620 self.templateViewerActivateAct.setStatusTip(self.tr(
1578 self.templateViewerActivateAct.setWhatsThis(self.tr( 1621 "Switch the input focus to the Template-Viewer window."))
1579 """<b>Activate Template-Viewer</b>""" 1622 self.templateViewerActivateAct.setWhatsThis(self.tr(
1580 """<p>This switches the input focus to the Template-Viewer""" 1623 """<b>Activate Template-Viewer</b>"""
1581 """ window.</p>""" 1624 """<p>This switches the input focus to the Template-Viewer"""
1582 )) 1625 """ window.</p>"""
1583 self.templateViewerActivateAct.triggered.connect( 1626 ))
1584 self.__activateTemplateViewer) 1627 self.templateViewerActivateAct.triggered.connect(
1585 self.actions.append(self.templateViewerActivateAct) 1628 self.__activateTemplateViewer)
1586 self.addAction(self.templateViewerActivateAct) 1629 self.actions.append(self.templateViewerActivateAct)
1630 self.addAction(self.templateViewerActivateAct)
1587 1631
1588 self.ltAct = E5Action( 1632 self.ltAct = E5Action(
1589 self.tr('Left Toolbox'), 1633 self.tr('Left Toolbox'),
1590 self.tr('&Left Toolbox'), 0, 0, self, 'vertical_toolbox', True) 1634 self.tr('&Left Toolbox'), 0, 0, self, 'vertical_toolbox', True)
1591 self.ltAct.setStatusTip(self.tr('Toggle the Left Toolbox window')) 1635 self.ltAct.setStatusTip(self.tr('Toggle the Left Toolbox window'))
1663 """ If it is displayed then close it.</p>""" 1707 """ If it is displayed then close it.</p>"""
1664 )) 1708 ))
1665 self.bsbAct.triggered.connect(self.__toggleBottomSidebar) 1709 self.bsbAct.triggered.connect(self.__toggleBottomSidebar)
1666 self.actions.append(self.bsbAct) 1710 self.actions.append(self.bsbAct)
1667 1711
1668 self.cooperationViewerActivateAct = E5Action( 1712 if self.cooperation is not None:
1669 self.tr('Cooperation-Viewer'), 1713 self.cooperationViewerActivateAct = E5Action(
1670 self.tr('Co&operation-Viewer'), 1714 self.tr('Cooperation-Viewer'),
1671 QKeySequence(self.tr("Alt+Shift+O")), 1715 self.tr('Co&operation-Viewer'),
1672 0, self, 1716 QKeySequence(self.tr("Alt+Shift+O")),
1673 'cooperation_viewer_activate') 1717 0, self,
1674 self.cooperationViewerActivateAct.setStatusTip(self.tr( 1718 'cooperation_viewer_activate')
1675 "Switch the input focus to the Cooperation-Viewer window.")) 1719 self.cooperationViewerActivateAct.setStatusTip(self.tr(
1676 self.cooperationViewerActivateAct.setWhatsThis(self.tr( 1720 "Switch the input focus to the Cooperation-Viewer window."))
1677 """<b>Activate Cooperation-Viewer</b>""" 1721 self.cooperationViewerActivateAct.setWhatsThis(self.tr(
1678 """<p>This switches the input focus to the Cooperation-Viewer""" 1722 """<b>Activate Cooperation-Viewer</b>"""
1679 """ window.</p>""" 1723 """<p>This switches the input focus to the"""
1680 )) 1724 """ Cooperation-Viewer window.</p>"""
1681 self.cooperationViewerActivateAct.triggered.connect( 1725 ))
1682 self.activateCooperationViewer) 1726 self.cooperationViewerActivateAct.triggered.connect(
1683 self.actions.append(self.cooperationViewerActivateAct) 1727 self.activateCooperationViewer)
1684 self.addAction(self.cooperationViewerActivateAct) 1728 self.actions.append(self.cooperationViewerActivateAct)
1685 1729 self.addAction(self.cooperationViewerActivateAct)
1686 self.ircActivateAct = E5Action( 1730
1687 self.tr('IRC'), 1731 if self.irc is not None:
1688 self.tr('&IRC'), 1732 self.ircActivateAct = E5Action(
1689 QKeySequence(self.tr("Meta+Shift+I")), 1733 self.tr('IRC'),
1690 0, self, 1734 self.tr('&IRC'),
1691 'irc_widget_activate') 1735 QKeySequence(self.tr("Meta+Shift+I")),
1692 self.ircActivateAct.setStatusTip(self.tr( 1736 0, self,
1693 "Switch the input focus to the IRC window.")) 1737 'irc_widget_activate')
1694 self.ircActivateAct.setWhatsThis(self.tr( 1738 self.ircActivateAct.setStatusTip(self.tr(
1695 """<b>Activate IRC</b>""" 1739 "Switch the input focus to the IRC window."))
1696 """<p>This switches the input focus to the IRC window.</p>""" 1740 self.ircActivateAct.setWhatsThis(self.tr(
1697 )) 1741 """<b>Activate IRC</b>"""
1698 self.ircActivateAct.triggered.connect( 1742 """<p>This switches the input focus to the IRC window.</p>"""
1699 self.__activateIRC) 1743 ))
1700 self.actions.append(self.ircActivateAct) 1744 self.ircActivateAct.triggered.connect(
1701 self.addAction(self.ircActivateAct) 1745 self.__activateIRC)
1702 1746 self.actions.append(self.ircActivateAct)
1703 self.symbolsViewerActivateAct = E5Action( 1747 self.addAction(self.ircActivateAct)
1704 self.tr('Symbols-Viewer'), 1748
1705 self.tr('S&ymbols-Viewer'), 1749 if self.symbolsViewer is not None:
1706 QKeySequence(self.tr("Alt+Shift+Y")), 1750 self.symbolsViewerActivateAct = E5Action(
1707 0, self, 1751 self.tr('Symbols-Viewer'),
1708 'symbols_viewer_activate') 1752 self.tr('S&ymbols-Viewer'),
1709 self.symbolsViewerActivateAct.setStatusTip(self.tr( 1753 QKeySequence(self.tr("Alt+Shift+Y")),
1710 "Switch the input focus to the Symbols-Viewer window.")) 1754 0, self,
1711 self.symbolsViewerActivateAct.setWhatsThis(self.tr( 1755 'symbols_viewer_activate')
1712 """<b>Activate Symbols-Viewer</b>""" 1756 self.symbolsViewerActivateAct.setStatusTip(self.tr(
1713 """<p>This switches the input focus to the Symbols-Viewer""" 1757 "Switch the input focus to the Symbols-Viewer window."))
1714 """ window.</p>""" 1758 self.symbolsViewerActivateAct.setWhatsThis(self.tr(
1715 )) 1759 """<b>Activate Symbols-Viewer</b>"""
1716 self.symbolsViewerActivateAct.triggered.connect( 1760 """<p>This switches the input focus to the Symbols-Viewer"""
1717 self.__activateSymbolsViewer) 1761 """ window.</p>"""
1718 self.actions.append(self.symbolsViewerActivateAct) 1762 ))
1719 self.addAction(self.symbolsViewerActivateAct) 1763 self.symbolsViewerActivateAct.triggered.connect(
1720 1764 self.__activateSymbolsViewer)
1721 self.numbersViewerActivateAct = E5Action( 1765 self.actions.append(self.symbolsViewerActivateAct)
1722 self.tr('Numbers-Viewer'), 1766 self.addAction(self.symbolsViewerActivateAct)
1723 self.tr('Num&bers-Viewer'), 1767
1724 QKeySequence(self.tr("Alt+Shift+B")), 1768 if self.numbersViewer is not None:
1725 0, self, 1769 self.numbersViewerActivateAct = E5Action(
1726 'numbers_viewer_activate') 1770 self.tr('Numbers-Viewer'),
1727 self.numbersViewerActivateAct.setStatusTip(self.tr( 1771 self.tr('Num&bers-Viewer'),
1728 "Switch the input focus to the Numbers-Viewer window.")) 1772 QKeySequence(self.tr("Alt+Shift+B")),
1729 self.numbersViewerActivateAct.setWhatsThis(self.tr( 1773 0, self,
1730 """<b>Activate Numbers-Viewer</b>""" 1774 'numbers_viewer_activate')
1731 """<p>This switches the input focus to the Numbers-Viewer""" 1775 self.numbersViewerActivateAct.setStatusTip(self.tr(
1732 """ window.</p>""" 1776 "Switch the input focus to the Numbers-Viewer window."))
1733 )) 1777 self.numbersViewerActivateAct.setWhatsThis(self.tr(
1734 self.numbersViewerActivateAct.triggered.connect( 1778 """<b>Activate Numbers-Viewer</b>"""
1735 self.__activateNumbersViewer) 1779 """<p>This switches the input focus to the Numbers-Viewer"""
1736 self.actions.append(self.numbersViewerActivateAct) 1780 """ window.</p>"""
1737 self.addAction(self.numbersViewerActivateAct) 1781 ))
1782 self.numbersViewerActivateAct.triggered.connect(
1783 self.__activateNumbersViewer)
1784 self.actions.append(self.numbersViewerActivateAct)
1785 self.addAction(self.numbersViewerActivateAct)
1738 1786
1739 self.whatsThisAct = E5Action( 1787 self.whatsThisAct = E5Action(
1740 self.tr('What\'s This?'), 1788 self.tr('What\'s This?'),
1741 UI.PixmapCache.getIcon("whatsThis.png"), 1789 UI.PixmapCache.getIcon("whatsThis.png"),
1742 self.tr('&What\'s This?'), 1790 self.tr('&What\'s This?'),
2662 mb.addMenu(self.__menus["file"]) 2710 mb.addMenu(self.__menus["file"])
2663 self.__menus["file"].addSeparator() 2711 self.__menus["file"].addSeparator()
2664 self.__menus["file"].addAction(self.saveSessionAct) 2712 self.__menus["file"].addAction(self.saveSessionAct)
2665 self.__menus["file"].addAction(self.loadSessionAct) 2713 self.__menus["file"].addAction(self.loadSessionAct)
2666 self.__menus["file"].addSeparator() 2714 self.__menus["file"].addSeparator()
2715 self.__menus["file"].addAction(self.restartAct)
2667 self.__menus["file"].addAction(self.exitAct) 2716 self.__menus["file"].addAction(self.exitAct)
2668 act = self.__menus["file"].actions()[0] 2717 act = self.__menus["file"].actions()[0]
2669 sep = self.__menus["file"].insertSeparator(act) 2718 sep = self.__menus["file"].insertSeparator(act)
2670 self.__menus["file"].insertAction(sep, self.newWindowAct) 2719 self.__menus["file"].insertAction(sep, self.newWindowAct)
2671 self.__menus["file"].aboutToShow.connect(self.__showFileMenu) 2720 self.__menus["file"].aboutToShow.connect(self.__showFileMenu)
2754 2803
2755 self.__menus["subwindow"] = QMenu(self.tr("&Windows"), 2804 self.__menus["subwindow"] = QMenu(self.tr("&Windows"),
2756 self.__menus["window"]) 2805 self.__menus["window"])
2757 self.__menus["subwindow"].setTearOffEnabled(True) 2806 self.__menus["subwindow"].setTearOffEnabled(True)
2758 # left side 2807 # left side
2808 try:
2809 self.__menus["subwindow"].addSection(self.tr("Left Side"))
2810 except AttributeError:
2811 # Qt4
2812 pass
2759 self.__menus["subwindow"].addAction(self.pbActivateAct) 2813 self.__menus["subwindow"].addAction(self.pbActivateAct)
2760 self.__menus["subwindow"].addAction(self.mpbActivateAct) 2814 self.__menus["subwindow"].addAction(self.mpbActivateAct)
2761 self.__menus["subwindow"].addAction(self.templateViewerActivateAct) 2815 if self.templateViewer is not None:
2762 self.__menus["subwindow"].addAction(self.browserActivateAct) 2816 self.__menus["subwindow"].addAction(self.templateViewerActivateAct)
2763 self.__menus["subwindow"].addAction(self.symbolsViewerActivateAct) 2817 if self.browser is not None:
2818 self.__menus["subwindow"].addAction(self.browserActivateAct)
2819 if self.symbolsViewer is not None:
2820 self.__menus["subwindow"].addAction(self.symbolsViewerActivateAct)
2764 # bottom side 2821 # bottom side
2822 try:
2823 self.__menus["subwindow"].addSection(self.tr("Bottom Side"))
2824 except AttributeError:
2825 # Qt4
2826 self.__menus["subwindow"].addSeparator()
2765 self.__menus["subwindow"].addAction(self.shellActivateAct) 2827 self.__menus["subwindow"].addAction(self.shellActivateAct)
2766 self.__menus["subwindow"].addAction(self.taskViewerActivateAct) 2828 self.__menus["subwindow"].addAction(self.taskViewerActivateAct)
2767 self.__menus["subwindow"].addAction(self.logViewerActivateAct) 2829 self.__menus["subwindow"].addAction(self.logViewerActivateAct)
2768 self.__menus["subwindow"].addAction(self.numbersViewerActivateAct) 2830 if self.numbersViewer is not None:
2831 self.__menus["subwindow"].addAction(self.numbersViewerActivateAct)
2832 try:
2833 self.__menus["subwindow"].addSection(self.tr("Right Side"))
2834 except AttributeError:
2835 # Qt4
2836 self.__menus["subwindow"].addSeparator()
2769 # right side 2837 # right side
2838 if self.codeDocumentationViewer is not None:
2839 self.__menus["subwindow"].addAction(
2840 self.tr("Code Documentation Viewer"),
2841 self.activateCodeDocumentationViewer)
2770 self.__menus["subwindow"].addAction(self.debugViewerActivateAct) 2842 self.__menus["subwindow"].addAction(self.debugViewerActivateAct)
2771 self.__menus["subwindow"].addAction(self.cooperationViewerActivateAct) 2843 if self.cooperation is not None:
2772 self.__menus["subwindow"].addAction(self.ircActivateAct) 2844 self.__menus["subwindow"].addAction(
2845 self.cooperationViewerActivateAct)
2846 if self.irc is not None:
2847 self.__menus["subwindow"].addAction(self.ircActivateAct)
2848 try:
2849 self.__menus["subwindow"].addSection(self.tr("Plug-ins"))
2850 except AttributeError:
2851 # Qt4
2852 self.__menus["subwindow"].addSeparator()
2773 2853
2774 self.__menus["toolbars"] = \ 2854 self.__menus["toolbars"] = \
2775 QMenu(self.tr("&Toolbars"), self.__menus["window"]) 2855 QMenu(self.tr("&Toolbars"), self.__menus["window"])
2776 self.__menus["toolbars"].setTearOffEnabled(True) 2856 self.__menus["toolbars"].setTearOffEnabled(True)
2777 self.__menus["toolbars"].aboutToShow.connect(self.__showToolbarsMenu) 2857 self.__menus["toolbars"].aboutToShow.connect(self.__showToolbarsMenu)
2878 helptb.setToolTip(self.tr("Help")) 2958 helptb.setToolTip(self.tr("Help"))
2879 profilestb.setToolTip(self.tr("Profiles")) 2959 profilestb.setToolTip(self.tr("Profiles"))
2880 pluginstb.setToolTip(self.tr("Plugins")) 2960 pluginstb.setToolTip(self.tr("Plugins"))
2881 2961
2882 filetb.addSeparator() 2962 filetb.addSeparator()
2963 filetb.addAction(self.restartAct)
2883 filetb.addAction(self.exitAct) 2964 filetb.addAction(self.exitAct)
2884 act = filetb.actions()[0] 2965 act = filetb.actions()[0]
2885 sep = filetb.insertSeparator(act) 2966 sep = filetb.insertSeparator(act)
2886 filetb.insertAction(sep, self.newWindowAct) 2967 filetb.insertAction(sep, self.newWindowAct)
2887 self.toolbarManager.addToolBar(filetb, filetb.windowTitle()) 2968 self.toolbarManager.addToolBar(filetb, filetb.windowTitle())
3580 """ 3661 """
3581 Private method to quit the application. 3662 Private method to quit the application.
3582 """ 3663 """
3583 if self.__shutdown(): 3664 if self.__shutdown():
3584 e5App().closeAllWindows() 3665 e5App().closeAllWindows()
3585 3666
3586 def __restart(self): 3667 @pyqtSlot()
3668 def __restart(self, ask=False):
3587 """ 3669 """
3588 Private method to restart the application. 3670 Private method to restart the application.
3589 """ 3671
3590 res = E5MessageBox.yesNo( 3672 @param ask flag indicating to ask the user for permission
3591 self, 3673 @type bool
3592 self.tr("Restart application"), 3674 """
3593 self.tr( 3675 if ask:
3594 """The application needs to be restarted. Do it now?"""), 3676 res = E5MessageBox.yesNo(
3595 yesDefault=True) 3677 self,
3678 self.tr("Restart application"),
3679 self.tr(
3680 """The application needs to be restarted. Do it now?"""),
3681 yesDefault=True)
3682 else:
3683 res = True
3596 3684
3597 if res and self.__shutdown(): 3685 if res and self.__shutdown():
3598 e5App().closeAllWindows() 3686 e5App().closeAllWindows()
3599 program = sys.executable 3687 program = sys.executable
3600 eric6 = os.path.join(getConfig("ericDir"), "eric6.py") 3688 eric6 = os.path.join(getConfig("ericDir"), "eric6.py")
3735 self.__menus["window"].clear() 3823 self.__menus["window"].clear()
3736 3824
3737 self.__menus["window"].addActions(self.viewProfileActGrp.actions()) 3825 self.__menus["window"].addActions(self.viewProfileActGrp.actions())
3738 self.__menus["window"].addSeparator() 3826 self.__menus["window"].addSeparator()
3739 3827
3740 if self.layoutType == "Toolboxes": 3828 if self.__layoutType == "Toolboxes":
3741 self.__menus["window"].addAction(self.ltAct) 3829 self.__menus["window"].addAction(self.ltAct)
3742 self.ltAct.setChecked(not self.lToolboxDock.isHidden()) 3830 self.ltAct.setChecked(not self.lToolboxDock.isHidden())
3743 self.__menus["window"].addAction(self.rtAct) 3831 self.__menus["window"].addAction(self.rtAct)
3744 self.rtAct.setChecked(not self.lToolboxDock.isHidden()) 3832 self.rtAct.setChecked(not self.lToolboxDock.isHidden())
3745 self.__menus["window"].addAction(self.htAct) 3833 self.__menus["window"].addAction(self.htAct)
3746 self.htAct.setChecked(not self.hToolboxDock.isHidden()) 3834 self.htAct.setChecked(not self.hToolboxDock.isHidden())
3747 elif self.layoutType == "Sidebars": 3835 elif self.__layoutType == "Sidebars":
3748 self.__menus["window"].addAction(self.lsbAct) 3836 self.__menus["window"].addAction(self.lsbAct)
3749 self.lsbAct.setChecked(not self.leftSidebar.isHidden()) 3837 self.lsbAct.setChecked(not self.leftSidebar.isHidden())
3750 self.__menus["window"].addAction(self.rsbAct) 3838 self.__menus["window"].addAction(self.rsbAct)
3751 self.rsbAct.setChecked(not self.rightSidebar.isHidden()) 3839 self.rsbAct.setChecked(not self.rightSidebar.isHidden())
3752 self.__menus["window"].addAction(self.bsbAct) 3840 self.__menus["window"].addAction(self.bsbAct)
3867 @param save flag indicating that the current profile should 3955 @param save flag indicating that the current profile should
3868 be saved (boolean) 3956 be saved (boolean)
3869 """ 3957 """
3870 if self.currentProfile and save: 3958 if self.currentProfile and save:
3871 # step 1: save the window geometries of the active profile 3959 # step 1: save the window geometries of the active profile
3872 if self.layoutType in ["Toolboxes", "Sidebars"]: 3960 if self.__layoutType in ["Toolboxes", "Sidebars"]:
3873 state = self.saveState() 3961 state = self.saveState()
3874 self.profiles[self.currentProfile][0] = state 3962 self.profiles[self.currentProfile][0] = state
3875 if self.layoutType == "Sidebars": 3963 if self.__layoutType == "Sidebars":
3876 state = self.leftSplitter.saveState() 3964 state = self.leftSplitter.saveState()
3877 self.profiles[self.currentProfile][2][0] = state 3965 self.profiles[self.currentProfile][2][0] = state
3878 state = self.verticalSplitter.saveState() 3966 state = self.verticalSplitter.saveState()
3879 self.profiles[self.currentProfile][2][1] = state 3967 self.profiles[self.currentProfile][2][1] = state
3880 state = self.leftSidebar.saveState() 3968 state = self.leftSidebar.saveState()
3884 state = self.rightSplitter.saveState() 3972 state = self.rightSplitter.saveState()
3885 self.profiles[self.currentProfile][2][4] = state 3973 self.profiles[self.currentProfile][2][4] = state
3886 state = self.rightSidebar.saveState() 3974 state = self.rightSidebar.saveState()
3887 self.profiles[self.currentProfile][2][5] = state 3975 self.profiles[self.currentProfile][2][5] = state
3888 # step 2: save the visibility of the windows of the active profile 3976 # step 2: save the visibility of the windows of the active profile
3889 if self.layoutType == "Toolboxes": 3977 if self.__layoutType == "Toolboxes":
3890 self.profiles[self.currentProfile][1][0] = \ 3978 self.profiles[self.currentProfile][1][0] = \
3891 self.lToolboxDock.isVisible() 3979 self.lToolboxDock.isVisible()
3892 self.profiles[self.currentProfile][1][1] = \ 3980 self.profiles[self.currentProfile][1][1] = \
3893 self.hToolboxDock.isVisible() 3981 self.hToolboxDock.isVisible()
3894 self.profiles[self.currentProfile][1][2] = \ 3982 self.profiles[self.currentProfile][1][2] = \
3895 self.rToolboxDock.isVisible() 3983 self.rToolboxDock.isVisible()
3896 elif self.layoutType == "Sidebars": 3984 elif self.__layoutType == "Sidebars":
3897 self.profiles[self.currentProfile][1][0] = \ 3985 self.profiles[self.currentProfile][1][0] = \
3898 self.leftSidebar.isVisible() 3986 self.leftSidebar.isVisible()
3899 self.profiles[self.currentProfile][1][1] = \ 3987 self.profiles[self.currentProfile][1][1] = \
3900 self.bottomSidebar.isVisible() 3988 self.bottomSidebar.isVisible()
3901 self.profiles[self.currentProfile][1][2] = \ 3989 self.profiles[self.currentProfile][1][2] = \
3913 if self.currentProfile != name or not save: 4001 if self.currentProfile != name or not save:
3914 # step 1: save the active profile 4002 # step 1: save the active profile
3915 self.__saveCurrentViewProfile(save) 4003 self.__saveCurrentViewProfile(save)
3916 4004
3917 # step 2: set the window geometries of the new profile 4005 # step 2: set the window geometries of the new profile
3918 if self.layoutType in ["Toolboxes", "Sidebars"]: 4006 if self.__layoutType in ["Toolboxes", "Sidebars"]:
3919 state = self.profiles[name][0] 4007 state = self.profiles[name][0]
3920 if not state.isEmpty(): 4008 if not state.isEmpty():
3921 self.restoreState(state) 4009 self.restoreState(state)
3922 if self.layoutType == "Sidebars": 4010 if self.__layoutType == "Sidebars":
3923 state = self.profiles[name][2][0] 4011 state = self.profiles[name][2][0]
3924 if not state.isEmpty(): 4012 if not state.isEmpty():
3925 self.leftSplitter.restoreState(state) 4013 self.leftSplitter.restoreState(state)
3926 state = self.profiles[name][2][1] 4014 state = self.profiles[name][2][1]
3927 if not state.isEmpty(): 4015 if not state.isEmpty():
3939 if not state.isEmpty(): 4027 if not state.isEmpty():
3940 self.rightSidebar.restoreState(state) 4028 self.rightSidebar.restoreState(state)
3941 self.__configureDockareaCornerUsage() 4029 self.__configureDockareaCornerUsage()
3942 4030
3943 # step 3: activate the windows of the new profile 4031 # step 3: activate the windows of the new profile
3944 if self.layoutType == "Toolboxes": 4032 if self.__layoutType == "Toolboxes":
3945 self.lToolboxDock.setVisible(self.profiles[name][1][0]) 4033 self.lToolboxDock.setVisible(self.profiles[name][1][0])
3946 self.hToolboxDock.setVisible(self.profiles[name][1][1]) 4034 self.hToolboxDock.setVisible(self.profiles[name][1][1])
3947 self.rToolboxDock.setVisible(self.profiles[name][1][2]) 4035 self.rToolboxDock.setVisible(self.profiles[name][1][2])
3948 elif self.layoutType == "Sidebars": 4036 elif self.__layoutType == "Sidebars":
3949 self.leftSidebar.setVisible(self.profiles[name][1][0]) 4037 self.leftSidebar.setVisible(self.profiles[name][1][0])
3950 self.bottomSidebar.setVisible(self.profiles[name][1][1]) 4038 self.bottomSidebar.setVisible(self.profiles[name][1][1])
3951 self.rightSidebar.setVisible(self.profiles[name][1][2]) 4039 self.rightSidebar.setVisible(self.profiles[name][1][2])
3952 4040
3953 # step 4: remember the new profile 4041 # step 4: remember the new profile
3966 def __debuggingStarted(self): 4054 def __debuggingStarted(self):
3967 """ 4055 """
3968 Private slot to handle the start of a debugging session. 4056 Private slot to handle the start of a debugging session.
3969 """ 4057 """
3970 self.setDebugProfile() 4058 self.setDebugProfile()
3971 if self.layoutType == "Toolboxes": 4059 if self.__layoutType == "Toolboxes":
3972 self.__currentRightWidget = self.rToolbox.currentWidget() 4060 self.__currentRightWidget = self.rToolbox.currentWidget()
3973 self.rToolbox.setCurrentWidget(self.debugViewer) 4061 self.rToolbox.setCurrentWidget(self.debugViewer)
3974 if not self.embeddedShell: 4062 self.__currentBottomWidget = self.hToolbox.currentWidget()
3975 self.__currentBottomWidget = self.hToolbox.currentWidget() 4063 self.hToolbox.setCurrentWidget(self.shellAssembly)
3976 self.hToolbox.setCurrentWidget(self.shellAssembly) 4064 elif self.__layoutType == "Sidebars":
3977 elif self.layoutType == "Sidebars":
3978 self.__currentRightWidget = self.rightSidebar.currentWidget() 4065 self.__currentRightWidget = self.rightSidebar.currentWidget()
3979 self.rightSidebar.setCurrentWidget(self.debugViewer) 4066 self.rightSidebar.setCurrentWidget(self.debugViewer)
3980 if not self.embeddedShell: 4067 self.__currentBottomWidget = self.bottomSidebar.currentWidget()
3981 self.__currentBottomWidget = self.bottomSidebar.currentWidget() 4068 self.bottomSidebar.setCurrentWidget(self.shellAssembly)
3982 self.bottomSidebar.setCurrentWidget(self.shellAssembly)
3983 4069
3984 def __debuggingDone(self): 4070 def __debuggingDone(self):
3985 """ 4071 """
3986 Private slot to handle the end of a debugging session. 4072 Private slot to handle the end of a debugging session.
3987 """ 4073 """
3988 self.__setEditProfile() 4074 self.__setEditProfile()
3989 if self.layoutType == "Toolboxes": 4075 if self.__layoutType == "Toolboxes":
3990 if self.__currentRightWidget: 4076 if self.__currentRightWidget:
3991 self.rToolbox.setCurrentWidget(self.__currentRightWidget) 4077 self.rToolbox.setCurrentWidget(self.__currentRightWidget)
3992 if self.__currentBottomWidget: 4078 if self.__currentBottomWidget:
3993 self.hToolbox.setCurrentWidget(self.__currentBottomWidget) 4079 self.hToolbox.setCurrentWidget(self.__currentBottomWidget)
3994 elif self.layoutType == "Sidebars": 4080 elif self.__layoutType == "Sidebars":
3995 if self.__currentRightWidget: 4081 if self.__currentRightWidget:
3996 self.rightSidebar.setCurrentWidget(self.__currentRightWidget) 4082 self.rightSidebar.setCurrentWidget(self.__currentRightWidget)
3997 if self.__currentBottomWidget: 4083 if self.__currentBottomWidget:
3998 self.bottomSidebar.setCurrentWidget(self.__currentBottomWidget) 4084 self.bottomSidebar.setCurrentWidget(self.__currentBottomWidget)
3999 self.__currentRightWidget = None 4085 self.__currentRightWidget = None
4029 Public method to get the current view profile. 4115 Public method to get the current view profile.
4030 4116
4031 @return the name of the current view profile (string) 4117 @return the name of the current view profile (string)
4032 """ 4118 """
4033 return self.currentProfile 4119 return self.currentProfile
4034 4120
4121 def getLayoutType(self):
4122 """
4123 Public method to get the current layout type.
4124
4125 @return current layout type
4126 @rtype str
4127 """
4128 return self.__layoutType
4129
4035 def __activateProjectBrowser(self): 4130 def __activateProjectBrowser(self):
4036 """ 4131 """
4037 Private slot to handle the activation of the project browser. 4132 Private slot to handle the activation of the project browser.
4038 """ 4133 """
4039 if self.layoutType == "Toolboxes": 4134 if self.__layoutType == "Toolboxes":
4040 self.lToolboxDock.show() 4135 self.lToolboxDock.show()
4041 self.lToolbox.setCurrentWidget(self.projectBrowser) 4136 self.lToolbox.setCurrentWidget(self.projectBrowser)
4042 elif self.layoutType == "Sidebars": 4137 elif self.__layoutType == "Sidebars":
4043 self.leftSidebar.show() 4138 self.leftSidebar.show()
4044 self.leftSidebar.setCurrentWidget(self.projectBrowser) 4139 self.leftSidebar.setCurrentWidget(self.projectBrowser)
4045 else: 4140 else:
4046 self.projectBrowser.show() 4141 self.projectBrowser.show()
4047 self.projectBrowser.currentWidget().setFocus( 4142 self.projectBrowser.currentWidget().setFocus(
4049 4144
4050 def __activateMultiProjectBrowser(self): 4145 def __activateMultiProjectBrowser(self):
4051 """ 4146 """
4052 Private slot to handle the activation of the project browser. 4147 Private slot to handle the activation of the project browser.
4053 """ 4148 """
4054 if self.layoutType == "Toolboxes": 4149 if self.__layoutType == "Toolboxes":
4055 self.lToolboxDock.show() 4150 self.lToolboxDock.show()
4056 self.lToolbox.setCurrentWidget(self.multiProjectBrowser) 4151 self.lToolbox.setCurrentWidget(self.multiProjectBrowser)
4057 elif self.layoutType == "Sidebars": 4152 elif self.__layoutType == "Sidebars":
4058 self.leftSidebar.show() 4153 self.leftSidebar.show()
4059 self.leftSidebar.setCurrentWidget(self.multiProjectBrowser) 4154 self.leftSidebar.setCurrentWidget(self.multiProjectBrowser)
4060 else: 4155 else:
4061 self.multiProjectBrowser.show() 4156 self.multiProjectBrowser.show()
4062 self.multiProjectBrowser.setFocus(Qt.ActiveWindowFocusReason) 4157 self.multiProjectBrowser.setFocus(Qt.ActiveWindowFocusReason)
4063 4158
4064 def activateDebugViewer(self): 4159 def activateDebugViewer(self):
4065 """ 4160 """
4066 Public slot to handle the activation of the debug viewer. 4161 Public slot to handle the activation of the debug viewer.
4067 """ 4162 """
4068 if self.layoutType == "Toolboxes": 4163 if self.__layoutType == "Toolboxes":
4069 self.rToolboxDock.show() 4164 self.rToolboxDock.show()
4070 self.rToolbox.setCurrentWidget(self.debugViewer) 4165 self.rToolbox.setCurrentWidget(self.debugViewer)
4071 elif self.layoutType == "Sidebars": 4166 elif self.__layoutType == "Sidebars":
4072 self.rightSidebar.show() 4167 self.rightSidebar.show()
4073 self.rightSidebar.setCurrentWidget(self.debugViewer) 4168 self.rightSidebar.setCurrentWidget(self.debugViewer)
4074 else: 4169 else:
4075 self.debugViewer.show() 4170 self.debugViewer.show()
4076 self.debugViewer.currentWidget().setFocus(Qt.ActiveWindowFocusReason) 4171 self.debugViewer.currentWidget().setFocus(Qt.ActiveWindowFocusReason)
4077 4172
4078 def __activateShell(self): 4173 def __activateShell(self):
4079 """ 4174 """
4080 Private slot to handle the activation of the Shell window. 4175 Private slot to handle the activation of the Shell window.
4081 """ 4176 """
4082 if self.embeddedShell: # embedded in debug browser 4177 if self.__layoutType == "Toolboxes":
4083 if self.layoutType == "Toolboxes": 4178 self.hToolboxDock.show()
4084 self.rToolboxDock.show() 4179 self.hToolbox.setCurrentWidget(self.shellAssembly)
4085 self.rToolbox.setCurrentWidget(self.debugViewer) 4180 elif self.__layoutType == "Sidebars":
4086 elif self.layoutType == "Sidebars": 4181 self.bottomSidebar.show()
4087 self.rightSidebar.show() 4182 self.bottomSidebar.setCurrentWidget(self.shellAssembly)
4088 self.rightSidebar.setCurrentWidget(self.debugViewer) 4183 else:
4089 else: 4184 self.shell.show()
4090 self.debugViewer.show()
4091 self.debugViewer.setCurrentWidget(self.debugViewer.shellAssembly)
4092 else: # separate window
4093 if self.layoutType == "Toolboxes":
4094 self.hToolboxDock.show()
4095 self.hToolbox.setCurrentWidget(self.shellAssembly)
4096 elif self.layoutType == "Sidebars":
4097 self.bottomSidebar.show()
4098 self.bottomSidebar.setCurrentWidget(self.shellAssembly)
4099 else:
4100 self.shell.show()
4101 self.shell.setFocus(Qt.ActiveWindowFocusReason) 4185 self.shell.setFocus(Qt.ActiveWindowFocusReason)
4102 4186
4103 def __activateLogViewer(self): 4187 def __activateLogViewer(self):
4104 """ 4188 """
4105 Private slot to handle the activation of the Log Viewer. 4189 Private slot to handle the activation of the Log Viewer.
4106 """ 4190 """
4107 if self.layoutType == "Toolboxes": 4191 if self.__layoutType == "Toolboxes":
4108 self.hToolboxDock.show() 4192 self.hToolboxDock.show()
4109 self.hToolbox.setCurrentWidget(self.logViewer) 4193 self.hToolbox.setCurrentWidget(self.logViewer)
4110 elif self.layoutType == "Sidebars": 4194 elif self.__layoutType == "Sidebars":
4111 self.bottomSidebar.show() 4195 self.bottomSidebar.show()
4112 self.bottomSidebar.setCurrentWidget(self.logViewer) 4196 self.bottomSidebar.setCurrentWidget(self.logViewer)
4113 else: 4197 else:
4114 self.logViewer.show() 4198 self.logViewer.show()
4115 self.logViewer.setFocus(Qt.ActiveWindowFocusReason) 4199 self.logViewer.setFocus(Qt.ActiveWindowFocusReason)
4116 4200
4117 def __activateTaskViewer(self): 4201 def __activateTaskViewer(self):
4118 """ 4202 """
4119 Private slot to handle the activation of the Task Viewer. 4203 Private slot to handle the activation of the Task Viewer.
4120 """ 4204 """
4121 if self.layoutType == "Toolboxes": 4205 if self.__layoutType == "Toolboxes":
4122 self.hToolboxDock.show() 4206 self.hToolboxDock.show()
4123 self.hToolbox.setCurrentWidget(self.taskViewer) 4207 self.hToolbox.setCurrentWidget(self.taskViewer)
4124 elif self.layoutType == "Sidebars": 4208 elif self.__layoutType == "Sidebars":
4125 self.bottomSidebar.show() 4209 self.bottomSidebar.show()
4126 self.bottomSidebar.setCurrentWidget(self.taskViewer) 4210 self.bottomSidebar.setCurrentWidget(self.taskViewer)
4127 else: 4211 else:
4128 self.taskViewer.show() 4212 self.taskViewer.show()
4129 self.taskViewer.setFocus(Qt.ActiveWindowFocusReason) 4213 self.taskViewer.setFocus(Qt.ActiveWindowFocusReason)
4130 4214
4131 def __activateTemplateViewer(self): 4215 def __activateTemplateViewer(self):
4132 """ 4216 """
4133 Private slot to handle the activation of the Template Viewer. 4217 Private slot to handle the activation of the Template Viewer.
4134 """ 4218 """
4135 if self.layoutType == "Toolboxes": 4219 if self.templateViewer is not None:
4136 self.lToolboxDock.show() 4220 if self.__layoutType == "Toolboxes":
4137 self.lToolbox.setCurrentWidget(self.templateViewer) 4221 self.lToolboxDock.show()
4138 elif self.layoutType == "Sidebars": 4222 self.lToolbox.setCurrentWidget(self.templateViewer)
4139 self.leftSidebar.show() 4223 elif self.__layoutType == "Sidebars":
4140 self.leftSidebar.setCurrentWidget(self.templateViewer) 4224 self.leftSidebar.show()
4141 else: 4225 self.leftSidebar.setCurrentWidget(self.templateViewer)
4142 self.templateViewer.show() 4226 else:
4143 self.templateViewer.setFocus(Qt.ActiveWindowFocusReason) 4227 self.templateViewer.show()
4228 self.templateViewer.setFocus(Qt.ActiveWindowFocusReason)
4144 4229
4145 def __activateBrowser(self): 4230 def __activateBrowser(self):
4146 """ 4231 """
4147 Private slot to handle the activation of the file browser. 4232 Private slot to handle the activation of the file browser.
4148 """ 4233 """
4149 if self.embeddedFileBrowser == 0: # separate window 4234 if self.browser is not None:
4150 if self.layoutType == "Toolboxes": 4235 if self.__layoutType == "Toolboxes":
4151 self.lToolboxDock.show() 4236 self.lToolboxDock.show()
4152 self.lToolbox.setCurrentWidget(self.browser) 4237 self.lToolbox.setCurrentWidget(self.browser)
4153 elif self.layoutType == "Sidebars": 4238 elif self.__layoutType == "Sidebars":
4154 self.leftSidebar.show() 4239 self.leftSidebar.show()
4155 self.leftSidebar.setCurrentWidget(self.browser) 4240 self.leftSidebar.setCurrentWidget(self.browser)
4156 else: 4241 else:
4157 self.browser.show() 4242 self.browser.show()
4158 elif self.embeddedFileBrowser == 1: # embedded in debug browser 4243 self.browser.setFocus(Qt.ActiveWindowFocusReason)
4159 if self.layoutType == "Toolboxes":
4160 self.rToolboxDock.show()
4161 self.rToolbox.setCurrentWidget(self.debugViewer)
4162 elif self.layoutType == "Sidebars":
4163 self.rightSidebar.show()
4164 self.rightSidebar.setCurrentWidget(self.debugViewer)
4165 else:
4166 self.debugViewer.show()
4167 self.debugViewer.setCurrentWidget(self.browser)
4168 else: # embedded in project browser
4169 if self.layoutType == "Toolboxes":
4170 self.lToolboxDock.show()
4171 self.lToolbox.setCurrentWidget(self.projectBrowser)
4172 elif self.layoutType == "Sidebars":
4173 self.leftSidebar.show()
4174 self.leftSidebar.setCurrentWidget(self.projectBrowser)
4175 else:
4176 self.projectBrowser.show()
4177 self.projectBrowser.setCurrentWidget(self.browser)
4178 self.browser.setFocus(Qt.ActiveWindowFocusReason)
4179 4244
4180 def __toggleLeftToolbox(self): 4245 def __toggleLeftToolbox(self):
4181 """ 4246 """
4182 Private slot to handle the toggle of the Left Toolbox window. 4247 Private slot to handle the toggle of the Left Toolbox window.
4183 """ 4248 """
4254 4319
4255 def activateCooperationViewer(self): 4320 def activateCooperationViewer(self):
4256 """ 4321 """
4257 Public slot to handle the activation of the cooperation window. 4322 Public slot to handle the activation of the cooperation window.
4258 """ 4323 """
4259 if self.layoutType == "Toolboxes": 4324 if self.cooperation is not None:
4260 self.rToolboxDock.show() 4325 if self.__layoutType == "Toolboxes":
4261 self.rToolbox.setCurrentWidget(self.cooperation) 4326 self.rToolboxDock.show()
4262 elif self.layoutType == "Sidebars": 4327 self.rToolbox.setCurrentWidget(self.cooperation)
4263 self.rightSidebar.show() 4328 elif self.__layoutType == "Sidebars":
4264 self.rightSidebar.setCurrentWidget(self.cooperation) 4329 self.rightSidebar.show()
4265 else: 4330 self.rightSidebar.setCurrentWidget(self.cooperation)
4266 self.cooperation.show() 4331 else:
4267 self.cooperation.setFocus(Qt.ActiveWindowFocusReason) 4332 self.cooperation.show()
4333 self.cooperation.setFocus(Qt.ActiveWindowFocusReason)
4268 4334
4269 def __activateIRC(self): 4335 def __activateIRC(self):
4270 """ 4336 """
4271 Private slot to handle the activation of the IRC window. 4337 Private slot to handle the activation of the IRC window.
4272 """ 4338 """
4273 if self.layoutType == "Toolboxes": 4339 if self.irc is not None:
4274 self.rToolboxDock.show() 4340 if self.__layoutType == "Toolboxes":
4275 self.rToolbox.setCurrentWidget(self.irc) 4341 self.rToolboxDock.show()
4276 elif self.layoutType == "Sidebars": 4342 self.rToolbox.setCurrentWidget(self.irc)
4277 self.rightSidebar.show() 4343 elif self.__layoutType == "Sidebars":
4278 self.rightSidebar.setCurrentWidget(self.irc) 4344 self.rightSidebar.show()
4279 else: 4345 self.rightSidebar.setCurrentWidget(self.irc)
4280 self.irc.show() 4346 else:
4281 self.irc.setFocus(Qt.ActiveWindowFocusReason) 4347 self.irc.show()
4348 self.irc.setFocus(Qt.ActiveWindowFocusReason)
4282 4349
4283 def __activateSymbolsViewer(self): 4350 def __activateSymbolsViewer(self):
4284 """ 4351 """
4285 Private slot to handle the activation of the Symbols Viewer. 4352 Private slot to handle the activation of the Symbols Viewer.
4286 """ 4353 """
4287 if self.layoutType == "Toolboxes": 4354 if self.symbolsViewer is not None:
4288 self.lToolboxDock.show() 4355 if self.__layoutType == "Toolboxes":
4289 self.lToolbox.setCurrentWidget(self.symbolsViewer) 4356 self.lToolboxDock.show()
4290 elif self.layoutType == "Sidebars": 4357 self.lToolbox.setCurrentWidget(self.symbolsViewer)
4291 self.leftSidebar.show() 4358 elif self.__layoutType == "Sidebars":
4292 self.leftSidebar.setCurrentWidget(self.symbolsViewer) 4359 self.leftSidebar.show()
4293 else: 4360 self.leftSidebar.setCurrentWidget(self.symbolsViewer)
4294 self.symbolsViewer.show() 4361 else:
4295 self.symbolsViewer.setFocus(Qt.ActiveWindowFocusReason) 4362 self.symbolsViewer.show()
4363 self.symbolsViewer.setFocus(Qt.ActiveWindowFocusReason)
4296 4364
4297 def __activateNumbersViewer(self): 4365 def __activateNumbersViewer(self):
4298 """ 4366 """
4299 Private slot to handle the activation of the Numbers Viewer. 4367 Private slot to handle the activation of the Numbers Viewer.
4300 """ 4368 """
4301 if self.layoutType == "Toolboxes": 4369 if self.numbersViewer is not None:
4302 self.hToolboxDock.show() 4370 if self.__layoutType == "Toolboxes":
4303 self.hToolboxDock.setCurrentWidget(self.numbersViewer) 4371 self.hToolboxDock.show()
4304 elif self.layoutType == "Sidebars": 4372 self.hToolbox.setCurrentWidget(self.numbersViewer)
4305 self.bottomSidebar.show() 4373 elif self.__layoutType == "Sidebars":
4306 self.bottomSidebar.setCurrentWidget(self.numbersViewer) 4374 self.bottomSidebar.show()
4307 else: 4375 self.bottomSidebar.setCurrentWidget(self.numbersViewer)
4308 self.numbersViewer.show() 4376 else:
4309 self.numbersViewer.setFocus(Qt.ActiveWindowFocusReason) 4377 self.numbersViewer.show()
4378 self.numbersViewer.setFocus(Qt.ActiveWindowFocusReason)
4310 4379
4311 def __activateViewmanager(self): 4380 def __activateViewmanager(self):
4312 """ 4381 """
4313 Private slot to handle the activation of the current editor. 4382 Private slot to handle the activation of the current editor.
4314 """ 4383 """
4321 Public slot to handle the activation of the Code Documentation Viewer. 4390 Public slot to handle the activation of the Code Documentation Viewer.
4322 4391
4323 @param switchFocus flag indicating to transfer the input focus 4392 @param switchFocus flag indicating to transfer the input focus
4324 @type bool 4393 @type bool
4325 """ 4394 """
4326 if self.layoutType == "Toolboxes": 4395 if self.codeDocumentationViewer is not None:
4327 self.rToolboxDock.show() 4396 if self.__layoutType == "Toolboxes":
4328 self.rToolbox.setCurrentWidget(self.codeDocumentationViewer) 4397 self.rToolboxDock.show()
4329 elif self.layoutType == "Sidebars": 4398 self.rToolbox.setCurrentWidget(self.codeDocumentationViewer)
4330 self.rightSidebar.show() 4399 elif self.__layoutType == "Sidebars":
4331 self.rightSidebar.setCurrentWidget(self.codeDocumentationViewer) 4400 self.rightSidebar.show()
4332 else: 4401 self.rightSidebar.setCurrentWidget(
4333 self.codeDocumentationViewer.show() 4402 self.codeDocumentationViewer)
4334 if switchFocus: 4403 else:
4335 self.codeDocumentationViewer.setFocus(Qt.ActiveWindowFocusReason) 4404 self.codeDocumentationViewer.show()
4405 if switchFocus:
4406 self.codeDocumentationViewer.setFocus(
4407 Qt.ActiveWindowFocusReason)
4336 4408
4337 def __toggleWindow(self, w): 4409 def __toggleWindow(self, w):
4338 """ 4410 """
4339 Private method to toggle a workspace editor window. 4411 Private method to toggle a workspace editor window.
4340 4412
5733 5805
5734 from QScintilla.SpellChecker import SpellChecker 5806 from QScintilla.SpellChecker import SpellChecker
5735 SpellChecker.setDefaultLanguage( 5807 SpellChecker.setDefaultLanguage(
5736 Preferences.getEditor("SpellCheckingDefaultLanguage")) 5808 Preferences.getEditor("SpellCheckingDefaultLanguage"))
5737 5809
5738 if self.layoutType == "Sidebars": 5810 if self.__layoutType == "Sidebars":
5739 delay = Preferences.getUI("SidebarDelay") 5811 delay = Preferences.getUI("SidebarDelay")
5740 self.leftSidebar.setDelay(delay) 5812 self.leftSidebar.setDelay(delay)
5741 self.bottomSidebar.setDelay(delay) 5813 self.bottomSidebar.setDelay(delay)
5742 self.rightSidebar.setDelay(delay) 5814 self.rightSidebar.setDelay(delay)
5743 5815
5797 def __configViewProfiles(self): 5869 def __configViewProfiles(self):
5798 """ 5870 """
5799 Private slot to configure the various view profiles. 5871 Private slot to configure the various view profiles.
5800 """ 5872 """
5801 from Preferences.ViewProfileDialog import ViewProfileDialog 5873 from Preferences.ViewProfileDialog import ViewProfileDialog
5802 dlg = ViewProfileDialog(self.layoutType, self.profiles['edit'][1], 5874 dlg = ViewProfileDialog(self.__layoutType, self.profiles['edit'][1],
5803 self.profiles['debug'][1]) 5875 self.profiles['debug'][1])
5804 if dlg.exec_() == QDialog.Accepted: 5876 if dlg.exec_() == QDialog.Accepted:
5805 edit, debug = dlg.getVisibilities() 5877 edit, debug = dlg.getVisibilities()
5806 self.profiles['edit'][1] = edit 5878 self.profiles['edit'][1] = edit
5807 self.profiles['debug'][1] = debug 5879 self.profiles['debug'][1] = debug
6336 self.pluginManager, 6408 self.pluginManager,
6337 [] if pluginFileNames is None else pluginFileNames[:], 6409 [] if pluginFileNames is None else pluginFileNames[:],
6338 self) 6410 self)
6339 dlg.exec_() 6411 dlg.exec_()
6340 if dlg.restartNeeded(): 6412 if dlg.restartNeeded():
6341 self.__restart() 6413 self.__restart(ask=True)
6342 6414
6343 def __deinstallPlugin(self): 6415 def __deinstallPlugin(self):
6344 """ 6416 """
6345 Private slot to show a dialog to uninstall a plugin. 6417 Private slot to show a dialog to uninstall a plugin.
6346 """ 6418 """
6456 6528
6457 if self.helpWindow is not None: 6529 if self.helpWindow is not None:
6458 if not self.helpWindow.shutdown(): 6530 if not self.helpWindow.shutdown():
6459 return False 6531 return False
6460 6532
6461 if not self.irc.shutdown(): 6533 if self.irc is not None:
6462 return False 6534 if not self.irc.shutdown():
6535 return False
6463 6536
6464 sessionCreated = self.__writeSession() 6537 sessionCreated = self.__writeSession()
6465 6538
6466 if not self.project.closeProject(): 6539 if not self.project.closeProject():
6467 return False 6540 return False
6473 return False 6546 return False
6474 6547
6475 if sessionCreated and not self.__disableCrashSession: 6548 if sessionCreated and not self.__disableCrashSession:
6476 self.__deleteCrashSession() 6549 self.__deleteCrashSession()
6477 6550
6478 self.codeDocumentationViewer.shutdown() 6551 if self.codeDocumentationViewer is not None:
6552 self.codeDocumentationViewer.shutdown()
6479 6553
6480 self.__previewer.shutdown() 6554 self.__previewer.shutdown()
6481 6555
6482 self.shell.closeShell() 6556 self.shell.closeShell()
6483 6557
6484 self.__writeTasks() 6558 self.__writeTasks()
6485 self.templateViewer.save() 6559
6560 if self.templateViewer is not None:
6561 self.templateViewer.save()
6486 6562
6487 if not self.debuggerUI.shutdownServer(): 6563 if not self.debuggerUI.shutdownServer():
6488 return False 6564 return False
6489 self.debuggerUI.shutdown() 6565 self.debuggerUI.shutdown()
6490 6566
6491 self.backgroundService.shutdown() 6567 self.backgroundService.shutdown()
6492 6568
6493 self.cooperation.shutdown() 6569 if self.cooperation is not None:
6570 self.cooperation.shutdown()
6494 6571
6495 self.pluginManager.doShutdown() 6572 self.pluginManager.doShutdown()
6496 6573
6497 self.virtualenvManager.shutdown() 6574 self.virtualenvManager.shutdown()
6498 6575
6499 if self.layoutType == "Sidebars": 6576 if self.__layoutType == "Sidebars":
6500 self.leftSidebar.shutdown() 6577 self.leftSidebar.shutdown()
6501 self.bottomSidebar.shutdown() 6578 self.bottomSidebar.shutdown()
6502 self.rightSidebar.shutdown() 6579 self.rightSidebar.shutdown()
6503 6580
6504 if self.SAServer is not None: 6581 if self.SAServer is not None:
6506 self.SAServer = None 6583 self.SAServer = None
6507 6584
6508 Preferences.setGeometry("MainMaximized", self.isMaximized()) 6585 Preferences.setGeometry("MainMaximized", self.isMaximized())
6509 if not self.isMaximized(): 6586 if not self.isMaximized():
6510 Preferences.setGeometry("MainGeometry", self.saveGeometry()) 6587 Preferences.setGeometry("MainGeometry", self.saveGeometry())
6511 self.browser.saveToplevelDirs() 6588
6589 if self.browser is not None:
6590 self.browser.saveToplevelDirs()
6512 6591
6513 Preferences.setUI( 6592 Preferences.setUI(
6514 "ToolbarManagerState", self.toolbarManager.saveState()) 6593 "ToolbarManagerState", self.toolbarManager.saveState())
6515 self.__saveCurrentViewProfile(True) 6594 self.__saveCurrentViewProfile(True)
6516 Preferences.saveToolGroups(self.toolGroups, self.currentToolGroup) 6595 Preferences.saveToolGroups(self.toolGroups, self.currentToolGroup)
7006 7085
7007 def autoConnectIrc(self): 7086 def autoConnectIrc(self):
7008 """ 7087 """
7009 Public method to initiate the IRC auto connection. 7088 Public method to initiate the IRC auto connection.
7010 """ 7089 """
7011 self.irc.autoConnect() 7090 if self.irc is not None:
7091 self.irc.autoConnect()
7012 7092
7013 def __ircAutoConnected(self): 7093 def __ircAutoConnected(self):
7014 """ 7094 """
7015 Private slot handling the automatic connection of the IRC client. 7095 Private slot handling the automatic connection of the IRC client.
7016 """ 7096 """

eric ide

mercurial