3011:18292228c724 | 3012:d177226027e2 |
---|---|
9 | 9 |
10 import os | 10 import os |
11 import sys | 11 import sys |
12 import logging | 12 import logging |
13 | 13 |
14 from PyQt4.QtCore import QTimer, QFile, QFileInfo, pyqtSignal, PYQT_VERSION_STR, QDate, \ | 14 from PyQt4.QtCore import QTimer, QFile, QFileInfo, pyqtSignal, \ |
15 QIODevice, qVersion, QProcess, QSize, QUrl, QObject, Qt | 15 PYQT_VERSION_STR, QDate, QIODevice, qVersion, QProcess, QSize, QUrl, \ |
16 QObject, Qt | |
16 from PyQt4.QtGui import QSizePolicy, QWidget, QKeySequence, QDesktopServices, \ | 17 from PyQt4.QtGui import QSizePolicy, QWidget, QKeySequence, QDesktopServices, \ |
17 QWhatsThis, QToolBar, QDialog, QSplitter, QApplication, QMenu, QProgressDialog, \ | 18 QWhatsThis, QToolBar, QDialog, QSplitter, QApplication, QMenu, \ |
18 QVBoxLayout, QDockWidget, QAction, QLabel | 19 QProgressDialog, QVBoxLayout, QDockWidget, QAction, QLabel |
19 from PyQt4.Qsci import QSCINTILLA_VERSION_STR | 20 from PyQt4.Qsci import QSCINTILLA_VERSION_STR |
20 from PyQt4.QtNetwork import QNetworkProxyFactory, QNetworkAccessManager, \ | 21 from PyQt4.QtNetwork import QNetworkProxyFactory, QNetworkAccessManager, \ |
21 QNetworkRequest, QNetworkReply | 22 QNetworkRequest, QNetworkReply |
22 | 23 |
23 from .Info import Version, BugAddress, Program, FeatureAddress | 24 from .Info import Version, BugAddress, Program, FeatureAddress |
83 | 84 |
84 def __bufferedWrite(self): | 85 def __bufferedWrite(self): |
85 """ | 86 """ |
86 Private method returning number of characters to write. | 87 Private method returning number of characters to write. |
87 | 88 |
88 @return number of characters buffered or length of buffered line (integer) | 89 @return number of characters buffered or length of buffered line |
90 (integer) | |
89 """ | 91 """ |
90 return self.buffer.rfind('\n') + 1 | 92 return self.buffer.rfind('\n') + 1 |
91 | 93 |
92 def flush(self): | 94 def flush(self): |
93 """ | 95 """ |
111 | 113 |
112 @signal appendStderr(str) emitted to write data to stderr logger | 114 @signal appendStderr(str) emitted to write data to stderr logger |
113 @signal appendStdout(str) emitted to write data to stdout logger | 115 @signal appendStdout(str) emitted to write data to stdout logger |
114 @signal preferencesChanged() emitted after the preferences were changed | 116 @signal preferencesChanged() emitted after the preferences were changed |
115 @signal reloadAPIs() emitted to reload the api information | 117 @signal reloadAPIs() emitted to reload the api information |
116 @signal showMenu(str, QMenu) emitted when a menu is about to be shown. The name | 118 @signal showMenu(str, QMenu) emitted when a menu is about to be shown. The |
117 of the menu and a reference to the menu are given. | 119 name of the menu and a reference to the menu are given. |
118 @signal masterPasswordChanged(str, str) emitted after the master | 120 @signal masterPasswordChanged(str, str) emitted after the master |
119 password has been changed with the old and the new password | 121 password has been changed with the old and the new password |
120 """ | 122 """ |
121 appendStderr = pyqtSignal(str) | 123 appendStderr = pyqtSignal(str) |
122 appendStdout = pyqtSignal(str) | 124 appendStdout = pyqtSignal(str) |
123 preferencesChanged = pyqtSignal() | 125 preferencesChanged = pyqtSignal() |
124 reloadAPIs = pyqtSignal() | 126 reloadAPIs = pyqtSignal() |
130 | 132 |
131 LeftSide = 1 | 133 LeftSide = 1 |
132 BottomSide = 2 | 134 BottomSide = 2 |
133 RightSide = 3 | 135 RightSide = 3 |
134 | 136 |
135 def __init__(self, app, locale, splash, plugin, noOpenAtStartup, restartArguments): | 137 def __init__(self, app, locale, splash, plugin, noOpenAtStartup, |
138 restartArguments): | |
136 """ | 139 """ |
137 Constructor | 140 Constructor |
138 | 141 |
139 @param app reference to the application object (E5Application) | 142 @param app reference to the application object (E5Application) |
140 @param locale locale to be used by the UI (string) | 143 @param locale locale to be used by the UI (string) |
141 @param splash reference to the splashscreen (UI.SplashScreen.SplashScreen) | 144 @param splash reference to the splashscreen |
142 @param plugin filename of a plugin to be loaded (used for plugin development) | 145 (UI.SplashScreen.SplashScreen) |
146 @param plugin filename of a plugin to be loaded (used for plugin | |
147 development) | |
143 @param noOpenAtStartup flag indicating that the open at startup option | 148 @param noOpenAtStartup flag indicating that the open at startup option |
144 should not be executed (boolean) | 149 should not be executed (boolean) |
145 @param restartArguments list of command line parameters to be used for a | 150 @param restartArguments list of command line parameters to be used for |
146 restart (list of strings) | 151 a restart (list of strings) |
147 """ | 152 """ |
148 super().__init__() | 153 super().__init__() |
149 self.setAttribute(Qt.WA_DeleteOnClose) | 154 self.setAttribute(Qt.WA_DeleteOnClose) |
150 | 155 |
151 self.__restartArgs = restartArguments[:] | 156 self.__restartArgs = restartArguments[:] |
152 | 157 |
153 self.setStyle(Preferences.getUI("Style"), Preferences.getUI("StyleSheet")) | 158 self.setStyle(Preferences.getUI("Style"), |
159 Preferences.getUI("StyleSheet")) | |
154 | 160 |
155 self.maxEditorPathLen = Preferences.getUI("CaptionFilenameLength") | 161 self.maxEditorPathLen = Preferences.getUI("CaptionFilenameLength") |
156 self.locale = locale | 162 self.locale = locale |
157 self.__noOpenAtStartup = noOpenAtStartup | 163 self.__noOpenAtStartup = noOpenAtStartup |
158 | 164 |
240 self.browser.sourceFile[str, int, str].connect( | 246 self.browser.sourceFile[str, int, str].connect( |
241 self.viewmanager.openSourceFile) | 247 self.viewmanager.openSourceFile) |
242 self.browser.designerFile.connect(self.__designer) | 248 self.browser.designerFile.connect(self.__designer) |
243 self.browser.linguistFile.connect(self.__linguist4) | 249 self.browser.linguistFile.connect(self.__linguist4) |
244 self.browser.projectFile.connect(self.project.openProject) | 250 self.browser.projectFile.connect(self.project.openProject) |
245 self.browser.multiProjectFile.connect(self.multiProject.openMultiProject) | 251 self.browser.multiProjectFile.connect( |
252 self.multiProject.openMultiProject) | |
246 self.browser.pixmapEditFile.connect(self.__editPixmap) | 253 self.browser.pixmapEditFile.connect(self.__editPixmap) |
247 self.browser.pixmapFile.connect(self.__showPixmap) | 254 self.browser.pixmapFile.connect(self.__showPixmap) |
248 self.browser.svgFile.connect(self.__showSvg) | 255 self.browser.svgFile.connect(self.__showSvg) |
249 self.browser.unittestOpen.connect(self.__unittestScript) | 256 self.browser.unittestOpen.connect(self.__unittestScript) |
250 self.browser.trpreview.connect(self.__TRPreviewer) | 257 self.browser.trpreview.connect(self.__TRPreviewer) |
262 self.viewmanager.openSourceFile) | 269 self.viewmanager.openSourceFile) |
263 self.projectBrowser.psBrowser.sourceFile[str, int, str].connect( | 270 self.projectBrowser.psBrowser.sourceFile[str, int, str].connect( |
264 self.viewmanager.openSourceFile) | 271 self.viewmanager.openSourceFile) |
265 self.projectBrowser.psBrowser.closeSourceWindow.connect( | 272 self.projectBrowser.psBrowser.closeSourceWindow.connect( |
266 self.viewmanager.closeWindow) | 273 self.viewmanager.closeWindow) |
267 self.projectBrowser.psBrowser.unittestOpen.connect(self.__unittestScript) | 274 self.projectBrowser.psBrowser.unittestOpen.connect( |
275 self.__unittestScript) | |
268 | 276 |
269 self.projectBrowser.pfBrowser.designerFile.connect(self.__designer) | 277 self.projectBrowser.pfBrowser.designerFile.connect(self.__designer) |
270 self.projectBrowser.pfBrowser.sourceFile.connect( | 278 self.projectBrowser.pfBrowser.sourceFile.connect( |
271 self.viewmanager.openSourceFile) | 279 self.viewmanager.openSourceFile) |
272 self.projectBrowser.pfBrowser.uipreview.connect(self.__UIPreviewer) | 280 self.projectBrowser.pfBrowser.uipreview.connect(self.__UIPreviewer) |
282 self.projectBrowser.prBrowser.appendStderr.connect(self.appendToStderr) | 290 self.projectBrowser.prBrowser.appendStderr.connect(self.appendToStderr) |
283 | 291 |
284 self.projectBrowser.ptBrowser.linguistFile.connect(self.__linguist4) | 292 self.projectBrowser.ptBrowser.linguistFile.connect(self.__linguist4) |
285 self.projectBrowser.ptBrowser.sourceFile.connect( | 293 self.projectBrowser.ptBrowser.sourceFile.connect( |
286 self.viewmanager.openSourceFile) | 294 self.viewmanager.openSourceFile) |
287 self.projectBrowser.ptBrowser.trpreview[list].connect(self.__TRPreviewer) | 295 self.projectBrowser.ptBrowser.trpreview[list].connect( |
288 self.projectBrowser.ptBrowser.trpreview[list, bool].connect(self.__TRPreviewer) | 296 self.__TRPreviewer) |
297 self.projectBrowser.ptBrowser.trpreview[list, bool].connect( | |
298 self.__TRPreviewer) | |
289 self.projectBrowser.ptBrowser.closeSourceWindow.connect( | 299 self.projectBrowser.ptBrowser.closeSourceWindow.connect( |
290 self.viewmanager.closeWindow) | 300 self.viewmanager.closeWindow) |
291 self.projectBrowser.ptBrowser.appendStdout.connect(self.appendToStdout) | 301 self.projectBrowser.ptBrowser.appendStdout.connect(self.appendToStdout) |
292 self.projectBrowser.ptBrowser.appendStderr.connect(self.appendToStderr) | 302 self.projectBrowser.ptBrowser.appendStderr.connect(self.appendToStderr) |
293 | 303 |
309 self.projectBrowser.poBrowser.svgFile.connect(self.__showSvg) | 319 self.projectBrowser.poBrowser.svgFile.connect(self.__showSvg) |
310 | 320 |
311 self.project.sourceFile.connect(self.viewmanager.openSourceFile) | 321 self.project.sourceFile.connect(self.viewmanager.openSourceFile) |
312 self.project.projectOpened.connect(self.viewmanager.projectOpened) | 322 self.project.projectOpened.connect(self.viewmanager.projectOpened) |
313 self.project.projectClosed.connect(self.viewmanager.projectClosed) | 323 self.project.projectClosed.connect(self.viewmanager.projectClosed) |
314 self.project.projectFileRenamed.connect(self.viewmanager.projectFileRenamed) | 324 self.project.projectFileRenamed.connect( |
325 self.viewmanager.projectFileRenamed) | |
315 self.project.lexerAssociationsChanged.connect( | 326 self.project.lexerAssociationsChanged.connect( |
316 self.viewmanager.projectLexerAssociationsChanged) | 327 self.viewmanager.projectLexerAssociationsChanged) |
317 self.project.newProject.connect(self.__newProject) | 328 self.project.newProject.connect(self.__newProject) |
318 self.project.projectOpened.connect(self.__projectOpened) | 329 self.project.projectOpened.connect(self.__projectOpened) |
319 self.project.projectOpened.connect(self.__activateProjectBrowser) | 330 self.project.projectOpened.connect(self.__activateProjectBrowser) |
320 self.project.projectClosed.connect(self.__projectClosed) | 331 self.project.projectClosed.connect(self.__projectClosed) |
321 | 332 |
322 self.multiProject.multiProjectOpened.connect(self.__activateMultiProjectBrowser) | 333 self.multiProject.multiProjectOpened.connect( |
334 self.__activateMultiProjectBrowser) | |
323 | 335 |
324 self.debuggerUI.resetUI.connect(self.viewmanager.handleResetUI) | 336 self.debuggerUI.resetUI.connect(self.viewmanager.handleResetUI) |
325 self.debuggerUI.resetUI.connect(self.debugViewer.handleResetUI) | 337 self.debuggerUI.resetUI.connect(self.debugViewer.handleResetUI) |
326 self.debuggerUI.resetUI.connect(self.__debuggingDone) | 338 self.debuggerUI.resetUI.connect(self.__debuggingDone) |
327 self.debuggerUI.debuggingStarted.connect(self.browser.handleProgramChange) | 339 self.debuggerUI.debuggingStarted.connect( |
340 self.browser.handleProgramChange) | |
328 self.debuggerUI.debuggingStarted.connect( | 341 self.debuggerUI.debuggingStarted.connect( |
329 self.debugViewer.exceptionLogger.debuggingStarted) | 342 self.debugViewer.exceptionLogger.debuggingStarted) |
330 self.debuggerUI.debuggingStarted.connect(self.debugViewer.handleDebuggingStarted) | 343 self.debuggerUI.debuggingStarted.connect( |
344 self.debugViewer.handleDebuggingStarted) | |
331 self.debuggerUI.debuggingStarted.connect(self.__programChange) | 345 self.debuggerUI.debuggingStarted.connect(self.__programChange) |
332 self.debuggerUI.debuggingStarted.connect(self.__debuggingStarted) | 346 self.debuggerUI.debuggingStarted.connect(self.__debuggingStarted) |
333 self.debuggerUI.compileForms.connect( | 347 self.debuggerUI.compileForms.connect( |
334 self.projectBrowser.pfBrowser.compileChangedForms) | 348 self.projectBrowser.pfBrowser.compileChangedForms) |
335 self.debuggerUI.compileResources.connect( | 349 self.debuggerUI.compileResources.connect( |
336 self.projectBrowser.prBrowser.compileChangedResources) | 350 self.projectBrowser.prBrowser.compileChangedResources) |
337 self.debuggerUI.appendStdout.connect(self.appendToStdout) | 351 self.debuggerUI.appendStdout.connect(self.appendToStdout) |
338 | 352 |
339 debugServer.passiveDebugStarted.connect( | 353 debugServer.passiveDebugStarted.connect( |
340 self.debugViewer.exceptionLogger.debuggingStarted) | 354 self.debugViewer.exceptionLogger.debuggingStarted) |
341 debugServer.passiveDebugStarted.connect(self.debugViewer.handleDebuggingStarted) | 355 debugServer.passiveDebugStarted.connect( |
342 debugServer.clientException.connect(self.debugViewer.exceptionLogger.addException) | 356 self.debugViewer.handleDebuggingStarted) |
357 debugServer.clientException.connect( | |
358 self.debugViewer.exceptionLogger.addException) | |
343 debugServer.clientLine.connect( | 359 debugServer.clientLine.connect( |
344 self.debugViewer.breakpointViewer.highlightBreakpoint) | 360 self.debugViewer.breakpointViewer.highlightBreakpoint) |
345 debugServer.clientProcessStdout.connect(self.appendToStdout) | 361 debugServer.clientProcessStdout.connect(self.appendToStdout) |
346 debugServer.clientProcessStderr.connect(self.appendToStderr) | 362 debugServer.clientProcessStderr.connect(self.appendToStderr) |
347 | 363 |
353 self.preferencesChanged.connect(self.logViewer.preferencesChanged) | 369 self.preferencesChanged.connect(self.logViewer.preferencesChanged) |
354 self.appendStdout.connect(self.logViewer.appendToStdout) | 370 self.appendStdout.connect(self.logViewer.appendToStdout) |
355 self.appendStderr.connect(self.logViewer.appendToStderr) | 371 self.appendStderr.connect(self.logViewer.appendToStderr) |
356 self.preferencesChanged.connect(self.shell.handlePreferencesChanged) | 372 self.preferencesChanged.connect(self.shell.handlePreferencesChanged) |
357 self.preferencesChanged.connect(self.project.handlePreferencesChanged) | 373 self.preferencesChanged.connect(self.project.handlePreferencesChanged) |
358 self.preferencesChanged.connect(self.projectBrowser.handlePreferencesChanged) | 374 self.preferencesChanged.connect( |
375 self.projectBrowser.handlePreferencesChanged) | |
359 self.preferencesChanged.connect( | 376 self.preferencesChanged.connect( |
360 self.projectBrowser.psBrowser.handlePreferencesChanged) | 377 self.projectBrowser.psBrowser.handlePreferencesChanged) |
361 self.preferencesChanged.connect( | 378 self.preferencesChanged.connect( |
362 self.projectBrowser.pfBrowser.handlePreferencesChanged) | 379 self.projectBrowser.pfBrowser.handlePreferencesChanged) |
363 self.preferencesChanged.connect( | 380 self.preferencesChanged.connect( |
367 self.preferencesChanged.connect( | 384 self.preferencesChanged.connect( |
368 self.projectBrowser.piBrowser.handlePreferencesChanged) | 385 self.projectBrowser.piBrowser.handlePreferencesChanged) |
369 self.preferencesChanged.connect( | 386 self.preferencesChanged.connect( |
370 self.projectBrowser.poBrowser.handlePreferencesChanged) | 387 self.projectBrowser.poBrowser.handlePreferencesChanged) |
371 self.preferencesChanged.connect(self.browser.handlePreferencesChanged) | 388 self.preferencesChanged.connect(self.browser.handlePreferencesChanged) |
372 self.preferencesChanged.connect(self.taskViewer.handlePreferencesChanged) | 389 self.preferencesChanged.connect( |
390 self.taskViewer.handlePreferencesChanged) | |
373 self.preferencesChanged.connect(self.pluginManager.preferencesChanged) | 391 self.preferencesChanged.connect(self.pluginManager.preferencesChanged) |
374 self.preferencesChanged.connect(debugServer.preferencesChanged) | 392 self.preferencesChanged.connect(debugServer.preferencesChanged) |
375 self.preferencesChanged.connect(self.debugViewer.preferencesChanged) | 393 self.preferencesChanged.connect(self.debugViewer.preferencesChanged) |
376 self.preferencesChanged.connect(self.cooperation.preferencesChanged) | 394 self.preferencesChanged.connect(self.cooperation.preferencesChanged) |
377 | 395 |
378 self.viewmanager.editorSaved.connect(self.project.repopulateItem) | 396 self.viewmanager.editorSaved.connect(self.project.repopulateItem) |
379 self.viewmanager.lastEditorClosed.connect(self.__lastEditorClosed) | 397 self.viewmanager.lastEditorClosed.connect(self.__lastEditorClosed) |
380 self.viewmanager.editorOpened.connect(self.__editorOpened) | 398 self.viewmanager.editorOpened.connect(self.__editorOpened) |
381 self.viewmanager.changeCaption.connect(self.__setWindowCaption) | 399 self.viewmanager.changeCaption.connect(self.__setWindowCaption) |
382 self.viewmanager.checkActions.connect(self.__checkActions) | 400 self.viewmanager.checkActions.connect(self.__checkActions) |
383 self.viewmanager.editorChanged.connect(self.projectBrowser.handleEditorChanged) | 401 self.viewmanager.editorChanged.connect( |
402 self.projectBrowser.handleEditorChanged) | |
384 self.viewmanager.editorLineChanged.connect( | 403 self.viewmanager.editorLineChanged.connect( |
385 self.projectBrowser.handleEditorLineChanged) | 404 self.projectBrowser.handleEditorLineChanged) |
386 self.viewmanager.checkActions.connect(self.cooperation.checkEditorActions) | 405 self.viewmanager.checkActions.connect( |
406 self.cooperation.checkEditorActions) | |
387 | 407 |
388 self.shell.zoomValueChanged.connect(self.viewmanager.zoomValueChanged) | 408 self.shell.zoomValueChanged.connect(self.viewmanager.zoomValueChanged) |
389 | 409 |
390 self.cooperation.shareEditor.connect(self.viewmanager.shareEditor) | 410 self.cooperation.shareEditor.connect(self.viewmanager.shareEditor) |
391 self.cooperation.startEdit.connect(self.viewmanager.startSharedEdit) | 411 self.cooperation.startEdit.connect(self.viewmanager.startSharedEdit) |
411 self.toolProcs = [] | 431 self.toolProcs = [] |
412 self.__initExternalToolsActions() | 432 self.__initExternalToolsActions() |
413 | 433 |
414 # create a dummy help window for shortcuts handling | 434 # create a dummy help window for shortcuts handling |
415 from Helpviewer.HelpWindow import HelpWindow | 435 from Helpviewer.HelpWindow import HelpWindow |
416 self.dummyHelpViewer = HelpWindow(None, '.', None, 'help viewer', True, True) | 436 self.dummyHelpViewer = \ |
437 HelpWindow(None, '.', None, 'help viewer', True, True) | |
417 | 438 |
418 # register all relevant objects | 439 # register all relevant objects |
419 splash.showMessage(self.trUtf8("Registering Objects...")) | 440 splash.showMessage(self.trUtf8("Registering Objects...")) |
420 e5App().registerObject("UserInterface", self) | 441 e5App().registerObject("UserInterface", self) |
421 e5App().registerObject("DebugUI", self.debuggerUI) | 442 e5App().registerObject("DebugUI", self.debuggerUI) |
467 ## sys.stdout = self.stdout | 488 ## sys.stdout = self.stdout |
468 ## sys.stderr = self.stderr | 489 ## sys.stderr = self.stderr |
469 | 490 |
470 # now fire up the single application server | 491 # now fire up the single application server |
471 if Preferences.getUI("SingleApplicationMode"): | 492 if Preferences.getUI("SingleApplicationMode"): |
472 splash.showMessage(self.trUtf8("Initializing Single Application Server...")) | 493 splash.showMessage( |
494 self.trUtf8("Initializing Single Application Server...")) | |
473 self.SAServer = E5SingleApplicationServer() | 495 self.SAServer = E5SingleApplicationServer() |
474 else: | 496 else: |
475 self.SAServer = None | 497 self.SAServer = None |
476 | 498 |
477 # now finalize the plugin manager setup | 499 # now finalize the plugin manager setup |
484 from Preferences import Shortcuts | 506 from Preferences import Shortcuts |
485 Shortcuts.readShortcuts() | 507 Shortcuts.readShortcuts() |
486 | 508 |
487 # restore toolbar manager state | 509 # restore toolbar manager state |
488 splash.showMessage(self.trUtf8("Restoring Toolbarmanager...")) | 510 splash.showMessage(self.trUtf8("Restoring Toolbarmanager...")) |
489 self.toolbarManager.restoreState(Preferences.getUI("ToolbarManagerState")) | 511 self.toolbarManager.restoreState( |
512 Preferences.getUI("ToolbarManagerState")) | |
490 | 513 |
491 # now activate the initial view profile | 514 # now activate the initial view profile |
492 splash.showMessage(self.trUtf8("Setting View Profile...")) | 515 splash.showMessage(self.trUtf8("Setting View Profile...")) |
493 self.__setEditProfile() | 516 self.__setEditProfile() |
494 | 517 |
546 layout.setContentsMargins(1, 1, 1, 1) | 569 layout.setContentsMargins(1, 1, 1, 1) |
547 layout.setSpacing(1) | 570 layout.setSpacing(1) |
548 layout.addWidget(self.viewmanager) | 571 layout.addWidget(self.viewmanager) |
549 layout.addWidget(self.viewmanager.searchWidget()) | 572 layout.addWidget(self.viewmanager.searchWidget()) |
550 layout.addWidget(self.viewmanager.replaceWidget()) | 573 layout.addWidget(self.viewmanager.replaceWidget()) |
551 self.viewmanager.setSizePolicy(QSizePolicy.Preferred, QSizePolicy.Expanding) | 574 self.viewmanager.setSizePolicy( |
575 QSizePolicy.Preferred, QSizePolicy.Expanding) | |
552 leftWidget.setLayout(layout) | 576 leftWidget.setLayout(layout) |
553 self.viewmanager.searchWidget().hide() | 577 self.viewmanager.searchWidget().hide() |
554 self.viewmanager.replaceWidget().hide() | 578 self.viewmanager.replaceWidget().hide() |
555 | 579 |
556 splitter = QSplitter(Qt.Horizontal) | 580 splitter = QSplitter(Qt.Horizontal) |
572 elif self.layout == "Sidebars": | 596 elif self.layout == "Sidebars": |
573 logging.debug("Creating sidebars...") | 597 logging.debug("Creating sidebars...") |
574 self.__createSidebarsLayout(debugServer) | 598 self.__createSidebarsLayout(debugServer) |
575 | 599 |
576 else: | 600 else: |
577 raise ValueError("Wrong layout type given ({0})".format(self.layout)) | 601 raise ValueError("Wrong layout type given ({0})".format( |
602 self.layout)) | |
578 logging.debug("Created Layout") | 603 logging.debug("Created Layout") |
579 | 604 |
580 def __createToolboxesLayout(self, debugServer): | 605 def __createToolboxesLayout(self, debugServer): |
581 """ | 606 """ |
582 Private method to create the Toolboxes layout. | 607 Private method to create the Toolboxes layout. |
593 | 618 |
594 # Create the horizontal toolbox | 619 # Create the horizontal toolbox |
595 self.hToolboxDock = self.__createDockWindow("hToolboxDock") | 620 self.hToolboxDock = self.__createDockWindow("hToolboxDock") |
596 self.hToolbox = E5HorizontalToolBox(self.hToolboxDock) | 621 self.hToolbox = E5HorizontalToolBox(self.hToolboxDock) |
597 self.__setupDockWindow(self.hToolboxDock, Qt.BottomDockWidgetArea, | 622 self.__setupDockWindow(self.hToolboxDock, Qt.BottomDockWidgetArea, |
598 self.hToolbox, self.trUtf8("Horizontal Toolbox")) | 623 self.hToolbox, |
624 self.trUtf8("Horizontal Toolbox")) | |
599 | 625 |
600 # Create the right toolbox | 626 # Create the right toolbox |
601 self.rToolboxDock = self.__createDockWindow("rToolboxDock") | 627 self.rToolboxDock = self.__createDockWindow("rToolboxDock") |
602 self.rToolbox = E5VerticalToolBox(self.rToolboxDock) | 628 self.rToolbox = E5VerticalToolBox(self.rToolboxDock) |
603 self.__setupDockWindow(self.rToolboxDock, Qt.RightDockWidgetArea, | 629 self.__setupDockWindow(self.rToolboxDock, Qt.RightDockWidgetArea, |
667 if self.embeddedShell: | 693 if self.embeddedShell: |
668 self.shell = self.debugViewer.shell | 694 self.shell = self.debugViewer.shell |
669 else: | 695 else: |
670 # Create the shell | 696 # Create the shell |
671 from QScintilla.Shell import ShellAssembly | 697 from QScintilla.Shell import ShellAssembly |
672 self.shellAssembly = ShellAssembly(debugServer, self.viewmanager, True) | 698 self.shellAssembly = \ |
699 ShellAssembly(debugServer, self.viewmanager, True) | |
673 self.shell = self.shellAssembly.shell() | 700 self.shell = self.shellAssembly.shell() |
674 self.hToolbox.insertItem(0, self.shellAssembly, | 701 self.hToolbox.insertItem(0, self.shellAssembly, |
675 UI.PixmapCache.getIcon("shell.png"), | 702 UI.PixmapCache.getIcon("shell.png"), |
676 self.trUtf8("Shell")) | 703 self.trUtf8("Shell")) |
677 | 704 |
752 from Debugger.DebugViewer import DebugViewer | 779 from Debugger.DebugViewer import DebugViewer |
753 self.debugViewer = DebugViewer(debugServer, True, self.viewmanager, | 780 self.debugViewer = DebugViewer(debugServer, True, self.viewmanager, |
754 None, | 781 None, |
755 embeddedShell=self.embeddedShell, | 782 embeddedShell=self.embeddedShell, |
756 embeddedBrowser=(self.embeddedFileBrowser == 1)) | 783 embeddedBrowser=(self.embeddedFileBrowser == 1)) |
757 self.rightSidebar.addTab(self.debugViewer, | 784 self.rightSidebar.addTab( |
758 UI.PixmapCache.getIcon("debugViewer.png"), self.trUtf8("Debug-Viewer")) | 785 self.debugViewer, UI.PixmapCache.getIcon("debugViewer.png"), |
786 self.trUtf8("Debug-Viewer")) | |
759 | 787 |
760 # Create the chat part of the user interface | 788 # Create the chat part of the user interface |
761 logging.debug("Creating Chat Widget...") | 789 logging.debug("Creating Chat Widget...") |
762 from Cooperation.ChatWidget import ChatWidget | 790 from Cooperation.ChatWidget import ChatWidget |
763 self.cooperation = ChatWidget(self) | 791 self.cooperation = ChatWidget(self) |
764 self.rightSidebar.addTab(self.cooperation, | 792 self.rightSidebar.addTab( |
765 UI.PixmapCache.getIcon("cooperation.png"), self.trUtf8("Cooperation")) | 793 self.cooperation, UI.PixmapCache.getIcon("cooperation.png"), |
794 self.trUtf8("Cooperation")) | |
766 | 795 |
767 # Create the IRC part of the user interface | 796 # Create the IRC part of the user interface |
768 logging.debug("Creating IRC Widget...") | 797 logging.debug("Creating IRC Widget...") |
769 from Network.IRC.IrcWidget import IrcWidget | 798 from Network.IRC.IrcWidget import IrcWidget |
770 self.irc = IrcWidget(self) | 799 self.irc = IrcWidget(self) |
774 # Create the task viewer part of the user interface | 803 # Create the task viewer part of the user interface |
775 logging.debug("Creating Task Viewer...") | 804 logging.debug("Creating Task Viewer...") |
776 from Tasks.TaskViewer import TaskViewer | 805 from Tasks.TaskViewer import TaskViewer |
777 self.taskViewer = TaskViewer(None, self.project) | 806 self.taskViewer = TaskViewer(None, self.project) |
778 self.bottomSidebar.addTab(self.taskViewer, | 807 self.bottomSidebar.addTab(self.taskViewer, |
779 UI.PixmapCache.getIcon("task.png"), | 808 UI.PixmapCache.getIcon("task.png"), |
780 self.trUtf8("Task-Viewer")) | 809 self.trUtf8("Task-Viewer")) |
781 | 810 |
782 # Create the log viewer part of the user interface | 811 # Create the log viewer part of the user interface |
783 logging.debug("Creating Log Viewer...") | 812 logging.debug("Creating Log Viewer...") |
784 from .LogView import LogViewer | 813 from .LogView import LogViewer |
785 self.logViewer = LogViewer() | 814 self.logViewer = LogViewer() |
786 self.bottomSidebar.addTab(self.logViewer, | 815 self.bottomSidebar.addTab(self.logViewer, |
787 UI.PixmapCache.getIcon("logViewer.png"), | 816 UI.PixmapCache.getIcon("logViewer.png"), |
788 self.trUtf8("Log-Viewer")) | 817 self.trUtf8("Log-Viewer")) |
789 | 818 |
790 if self.embeddedShell: | 819 if self.embeddedShell: |
791 self.shell = self.debugViewer.shell | 820 self.shell = self.debugViewer.shell |
792 else: | 821 else: |
793 # Create the shell | 822 # Create the shell |
794 logging.debug("Creating Shell...") | 823 logging.debug("Creating Shell...") |
795 from QScintilla.Shell import ShellAssembly | 824 from QScintilla.Shell import ShellAssembly |
796 self.shellAssembly = ShellAssembly(debugServer, self.viewmanager, True) | 825 self.shellAssembly = \ |
826 ShellAssembly(debugServer, self.viewmanager, True) | |
797 self.shell = self.shellAssembly.shell() | 827 self.shell = self.shellAssembly.shell() |
798 self.bottomSidebar.insertTab(0, self.shellAssembly, | 828 self.bottomSidebar.insertTab(0, self.shellAssembly, |
799 UI.PixmapCache.getIcon("shell.png"), | 829 UI.PixmapCache.getIcon("shell.png"), |
800 self.trUtf8("Shell")) | 830 self.trUtf8("Shell")) |
801 | 831 |
802 if self.embeddedFileBrowser == 0: # separate window | 832 if self.embeddedFileBrowser == 0: # separate window |
803 # Create the file browser | 833 # Create the file browser |
804 logging.debug("Creating File Browser...") | 834 logging.debug("Creating File Browser...") |
805 from .Browser import Browser | 835 from .Browser import Browser |
906 for container in [self.lToolbox, self.hToolbox, self.rToolbox]: | 936 for container in [self.lToolbox, self.hToolbox, self.rToolbox]: |
907 index = container.indexOf(widget) | 937 index = container.indexOf(widget) |
908 if index != -1: | 938 if index != -1: |
909 container.removeItem(index) | 939 container.removeItem(index) |
910 elif self.layout == "Sidebars": | 940 elif self.layout == "Sidebars": |
911 for container in [self.leftSidebar, self.bottomSidebar, self.rightSidebar]: | 941 for container in [self.leftSidebar, self.bottomSidebar, |
942 self.rightSidebar]: | |
912 index = container.indexOf(widget) | 943 index = container.indexOf(widget) |
913 if index != -1: | 944 if index != -1: |
914 container.removeTab(index) | 945 container.removeTab(index) |
915 | 946 |
916 def showLogTab(self, tabname): | 947 def showLogTab(self, tabname): |
1074 QDockWidget.DockWidgetFeatures(QDockWidget.AllDockWidgetFeatures)) | 1105 QDockWidget.DockWidgetFeatures(QDockWidget.AllDockWidgetFeatures)) |
1075 return dock | 1106 return dock |
1076 | 1107 |
1077 def __setupDockWindow(self, dock, where, widget, caption): | 1108 def __setupDockWindow(self, dock, where, widget, caption): |
1078 """ | 1109 """ |
1079 Private method to configure the dock window created with __createDockWindow(). | 1110 Private method to configure the dock window created with |
1111 __createDockWindow(). | |
1080 | 1112 |
1081 @param dock the dock window (QDockWindow) | 1113 @param dock the dock window (QDockWindow) |
1082 @param where dock area to be docked to (Qt.DockWidgetArea) | 1114 @param where dock area to be docked to (Qt.DockWidgetArea) |
1083 @param widget widget to be shown in the dock window (QWidget) | 1115 @param widget widget to be shown in the dock window (QWidget) |
1084 @param caption caption of the dock window (string) | 1116 @param caption caption of the dock window (string) |
1103 if project is not None: | 1135 if project is not None: |
1104 self.capProject = project | 1136 self.capProject = project |
1105 | 1137 |
1106 if self.passiveMode: | 1138 if self.passiveMode: |
1107 if not self.capProject and not self.capEditor: | 1139 if not self.capProject and not self.capEditor: |
1108 self.setWindowTitle(self.trUtf8("{0} - Passive Mode").format(Program)) | 1140 self.setWindowTitle( |
1141 self.trUtf8("{0} - Passive Mode").format(Program)) | |
1109 elif self.capProject and not self.capEditor: | 1142 elif self.capProject and not self.capEditor: |
1110 self.setWindowTitle(self.trUtf8("{0} - {1} - Passive Mode")\ | 1143 self.setWindowTitle(self.trUtf8("{0} - {1} - Passive Mode")\ |
1111 .format(self.capProject, Program)) | 1144 .format(self.capProject, Program)) |
1112 elif not self.capProject and self.capEditor: | 1145 elif not self.capProject and self.capEditor: |
1113 self.setWindowTitle(self.trUtf8("{0} - {1} - Passive Mode")\ | 1146 self.setWindowTitle(self.trUtf8("{0} - {1} - Passive Mode")\ |
1114 .format(self.capEditor, Program)) | 1147 .format(self.capEditor, Program)) |
1115 else: | 1148 else: |
1116 self.setWindowTitle(self.trUtf8("{0} - {1} - {2} - Passive Mode")\ | 1149 self.setWindowTitle( |
1150 self.trUtf8("{0} - {1} - {2} - Passive Mode")\ | |
1117 .format(self.capProject, self.capEditor, Program)) | 1151 .format(self.capProject, self.capEditor, Program)) |
1118 else: | 1152 else: |
1119 if not self.capProject and not self.capEditor: | 1153 if not self.capProject and not self.capEditor: |
1120 self.setWindowTitle(Program) | 1154 self.setWindowTitle(Program) |
1121 elif self.capProject and not self.capEditor: | 1155 elif self.capProject and not self.capEditor: |
1122 self.setWindowTitle("{0} - {1}".format(self.capProject, Program)) | 1156 self.setWindowTitle( |
1157 "{0} - {1}".format(self.capProject, Program)) | |
1123 elif not self.capProject and self.capEditor: | 1158 elif not self.capProject and self.capEditor: |
1124 self.setWindowTitle("{0} - {1}".format(self.capEditor, Program)) | 1159 self.setWindowTitle( |
1160 "{0} - {1}".format(self.capEditor, Program)) | |
1125 else: | 1161 else: |
1126 self.setWindowTitle("{0} - {1} - {2}".format( | 1162 self.setWindowTitle("{0} - {1} - {2}".format( |
1127 self.capProject, self.capEditor, Program)) | 1163 self.capProject, self.capEditor, Program)) |
1128 | 1164 |
1129 def __initActions(self): | 1165 def __initActions(self): |
1139 QKeySequence(self.trUtf8("Ctrl+Q", "File|Quit")), | 1175 QKeySequence(self.trUtf8("Ctrl+Q", "File|Quit")), |
1140 0, self, 'quit') | 1176 0, self, 'quit') |
1141 self.exitAct.setStatusTip(self.trUtf8('Quit the IDE')) | 1177 self.exitAct.setStatusTip(self.trUtf8('Quit the IDE')) |
1142 self.exitAct.setWhatsThis(self.trUtf8( | 1178 self.exitAct.setWhatsThis(self.trUtf8( |
1143 """<b>Quit the IDE</b>""" | 1179 """<b>Quit the IDE</b>""" |
1144 """<p>This quits the IDE. Any unsaved changes may be saved first.""" | 1180 """<p>This quits the IDE. Any unsaved changes may be saved""" |
1145 """ Any Python program being debugged will be stopped and the""" | 1181 """ first. Any Python program being debugged will be stopped""" |
1146 """ preferences will be written to disc.</p>""" | 1182 """ and the preferences will be written to disc.</p>""" |
1147 )) | 1183 )) |
1148 self.exitAct.triggered[()].connect(self.__quit) | 1184 self.exitAct.triggered[()].connect(self.__quit) |
1149 self.exitAct.setMenuRole(QAction.QuitRole) | 1185 self.exitAct.setMenuRole(QAction.QuitRole) |
1150 self.actions.append(self.exitAct) | 1186 self.actions.append(self.exitAct) |
1151 | 1187 |
1152 self.newWindowAct = E5Action(self.trUtf8('New Window'), | 1188 self.newWindowAct = E5Action(self.trUtf8('New Window'), |
1153 UI.PixmapCache.getIcon("newWindow.png"), | 1189 UI.PixmapCache.getIcon("newWindow.png"), |
1154 self.trUtf8('New &Window'), | 1190 self.trUtf8('New &Window'), |
1155 QKeySequence(self.trUtf8("Ctrl+Shift+N", "File|New Window")), | 1191 QKeySequence(self.trUtf8("Ctrl+Shift+N", "File|New Window")), |
1156 0, self, 'new_window') | 1192 0, self, 'new_window') |
1157 self.newWindowAct.setStatusTip(self.trUtf8('Open a new eric5 instance')) | 1193 self.newWindowAct.setStatusTip(self.trUtf8( |
1194 'Open a new eric5 instance')) | |
1158 self.newWindowAct.setWhatsThis(self.trUtf8( | 1195 self.newWindowAct.setWhatsThis(self.trUtf8( |
1159 """<b>New Window</b>""" | 1196 """<b>New Window</b>""" |
1160 """<p>This opens a new instance of the eric5 IDE.</p>""" | 1197 """<p>This opens a new instance of the eric5 IDE.</p>""" |
1161 )) | 1198 )) |
1162 self.newWindowAct.triggered[()].connect(self.__newWindow) | 1199 self.newWindowAct.triggered[()].connect(self.__newWindow) |
1163 self.actions.append(self.newWindowAct) | 1200 self.actions.append(self.newWindowAct) |
1164 self.newWindowAct.setEnabled(not Preferences.getUI("SingleApplicationMode")) | 1201 self.newWindowAct.setEnabled( |
1202 not Preferences.getUI("SingleApplicationMode")) | |
1165 | 1203 |
1166 self.viewProfileActGrp = createActionGroup(self, "viewprofiles", True) | 1204 self.viewProfileActGrp = createActionGroup(self, "viewprofiles", True) |
1167 | 1205 |
1168 self.setEditProfileAct = E5Action(self.trUtf8('Edit Profile'), | 1206 self.setEditProfileAct = E5Action(self.trUtf8('Edit Profile'), |
1169 UI.PixmapCache.getIcon("viewProfileEdit.png"), | 1207 UI.PixmapCache.getIcon("viewProfileEdit.png"), |
1170 self.trUtf8('Edit Profile'), | 1208 self.trUtf8('Edit Profile'), |
1171 0, 0, | 1209 0, 0, |
1172 self.viewProfileActGrp, 'edit_profile', True) | 1210 self.viewProfileActGrp, 'edit_profile', True) |
1173 self.setEditProfileAct.setStatusTip(self.trUtf8('Activate the edit view profile')) | 1211 self.setEditProfileAct.setStatusTip(self.trUtf8( |
1212 'Activate the edit view profile')) | |
1174 self.setEditProfileAct.setWhatsThis(self.trUtf8( | 1213 self.setEditProfileAct.setWhatsThis(self.trUtf8( |
1175 """<b>Edit Profile</b>""" | 1214 """<b>Edit Profile</b>""" |
1176 """<p>Activate the "Edit View Profile". Windows being shown,""" | 1215 """<p>Activate the "Edit View Profile". Windows being shown,""" |
1177 """ if this profile is active, may be configured with the""" | 1216 """ if this profile is active, may be configured with the""" |
1178 """ "View Profile Configuration" dialog.</p>""" | 1217 """ "View Profile Configuration" dialog.</p>""" |
1203 'project_viewer_activate') | 1242 'project_viewer_activate') |
1204 self.pbActivateAct.setStatusTip(self.trUtf8( | 1243 self.pbActivateAct.setStatusTip(self.trUtf8( |
1205 "Switch the input focus to the Project-Viewer window.")) | 1244 "Switch the input focus to the Project-Viewer window.")) |
1206 self.pbActivateAct.setWhatsThis(self.trUtf8( | 1245 self.pbActivateAct.setWhatsThis(self.trUtf8( |
1207 """<b>Activate Project-Viewer</b>""" | 1246 """<b>Activate Project-Viewer</b>""" |
1208 """<p>This switches the input focus to the Project-Viewer window.</p>""" | 1247 """<p>This switches the input focus to the Project-Viewer""" |
1248 """ window.</p>""" | |
1209 )) | 1249 )) |
1210 self.pbActivateAct.triggered[()].connect(self.__activateProjectBrowser) | 1250 self.pbActivateAct.triggered[()].connect(self.__activateProjectBrowser) |
1211 self.actions.append(self.pbActivateAct) | 1251 self.actions.append(self.pbActivateAct) |
1212 self.addAction(self.pbActivateAct) | 1252 self.addAction(self.pbActivateAct) |
1213 | 1253 |
1218 'multi_project_viewer_activate') | 1258 'multi_project_viewer_activate') |
1219 self.mpbActivateAct.setStatusTip(self.trUtf8( | 1259 self.mpbActivateAct.setStatusTip(self.trUtf8( |
1220 "Switch the input focus to the Multiproject-Viewer window.")) | 1260 "Switch the input focus to the Multiproject-Viewer window.")) |
1221 self.mpbActivateAct.setWhatsThis(self.trUtf8( | 1261 self.mpbActivateAct.setWhatsThis(self.trUtf8( |
1222 """<b>Activate Multiproject-Viewer</b>""" | 1262 """<b>Activate Multiproject-Viewer</b>""" |
1223 """<p>This switches the input focus to the Multiproject-Viewer window.</p>""" | 1263 """<p>This switches the input focus to the Multiproject-Viewer""" |
1224 )) | 1264 """ window.</p>""" |
1225 self.mpbActivateAct.triggered[()].connect(self.__activateMultiProjectBrowser) | 1265 )) |
1266 self.mpbActivateAct.triggered[()].connect( | |
1267 self.__activateMultiProjectBrowser) | |
1226 self.actions.append(self.mpbActivateAct) | 1268 self.actions.append(self.mpbActivateAct) |
1227 self.addAction(self.mpbActivateAct) | 1269 self.addAction(self.mpbActivateAct) |
1228 | 1270 |
1229 self.debugViewerActivateAct = E5Action(self.trUtf8('Debug-Viewer'), | 1271 self.debugViewerActivateAct = E5Action(self.trUtf8('Debug-Viewer'), |
1230 self.trUtf8('&Debug-Viewer'), | 1272 self.trUtf8('&Debug-Viewer'), |
1233 'debug_viewer_activate') | 1275 'debug_viewer_activate') |
1234 self.debugViewerActivateAct.setStatusTip(self.trUtf8( | 1276 self.debugViewerActivateAct.setStatusTip(self.trUtf8( |
1235 "Switch the input focus to the Debug-Viewer window.")) | 1277 "Switch the input focus to the Debug-Viewer window.")) |
1236 self.debugViewerActivateAct.setWhatsThis(self.trUtf8( | 1278 self.debugViewerActivateAct.setWhatsThis(self.trUtf8( |
1237 """<b>Activate Debug-Viewer</b>""" | 1279 """<b>Activate Debug-Viewer</b>""" |
1238 """<p>This switches the input focus to the Debug-Viewer window.</p>""" | 1280 """<p>This switches the input focus to the Debug-Viewer""" |
1239 )) | 1281 """ window.</p>""" |
1240 self.debugViewerActivateAct.triggered[()].connect(self.__activateDebugViewer) | 1282 )) |
1283 self.debugViewerActivateAct.triggered[()].connect( | |
1284 self.__activateDebugViewer) | |
1241 self.actions.append(self.debugViewerActivateAct) | 1285 self.actions.append(self.debugViewerActivateAct) |
1242 self.addAction(self.debugViewerActivateAct) | 1286 self.addAction(self.debugViewerActivateAct) |
1243 | 1287 |
1244 self.shellActivateAct = E5Action(self.trUtf8('Shell'), | 1288 self.shellActivateAct = E5Action(self.trUtf8('Shell'), |
1245 self.trUtf8('&Shell'), | 1289 self.trUtf8('&Shell'), |
1263 'file_browser_activate') | 1307 'file_browser_activate') |
1264 self.browserActivateAct.setStatusTip(self.trUtf8( | 1308 self.browserActivateAct.setStatusTip(self.trUtf8( |
1265 "Switch the input focus to the File-Browser window.")) | 1309 "Switch the input focus to the File-Browser window.")) |
1266 self.browserActivateAct.setWhatsThis(self.trUtf8( | 1310 self.browserActivateAct.setWhatsThis(self.trUtf8( |
1267 """<b>Activate File-Browser</b>""" | 1311 """<b>Activate File-Browser</b>""" |
1268 """<p>This switches the input focus to the File-Browser window.</p>""" | 1312 """<p>This switches the input focus to the File-Browser""" |
1313 """ window.</p>""" | |
1269 )) | 1314 )) |
1270 self.browserActivateAct.triggered[()].connect(self.__activateBrowser) | 1315 self.browserActivateAct.triggered[()].connect(self.__activateBrowser) |
1271 self.actions.append(self.browserActivateAct) | 1316 self.actions.append(self.browserActivateAct) |
1272 self.addAction(self.browserActivateAct) | 1317 self.addAction(self.browserActivateAct) |
1273 | 1318 |
1278 'log_viewer_activate') | 1323 'log_viewer_activate') |
1279 self.logViewerActivateAct.setStatusTip(self.trUtf8( | 1324 self.logViewerActivateAct.setStatusTip(self.trUtf8( |
1280 "Switch the input focus to the Log-Viewer window.")) | 1325 "Switch the input focus to the Log-Viewer window.")) |
1281 self.logViewerActivateAct.setWhatsThis(self.trUtf8( | 1326 self.logViewerActivateAct.setWhatsThis(self.trUtf8( |
1282 """<b>Activate Log-Viewer</b>""" | 1327 """<b>Activate Log-Viewer</b>""" |
1283 """<p>This switches the input focus to the Log-Viewer window.</p>""" | 1328 """<p>This switches the input focus to the Log-Viewer""" |
1284 )) | 1329 """ window.</p>""" |
1285 self.logViewerActivateAct.triggered[()].connect(self.__activateLogViewer) | 1330 )) |
1331 self.logViewerActivateAct.triggered[()].connect( | |
1332 self.__activateLogViewer) | |
1286 self.actions.append(self.logViewerActivateAct) | 1333 self.actions.append(self.logViewerActivateAct) |
1287 self.addAction(self.logViewerActivateAct) | 1334 self.addAction(self.logViewerActivateAct) |
1288 | 1335 |
1289 self.taskViewerActivateAct = E5Action(self.trUtf8('Task-Viewer'), | 1336 self.taskViewerActivateAct = E5Action(self.trUtf8('Task-Viewer'), |
1290 self.trUtf8('&Task-Viewer'), | 1337 self.trUtf8('&Task-Viewer'), |
1293 'task_viewer_activate') | 1340 'task_viewer_activate') |
1294 self.taskViewerActivateAct.setStatusTip(self.trUtf8( | 1341 self.taskViewerActivateAct.setStatusTip(self.trUtf8( |
1295 "Switch the input focus to the Task-Viewer window.")) | 1342 "Switch the input focus to the Task-Viewer window.")) |
1296 self.taskViewerActivateAct.setWhatsThis(self.trUtf8( | 1343 self.taskViewerActivateAct.setWhatsThis(self.trUtf8( |
1297 """<b>Activate Task-Viewer</b>""" | 1344 """<b>Activate Task-Viewer</b>""" |
1298 """<p>This switches the input focus to the Task-Viewer window.</p>""" | 1345 """<p>This switches the input focus to the Task-Viewer""" |
1299 )) | 1346 """ window.</p>""" |
1300 self.taskViewerActivateAct.triggered[()].connect(self.__activateTaskViewer) | 1347 )) |
1348 self.taskViewerActivateAct.triggered[()].connect( | |
1349 self.__activateTaskViewer) | |
1301 self.actions.append(self.taskViewerActivateAct) | 1350 self.actions.append(self.taskViewerActivateAct) |
1302 self.addAction(self.taskViewerActivateAct) | 1351 self.addAction(self.taskViewerActivateAct) |
1303 | 1352 |
1304 self.templateViewerActivateAct = E5Action(self.trUtf8('Template-Viewer'), | 1353 self.templateViewerActivateAct = E5Action( |
1305 self.trUtf8('Templ&ate-Viewer'), | 1354 self.trUtf8('Template-Viewer'), |
1306 QKeySequence(self.trUtf8("Alt+Shift+A")), | 1355 self.trUtf8('Templ&ate-Viewer'), |
1307 0, self, | 1356 QKeySequence(self.trUtf8("Alt+Shift+A")), |
1308 'template_viewer_activate') | 1357 0, self, |
1358 'template_viewer_activate') | |
1309 self.templateViewerActivateAct.setStatusTip(self.trUtf8( | 1359 self.templateViewerActivateAct.setStatusTip(self.trUtf8( |
1310 "Switch the input focus to the Template-Viewer window.")) | 1360 "Switch the input focus to the Template-Viewer window.")) |
1311 self.templateViewerActivateAct.setWhatsThis(self.trUtf8( | 1361 self.templateViewerActivateAct.setWhatsThis(self.trUtf8( |
1312 """<b>Activate Template-Viewer</b>""" | 1362 """<b>Activate Template-Viewer</b>""" |
1313 """<p>This switches the input focus to the Template-Viewer window.</p>""" | 1363 """<p>This switches the input focus to the Template-Viewer""" |
1364 """ window.</p>""" | |
1314 )) | 1365 )) |
1315 self.templateViewerActivateAct.triggered[()].connect( | 1366 self.templateViewerActivateAct.triggered[()].connect( |
1316 self.__activateTemplateViewer) | 1367 self.__activateTemplateViewer) |
1317 self.actions.append(self.templateViewerActivateAct) | 1368 self.actions.append(self.templateViewerActivateAct) |
1318 self.addAction(self.templateViewerActivateAct) | 1369 self.addAction(self.templateViewerActivateAct) |
1319 | 1370 |
1320 self.ltAct = E5Action(self.trUtf8('Left Toolbox'), | 1371 self.ltAct = E5Action( |
1321 self.trUtf8('&Left Toolbox'), 0, 0, self, 'vertical_toolbox', True) | 1372 self.trUtf8('Left Toolbox'), |
1373 self.trUtf8('&Left Toolbox'), 0, 0, self, 'vertical_toolbox', True) | |
1322 self.ltAct.setStatusTip(self.trUtf8('Toggle the Left Toolbox window')) | 1374 self.ltAct.setStatusTip(self.trUtf8('Toggle the Left Toolbox window')) |
1323 self.ltAct.setWhatsThis(self.trUtf8( | 1375 self.ltAct.setWhatsThis(self.trUtf8( |
1324 """<b>Toggle the Left Toolbox window</b>""" | 1376 """<b>Toggle the Left Toolbox window</b>""" |
1325 """<p>If the Left Toolbox window is hidden then display it.""" | 1377 """<p>If the Left Toolbox window is hidden then display it.""" |
1326 """ If it is displayed then close it.</p>""" | 1378 """ If it is displayed then close it.</p>""" |
1327 )) | 1379 )) |
1328 self.ltAct.triggered[()].connect(self.__toggleLeftToolbox) | 1380 self.ltAct.triggered[()].connect(self.__toggleLeftToolbox) |
1329 self.actions.append(self.ltAct) | 1381 self.actions.append(self.ltAct) |
1330 | 1382 |
1331 self.rtAct = E5Action(self.trUtf8('Right Toolbox'), | 1383 self.rtAct = E5Action( |
1332 self.trUtf8('&Right Toolbox'), 0, 0, self, 'vertical_toolbox', True) | 1384 self.trUtf8('Right Toolbox'), |
1385 self.trUtf8('&Right Toolbox'), | |
1386 0, 0, self, 'vertical_toolbox', True) | |
1333 self.rtAct.setStatusTip(self.trUtf8('Toggle the Right Toolbox window')) | 1387 self.rtAct.setStatusTip(self.trUtf8('Toggle the Right Toolbox window')) |
1334 self.rtAct.setWhatsThis(self.trUtf8( | 1388 self.rtAct.setWhatsThis(self.trUtf8( |
1335 """<b>Toggle the Right Toolbox window</b>""" | 1389 """<b>Toggle the Right Toolbox window</b>""" |
1336 """<p>If the Right Toolbox window is hidden then display it.""" | 1390 """<p>If the Right Toolbox window is hidden then display it.""" |
1337 """ If it is displayed then close it.</p>""" | 1391 """ If it is displayed then close it.</p>""" |
1340 self.actions.append(self.rtAct) | 1394 self.actions.append(self.rtAct) |
1341 | 1395 |
1342 self.htAct = E5Action(self.trUtf8('Horizontal Toolbox'), | 1396 self.htAct = E5Action(self.trUtf8('Horizontal Toolbox'), |
1343 self.trUtf8('&Horizontal Toolbox'), 0, 0, self, | 1397 self.trUtf8('&Horizontal Toolbox'), 0, 0, self, |
1344 'horizontal_toolbox', True) | 1398 'horizontal_toolbox', True) |
1345 self.htAct.setStatusTip(self.trUtf8('Toggle the Horizontal Toolbox window')) | 1399 self.htAct.setStatusTip(self.trUtf8( |
1400 'Toggle the Horizontal Toolbox window')) | |
1346 self.htAct.setWhatsThis(self.trUtf8( | 1401 self.htAct.setWhatsThis(self.trUtf8( |
1347 """<b>Toggle the Horizontal Toolbox window</b>""" | 1402 """<b>Toggle the Horizontal Toolbox window</b>""" |
1348 """<p>If the Horizontal Toolbox window is hidden then display it.""" | 1403 """<p>If the Horizontal Toolbox window is hidden then display""" |
1349 """ If it is displayed then close it.</p>""" | 1404 """ it. If it is displayed then close it.</p>""" |
1350 )) | 1405 )) |
1351 self.htAct.triggered[()].connect(self.__toggleHorizontalToolbox) | 1406 self.htAct.triggered[()].connect(self.__toggleHorizontalToolbox) |
1352 self.actions.append(self.htAct) | 1407 self.actions.append(self.htAct) |
1353 | 1408 |
1354 self.lsbAct = E5Action(self.trUtf8('Left Sidebar'), | 1409 self.lsbAct = E5Action(self.trUtf8('Left Sidebar'), |
1360 """ If it is displayed then close it.</p>""" | 1415 """ If it is displayed then close it.</p>""" |
1361 )) | 1416 )) |
1362 self.lsbAct.triggered[()].connect(self.__toggleLeftSidebar) | 1417 self.lsbAct.triggered[()].connect(self.__toggleLeftSidebar) |
1363 self.actions.append(self.lsbAct) | 1418 self.actions.append(self.lsbAct) |
1364 | 1419 |
1365 self.rsbAct = E5Action(self.trUtf8('Right Sidebar'), | 1420 self.rsbAct = E5Action( |
1366 self.trUtf8('&Right Sidebar'), 0, 0, self, 'right_sidebar', True) | 1421 self.trUtf8('Right Sidebar'), |
1367 self.rsbAct.setStatusTip(self.trUtf8('Toggle the right sidebar window')) | 1422 self.trUtf8('&Right Sidebar'), 0, 0, self, 'right_sidebar', True) |
1423 self.rsbAct.setStatusTip(self.trUtf8( | |
1424 'Toggle the right sidebar window')) | |
1368 self.rsbAct.setWhatsThis(self.trUtf8( | 1425 self.rsbAct.setWhatsThis(self.trUtf8( |
1369 """<b>Toggle the right sidebar window</b>""" | 1426 """<b>Toggle the right sidebar window</b>""" |
1370 """<p>If the right sidebar window is hidden then display it.""" | 1427 """<p>If the right sidebar window is hidden then display it.""" |
1371 """ If it is displayed then close it.</p>""" | 1428 """ If it is displayed then close it.</p>""" |
1372 )) | 1429 )) |
1374 self.actions.append(self.rsbAct) | 1431 self.actions.append(self.rsbAct) |
1375 | 1432 |
1376 self.bsbAct = E5Action(self.trUtf8('Bottom Sidebar'), | 1433 self.bsbAct = E5Action(self.trUtf8('Bottom Sidebar'), |
1377 self.trUtf8('&Bottom Sidebar'), 0, 0, self, | 1434 self.trUtf8('&Bottom Sidebar'), 0, 0, self, |
1378 'bottom_sidebar', True) | 1435 'bottom_sidebar', True) |
1379 self.bsbAct.setStatusTip(self.trUtf8('Toggle the bottom sidebar window')) | 1436 self.bsbAct.setStatusTip(self.trUtf8( |
1437 'Toggle the bottom sidebar window')) | |
1380 self.bsbAct.setWhatsThis(self.trUtf8( | 1438 self.bsbAct.setWhatsThis(self.trUtf8( |
1381 """<b>Toggle the bottom sidebar window</b>""" | 1439 """<b>Toggle the bottom sidebar window</b>""" |
1382 """<p>If the bottom sidebar window is hidden then display it.""" | 1440 """<p>If the bottom sidebar window is hidden then display it.""" |
1383 """ If it is displayed then close it.</p>""" | 1441 """ If it is displayed then close it.</p>""" |
1384 )) | 1442 )) |
1393 'cooperation_viewer_activate') | 1451 'cooperation_viewer_activate') |
1394 self.cooperationViewerActivateAct.setStatusTip(self.trUtf8( | 1452 self.cooperationViewerActivateAct.setStatusTip(self.trUtf8( |
1395 "Switch the input focus to the Cooperation-Viewer window.")) | 1453 "Switch the input focus to the Cooperation-Viewer window.")) |
1396 self.cooperationViewerActivateAct.setWhatsThis(self.trUtf8( | 1454 self.cooperationViewerActivateAct.setWhatsThis(self.trUtf8( |
1397 """<b>Activate Cooperation-Viewer</b>""" | 1455 """<b>Activate Cooperation-Viewer</b>""" |
1398 """<p>This switches the input focus to the Cooperation-Viewer window.</p>""" | 1456 """<p>This switches the input focus to the Cooperation-Viewer""" |
1457 """ window.</p>""" | |
1399 )) | 1458 )) |
1400 self.cooperationViewerActivateAct.triggered[()].connect( | 1459 self.cooperationViewerActivateAct.triggered[()].connect( |
1401 self.activateCooperationViewer) | 1460 self.activateCooperationViewer) |
1402 self.actions.append(self.cooperationViewerActivateAct) | 1461 self.actions.append(self.cooperationViewerActivateAct) |
1403 self.addAction(self.cooperationViewerActivateAct) | 1462 self.addAction(self.cooperationViewerActivateAct) |
1427 'symbols_viewer_activate') | 1486 'symbols_viewer_activate') |
1428 self.symbolsViewerActivateAct.setStatusTip(self.trUtf8( | 1487 self.symbolsViewerActivateAct.setStatusTip(self.trUtf8( |
1429 "Switch the input focus to the Symbols-Viewer window.")) | 1488 "Switch the input focus to the Symbols-Viewer window.")) |
1430 self.symbolsViewerActivateAct.setWhatsThis(self.trUtf8( | 1489 self.symbolsViewerActivateAct.setWhatsThis(self.trUtf8( |
1431 """<b>Activate Symbols-Viewer</b>""" | 1490 """<b>Activate Symbols-Viewer</b>""" |
1432 """<p>This switches the input focus to the Symbols-Viewer window.</p>""" | 1491 """<p>This switches the input focus to the Symbols-Viewer""" |
1433 )) | 1492 """ window.</p>""" |
1434 self.symbolsViewerActivateAct.triggered[()].connect(self.__activateSymbolsViewer) | 1493 )) |
1494 self.symbolsViewerActivateAct.triggered[()].connect( | |
1495 self.__activateSymbolsViewer) | |
1435 self.actions.append(self.symbolsViewerActivateAct) | 1496 self.actions.append(self.symbolsViewerActivateAct) |
1436 self.addAction(self.symbolsViewerActivateAct) | 1497 self.addAction(self.symbolsViewerActivateAct) |
1437 | 1498 |
1438 self.numbersViewerActivateAct = E5Action( | 1499 self.numbersViewerActivateAct = E5Action( |
1439 self.trUtf8('Numbers-Viewer'), | 1500 self.trUtf8('Numbers-Viewer'), |
1443 'numbers_viewer_activate') | 1504 'numbers_viewer_activate') |
1444 self.numbersViewerActivateAct.setStatusTip(self.trUtf8( | 1505 self.numbersViewerActivateAct.setStatusTip(self.trUtf8( |
1445 "Switch the input focus to the Numbers-Viewer window.")) | 1506 "Switch the input focus to the Numbers-Viewer window.")) |
1446 self.numbersViewerActivateAct.setWhatsThis(self.trUtf8( | 1507 self.numbersViewerActivateAct.setWhatsThis(self.trUtf8( |
1447 """<b>Activate Numbers-Viewer</b>""" | 1508 """<b>Activate Numbers-Viewer</b>""" |
1448 """<p>This switches the input focus to the Numbers-Viewer window.</p>""" | 1509 """<p>This switches the input focus to the Numbers-Viewer""" |
1449 )) | 1510 """ window.</p>""" |
1450 self.numbersViewerActivateAct.triggered[()].connect(self.__activateNumbersViewer) | 1511 )) |
1512 self.numbersViewerActivateAct.triggered[()].connect( | |
1513 self.__activateNumbersViewer) | |
1451 self.actions.append(self.numbersViewerActivateAct) | 1514 self.actions.append(self.numbersViewerActivateAct) |
1452 self.addAction(self.numbersViewerActivateAct) | 1515 self.addAction(self.numbersViewerActivateAct) |
1453 | 1516 |
1454 self.whatsThisAct = E5Action(self.trUtf8('What\'s This?'), | 1517 self.whatsThisAct = E5Action(self.trUtf8('What\'s This?'), |
1455 UI.PixmapCache.getIcon("whatsThis.png"), | 1518 UI.PixmapCache.getIcon("whatsThis.png"), |
1457 QKeySequence(self.trUtf8("Shift+F1")), | 1520 QKeySequence(self.trUtf8("Shift+F1")), |
1458 0, self, 'whatsThis') | 1521 0, self, 'whatsThis') |
1459 self.whatsThisAct.setStatusTip(self.trUtf8('Context sensitive help')) | 1522 self.whatsThisAct.setStatusTip(self.trUtf8('Context sensitive help')) |
1460 self.whatsThisAct.setWhatsThis(self.trUtf8( | 1523 self.whatsThisAct.setWhatsThis(self.trUtf8( |
1461 """<b>Display context sensitive help</b>""" | 1524 """<b>Display context sensitive help</b>""" |
1462 """<p>In What's This? mode, the mouse cursor shows an arrow with a question""" | 1525 """<p>In What's This? mode, the mouse cursor shows an arrow with""" |
1463 """ mark, and you can click on the interface elements to get a short""" | 1526 """ a question mark, and you can click on the interface elements""" |
1464 """ description of what they do and how to use them. In dialogs, this""" | 1527 """ to get a short description of what they do and how to use""" |
1465 """ feature can be accessed using the context help button in the""" | 1528 """ them. In dialogs, this feature can be accessed using the""" |
1466 """ titlebar.</p>""" | 1529 """ context help button in the titlebar.</p>""" |
1467 )) | 1530 )) |
1468 self.whatsThisAct.triggered[()].connect(self.__whatsThis) | 1531 self.whatsThisAct.triggered[()].connect(self.__whatsThis) |
1469 self.actions.append(self.whatsThisAct) | 1532 self.actions.append(self.whatsThisAct) |
1470 | 1533 |
1471 self.helpviewerAct = E5Action(self.trUtf8('Helpviewer'), | 1534 self.helpviewerAct = E5Action(self.trUtf8('Helpviewer'), |
1472 UI.PixmapCache.getIcon("help.png"), | 1535 UI.PixmapCache.getIcon("help.png"), |
1473 self.trUtf8('&Helpviewer...'), | 1536 self.trUtf8('&Helpviewer...'), |
1474 QKeySequence(self.trUtf8("F1")), | 1537 QKeySequence(self.trUtf8("F1")), |
1475 0, self, 'helpviewer') | 1538 0, self, 'helpviewer') |
1476 self.helpviewerAct.setStatusTip(self.trUtf8('Open the helpviewer window')) | 1539 self.helpviewerAct.setStatusTip(self.trUtf8( |
1540 'Open the helpviewer window')) | |
1477 self.helpviewerAct.setWhatsThis(self.trUtf8( | 1541 self.helpviewerAct.setWhatsThis(self.trUtf8( |
1478 """<b>Helpviewer</b>""" | 1542 """<b>Helpviewer</b>""" |
1479 """<p>Display the eric5 web browser. This window will show""" | 1543 """<p>Display the eric5 web browser. This window will show""" |
1480 """ HTML help files and help from Qt help collections. It has the""" | 1544 """ HTML help files and help from Qt help collections. It has""" |
1481 """ capability to navigate to links, set bookmarks, print the displayed""" | 1545 """ the capability to navigate to links, set bookmarks, print""" |
1482 """ help and some more features. You may use it to browse the internet""" | 1546 """ the displayed help and some more features. You may use it to""" |
1483 """ as well</p><p>If called with a word selected, this word is search""" | 1547 """ browse the internet as well</p><p>If called with a word""" |
1484 """ in the Qt help collection.</p>""" | 1548 """ selected, this word is search in the Qt help collection.</p>""" |
1485 )) | 1549 )) |
1486 self.helpviewerAct.triggered[()].connect(self.__helpViewer) | 1550 self.helpviewerAct.triggered[()].connect(self.__helpViewer) |
1487 self.actions.append(self.helpviewerAct) | 1551 self.actions.append(self.helpviewerAct) |
1488 | 1552 |
1489 self.__initQtDocActions() | 1553 self.__initQtDocActions() |
1491 self.__initEricDocAction() | 1555 self.__initEricDocAction() |
1492 self.__initPySideDocAction() | 1556 self.__initPySideDocAction() |
1493 | 1557 |
1494 self.versionAct = E5Action(self.trUtf8('Show Versions'), | 1558 self.versionAct = E5Action(self.trUtf8('Show Versions'), |
1495 self.trUtf8('Show &Versions'), 0, 0, self, 'show_versions') | 1559 self.trUtf8('Show &Versions'), 0, 0, self, 'show_versions') |
1496 self.versionAct.setStatusTip(self.trUtf8('Display version information')) | 1560 self.versionAct.setStatusTip(self.trUtf8( |
1561 'Display version information')) | |
1497 self.versionAct.setWhatsThis(self.trUtf8( | 1562 self.versionAct.setWhatsThis(self.trUtf8( |
1498 """<b>Show Versions</b>""" | 1563 """<b>Show Versions</b>""" |
1499 """<p>Display version information.</p>""" | 1564 """<p>Display version information.</p>""" |
1500 )) | 1565 )) |
1501 self.versionAct.triggered[()].connect(self.__showVersions) | 1566 self.versionAct.triggered[()].connect(self.__showVersions) |
1502 self.actions.append(self.versionAct) | 1567 self.actions.append(self.versionAct) |
1503 | 1568 |
1504 self.checkUpdateAct = E5Action(self.trUtf8('Check for Updates'), | 1569 self.checkUpdateAct = E5Action( |
1505 self.trUtf8('Check for &Updates...'), 0, 0, self, 'check_updates') | 1570 self.trUtf8('Check for Updates'), |
1571 self.trUtf8('Check for &Updates...'), 0, 0, self, 'check_updates') | |
1506 self.checkUpdateAct.setStatusTip(self.trUtf8('Check for Updates')) | 1572 self.checkUpdateAct.setStatusTip(self.trUtf8('Check for Updates')) |
1507 self.checkUpdateAct.setWhatsThis(self.trUtf8( | 1573 self.checkUpdateAct.setWhatsThis(self.trUtf8( |
1508 """<b>Check for Updates...</b>""" | 1574 """<b>Check for Updates...</b>""" |
1509 """<p>Checks the internet for updates of eric5.</p>""" | 1575 """<p>Checks the internet for updates of eric5.</p>""" |
1510 )) | 1576 )) |
1511 self.checkUpdateAct.triggered[()].connect(self.performVersionCheck) | 1577 self.checkUpdateAct.triggered[()].connect(self.performVersionCheck) |
1512 self.actions.append(self.checkUpdateAct) | 1578 self.actions.append(self.checkUpdateAct) |
1513 | 1579 |
1514 self.showVersionsAct = E5Action(self.trUtf8('Show downloadable versions'), | 1580 self.showVersionsAct = E5Action( |
1515 self.trUtf8('Show &downloadable versions...'), | 1581 self.trUtf8('Show downloadable versions'), |
1516 0, 0, self, 'show_downloadable_versions') | 1582 self.trUtf8('Show &downloadable versions...'), |
1583 0, 0, self, 'show_downloadable_versions') | |
1517 self.showVersionsAct.setStatusTip( | 1584 self.showVersionsAct.setStatusTip( |
1518 self.trUtf8('Show the versions available for download')) | 1585 self.trUtf8('Show the versions available for download')) |
1519 self.showVersionsAct.setWhatsThis(self.trUtf8( | 1586 self.showVersionsAct.setWhatsThis(self.trUtf8( |
1520 """<b>Show downloadable versions...</b>""" | 1587 """<b>Show downloadable versions...</b>""" |
1521 """<p>Shows the eric5 versions available for download """ | 1588 """<p>Shows the eric5 versions available for download """ |
1522 """from the internet.</p>""" | 1589 """from the internet.</p>""" |
1523 )) | 1590 )) |
1524 self.showVersionsAct.triggered[()].connect(self.showAvailableVersionsInfo) | 1591 self.showVersionsAct.triggered[()].connect( |
1592 self.showAvailableVersionsInfo) | |
1525 self.actions.append(self.showVersionsAct) | 1593 self.actions.append(self.showVersionsAct) |
1526 | 1594 |
1527 self.reportBugAct = E5Action(self.trUtf8('Report Bug'), | 1595 self.reportBugAct = E5Action(self.trUtf8('Report Bug'), |
1528 self.trUtf8('Report &Bug...'), 0, 0, self, 'report_bug') | 1596 self.trUtf8('Report &Bug...'), 0, 0, self, 'report_bug') |
1529 self.reportBugAct.setStatusTip(self.trUtf8('Report a bug')) | 1597 self.reportBugAct.setStatusTip(self.trUtf8('Report a bug')) |
1532 """<p>Opens a dialog to report a bug.</p>""" | 1600 """<p>Opens a dialog to report a bug.</p>""" |
1533 )) | 1601 )) |
1534 self.reportBugAct.triggered[()].connect(self.__reportBug) | 1602 self.reportBugAct.triggered[()].connect(self.__reportBug) |
1535 self.actions.append(self.reportBugAct) | 1603 self.actions.append(self.reportBugAct) |
1536 | 1604 |
1537 self.requestFeatureAct = E5Action(self.trUtf8('Request Feature'), | 1605 self.requestFeatureAct = E5Action( |
1538 self.trUtf8('Request &Feature...'), 0, 0, self, 'request_feature') | 1606 self.trUtf8('Request Feature'), |
1539 self.requestFeatureAct.setStatusTip(self.trUtf8('Send a feature request')) | 1607 self.trUtf8('Request &Feature...'), 0, 0, self, 'request_feature') |
1608 self.requestFeatureAct.setStatusTip(self.trUtf8( | |
1609 'Send a feature request')) | |
1540 self.requestFeatureAct.setWhatsThis(self.trUtf8( | 1610 self.requestFeatureAct.setWhatsThis(self.trUtf8( |
1541 """<b>Request Feature...</b>""" | 1611 """<b>Request Feature...</b>""" |
1542 """<p>Opens a dialog to send a feature request.</p>""" | 1612 """<p>Opens a dialog to send a feature request.</p>""" |
1543 )) | 1613 )) |
1544 self.requestFeatureAct.triggered[()].connect(self.__requestFeature) | 1614 self.requestFeatureAct.triggered[()].connect(self.__requestFeature) |
1578 0, 0, self.utActGrp, 'unittest_rerun_failed') | 1648 0, 0, self.utActGrp, 'unittest_rerun_failed') |
1579 self.utRerunFailedAct.setStatusTip(self.trUtf8( | 1649 self.utRerunFailedAct.setStatusTip(self.trUtf8( |
1580 'Rerun failed tests of the last run')) | 1650 'Rerun failed tests of the last run')) |
1581 self.utRerunFailedAct.setWhatsThis(self.trUtf8( | 1651 self.utRerunFailedAct.setWhatsThis(self.trUtf8( |
1582 """<b>Rerun Failed Tests</b>""" | 1652 """<b>Rerun Failed Tests</b>""" |
1583 """<p>Rerun all tests that failed during the last unittest run.</p>""" | 1653 """<p>Rerun all tests that failed during the last unittest""" |
1654 """ run.</p>""" | |
1584 )) | 1655 )) |
1585 self.utRerunFailedAct.triggered[()].connect(self.__unittestRerunFailed) | 1656 self.utRerunFailedAct.triggered[()].connect(self.__unittestRerunFailed) |
1586 self.utRerunFailedAct.setEnabled(False) | 1657 self.utRerunFailedAct.setEnabled(False) |
1587 self.actions.append(self.utRerunFailedAct) | 1658 self.actions.append(self.utRerunFailedAct) |
1588 | 1659 |
1589 self.utScriptAct = E5Action(self.trUtf8('Unittest Script'), | 1660 self.utScriptAct = E5Action(self.trUtf8('Unittest Script'), |
1590 UI.PixmapCache.getIcon("unittestScript.png"), | 1661 UI.PixmapCache.getIcon("unittestScript.png"), |
1591 self.trUtf8('Unittest &Script...'), | 1662 self.trUtf8('Unittest &Script...'), |
1592 0, 0, self.utActGrp, 'unittest_script') | 1663 0, 0, self.utActGrp, 'unittest_script') |
1593 self.utScriptAct.setStatusTip(self.trUtf8('Run unittest with current script')) | 1664 self.utScriptAct.setStatusTip(self.trUtf8( |
1665 'Run unittest with current script')) | |
1594 self.utScriptAct.setWhatsThis(self.trUtf8( | 1666 self.utScriptAct.setWhatsThis(self.trUtf8( |
1595 """<b>Unittest Script</b>""" | 1667 """<b>Unittest Script</b>""" |
1596 """<p>Run unittest with current script.</p>""" | 1668 """<p>Run unittest with current script.</p>""" |
1597 )) | 1669 )) |
1598 self.utScriptAct.triggered[()].connect(self.__unittestScript) | 1670 self.utScriptAct.triggered[()].connect(self.__unittestScript) |
1601 | 1673 |
1602 self.utProjectAct = E5Action(self.trUtf8('Unittest Project'), | 1674 self.utProjectAct = E5Action(self.trUtf8('Unittest Project'), |
1603 UI.PixmapCache.getIcon("unittestProject.png"), | 1675 UI.PixmapCache.getIcon("unittestProject.png"), |
1604 self.trUtf8('Unittest &Project...'), | 1676 self.trUtf8('Unittest &Project...'), |
1605 0, 0, self.utActGrp, 'unittest_project') | 1677 0, 0, self.utActGrp, 'unittest_project') |
1606 self.utProjectAct.setStatusTip(self.trUtf8('Run unittest with current project')) | 1678 self.utProjectAct.setStatusTip(self.trUtf8( |
1679 'Run unittest with current project')) | |
1607 self.utProjectAct.setWhatsThis(self.trUtf8( | 1680 self.utProjectAct.setWhatsThis(self.trUtf8( |
1608 """<b>Unittest Project</b>""" | 1681 """<b>Unittest Project</b>""" |
1609 """<p>Run unittest with current project.</p>""" | 1682 """<p>Run unittest with current project.</p>""" |
1610 )) | 1683 )) |
1611 self.utProjectAct.triggered[()].connect(self.__unittestProject) | 1684 self.utProjectAct.triggered[()].connect(self.__unittestProject) |
1666 """<p>Start the UI Previewer.</p>""" | 1739 """<p>Start the UI Previewer.</p>""" |
1667 )) | 1740 )) |
1668 self.uipreviewerAct.triggered[()].connect(self.__UIPreviewer) | 1741 self.uipreviewerAct.triggered[()].connect(self.__UIPreviewer) |
1669 self.actions.append(self.uipreviewerAct) | 1742 self.actions.append(self.uipreviewerAct) |
1670 | 1743 |
1671 self.trpreviewerAct = E5Action(self.trUtf8('Translations Previewer'), | 1744 self.trpreviewerAct = E5Action( |
1672 UI.PixmapCache.getIcon("trPreviewer.png"), | 1745 self.trUtf8('Translations Previewer'), |
1673 self.trUtf8('&Translations Previewer...'), 0, 0, self, 'tr_previewer') | 1746 UI.PixmapCache.getIcon("trPreviewer.png"), |
1674 self.trpreviewerAct.setStatusTip(self.trUtf8('Start the Translations Previewer')) | 1747 self.trUtf8('&Translations Previewer...'), |
1748 0, 0, self, 'tr_previewer') | |
1749 self.trpreviewerAct.setStatusTip(self.trUtf8( | |
1750 'Start the Translations Previewer')) | |
1675 self.trpreviewerAct.setWhatsThis(self.trUtf8( | 1751 self.trpreviewerAct.setWhatsThis(self.trUtf8( |
1676 """<b>Translations Previewer</b>""" | 1752 """<b>Translations Previewer</b>""" |
1677 """<p>Start the Translations Previewer.</p>""" | 1753 """<p>Start the Translations Previewer.</p>""" |
1678 )) | 1754 )) |
1679 self.trpreviewerAct.triggered[()].connect(self.__TRPreviewer) | 1755 self.trpreviewerAct.triggered[()].connect(self.__TRPreviewer) |
1729 | 1805 |
1730 self.webBrowserAct = E5Action(self.trUtf8('eric5 Web Browser'), | 1806 self.webBrowserAct = E5Action(self.trUtf8('eric5 Web Browser'), |
1731 UI.PixmapCache.getIcon("ericWeb.png"), | 1807 UI.PixmapCache.getIcon("ericWeb.png"), |
1732 self.trUtf8('eric5 &Web Browser...'), | 1808 self.trUtf8('eric5 &Web Browser...'), |
1733 0, 0, self, 'web_browser') | 1809 0, 0, self, 'web_browser') |
1734 self.webBrowserAct.setStatusTip(self.trUtf8('Start the eric5 Web Browser')) | 1810 self.webBrowserAct.setStatusTip(self.trUtf8( |
1811 'Start the eric5 Web Browser')) | |
1735 self.webBrowserAct.setWhatsThis(self.trUtf8( | 1812 self.webBrowserAct.setWhatsThis(self.trUtf8( |
1736 """<b>eric5 Web Browser</b>""" | 1813 """<b>eric5 Web Browser</b>""" |
1737 """<p>Browse the Internet with the eric5 Web Browser.</p>""" | 1814 """<p>Browse the Internet with the eric5 Web Browser.</p>""" |
1738 )) | 1815 )) |
1739 self.webBrowserAct.triggered[()].connect(self.__startWebBrowser) | 1816 self.webBrowserAct.triggered[()].connect(self.__startWebBrowser) |
1741 | 1818 |
1742 self.iconEditorAct = E5Action(self.trUtf8('Icon Editor'), | 1819 self.iconEditorAct = E5Action(self.trUtf8('Icon Editor'), |
1743 UI.PixmapCache.getIcon("iconEditor.png"), | 1820 UI.PixmapCache.getIcon("iconEditor.png"), |
1744 self.trUtf8('&Icon Editor...'), | 1821 self.trUtf8('&Icon Editor...'), |
1745 0, 0, self, 'icon_editor') | 1822 0, 0, self, 'icon_editor') |
1746 self.iconEditorAct.setStatusTip(self.trUtf8('Start the eric5 Icon Editor')) | 1823 self.iconEditorAct.setStatusTip(self.trUtf8( |
1824 'Start the eric5 Icon Editor')) | |
1747 self.iconEditorAct.setWhatsThis(self.trUtf8( | 1825 self.iconEditorAct.setWhatsThis(self.trUtf8( |
1748 """<b>Icon Editor</b>""" | 1826 """<b>Icon Editor</b>""" |
1749 """<p>Starts the eric5 Icon Editor for editing simple icons.</p>""" | 1827 """<p>Starts the eric5 Icon Editor for editing simple icons.</p>""" |
1750 )) | 1828 )) |
1751 self.iconEditorAct.triggered[()].connect(self.__editPixmap) | 1829 self.iconEditorAct.triggered[()].connect(self.__editPixmap) |
1753 | 1831 |
1754 self.snapshotAct = E5Action(self.trUtf8('Snapshot'), | 1832 self.snapshotAct = E5Action(self.trUtf8('Snapshot'), |
1755 UI.PixmapCache.getIcon("ericSnap.png"), | 1833 UI.PixmapCache.getIcon("ericSnap.png"), |
1756 self.trUtf8('&Snapshot...'), | 1834 self.trUtf8('&Snapshot...'), |
1757 0, 0, self, 'snapshot') | 1835 0, 0, self, 'snapshot') |
1758 self.snapshotAct.setStatusTip(self.trUtf8('Take snapshots of a screen region')) | 1836 self.snapshotAct.setStatusTip(self.trUtf8( |
1837 'Take snapshots of a screen region')) | |
1759 self.snapshotAct.setWhatsThis(self.trUtf8( | 1838 self.snapshotAct.setWhatsThis(self.trUtf8( |
1760 """<b>Snapshot</b>""" | 1839 """<b>Snapshot</b>""" |
1761 """<p>This opens a dialog to take snapshots of a screen region.</p>""" | 1840 """<p>This opens a dialog to take snapshots of a screen""" |
1841 """ region.</p>""" | |
1762 )) | 1842 )) |
1763 self.snapshotAct.triggered[()].connect(self.__snapshot) | 1843 self.snapshotAct.triggered[()].connect(self.__snapshot) |
1764 self.actions.append(self.snapshotAct) | 1844 self.actions.append(self.snapshotAct) |
1765 | 1845 |
1766 self.prefAct = E5Action(self.trUtf8('Preferences'), | 1846 self.prefAct = E5Action(self.trUtf8('Preferences'), |
1767 UI.PixmapCache.getIcon("configure.png"), | 1847 UI.PixmapCache.getIcon("configure.png"), |
1768 self.trUtf8('&Preferences...'), 0, 0, self, 'preferences') | 1848 self.trUtf8('&Preferences...'), 0, 0, self, 'preferences') |
1769 self.prefAct.setStatusTip(self.trUtf8('Set the prefered configuration')) | 1849 self.prefAct.setStatusTip(self.trUtf8( |
1850 'Set the prefered configuration')) | |
1770 self.prefAct.setWhatsThis(self.trUtf8( | 1851 self.prefAct.setWhatsThis(self.trUtf8( |
1771 """<b>Preferences</b>""" | 1852 """<b>Preferences</b>""" |
1772 """<p>Set the configuration items of the application""" | 1853 """<p>Set the configuration items of the application""" |
1773 """ with your prefered values.</p>""" | 1854 """ with your prefered values.</p>""" |
1774 )) | 1855 )) |
1775 self.prefAct.triggered[()].connect(self.showPreferences) | 1856 self.prefAct.triggered[()].connect(self.showPreferences) |
1776 self.prefAct.setMenuRole(QAction.PreferencesRole) | 1857 self.prefAct.setMenuRole(QAction.PreferencesRole) |
1777 self.actions.append(self.prefAct) | 1858 self.actions.append(self.prefAct) |
1778 | 1859 |
1779 self.prefExportAct = E5Action(self.trUtf8('Export Preferences'), | 1860 self.prefExportAct = E5Action( |
1780 UI.PixmapCache.getIcon("configureExport.png"), | 1861 self.trUtf8('Export Preferences'), |
1781 self.trUtf8('E&xport Preferences...'), 0, 0, self, 'export_preferences') | 1862 UI.PixmapCache.getIcon("configureExport.png"), |
1782 self.prefExportAct.setStatusTip(self.trUtf8('Export the current configuration')) | 1863 self.trUtf8('E&xport Preferences...'), |
1864 0, 0, self, 'export_preferences') | |
1865 self.prefExportAct.setStatusTip(self.trUtf8( | |
1866 'Export the current configuration')) | |
1783 self.prefExportAct.setWhatsThis(self.trUtf8( | 1867 self.prefExportAct.setWhatsThis(self.trUtf8( |
1784 """<b>Export Preferences</b>""" | 1868 """<b>Export Preferences</b>""" |
1785 """<p>Export the current configuration to a file.</p>""" | 1869 """<p>Export the current configuration to a file.</p>""" |
1786 )) | 1870 )) |
1787 self.prefExportAct.triggered[()].connect(self.__exportPreferences) | 1871 self.prefExportAct.triggered[()].connect(self.__exportPreferences) |
1788 self.actions.append(self.prefExportAct) | 1872 self.actions.append(self.prefExportAct) |
1789 | 1873 |
1790 self.prefImportAct = E5Action(self.trUtf8('Import Preferences'), | 1874 self.prefImportAct = E5Action( |
1791 UI.PixmapCache.getIcon("configureImport.png"), | 1875 self.trUtf8('Import Preferences'), |
1792 self.trUtf8('I&mport Preferences...'), 0, 0, self, 'import_preferences') | 1876 UI.PixmapCache.getIcon("configureImport.png"), |
1877 self.trUtf8('I&mport Preferences...'), | |
1878 0, 0, self, 'import_preferences') | |
1793 self.prefImportAct.setStatusTip(self.trUtf8( | 1879 self.prefImportAct.setStatusTip(self.trUtf8( |
1794 'Import a previously exported configuration')) | 1880 'Import a previously exported configuration')) |
1795 self.prefImportAct.setWhatsThis(self.trUtf8( | 1881 self.prefImportAct.setWhatsThis(self.trUtf8( |
1796 """<b>Import Preferences</b>""" | 1882 """<b>Import Preferences</b>""" |
1797 """<p>Import a previously exported configuration.</p>""" | 1883 """<p>Import a previously exported configuration.</p>""" |
1799 self.prefImportAct.triggered[()].connect(self.__importPreferences) | 1885 self.prefImportAct.triggered[()].connect(self.__importPreferences) |
1800 self.actions.append(self.prefImportAct) | 1886 self.actions.append(self.prefImportAct) |
1801 | 1887 |
1802 self.reloadAPIsAct = E5Action(self.trUtf8('Reload APIs'), | 1888 self.reloadAPIsAct = E5Action(self.trUtf8('Reload APIs'), |
1803 self.trUtf8('Reload &APIs'), 0, 0, self, 'reload_apis') | 1889 self.trUtf8('Reload &APIs'), 0, 0, self, 'reload_apis') |
1804 self.reloadAPIsAct.setStatusTip(self.trUtf8('Reload the API information')) | 1890 self.reloadAPIsAct.setStatusTip(self.trUtf8( |
1891 'Reload the API information')) | |
1805 self.reloadAPIsAct.setWhatsThis(self.trUtf8( | 1892 self.reloadAPIsAct.setWhatsThis(self.trUtf8( |
1806 """<b>Reload APIs</b>""" | 1893 """<b>Reload APIs</b>""" |
1807 """<p>Reload the API information.</p>""" | 1894 """<p>Reload the API information.</p>""" |
1808 )) | 1895 )) |
1809 self.reloadAPIsAct.triggered[()].connect(self.__reloadAPIs) | 1896 self.reloadAPIsAct.triggered[()].connect(self.__reloadAPIs) |
1810 self.actions.append(self.reloadAPIsAct) | 1897 self.actions.append(self.reloadAPIsAct) |
1811 | 1898 |
1812 self.showExternalToolsAct = E5Action(self.trUtf8('Show external tools'), | 1899 self.showExternalToolsAct = E5Action( |
1813 UI.PixmapCache.getIcon("showPrograms.png"), | 1900 self.trUtf8('Show external tools'), |
1814 self.trUtf8('Show external &tools'), 0, 0, self, 'show_external_tools') | 1901 UI.PixmapCache.getIcon("showPrograms.png"), |
1815 self.showExternalToolsAct.setStatusTip(self.trUtf8('Show external tools')) | 1902 self.trUtf8('Show external &tools'), |
1903 0, 0, self, 'show_external_tools') | |
1904 self.showExternalToolsAct.setStatusTip(self.trUtf8( | |
1905 'Show external tools')) | |
1816 self.showExternalToolsAct.setWhatsThis(self.trUtf8( | 1906 self.showExternalToolsAct.setWhatsThis(self.trUtf8( |
1817 """<b>Show external tools</b>""" | 1907 """<b>Show external tools</b>""" |
1818 """<p>Opens a dialog to show the path and versions of all""" | 1908 """<p>Opens a dialog to show the path and versions of all""" |
1819 """ extenal tools used by eric5.</p>""" | 1909 """ extenal tools used by eric5.</p>""" |
1820 )) | 1910 )) |
1821 self.showExternalToolsAct.triggered[()].connect(self.__showExternalTools) | 1911 self.showExternalToolsAct.triggered[()].connect( |
1912 self.__showExternalTools) | |
1822 self.actions.append(self.showExternalToolsAct) | 1913 self.actions.append(self.showExternalToolsAct) |
1823 | 1914 |
1824 self.configViewProfilesAct = E5Action(self.trUtf8('View Profiles'), | 1915 self.configViewProfilesAct = E5Action(self.trUtf8('View Profiles'), |
1825 UI.PixmapCache.getIcon("configureViewProfiles.png"), | 1916 UI.PixmapCache.getIcon("configureViewProfiles.png"), |
1826 self.trUtf8('&View Profiles...'), 0, 0, self, 'view_profiles') | 1917 self.trUtf8('&View Profiles...'), 0, 0, self, 'view_profiles') |
1827 self.configViewProfilesAct.setStatusTip(self.trUtf8('Configure view profiles')) | 1918 self.configViewProfilesAct.setStatusTip(self.trUtf8( |
1919 'Configure view profiles')) | |
1828 self.configViewProfilesAct.setWhatsThis(self.trUtf8( | 1920 self.configViewProfilesAct.setWhatsThis(self.trUtf8( |
1829 """<b>View Profiles</b>""" | 1921 """<b>View Profiles</b>""" |
1830 """<p>Configure the view profiles. With this dialog you may""" | 1922 """<p>Configure the view profiles. With this dialog you may""" |
1831 """ set the visibility of the various windows for the predetermined""" | 1923 """ set the visibility of the various windows for the""" |
1832 """ view profiles.</p>""" | 1924 """ predetermined view profiles.</p>""" |
1833 )) | 1925 )) |
1834 self.configViewProfilesAct.triggered[()].connect(self.__configViewProfiles) | 1926 self.configViewProfilesAct.triggered[()].connect( |
1927 self.__configViewProfiles) | |
1835 self.actions.append(self.configViewProfilesAct) | 1928 self.actions.append(self.configViewProfilesAct) |
1836 | 1929 |
1837 self.configToolBarsAct = E5Action(self.trUtf8('Toolbars'), | 1930 self.configToolBarsAct = E5Action(self.trUtf8('Toolbars'), |
1838 UI.PixmapCache.getIcon("toolbarsConfigure.png"), | 1931 UI.PixmapCache.getIcon("toolbarsConfigure.png"), |
1839 self.trUtf8('Tool&bars...'), 0, 0, self, 'configure_toolbars') | 1932 self.trUtf8('Tool&bars...'), 0, 0, self, 'configure_toolbars') |
1845 """ define your own toolbars.</p>""" | 1938 """ define your own toolbars.</p>""" |
1846 )) | 1939 )) |
1847 self.configToolBarsAct.triggered[()].connect(self.__configToolBars) | 1940 self.configToolBarsAct.triggered[()].connect(self.__configToolBars) |
1848 self.actions.append(self.configToolBarsAct) | 1941 self.actions.append(self.configToolBarsAct) |
1849 | 1942 |
1850 self.shortcutsAct = E5Action(self.trUtf8('Keyboard Shortcuts'), | 1943 self.shortcutsAct = E5Action( |
1851 UI.PixmapCache.getIcon("configureShortcuts.png"), | 1944 self.trUtf8('Keyboard Shortcuts'), |
1852 self.trUtf8('Keyboard &Shortcuts...'), 0, 0, self, 'keyboard_shortcuts') | 1945 UI.PixmapCache.getIcon("configureShortcuts.png"), |
1853 self.shortcutsAct.setStatusTip(self.trUtf8('Set the keyboard shortcuts')) | 1946 self.trUtf8('Keyboard &Shortcuts...'), |
1947 0, 0, self, 'keyboard_shortcuts') | |
1948 self.shortcutsAct.setStatusTip(self.trUtf8( | |
1949 'Set the keyboard shortcuts')) | |
1854 self.shortcutsAct.setWhatsThis(self.trUtf8( | 1950 self.shortcutsAct.setWhatsThis(self.trUtf8( |
1855 """<b>Keyboard Shortcuts</b>""" | 1951 """<b>Keyboard Shortcuts</b>""" |
1856 """<p>Set the keyboard shortcuts of the application""" | 1952 """<p>Set the keyboard shortcuts of the application""" |
1857 """ with your prefered values.</p>""" | 1953 """ with your prefered values.</p>""" |
1858 )) | 1954 )) |
1859 self.shortcutsAct.triggered[()].connect(self.__configShortcuts) | 1955 self.shortcutsAct.triggered[()].connect(self.__configShortcuts) |
1860 self.actions.append(self.shortcutsAct) | 1956 self.actions.append(self.shortcutsAct) |
1861 | 1957 |
1862 self.exportShortcutsAct = E5Action(self.trUtf8('Export Keyboard Shortcuts'), | 1958 self.exportShortcutsAct = E5Action( |
1863 UI.PixmapCache.getIcon("exportShortcuts.png"), | 1959 self.trUtf8('Export Keyboard Shortcuts'), |
1864 self.trUtf8('&Export Keyboard Shortcuts...'), 0, 0, self, | 1960 UI.PixmapCache.getIcon("exportShortcuts.png"), |
1865 'export_keyboard_shortcuts') | 1961 self.trUtf8('&Export Keyboard Shortcuts...'), |
1866 self.exportShortcutsAct.setStatusTip(self.trUtf8('Export the keyboard shortcuts')) | 1962 0, 0, self, 'export_keyboard_shortcuts') |
1963 self.exportShortcutsAct.setStatusTip(self.trUtf8( | |
1964 'Export the keyboard shortcuts')) | |
1867 self.exportShortcutsAct.setWhatsThis(self.trUtf8( | 1965 self.exportShortcutsAct.setWhatsThis(self.trUtf8( |
1868 """<b>Export Keyboard Shortcuts</b>""" | 1966 """<b>Export Keyboard Shortcuts</b>""" |
1869 """<p>Export the keyboard shortcuts of the application.</p>""" | 1967 """<p>Export the keyboard shortcuts of the application.</p>""" |
1870 )) | 1968 )) |
1871 self.exportShortcutsAct.triggered[()].connect(self.__exportShortcuts) | 1969 self.exportShortcutsAct.triggered[()].connect(self.__exportShortcuts) |
1872 self.actions.append(self.exportShortcutsAct) | 1970 self.actions.append(self.exportShortcutsAct) |
1873 | 1971 |
1874 self.importShortcutsAct = E5Action(self.trUtf8('Import Keyboard Shortcuts'), | 1972 self.importShortcutsAct = E5Action( |
1875 UI.PixmapCache.getIcon("importShortcuts.png"), | 1973 self.trUtf8('Import Keyboard Shortcuts'), |
1876 self.trUtf8('&Import Keyboard Shortcuts...'), 0, 0, self, | 1974 UI.PixmapCache.getIcon("importShortcuts.png"), |
1877 'import_keyboard_shortcuts') | 1975 self.trUtf8('&Import Keyboard Shortcuts...'), |
1878 self.importShortcutsAct.setStatusTip(self.trUtf8('Import the keyboard shortcuts')) | 1976 0, 0, self, 'import_keyboard_shortcuts') |
1977 self.importShortcutsAct.setStatusTip(self.trUtf8( | |
1978 'Import the keyboard shortcuts')) | |
1879 self.importShortcutsAct.setWhatsThis(self.trUtf8( | 1979 self.importShortcutsAct.setWhatsThis(self.trUtf8( |
1880 """<b>Import Keyboard Shortcuts</b>""" | 1980 """<b>Import Keyboard Shortcuts</b>""" |
1881 """<p>Import the keyboard shortcuts of the application.</p>""" | 1981 """<p>Import the keyboard shortcuts of the application.</p>""" |
1882 )) | 1982 )) |
1883 self.importShortcutsAct.triggered[()].connect(self.__importShortcuts) | 1983 self.importShortcutsAct.triggered[()].connect(self.__importShortcuts) |
1884 self.actions.append(self.importShortcutsAct) | 1984 self.actions.append(self.importShortcutsAct) |
1885 | 1985 |
1886 if SSL_AVAILABLE: | 1986 if SSL_AVAILABLE: |
1887 self.certificatesAct = E5Action(self.trUtf8('Manage SSL Certificates'), | 1987 self.certificatesAct = E5Action( |
1888 UI.PixmapCache.getIcon("certificates.png"), | 1988 self.trUtf8('Manage SSL Certificates'), |
1889 self.trUtf8('Manage SSL Certificates...'), | 1989 UI.PixmapCache.getIcon("certificates.png"), |
1890 0, 0, | 1990 self.trUtf8('Manage SSL Certificates...'), |
1891 self, 'manage_ssl_certificates') | 1991 0, 0, self, 'manage_ssl_certificates') |
1892 self.certificatesAct.setStatusTip(self.trUtf8( | 1992 self.certificatesAct.setStatusTip(self.trUtf8( |
1893 'Manage the saved SSL certificates')) | 1993 'Manage the saved SSL certificates')) |
1894 self.certificatesAct.setWhatsThis(self.trUtf8( | 1994 self.certificatesAct.setWhatsThis(self.trUtf8( |
1895 """<b>Manage SSL Certificates...</b>""" | 1995 """<b>Manage SSL Certificates...</b>""" |
1896 """<p>Opens a dialog to manage the saved SSL certificates.</p>""" | 1996 """<p>Opens a dialog to manage the saved SSL certificates.""" |
1997 """</p>""" | |
1897 )) | 1998 )) |
1898 self.certificatesAct.triggered[()].connect(self.__showCertificatesDialog) | 1999 self.certificatesAct.triggered[()].connect( |
2000 self.__showCertificatesDialog) | |
1899 self.actions.append(self.certificatesAct) | 2001 self.actions.append(self.certificatesAct) |
1900 | 2002 |
1901 self.editMessageFilterAct = E5Action(self.trUtf8('Edit Message Filters'), | 2003 self.editMessageFilterAct = E5Action( |
1902 UI.PixmapCache.getIcon("warning.png"), | 2004 self.trUtf8('Edit Message Filters'), |
1903 self.trUtf8('Edit Message Filters...'), 0, 0, self, | 2005 UI.PixmapCache.getIcon("warning.png"), |
1904 'manage_message_filters') | 2006 self.trUtf8('Edit Message Filters...'), |
2007 0, 0, self, 'manage_message_filters') | |
1905 self.editMessageFilterAct.setStatusTip(self.trUtf8( | 2008 self.editMessageFilterAct.setStatusTip(self.trUtf8( |
1906 'Edit the message filters used to suppress unwanted messages')) | 2009 'Edit the message filters used to suppress unwanted messages')) |
1907 self.editMessageFilterAct.setWhatsThis(self.trUtf8( | 2010 self.editMessageFilterAct.setWhatsThis(self.trUtf8( |
1908 """<b>Edit Message Filters</b>""" | 2011 """<b>Edit Message Filters</b>""" |
1909 """<p>Opens a dialog to edit the message filters used to suppress""" | 2012 """<p>Opens a dialog to edit the message filters used to""" |
1910 """ unwanted messages been shown in an error window.</p>""" | 2013 """ suppress unwanted messages been shown in an error""" |
1911 )) | 2014 """ window.</p>""" |
1912 self.editMessageFilterAct.triggered[()].connect(E5ErrorMessage.editMessageFilters) | 2015 )) |
2016 self.editMessageFilterAct.triggered[()].connect( | |
2017 E5ErrorMessage.editMessageFilters) | |
1913 self.actions.append(self.editMessageFilterAct) | 2018 self.actions.append(self.editMessageFilterAct) |
1914 | 2019 |
1915 self.viewmanagerActivateAct = E5Action(self.trUtf8('Activate current editor'), | 2020 self.viewmanagerActivateAct = E5Action( |
1916 self.trUtf8('Activate current editor'), | 2021 self.trUtf8('Activate current editor'), |
1917 QKeySequence(self.trUtf8("Alt+Shift+E")), | 2022 self.trUtf8('Activate current editor'), |
1918 0, self, | 2023 QKeySequence(self.trUtf8("Alt+Shift+E")), |
1919 'viewmanager_activate', 1) | 2024 0, self, 'viewmanager_activate', 1) |
1920 self.viewmanagerActivateAct.triggered[()].connect(self.__activateViewmanager) | 2025 self.viewmanagerActivateAct.triggered[()].connect( |
2026 self.__activateViewmanager) | |
1921 self.actions.append(self.viewmanagerActivateAct) | 2027 self.actions.append(self.viewmanagerActivateAct) |
1922 self.addAction(self.viewmanagerActivateAct) | 2028 self.addAction(self.viewmanagerActivateAct) |
1923 | 2029 |
1924 self.nextTabAct = E5Action(self.trUtf8('Show next'), | 2030 self.nextTabAct = E5Action(self.trUtf8('Show next'), |
1925 self.trUtf8('Show next'), | 2031 self.trUtf8('Show next'), |
1955 """ loaded plugins.</p>""" | 2061 """ loaded plugins.</p>""" |
1956 )) | 2062 )) |
1957 self.pluginInfoAct.triggered[()].connect(self.__showPluginInfo) | 2063 self.pluginInfoAct.triggered[()].connect(self.__showPluginInfo) |
1958 self.actions.append(self.pluginInfoAct) | 2064 self.actions.append(self.pluginInfoAct) |
1959 | 2065 |
1960 self.pluginInstallAct = E5Action(self.trUtf8('Install Plugins'), | 2066 self.pluginInstallAct = E5Action( |
1961 UI.PixmapCache.getIcon("pluginInstall.png"), | 2067 self.trUtf8('Install Plugins'), |
1962 self.trUtf8('&Install Plugins...'), 0, 0, self, 'plugin_install') | 2068 UI.PixmapCache.getIcon("pluginInstall.png"), |
2069 self.trUtf8('&Install Plugins...'), | |
2070 0, 0, self, 'plugin_install') | |
1963 self.pluginInstallAct.setStatusTip(self.trUtf8('Install Plugins')) | 2071 self.pluginInstallAct.setStatusTip(self.trUtf8('Install Plugins')) |
1964 self.pluginInstallAct.setWhatsThis(self.trUtf8( | 2072 self.pluginInstallAct.setWhatsThis(self.trUtf8( |
1965 """<b>Install Plugins...</b>""" | 2073 """<b>Install Plugins...</b>""" |
1966 """<p>This opens a dialog to install or update plugins.</p>""" | 2074 """<p>This opens a dialog to install or update plugins.</p>""" |
1967 )) | 2075 )) |
1968 self.pluginInstallAct.triggered[()].connect(self.__installPlugins) | 2076 self.pluginInstallAct.triggered[()].connect(self.__installPlugins) |
1969 self.actions.append(self.pluginInstallAct) | 2077 self.actions.append(self.pluginInstallAct) |
1970 | 2078 |
1971 self.pluginDeinstallAct = E5Action(self.trUtf8('Uninstall Plugin'), | 2079 self.pluginDeinstallAct = E5Action( |
1972 UI.PixmapCache.getIcon("pluginUninstall.png"), | 2080 self.trUtf8('Uninstall Plugin'), |
1973 self.trUtf8('&Uninstall Plugin...'), 0, 0, self, 'plugin_deinstall') | 2081 UI.PixmapCache.getIcon("pluginUninstall.png"), |
2082 self.trUtf8('&Uninstall Plugin...'), | |
2083 0, 0, self, 'plugin_deinstall') | |
1974 self.pluginDeinstallAct.setStatusTip(self.trUtf8('Uninstall Plugin')) | 2084 self.pluginDeinstallAct.setStatusTip(self.trUtf8('Uninstall Plugin')) |
1975 self.pluginDeinstallAct.setWhatsThis(self.trUtf8( | 2085 self.pluginDeinstallAct.setWhatsThis(self.trUtf8( |
1976 """<b>Uninstall Plugin...</b>""" | 2086 """<b>Uninstall Plugin...</b>""" |
1977 """<p>This opens a dialog to uninstall a plugin.</p>""" | 2087 """<p>This opens a dialog to uninstall a plugin.</p>""" |
1978 )) | 2088 )) |
1979 self.pluginDeinstallAct.triggered[()].connect(self.__deinstallPlugin) | 2089 self.pluginDeinstallAct.triggered[()].connect(self.__deinstallPlugin) |
1980 self.actions.append(self.pluginDeinstallAct) | 2090 self.actions.append(self.pluginDeinstallAct) |
1981 | 2091 |
1982 self.pluginRepoAct = E5Action(self.trUtf8('Plugin Repository'), | 2092 self.pluginRepoAct = E5Action( |
1983 UI.PixmapCache.getIcon("pluginRepository.png"), | 2093 self.trUtf8('Plugin Repository'), |
1984 self.trUtf8('Plugin &Repository...'), 0, 0, self, 'plugin_repository') | 2094 UI.PixmapCache.getIcon("pluginRepository.png"), |
2095 self.trUtf8('Plugin &Repository...'), | |
2096 0, 0, self, 'plugin_repository') | |
1985 self.pluginRepoAct.setStatusTip(self.trUtf8( | 2097 self.pluginRepoAct.setStatusTip(self.trUtf8( |
1986 'Show Plugins available for download')) | 2098 'Show Plugins available for download')) |
1987 self.pluginRepoAct.setWhatsThis(self.trUtf8( | 2099 self.pluginRepoAct.setWhatsThis(self.trUtf8( |
1988 """<b>Plugin Repository...</b>""" | 2100 """<b>Plugin Repository...</b>""" |
1989 """<p>This opens a dialog, that shows a list of plugins """ | 2101 """<p>This opens a dialog, that shows a list of plugins """ |
2006 | 2118 |
2007 def __initQtDocActions(self): | 2119 def __initQtDocActions(self): |
2008 """ | 2120 """ |
2009 Private slot to initialize the action to show the Qt documentation. | 2121 Private slot to initialize the action to show the Qt documentation. |
2010 """ | 2122 """ |
2011 self.qt4DocAct = E5Action(self.trUtf8('Qt4 Documentation'), | 2123 self.qt4DocAct = E5Action( |
2012 self.trUtf8('Qt&4 Documentation'), 0, 0, self, 'qt4_documentation') | 2124 self.trUtf8('Qt4 Documentation'), |
2125 self.trUtf8('Qt&4 Documentation'), | |
2126 0, 0, self, 'qt4_documentation') | |
2013 self.qt4DocAct.setStatusTip(self.trUtf8('Open Qt4 Documentation')) | 2127 self.qt4DocAct.setStatusTip(self.trUtf8('Open Qt4 Documentation')) |
2014 self.qt4DocAct.setWhatsThis(self.trUtf8( | 2128 self.qt4DocAct.setWhatsThis(self.trUtf8( |
2015 """<b>Qt4 Documentation</b>""" | 2129 """<b>Qt4 Documentation</b>""" |
2016 """<p>Display the Qt4 Documentation. Dependant upon your settings, this""" | 2130 """<p>Display the Qt4 Documentation. Dependent upon your""" |
2017 """ will either show the help in Eric's internal help viewer, or execute""" | 2131 """ settings, this will either show the help in Eric's internal""" |
2018 """ a web browser or Qt Assistant. </p>""" | 2132 """ help viewer, or execute a web browser or Qt Assistant. </p>""" |
2019 )) | 2133 )) |
2020 self.qt4DocAct.triggered[()].connect(self.__showQt4Doc) | 2134 self.qt4DocAct.triggered[()].connect(self.__showQt4Doc) |
2021 self.actions.append(self.qt4DocAct) | 2135 self.actions.append(self.qt4DocAct) |
2022 | 2136 |
2023 self.qt5DocAct = E5Action(self.trUtf8('Qt5 Documentation'), | 2137 self.qt5DocAct = E5Action( |
2024 self.trUtf8('Qt&5 Documentation'), 0, 0, self, 'qt5_documentation') | 2138 self.trUtf8('Qt5 Documentation'), |
2139 self.trUtf8('Qt&5 Documentation'), | |
2140 0, 0, self, 'qt5_documentation') | |
2025 self.qt5DocAct.setStatusTip(self.trUtf8('Open Qt5 Documentation')) | 2141 self.qt5DocAct.setStatusTip(self.trUtf8('Open Qt5 Documentation')) |
2026 self.qt5DocAct.setWhatsThis(self.trUtf8( | 2142 self.qt5DocAct.setWhatsThis(self.trUtf8( |
2027 """<b>Qt5 Documentation</b>""" | 2143 """<b>Qt5 Documentation</b>""" |
2028 """<p>Display the Qt5 Documentation. Dependant upon your settings, this""" | 2144 """<p>Display the Qt5 Documentation. Dependent upon your""" |
2029 """ will either show the help in Eric's internal help viewer, or execute""" | 2145 """ settings, this will either show the help in Eric's internal""" |
2030 """ a web browser or Qt Assistant. </p>""" | 2146 """ help viewer, or execute a web browser or Qt Assistant. </p>""" |
2031 )) | 2147 )) |
2032 self.qt5DocAct.triggered[()].connect(self.__showQt5Doc) | 2148 self.qt5DocAct.triggered[()].connect(self.__showQt5Doc) |
2033 self.actions.append(self.qt5DocAct) | 2149 self.actions.append(self.qt5DocAct) |
2034 | 2150 |
2035 self.pyqt4DocAct = E5Action(self.trUtf8('PyQt4 Documentation'), | 2151 self.pyqt4DocAct = E5Action( |
2036 self.trUtf8('PyQt&4 Documentation'), 0, 0, self, 'pyqt4_documentation') | 2152 self.trUtf8('PyQt4 Documentation'), |
2153 self.trUtf8('PyQt&4 Documentation'), | |
2154 0, 0, self, 'pyqt4_documentation') | |
2037 self.pyqt4DocAct.setStatusTip(self.trUtf8('Open PyQt4 Documentation')) | 2155 self.pyqt4DocAct.setStatusTip(self.trUtf8('Open PyQt4 Documentation')) |
2038 self.pyqt4DocAct.setWhatsThis(self.trUtf8( | 2156 self.pyqt4DocAct.setWhatsThis(self.trUtf8( |
2039 """<b>PyQt4 Documentation</b>""" | 2157 """<b>PyQt4 Documentation</b>""" |
2040 """<p>Display the PyQt4 Documentation. Dependant upon your settings, this""" | 2158 """<p>Display the PyQt4 Documentation. Dependent upon your""" |
2041 """ will either show the help in Eric's internal help viewer, or execute""" | 2159 """ settings, this will either show the help in Eric's internal""" |
2042 """ a web browser or Qt Assistant. </p>""" | 2160 """ help viewer, or execute a web browser or Qt Assistant. </p>""" |
2043 )) | 2161 )) |
2044 self.pyqt4DocAct.triggered[()].connect(self.__showPyQt4Doc) | 2162 self.pyqt4DocAct.triggered[()].connect(self.__showPyQt4Doc) |
2045 self.actions.append(self.pyqt4DocAct) | 2163 self.actions.append(self.pyqt4DocAct) |
2046 | 2164 |
2047 try: | 2165 try: |
2048 import PyQt5 # __IGNORE_WARNING__ | 2166 import PyQt5 # __IGNORE_WARNING__ |
2049 self.pyqt5DocAct = E5Action(self.trUtf8('PyQt5 Documentation'), | 2167 self.pyqt5DocAct = E5Action( |
2050 self.trUtf8('PyQt&5 Documentation'), 0, 0, self, 'pyqt5_documentation') | 2168 self.trUtf8('PyQt5 Documentation'), |
2051 self.pyqt5DocAct.setStatusTip(self.trUtf8('Open PyQt5 Documentation')) | 2169 self.trUtf8('PyQt&5 Documentation'), |
2170 0, 0, self, 'pyqt5_documentation') | |
2171 self.pyqt5DocAct.setStatusTip(self.trUtf8( | |
2172 'Open PyQt5 Documentation')) | |
2052 self.pyqt5DocAct.setWhatsThis(self.trUtf8( | 2173 self.pyqt5DocAct.setWhatsThis(self.trUtf8( |
2053 """<b>PyQt5 Documentation</b>""" | 2174 """<b>PyQt5 Documentation</b>""" |
2054 """<p>Display the PyQt5 Documentation. Dependant upon your settings,""" | 2175 """<p>Display the PyQt5 Documentation. Dependent upon your""" |
2055 """ this will either show the help in Eric's internal help viewer,""" | 2176 """ settings, this will either show the help in Eric's""" |
2056 """ or execute a web browser or Qt Assistant. </p>""" | 2177 """ internal help viewer, or execute a web browser or""" |
2178 """ Qt Assistant. </p>""" | |
2057 )) | 2179 )) |
2058 self.pyqt5DocAct.triggered[()].connect(self.__showPyQt5Doc) | 2180 self.pyqt5DocAct.triggered[()].connect(self.__showPyQt5Doc) |
2059 self.actions.append(self.pyqt5DocAct) | 2181 self.actions.append(self.pyqt5DocAct) |
2060 except ImportError: | 2182 except ImportError: |
2061 self.pyqt5DocAct = None | 2183 self.pyqt5DocAct = None |
2062 | 2184 |
2063 def __initPythonDocActions(self): | 2185 def __initPythonDocActions(self): |
2064 """ | 2186 """ |
2065 Private slot to initialize the actions to show the Python documentation. | 2187 Private slot to initialize the actions to show the Python |
2066 """ | 2188 documentation. |
2067 self.pythonDocAct = E5Action(self.trUtf8('Python 3 Documentation'), | 2189 """ |
2068 self.trUtf8('Python &3 Documentation'), 0, 0, self, 'python3_documentation') | 2190 self.pythonDocAct = E5Action( |
2069 self.pythonDocAct.setStatusTip(self.trUtf8('Open Python 3 Documentation')) | 2191 self.trUtf8('Python 3 Documentation'), |
2192 self.trUtf8('Python &3 Documentation'), | |
2193 0, 0, self, 'python3_documentation') | |
2194 self.pythonDocAct.setStatusTip(self.trUtf8( | |
2195 'Open Python 3 Documentation')) | |
2070 self.pythonDocAct.setWhatsThis(self.trUtf8( | 2196 self.pythonDocAct.setWhatsThis(self.trUtf8( |
2071 """<b>Python 3 Documentation</b>""" | 2197 """<b>Python 3 Documentation</b>""" |
2072 """<p>Display the Python 3 documentation.""" | 2198 """<p>Display the Python 3 documentation. If no documentation""" |
2073 """ If no documentation directory is configured,""" | 2199 """ directory is configured, the location of the Python 3""" |
2074 """ the location of the Python 3 documentation is assumed to be the doc""" | 2200 """ documentation is assumed to be the doc directory underneath""" |
2075 """ directory underneath the location of the Python 3 executable on""" | 2201 """ the location of the Python 3 executable on Windows and""" |
2076 """ Windows and <i>/usr/share/doc/packages/python/html</i> on Unix.""" | 2202 """ <i>/usr/share/doc/packages/python/html</i> on Unix. Set""" |
2077 """ Set PYTHON3DOCDIR in your environment to override this. </p>""" | 2203 """ PYTHON3DOCDIR in your environment to override this.</p>""" |
2078 )) | 2204 )) |
2079 self.pythonDocAct.triggered[()].connect(self.__showPythonDoc) | 2205 self.pythonDocAct.triggered[()].connect(self.__showPythonDoc) |
2080 self.actions.append(self.pythonDocAct) | 2206 self.actions.append(self.pythonDocAct) |
2081 | 2207 |
2082 self.python2DocAct = E5Action(self.trUtf8('Python 2 Documentation'), | 2208 self.python2DocAct = E5Action( |
2083 self.trUtf8('Python &2 Documentation'), 0, 0, self, 'python2_documentation') | 2209 self.trUtf8('Python 2 Documentation'), |
2084 self.python2DocAct.setStatusTip(self.trUtf8('Open Python 2 Documentation')) | 2210 self.trUtf8('Python &2 Documentation'), |
2211 0, 0, self, 'python2_documentation') | |
2212 self.python2DocAct.setStatusTip(self.trUtf8( | |
2213 'Open Python 2 Documentation')) | |
2085 self.python2DocAct.setWhatsThis(self.trUtf8( | 2214 self.python2DocAct.setWhatsThis(self.trUtf8( |
2086 """<b>Python 2 Documentation</b>""" | 2215 """<b>Python 2 Documentation</b>""" |
2087 """<p>Display the Python 2 documentation.""" | 2216 """<p>Display the Python 2 documentation. If no documentation""" |
2088 """ If no documentation directory is configured,""" | 2217 """ directory is configured, the location of the Python 2""" |
2089 """ the location of the Python 2 documentation is assumed to be the doc""" | 2218 """ documentation is assumed to be the doc directory underneath""" |
2090 """ directory underneath the location of the configured Python 2""" | 2219 """ the location of the configured Python 2 executable on""" |
2091 """ executable on Windows and""" | 2220 """ Windows and""" |
2092 """ <i>/usr/share/doc/packages/python/html/python-docs-html</i>""" | 2221 """ <i>/usr/share/doc/packages/python/html/python-docs-html</i>""" |
2093 """ on Unix. Set PYTHON2DOCDIR in your environment to override""" | 2222 """ on Unix. Set PYTHON2DOCDIR in your environment to override""" |
2094 """ this. </p>""" | 2223 """ this. </p>""" |
2095 )) | 2224 )) |
2096 self.python2DocAct.triggered[()].connect(self.__showPython2Doc) | 2225 self.python2DocAct.triggered[()].connect(self.__showPython2Doc) |
2097 self.actions.append(self.python2DocAct) | 2226 self.actions.append(self.python2DocAct) |
2098 | 2227 |
2099 def __initEricDocAction(self): | 2228 def __initEricDocAction(self): |
2100 """ | 2229 """ |
2101 Private slot to initialize the action to show the eric5 documentation. | 2230 Private slot to initialize the action to show the eric5 documentation. |
2102 """ | 2231 """ |
2103 self.ericDocAct = E5Action(self.trUtf8("Eric API Documentation"), | 2232 self.ericDocAct = E5Action( |
2104 self.trUtf8('&Eric API Documentation'), 0, 0, self, 'eric_documentation') | 2233 self.trUtf8("Eric API Documentation"), |
2105 self.ericDocAct.setStatusTip(self.trUtf8("Open Eric API Documentation")) | 2234 self.trUtf8('&Eric API Documentation'), |
2235 0, 0, self, 'eric_documentation') | |
2236 self.ericDocAct.setStatusTip(self.trUtf8( | |
2237 "Open Eric API Documentation")) | |
2106 self.ericDocAct.setWhatsThis(self.trUtf8( | 2238 self.ericDocAct.setWhatsThis(self.trUtf8( |
2107 """<b>Eric API Documentation</b>""" | 2239 """<b>Eric API Documentation</b>""" |
2108 """<p>Display the Eric API documentation.""" | 2240 """<p>Display the Eric API documentation. The location for the""" |
2109 """ The location for the documentation is the Documentation/Source""" | 2241 """ documentation is the Documentation/Source subdirectory of""" |
2110 """ subdirectory of the eric5 installation directory.</p>""" | 2242 """ the eric5 installation directory.</p>""" |
2111 )) | 2243 )) |
2112 self.ericDocAct.triggered[()].connect(self.__showEricDoc) | 2244 self.ericDocAct.triggered[()].connect(self.__showEricDoc) |
2113 self.actions.append(self.ericDocAct) | 2245 self.actions.append(self.ericDocAct) |
2114 | 2246 |
2115 def __initPySideDocAction(self): | 2247 def __initPySideDocAction(self): |
2116 """ | 2248 """ |
2117 Private slot to initialize the action to show the PySide documentation. | 2249 Private slot to initialize the action to show the PySide documentation. |
2118 """ | 2250 """ |
2119 pyside2, pyside3 = Utilities.checkPyside() | 2251 pyside2, pyside3 = Utilities.checkPyside() |
2120 if pyside2 or pyside3: | 2252 if pyside2 or pyside3: |
2121 self.pysideDocAct = E5Action(self.trUtf8('PySide Documentation'), | 2253 self.pysideDocAct = E5Action( |
2122 self.trUtf8('Py&Side Documentation'), 0, 0, self, 'pyside_documentation') | 2254 self.trUtf8('PySide Documentation'), |
2123 self.pysideDocAct.setStatusTip(self.trUtf8('Open PySide Documentation')) | 2255 self.trUtf8('Py&Side Documentation'), |
2256 0, 0, self, 'pyside_documentation') | |
2257 self.pysideDocAct.setStatusTip(self.trUtf8( | |
2258 'Open PySide Documentation')) | |
2124 self.pysideDocAct.setWhatsThis(self.trUtf8( | 2259 self.pysideDocAct.setWhatsThis(self.trUtf8( |
2125 """<b>PySide Documentation</b>""" | 2260 """<b>PySide Documentation</b>""" |
2126 """<p>Display the PySide Documentation. Dependant upon your settings, """ | 2261 """<p>Display the PySide Documentation. Dependent upon your""" |
2127 """this will either show the help in Eric's internal help viewer, or """ | 2262 """ settings, this will either show the help in Eric's""" |
2128 """execute a web browser or Qt Assistant. </p>""" | 2263 """ internal help viewer, or execute a web browser or""" |
2264 """ Qt Assistant. </p>""" | |
2129 )) | 2265 )) |
2130 self.pysideDocAct.triggered[()].connect(self.__showPySideDoc) | 2266 self.pysideDocAct.triggered[()].connect(self.__showPySideDoc) |
2131 self.actions.append(self.pysideDocAct) | 2267 self.actions.append(self.pysideDocAct) |
2132 else: | 2268 else: |
2133 self.pysideDocAct = None | 2269 self.pysideDocAct = None |
2152 mb.addMenu(self.__menus["edit"]) | 2288 mb.addMenu(self.__menus["edit"]) |
2153 | 2289 |
2154 self.__menus["view"] = self.viewmanager.initViewMenu() | 2290 self.__menus["view"] = self.viewmanager.initViewMenu() |
2155 mb.addMenu(self.__menus["view"]) | 2291 mb.addMenu(self.__menus["view"]) |
2156 | 2292 |
2157 self.__menus["start"], self.__menus["debug"] = self.debuggerUI.initMenus() | 2293 self.__menus["start"], self.__menus["debug"] = \ |
2294 self.debuggerUI.initMenus() | |
2158 mb.addMenu(self.__menus["start"]) | 2295 mb.addMenu(self.__menus["start"]) |
2159 mb.addMenu(self.__menus["debug"]) | 2296 mb.addMenu(self.__menus["debug"]) |
2160 | 2297 |
2161 self.__menus["unittest"] = QMenu(self.trUtf8('&Unittest'), self) | 2298 self.__menus["unittest"] = QMenu(self.trUtf8('&Unittest'), self) |
2162 self.__menus["unittest"].setTearOffEnabled(True) | 2299 self.__menus["unittest"].setTearOffEnabled(True) |
2181 mb.addMenu(self.__menus["extras"]) | 2318 mb.addMenu(self.__menus["extras"]) |
2182 self.viewmanager.addToExtrasMenu(self.__menus["extras"]) | 2319 self.viewmanager.addToExtrasMenu(self.__menus["extras"]) |
2183 self.__menus["wizards"] = QMenu(self.trUtf8('Wi&zards'), self) | 2320 self.__menus["wizards"] = QMenu(self.trUtf8('Wi&zards'), self) |
2184 self.__menus["wizards"].setTearOffEnabled(True) | 2321 self.__menus["wizards"].setTearOffEnabled(True) |
2185 self.__menus["wizards"].aboutToShow.connect(self.__showWizardsMenu) | 2322 self.__menus["wizards"].aboutToShow.connect(self.__showWizardsMenu) |
2186 self.wizardsMenuAct = self.__menus["extras"].addMenu(self.__menus["wizards"]) | 2323 self.wizardsMenuAct = self.__menus["extras"].addMenu( |
2324 self.__menus["wizards"]) | |
2187 self.wizardsMenuAct.setEnabled(False) | 2325 self.wizardsMenuAct.setEnabled(False) |
2188 self.__menus["macros"] = self.viewmanager.initMacroMenu() | 2326 self.__menus["macros"] = self.viewmanager.initMacroMenu() |
2189 self.__menus["extras"].addMenu(self.__menus["macros"]) | 2327 self.__menus["extras"].addMenu(self.__menus["macros"]) |
2190 self.__menus["tools"] = QMenu(self.trUtf8('&Tools'), self) | 2328 self.__menus["tools"] = QMenu(self.trUtf8('&Tools'), self) |
2191 self.__menus["tools"].aboutToShow.connect(self.__showToolsMenu) | 2329 self.__menus["tools"].aboutToShow.connect(self.__showToolsMenu) |
2222 self.__menus["window"] = QMenu(self.trUtf8('&Window'), self) | 2360 self.__menus["window"] = QMenu(self.trUtf8('&Window'), self) |
2223 mb.addMenu(self.__menus["window"]) | 2361 mb.addMenu(self.__menus["window"]) |
2224 self.__menus["window"].setTearOffEnabled(True) | 2362 self.__menus["window"].setTearOffEnabled(True) |
2225 self.__menus["window"].aboutToShow.connect(self.__showWindowMenu) | 2363 self.__menus["window"].aboutToShow.connect(self.__showWindowMenu) |
2226 | 2364 |
2227 self.__menus["subwindow"] = QMenu(self.trUtf8("&Windows"), self.__menus["window"]) | 2365 self.__menus["subwindow"] = QMenu(self.trUtf8("&Windows"), |
2366 self.__menus["window"]) | |
2228 self.__menus["subwindow"].setTearOffEnabled(True) | 2367 self.__menus["subwindow"].setTearOffEnabled(True) |
2229 # left side | 2368 # left side |
2230 self.__menus["subwindow"].addAction(self.pbActivateAct) | 2369 self.__menus["subwindow"].addAction(self.pbActivateAct) |
2231 self.__menus["subwindow"].addAction(self.mpbActivateAct) | 2370 self.__menus["subwindow"].addAction(self.mpbActivateAct) |
2232 self.__menus["subwindow"].addAction(self.templateViewerActivateAct) | 2371 self.__menus["subwindow"].addAction(self.templateViewerActivateAct) |
2307 """ | 2446 """ |
2308 Private slot to create the toolbars. | 2447 Private slot to create the toolbars. |
2309 """ | 2448 """ |
2310 filetb = self.viewmanager.initFileToolbar(self.toolbarManager) | 2449 filetb = self.viewmanager.initFileToolbar(self.toolbarManager) |
2311 edittb = self.viewmanager.initEditToolbar(self.toolbarManager) | 2450 edittb = self.viewmanager.initEditToolbar(self.toolbarManager) |
2312 searchtb, quicksearchtb = self.viewmanager.initSearchToolbars(self.toolbarManager) | 2451 searchtb, quicksearchtb = self.viewmanager.initSearchToolbars( |
2452 self.toolbarManager) | |
2313 viewtb = self.viewmanager.initViewToolbar(self.toolbarManager) | 2453 viewtb = self.viewmanager.initViewToolbar(self.toolbarManager) |
2314 starttb, debugtb = self.debuggerUI.initToolbars(self.toolbarManager) | 2454 starttb, debugtb = self.debuggerUI.initToolbars(self.toolbarManager) |
2315 multiprojecttb = self.multiProject.initToolbar(self.toolbarManager) | 2455 multiprojecttb = self.multiProject.initToolbar(self.toolbarManager) |
2316 projecttb = self.project.initToolbar(self.toolbarManager) | 2456 projecttb = self.project.initToolbar(self.toolbarManager) |
2317 toolstb = QToolBar(self.trUtf8("Tools"), self) | 2457 toolstb = QToolBar(self.trUtf8("Tools"), self) |
2386 settingstb.addAction(self.configViewProfilesAct) | 2526 settingstb.addAction(self.configViewProfilesAct) |
2387 settingstb.addAction(self.configToolBarsAct) | 2527 settingstb.addAction(self.configToolBarsAct) |
2388 settingstb.addAction(self.shortcutsAct) | 2528 settingstb.addAction(self.shortcutsAct) |
2389 settingstb.addAction(self.showExternalToolsAct) | 2529 settingstb.addAction(self.showExternalToolsAct) |
2390 self.toolbarManager.addToolBar(settingstb, settingstb.windowTitle()) | 2530 self.toolbarManager.addToolBar(settingstb, settingstb.windowTitle()) |
2391 self.toolbarManager.addAction(self.exportShortcutsAct, settingstb.windowTitle()) | 2531 self.toolbarManager.addAction( |
2392 self.toolbarManager.addAction(self.importShortcutsAct, settingstb.windowTitle()) | 2532 self.exportShortcutsAct, settingstb.windowTitle()) |
2533 self.toolbarManager.addAction( | |
2534 self.importShortcutsAct, settingstb.windowTitle()) | |
2393 | 2535 |
2394 # setup the help toolbar | 2536 # setup the help toolbar |
2395 helptb.addAction(self.whatsThisAct) | 2537 helptb.addAction(self.whatsThisAct) |
2396 self.toolbarManager.addToolBar(helptb, helptb.windowTitle()) | 2538 self.toolbarManager.addToolBar(helptb, helptb.windowTitle()) |
2397 self.toolbarManager.addAction(self.helpviewerAct, helptb.windowTitle()) | 2539 self.toolbarManager.addAction(self.helpviewerAct, helptb.windowTitle()) |
2450 self.__toolbars["tools"] = [toolstb.windowTitle(), toolstb] | 2592 self.__toolbars["tools"] = [toolstb.windowTitle(), toolstb] |
2451 self.__toolbars["help"] = [helptb.windowTitle(), helptb] | 2593 self.__toolbars["help"] = [helptb.windowTitle(), helptb] |
2452 self.__toolbars["settings"] = [settingstb.windowTitle(), settingstb] | 2594 self.__toolbars["settings"] = [settingstb.windowTitle(), settingstb] |
2453 self.__toolbars["bookmarks"] = [bookmarktb.windowTitle(), bookmarktb] | 2595 self.__toolbars["bookmarks"] = [bookmarktb.windowTitle(), bookmarktb] |
2454 self.__toolbars["unittest"] = [unittesttb.windowTitle(), unittesttb] | 2596 self.__toolbars["unittest"] = [unittesttb.windowTitle(), unittesttb] |
2455 self.__toolbars["view_profiles"] = [profilestb.windowTitle(), profilestb] | 2597 self.__toolbars["view_profiles"] = [profilestb.windowTitle(), |
2598 profilestb] | |
2456 self.__toolbars["plugins"] = [pluginstb.windowTitle(), pluginstb] | 2599 self.__toolbars["plugins"] = [pluginstb.windowTitle(), pluginstb] |
2457 self.__toolbars["quicksearch"] = [quicksearchtb.windowTitle(), quicksearchtb] | 2600 self.__toolbars["quicksearch"] = [quicksearchtb.windowTitle(), |
2458 self.__toolbars["multiproject"] = [multiprojecttb.windowTitle(), multiprojecttb] | 2601 quicksearchtb] |
2602 self.__toolbars["multiproject"] = [multiprojecttb.windowTitle(), | |
2603 multiprojecttb] | |
2459 self.__toolbars["spelling"] = [spellingtb.windowTitle(), spellingtb] | 2604 self.__toolbars["spelling"] = [spellingtb.windowTitle(), spellingtb] |
2460 | 2605 |
2461 def __initDebugToolbarsLayout(self): | 2606 def __initDebugToolbarsLayout(self): |
2462 """ | 2607 """ |
2463 Private slot to initialize the toolbars layout for the debug profile. | 2608 Private slot to initialize the toolbars layout for the debug profile. |
2511 )) | 2656 )) |
2512 | 2657 |
2513 self.sbLine = QLabel(self.__statusBar) | 2658 self.sbLine = QLabel(self.__statusBar) |
2514 self.__statusBar.addPermanentWidget(self.sbLine) | 2659 self.__statusBar.addPermanentWidget(self.sbLine) |
2515 self.sbLine.setWhatsThis(self.trUtf8( | 2660 self.sbLine.setWhatsThis(self.trUtf8( |
2516 """<p>This part of the status bar displays the line number of the""" | 2661 """<p>This part of the status bar displays the line number of""" |
2517 """ current editor.</p>""" | 2662 """ the current editor.</p>""" |
2518 )) | 2663 )) |
2519 | 2664 |
2520 self.sbPos = QLabel(self.__statusBar) | 2665 self.sbPos = QLabel(self.__statusBar) |
2521 self.__statusBar.addPermanentWidget(self.sbPos) | 2666 self.__statusBar.addPermanentWidget(self.sbPos) |
2522 self.sbPos.setWhatsThis(self.trUtf8( | 2667 self.sbPos.setWhatsThis(self.trUtf8( |
2523 """<p>This part of the status bar displays the cursor position of""" | 2668 """<p>This part of the status bar displays the cursor position""" |
2524 """ the current editor.</p>""" | 2669 """ of the current editor.</p>""" |
2525 )) | 2670 )) |
2526 | 2671 |
2527 self.sbZoom = E5ZoomWidget(UI.PixmapCache.getPixmap("zoomOut.png"), | 2672 self.sbZoom = E5ZoomWidget(UI.PixmapCache.getPixmap("zoomOut.png"), |
2528 UI.PixmapCache.getPixmap("zoomIn.png"), | 2673 UI.PixmapCache.getPixmap("zoomIn.png"), |
2529 UI.PixmapCache.getPixmap("zoomReset.png"), | 2674 UI.PixmapCache.getPixmap("zoomReset.png"), |
2530 self.__statusBar) | 2675 self.__statusBar) |
2531 self.__statusBar.addPermanentWidget(self.sbZoom) | 2676 self.__statusBar.addPermanentWidget(self.sbZoom) |
2532 self.sbZoom.setWhatsThis(self.trUtf8( | 2677 self.sbZoom.setWhatsThis(self.trUtf8( |
2533 """<p>This part of the status bar allows zooming the current editor,""" | 2678 """<p>This part of the status bar allows zooming the current""" |
2534 """ shell or terminal.</p>""" | 2679 """ editor, shell or terminal.</p>""" |
2535 )) | 2680 )) |
2536 | 2681 |
2537 self.viewmanager.setSbInfo(self.sbLine, self.sbPos, self.sbWritable, | 2682 self.viewmanager.setSbInfo( |
2538 self.sbEncoding, self.sbLanguage, self.sbEol, | 2683 self.sbLine, self.sbPos, self.sbWritable, self.sbEncoding, |
2539 self.sbZoom) | 2684 self.sbLanguage, self.sbEol, self.sbZoom) |
2540 | 2685 |
2541 from VCS.StatusMonitorLed import StatusMonitorLed | 2686 from VCS.StatusMonitorLed import StatusMonitorLed |
2542 self.sbVcsMonitorLed = StatusMonitorLed(self.project, self.__statusBar) | 2687 self.sbVcsMonitorLed = StatusMonitorLed(self.project, self.__statusBar) |
2543 self.__statusBar.addPermanentWidget(self.sbVcsMonitorLed) | 2688 self.__statusBar.addPermanentWidget(self.sbVcsMonitorLed) |
2544 | 2689 |
2549 self.toolGroupActions = {} | 2694 self.toolGroupActions = {} |
2550 for toolGroup in self.toolGroups: | 2695 for toolGroup in self.toolGroups: |
2551 category = self.trUtf8("External Tools/{0}").format(toolGroup[0]) | 2696 category = self.trUtf8("External Tools/{0}").format(toolGroup[0]) |
2552 for tool in toolGroup[1]: | 2697 for tool in toolGroup[1]: |
2553 if tool['menutext'] != '--': | 2698 if tool['menutext'] != '--': |
2554 act = QAction(UI.PixmapCache.getIcon(tool['icon']), tool['menutext'], | 2699 act = QAction(UI.PixmapCache.getIcon(tool['icon']), |
2555 self) | 2700 tool['menutext'], self) |
2556 act.setObjectName("{0}@@{1}".format(toolGroup[0], | 2701 act.setObjectName("{0}@@{1}".format(toolGroup[0], |
2557 tool['menutext'])) | 2702 tool['menutext'])) |
2558 act.triggered[()].connect(self.__toolActionTriggered) | 2703 act.triggered[()].connect(self.__toolActionTriggered) |
2559 self.toolGroupActions[act.objectName()] = act | 2704 self.toolGroupActions[act.objectName()] = act |
2560 | 2705 |
2561 self.toolbarManager.addAction(act, category) | 2706 self.toolbarManager.addAction(act, category) |
2562 | 2707 |
2563 def __updateExternalToolsActions(self): | 2708 def __updateExternalToolsActions(self): |
2564 """ | 2709 """ |
2565 Private method to update the external tools actions for the current tool group. | 2710 Private method to update the external tools actions for the current |
2711 tool group. | |
2566 """ | 2712 """ |
2567 toolGroup = self.toolGroups[self.currentToolGroup] | 2713 toolGroup = self.toolGroups[self.currentToolGroup] |
2568 groupkey = "{0}@@".format(toolGroup[0]) | 2714 groupkey = "{0}@@".format(toolGroup[0]) |
2569 groupActionKeys = [] | 2715 groupActionKeys = [] |
2570 # step 1: get actions for this group | 2716 # step 1: get actions for this group |
2590 category = self.trUtf8("External Tools/{0}").format(toolGroup[0]) | 2736 category = self.trUtf8("External Tools/{0}").format(toolGroup[0]) |
2591 for tool in toolGroup[1]: | 2737 for tool in toolGroup[1]: |
2592 if tool['menutext'] != '--': | 2738 if tool['menutext'] != '--': |
2593 key = "{0}@@{1}".format(toolGroup[0], tool['menutext']) | 2739 key = "{0}@@{1}".format(toolGroup[0], tool['menutext']) |
2594 if key not in groupActionKeys: | 2740 if key not in groupActionKeys: |
2595 act = QAction(UI.PixmapCache.getIcon(tool['icon']), tool['menutext'], | 2741 act = QAction(UI.PixmapCache.getIcon(tool['icon']), |
2596 self) | 2742 tool['menutext'], self) |
2597 act.setObjectName(key) | 2743 act.setObjectName(key) |
2598 act.triggered[()].connect(self.__toolActionTriggered) | 2744 act.triggered[()].connect(self.__toolActionTriggered) |
2599 self.toolGroupActions[key] = act | 2745 self.toolGroupActions[key] = act |
2600 | 2746 |
2601 self.toolbarManager.addAction(act, category) | 2747 self.toolbarManager.addAction(act, category) |
2629 | 2775 |
2630 def __showSettingsMenu(self): | 2776 def __showSettingsMenu(self): |
2631 """ | 2777 """ |
2632 Private slot to show the Settings menu. | 2778 Private slot to show the Settings menu. |
2633 """ | 2779 """ |
2634 self.editMessageFilterAct.setEnabled(E5ErrorMessage.messageHandlerInstalled()) | 2780 self.editMessageFilterAct.setEnabled( |
2781 E5ErrorMessage.messageHandlerInstalled()) | |
2635 | 2782 |
2636 self.showMenu.emit("Settings", self.__menus["settings"]) | 2783 self.showMenu.emit("Settings", self.__menus["settings"]) |
2637 | 2784 |
2638 def __showNext(self): | 2785 def __showNext(self): |
2639 """ | 2786 """ |
2655 if fwidget: | 2802 if fwidget: |
2656 fwidget.prevTab() | 2803 fwidget.prevTab() |
2657 | 2804 |
2658 def __switchTab(self): | 2805 def __switchTab(self): |
2659 """ | 2806 """ |
2660 Private slot used to switch between the current and the previous current tab. | 2807 Private slot used to switch between the current and the previous |
2808 current tab. | |
2661 """ | 2809 """ |
2662 fwidget = QApplication.focusWidget() | 2810 fwidget = QApplication.focusWidget() |
2663 while fwidget and not hasattr(fwidget, 'switchTab'): | 2811 while fwidget and not hasattr(fwidget, 'switchTab'): |
2664 fwidget = fwidget.parent() | 2812 fwidget = fwidget.parent() |
2665 if fwidget: | 2813 if fwidget: |
2722 """ | 2870 """ |
2723 Public slot to show the email dialog in a given mode. | 2871 Public slot to show the email dialog in a given mode. |
2724 | 2872 |
2725 @param mode mode of the email dialog (string, "bug" or "feature") | 2873 @param mode mode of the email dialog (string, "bug" or "feature") |
2726 @param attachFile name of a file to attach to the email (string) | 2874 @param attachFile name of a file to attach to the email (string) |
2727 @param deleteAttachFile flag indicating to delete the attached file after | 2875 @param deleteAttachFile flag indicating to delete the attached file |
2728 it has been sent (boolean) | 2876 after it has been sent (boolean) |
2729 """ | 2877 """ |
2730 if Preferences.getUser("UseSystemEmailClient"): | 2878 if Preferences.getUser("UseSystemEmailClient"): |
2731 self.__showSystemEmailClient(mode, attachFile, deleteAttachFile) | 2879 self.__showSystemEmailClient(mode, attachFile, deleteAttachFile) |
2732 else: | 2880 else: |
2733 if Preferences.getUser("Email") == "" or \ | 2881 if Preferences.getUser("Email") == "" or \ |
2734 Preferences.getUser("MailServer") == "": | 2882 Preferences.getUser("MailServer") == "": |
2735 E5MessageBox.critical(self, | 2883 E5MessageBox.critical(self, |
2736 self.trUtf8("Report Bug"), | 2884 self.trUtf8("Report Bug"), |
2737 self.trUtf8("""Email address or mail server address is empty.""" | 2885 self.trUtf8( |
2738 """ Please configure your Email settings in the""" | 2886 """Email address or mail server address is empty.""" |
2739 """ Preferences Dialog.""")) | 2887 """ Please configure your Email settings in the""" |
2888 """ Preferences Dialog.""")) | |
2740 self.showPreferences("emailPage") | 2889 self.showPreferences("emailPage") |
2741 return | 2890 return |
2742 | 2891 |
2743 from .EmailDialog import EmailDialog | 2892 from .EmailDialog import EmailDialog |
2744 self.dlg = EmailDialog(mode=mode) | 2893 self.dlg = EmailDialog(mode=mode) |
2745 if attachFile is not None: | 2894 if attachFile is not None: |
2746 self.dlg.attachFile(attachFile, deleteAttachFile) | 2895 self.dlg.attachFile(attachFile, deleteAttachFile) |
2747 self.dlg.show() | 2896 self.dlg.show() |
2748 | 2897 |
2749 def __showSystemEmailClient(self, mode, attachFile=None, deleteAttachFile=False): | 2898 def __showSystemEmailClient(self, mode, attachFile=None, |
2899 deleteAttachFile=False): | |
2750 """ | 2900 """ |
2751 Private slot to show the system email dialog. | 2901 Private slot to show the system email dialog. |
2752 | 2902 |
2753 @param mode mode of the email dialog (string, "bug" or "feature") | 2903 @param mode mode of the email dialog (string, "bug" or "feature") |
2754 @param attachFile name of a file to put into the body of the | 2904 @param attachFile name of a file to put into the body of the |
2778 url.addQueryItem("body", body) | 2928 url.addQueryItem("body", body) |
2779 QDesktopServices.openUrl(url) | 2929 QDesktopServices.openUrl(url) |
2780 | 2930 |
2781 def checkForErrorLog(self): | 2931 def checkForErrorLog(self): |
2782 """ | 2932 """ |
2783 Public method to check for the presence of an error log and ask the user, | 2933 Public method to check for the presence of an error log and ask the |
2784 what to do with it. | 2934 user, what to do with it. |
2785 """ | 2935 """ |
2786 if Preferences.getUI("CheckErrorLog"): | 2936 if Preferences.getUI("CheckErrorLog"): |
2787 logFile = os.path.join(Utilities.getConfigDir(), "eric5_error.log") | 2937 logFile = os.path.join(Utilities.getConfigDir(), "eric5_error.log") |
2788 if os.path.exists(logFile): | 2938 if os.path.exists(logFile): |
2789 from .ErrorLogDialog import ErrorLogDialog | 2939 from .ErrorLogDialog import ErrorLogDialog |
2978 | 3128 |
2979 def __restart(self): | 3129 def __restart(self): |
2980 """ | 3130 """ |
2981 Private method to restart the application. | 3131 Private method to restart the application. |
2982 """ | 3132 """ |
2983 res = E5MessageBox.yesNo(self, | 3133 res = E5MessageBox.yesNo( |
3134 self, | |
2984 self.trUtf8("Restart application"), | 3135 self.trUtf8("Restart application"), |
2985 self.trUtf8("""The application needs to be restarted. Do it now?"""), | 3136 self.trUtf8( |
3137 """The application needs to be restarted. Do it now?"""), | |
2986 yesDefault=True) | 3138 yesDefault=True) |
2987 | 3139 |
2988 if res and self.__shutdown(): | 3140 if res and self.__shutdown(): |
2989 e5App().closeAllWindows() | 3141 e5App().closeAllWindows() |
2990 program = sys.executable | 3142 program = sys.executable |
3010 Private slot to display the Tools menu. | 3162 Private slot to display the Tools menu. |
3011 """ | 3163 """ |
3012 self.__menus["tools"].clear() | 3164 self.__menus["tools"].clear() |
3013 | 3165 |
3014 self.__menus["tools"].addMenu(self.toolGroupsMenu) | 3166 self.__menus["tools"].addMenu(self.toolGroupsMenu) |
3015 act = self.__menus["tools"].addAction(self.trUtf8("Configure Tool Groups ..."), | 3167 act = self.__menus["tools"].addAction( |
3168 self.trUtf8("Configure Tool Groups ..."), | |
3016 self.__toolGroupsConfiguration) | 3169 self.__toolGroupsConfiguration) |
3017 act.setData(-1) | 3170 act.setData(-1) |
3018 act = self.__menus["tools"].addAction( | 3171 act = self.__menus["tools"].addAction( |
3019 self.trUtf8("Configure current Tool Group ..."), | 3172 self.trUtf8("Configure current Tool Group ..."), |
3020 self.__toolsConfiguration) | 3173 self.__toolsConfiguration) |
3048 for tool in self.toolGroups[self.currentToolGroup][1]: | 3201 for tool in self.toolGroups[self.currentToolGroup][1]: |
3049 if tool['menutext'] == '--': | 3202 if tool['menutext'] == '--': |
3050 self.__menus["tools"].addSeparator() | 3203 self.__menus["tools"].addSeparator() |
3051 else: | 3204 else: |
3052 act = self.__menus["tools"].addAction( | 3205 act = self.__menus["tools"].addAction( |
3053 UI.PixmapCache.getIcon(tool['icon']), tool['menutext']) | 3206 UI.PixmapCache.getIcon(tool['icon']), |
3207 tool['menutext']) | |
3054 act.setData(idx) | 3208 act.setData(idx) |
3055 idx += 1 | 3209 idx += 1 |
3056 except IndexError: | 3210 except IndexError: |
3057 # the current tool group might have been deleted | 3211 # the current tool group might have been deleted |
3058 pass | 3212 pass |
3216 self.profiles[self.currentProfile][2][4] = state | 3370 self.profiles[self.currentProfile][2][4] = state |
3217 state = self.rightSidebar.saveState() | 3371 state = self.rightSidebar.saveState() |
3218 self.profiles[self.currentProfile][2][5] = state | 3372 self.profiles[self.currentProfile][2][5] = state |
3219 # step 2: save the visibility of the windows of the active profile | 3373 # step 2: save the visibility of the windows of the active profile |
3220 if self.layout == "Toolboxes": | 3374 if self.layout == "Toolboxes": |
3221 self.profiles[self.currentProfile][1][0] = self.lToolboxDock.isVisible() | 3375 self.profiles[self.currentProfile][1][0] = \ |
3222 self.profiles[self.currentProfile][1][1] = self.hToolboxDock.isVisible() | 3376 self.lToolboxDock.isVisible() |
3223 self.profiles[self.currentProfile][1][2] = self.rToolboxDock.isVisible() | 3377 self.profiles[self.currentProfile][1][1] = \ |
3378 self.hToolboxDock.isVisible() | |
3379 self.profiles[self.currentProfile][1][2] = \ | |
3380 self.rToolboxDock.isVisible() | |
3224 elif self.layout == "Sidebars": | 3381 elif self.layout == "Sidebars": |
3225 self.profiles[self.currentProfile][1][0] = self.leftSidebar.isVisible() | 3382 self.profiles[self.currentProfile][1][0] = \ |
3226 self.profiles[self.currentProfile][1][1] = self.bottomSidebar.isVisible() | 3383 self.leftSidebar.isVisible() |
3227 self.profiles[self.currentProfile][1][2] = self.rightSidebar.isVisible() | 3384 self.profiles[self.currentProfile][1][1] = \ |
3385 self.bottomSidebar.isVisible() | |
3386 self.profiles[self.currentProfile][1][2] = \ | |
3387 self.rightSidebar.isVisible() | |
3228 Preferences.setUI("ViewProfiles2", self.profiles) | 3388 Preferences.setUI("ViewProfiles2", self.profiles) |
3229 | 3389 |
3230 def __activateViewProfile(self, name, save=True): | 3390 def __activateViewProfile(self, name, save=True): |
3231 """ | 3391 """ |
3232 Private slot to activate a view profile. | 3392 Private slot to activate a view profile. |
3279 self.currentProfile = name | 3439 self.currentProfile = name |
3280 | 3440 |
3281 # step 5: make sure that cursor of the shell is visible | 3441 # step 5: make sure that cursor of the shell is visible |
3282 self.shell.ensureCursorVisible() | 3442 self.shell.ensureCursorVisible() |
3283 | 3443 |
3284 # step 6: make sure, that the toolbars and window menu are shown correctly | 3444 # step 6: make sure, that the toolbars and window menu are |
3445 # shown correctly | |
3285 if self.__menus["toolbars"].isTearOffMenuVisible(): | 3446 if self.__menus["toolbars"].isTearOffMenuVisible(): |
3286 self.__showToolbarsMenu() | 3447 self.__showToolbarsMenu() |
3287 if self.__menus["window"].isTearOffMenuVisible(): | 3448 if self.__menus["window"].isTearOffMenuVisible(): |
3288 self.__showWindowMenu() | 3449 self.__showWindowMenu() |
3289 | 3450 |
3364 elif self.layout == "Sidebars": | 3525 elif self.layout == "Sidebars": |
3365 self.leftSidebar.show() | 3526 self.leftSidebar.show() |
3366 self.leftSidebar.setCurrentWidget(self.projectBrowser) | 3527 self.leftSidebar.setCurrentWidget(self.projectBrowser) |
3367 else: | 3528 else: |
3368 self.projectBrowser.show() | 3529 self.projectBrowser.show() |
3369 self.projectBrowser.currentWidget().setFocus(Qt.ActiveWindowFocusReason) | 3530 self.projectBrowser.currentWidget().setFocus( |
3531 Qt.ActiveWindowFocusReason) | |
3370 | 3532 |
3371 def __activateMultiProjectBrowser(self): | 3533 def __activateMultiProjectBrowser(self): |
3372 """ | 3534 """ |
3373 Private slot to handle the activation of the project browser. | 3535 Private slot to handle the activation of the project browser. |
3374 """ | 3536 """ |
3539 Private slot to handle the toggle of the left sidebar window. | 3701 Private slot to handle the toggle of the left sidebar window. |
3540 """ | 3702 """ |
3541 hasFocus = self.leftSidebar.currentWidget().hasFocus() | 3703 hasFocus = self.leftSidebar.currentWidget().hasFocus() |
3542 shown = self.__toggleWindow(self.leftSidebar) | 3704 shown = self.__toggleWindow(self.leftSidebar) |
3543 if shown: | 3705 if shown: |
3544 self.leftSidebar.currentWidget().setFocus(Qt.ActiveWindowFocusReason) | 3706 self.leftSidebar.currentWidget().setFocus( |
3707 Qt.ActiveWindowFocusReason) | |
3545 else: | 3708 else: |
3546 if hasFocus: | 3709 if hasFocus: |
3547 self.__activateViewmanager() | 3710 self.__activateViewmanager() |
3548 | 3711 |
3549 def __toggleRightSidebar(self): | 3712 def __toggleRightSidebar(self): |
3551 Private slot to handle the toggle of the right sidebar window. | 3714 Private slot to handle the toggle of the right sidebar window. |
3552 """ | 3715 """ |
3553 hasFocus = self.rightSidebar.currentWidget().hasFocus() | 3716 hasFocus = self.rightSidebar.currentWidget().hasFocus() |
3554 shown = self.__toggleWindow(self.rightSidebar) | 3717 shown = self.__toggleWindow(self.rightSidebar) |
3555 if shown: | 3718 if shown: |
3556 self.rightSidebar.currentWidget().setFocus(Qt.ActiveWindowFocusReason) | 3719 self.rightSidebar.currentWidget().setFocus( |
3720 Qt.ActiveWindowFocusReason) | |
3557 else: | 3721 else: |
3558 if hasFocus: | 3722 if hasFocus: |
3559 self.__activateViewmanager() | 3723 self.__activateViewmanager() |
3560 | 3724 |
3561 def __toggleBottomSidebar(self): | 3725 def __toggleBottomSidebar(self): |
3563 Private slot to handle the toggle of the bottom sidebar window. | 3727 Private slot to handle the toggle of the bottom sidebar window. |
3564 """ | 3728 """ |
3565 hasFocus = self.bottomSidebar.currentWidget().hasFocus() | 3729 hasFocus = self.bottomSidebar.currentWidget().hasFocus() |
3566 shown = self.__toggleWindow(self.bottomSidebar) | 3730 shown = self.__toggleWindow(self.bottomSidebar) |
3567 if shown: | 3731 if shown: |
3568 self.bottomSidebar.currentWidget().setFocus(Qt.ActiveWindowFocusReason) | 3732 self.bottomSidebar.currentWidget().setFocus( |
3733 Qt.ActiveWindowFocusReason) | |
3569 else: | 3734 else: |
3570 if hasFocus: | 3735 if hasFocus: |
3571 self.__activateViewmanager() | 3736 self.__activateViewmanager() |
3572 | 3737 |
3573 def activateCooperationViewer(self): | 3738 def activateCooperationViewer(self): |
3651 def __toolsConfiguration(self): | 3816 def __toolsConfiguration(self): |
3652 """ | 3817 """ |
3653 Private slot to handle the tools configuration menu entry. | 3818 Private slot to handle the tools configuration menu entry. |
3654 """ | 3819 """ |
3655 from Preferences.ToolConfigurationDialog import ToolConfigurationDialog | 3820 from Preferences.ToolConfigurationDialog import ToolConfigurationDialog |
3656 dlg = ToolConfigurationDialog(self.toolGroups[self.currentToolGroup][1], self) | 3821 dlg = ToolConfigurationDialog( |
3822 self.toolGroups[self.currentToolGroup][1], self) | |
3657 if dlg.exec_() == QDialog.Accepted: | 3823 if dlg.exec_() == QDialog.Accepted: |
3658 self.toolGroups[self.currentToolGroup][1] = dlg.getToollist() | 3824 self.toolGroups[self.currentToolGroup][1] = dlg.getToollist() |
3659 self.__updateExternalToolsActions() | 3825 self.__updateExternalToolsActions() |
3660 | 3826 |
3661 def __toolGroupsConfiguration(self): | 3827 def __toolGroupsConfiguration(self): |
3662 """ | 3828 """ |
3663 Private slot to handle the tool groups configuration menu entry. | 3829 Private slot to handle the tool groups configuration menu entry. |
3664 """ | 3830 """ |
3665 from Preferences.ToolGroupConfigurationDialog import ToolGroupConfigurationDialog | 3831 from Preferences.ToolGroupConfigurationDialog import \ |
3666 dlg = ToolGroupConfigurationDialog(self.toolGroups, self.currentToolGroup, self) | 3832 ToolGroupConfigurationDialog |
3833 dlg = ToolGroupConfigurationDialog( | |
3834 self.toolGroups, self.currentToolGroup, self) | |
3667 if dlg.exec_() == QDialog.Accepted: | 3835 if dlg.exec_() == QDialog.Accepted: |
3668 self.toolGroups, self.currentToolGroup = dlg.getToolGroups() | 3836 self.toolGroups, self.currentToolGroup = dlg.getToolGroups() |
3669 | 3837 |
3670 def __createUnitTestDialog(self): | 3838 def __createUnitTestDialog(self): |
3671 """ | 3839 """ |
3673 """ | 3841 """ |
3674 if self.unittestDialog is None: | 3842 if self.unittestDialog is None: |
3675 from PyUnit.UnittestDialog import UnittestDialog | 3843 from PyUnit.UnittestDialog import UnittestDialog |
3676 self.unittestDialog = UnittestDialog( | 3844 self.unittestDialog = UnittestDialog( |
3677 None, self.debuggerUI.debugServer, self, fromEric=True) | 3845 None, self.debuggerUI.debugServer, self, fromEric=True) |
3678 self.unittestDialog.unittestFile.connect(self.viewmanager.setFileLine) | 3846 self.unittestDialog.unittestFile.connect( |
3847 self.viewmanager.setFileLine) | |
3679 self.unittestDialog.unittestStopped.connect(self.__unittestStopped) | 3848 self.unittestDialog.unittestStopped.connect(self.__unittestStopped) |
3680 | 3849 |
3681 def __unittestStopped(self): | 3850 def __unittestStopped(self): |
3682 """ | 3851 """ |
3683 Private slot to handle the end of a unit test run. | 3852 Private slot to handle the end of a unit test run. |
3693 self.unittestDialog.show() | 3862 self.unittestDialog.show() |
3694 self.unittestDialog.raise_() | 3863 self.unittestDialog.raise_() |
3695 | 3864 |
3696 def __unittestScript(self, prog=None): | 3865 def __unittestScript(self, prog=None): |
3697 """ | 3866 """ |
3698 Private slot for displaying the unittest dialog and run the current script. | 3867 Private slot for displaying the unittest dialog and run the current |
3868 script. | |
3699 | 3869 |
3700 @param prog the python program to be opened | 3870 @param prog the python program to be opened |
3701 """ | 3871 """ |
3702 if prog is None: | 3872 if prog is None: |
3703 aw = self.viewmanager.activeWindow() | 3873 aw = self.viewmanager.activeWindow() |
3715 self.utRestartAct.setEnabled(False) | 3885 self.utRestartAct.setEnabled(False) |
3716 self.utRerunFailedAct.setEnabled(False) | 3886 self.utRerunFailedAct.setEnabled(False) |
3717 | 3887 |
3718 def __unittestProject(self): | 3888 def __unittestProject(self): |
3719 """ | 3889 """ |
3720 Private slot for displaying the unittest dialog and run the current project. | 3890 Private slot for displaying the unittest dialog and run the current |
3891 project. | |
3721 """ | 3892 """ |
3722 fn = self.project.getMainScript(True) | 3893 fn = self.project.getMainScript(True) |
3723 if fn: | 3894 if fn: |
3724 tfn = Utilities.getTestFileName(fn) | 3895 tfn = Utilities.getTestFileName(fn) |
3725 if os.path.exists(tfn): | 3896 if os.path.exists(tfn): |
3740 self.utRestartAct.setEnabled(False) | 3911 self.utRestartAct.setEnabled(False) |
3741 self.utRerunFailedAct.setEnabled(False) | 3912 self.utRerunFailedAct.setEnabled(False) |
3742 | 3913 |
3743 def __unittestRestart(self): | 3914 def __unittestRestart(self): |
3744 """ | 3915 """ |
3745 Private slot to display the unittest dialog and rerun the last unit test. | 3916 Private slot to display the unittest dialog and rerun the last |
3917 unit test. | |
3746 """ | 3918 """ |
3747 self.__createUnitTestDialog() | 3919 self.__createUnitTestDialog() |
3748 self.unittestDialog.show() | 3920 self.unittestDialog.show() |
3749 self.unittestDialog.raise_() | 3921 self.unittestDialog.raise_() |
3750 self.unittestDialog.on_startButton_clicked() | 3922 self.unittestDialog.on_startButton_clicked() |
3811 ' is zero length.</p>') | 3983 ' is zero length.</p>') |
3812 .format(fn)) | 3984 .format(fn)) |
3813 return | 3985 return |
3814 | 3986 |
3815 if Utilities.isMacPlatform(): | 3987 if Utilities.isMacPlatform(): |
3816 designer, args = Utilities.prepareQtMacBundle("designer", version, args) | 3988 designer, args = Utilities.prepareQtMacBundle( |
3989 "designer", version, args) | |
3817 else: | 3990 else: |
3818 if version == 4: | 3991 if version == 4: |
3819 designer = os.path.join( | 3992 designer = os.path.join( |
3820 Utilities.getQtBinariesPath(), | 3993 Utilities.getQtBinariesPath(), |
3821 Utilities.generateQtToolName("designer")) | 3994 Utilities.generateQtToolName("designer")) |
3852 | 4025 |
3853 args = [] | 4026 args = [] |
3854 if fn is not None: | 4027 if fn is not None: |
3855 fn = fn.replace('.qm', '.ts') | 4028 fn = fn.replace('.qm', '.ts') |
3856 try: | 4029 try: |
3857 if os.path.isfile(fn) and os.path.getsize(fn) and fn not in args: | 4030 if os.path.isfile(fn) and os.path.getsize(fn) and \ |
4031 fn not in args: | |
3858 args.append(fn) | 4032 args.append(fn) |
3859 else: | 4033 else: |
3860 E5MessageBox.critical(self, | 4034 E5MessageBox.critical(self, |
3861 self.trUtf8('Problem'), | 4035 self.trUtf8('Problem'), |
3862 self.trUtf8('<p>The file <b>{0}</b> does not exist or' | 4036 self.trUtf8('<p>The file <b>{0}</b> does not exist or' |
3870 ' is zero length.</p>') | 4044 ' is zero length.</p>') |
3871 .format(fn)) | 4045 .format(fn)) |
3872 return | 4046 return |
3873 | 4047 |
3874 if Utilities.isMacPlatform(): | 4048 if Utilities.isMacPlatform(): |
3875 linguist, args = Utilities.prepareQtMacBundle("linguist", version, args) | 4049 linguist, args = Utilities.prepareQtMacBundle( |
4050 "linguist", version, args) | |
3876 else: | 4051 else: |
3877 if version == 4: | 4052 if version == 4: |
3878 linguist = os.path.join( | 4053 linguist = os.path.join( |
3879 Utilities.getQtBinariesPath(), | 4054 Utilities.getQtBinariesPath(), |
3880 Utilities.generateQtToolName("linguist")) | 4055 Utilities.generateQtToolName("linguist")) |
3916 if version == 4: | 4091 if version == 4: |
3917 args.append('-showUrl') | 4092 args.append('-showUrl') |
3918 args.append(home) | 4093 args.append(home) |
3919 | 4094 |
3920 if Utilities.isMacPlatform(): | 4095 if Utilities.isMacPlatform(): |
3921 assistant, args = Utilities.prepareQtMacBundle("assistant", version, args) | 4096 assistant, args = Utilities.prepareQtMacBundle( |
4097 "assistant", version, args) | |
3922 else: | 4098 else: |
3923 if version == 4: | 4099 if version == 4: |
3924 assistant = os.path.join( | 4100 assistant = os.path.join( |
3925 Utilities.getQtBinariesPath(), | 4101 Utilities.getQtBinariesPath(), |
3926 Utilities.generateQtToolName("assistant")) | 4102 Utilities.generateQtToolName("assistant")) |
3956 """ | 4132 """ |
3957 customViewer = Preferences.getHelp("CustomViewer") | 4133 customViewer = Preferences.getHelp("CustomViewer") |
3958 if not customViewer: | 4134 if not customViewer: |
3959 E5MessageBox.information(self, | 4135 E5MessageBox.information(self, |
3960 self.trUtf8("Help"), | 4136 self.trUtf8("Help"), |
3961 self.trUtf8("""Currently no custom viewer is selected.""" | 4137 self.trUtf8( |
3962 """ Please use the preferences dialog to specify one.""")) | 4138 """Currently no custom viewer is selected.""" |
4139 """ Please use the preferences dialog to specify one.""")) | |
3963 return | 4140 return |
3964 | 4141 |
3965 proc = QProcess() | 4142 proc = QProcess() |
3966 args = [] | 4143 args = [] |
3967 if home: | 4144 if home: |
4024 self.trUtf8('<p>The file <b>{0}</b> does not exist or' | 4201 self.trUtf8('<p>The file <b>{0}</b> does not exist or' |
4025 ' is zero length.</p>') | 4202 ' is zero length.</p>') |
4026 .format(fn)) | 4203 .format(fn)) |
4027 return | 4204 return |
4028 | 4205 |
4029 if not os.path.isfile(viewer) or not proc.startDetached(sys.executable, args): | 4206 if not os.path.isfile(viewer) or \ |
4030 E5MessageBox.critical(self, | 4207 not proc.startDetached(sys.executable, args): |
4208 E5MessageBox.critical( | |
4209 self, | |
4031 self.trUtf8('Process Generation Error'), | 4210 self.trUtf8('Process Generation Error'), |
4032 self.trUtf8( | 4211 self.trUtf8( |
4033 '<p>Could not start UI Previewer.<br>' | 4212 '<p>Could not start UI Previewer.<br>' |
4034 'Ensure that it is available as <b>{0}</b>.</p>' | 4213 'Ensure that it is available as <b>{0}</b>.</p>' |
4035 ).format(viewer)) | 4214 ).format(viewer)) |
4038 """ | 4217 """ |
4039 Private slot to start the Translation Previewer executable. | 4218 Private slot to start the Translation Previewer executable. |
4040 | 4219 |
4041 @param fileNames filenames of forms and/or translations to be previewed | 4220 @param fileNames filenames of forms and/or translations to be previewed |
4042 (list of strings) | 4221 (list of strings) |
4043 @param ignore flag indicating non existing files should be ignored (boolean) | 4222 @param ignore flag indicating non existing files should be ignored |
4223 (boolean) | |
4044 """ | 4224 """ |
4045 proc = QProcess() | 4225 proc = QProcess() |
4046 | 4226 |
4047 viewer = os.path.join(getConfig("ericDir"), "eric5_trpreviewer.py") | 4227 viewer = os.path.join(getConfig("ericDir"), "eric5_trpreviewer.py") |
4048 | 4228 |
4056 args.append(fn) | 4236 args.append(fn) |
4057 else: | 4237 else: |
4058 if not ignore: | 4238 if not ignore: |
4059 E5MessageBox.critical(self, | 4239 E5MessageBox.critical(self, |
4060 self.trUtf8('Problem'), | 4240 self.trUtf8('Problem'), |
4061 self.trUtf8('<p>The file <b>{0}</b> does not exist or' | 4241 self.trUtf8( |
4242 '<p>The file <b>{0}</b> does not exist or' | |
4062 ' is zero length.</p>') | 4243 ' is zero length.</p>') |
4063 .format(fn)) | 4244 .format(fn)) |
4064 return | 4245 return |
4065 except EnvironmentError: | 4246 except EnvironmentError: |
4066 if not ignore: | 4247 if not ignore: |
4067 E5MessageBox.critical(self, | 4248 E5MessageBox.critical(self, |
4068 self.trUtf8('Problem'), | 4249 self.trUtf8('Problem'), |
4069 self.trUtf8('<p>The file <b>{0}</b> does not exist or' | 4250 self.trUtf8( |
4251 '<p>The file <b>{0}</b> does not exist or' | |
4070 ' is zero length.</p>') | 4252 ' is zero length.</p>') |
4071 .format(fn)) | 4253 .format(fn)) |
4072 return | 4254 return |
4073 | 4255 |
4074 if not os.path.isfile(viewer) or not proc.startDetached(sys.executable, args): | 4256 if not os.path.isfile(viewer) or \ |
4075 E5MessageBox.critical(self, | 4257 not proc.startDetached(sys.executable, args): |
4258 E5MessageBox.critical( | |
4259 self, | |
4076 self.trUtf8('Process Generation Error'), | 4260 self.trUtf8('Process Generation Error'), |
4077 self.trUtf8( | 4261 self.trUtf8( |
4078 '<p>Could not start Translation Previewer.<br>' | 4262 '<p>Could not start Translation Previewer.<br>' |
4079 'Ensure that it is available as <b>{0}</b>.</p>' | 4263 'Ensure that it is available as <b>{0}</b>.</p>' |
4080 ).format(viewer)) | 4264 ).format(viewer)) |
4088 browser = os.path.join(getConfig("ericDir"), "eric5_sqlbrowser.py") | 4272 browser = os.path.join(getConfig("ericDir"), "eric5_sqlbrowser.py") |
4089 | 4273 |
4090 args = [] | 4274 args = [] |
4091 args.append(browser) | 4275 args.append(browser) |
4092 | 4276 |
4093 if not os.path.isfile(browser) or not proc.startDetached(sys.executable, args): | 4277 if not os.path.isfile(browser) or \ |
4094 E5MessageBox.critical(self, | 4278 not proc.startDetached(sys.executable, args): |
4279 E5MessageBox.critical( | |
4280 self, | |
4095 self.trUtf8('Process Generation Error'), | 4281 self.trUtf8('Process Generation Error'), |
4096 self.trUtf8( | 4282 self.trUtf8( |
4097 '<p>Could not start SQL Browser.<br>' | 4283 '<p>Could not start SQL Browser.<br>' |
4098 'Ensure that it is available as <b>{0}</b>.</p>' | 4284 'Ensure that it is available as <b>{0}</b>.</p>' |
4099 ).format(browser)) | 4285 ).format(browser)) |
4138 snap = os.path.join(getConfig("ericDir"), "eric5_snap.py") | 4324 snap = os.path.join(getConfig("ericDir"), "eric5_snap.py") |
4139 | 4325 |
4140 args = [] | 4326 args = [] |
4141 args.append(snap) | 4327 args.append(snap) |
4142 | 4328 |
4143 if not os.path.isfile(snap) or not proc.startDetached(sys.executable, args): | 4329 if not os.path.isfile(snap) or \ |
4144 E5MessageBox.critical(self, | 4330 not proc.startDetached(sys.executable, args): |
4331 E5MessageBox.critical( | |
4332 self, | |
4145 self.trUtf8('Process Generation Error'), | 4333 self.trUtf8('Process Generation Error'), |
4146 self.trUtf8( | 4334 self.trUtf8( |
4147 '<p>Could not start Snapshot tool.<br>' | 4335 '<p>Could not start Snapshot tool.<br>' |
4148 'Ensure that it is available as <b>{0}</b>.</p>' | 4336 'Ensure that it is available as <b>{0}</b>.</p>' |
4149 ).format(snap)) | 4337 ).format(snap)) |
4159 for tool in toolGroup[1]: | 4347 for tool in toolGroup[1]: |
4160 if tool['menutext'] == toolMenuText: | 4348 if tool['menutext'] == toolMenuText: |
4161 self.__startToolProcess(tool) | 4349 self.__startToolProcess(tool) |
4162 return | 4350 return |
4163 | 4351 |
4164 E5MessageBox.information(self, | 4352 E5MessageBox.information( |
4353 self, | |
4165 self.trUtf8("External Tools"), | 4354 self.trUtf8("External Tools"), |
4166 self.trUtf8("""No tool entry found for external tool '{0}' """ | 4355 self.trUtf8( |
4167 """in tool group '{1}'.""").format(toolMenuText, toolGroupName)) | 4356 """No tool entry found for external tool '{0}' """ |
4357 """in tool group '{1}'.""") | |
4358 .format(toolMenuText, toolGroupName)) | |
4168 return | 4359 return |
4169 | 4360 |
4170 E5MessageBox.information(self, | 4361 E5MessageBox.information( |
4362 self, | |
4171 self.trUtf8("External Tools"), | 4363 self.trUtf8("External Tools"), |
4172 self.trUtf8("""No toolgroup entry '{0}' found.""").format(toolGroupName)) | 4364 self.trUtf8("""No toolgroup entry '{0}' found.""") |
4365 .format(toolGroupName) | |
4366 ) | |
4173 | 4367 |
4174 def __toolExecute(self, act): | 4368 def __toolExecute(self, act): |
4175 """ | 4369 """ |
4176 Private slot to execute a particular tool. | 4370 Private slot to execute a particular tool. |
4177 | 4371 |
4316 if not os.path.splitext(pythonDocDir)[1]: | 4510 if not os.path.splitext(pythonDocDir)[1]: |
4317 home = Utilities.normjoinpath(pythonDocDir, 'index.html') | 4511 home = Utilities.normjoinpath(pythonDocDir, 'index.html') |
4318 | 4512 |
4319 if Utilities.isWindowsPlatform() and not os.path.exists(home): | 4513 if Utilities.isWindowsPlatform() and not os.path.exists(home): |
4320 pyversion = sys.hexversion >> 16 | 4514 pyversion = sys.hexversion >> 16 |
4321 vers = "{0:d}{1:d}".format((pyversion >> 8) & 0xff, pyversion & 0xff) | 4515 vers = "{0:d}{1:d}".format((pyversion >> 8) & 0xff, |
4322 home = os.path.join(pythonDocDir, "python{0}.chm".format(vers)) | 4516 pyversion & 0xff) |
4517 home = os.path.join( | |
4518 pythonDocDir, "python{0}.chm".format(vers)) | |
4323 else: | 4519 else: |
4324 home = pythonDocDir | 4520 home = pythonDocDir |
4325 | 4521 |
4326 if not os.path.exists(home): | 4522 if not os.path.exists(home): |
4327 E5MessageBox.warning(self, | 4523 E5MessageBox.warning(self, |
4362 if Utilities.isWindowsPlatform(): | 4558 if Utilities.isWindowsPlatform(): |
4363 if executable: | 4559 if executable: |
4364 default = os.path.join(os.path.dirname(executable), "doc") | 4560 default = os.path.join(os.path.dirname(executable), "doc") |
4365 else: | 4561 else: |
4366 default = "" | 4562 default = "" |
4367 pythonDocDir = Utilities.getEnvironmentEntry("PYTHON2DOCDIR", default) | 4563 pythonDocDir = \ |
4564 Utilities.getEnvironmentEntry("PYTHON2DOCDIR", default) | |
4368 else: | 4565 else: |
4369 pythonDocDir = Utilities.getEnvironmentEntry("PYTHON2DOCDIR", | 4566 pythonDocDir = Utilities.getEnvironmentEntry("PYTHON2DOCDIR", |
4370 '/usr/share/doc/packages/python/html/python-docs-html') | 4567 '/usr/share/doc/packages/python/html/python-docs-html') |
4371 if not pythonDocDir.startswith("http://") and \ | 4568 if not pythonDocDir.startswith("http://") and \ |
4372 not pythonDocDir.startswith("https://"): | 4569 not pythonDocDir.startswith("https://"): |
4546 home = "" | 4743 home = "" |
4547 if pyqt5DocDir: | 4744 if pyqt5DocDir: |
4548 if pyqt5DocDir.startswith("file://"): | 4745 if pyqt5DocDir.startswith("file://"): |
4549 pyqt5DocDir = pyqt5DocDir[7:] | 4746 pyqt5DocDir = pyqt5DocDir[7:] |
4550 if not os.path.splitext(pyqt5DocDir)[1]: | 4747 if not os.path.splitext(pyqt5DocDir)[1]: |
4551 possibleHomes = [\ | 4748 possibleHomes = [ |
4552 Utilities.normjoinpath(pyqt5DocDir, 'index.html'), | 4749 Utilities.normjoinpath( |
4553 Utilities.normjoinpath(pyqt5DocDir, 'class_reference.html'), | 4750 pyqt5DocDir, 'index.html'), |
4751 Utilities.normjoinpath( | |
4752 pyqt5DocDir, 'class_reference.html'), | |
4554 ] | 4753 ] |
4555 for possibleHome in possibleHomes: | 4754 for possibleHome in possibleHomes: |
4556 if os.path.exists(possibleHome): | 4755 if os.path.exists(possibleHome): |
4557 home = possibleHome | 4756 home = possibleHome |
4558 break | 4757 break |
4669 """ | 4868 """ |
4670 Public slot to start the help viewer. | 4869 Public slot to start the help viewer. |
4671 | 4870 |
4672 @param home filename of file to be shown (string) | 4871 @param home filename of file to be shown (string) |
4673 @keyparam searchWord word to search for (string) | 4872 @keyparam searchWord word to search for (string) |
4674 @keyparam useSingle flag indicating to use a single browser window (boolean) | 4873 @keyparam useSingle flag indicating to use a single browser window |
4874 (boolean) | |
4675 """ | 4875 """ |
4676 if len(home) > 0: | 4876 if len(home) > 0: |
4677 homeUrl = QUrl(home) | 4877 homeUrl = QUrl(home) |
4678 if not homeUrl.scheme(): | 4878 if not homeUrl.scheme(): |
4679 home = QUrl.fromLocalFile(home).toString() | 4879 home = QUrl.fromLocalFile(home).toString() |
4690 help.showMaximized() | 4890 help.showMaximized() |
4691 | 4891 |
4692 if useSingle or Preferences.getHelp("SingleHelpWindow"): | 4892 if useSingle or Preferences.getHelp("SingleHelpWindow"): |
4693 self.helpWindow = help | 4893 self.helpWindow = help |
4694 self.helpWindow.helpClosed.connect(self.__helpClosed) | 4894 self.helpWindow.helpClosed.connect(self.__helpClosed) |
4695 self.preferencesChanged.connect(self.helpWindow.preferencesChanged) | 4895 self.preferencesChanged.connect( |
4696 self.masterPasswordChanged.connect(self.helpWindow.masterPasswordChanged) | 4896 self.helpWindow.preferencesChanged) |
4897 self.masterPasswordChanged.connect( | |
4898 self.helpWindow.masterPasswordChanged) | |
4697 elif searchWord is not None: | 4899 elif searchWord is not None: |
4698 self.helpWindow.search(searchWord) | 4900 self.helpWindow.search(searchWord) |
4699 self.helpWindow.raise_() | 4901 self.helpWindow.raise_() |
4700 else: | 4902 else: |
4701 self.helpWindow.newTab(home) | 4903 self.helpWindow.newTab(home) |
4704 def __helpClosed(self): | 4906 def __helpClosed(self): |
4705 """ | 4907 """ |
4706 Private slot to handle the helpClosed signal of the help window. | 4908 Private slot to handle the helpClosed signal of the help window. |
4707 """ | 4909 """ |
4708 if Preferences.getHelp("SingleHelpWindow"): | 4910 if Preferences.getHelp("SingleHelpWindow"): |
4709 self.preferencesChanged.disconnect(self.helpWindow.preferencesChanged) | 4911 self.preferencesChanged.disconnect( |
4710 self.masterPasswordChanged.disconnect(self.helpWindow.masterPasswordChanged) | 4912 self.helpWindow.preferencesChanged) |
4913 self.masterPasswordChanged.disconnect( | |
4914 self.helpWindow.masterPasswordChanged) | |
4711 self.helpWindow = None | 4915 self.helpWindow = None |
4712 | 4916 |
4713 def __helpViewer(self): | 4917 def __helpViewer(self): |
4714 """ | 4918 """ |
4715 Private slot to start an empty help viewer. | 4919 Private slot to start an empty help viewer. |
4734 | 4938 |
4735 def getHelpViewer(self, preview=False): | 4939 def getHelpViewer(self, preview=False): |
4736 """ | 4940 """ |
4737 Public method to get a reference to the help window instance. | 4941 Public method to get a reference to the help window instance. |
4738 | 4942 |
4739 @keyparam preview flag indicating to get a help window for preview (boolean) | 4943 @keyparam preview flag indicating to get a help window for preview |
4944 (boolean) | |
4740 @return reference to the help window instance (HelpWindow) | 4945 @return reference to the help window instance (HelpWindow) |
4741 """ | 4946 """ |
4742 if self.helpWindow is None: | 4947 if self.helpWindow is None: |
4743 self.launchHelpViewer("", useSingle=True) | 4948 self.launchHelpViewer("", useSingle=True) |
4744 self.helpWindow.raise_() | 4949 self.helpWindow.raise_() |
4784 | 4989 |
4785 def __preferencesChanged(self): | 4990 def __preferencesChanged(self): |
4786 """ | 4991 """ |
4787 Private slot to handle a change of the preferences. | 4992 Private slot to handle a change of the preferences. |
4788 """ | 4993 """ |
4789 self.setStyle(Preferences.getUI("Style"), Preferences.getUI("StyleSheet")) | 4994 self.setStyle(Preferences.getUI("Style"), |
4995 Preferences.getUI("StyleSheet")) | |
4790 | 4996 |
4791 if Preferences.getUI("SingleApplicationMode"): | 4997 if Preferences.getUI("SingleApplicationMode"): |
4792 if self.SAServer is None: | 4998 if self.SAServer is None: |
4793 self.SAServer = E5SingleApplicationServer() | 4999 self.SAServer = E5SingleApplicationServer() |
4794 else: | 5000 else: |
4795 if self.SAServer is not None: | 5001 if self.SAServer is not None: |
4796 self.SAServer.shutdown() | 5002 self.SAServer.shutdown() |
4797 self.SAServer = None | 5003 self.SAServer = None |
4798 self.newWindowAct.setEnabled(not Preferences.getUI("SingleApplicationMode")) | 5004 self.newWindowAct.setEnabled( |
5005 not Preferences.getUI("SingleApplicationMode")) | |
4799 | 5006 |
4800 self.maxEditorPathLen = Preferences.getUI("CaptionFilenameLength") | 5007 self.maxEditorPathLen = Preferences.getUI("CaptionFilenameLength") |
4801 self.captionShowsFilename = Preferences.getUI("CaptionShowsFilename") | 5008 self.captionShowsFilename = Preferences.getUI("CaptionShowsFilename") |
4802 if not self.captionShowsFilename: | 5009 if not self.captionShowsFilename: |
4803 self.__setWindowCaption(editor="") | 5010 self.__setWindowCaption(editor="") |
4847 """ | 5054 """ |
4848 self.reloadAPIs.emit() | 5055 self.reloadAPIs.emit() |
4849 | 5056 |
4850 def __showExternalTools(self): | 5057 def __showExternalTools(self): |
4851 """ | 5058 """ |
4852 Private slot to display a dialog show a list of external tools used by eric5. | 5059 Private slot to display a dialog show a list of external tools used |
5060 by eric5. | |
4853 """ | 5061 """ |
4854 if self.programsDialog is None: | 5062 if self.programsDialog is None: |
4855 from Preferences.ProgramsDialog import ProgramsDialog | 5063 from Preferences.ProgramsDialog import ProgramsDialog |
4856 self.programsDialog = ProgramsDialog(self) | 5064 self.programsDialog = ProgramsDialog(self) |
4857 self.programsDialog.show() | 5065 self.programsDialog.show() |
4878 Private slot to configure the various toolbars. | 5086 Private slot to configure the various toolbars. |
4879 """ | 5087 """ |
4880 from E5Gui.E5ToolBarDialog import E5ToolBarDialog | 5088 from E5Gui.E5ToolBarDialog import E5ToolBarDialog |
4881 dlg = E5ToolBarDialog(self.toolbarManager) | 5089 dlg = E5ToolBarDialog(self.toolbarManager) |
4882 if dlg.exec_() == QDialog.Accepted: | 5090 if dlg.exec_() == QDialog.Accepted: |
4883 Preferences.setUI("ToolbarManagerState", self.toolbarManager.saveState()) | 5091 Preferences.setUI( |
5092 "ToolbarManagerState", self.toolbarManager.saveState()) | |
4884 | 5093 |
4885 def __configShortcuts(self): | 5094 def __configShortcuts(self): |
4886 """ | 5095 """ |
4887 Private slot to configure the keyboard shortcuts. | 5096 Private slot to configure the keyboard shortcuts. |
4888 """ | 5097 """ |
4997 """ | 5206 """ |
4998 Private slot to handle the editorOpened signal. | 5207 Private slot to handle the editorOpened signal. |
4999 | 5208 |
5000 @param fn filename of the opened editor (string) | 5209 @param fn filename of the opened editor (string) |
5001 """ | 5210 """ |
5002 self.wizardsMenuAct.setEnabled(len(self.__menus["wizards"].actions()) > 0) | 5211 self.wizardsMenuAct.setEnabled( |
5212 len(self.__menus["wizards"].actions()) > 0) | |
5003 | 5213 |
5004 if fn and str(fn) != "None": | 5214 if fn and str(fn) != "None": |
5005 dbs = e5App().getObject("DebugServer") | 5215 dbs = e5App().getObject("DebugServer") |
5006 for language in dbs.getSupportedLanguages(): | 5216 for language in dbs.getSupportedLanguages(): |
5007 exts = dbs.getExtensions(language) | 5217 exts = dbs.getExtensions(language) |
5054 f = QFile(fn) | 5264 f = QFile(fn) |
5055 ok = f.open(QIODevice.WriteOnly) | 5265 ok = f.open(QIODevice.WriteOnly) |
5056 if not ok: | 5266 if not ok: |
5057 E5MessageBox.critical(self, | 5267 E5MessageBox.critical(self, |
5058 self.trUtf8("Save tasks"), | 5268 self.trUtf8("Save tasks"), |
5059 self.trUtf8("<p>The tasks file <b>{0}</b> could not be written.</p>") | 5269 self.trUtf8( |
5270 "<p>The tasks file <b>{0}</b> could not be written.</p>") | |
5060 .format(fn)) | 5271 .format(fn)) |
5061 return | 5272 return |
5062 | 5273 |
5063 from E5XML.TasksWriter import TasksWriter | 5274 from E5XML.TasksWriter import TasksWriter |
5064 TasksWriter(f, False).writeXML() | 5275 TasksWriter(f, False).writeXML() |
5078 reader.readXML() | 5289 reader.readXML() |
5079 f.close() | 5290 f.close() |
5080 else: | 5291 else: |
5081 E5MessageBox.critical(self, | 5292 E5MessageBox.critical(self, |
5082 self.trUtf8("Read tasks"), | 5293 self.trUtf8("Read tasks"), |
5083 self.trUtf8("<p>The tasks file <b>{0}</b> could not be read.</p>") | 5294 self.trUtf8( |
5295 "<p>The tasks file <b>{0}</b> could not be read.</p>") | |
5084 .format(fn)) | 5296 .format(fn)) |
5085 | 5297 |
5086 def __writeSession(self): | 5298 def __writeSession(self): |
5087 """ | 5299 """ |
5088 Private slot to write the session data to an XML file (.e4s). | 5300 Private slot to write the session data to an XML file (.e4s). |
5094 SessionWriter(f, None).writeXML() | 5306 SessionWriter(f, None).writeXML() |
5095 f.close() | 5307 f.close() |
5096 else: | 5308 else: |
5097 E5MessageBox.critical(self, | 5309 E5MessageBox.critical(self, |
5098 self.trUtf8("Save session"), | 5310 self.trUtf8("Save session"), |
5099 self.trUtf8("<p>The session file <b>{0}</b> could not be written.</p>") | 5311 self.trUtf8( |
5312 "<p>The session file <b>{0}</b> could not be written.</p>") | |
5100 .format(fn)) | 5313 .format(fn)) |
5101 | 5314 |
5102 def __readSession(self): | 5315 def __readSession(self): |
5103 """ | 5316 """ |
5104 Private slot to read in the session file (.e4s). | 5317 Private slot to read in the session file (.e4s). |
5105 """ | 5318 """ |
5106 fn = os.path.join(Utilities.getConfigDir(), "eric5session.e4s") | 5319 fn = os.path.join(Utilities.getConfigDir(), "eric5session.e4s") |
5107 if not os.path.exists(fn): | 5320 if not os.path.exists(fn): |
5108 E5MessageBox.critical(self, | 5321 E5MessageBox.critical(self, |
5109 self.trUtf8("Read session"), | 5322 self.trUtf8("Read session"), |
5110 self.trUtf8("<p>The session file <b>{0}</b> could not be read.</p>")\ | 5323 self.trUtf8( |
5324 "<p>The session file <b>{0}</b> could not be read.</p>")\ | |
5111 .format(fn)) | 5325 .format(fn)) |
5112 return | 5326 return |
5113 | 5327 |
5114 f = QFile(fn) | 5328 f = QFile(fn) |
5115 if f.open(QIODevice.ReadOnly): | 5329 if f.open(QIODevice.ReadOnly): |
5118 reader.readXML() | 5332 reader.readXML() |
5119 f.close() | 5333 f.close() |
5120 else: | 5334 else: |
5121 E5MessageBox.critical(self, | 5335 E5MessageBox.critical(self, |
5122 self.trUtf8("Read session"), | 5336 self.trUtf8("Read session"), |
5123 self.trUtf8("<p>The session file <b>{0}</b> could not be read.</p>")\ | 5337 self.trUtf8( |
5338 "<p>The session file <b>{0}</b> could not be read.</p>")\ | |
5124 .format(fn)) | 5339 .format(fn)) |
5125 | 5340 |
5126 def showFindFileByNameDialog(self): | 5341 def showFindFileByNameDialog(self): |
5127 """ | 5342 """ |
5128 Public slot to show the Find File by Name dialog. | 5343 Public slot to show the Find File by Name dialog. |
5129 """ | 5344 """ |
5130 if self.findFileNameDialog is None: | 5345 if self.findFileNameDialog is None: |
5131 from .FindFileNameDialog import FindFileNameDialog | 5346 from .FindFileNameDialog import FindFileNameDialog |
5132 self.findFileNameDialog = FindFileNameDialog(self.project) | 5347 self.findFileNameDialog = FindFileNameDialog(self.project) |
5133 self.findFileNameDialog.sourceFile.connect(self.viewmanager.openSourceFile) | 5348 self.findFileNameDialog.sourceFile.connect( |
5349 self.viewmanager.openSourceFile) | |
5134 self.findFileNameDialog.designerFile.connect(self.__designer) | 5350 self.findFileNameDialog.designerFile.connect(self.__designer) |
5135 self.findFileNameDialog.show() | 5351 self.findFileNameDialog.show() |
5136 self.findFileNameDialog.raise_() | 5352 self.findFileNameDialog.raise_() |
5137 self.findFileNameDialog.activateWindow() | 5353 self.findFileNameDialog.activateWindow() |
5138 | 5354 |
5166 @keyparam searchDir directory to search in (string) | 5382 @keyparam searchDir directory to search in (string) |
5167 @keyparam openFiles flag indicating to operate on open files (boolean) | 5383 @keyparam openFiles flag indicating to operate on open files (boolean) |
5168 """ | 5384 """ |
5169 if self.replaceFilesDialog is None: | 5385 if self.replaceFilesDialog is None: |
5170 from .FindFileDialog import FindFileDialog | 5386 from .FindFileDialog import FindFileDialog |
5171 self.replaceFilesDialog = FindFileDialog(self.project, replaceMode=True) | 5387 self.replaceFilesDialog = \ |
5388 FindFileDialog(self.project, replaceMode=True) | |
5172 self.replaceFilesDialog.sourceFile.connect( | 5389 self.replaceFilesDialog.sourceFile.connect( |
5173 self.viewmanager.openSourceFile) | 5390 self.viewmanager.openSourceFile) |
5174 self.replaceFilesDialog.designerFile.connect(self.__designer) | 5391 self.replaceFilesDialog.designerFile.connect(self.__designer) |
5175 if searchDir: | 5392 if searchDir: |
5176 self.replaceFilesDialog.setSearchDirectory(searchDir) | 5393 self.replaceFilesDialog.setSearchDirectory(searchDir) |
5378 Preferences.setGeometry("MainMaximized", self.isMaximized()) | 5595 Preferences.setGeometry("MainMaximized", self.isMaximized()) |
5379 if not self.isMaximized(): | 5596 if not self.isMaximized(): |
5380 Preferences.setGeometry("MainGeometry", self.saveGeometry()) | 5597 Preferences.setGeometry("MainGeometry", self.saveGeometry()) |
5381 self.browser.saveToplevelDirs() | 5598 self.browser.saveToplevelDirs() |
5382 | 5599 |
5383 Preferences.setUI("ToolbarManagerState", self.toolbarManager.saveState()) | 5600 Preferences.setUI( |
5601 "ToolbarManagerState", self.toolbarManager.saveState()) | |
5384 self.__saveCurrentViewProfile(True) | 5602 self.__saveCurrentViewProfile(True) |
5385 Preferences.saveToolGroups(self.toolGroups, self.currentToolGroup) | 5603 Preferences.saveToolGroups(self.toolGroups, self.currentToolGroup) |
5386 Preferences.syncPreferences() | 5604 Preferences.syncPreferences() |
5387 self.shutdownCalled = True | 5605 self.shutdownCalled = True |
5388 return True | 5606 return True |
5395 """ | 5613 """ |
5396 Public method to show the eric5 versions available for download. | 5614 Public method to show the eric5 versions available for download. |
5397 """ | 5615 """ |
5398 self.performVersionCheck(manual=True, showVersions=True) | 5616 self.performVersionCheck(manual=True, showVersions=True) |
5399 | 5617 |
5400 def performVersionCheck(self, manual=True, alternative=0, showVersions=False): | 5618 def performVersionCheck(self, manual=True, alternative=0, |
5619 showVersions=False): | |
5401 """ | 5620 """ |
5402 Public method to check the internet for an eric5 update. | 5621 Public method to check the internet for an eric5 update. |
5403 | 5622 |
5404 @param manual flag indicating an invocation via the menu (boolean) | 5623 @param manual flag indicating an invocation via the menu (boolean) |
5405 @param alternative index of server to download from (integer) | 5624 @param alternative index of server to download from (integer) |
5496 self.trUtf8("""The versions information could not be""" | 5715 self.trUtf8("""The versions information could not be""" |
5497 """ downloaded for the last 7 days.""" | 5716 """ downloaded for the last 7 days.""" |
5498 """ Please go online and try again.""")) | 5717 """ Please go online and try again.""")) |
5499 return | 5718 return |
5500 else: | 5719 else: |
5501 self.performVersionCheck(self.manualUpdatesCheck, self.httpAlternative, | 5720 self.performVersionCheck(self.manualUpdatesCheck, |
5502 self.showAvailableVersions) | 5721 self.httpAlternative, |
5722 self.showAvailableVersions) | |
5503 return | 5723 return |
5504 | 5724 |
5505 self.__inVersionCheck = False | 5725 self.__inVersionCheck = False |
5506 if self.__versionCheckProgress is not None: | 5726 if self.__versionCheckProgress is not None: |
5507 self.__versionCheckProgress.reset() | 5727 self.__versionCheckProgress.reset() |
5515 "Updates/LastCheckDate", QDate.currentDate()) | 5735 "Updates/LastCheckDate", QDate.currentDate()) |
5516 self.__versionCheckResult(versions) | 5736 self.__versionCheckResult(versions) |
5517 | 5737 |
5518 def __updateVersionsUrls(self, versions): | 5738 def __updateVersionsUrls(self, versions): |
5519 """ | 5739 """ |
5520 Private method to update the URLs from which to retrieve the versions file. | 5740 Private method to update the URLs from which to retrieve the versions |
5521 | 5741 file. |
5522 @param versions contents of the downloaded versions file (list of strings) | 5742 |
5743 @param versions contents of the downloaded versions file (list of | |
5744 strings) | |
5523 """ | 5745 """ |
5524 if len(versions) > 5 and versions[4] == "---": | 5746 if len(versions) > 5 and versions[4] == "---": |
5525 line = 5 | 5747 line = 5 |
5526 urls = [] | 5748 urls = [] |
5527 while line < len(versions): | 5749 while line < len(versions): |
5532 | 5754 |
5533 def __versionCheckResult(self, versions): | 5755 def __versionCheckResult(self, versions): |
5534 """ | 5756 """ |
5535 Private method to show the result of the version check action. | 5757 Private method to show the result of the version check action. |
5536 | 5758 |
5537 @param versions contents of the downloaded versions file (list of strings) | 5759 @param versions contents of the downloaded versions file (list of |
5760 strings) | |
5538 """ | 5761 """ |
5539 url = "" | 5762 url = "" |
5540 try: | 5763 try: |
5541 if "-snapshot-" in Version: | 5764 if "-snapshot-" in Version: |
5542 # check snapshot version | 5765 # check snapshot version |
5543 if versions[2][0] == "5" and versions[2] > Version: | 5766 if versions[2][0] == "5" and versions[2] > Version: |
5544 res = E5MessageBox.yesNo(self, | 5767 res = E5MessageBox.yesNo( |
5768 self, | |
5545 self.trUtf8("Update available"), | 5769 self.trUtf8("Update available"), |
5546 self.trUtf8("""The update to <b>{0}</b> of eric5 is available""" | 5770 self.trUtf8( |
5547 """ at <b>{1}</b>. Would you like to get it?""")\ | 5771 """The update to <b>{0}</b> of eric5 is""" |
5772 """ available at <b>{1}</b>. Would you like to""" | |
5773 """ get it?""")\ | |
5548 .format(versions[2], versions[3]), | 5774 .format(versions[2], versions[3]), |
5549 yesDefault=True) | 5775 yesDefault=True) |
5550 url = res and versions[3] or '' | 5776 url = res and versions[3] or '' |
5551 elif versions[0] > Version: | 5777 elif versions[0] > Version: |
5552 res = E5MessageBox.yesNo(self, | 5778 res = E5MessageBox.yesNo( |
5779 self, | |
5553 self.trUtf8("Update available"), | 5780 self.trUtf8("Update available"), |
5554 self.trUtf8("""The update to <b>{0}</b> of eric5 is available""" | 5781 self.trUtf8( |
5555 """ at <b>{1}</b>. Would you like to get it?""")\ | 5782 """The update to <b>{0}</b> of eric5 is""" |
5783 """ available at <b>{1}</b>. Would you like to""" | |
5784 """ get it?""")\ | |
5556 .format(versions[0], versions[1]), | 5785 .format(versions[0], versions[1]), |
5557 yesDefault=True) | 5786 yesDefault=True) |
5558 url = res and versions[1] or '' | 5787 url = res and versions[1] or '' |
5559 else: | 5788 else: |
5560 if self.manualUpdatesCheck: | 5789 if self.manualUpdatesCheck: |
5561 E5MessageBox.information(self, | 5790 E5MessageBox.information( |
5791 self, | |
5562 self.trUtf8("Eric5 is up to date"), | 5792 self.trUtf8("Eric5 is up to date"), |
5563 self.trUtf8("""You are using the latest version of eric5""")) | 5793 self.trUtf8( |
5794 """You are using the latest version of""" | |
5795 """ eric5""")) | |
5564 else: | 5796 else: |
5565 # check release version | 5797 # check release version |
5566 if versions[0] > Version: | 5798 if versions[0] > Version: |
5567 res = E5MessageBox.yesNo(self, | 5799 res = E5MessageBox.yesNo( |
5800 self, | |
5568 self.trUtf8("Update available"), | 5801 self.trUtf8("Update available"), |
5569 self.trUtf8("""The update to <b>{0}</b> of eric5 is available""" | 5802 self.trUtf8( |
5570 """ at <b>{1}</b>. Would you like to get it?""")\ | 5803 """The update to <b>{0}</b> of eric5 is""" |
5804 """ available at <b>{1}</b>. Would you like""" | |
5805 """ to get it?""")\ | |
5571 .format(versions[0], versions[1]), | 5806 .format(versions[0], versions[1]), |
5572 yesDefault=True) | 5807 yesDefault=True) |
5573 url = res and versions[1] or '' | 5808 url = res and versions[1] or '' |
5574 else: | 5809 else: |
5575 if self.manualUpdatesCheck: | 5810 if self.manualUpdatesCheck: |
5576 E5MessageBox.information(self, | 5811 E5MessageBox.information( |
5812 self, | |
5577 self.trUtf8("Eric5 is up to date"), | 5813 self.trUtf8("Eric5 is up to date"), |
5578 self.trUtf8("""You are using the latest version of eric5""")) | 5814 self.trUtf8( |
5815 """You are using the latest version of""" | |
5816 """ eric5""")) | |
5579 except IndexError: | 5817 except IndexError: |
5580 E5MessageBox.warning(self, | 5818 E5MessageBox.warning(self, |
5581 self.trUtf8("Error during updates check"), | 5819 self.trUtf8("Error during updates check"), |
5582 self.trUtf8("""Could not perform updates check.""")) | 5820 self.trUtf8("""Could not perform updates check.""")) |
5583 | 5821 |
5594 | 5832 |
5595 def __showAvailableVersionInfos(self, versions): | 5833 def __showAvailableVersionInfos(self, versions): |
5596 """ | 5834 """ |
5597 Private method to show the versions available for download. | 5835 Private method to show the versions available for download. |
5598 | 5836 |
5599 @param versions contents of the downloaded versions file (list of strings) | 5837 @param versions contents of the downloaded versions file (list of |
5838 strings) | |
5600 """ | 5839 """ |
5601 versionText = self.trUtf8( | 5840 versionText = self.trUtf8( |
5602 """<h3>Available versions</h3>""" | 5841 """<h3>Available versions</h3>""" |
5603 """<table>""") | 5842 """<table>""") |
5604 line = 0 | 5843 line = 0 |
5605 while line < len(versions): | 5844 while line < len(versions): |
5606 if versions[line] == "---": | 5845 if versions[line] == "---": |
5607 break | 5846 break |
5608 | 5847 |
5609 versionText += """<tr><td>{0}</td><td><a href="{1}">{2}</a></td></tr>"""\ | 5848 versionText += """<tr><td>{0}</td><td><a href="{1}">{2}</a>""" \ |
5610 .format(versions[line], versions[line + 1], | 5849 """</td></tr>""".format( |
5850 versions[line], versions[line + 1], | |
5611 'sourceforge' in versions[line + 1] and \ | 5851 'sourceforge' in versions[line + 1] and \ |
5612 "SourceForge" or versions[line + 1]) | 5852 "SourceForge" or versions[line + 1]) |
5613 line += 2 | 5853 line += 2 |
5614 versionText += self.trUtf8("""</table>""") | 5854 versionText += self.trUtf8("""</table>""") |
5615 | 5855 |
5668 Public method to check, if the eric5 version is good compared to | 5908 Public method to check, if the eric5 version is good compared to |
5669 the required version. | 5909 the required version. |
5670 | 5910 |
5671 @param required required version (string) | 5911 @param required required version (string) |
5672 @param snapshot required snapshot version (string) | 5912 @param snapshot required snapshot version (string) |
5673 @return flag indicating, that the version is newer than the required one | 5913 @return flag indicating, that the version is newer than the required |
5674 (boolean) | 5914 one (boolean) |
5675 """ | 5915 """ |
5676 if Version.startswith("@@"): | 5916 if Version.startswith("@@"): |
5677 # development version, always newer | 5917 # development version, always newer |
5678 return True | 5918 return True |
5679 | 5919 |
5734 from .NotificationWidget import NotificationWidget | 5974 from .NotificationWidget import NotificationWidget |
5735 self.__notification = NotificationWidget(parent=self) | 5975 self.__notification = NotificationWidget(parent=self) |
5736 self.__notification.setPixmap(icon) | 5976 self.__notification.setPixmap(icon) |
5737 self.__notification.setHeading(heading) | 5977 self.__notification.setHeading(heading) |
5738 self.__notification.setText(text) | 5978 self.__notification.setText(text) |
5739 self.__notification.setTimeout(Preferences.getUI("NotificationTimeout")) | 5979 self.__notification.setTimeout( |
5980 Preferences.getUI("NotificationTimeout")) | |
5740 self.__notification.move(Preferences.getUI("NotificationPosition")) | 5981 self.__notification.move(Preferences.getUI("NotificationPosition")) |
5741 self.__notification.show() | 5982 self.__notification.show() |
5742 | 5983 |
5743 def notificationsEnabled(self): | 5984 def notificationsEnabled(self): |
5744 """ | 5985 """ |