3056:9986ec0e559a | 3057:10516539f238 |
---|---|
15 | 15 |
16 import os | 16 import os |
17 import sys | 17 import sys |
18 import logging | 18 import logging |
19 | 19 |
20 from PyQt4.QtCore import QTimer, QFile, QFileInfo, pyqtSignal, PYQT_VERSION_STR, QDate, \ | 20 from PyQt4.QtCore import QTimer, QFile, QFileInfo, pyqtSignal, \ |
21 QIODevice, qVersion, QProcess, QSize, QUrl, QObject, Qt | 21 PYQT_VERSION_STR, QDate, QIODevice, qVersion, QProcess, QSize, QUrl, \ |
22 QObject, Qt | |
22 from PyQt4.QtGui import QSizePolicy, QWidget, QKeySequence, QDesktopServices, \ | 23 from PyQt4.QtGui import QSizePolicy, QWidget, QKeySequence, QDesktopServices, \ |
23 QWhatsThis, QToolBar, QDialog, QSplitter, QApplication, QMenu, QProgressDialog, \ | 24 QWhatsThis, QToolBar, QDialog, QSplitter, QApplication, QMenu, \ |
24 QVBoxLayout, QDockWidget, QAction, QLabel | 25 QProgressDialog, QVBoxLayout, QDockWidget, QAction, QLabel |
25 from PyQt4.Qsci import QSCINTILLA_VERSION_STR | 26 from PyQt4.Qsci import QSCINTILLA_VERSION_STR |
26 from PyQt4.QtNetwork import QNetworkProxyFactory, QNetworkAccessManager, \ | 27 from PyQt4.QtNetwork import QNetworkProxyFactory, QNetworkAccessManager, \ |
27 QNetworkRequest, QNetworkReply | 28 QNetworkRequest, QNetworkReply |
28 | 29 |
29 from .Info import Version, BugAddress, Program, FeatureAddress | 30 from .Info import Version, BugAddress, Program, FeatureAddress |
53 from eric5config import getConfig | 54 from eric5config import getConfig |
54 | 55 |
55 | 56 |
56 class Redirector(QObject): | 57 class Redirector(QObject): |
57 """ | 58 """ |
58 Helper class used to redirect stdout and stderr to the log window | 59 Helper class used to redirect stdout and stderr to the log window. |
59 | 60 |
60 @signal appendStderr(str) emitted to write data to stderr logger | 61 @signal appendStderr(str) emitted to write data to stderr logger |
61 @signal appendStdout(str) emitted to write data to stdout logger | 62 @signal appendStdout(str) emitted to write data to stdout logger |
62 """ | 63 """ |
63 appendStderr = pyqtSignal(str) | 64 appendStderr = pyqtSignal(str) |
89 | 90 |
90 def __bufferedWrite(self): | 91 def __bufferedWrite(self): |
91 """ | 92 """ |
92 Private method returning number of characters to write. | 93 Private method returning number of characters to write. |
93 | 94 |
94 @return number of characters buffered or length of buffered line (integer) | 95 @return number of characters buffered or length of buffered line |
96 (integer) | |
95 """ | 97 """ |
96 return self.buffer.rfind('\n') + 1 | 98 return self.buffer.rfind('\n') + 1 |
97 | 99 |
98 def flush(self): | 100 def flush(self): |
99 """ | 101 """ |
117 | 119 |
118 @signal appendStderr(str) emitted to write data to stderr logger | 120 @signal appendStderr(str) emitted to write data to stderr logger |
119 @signal appendStdout(str) emitted to write data to stdout logger | 121 @signal appendStdout(str) emitted to write data to stdout logger |
120 @signal preferencesChanged() emitted after the preferences were changed | 122 @signal preferencesChanged() emitted after the preferences were changed |
121 @signal reloadAPIs() emitted to reload the api information | 123 @signal reloadAPIs() emitted to reload the api information |
122 @signal showMenu(str, QMenu) emitted when a menu is about to be shown. The name | 124 @signal showMenu(str, QMenu) emitted when a menu is about to be shown. The |
123 of the menu and a reference to the menu are given. | 125 name of the menu and a reference to the menu are given. |
124 @signal masterPasswordChanged(str, str) emitted after the master | 126 @signal masterPasswordChanged(str, str) emitted after the master |
125 password has been changed with the old and the new password | 127 password has been changed with the old and the new password |
126 """ | 128 """ |
127 appendStderr = pyqtSignal(str) | 129 appendStderr = pyqtSignal(str) |
128 appendStdout = pyqtSignal(str) | 130 appendStdout = pyqtSignal(str) |
129 preferencesChanged = pyqtSignal() | 131 preferencesChanged = pyqtSignal() |
130 reloadAPIs = pyqtSignal() | 132 reloadAPIs = pyqtSignal() |
136 | 138 |
137 LeftSide = 1 | 139 LeftSide = 1 |
138 BottomSide = 2 | 140 BottomSide = 2 |
139 RightSide = 3 | 141 RightSide = 3 |
140 | 142 |
141 def __init__(self, app, locale, splash, plugin, noOpenAtStartup, restartArguments): | 143 def __init__(self, app, locale, splash, plugin, noOpenAtStartup, |
144 restartArguments): | |
142 """ | 145 """ |
143 Constructor | 146 Constructor |
144 | 147 |
145 @param app reference to the application object (E5Application) | 148 @param app reference to the application object (E5Application) |
146 @param locale locale to be used by the UI (string) | 149 @param locale locale to be used by the UI (string) |
147 @param splash reference to the splashscreen (UI.SplashScreen.SplashScreen) | 150 @param splash reference to the splashscreen |
148 @param plugin filename of a plugin to be loaded (used for plugin development) | 151 (UI.SplashScreen.SplashScreen) |
152 @param plugin filename of a plugin to be loaded (used for plugin | |
153 development) | |
149 @param noOpenAtStartup flag indicating that the open at startup option | 154 @param noOpenAtStartup flag indicating that the open at startup option |
150 should not be executed (boolean) | 155 should not be executed (boolean) |
151 @param restartArguments list of command line parameters to be used for a | 156 @param restartArguments list of command line parameters to be used for |
152 restart (list of strings) | 157 a restart (list of strings) |
153 """ | 158 """ |
154 super(UserInterface, self).__init__() | 159 super(UserInterface, self).__init__() |
155 self.setAttribute(Qt.WA_DeleteOnClose) | 160 self.setAttribute(Qt.WA_DeleteOnClose) |
156 | 161 |
157 self.__restartArgs = restartArguments[:] | 162 self.__restartArgs = restartArguments[:] |
158 | 163 |
159 self.setStyle(Preferences.getUI("Style"), Preferences.getUI("StyleSheet")) | 164 self.setStyle(Preferences.getUI("Style"), |
165 Preferences.getUI("StyleSheet")) | |
160 | 166 |
161 self.maxEditorPathLen = Preferences.getUI("CaptionFilenameLength") | 167 self.maxEditorPathLen = Preferences.getUI("CaptionFilenameLength") |
162 self.locale = locale | 168 self.locale = locale |
163 self.__noOpenAtStartup = noOpenAtStartup | 169 self.__noOpenAtStartup = noOpenAtStartup |
164 | 170 |
246 self.browser.sourceFile[str, int, str].connect( | 252 self.browser.sourceFile[str, int, str].connect( |
247 self.viewmanager.openSourceFile) | 253 self.viewmanager.openSourceFile) |
248 self.browser.designerFile.connect(self.__designer) | 254 self.browser.designerFile.connect(self.__designer) |
249 self.browser.linguistFile.connect(self.__linguist4) | 255 self.browser.linguistFile.connect(self.__linguist4) |
250 self.browser.projectFile.connect(self.project.openProject) | 256 self.browser.projectFile.connect(self.project.openProject) |
251 self.browser.multiProjectFile.connect(self.multiProject.openMultiProject) | 257 self.browser.multiProjectFile.connect( |
258 self.multiProject.openMultiProject) | |
252 self.browser.pixmapEditFile.connect(self.__editPixmap) | 259 self.browser.pixmapEditFile.connect(self.__editPixmap) |
253 self.browser.pixmapFile.connect(self.__showPixmap) | 260 self.browser.pixmapFile.connect(self.__showPixmap) |
254 self.browser.svgFile.connect(self.__showSvg) | 261 self.browser.svgFile.connect(self.__showSvg) |
255 self.browser.unittestOpen.connect(self.__unittestScript) | 262 self.browser.unittestOpen.connect(self.__unittestScript) |
256 self.browser.trpreview.connect(self.__TRPreviewer) | 263 self.browser.trpreview.connect(self.__TRPreviewer) |
268 self.viewmanager.openSourceFile) | 275 self.viewmanager.openSourceFile) |
269 self.projectBrowser.psBrowser.sourceFile[str, int, str].connect( | 276 self.projectBrowser.psBrowser.sourceFile[str, int, str].connect( |
270 self.viewmanager.openSourceFile) | 277 self.viewmanager.openSourceFile) |
271 self.projectBrowser.psBrowser.closeSourceWindow.connect( | 278 self.projectBrowser.psBrowser.closeSourceWindow.connect( |
272 self.viewmanager.closeWindow) | 279 self.viewmanager.closeWindow) |
273 self.projectBrowser.psBrowser.unittestOpen.connect(self.__unittestScript) | 280 self.projectBrowser.psBrowser.unittestOpen.connect( |
281 self.__unittestScript) | |
274 | 282 |
275 self.projectBrowser.pfBrowser.designerFile.connect(self.__designer) | 283 self.projectBrowser.pfBrowser.designerFile.connect(self.__designer) |
276 self.projectBrowser.pfBrowser.sourceFile.connect( | 284 self.projectBrowser.pfBrowser.sourceFile.connect( |
277 self.viewmanager.openSourceFile) | 285 self.viewmanager.openSourceFile) |
278 self.projectBrowser.pfBrowser.uipreview.connect(self.__UIPreviewer) | 286 self.projectBrowser.pfBrowser.uipreview.connect(self.__UIPreviewer) |
288 self.projectBrowser.prBrowser.appendStderr.connect(self.appendToStderr) | 296 self.projectBrowser.prBrowser.appendStderr.connect(self.appendToStderr) |
289 | 297 |
290 self.projectBrowser.ptBrowser.linguistFile.connect(self.__linguist4) | 298 self.projectBrowser.ptBrowser.linguistFile.connect(self.__linguist4) |
291 self.projectBrowser.ptBrowser.sourceFile.connect( | 299 self.projectBrowser.ptBrowser.sourceFile.connect( |
292 self.viewmanager.openSourceFile) | 300 self.viewmanager.openSourceFile) |
293 self.projectBrowser.ptBrowser.trpreview[list].connect(self.__TRPreviewer) | 301 self.projectBrowser.ptBrowser.trpreview[list].connect( |
294 self.projectBrowser.ptBrowser.trpreview[list, bool].connect(self.__TRPreviewer) | 302 self.__TRPreviewer) |
303 self.projectBrowser.ptBrowser.trpreview[list, bool].connect( | |
304 self.__TRPreviewer) | |
295 self.projectBrowser.ptBrowser.closeSourceWindow.connect( | 305 self.projectBrowser.ptBrowser.closeSourceWindow.connect( |
296 self.viewmanager.closeWindow) | 306 self.viewmanager.closeWindow) |
297 self.projectBrowser.ptBrowser.appendStdout.connect(self.appendToStdout) | 307 self.projectBrowser.ptBrowser.appendStdout.connect(self.appendToStdout) |
298 self.projectBrowser.ptBrowser.appendStderr.connect(self.appendToStderr) | 308 self.projectBrowser.ptBrowser.appendStderr.connect(self.appendToStderr) |
299 | 309 |
315 self.projectBrowser.poBrowser.svgFile.connect(self.__showSvg) | 325 self.projectBrowser.poBrowser.svgFile.connect(self.__showSvg) |
316 | 326 |
317 self.project.sourceFile.connect(self.viewmanager.openSourceFile) | 327 self.project.sourceFile.connect(self.viewmanager.openSourceFile) |
318 self.project.projectOpened.connect(self.viewmanager.projectOpened) | 328 self.project.projectOpened.connect(self.viewmanager.projectOpened) |
319 self.project.projectClosed.connect(self.viewmanager.projectClosed) | 329 self.project.projectClosed.connect(self.viewmanager.projectClosed) |
320 self.project.projectFileRenamed.connect(self.viewmanager.projectFileRenamed) | 330 self.project.projectFileRenamed.connect( |
331 self.viewmanager.projectFileRenamed) | |
321 self.project.lexerAssociationsChanged.connect( | 332 self.project.lexerAssociationsChanged.connect( |
322 self.viewmanager.projectLexerAssociationsChanged) | 333 self.viewmanager.projectLexerAssociationsChanged) |
323 self.project.newProject.connect(self.__newProject) | 334 self.project.newProject.connect(self.__newProject) |
324 self.project.projectOpened.connect(self.__projectOpened) | 335 self.project.projectOpened.connect(self.__projectOpened) |
325 self.project.projectOpened.connect(self.__activateProjectBrowser) | 336 self.project.projectOpened.connect(self.__activateProjectBrowser) |
326 self.project.projectClosed.connect(self.__projectClosed) | 337 self.project.projectClosed.connect(self.__projectClosed) |
327 | 338 |
328 self.multiProject.multiProjectOpened.connect(self.__activateMultiProjectBrowser) | 339 self.multiProject.multiProjectOpened.connect( |
340 self.__activateMultiProjectBrowser) | |
329 | 341 |
330 self.debuggerUI.resetUI.connect(self.viewmanager.handleResetUI) | 342 self.debuggerUI.resetUI.connect(self.viewmanager.handleResetUI) |
331 self.debuggerUI.resetUI.connect(self.debugViewer.handleResetUI) | 343 self.debuggerUI.resetUI.connect(self.debugViewer.handleResetUI) |
332 self.debuggerUI.resetUI.connect(self.__debuggingDone) | 344 self.debuggerUI.resetUI.connect(self.__debuggingDone) |
333 self.debuggerUI.debuggingStarted.connect(self.browser.handleProgramChange) | 345 self.debuggerUI.debuggingStarted.connect( |
346 self.browser.handleProgramChange) | |
334 self.debuggerUI.debuggingStarted.connect( | 347 self.debuggerUI.debuggingStarted.connect( |
335 self.debugViewer.exceptionLogger.debuggingStarted) | 348 self.debugViewer.exceptionLogger.debuggingStarted) |
336 self.debuggerUI.debuggingStarted.connect(self.debugViewer.handleDebuggingStarted) | 349 self.debuggerUI.debuggingStarted.connect( |
350 self.debugViewer.handleDebuggingStarted) | |
337 self.debuggerUI.debuggingStarted.connect(self.__programChange) | 351 self.debuggerUI.debuggingStarted.connect(self.__programChange) |
338 self.debuggerUI.debuggingStarted.connect(self.__debuggingStarted) | 352 self.debuggerUI.debuggingStarted.connect(self.__debuggingStarted) |
339 self.debuggerUI.compileForms.connect( | 353 self.debuggerUI.compileForms.connect( |
340 self.projectBrowser.pfBrowser.compileChangedForms) | 354 self.projectBrowser.pfBrowser.compileChangedForms) |
341 self.debuggerUI.compileResources.connect( | 355 self.debuggerUI.compileResources.connect( |
342 self.projectBrowser.prBrowser.compileChangedResources) | 356 self.projectBrowser.prBrowser.compileChangedResources) |
343 self.debuggerUI.appendStdout.connect(self.appendToStdout) | 357 self.debuggerUI.appendStdout.connect(self.appendToStdout) |
344 | 358 |
345 debugServer.passiveDebugStarted.connect( | 359 debugServer.passiveDebugStarted.connect( |
346 self.debugViewer.exceptionLogger.debuggingStarted) | 360 self.debugViewer.exceptionLogger.debuggingStarted) |
347 debugServer.passiveDebugStarted.connect(self.debugViewer.handleDebuggingStarted) | 361 debugServer.passiveDebugStarted.connect( |
348 debugServer.clientException.connect(self.debugViewer.exceptionLogger.addException) | 362 self.debugViewer.handleDebuggingStarted) |
363 debugServer.clientException.connect( | |
364 self.debugViewer.exceptionLogger.addException) | |
349 debugServer.clientLine.connect( | 365 debugServer.clientLine.connect( |
350 self.debugViewer.breakpointViewer.highlightBreakpoint) | 366 self.debugViewer.breakpointViewer.highlightBreakpoint) |
351 debugServer.clientProcessStdout.connect(self.appendToStdout) | 367 debugServer.clientProcessStdout.connect(self.appendToStdout) |
352 debugServer.clientProcessStderr.connect(self.appendToStderr) | 368 debugServer.clientProcessStderr.connect(self.appendToStderr) |
353 | 369 |
359 self.preferencesChanged.connect(self.logViewer.preferencesChanged) | 375 self.preferencesChanged.connect(self.logViewer.preferencesChanged) |
360 self.appendStdout.connect(self.logViewer.appendToStdout) | 376 self.appendStdout.connect(self.logViewer.appendToStdout) |
361 self.appendStderr.connect(self.logViewer.appendToStderr) | 377 self.appendStderr.connect(self.logViewer.appendToStderr) |
362 self.preferencesChanged.connect(self.shell.handlePreferencesChanged) | 378 self.preferencesChanged.connect(self.shell.handlePreferencesChanged) |
363 self.preferencesChanged.connect(self.project.handlePreferencesChanged) | 379 self.preferencesChanged.connect(self.project.handlePreferencesChanged) |
364 self.preferencesChanged.connect(self.projectBrowser.handlePreferencesChanged) | 380 self.preferencesChanged.connect( |
381 self.projectBrowser.handlePreferencesChanged) | |
365 self.preferencesChanged.connect( | 382 self.preferencesChanged.connect( |
366 self.projectBrowser.psBrowser.handlePreferencesChanged) | 383 self.projectBrowser.psBrowser.handlePreferencesChanged) |
367 self.preferencesChanged.connect( | 384 self.preferencesChanged.connect( |
368 self.projectBrowser.pfBrowser.handlePreferencesChanged) | 385 self.projectBrowser.pfBrowser.handlePreferencesChanged) |
369 self.preferencesChanged.connect( | 386 self.preferencesChanged.connect( |
373 self.preferencesChanged.connect( | 390 self.preferencesChanged.connect( |
374 self.projectBrowser.piBrowser.handlePreferencesChanged) | 391 self.projectBrowser.piBrowser.handlePreferencesChanged) |
375 self.preferencesChanged.connect( | 392 self.preferencesChanged.connect( |
376 self.projectBrowser.poBrowser.handlePreferencesChanged) | 393 self.projectBrowser.poBrowser.handlePreferencesChanged) |
377 self.preferencesChanged.connect(self.browser.handlePreferencesChanged) | 394 self.preferencesChanged.connect(self.browser.handlePreferencesChanged) |
378 self.preferencesChanged.connect(self.taskViewer.handlePreferencesChanged) | 395 self.preferencesChanged.connect( |
396 self.taskViewer.handlePreferencesChanged) | |
379 self.preferencesChanged.connect(self.pluginManager.preferencesChanged) | 397 self.preferencesChanged.connect(self.pluginManager.preferencesChanged) |
380 self.preferencesChanged.connect(debugServer.preferencesChanged) | 398 self.preferencesChanged.connect(debugServer.preferencesChanged) |
381 self.preferencesChanged.connect(self.debugViewer.preferencesChanged) | 399 self.preferencesChanged.connect(self.debugViewer.preferencesChanged) |
382 self.preferencesChanged.connect(self.cooperation.preferencesChanged) | 400 self.preferencesChanged.connect(self.cooperation.preferencesChanged) |
383 | 401 |
384 self.viewmanager.editorSaved.connect(self.project.repopulateItem) | 402 self.viewmanager.editorSaved.connect(self.project.repopulateItem) |
385 self.viewmanager.lastEditorClosed.connect(self.__lastEditorClosed) | 403 self.viewmanager.lastEditorClosed.connect(self.__lastEditorClosed) |
386 self.viewmanager.editorOpened.connect(self.__editorOpened) | 404 self.viewmanager.editorOpened.connect(self.__editorOpened) |
387 self.viewmanager.changeCaption.connect(self.__setWindowCaption) | 405 self.viewmanager.changeCaption.connect(self.__setWindowCaption) |
388 self.viewmanager.checkActions.connect(self.__checkActions) | 406 self.viewmanager.checkActions.connect(self.__checkActions) |
389 self.viewmanager.editorChanged.connect(self.projectBrowser.handleEditorChanged) | 407 self.viewmanager.editorChanged.connect( |
408 self.projectBrowser.handleEditorChanged) | |
390 self.viewmanager.editorLineChanged.connect( | 409 self.viewmanager.editorLineChanged.connect( |
391 self.projectBrowser.handleEditorLineChanged) | 410 self.projectBrowser.handleEditorLineChanged) |
392 self.viewmanager.checkActions.connect(self.cooperation.checkEditorActions) | 411 self.viewmanager.checkActions.connect( |
412 self.cooperation.checkEditorActions) | |
393 | 413 |
394 self.shell.zoomValueChanged.connect(self.viewmanager.zoomValueChanged) | 414 self.shell.zoomValueChanged.connect(self.viewmanager.zoomValueChanged) |
395 | 415 |
396 self.cooperation.shareEditor.connect(self.viewmanager.shareEditor) | 416 self.cooperation.shareEditor.connect(self.viewmanager.shareEditor) |
397 self.cooperation.startEdit.connect(self.viewmanager.startSharedEdit) | 417 self.cooperation.startEdit.connect(self.viewmanager.startSharedEdit) |
417 self.toolProcs = [] | 437 self.toolProcs = [] |
418 self.__initExternalToolsActions() | 438 self.__initExternalToolsActions() |
419 | 439 |
420 # create a dummy help window for shortcuts handling | 440 # create a dummy help window for shortcuts handling |
421 from Helpviewer.HelpWindow import HelpWindow | 441 from Helpviewer.HelpWindow import HelpWindow |
422 self.dummyHelpViewer = HelpWindow(None, '.', None, 'help viewer', True, True) | 442 self.dummyHelpViewer = \ |
443 HelpWindow(None, '.', None, 'help viewer', True, True) | |
423 | 444 |
424 # register all relevant objects | 445 # register all relevant objects |
425 splash.showMessage(self.trUtf8("Registering Objects...")) | 446 splash.showMessage(self.trUtf8("Registering Objects...")) |
426 e5App().registerObject("UserInterface", self) | 447 e5App().registerObject("UserInterface", self) |
427 e5App().registerObject("DebugUI", self.debuggerUI) | 448 e5App().registerObject("DebugUI", self.debuggerUI) |
473 ## sys.stdout = self.stdout | 494 ## sys.stdout = self.stdout |
474 ## sys.stderr = self.stderr | 495 ## sys.stderr = self.stderr |
475 | 496 |
476 # now fire up the single application server | 497 # now fire up the single application server |
477 if Preferences.getUI("SingleApplicationMode"): | 498 if Preferences.getUI("SingleApplicationMode"): |
478 splash.showMessage(self.trUtf8("Initializing Single Application Server...")) | 499 splash.showMessage( |
500 self.trUtf8("Initializing Single Application Server...")) | |
479 self.SAServer = E5SingleApplicationServer() | 501 self.SAServer = E5SingleApplicationServer() |
480 else: | 502 else: |
481 self.SAServer = None | 503 self.SAServer = None |
482 | 504 |
483 # now finalize the plugin manager setup | 505 # now finalize the plugin manager setup |
490 from Preferences import Shortcuts | 512 from Preferences import Shortcuts |
491 Shortcuts.readShortcuts() | 513 Shortcuts.readShortcuts() |
492 | 514 |
493 # restore toolbar manager state | 515 # restore toolbar manager state |
494 splash.showMessage(self.trUtf8("Restoring Toolbarmanager...")) | 516 splash.showMessage(self.trUtf8("Restoring Toolbarmanager...")) |
495 self.toolbarManager.restoreState(Preferences.getUI("ToolbarManagerState")) | 517 self.toolbarManager.restoreState( |
518 Preferences.getUI("ToolbarManagerState")) | |
496 | 519 |
497 # now activate the initial view profile | 520 # now activate the initial view profile |
498 splash.showMessage(self.trUtf8("Setting View Profile...")) | 521 splash.showMessage(self.trUtf8("Setting View Profile...")) |
499 self.__setEditProfile() | 522 self.__setEditProfile() |
500 | 523 |
538 def __createLayout(self, debugServer): | 561 def __createLayout(self, debugServer): |
539 """ | 562 """ |
540 Private method to create the layout of the various windows. | 563 Private method to create the layout of the various windows. |
541 | 564 |
542 @param debugServer reference to the debug server object | 565 @param debugServer reference to the debug server object |
566 @exception ValueError raised to indicate an invalid layout type | |
543 """ | 567 """ |
544 # Create the view manager depending on the configuration setting | 568 # Create the view manager depending on the configuration setting |
545 logging.debug("Creating Viewmanager...") | 569 logging.debug("Creating Viewmanager...") |
546 import ViewManager | 570 import ViewManager |
547 self.viewmanager = \ | 571 self.viewmanager = \ |
551 layout.setContentsMargins(1, 1, 1, 1) | 575 layout.setContentsMargins(1, 1, 1, 1) |
552 layout.setSpacing(1) | 576 layout.setSpacing(1) |
553 layout.addWidget(self.viewmanager) | 577 layout.addWidget(self.viewmanager) |
554 layout.addWidget(self.viewmanager.searchWidget()) | 578 layout.addWidget(self.viewmanager.searchWidget()) |
555 layout.addWidget(self.viewmanager.replaceWidget()) | 579 layout.addWidget(self.viewmanager.replaceWidget()) |
556 self.viewmanager.setSizePolicy(QSizePolicy.Preferred, QSizePolicy.Expanding) | 580 self.viewmanager.setSizePolicy( |
581 QSizePolicy.Preferred, QSizePolicy.Expanding) | |
557 leftWidget.setLayout(layout) | 582 leftWidget.setLayout(layout) |
558 self.viewmanager.searchWidget().hide() | 583 self.viewmanager.searchWidget().hide() |
559 self.viewmanager.replaceWidget().hide() | 584 self.viewmanager.replaceWidget().hide() |
560 | 585 |
561 splitter = QSplitter(Qt.Horizontal) | 586 splitter = QSplitter(Qt.Horizontal) |
577 elif self.layout == "Sidebars": | 602 elif self.layout == "Sidebars": |
578 logging.debug("Creating sidebars...") | 603 logging.debug("Creating sidebars...") |
579 self.__createSidebarsLayout(debugServer) | 604 self.__createSidebarsLayout(debugServer) |
580 | 605 |
581 else: | 606 else: |
582 raise ValueError("Wrong layout type given ({0})".format(self.layout)) | 607 raise ValueError("Wrong layout type given ({0})".format( |
608 self.layout)) | |
583 logging.debug("Created Layout") | 609 logging.debug("Created Layout") |
584 | 610 |
585 def __createToolboxesLayout(self, debugServer): | 611 def __createToolboxesLayout(self, debugServer): |
586 """ | 612 """ |
587 Private method to create the Toolboxes layout. | 613 Private method to create the Toolboxes layout. |
598 | 624 |
599 # Create the horizontal toolbox | 625 # Create the horizontal toolbox |
600 self.hToolboxDock = self.__createDockWindow("hToolboxDock") | 626 self.hToolboxDock = self.__createDockWindow("hToolboxDock") |
601 self.hToolbox = E5HorizontalToolBox(self.hToolboxDock) | 627 self.hToolbox = E5HorizontalToolBox(self.hToolboxDock) |
602 self.__setupDockWindow(self.hToolboxDock, Qt.BottomDockWidgetArea, | 628 self.__setupDockWindow(self.hToolboxDock, Qt.BottomDockWidgetArea, |
603 self.hToolbox, self.trUtf8("Horizontal Toolbox")) | 629 self.hToolbox, |
630 self.trUtf8("Horizontal Toolbox")) | |
604 | 631 |
605 # Create the right toolbox | 632 # Create the right toolbox |
606 self.rToolboxDock = self.__createDockWindow("rToolboxDock") | 633 self.rToolboxDock = self.__createDockWindow("rToolboxDock") |
607 self.rToolbox = E5VerticalToolBox(self.rToolboxDock) | 634 self.rToolbox = E5VerticalToolBox(self.rToolboxDock) |
608 self.__setupDockWindow(self.rToolboxDock, Qt.RightDockWidgetArea, | 635 self.__setupDockWindow(self.rToolboxDock, Qt.RightDockWidgetArea, |
672 if self.embeddedShell: | 699 if self.embeddedShell: |
673 self.shell = self.debugViewer.shell | 700 self.shell = self.debugViewer.shell |
674 else: | 701 else: |
675 # Create the shell | 702 # Create the shell |
676 from QScintilla.Shell import ShellAssembly | 703 from QScintilla.Shell import ShellAssembly |
677 self.shellAssembly = ShellAssembly(debugServer, self.viewmanager, True) | 704 self.shellAssembly = \ |
705 ShellAssembly(debugServer, self.viewmanager, True) | |
678 self.shell = self.shellAssembly.shell() | 706 self.shell = self.shellAssembly.shell() |
679 self.hToolbox.insertItem(0, self.shellAssembly, | 707 self.hToolbox.insertItem(0, self.shellAssembly, |
680 UI.PixmapCache.getIcon("shell.png"), | 708 UI.PixmapCache.getIcon("shell.png"), |
681 self.trUtf8("Shell")) | 709 self.trUtf8("Shell")) |
682 | 710 |
757 from Debugger.DebugViewer import DebugViewer | 785 from Debugger.DebugViewer import DebugViewer |
758 self.debugViewer = DebugViewer(debugServer, True, self.viewmanager, | 786 self.debugViewer = DebugViewer(debugServer, True, self.viewmanager, |
759 None, | 787 None, |
760 embeddedShell=self.embeddedShell, | 788 embeddedShell=self.embeddedShell, |
761 embeddedBrowser=(self.embeddedFileBrowser == 1)) | 789 embeddedBrowser=(self.embeddedFileBrowser == 1)) |
762 self.rightSidebar.addTab(self.debugViewer, | 790 self.rightSidebar.addTab( |
763 UI.PixmapCache.getIcon("debugViewer.png"), self.trUtf8("Debug-Viewer")) | 791 self.debugViewer, UI.PixmapCache.getIcon("debugViewer.png"), |
792 self.trUtf8("Debug-Viewer")) | |
764 | 793 |
765 # Create the chat part of the user interface | 794 # Create the chat part of the user interface |
766 logging.debug("Creating Chat Widget...") | 795 logging.debug("Creating Chat Widget...") |
767 from Cooperation.ChatWidget import ChatWidget | 796 from Cooperation.ChatWidget import ChatWidget |
768 self.cooperation = ChatWidget(self) | 797 self.cooperation = ChatWidget(self) |
769 self.rightSidebar.addTab(self.cooperation, | 798 self.rightSidebar.addTab( |
770 UI.PixmapCache.getIcon("cooperation.png"), self.trUtf8("Cooperation")) | 799 self.cooperation, UI.PixmapCache.getIcon("cooperation.png"), |
800 self.trUtf8("Cooperation")) | |
771 | 801 |
772 # Create the IRC part of the user interface | 802 # Create the IRC part of the user interface |
773 logging.debug("Creating IRC Widget...") | 803 logging.debug("Creating IRC Widget...") |
774 from Network.IRC.IrcWidget import IrcWidget | 804 from Network.IRC.IrcWidget import IrcWidget |
775 self.irc = IrcWidget(self) | 805 self.irc = IrcWidget(self) |
779 # Create the task viewer part of the user interface | 809 # Create the task viewer part of the user interface |
780 logging.debug("Creating Task Viewer...") | 810 logging.debug("Creating Task Viewer...") |
781 from Tasks.TaskViewer import TaskViewer | 811 from Tasks.TaskViewer import TaskViewer |
782 self.taskViewer = TaskViewer(None, self.project) | 812 self.taskViewer = TaskViewer(None, self.project) |
783 self.bottomSidebar.addTab(self.taskViewer, | 813 self.bottomSidebar.addTab(self.taskViewer, |
784 UI.PixmapCache.getIcon("task.png"), | 814 UI.PixmapCache.getIcon("task.png"), |
785 self.trUtf8("Task-Viewer")) | 815 self.trUtf8("Task-Viewer")) |
786 | 816 |
787 # Create the log viewer part of the user interface | 817 # Create the log viewer part of the user interface |
788 logging.debug("Creating Log Viewer...") | 818 logging.debug("Creating Log Viewer...") |
789 from .LogView import LogViewer | 819 from .LogView import LogViewer |
790 self.logViewer = LogViewer() | 820 self.logViewer = LogViewer() |
791 self.bottomSidebar.addTab(self.logViewer, | 821 self.bottomSidebar.addTab(self.logViewer, |
792 UI.PixmapCache.getIcon("logViewer.png"), | 822 UI.PixmapCache.getIcon("logViewer.png"), |
793 self.trUtf8("Log-Viewer")) | 823 self.trUtf8("Log-Viewer")) |
794 | 824 |
795 if self.embeddedShell: | 825 if self.embeddedShell: |
796 self.shell = self.debugViewer.shell | 826 self.shell = self.debugViewer.shell |
797 else: | 827 else: |
798 # Create the shell | 828 # Create the shell |
799 logging.debug("Creating Shell...") | 829 logging.debug("Creating Shell...") |
800 from QScintilla.Shell import ShellAssembly | 830 from QScintilla.Shell import ShellAssembly |
801 self.shellAssembly = ShellAssembly(debugServer, self.viewmanager, True) | 831 self.shellAssembly = \ |
832 ShellAssembly(debugServer, self.viewmanager, True) | |
802 self.shell = self.shellAssembly.shell() | 833 self.shell = self.shellAssembly.shell() |
803 self.bottomSidebar.insertTab(0, self.shellAssembly, | 834 self.bottomSidebar.insertTab(0, self.shellAssembly, |
804 UI.PixmapCache.getIcon("shell.png"), | 835 UI.PixmapCache.getIcon("shell.png"), |
805 self.trUtf8("Shell")) | 836 self.trUtf8("Shell")) |
806 | 837 |
807 if self.embeddedFileBrowser == 0: # separate window | 838 if self.embeddedFileBrowser == 0: # separate window |
808 # Create the file browser | 839 # Create the file browser |
809 logging.debug("Creating File Browser...") | 840 logging.debug("Creating File Browser...") |
810 from .Browser import Browser | 841 from .Browser import Browser |
911 for container in [self.lToolbox, self.hToolbox, self.rToolbox]: | 942 for container in [self.lToolbox, self.hToolbox, self.rToolbox]: |
912 index = container.indexOf(widget) | 943 index = container.indexOf(widget) |
913 if index != -1: | 944 if index != -1: |
914 container.removeItem(index) | 945 container.removeItem(index) |
915 elif self.layout == "Sidebars": | 946 elif self.layout == "Sidebars": |
916 for container in [self.leftSidebar, self.bottomSidebar, self.rightSidebar]: | 947 for container in [self.leftSidebar, self.bottomSidebar, |
948 self.rightSidebar]: | |
917 index = container.indexOf(widget) | 949 index = container.indexOf(widget) |
918 if index != -1: | 950 if index != -1: |
919 container.removeTab(index) | 951 container.removeTab(index) |
920 | 952 |
921 def showLogTab(self, tabname): | 953 def showLogTab(self, tabname): |
1079 QDockWidget.DockWidgetFeatures(QDockWidget.AllDockWidgetFeatures)) | 1111 QDockWidget.DockWidgetFeatures(QDockWidget.AllDockWidgetFeatures)) |
1080 return dock | 1112 return dock |
1081 | 1113 |
1082 def __setupDockWindow(self, dock, where, widget, caption): | 1114 def __setupDockWindow(self, dock, where, widget, caption): |
1083 """ | 1115 """ |
1084 Private method to configure the dock window created with __createDockWindow(). | 1116 Private method to configure the dock window created with |
1117 __createDockWindow(). | |
1085 | 1118 |
1086 @param dock the dock window (QDockWindow) | 1119 @param dock the dock window (QDockWindow) |
1087 @param where dock area to be docked to (Qt.DockWidgetArea) | 1120 @param where dock area to be docked to (Qt.DockWidgetArea) |
1088 @param widget widget to be shown in the dock window (QWidget) | 1121 @param widget widget to be shown in the dock window (QWidget) |
1089 @param caption caption of the dock window (string) | 1122 @param caption caption of the dock window (string) |
1108 if project is not None: | 1141 if project is not None: |
1109 self.capProject = project | 1142 self.capProject = project |
1110 | 1143 |
1111 if self.passiveMode: | 1144 if self.passiveMode: |
1112 if not self.capProject and not self.capEditor: | 1145 if not self.capProject and not self.capEditor: |
1113 self.setWindowTitle(self.trUtf8("{0} - Passive Mode").format(Program)) | 1146 self.setWindowTitle( |
1147 self.trUtf8("{0} - Passive Mode").format(Program)) | |
1114 elif self.capProject and not self.capEditor: | 1148 elif self.capProject and not self.capEditor: |
1115 self.setWindowTitle(self.trUtf8("{0} - {1} - Passive Mode")\ | 1149 self.setWindowTitle(self.trUtf8("{0} - {1} - Passive Mode")\ |
1116 .format(self.capProject, Program)) | 1150 .format(self.capProject, Program)) |
1117 elif not self.capProject and self.capEditor: | 1151 elif not self.capProject and self.capEditor: |
1118 self.setWindowTitle(self.trUtf8("{0} - {1} - Passive Mode")\ | 1152 self.setWindowTitle(self.trUtf8("{0} - {1} - Passive Mode")\ |
1119 .format(self.capEditor, Program)) | 1153 .format(self.capEditor, Program)) |
1120 else: | 1154 else: |
1121 self.setWindowTitle(self.trUtf8("{0} - {1} - {2} - Passive Mode")\ | 1155 self.setWindowTitle( |
1156 self.trUtf8("{0} - {1} - {2} - Passive Mode")\ | |
1122 .format(self.capProject, self.capEditor, Program)) | 1157 .format(self.capProject, self.capEditor, Program)) |
1123 else: | 1158 else: |
1124 if not self.capProject and not self.capEditor: | 1159 if not self.capProject and not self.capEditor: |
1125 self.setWindowTitle(Program) | 1160 self.setWindowTitle(Program) |
1126 elif self.capProject and not self.capEditor: | 1161 elif self.capProject and not self.capEditor: |
1127 self.setWindowTitle("{0} - {1}".format(self.capProject, Program)) | 1162 self.setWindowTitle( |
1163 "{0} - {1}".format(self.capProject, Program)) | |
1128 elif not self.capProject and self.capEditor: | 1164 elif not self.capProject and self.capEditor: |
1129 self.setWindowTitle("{0} - {1}".format(self.capEditor, Program)) | 1165 self.setWindowTitle( |
1166 "{0} - {1}".format(self.capEditor, Program)) | |
1130 else: | 1167 else: |
1131 self.setWindowTitle("{0} - {1} - {2}".format( | 1168 self.setWindowTitle("{0} - {1} - {2}".format( |
1132 self.capProject, self.capEditor, Program)) | 1169 self.capProject, self.capEditor, Program)) |
1133 | 1170 |
1134 def __initActions(self): | 1171 def __initActions(self): |
1144 QKeySequence(self.trUtf8("Ctrl+Q", "File|Quit")), | 1181 QKeySequence(self.trUtf8("Ctrl+Q", "File|Quit")), |
1145 0, self, 'quit') | 1182 0, self, 'quit') |
1146 self.exitAct.setStatusTip(self.trUtf8('Quit the IDE')) | 1183 self.exitAct.setStatusTip(self.trUtf8('Quit the IDE')) |
1147 self.exitAct.setWhatsThis(self.trUtf8( | 1184 self.exitAct.setWhatsThis(self.trUtf8( |
1148 """<b>Quit the IDE</b>""" | 1185 """<b>Quit the IDE</b>""" |
1149 """<p>This quits the IDE. Any unsaved changes may be saved first.""" | 1186 """<p>This quits the IDE. Any unsaved changes may be saved""" |
1150 """ Any Python program being debugged will be stopped and the""" | 1187 """ first. Any Python program being debugged will be stopped""" |
1151 """ preferences will be written to disc.</p>""" | 1188 """ and the preferences will be written to disc.</p>""" |
1152 )) | 1189 )) |
1153 self.exitAct.triggered[()].connect(self.__quit) | 1190 self.exitAct.triggered[()].connect(self.__quit) |
1154 self.exitAct.setMenuRole(QAction.QuitRole) | 1191 self.exitAct.setMenuRole(QAction.QuitRole) |
1155 self.actions.append(self.exitAct) | 1192 self.actions.append(self.exitAct) |
1156 | 1193 |
1157 self.newWindowAct = E5Action(self.trUtf8('New Window'), | 1194 self.newWindowAct = E5Action(self.trUtf8('New Window'), |
1158 UI.PixmapCache.getIcon("newWindow.png"), | 1195 UI.PixmapCache.getIcon("newWindow.png"), |
1159 self.trUtf8('New &Window'), | 1196 self.trUtf8('New &Window'), |
1160 QKeySequence(self.trUtf8("Ctrl+Shift+N", "File|New Window")), | 1197 QKeySequence(self.trUtf8("Ctrl+Shift+N", "File|New Window")), |
1161 0, self, 'new_window') | 1198 0, self, 'new_window') |
1162 self.newWindowAct.setStatusTip(self.trUtf8('Open a new eric5 instance')) | 1199 self.newWindowAct.setStatusTip(self.trUtf8( |
1200 'Open a new eric5 instance')) | |
1163 self.newWindowAct.setWhatsThis(self.trUtf8( | 1201 self.newWindowAct.setWhatsThis(self.trUtf8( |
1164 """<b>New Window</b>""" | 1202 """<b>New Window</b>""" |
1165 """<p>This opens a new instance of the eric5 IDE.</p>""" | 1203 """<p>This opens a new instance of the eric5 IDE.</p>""" |
1166 )) | 1204 )) |
1167 self.newWindowAct.triggered[()].connect(self.__newWindow) | 1205 self.newWindowAct.triggered[()].connect(self.__newWindow) |
1168 self.actions.append(self.newWindowAct) | 1206 self.actions.append(self.newWindowAct) |
1169 self.newWindowAct.setEnabled(not Preferences.getUI("SingleApplicationMode")) | 1207 self.newWindowAct.setEnabled( |
1208 not Preferences.getUI("SingleApplicationMode")) | |
1170 | 1209 |
1171 self.viewProfileActGrp = createActionGroup(self, "viewprofiles", True) | 1210 self.viewProfileActGrp = createActionGroup(self, "viewprofiles", True) |
1172 | 1211 |
1173 self.setEditProfileAct = E5Action(self.trUtf8('Edit Profile'), | 1212 self.setEditProfileAct = E5Action(self.trUtf8('Edit Profile'), |
1174 UI.PixmapCache.getIcon("viewProfileEdit.png"), | 1213 UI.PixmapCache.getIcon("viewProfileEdit.png"), |
1175 self.trUtf8('Edit Profile'), | 1214 self.trUtf8('Edit Profile'), |
1176 0, 0, | 1215 0, 0, |
1177 self.viewProfileActGrp, 'edit_profile', True) | 1216 self.viewProfileActGrp, 'edit_profile', True) |
1178 self.setEditProfileAct.setStatusTip(self.trUtf8('Activate the edit view profile')) | 1217 self.setEditProfileAct.setStatusTip(self.trUtf8( |
1218 'Activate the edit view profile')) | |
1179 self.setEditProfileAct.setWhatsThis(self.trUtf8( | 1219 self.setEditProfileAct.setWhatsThis(self.trUtf8( |
1180 """<b>Edit Profile</b>""" | 1220 """<b>Edit Profile</b>""" |
1181 """<p>Activate the "Edit View Profile". Windows being shown,""" | 1221 """<p>Activate the "Edit View Profile". Windows being shown,""" |
1182 """ if this profile is active, may be configured with the""" | 1222 """ if this profile is active, may be configured with the""" |
1183 """ "View Profile Configuration" dialog.</p>""" | 1223 """ "View Profile Configuration" dialog.</p>""" |
1208 'project_viewer_activate') | 1248 'project_viewer_activate') |
1209 self.pbActivateAct.setStatusTip(self.trUtf8( | 1249 self.pbActivateAct.setStatusTip(self.trUtf8( |
1210 "Switch the input focus to the Project-Viewer window.")) | 1250 "Switch the input focus to the Project-Viewer window.")) |
1211 self.pbActivateAct.setWhatsThis(self.trUtf8( | 1251 self.pbActivateAct.setWhatsThis(self.trUtf8( |
1212 """<b>Activate Project-Viewer</b>""" | 1252 """<b>Activate Project-Viewer</b>""" |
1213 """<p>This switches the input focus to the Project-Viewer window.</p>""" | 1253 """<p>This switches the input focus to the Project-Viewer""" |
1254 """ window.</p>""" | |
1214 )) | 1255 )) |
1215 self.pbActivateAct.triggered[()].connect(self.__activateProjectBrowser) | 1256 self.pbActivateAct.triggered[()].connect(self.__activateProjectBrowser) |
1216 self.actions.append(self.pbActivateAct) | 1257 self.actions.append(self.pbActivateAct) |
1217 self.addAction(self.pbActivateAct) | 1258 self.addAction(self.pbActivateAct) |
1218 | 1259 |
1223 'multi_project_viewer_activate') | 1264 'multi_project_viewer_activate') |
1224 self.mpbActivateAct.setStatusTip(self.trUtf8( | 1265 self.mpbActivateAct.setStatusTip(self.trUtf8( |
1225 "Switch the input focus to the Multiproject-Viewer window.")) | 1266 "Switch the input focus to the Multiproject-Viewer window.")) |
1226 self.mpbActivateAct.setWhatsThis(self.trUtf8( | 1267 self.mpbActivateAct.setWhatsThis(self.trUtf8( |
1227 """<b>Activate Multiproject-Viewer</b>""" | 1268 """<b>Activate Multiproject-Viewer</b>""" |
1228 """<p>This switches the input focus to the Multiproject-Viewer window.</p>""" | 1269 """<p>This switches the input focus to the Multiproject-Viewer""" |
1229 )) | 1270 """ window.</p>""" |
1230 self.mpbActivateAct.triggered[()].connect(self.__activateMultiProjectBrowser) | 1271 )) |
1272 self.mpbActivateAct.triggered[()].connect( | |
1273 self.__activateMultiProjectBrowser) | |
1231 self.actions.append(self.mpbActivateAct) | 1274 self.actions.append(self.mpbActivateAct) |
1232 self.addAction(self.mpbActivateAct) | 1275 self.addAction(self.mpbActivateAct) |
1233 | 1276 |
1234 self.debugViewerActivateAct = E5Action(self.trUtf8('Debug-Viewer'), | 1277 self.debugViewerActivateAct = E5Action(self.trUtf8('Debug-Viewer'), |
1235 self.trUtf8('&Debug-Viewer'), | 1278 self.trUtf8('&Debug-Viewer'), |
1238 'debug_viewer_activate') | 1281 'debug_viewer_activate') |
1239 self.debugViewerActivateAct.setStatusTip(self.trUtf8( | 1282 self.debugViewerActivateAct.setStatusTip(self.trUtf8( |
1240 "Switch the input focus to the Debug-Viewer window.")) | 1283 "Switch the input focus to the Debug-Viewer window.")) |
1241 self.debugViewerActivateAct.setWhatsThis(self.trUtf8( | 1284 self.debugViewerActivateAct.setWhatsThis(self.trUtf8( |
1242 """<b>Activate Debug-Viewer</b>""" | 1285 """<b>Activate Debug-Viewer</b>""" |
1243 """<p>This switches the input focus to the Debug-Viewer window.</p>""" | 1286 """<p>This switches the input focus to the Debug-Viewer""" |
1244 )) | 1287 """ window.</p>""" |
1245 self.debugViewerActivateAct.triggered[()].connect(self.__activateDebugViewer) | 1288 )) |
1289 self.debugViewerActivateAct.triggered[()].connect( | |
1290 self.__activateDebugViewer) | |
1246 self.actions.append(self.debugViewerActivateAct) | 1291 self.actions.append(self.debugViewerActivateAct) |
1247 self.addAction(self.debugViewerActivateAct) | 1292 self.addAction(self.debugViewerActivateAct) |
1248 | 1293 |
1249 self.shellActivateAct = E5Action(self.trUtf8('Shell'), | 1294 self.shellActivateAct = E5Action(self.trUtf8('Shell'), |
1250 self.trUtf8('&Shell'), | 1295 self.trUtf8('&Shell'), |
1268 'file_browser_activate') | 1313 'file_browser_activate') |
1269 self.browserActivateAct.setStatusTip(self.trUtf8( | 1314 self.browserActivateAct.setStatusTip(self.trUtf8( |
1270 "Switch the input focus to the File-Browser window.")) | 1315 "Switch the input focus to the File-Browser window.")) |
1271 self.browserActivateAct.setWhatsThis(self.trUtf8( | 1316 self.browserActivateAct.setWhatsThis(self.trUtf8( |
1272 """<b>Activate File-Browser</b>""" | 1317 """<b>Activate File-Browser</b>""" |
1273 """<p>This switches the input focus to the File-Browser window.</p>""" | 1318 """<p>This switches the input focus to the File-Browser""" |
1319 """ window.</p>""" | |
1274 )) | 1320 )) |
1275 self.browserActivateAct.triggered[()].connect(self.__activateBrowser) | 1321 self.browserActivateAct.triggered[()].connect(self.__activateBrowser) |
1276 self.actions.append(self.browserActivateAct) | 1322 self.actions.append(self.browserActivateAct) |
1277 self.addAction(self.browserActivateAct) | 1323 self.addAction(self.browserActivateAct) |
1278 | 1324 |
1283 'log_viewer_activate') | 1329 'log_viewer_activate') |
1284 self.logViewerActivateAct.setStatusTip(self.trUtf8( | 1330 self.logViewerActivateAct.setStatusTip(self.trUtf8( |
1285 "Switch the input focus to the Log-Viewer window.")) | 1331 "Switch the input focus to the Log-Viewer window.")) |
1286 self.logViewerActivateAct.setWhatsThis(self.trUtf8( | 1332 self.logViewerActivateAct.setWhatsThis(self.trUtf8( |
1287 """<b>Activate Log-Viewer</b>""" | 1333 """<b>Activate Log-Viewer</b>""" |
1288 """<p>This switches the input focus to the Log-Viewer window.</p>""" | 1334 """<p>This switches the input focus to the Log-Viewer""" |
1289 )) | 1335 """ window.</p>""" |
1290 self.logViewerActivateAct.triggered[()].connect(self.__activateLogViewer) | 1336 )) |
1337 self.logViewerActivateAct.triggered[()].connect( | |
1338 self.__activateLogViewer) | |
1291 self.actions.append(self.logViewerActivateAct) | 1339 self.actions.append(self.logViewerActivateAct) |
1292 self.addAction(self.logViewerActivateAct) | 1340 self.addAction(self.logViewerActivateAct) |
1293 | 1341 |
1294 self.taskViewerActivateAct = E5Action(self.trUtf8('Task-Viewer'), | 1342 self.taskViewerActivateAct = E5Action(self.trUtf8('Task-Viewer'), |
1295 self.trUtf8('&Task-Viewer'), | 1343 self.trUtf8('&Task-Viewer'), |
1298 'task_viewer_activate') | 1346 'task_viewer_activate') |
1299 self.taskViewerActivateAct.setStatusTip(self.trUtf8( | 1347 self.taskViewerActivateAct.setStatusTip(self.trUtf8( |
1300 "Switch the input focus to the Task-Viewer window.")) | 1348 "Switch the input focus to the Task-Viewer window.")) |
1301 self.taskViewerActivateAct.setWhatsThis(self.trUtf8( | 1349 self.taskViewerActivateAct.setWhatsThis(self.trUtf8( |
1302 """<b>Activate Task-Viewer</b>""" | 1350 """<b>Activate Task-Viewer</b>""" |
1303 """<p>This switches the input focus to the Task-Viewer window.</p>""" | 1351 """<p>This switches the input focus to the Task-Viewer""" |
1304 )) | 1352 """ window.</p>""" |
1305 self.taskViewerActivateAct.triggered[()].connect(self.__activateTaskViewer) | 1353 )) |
1354 self.taskViewerActivateAct.triggered[()].connect( | |
1355 self.__activateTaskViewer) | |
1306 self.actions.append(self.taskViewerActivateAct) | 1356 self.actions.append(self.taskViewerActivateAct) |
1307 self.addAction(self.taskViewerActivateAct) | 1357 self.addAction(self.taskViewerActivateAct) |
1308 | 1358 |
1309 self.templateViewerActivateAct = E5Action(self.trUtf8('Template-Viewer'), | 1359 self.templateViewerActivateAct = E5Action( |
1310 self.trUtf8('Templ&ate-Viewer'), | 1360 self.trUtf8('Template-Viewer'), |
1311 QKeySequence(self.trUtf8("Alt+Shift+A")), | 1361 self.trUtf8('Templ&ate-Viewer'), |
1312 0, self, | 1362 QKeySequence(self.trUtf8("Alt+Shift+A")), |
1313 'template_viewer_activate') | 1363 0, self, |
1364 'template_viewer_activate') | |
1314 self.templateViewerActivateAct.setStatusTip(self.trUtf8( | 1365 self.templateViewerActivateAct.setStatusTip(self.trUtf8( |
1315 "Switch the input focus to the Template-Viewer window.")) | 1366 "Switch the input focus to the Template-Viewer window.")) |
1316 self.templateViewerActivateAct.setWhatsThis(self.trUtf8( | 1367 self.templateViewerActivateAct.setWhatsThis(self.trUtf8( |
1317 """<b>Activate Template-Viewer</b>""" | 1368 """<b>Activate Template-Viewer</b>""" |
1318 """<p>This switches the input focus to the Template-Viewer window.</p>""" | 1369 """<p>This switches the input focus to the Template-Viewer""" |
1370 """ window.</p>""" | |
1319 )) | 1371 )) |
1320 self.templateViewerActivateAct.triggered[()].connect( | 1372 self.templateViewerActivateAct.triggered[()].connect( |
1321 self.__activateTemplateViewer) | 1373 self.__activateTemplateViewer) |
1322 self.actions.append(self.templateViewerActivateAct) | 1374 self.actions.append(self.templateViewerActivateAct) |
1323 self.addAction(self.templateViewerActivateAct) | 1375 self.addAction(self.templateViewerActivateAct) |
1324 | 1376 |
1325 self.ltAct = E5Action(self.trUtf8('Left Toolbox'), | 1377 self.ltAct = E5Action( |
1326 self.trUtf8('&Left Toolbox'), 0, 0, self, 'vertical_toolbox', True) | 1378 self.trUtf8('Left Toolbox'), |
1379 self.trUtf8('&Left Toolbox'), 0, 0, self, 'vertical_toolbox', True) | |
1327 self.ltAct.setStatusTip(self.trUtf8('Toggle the Left Toolbox window')) | 1380 self.ltAct.setStatusTip(self.trUtf8('Toggle the Left Toolbox window')) |
1328 self.ltAct.setWhatsThis(self.trUtf8( | 1381 self.ltAct.setWhatsThis(self.trUtf8( |
1329 """<b>Toggle the Left Toolbox window</b>""" | 1382 """<b>Toggle the Left Toolbox window</b>""" |
1330 """<p>If the Left Toolbox window is hidden then display it.""" | 1383 """<p>If the Left Toolbox window is hidden then display it.""" |
1331 """ If it is displayed then close it.</p>""" | 1384 """ If it is displayed then close it.</p>""" |
1332 )) | 1385 )) |
1333 self.ltAct.triggered[()].connect(self.__toggleLeftToolbox) | 1386 self.ltAct.triggered[()].connect(self.__toggleLeftToolbox) |
1334 self.actions.append(self.ltAct) | 1387 self.actions.append(self.ltAct) |
1335 | 1388 |
1336 self.rtAct = E5Action(self.trUtf8('Right Toolbox'), | 1389 self.rtAct = E5Action( |
1337 self.trUtf8('&Right Toolbox'), 0, 0, self, 'vertical_toolbox', True) | 1390 self.trUtf8('Right Toolbox'), |
1391 self.trUtf8('&Right Toolbox'), | |
1392 0, 0, self, 'vertical_toolbox', True) | |
1338 self.rtAct.setStatusTip(self.trUtf8('Toggle the Right Toolbox window')) | 1393 self.rtAct.setStatusTip(self.trUtf8('Toggle the Right Toolbox window')) |
1339 self.rtAct.setWhatsThis(self.trUtf8( | 1394 self.rtAct.setWhatsThis(self.trUtf8( |
1340 """<b>Toggle the Right Toolbox window</b>""" | 1395 """<b>Toggle the Right Toolbox window</b>""" |
1341 """<p>If the Right Toolbox window is hidden then display it.""" | 1396 """<p>If the Right Toolbox window is hidden then display it.""" |
1342 """ If it is displayed then close it.</p>""" | 1397 """ If it is displayed then close it.</p>""" |
1345 self.actions.append(self.rtAct) | 1400 self.actions.append(self.rtAct) |
1346 | 1401 |
1347 self.htAct = E5Action(self.trUtf8('Horizontal Toolbox'), | 1402 self.htAct = E5Action(self.trUtf8('Horizontal Toolbox'), |
1348 self.trUtf8('&Horizontal Toolbox'), 0, 0, self, | 1403 self.trUtf8('&Horizontal Toolbox'), 0, 0, self, |
1349 'horizontal_toolbox', True) | 1404 'horizontal_toolbox', True) |
1350 self.htAct.setStatusTip(self.trUtf8('Toggle the Horizontal Toolbox window')) | 1405 self.htAct.setStatusTip(self.trUtf8( |
1406 'Toggle the Horizontal Toolbox window')) | |
1351 self.htAct.setWhatsThis(self.trUtf8( | 1407 self.htAct.setWhatsThis(self.trUtf8( |
1352 """<b>Toggle the Horizontal Toolbox window</b>""" | 1408 """<b>Toggle the Horizontal Toolbox window</b>""" |
1353 """<p>If the Horizontal Toolbox window is hidden then display it.""" | 1409 """<p>If the Horizontal Toolbox window is hidden then display""" |
1354 """ If it is displayed then close it.</p>""" | 1410 """ it. If it is displayed then close it.</p>""" |
1355 )) | 1411 )) |
1356 self.htAct.triggered[()].connect(self.__toggleHorizontalToolbox) | 1412 self.htAct.triggered[()].connect(self.__toggleHorizontalToolbox) |
1357 self.actions.append(self.htAct) | 1413 self.actions.append(self.htAct) |
1358 | 1414 |
1359 self.lsbAct = E5Action(self.trUtf8('Left Sidebar'), | 1415 self.lsbAct = E5Action(self.trUtf8('Left Sidebar'), |
1365 """ If it is displayed then close it.</p>""" | 1421 """ If it is displayed then close it.</p>""" |
1366 )) | 1422 )) |
1367 self.lsbAct.triggered[()].connect(self.__toggleLeftSidebar) | 1423 self.lsbAct.triggered[()].connect(self.__toggleLeftSidebar) |
1368 self.actions.append(self.lsbAct) | 1424 self.actions.append(self.lsbAct) |
1369 | 1425 |
1370 self.rsbAct = E5Action(self.trUtf8('Right Sidebar'), | 1426 self.rsbAct = E5Action( |
1371 self.trUtf8('&Right Sidebar'), 0, 0, self, 'right_sidebar', True) | 1427 self.trUtf8('Right Sidebar'), |
1372 self.rsbAct.setStatusTip(self.trUtf8('Toggle the right sidebar window')) | 1428 self.trUtf8('&Right Sidebar'), 0, 0, self, 'right_sidebar', True) |
1429 self.rsbAct.setStatusTip(self.trUtf8( | |
1430 'Toggle the right sidebar window')) | |
1373 self.rsbAct.setWhatsThis(self.trUtf8( | 1431 self.rsbAct.setWhatsThis(self.trUtf8( |
1374 """<b>Toggle the right sidebar window</b>""" | 1432 """<b>Toggle the right sidebar window</b>""" |
1375 """<p>If the right sidebar window is hidden then display it.""" | 1433 """<p>If the right sidebar window is hidden then display it.""" |
1376 """ If it is displayed then close it.</p>""" | 1434 """ If it is displayed then close it.</p>""" |
1377 )) | 1435 )) |
1379 self.actions.append(self.rsbAct) | 1437 self.actions.append(self.rsbAct) |
1380 | 1438 |
1381 self.bsbAct = E5Action(self.trUtf8('Bottom Sidebar'), | 1439 self.bsbAct = E5Action(self.trUtf8('Bottom Sidebar'), |
1382 self.trUtf8('&Bottom Sidebar'), 0, 0, self, | 1440 self.trUtf8('&Bottom Sidebar'), 0, 0, self, |
1383 'bottom_sidebar', True) | 1441 'bottom_sidebar', True) |
1384 self.bsbAct.setStatusTip(self.trUtf8('Toggle the bottom sidebar window')) | 1442 self.bsbAct.setStatusTip(self.trUtf8( |
1443 'Toggle the bottom sidebar window')) | |
1385 self.bsbAct.setWhatsThis(self.trUtf8( | 1444 self.bsbAct.setWhatsThis(self.trUtf8( |
1386 """<b>Toggle the bottom sidebar window</b>""" | 1445 """<b>Toggle the bottom sidebar window</b>""" |
1387 """<p>If the bottom sidebar window is hidden then display it.""" | 1446 """<p>If the bottom sidebar window is hidden then display it.""" |
1388 """ If it is displayed then close it.</p>""" | 1447 """ If it is displayed then close it.</p>""" |
1389 )) | 1448 )) |
1398 'cooperation_viewer_activate') | 1457 'cooperation_viewer_activate') |
1399 self.cooperationViewerActivateAct.setStatusTip(self.trUtf8( | 1458 self.cooperationViewerActivateAct.setStatusTip(self.trUtf8( |
1400 "Switch the input focus to the Cooperation-Viewer window.")) | 1459 "Switch the input focus to the Cooperation-Viewer window.")) |
1401 self.cooperationViewerActivateAct.setWhatsThis(self.trUtf8( | 1460 self.cooperationViewerActivateAct.setWhatsThis(self.trUtf8( |
1402 """<b>Activate Cooperation-Viewer</b>""" | 1461 """<b>Activate Cooperation-Viewer</b>""" |
1403 """<p>This switches the input focus to the Cooperation-Viewer window.</p>""" | 1462 """<p>This switches the input focus to the Cooperation-Viewer""" |
1463 """ window.</p>""" | |
1404 )) | 1464 )) |
1405 self.cooperationViewerActivateAct.triggered[()].connect( | 1465 self.cooperationViewerActivateAct.triggered[()].connect( |
1406 self.activateCooperationViewer) | 1466 self.activateCooperationViewer) |
1407 self.actions.append(self.cooperationViewerActivateAct) | 1467 self.actions.append(self.cooperationViewerActivateAct) |
1408 self.addAction(self.cooperationViewerActivateAct) | 1468 self.addAction(self.cooperationViewerActivateAct) |
1432 'symbols_viewer_activate') | 1492 'symbols_viewer_activate') |
1433 self.symbolsViewerActivateAct.setStatusTip(self.trUtf8( | 1493 self.symbolsViewerActivateAct.setStatusTip(self.trUtf8( |
1434 "Switch the input focus to the Symbols-Viewer window.")) | 1494 "Switch the input focus to the Symbols-Viewer window.")) |
1435 self.symbolsViewerActivateAct.setWhatsThis(self.trUtf8( | 1495 self.symbolsViewerActivateAct.setWhatsThis(self.trUtf8( |
1436 """<b>Activate Symbols-Viewer</b>""" | 1496 """<b>Activate Symbols-Viewer</b>""" |
1437 """<p>This switches the input focus to the Symbols-Viewer window.</p>""" | 1497 """<p>This switches the input focus to the Symbols-Viewer""" |
1438 )) | 1498 """ window.</p>""" |
1439 self.symbolsViewerActivateAct.triggered[()].connect(self.__activateSymbolsViewer) | 1499 )) |
1500 self.symbolsViewerActivateAct.triggered[()].connect( | |
1501 self.__activateSymbolsViewer) | |
1440 self.actions.append(self.symbolsViewerActivateAct) | 1502 self.actions.append(self.symbolsViewerActivateAct) |
1441 self.addAction(self.symbolsViewerActivateAct) | 1503 self.addAction(self.symbolsViewerActivateAct) |
1442 | 1504 |
1443 self.numbersViewerActivateAct = E5Action( | 1505 self.numbersViewerActivateAct = E5Action( |
1444 self.trUtf8('Numbers-Viewer'), | 1506 self.trUtf8('Numbers-Viewer'), |
1448 'numbers_viewer_activate') | 1510 'numbers_viewer_activate') |
1449 self.numbersViewerActivateAct.setStatusTip(self.trUtf8( | 1511 self.numbersViewerActivateAct.setStatusTip(self.trUtf8( |
1450 "Switch the input focus to the Numbers-Viewer window.")) | 1512 "Switch the input focus to the Numbers-Viewer window.")) |
1451 self.numbersViewerActivateAct.setWhatsThis(self.trUtf8( | 1513 self.numbersViewerActivateAct.setWhatsThis(self.trUtf8( |
1452 """<b>Activate Numbers-Viewer</b>""" | 1514 """<b>Activate Numbers-Viewer</b>""" |
1453 """<p>This switches the input focus to the Numbers-Viewer window.</p>""" | 1515 """<p>This switches the input focus to the Numbers-Viewer""" |
1454 )) | 1516 """ window.</p>""" |
1455 self.numbersViewerActivateAct.triggered[()].connect(self.__activateNumbersViewer) | 1517 )) |
1518 self.numbersViewerActivateAct.triggered[()].connect( | |
1519 self.__activateNumbersViewer) | |
1456 self.actions.append(self.numbersViewerActivateAct) | 1520 self.actions.append(self.numbersViewerActivateAct) |
1457 self.addAction(self.numbersViewerActivateAct) | 1521 self.addAction(self.numbersViewerActivateAct) |
1458 | 1522 |
1459 self.whatsThisAct = E5Action(self.trUtf8('What\'s This?'), | 1523 self.whatsThisAct = E5Action(self.trUtf8('What\'s This?'), |
1460 UI.PixmapCache.getIcon("whatsThis.png"), | 1524 UI.PixmapCache.getIcon("whatsThis.png"), |
1462 QKeySequence(self.trUtf8("Shift+F1")), | 1526 QKeySequence(self.trUtf8("Shift+F1")), |
1463 0, self, 'whatsThis') | 1527 0, self, 'whatsThis') |
1464 self.whatsThisAct.setStatusTip(self.trUtf8('Context sensitive help')) | 1528 self.whatsThisAct.setStatusTip(self.trUtf8('Context sensitive help')) |
1465 self.whatsThisAct.setWhatsThis(self.trUtf8( | 1529 self.whatsThisAct.setWhatsThis(self.trUtf8( |
1466 """<b>Display context sensitive help</b>""" | 1530 """<b>Display context sensitive help</b>""" |
1467 """<p>In What's This? mode, the mouse cursor shows an arrow with a question""" | 1531 """<p>In What's This? mode, the mouse cursor shows an arrow with""" |
1468 """ mark, and you can click on the interface elements to get a short""" | 1532 """ a question mark, and you can click on the interface elements""" |
1469 """ description of what they do and how to use them. In dialogs, this""" | 1533 """ to get a short description of what they do and how to use""" |
1470 """ feature can be accessed using the context help button in the""" | 1534 """ them. In dialogs, this feature can be accessed using the""" |
1471 """ titlebar.</p>""" | 1535 """ context help button in the titlebar.</p>""" |
1472 )) | 1536 )) |
1473 self.whatsThisAct.triggered[()].connect(self.__whatsThis) | 1537 self.whatsThisAct.triggered[()].connect(self.__whatsThis) |
1474 self.actions.append(self.whatsThisAct) | 1538 self.actions.append(self.whatsThisAct) |
1475 | 1539 |
1476 self.helpviewerAct = E5Action(self.trUtf8('Helpviewer'), | 1540 self.helpviewerAct = E5Action(self.trUtf8('Helpviewer'), |
1477 UI.PixmapCache.getIcon("help.png"), | 1541 UI.PixmapCache.getIcon("help.png"), |
1478 self.trUtf8('&Helpviewer...'), | 1542 self.trUtf8('&Helpviewer...'), |
1479 QKeySequence(self.trUtf8("F1")), | 1543 QKeySequence(self.trUtf8("F1")), |
1480 0, self, 'helpviewer') | 1544 0, self, 'helpviewer') |
1481 self.helpviewerAct.setStatusTip(self.trUtf8('Open the helpviewer window')) | 1545 self.helpviewerAct.setStatusTip(self.trUtf8( |
1546 'Open the helpviewer window')) | |
1482 self.helpviewerAct.setWhatsThis(self.trUtf8( | 1547 self.helpviewerAct.setWhatsThis(self.trUtf8( |
1483 """<b>Helpviewer</b>""" | 1548 """<b>Helpviewer</b>""" |
1484 """<p>Display the eric5 web browser. This window will show""" | 1549 """<p>Display the eric5 web browser. This window will show""" |
1485 """ HTML help files and help from Qt help collections. It has the""" | 1550 """ HTML help files and help from Qt help collections. It has""" |
1486 """ capability to navigate to links, set bookmarks, print the displayed""" | 1551 """ the capability to navigate to links, set bookmarks, print""" |
1487 """ help and some more features. You may use it to browse the internet""" | 1552 """ the displayed help and some more features. You may use it to""" |
1488 """ as well</p><p>If called with a word selected, this word is search""" | 1553 """ browse the internet as well</p><p>If called with a word""" |
1489 """ in the Qt help collection.</p>""" | 1554 """ selected, this word is search in the Qt help collection.</p>""" |
1490 )) | 1555 )) |
1491 self.helpviewerAct.triggered[()].connect(self.__helpViewer) | 1556 self.helpviewerAct.triggered[()].connect(self.__helpViewer) |
1492 self.actions.append(self.helpviewerAct) | 1557 self.actions.append(self.helpviewerAct) |
1493 | 1558 |
1494 self.__initQtDocActions() | 1559 self.__initQtDocActions() |
1496 self.__initEricDocAction() | 1561 self.__initEricDocAction() |
1497 self.__initPySideDocAction() | 1562 self.__initPySideDocAction() |
1498 | 1563 |
1499 self.versionAct = E5Action(self.trUtf8('Show Versions'), | 1564 self.versionAct = E5Action(self.trUtf8('Show Versions'), |
1500 self.trUtf8('Show &Versions'), 0, 0, self, 'show_versions') | 1565 self.trUtf8('Show &Versions'), 0, 0, self, 'show_versions') |
1501 self.versionAct.setStatusTip(self.trUtf8('Display version information')) | 1566 self.versionAct.setStatusTip(self.trUtf8( |
1567 'Display version information')) | |
1502 self.versionAct.setWhatsThis(self.trUtf8( | 1568 self.versionAct.setWhatsThis(self.trUtf8( |
1503 """<b>Show Versions</b>""" | 1569 """<b>Show Versions</b>""" |
1504 """<p>Display version information.</p>""" | 1570 """<p>Display version information.</p>""" |
1505 )) | 1571 )) |
1506 self.versionAct.triggered[()].connect(self.__showVersions) | 1572 self.versionAct.triggered[()].connect(self.__showVersions) |
1507 self.actions.append(self.versionAct) | 1573 self.actions.append(self.versionAct) |
1508 | 1574 |
1509 self.checkUpdateAct = E5Action(self.trUtf8('Check for Updates'), | 1575 self.checkUpdateAct = E5Action( |
1510 self.trUtf8('Check for &Updates...'), 0, 0, self, 'check_updates') | 1576 self.trUtf8('Check for Updates'), |
1577 self.trUtf8('Check for &Updates...'), 0, 0, self, 'check_updates') | |
1511 self.checkUpdateAct.setStatusTip(self.trUtf8('Check for Updates')) | 1578 self.checkUpdateAct.setStatusTip(self.trUtf8('Check for Updates')) |
1512 self.checkUpdateAct.setWhatsThis(self.trUtf8( | 1579 self.checkUpdateAct.setWhatsThis(self.trUtf8( |
1513 """<b>Check for Updates...</b>""" | 1580 """<b>Check for Updates...</b>""" |
1514 """<p>Checks the internet for updates of eric5.</p>""" | 1581 """<p>Checks the internet for updates of eric5.</p>""" |
1515 )) | 1582 )) |
1516 self.checkUpdateAct.triggered[()].connect(self.performVersionCheck) | 1583 self.checkUpdateAct.triggered[()].connect(self.performVersionCheck) |
1517 self.actions.append(self.checkUpdateAct) | 1584 self.actions.append(self.checkUpdateAct) |
1518 | 1585 |
1519 self.showVersionsAct = E5Action(self.trUtf8('Show downloadable versions'), | 1586 self.showVersionsAct = E5Action( |
1520 self.trUtf8('Show &downloadable versions...'), | 1587 self.trUtf8('Show downloadable versions'), |
1521 0, 0, self, 'show_downloadable_versions') | 1588 self.trUtf8('Show &downloadable versions...'), |
1589 0, 0, self, 'show_downloadable_versions') | |
1522 self.showVersionsAct.setStatusTip( | 1590 self.showVersionsAct.setStatusTip( |
1523 self.trUtf8('Show the versions available for download')) | 1591 self.trUtf8('Show the versions available for download')) |
1524 self.showVersionsAct.setWhatsThis(self.trUtf8( | 1592 self.showVersionsAct.setWhatsThis(self.trUtf8( |
1525 """<b>Show downloadable versions...</b>""" | 1593 """<b>Show downloadable versions...</b>""" |
1526 """<p>Shows the eric5 versions available for download """ | 1594 """<p>Shows the eric5 versions available for download """ |
1527 """from the internet.</p>""" | 1595 """from the internet.</p>""" |
1528 )) | 1596 )) |
1529 self.showVersionsAct.triggered[()].connect(self.showAvailableVersionsInfo) | 1597 self.showVersionsAct.triggered[()].connect( |
1598 self.showAvailableVersionsInfo) | |
1530 self.actions.append(self.showVersionsAct) | 1599 self.actions.append(self.showVersionsAct) |
1531 | 1600 |
1532 self.reportBugAct = E5Action(self.trUtf8('Report Bug'), | 1601 self.reportBugAct = E5Action(self.trUtf8('Report Bug'), |
1533 self.trUtf8('Report &Bug...'), 0, 0, self, 'report_bug') | 1602 self.trUtf8('Report &Bug...'), 0, 0, self, 'report_bug') |
1534 self.reportBugAct.setStatusTip(self.trUtf8('Report a bug')) | 1603 self.reportBugAct.setStatusTip(self.trUtf8('Report a bug')) |
1537 """<p>Opens a dialog to report a bug.</p>""" | 1606 """<p>Opens a dialog to report a bug.</p>""" |
1538 )) | 1607 )) |
1539 self.reportBugAct.triggered[()].connect(self.__reportBug) | 1608 self.reportBugAct.triggered[()].connect(self.__reportBug) |
1540 self.actions.append(self.reportBugAct) | 1609 self.actions.append(self.reportBugAct) |
1541 | 1610 |
1542 self.requestFeatureAct = E5Action(self.trUtf8('Request Feature'), | 1611 self.requestFeatureAct = E5Action( |
1543 self.trUtf8('Request &Feature...'), 0, 0, self, 'request_feature') | 1612 self.trUtf8('Request Feature'), |
1544 self.requestFeatureAct.setStatusTip(self.trUtf8('Send a feature request')) | 1613 self.trUtf8('Request &Feature...'), 0, 0, self, 'request_feature') |
1614 self.requestFeatureAct.setStatusTip(self.trUtf8( | |
1615 'Send a feature request')) | |
1545 self.requestFeatureAct.setWhatsThis(self.trUtf8( | 1616 self.requestFeatureAct.setWhatsThis(self.trUtf8( |
1546 """<b>Request Feature...</b>""" | 1617 """<b>Request Feature...</b>""" |
1547 """<p>Opens a dialog to send a feature request.</p>""" | 1618 """<p>Opens a dialog to send a feature request.</p>""" |
1548 )) | 1619 )) |
1549 self.requestFeatureAct.triggered[()].connect(self.__requestFeature) | 1620 self.requestFeatureAct.triggered[()].connect(self.__requestFeature) |
1583 0, 0, self.utActGrp, 'unittest_rerun_failed') | 1654 0, 0, self.utActGrp, 'unittest_rerun_failed') |
1584 self.utRerunFailedAct.setStatusTip(self.trUtf8( | 1655 self.utRerunFailedAct.setStatusTip(self.trUtf8( |
1585 'Rerun failed tests of the last run')) | 1656 'Rerun failed tests of the last run')) |
1586 self.utRerunFailedAct.setWhatsThis(self.trUtf8( | 1657 self.utRerunFailedAct.setWhatsThis(self.trUtf8( |
1587 """<b>Rerun Failed Tests</b>""" | 1658 """<b>Rerun Failed Tests</b>""" |
1588 """<p>Rerun all tests that failed during the last unittest run.</p>""" | 1659 """<p>Rerun all tests that failed during the last unittest""" |
1660 """ run.</p>""" | |
1589 )) | 1661 )) |
1590 self.utRerunFailedAct.triggered[()].connect(self.__unittestRerunFailed) | 1662 self.utRerunFailedAct.triggered[()].connect(self.__unittestRerunFailed) |
1591 self.utRerunFailedAct.setEnabled(False) | 1663 self.utRerunFailedAct.setEnabled(False) |
1592 self.actions.append(self.utRerunFailedAct) | 1664 self.actions.append(self.utRerunFailedAct) |
1593 | 1665 |
1594 self.utScriptAct = E5Action(self.trUtf8('Unittest Script'), | 1666 self.utScriptAct = E5Action(self.trUtf8('Unittest Script'), |
1595 UI.PixmapCache.getIcon("unittestScript.png"), | 1667 UI.PixmapCache.getIcon("unittestScript.png"), |
1596 self.trUtf8('Unittest &Script...'), | 1668 self.trUtf8('Unittest &Script...'), |
1597 0, 0, self.utActGrp, 'unittest_script') | 1669 0, 0, self.utActGrp, 'unittest_script') |
1598 self.utScriptAct.setStatusTip(self.trUtf8('Run unittest with current script')) | 1670 self.utScriptAct.setStatusTip(self.trUtf8( |
1671 'Run unittest with current script')) | |
1599 self.utScriptAct.setWhatsThis(self.trUtf8( | 1672 self.utScriptAct.setWhatsThis(self.trUtf8( |
1600 """<b>Unittest Script</b>""" | 1673 """<b>Unittest Script</b>""" |
1601 """<p>Run unittest with current script.</p>""" | 1674 """<p>Run unittest with current script.</p>""" |
1602 )) | 1675 )) |
1603 self.utScriptAct.triggered[()].connect(self.__unittestScript) | 1676 self.utScriptAct.triggered[()].connect(self.__unittestScript) |
1606 | 1679 |
1607 self.utProjectAct = E5Action(self.trUtf8('Unittest Project'), | 1680 self.utProjectAct = E5Action(self.trUtf8('Unittest Project'), |
1608 UI.PixmapCache.getIcon("unittestProject.png"), | 1681 UI.PixmapCache.getIcon("unittestProject.png"), |
1609 self.trUtf8('Unittest &Project...'), | 1682 self.trUtf8('Unittest &Project...'), |
1610 0, 0, self.utActGrp, 'unittest_project') | 1683 0, 0, self.utActGrp, 'unittest_project') |
1611 self.utProjectAct.setStatusTip(self.trUtf8('Run unittest with current project')) | 1684 self.utProjectAct.setStatusTip(self.trUtf8( |
1685 'Run unittest with current project')) | |
1612 self.utProjectAct.setWhatsThis(self.trUtf8( | 1686 self.utProjectAct.setWhatsThis(self.trUtf8( |
1613 """<b>Unittest Project</b>""" | 1687 """<b>Unittest Project</b>""" |
1614 """<p>Run unittest with current project.</p>""" | 1688 """<p>Run unittest with current project.</p>""" |
1615 )) | 1689 )) |
1616 self.utProjectAct.triggered[()].connect(self.__unittestProject) | 1690 self.utProjectAct.triggered[()].connect(self.__unittestProject) |
1671 """<p>Start the UI Previewer.</p>""" | 1745 """<p>Start the UI Previewer.</p>""" |
1672 )) | 1746 )) |
1673 self.uipreviewerAct.triggered[()].connect(self.__UIPreviewer) | 1747 self.uipreviewerAct.triggered[()].connect(self.__UIPreviewer) |
1674 self.actions.append(self.uipreviewerAct) | 1748 self.actions.append(self.uipreviewerAct) |
1675 | 1749 |
1676 self.trpreviewerAct = E5Action(self.trUtf8('Translations Previewer'), | 1750 self.trpreviewerAct = E5Action( |
1677 UI.PixmapCache.getIcon("trPreviewer.png"), | 1751 self.trUtf8('Translations Previewer'), |
1678 self.trUtf8('&Translations Previewer...'), 0, 0, self, 'tr_previewer') | 1752 UI.PixmapCache.getIcon("trPreviewer.png"), |
1679 self.trpreviewerAct.setStatusTip(self.trUtf8('Start the Translations Previewer')) | 1753 self.trUtf8('&Translations Previewer...'), |
1754 0, 0, self, 'tr_previewer') | |
1755 self.trpreviewerAct.setStatusTip(self.trUtf8( | |
1756 'Start the Translations Previewer')) | |
1680 self.trpreviewerAct.setWhatsThis(self.trUtf8( | 1757 self.trpreviewerAct.setWhatsThis(self.trUtf8( |
1681 """<b>Translations Previewer</b>""" | 1758 """<b>Translations Previewer</b>""" |
1682 """<p>Start the Translations Previewer.</p>""" | 1759 """<p>Start the Translations Previewer.</p>""" |
1683 )) | 1760 )) |
1684 self.trpreviewerAct.triggered[()].connect(self.__TRPreviewer) | 1761 self.trpreviewerAct.triggered[()].connect(self.__TRPreviewer) |
1734 | 1811 |
1735 self.webBrowserAct = E5Action(self.trUtf8('eric5 Web Browser'), | 1812 self.webBrowserAct = E5Action(self.trUtf8('eric5 Web Browser'), |
1736 UI.PixmapCache.getIcon("ericWeb.png"), | 1813 UI.PixmapCache.getIcon("ericWeb.png"), |
1737 self.trUtf8('eric5 &Web Browser...'), | 1814 self.trUtf8('eric5 &Web Browser...'), |
1738 0, 0, self, 'web_browser') | 1815 0, 0, self, 'web_browser') |
1739 self.webBrowserAct.setStatusTip(self.trUtf8('Start the eric5 Web Browser')) | 1816 self.webBrowserAct.setStatusTip(self.trUtf8( |
1817 'Start the eric5 Web Browser')) | |
1740 self.webBrowserAct.setWhatsThis(self.trUtf8( | 1818 self.webBrowserAct.setWhatsThis(self.trUtf8( |
1741 """<b>eric5 Web Browser</b>""" | 1819 """<b>eric5 Web Browser</b>""" |
1742 """<p>Browse the Internet with the eric5 Web Browser.</p>""" | 1820 """<p>Browse the Internet with the eric5 Web Browser.</p>""" |
1743 )) | 1821 )) |
1744 self.webBrowserAct.triggered[()].connect(self.__startWebBrowser) | 1822 self.webBrowserAct.triggered[()].connect(self.__startWebBrowser) |
1746 | 1824 |
1747 self.iconEditorAct = E5Action(self.trUtf8('Icon Editor'), | 1825 self.iconEditorAct = E5Action(self.trUtf8('Icon Editor'), |
1748 UI.PixmapCache.getIcon("iconEditor.png"), | 1826 UI.PixmapCache.getIcon("iconEditor.png"), |
1749 self.trUtf8('&Icon Editor...'), | 1827 self.trUtf8('&Icon Editor...'), |
1750 0, 0, self, 'icon_editor') | 1828 0, 0, self, 'icon_editor') |
1751 self.iconEditorAct.setStatusTip(self.trUtf8('Start the eric5 Icon Editor')) | 1829 self.iconEditorAct.setStatusTip(self.trUtf8( |
1830 'Start the eric5 Icon Editor')) | |
1752 self.iconEditorAct.setWhatsThis(self.trUtf8( | 1831 self.iconEditorAct.setWhatsThis(self.trUtf8( |
1753 """<b>Icon Editor</b>""" | 1832 """<b>Icon Editor</b>""" |
1754 """<p>Starts the eric5 Icon Editor for editing simple icons.</p>""" | 1833 """<p>Starts the eric5 Icon Editor for editing simple icons.</p>""" |
1755 )) | 1834 )) |
1756 self.iconEditorAct.triggered[()].connect(self.__editPixmap) | 1835 self.iconEditorAct.triggered[()].connect(self.__editPixmap) |
1758 | 1837 |
1759 self.snapshotAct = E5Action(self.trUtf8('Snapshot'), | 1838 self.snapshotAct = E5Action(self.trUtf8('Snapshot'), |
1760 UI.PixmapCache.getIcon("ericSnap.png"), | 1839 UI.PixmapCache.getIcon("ericSnap.png"), |
1761 self.trUtf8('&Snapshot...'), | 1840 self.trUtf8('&Snapshot...'), |
1762 0, 0, self, 'snapshot') | 1841 0, 0, self, 'snapshot') |
1763 self.snapshotAct.setStatusTip(self.trUtf8('Take snapshots of a screen region')) | 1842 self.snapshotAct.setStatusTip(self.trUtf8( |
1843 'Take snapshots of a screen region')) | |
1764 self.snapshotAct.setWhatsThis(self.trUtf8( | 1844 self.snapshotAct.setWhatsThis(self.trUtf8( |
1765 """<b>Snapshot</b>""" | 1845 """<b>Snapshot</b>""" |
1766 """<p>This opens a dialog to take snapshots of a screen region.</p>""" | 1846 """<p>This opens a dialog to take snapshots of a screen""" |
1847 """ region.</p>""" | |
1767 )) | 1848 )) |
1768 self.snapshotAct.triggered[()].connect(self.__snapshot) | 1849 self.snapshotAct.triggered[()].connect(self.__snapshot) |
1769 self.actions.append(self.snapshotAct) | 1850 self.actions.append(self.snapshotAct) |
1770 | 1851 |
1771 self.prefAct = E5Action(self.trUtf8('Preferences'), | 1852 self.prefAct = E5Action(self.trUtf8('Preferences'), |
1772 UI.PixmapCache.getIcon("configure.png"), | 1853 UI.PixmapCache.getIcon("configure.png"), |
1773 self.trUtf8('&Preferences...'), 0, 0, self, 'preferences') | 1854 self.trUtf8('&Preferences...'), 0, 0, self, 'preferences') |
1774 self.prefAct.setStatusTip(self.trUtf8('Set the prefered configuration')) | 1855 self.prefAct.setStatusTip(self.trUtf8( |
1856 'Set the prefered configuration')) | |
1775 self.prefAct.setWhatsThis(self.trUtf8( | 1857 self.prefAct.setWhatsThis(self.trUtf8( |
1776 """<b>Preferences</b>""" | 1858 """<b>Preferences</b>""" |
1777 """<p>Set the configuration items of the application""" | 1859 """<p>Set the configuration items of the application""" |
1778 """ with your prefered values.</p>""" | 1860 """ with your prefered values.</p>""" |
1779 )) | 1861 )) |
1780 self.prefAct.triggered[()].connect(self.showPreferences) | 1862 self.prefAct.triggered[()].connect(self.showPreferences) |
1781 self.prefAct.setMenuRole(QAction.PreferencesRole) | 1863 self.prefAct.setMenuRole(QAction.PreferencesRole) |
1782 self.actions.append(self.prefAct) | 1864 self.actions.append(self.prefAct) |
1783 | 1865 |
1784 self.prefExportAct = E5Action(self.trUtf8('Export Preferences'), | 1866 self.prefExportAct = E5Action( |
1785 UI.PixmapCache.getIcon("configureExport.png"), | 1867 self.trUtf8('Export Preferences'), |
1786 self.trUtf8('E&xport Preferences...'), 0, 0, self, 'export_preferences') | 1868 UI.PixmapCache.getIcon("configureExport.png"), |
1787 self.prefExportAct.setStatusTip(self.trUtf8('Export the current configuration')) | 1869 self.trUtf8('E&xport Preferences...'), |
1870 0, 0, self, 'export_preferences') | |
1871 self.prefExportAct.setStatusTip(self.trUtf8( | |
1872 'Export the current configuration')) | |
1788 self.prefExportAct.setWhatsThis(self.trUtf8( | 1873 self.prefExportAct.setWhatsThis(self.trUtf8( |
1789 """<b>Export Preferences</b>""" | 1874 """<b>Export Preferences</b>""" |
1790 """<p>Export the current configuration to a file.</p>""" | 1875 """<p>Export the current configuration to a file.</p>""" |
1791 )) | 1876 )) |
1792 self.prefExportAct.triggered[()].connect(self.__exportPreferences) | 1877 self.prefExportAct.triggered[()].connect(self.__exportPreferences) |
1793 self.actions.append(self.prefExportAct) | 1878 self.actions.append(self.prefExportAct) |
1794 | 1879 |
1795 self.prefImportAct = E5Action(self.trUtf8('Import Preferences'), | 1880 self.prefImportAct = E5Action( |
1796 UI.PixmapCache.getIcon("configureImport.png"), | 1881 self.trUtf8('Import Preferences'), |
1797 self.trUtf8('I&mport Preferences...'), 0, 0, self, 'import_preferences') | 1882 UI.PixmapCache.getIcon("configureImport.png"), |
1883 self.trUtf8('I&mport Preferences...'), | |
1884 0, 0, self, 'import_preferences') | |
1798 self.prefImportAct.setStatusTip(self.trUtf8( | 1885 self.prefImportAct.setStatusTip(self.trUtf8( |
1799 'Import a previously exported configuration')) | 1886 'Import a previously exported configuration')) |
1800 self.prefImportAct.setWhatsThis(self.trUtf8( | 1887 self.prefImportAct.setWhatsThis(self.trUtf8( |
1801 """<b>Import Preferences</b>""" | 1888 """<b>Import Preferences</b>""" |
1802 """<p>Import a previously exported configuration.</p>""" | 1889 """<p>Import a previously exported configuration.</p>""" |
1804 self.prefImportAct.triggered[()].connect(self.__importPreferences) | 1891 self.prefImportAct.triggered[()].connect(self.__importPreferences) |
1805 self.actions.append(self.prefImportAct) | 1892 self.actions.append(self.prefImportAct) |
1806 | 1893 |
1807 self.reloadAPIsAct = E5Action(self.trUtf8('Reload APIs'), | 1894 self.reloadAPIsAct = E5Action(self.trUtf8('Reload APIs'), |
1808 self.trUtf8('Reload &APIs'), 0, 0, self, 'reload_apis') | 1895 self.trUtf8('Reload &APIs'), 0, 0, self, 'reload_apis') |
1809 self.reloadAPIsAct.setStatusTip(self.trUtf8('Reload the API information')) | 1896 self.reloadAPIsAct.setStatusTip(self.trUtf8( |
1897 'Reload the API information')) | |
1810 self.reloadAPIsAct.setWhatsThis(self.trUtf8( | 1898 self.reloadAPIsAct.setWhatsThis(self.trUtf8( |
1811 """<b>Reload APIs</b>""" | 1899 """<b>Reload APIs</b>""" |
1812 """<p>Reload the API information.</p>""" | 1900 """<p>Reload the API information.</p>""" |
1813 )) | 1901 )) |
1814 self.reloadAPIsAct.triggered[()].connect(self.__reloadAPIs) | 1902 self.reloadAPIsAct.triggered[()].connect(self.__reloadAPIs) |
1815 self.actions.append(self.reloadAPIsAct) | 1903 self.actions.append(self.reloadAPIsAct) |
1816 | 1904 |
1817 self.showExternalToolsAct = E5Action(self.trUtf8('Show external tools'), | 1905 self.showExternalToolsAct = E5Action( |
1818 UI.PixmapCache.getIcon("showPrograms.png"), | 1906 self.trUtf8('Show external tools'), |
1819 self.trUtf8('Show external &tools'), 0, 0, self, 'show_external_tools') | 1907 UI.PixmapCache.getIcon("showPrograms.png"), |
1820 self.showExternalToolsAct.setStatusTip(self.trUtf8('Show external tools')) | 1908 self.trUtf8('Show external &tools'), |
1909 0, 0, self, 'show_external_tools') | |
1910 self.showExternalToolsAct.setStatusTip(self.trUtf8( | |
1911 'Show external tools')) | |
1821 self.showExternalToolsAct.setWhatsThis(self.trUtf8( | 1912 self.showExternalToolsAct.setWhatsThis(self.trUtf8( |
1822 """<b>Show external tools</b>""" | 1913 """<b>Show external tools</b>""" |
1823 """<p>Opens a dialog to show the path and versions of all""" | 1914 """<p>Opens a dialog to show the path and versions of all""" |
1824 """ extenal tools used by eric5.</p>""" | 1915 """ extenal tools used by eric5.</p>""" |
1825 )) | 1916 )) |
1826 self.showExternalToolsAct.triggered[()].connect(self.__showExternalTools) | 1917 self.showExternalToolsAct.triggered[()].connect( |
1918 self.__showExternalTools) | |
1827 self.actions.append(self.showExternalToolsAct) | 1919 self.actions.append(self.showExternalToolsAct) |
1828 | 1920 |
1829 self.configViewProfilesAct = E5Action(self.trUtf8('View Profiles'), | 1921 self.configViewProfilesAct = E5Action(self.trUtf8('View Profiles'), |
1830 UI.PixmapCache.getIcon("configureViewProfiles.png"), | 1922 UI.PixmapCache.getIcon("configureViewProfiles.png"), |
1831 self.trUtf8('&View Profiles...'), 0, 0, self, 'view_profiles') | 1923 self.trUtf8('&View Profiles...'), 0, 0, self, 'view_profiles') |
1832 self.configViewProfilesAct.setStatusTip(self.trUtf8('Configure view profiles')) | 1924 self.configViewProfilesAct.setStatusTip(self.trUtf8( |
1925 'Configure view profiles')) | |
1833 self.configViewProfilesAct.setWhatsThis(self.trUtf8( | 1926 self.configViewProfilesAct.setWhatsThis(self.trUtf8( |
1834 """<b>View Profiles</b>""" | 1927 """<b>View Profiles</b>""" |
1835 """<p>Configure the view profiles. With this dialog you may""" | 1928 """<p>Configure the view profiles. With this dialog you may""" |
1836 """ set the visibility of the various windows for the predetermined""" | 1929 """ set the visibility of the various windows for the""" |
1837 """ view profiles.</p>""" | 1930 """ predetermined view profiles.</p>""" |
1838 )) | 1931 )) |
1839 self.configViewProfilesAct.triggered[()].connect(self.__configViewProfiles) | 1932 self.configViewProfilesAct.triggered[()].connect( |
1933 self.__configViewProfiles) | |
1840 self.actions.append(self.configViewProfilesAct) | 1934 self.actions.append(self.configViewProfilesAct) |
1841 | 1935 |
1842 self.configToolBarsAct = E5Action(self.trUtf8('Toolbars'), | 1936 self.configToolBarsAct = E5Action(self.trUtf8('Toolbars'), |
1843 UI.PixmapCache.getIcon("toolbarsConfigure.png"), | 1937 UI.PixmapCache.getIcon("toolbarsConfigure.png"), |
1844 self.trUtf8('Tool&bars...'), 0, 0, self, 'configure_toolbars') | 1938 self.trUtf8('Tool&bars...'), 0, 0, self, 'configure_toolbars') |
1850 """ define your own toolbars.</p>""" | 1944 """ define your own toolbars.</p>""" |
1851 )) | 1945 )) |
1852 self.configToolBarsAct.triggered[()].connect(self.__configToolBars) | 1946 self.configToolBarsAct.triggered[()].connect(self.__configToolBars) |
1853 self.actions.append(self.configToolBarsAct) | 1947 self.actions.append(self.configToolBarsAct) |
1854 | 1948 |
1855 self.shortcutsAct = E5Action(self.trUtf8('Keyboard Shortcuts'), | 1949 self.shortcutsAct = E5Action( |
1856 UI.PixmapCache.getIcon("configureShortcuts.png"), | 1950 self.trUtf8('Keyboard Shortcuts'), |
1857 self.trUtf8('Keyboard &Shortcuts...'), 0, 0, self, 'keyboard_shortcuts') | 1951 UI.PixmapCache.getIcon("configureShortcuts.png"), |
1858 self.shortcutsAct.setStatusTip(self.trUtf8('Set the keyboard shortcuts')) | 1952 self.trUtf8('Keyboard &Shortcuts...'), |
1953 0, 0, self, 'keyboard_shortcuts') | |
1954 self.shortcutsAct.setStatusTip(self.trUtf8( | |
1955 'Set the keyboard shortcuts')) | |
1859 self.shortcutsAct.setWhatsThis(self.trUtf8( | 1956 self.shortcutsAct.setWhatsThis(self.trUtf8( |
1860 """<b>Keyboard Shortcuts</b>""" | 1957 """<b>Keyboard Shortcuts</b>""" |
1861 """<p>Set the keyboard shortcuts of the application""" | 1958 """<p>Set the keyboard shortcuts of the application""" |
1862 """ with your prefered values.</p>""" | 1959 """ with your prefered values.</p>""" |
1863 )) | 1960 )) |
1864 self.shortcutsAct.triggered[()].connect(self.__configShortcuts) | 1961 self.shortcutsAct.triggered[()].connect(self.__configShortcuts) |
1865 self.actions.append(self.shortcutsAct) | 1962 self.actions.append(self.shortcutsAct) |
1866 | 1963 |
1867 self.exportShortcutsAct = E5Action(self.trUtf8('Export Keyboard Shortcuts'), | 1964 self.exportShortcutsAct = E5Action( |
1868 UI.PixmapCache.getIcon("exportShortcuts.png"), | 1965 self.trUtf8('Export Keyboard Shortcuts'), |
1869 self.trUtf8('&Export Keyboard Shortcuts...'), 0, 0, self, | 1966 UI.PixmapCache.getIcon("exportShortcuts.png"), |
1870 'export_keyboard_shortcuts') | 1967 self.trUtf8('&Export Keyboard Shortcuts...'), |
1871 self.exportShortcutsAct.setStatusTip(self.trUtf8('Export the keyboard shortcuts')) | 1968 0, 0, self, 'export_keyboard_shortcuts') |
1969 self.exportShortcutsAct.setStatusTip(self.trUtf8( | |
1970 'Export the keyboard shortcuts')) | |
1872 self.exportShortcutsAct.setWhatsThis(self.trUtf8( | 1971 self.exportShortcutsAct.setWhatsThis(self.trUtf8( |
1873 """<b>Export Keyboard Shortcuts</b>""" | 1972 """<b>Export Keyboard Shortcuts</b>""" |
1874 """<p>Export the keyboard shortcuts of the application.</p>""" | 1973 """<p>Export the keyboard shortcuts of the application.</p>""" |
1875 )) | 1974 )) |
1876 self.exportShortcutsAct.triggered[()].connect(self.__exportShortcuts) | 1975 self.exportShortcutsAct.triggered[()].connect(self.__exportShortcuts) |
1877 self.actions.append(self.exportShortcutsAct) | 1976 self.actions.append(self.exportShortcutsAct) |
1878 | 1977 |
1879 self.importShortcutsAct = E5Action(self.trUtf8('Import Keyboard Shortcuts'), | 1978 self.importShortcutsAct = E5Action( |
1880 UI.PixmapCache.getIcon("importShortcuts.png"), | 1979 self.trUtf8('Import Keyboard Shortcuts'), |
1881 self.trUtf8('&Import Keyboard Shortcuts...'), 0, 0, self, | 1980 UI.PixmapCache.getIcon("importShortcuts.png"), |
1882 'import_keyboard_shortcuts') | 1981 self.trUtf8('&Import Keyboard Shortcuts...'), |
1883 self.importShortcutsAct.setStatusTip(self.trUtf8('Import the keyboard shortcuts')) | 1982 0, 0, self, 'import_keyboard_shortcuts') |
1983 self.importShortcutsAct.setStatusTip(self.trUtf8( | |
1984 'Import the keyboard shortcuts')) | |
1884 self.importShortcutsAct.setWhatsThis(self.trUtf8( | 1985 self.importShortcutsAct.setWhatsThis(self.trUtf8( |
1885 """<b>Import Keyboard Shortcuts</b>""" | 1986 """<b>Import Keyboard Shortcuts</b>""" |
1886 """<p>Import the keyboard shortcuts of the application.</p>""" | 1987 """<p>Import the keyboard shortcuts of the application.</p>""" |
1887 )) | 1988 )) |
1888 self.importShortcutsAct.triggered[()].connect(self.__importShortcuts) | 1989 self.importShortcutsAct.triggered[()].connect(self.__importShortcuts) |
1889 self.actions.append(self.importShortcutsAct) | 1990 self.actions.append(self.importShortcutsAct) |
1890 | 1991 |
1891 if SSL_AVAILABLE: | 1992 if SSL_AVAILABLE: |
1892 self.certificatesAct = E5Action(self.trUtf8('Manage SSL Certificates'), | 1993 self.certificatesAct = E5Action( |
1893 UI.PixmapCache.getIcon("certificates.png"), | 1994 self.trUtf8('Manage SSL Certificates'), |
1894 self.trUtf8('Manage SSL Certificates...'), | 1995 UI.PixmapCache.getIcon("certificates.png"), |
1895 0, 0, | 1996 self.trUtf8('Manage SSL Certificates...'), |
1896 self, 'manage_ssl_certificates') | 1997 0, 0, self, 'manage_ssl_certificates') |
1897 self.certificatesAct.setStatusTip(self.trUtf8( | 1998 self.certificatesAct.setStatusTip(self.trUtf8( |
1898 'Manage the saved SSL certificates')) | 1999 'Manage the saved SSL certificates')) |
1899 self.certificatesAct.setWhatsThis(self.trUtf8( | 2000 self.certificatesAct.setWhatsThis(self.trUtf8( |
1900 """<b>Manage SSL Certificates...</b>""" | 2001 """<b>Manage SSL Certificates...</b>""" |
1901 """<p>Opens a dialog to manage the saved SSL certificates.</p>""" | 2002 """<p>Opens a dialog to manage the saved SSL certificates.""" |
2003 """</p>""" | |
1902 )) | 2004 )) |
1903 self.certificatesAct.triggered[()].connect(self.__showCertificatesDialog) | 2005 self.certificatesAct.triggered[()].connect( |
2006 self.__showCertificatesDialog) | |
1904 self.actions.append(self.certificatesAct) | 2007 self.actions.append(self.certificatesAct) |
1905 | 2008 |
1906 self.editMessageFilterAct = E5Action(self.trUtf8('Edit Message Filters'), | 2009 self.editMessageFilterAct = E5Action( |
1907 UI.PixmapCache.getIcon("warning.png"), | 2010 self.trUtf8('Edit Message Filters'), |
1908 self.trUtf8('Edit Message Filters...'), 0, 0, self, | 2011 UI.PixmapCache.getIcon("warning.png"), |
1909 'manage_message_filters') | 2012 self.trUtf8('Edit Message Filters...'), |
2013 0, 0, self, 'manage_message_filters') | |
1910 self.editMessageFilterAct.setStatusTip(self.trUtf8( | 2014 self.editMessageFilterAct.setStatusTip(self.trUtf8( |
1911 'Edit the message filters used to suppress unwanted messages')) | 2015 'Edit the message filters used to suppress unwanted messages')) |
1912 self.editMessageFilterAct.setWhatsThis(self.trUtf8( | 2016 self.editMessageFilterAct.setWhatsThis(self.trUtf8( |
1913 """<b>Edit Message Filters</b>""" | 2017 """<b>Edit Message Filters</b>""" |
1914 """<p>Opens a dialog to edit the message filters used to suppress""" | 2018 """<p>Opens a dialog to edit the message filters used to""" |
1915 """ unwanted messages been shown in an error window.</p>""" | 2019 """ suppress unwanted messages been shown in an error""" |
1916 )) | 2020 """ window.</p>""" |
1917 self.editMessageFilterAct.triggered[()].connect(E5ErrorMessage.editMessageFilters) | 2021 )) |
2022 self.editMessageFilterAct.triggered[()].connect( | |
2023 E5ErrorMessage.editMessageFilters) | |
1918 self.actions.append(self.editMessageFilterAct) | 2024 self.actions.append(self.editMessageFilterAct) |
1919 | 2025 |
1920 self.viewmanagerActivateAct = E5Action(self.trUtf8('Activate current editor'), | 2026 self.viewmanagerActivateAct = E5Action( |
1921 self.trUtf8('Activate current editor'), | 2027 self.trUtf8('Activate current editor'), |
1922 QKeySequence(self.trUtf8("Alt+Shift+E")), | 2028 self.trUtf8('Activate current editor'), |
1923 0, self, | 2029 QKeySequence(self.trUtf8("Alt+Shift+E")), |
1924 'viewmanager_activate', 1) | 2030 0, self, 'viewmanager_activate', 1) |
1925 self.viewmanagerActivateAct.triggered[()].connect(self.__activateViewmanager) | 2031 self.viewmanagerActivateAct.triggered[()].connect( |
2032 self.__activateViewmanager) | |
1926 self.actions.append(self.viewmanagerActivateAct) | 2033 self.actions.append(self.viewmanagerActivateAct) |
1927 self.addAction(self.viewmanagerActivateAct) | 2034 self.addAction(self.viewmanagerActivateAct) |
1928 | 2035 |
1929 self.nextTabAct = E5Action(self.trUtf8('Show next'), | 2036 self.nextTabAct = E5Action(self.trUtf8('Show next'), |
1930 self.trUtf8('Show next'), | 2037 self.trUtf8('Show next'), |
1960 """ loaded plugins.</p>""" | 2067 """ loaded plugins.</p>""" |
1961 )) | 2068 )) |
1962 self.pluginInfoAct.triggered[()].connect(self.__showPluginInfo) | 2069 self.pluginInfoAct.triggered[()].connect(self.__showPluginInfo) |
1963 self.actions.append(self.pluginInfoAct) | 2070 self.actions.append(self.pluginInfoAct) |
1964 | 2071 |
1965 self.pluginInstallAct = E5Action(self.trUtf8('Install Plugins'), | 2072 self.pluginInstallAct = E5Action( |
1966 UI.PixmapCache.getIcon("pluginInstall.png"), | 2073 self.trUtf8('Install Plugins'), |
1967 self.trUtf8('&Install Plugins...'), 0, 0, self, 'plugin_install') | 2074 UI.PixmapCache.getIcon("pluginInstall.png"), |
2075 self.trUtf8('&Install Plugins...'), | |
2076 0, 0, self, 'plugin_install') | |
1968 self.pluginInstallAct.setStatusTip(self.trUtf8('Install Plugins')) | 2077 self.pluginInstallAct.setStatusTip(self.trUtf8('Install Plugins')) |
1969 self.pluginInstallAct.setWhatsThis(self.trUtf8( | 2078 self.pluginInstallAct.setWhatsThis(self.trUtf8( |
1970 """<b>Install Plugins...</b>""" | 2079 """<b>Install Plugins...</b>""" |
1971 """<p>This opens a dialog to install or update plugins.</p>""" | 2080 """<p>This opens a dialog to install or update plugins.</p>""" |
1972 )) | 2081 )) |
1973 self.pluginInstallAct.triggered[()].connect(self.__installPlugins) | 2082 self.pluginInstallAct.triggered[()].connect(self.__installPlugins) |
1974 self.actions.append(self.pluginInstallAct) | 2083 self.actions.append(self.pluginInstallAct) |
1975 | 2084 |
1976 self.pluginDeinstallAct = E5Action(self.trUtf8('Uninstall Plugin'), | 2085 self.pluginDeinstallAct = E5Action( |
1977 UI.PixmapCache.getIcon("pluginUninstall.png"), | 2086 self.trUtf8('Uninstall Plugin'), |
1978 self.trUtf8('&Uninstall Plugin...'), 0, 0, self, 'plugin_deinstall') | 2087 UI.PixmapCache.getIcon("pluginUninstall.png"), |
2088 self.trUtf8('&Uninstall Plugin...'), | |
2089 0, 0, self, 'plugin_deinstall') | |
1979 self.pluginDeinstallAct.setStatusTip(self.trUtf8('Uninstall Plugin')) | 2090 self.pluginDeinstallAct.setStatusTip(self.trUtf8('Uninstall Plugin')) |
1980 self.pluginDeinstallAct.setWhatsThis(self.trUtf8( | 2091 self.pluginDeinstallAct.setWhatsThis(self.trUtf8( |
1981 """<b>Uninstall Plugin...</b>""" | 2092 """<b>Uninstall Plugin...</b>""" |
1982 """<p>This opens a dialog to uninstall a plugin.</p>""" | 2093 """<p>This opens a dialog to uninstall a plugin.</p>""" |
1983 )) | 2094 )) |
1984 self.pluginDeinstallAct.triggered[()].connect(self.__deinstallPlugin) | 2095 self.pluginDeinstallAct.triggered[()].connect(self.__deinstallPlugin) |
1985 self.actions.append(self.pluginDeinstallAct) | 2096 self.actions.append(self.pluginDeinstallAct) |
1986 | 2097 |
1987 self.pluginRepoAct = E5Action(self.trUtf8('Plugin Repository'), | 2098 self.pluginRepoAct = E5Action( |
1988 UI.PixmapCache.getIcon("pluginRepository.png"), | 2099 self.trUtf8('Plugin Repository'), |
1989 self.trUtf8('Plugin &Repository...'), 0, 0, self, 'plugin_repository') | 2100 UI.PixmapCache.getIcon("pluginRepository.png"), |
2101 self.trUtf8('Plugin &Repository...'), | |
2102 0, 0, self, 'plugin_repository') | |
1990 self.pluginRepoAct.setStatusTip(self.trUtf8( | 2103 self.pluginRepoAct.setStatusTip(self.trUtf8( |
1991 'Show Plugins available for download')) | 2104 'Show Plugins available for download')) |
1992 self.pluginRepoAct.setWhatsThis(self.trUtf8( | 2105 self.pluginRepoAct.setWhatsThis(self.trUtf8( |
1993 """<b>Plugin Repository...</b>""" | 2106 """<b>Plugin Repository...</b>""" |
1994 """<p>This opens a dialog, that shows a list of plugins """ | 2107 """<p>This opens a dialog, that shows a list of plugins """ |
2011 | 2124 |
2012 def __initQtDocActions(self): | 2125 def __initQtDocActions(self): |
2013 """ | 2126 """ |
2014 Private slot to initialize the action to show the Qt documentation. | 2127 Private slot to initialize the action to show the Qt documentation. |
2015 """ | 2128 """ |
2016 self.qt4DocAct = E5Action(self.trUtf8('Qt4 Documentation'), | 2129 self.qt4DocAct = E5Action( |
2017 self.trUtf8('Qt&4 Documentation'), 0, 0, self, 'qt4_documentation') | 2130 self.trUtf8('Qt4 Documentation'), |
2131 self.trUtf8('Qt&4 Documentation'), | |
2132 0, 0, self, 'qt4_documentation') | |
2018 self.qt4DocAct.setStatusTip(self.trUtf8('Open Qt4 Documentation')) | 2133 self.qt4DocAct.setStatusTip(self.trUtf8('Open Qt4 Documentation')) |
2019 self.qt4DocAct.setWhatsThis(self.trUtf8( | 2134 self.qt4DocAct.setWhatsThis(self.trUtf8( |
2020 """<b>Qt4 Documentation</b>""" | 2135 """<b>Qt4 Documentation</b>""" |
2021 """<p>Display the Qt4 Documentation. Dependant upon your settings, this""" | 2136 """<p>Display the Qt4 Documentation. Dependent upon your""" |
2022 """ will either show the help in Eric's internal help viewer, or execute""" | 2137 """ settings, this will either show the help in Eric's internal""" |
2023 """ a web browser or Qt Assistant. </p>""" | 2138 """ help viewer, or execute a web browser or Qt Assistant. </p>""" |
2024 )) | 2139 )) |
2025 self.qt4DocAct.triggered[()].connect(self.__showQt4Doc) | 2140 self.qt4DocAct.triggered[()].connect(self.__showQt4Doc) |
2026 self.actions.append(self.qt4DocAct) | 2141 self.actions.append(self.qt4DocAct) |
2027 | 2142 |
2028 self.qt5DocAct = E5Action(self.trUtf8('Qt5 Documentation'), | 2143 self.qt5DocAct = E5Action( |
2029 self.trUtf8('Qt&5 Documentation'), 0, 0, self, 'qt5_documentation') | 2144 self.trUtf8('Qt5 Documentation'), |
2145 self.trUtf8('Qt&5 Documentation'), | |
2146 0, 0, self, 'qt5_documentation') | |
2030 self.qt5DocAct.setStatusTip(self.trUtf8('Open Qt5 Documentation')) | 2147 self.qt5DocAct.setStatusTip(self.trUtf8('Open Qt5 Documentation')) |
2031 self.qt5DocAct.setWhatsThis(self.trUtf8( | 2148 self.qt5DocAct.setWhatsThis(self.trUtf8( |
2032 """<b>Qt5 Documentation</b>""" | 2149 """<b>Qt5 Documentation</b>""" |
2033 """<p>Display the Qt5 Documentation. Dependant upon your settings, this""" | 2150 """<p>Display the Qt5 Documentation. Dependent upon your""" |
2034 """ will either show the help in Eric's internal help viewer, or execute""" | 2151 """ settings, this will either show the help in Eric's internal""" |
2035 """ a web browser or Qt Assistant. </p>""" | 2152 """ help viewer, or execute a web browser or Qt Assistant. </p>""" |
2036 )) | 2153 )) |
2037 self.qt5DocAct.triggered[()].connect(self.__showQt5Doc) | 2154 self.qt5DocAct.triggered[()].connect(self.__showQt5Doc) |
2038 self.actions.append(self.qt5DocAct) | 2155 self.actions.append(self.qt5DocAct) |
2039 | 2156 |
2040 self.pyqt4DocAct = E5Action(self.trUtf8('PyQt4 Documentation'), | 2157 self.pyqt4DocAct = E5Action( |
2041 self.trUtf8('PyQt&4 Documentation'), 0, 0, self, 'pyqt4_documentation') | 2158 self.trUtf8('PyQt4 Documentation'), |
2159 self.trUtf8('PyQt&4 Documentation'), | |
2160 0, 0, self, 'pyqt4_documentation') | |
2042 self.pyqt4DocAct.setStatusTip(self.trUtf8('Open PyQt4 Documentation')) | 2161 self.pyqt4DocAct.setStatusTip(self.trUtf8('Open PyQt4 Documentation')) |
2043 self.pyqt4DocAct.setWhatsThis(self.trUtf8( | 2162 self.pyqt4DocAct.setWhatsThis(self.trUtf8( |
2044 """<b>PyQt4 Documentation</b>""" | 2163 """<b>PyQt4 Documentation</b>""" |
2045 """<p>Display the PyQt4 Documentation. Dependant upon your settings, this""" | 2164 """<p>Display the PyQt4 Documentation. Dependent upon your""" |
2046 """ will either show the help in Eric's internal help viewer, or execute""" | 2165 """ settings, this will either show the help in Eric's internal""" |
2047 """ a web browser or Qt Assistant. </p>""" | 2166 """ help viewer, or execute a web browser or Qt Assistant. </p>""" |
2048 )) | 2167 )) |
2049 self.pyqt4DocAct.triggered[()].connect(self.__showPyQt4Doc) | 2168 self.pyqt4DocAct.triggered[()].connect(self.__showPyQt4Doc) |
2050 self.actions.append(self.pyqt4DocAct) | 2169 self.actions.append(self.pyqt4DocAct) |
2051 | 2170 |
2052 try: | 2171 try: |
2053 import PyQt5 # __IGNORE_WARNING__ | 2172 import PyQt5 # __IGNORE_WARNING__ |
2054 self.pyqt5DocAct = E5Action(self.trUtf8('PyQt5 Documentation'), | 2173 self.pyqt5DocAct = E5Action( |
2055 self.trUtf8('PyQt&5 Documentation'), 0, 0, self, 'pyqt5_documentation') | 2174 self.trUtf8('PyQt5 Documentation'), |
2056 self.pyqt5DocAct.setStatusTip(self.trUtf8('Open PyQt5 Documentation')) | 2175 self.trUtf8('PyQt&5 Documentation'), |
2176 0, 0, self, 'pyqt5_documentation') | |
2177 self.pyqt5DocAct.setStatusTip(self.trUtf8( | |
2178 'Open PyQt5 Documentation')) | |
2057 self.pyqt5DocAct.setWhatsThis(self.trUtf8( | 2179 self.pyqt5DocAct.setWhatsThis(self.trUtf8( |
2058 """<b>PyQt5 Documentation</b>""" | 2180 """<b>PyQt5 Documentation</b>""" |
2059 """<p>Display the PyQt5 Documentation. Dependant upon your settings,""" | 2181 """<p>Display the PyQt5 Documentation. Dependent upon your""" |
2060 """ this will either show the help in Eric's internal help viewer,""" | 2182 """ settings, this will either show the help in Eric's""" |
2061 """ or execute a web browser or Qt Assistant. </p>""" | 2183 """ internal help viewer, or execute a web browser or""" |
2184 """ Qt Assistant. </p>""" | |
2062 )) | 2185 )) |
2063 self.pyqt5DocAct.triggered[()].connect(self.__showPyQt5Doc) | 2186 self.pyqt5DocAct.triggered[()].connect(self.__showPyQt5Doc) |
2064 self.actions.append(self.pyqt5DocAct) | 2187 self.actions.append(self.pyqt5DocAct) |
2065 except ImportError: | 2188 except ImportError: |
2066 self.pyqt5DocAct = None | 2189 self.pyqt5DocAct = None |
2067 | 2190 |
2068 def __initPythonDocActions(self): | 2191 def __initPythonDocActions(self): |
2069 """ | 2192 """ |
2070 Private slot to initialize the actions to show the Python documentation. | 2193 Private slot to initialize the actions to show the Python |
2071 """ | 2194 documentation. |
2072 self.pythonDocAct = E5Action(self.trUtf8('Python 3 Documentation'), | 2195 """ |
2073 self.trUtf8('Python &3 Documentation'), 0, 0, self, 'python3_documentation') | 2196 self.pythonDocAct = E5Action( |
2074 self.pythonDocAct.setStatusTip(self.trUtf8('Open Python 3 Documentation')) | 2197 self.trUtf8('Python 3 Documentation'), |
2198 self.trUtf8('Python &3 Documentation'), | |
2199 0, 0, self, 'python3_documentation') | |
2200 self.pythonDocAct.setStatusTip(self.trUtf8( | |
2201 'Open Python 3 Documentation')) | |
2075 self.pythonDocAct.setWhatsThis(self.trUtf8( | 2202 self.pythonDocAct.setWhatsThis(self.trUtf8( |
2076 """<b>Python 3 Documentation</b>""" | 2203 """<b>Python 3 Documentation</b>""" |
2077 """<p>Display the Python 3 documentation.""" | 2204 """<p>Display the Python 3 documentation. If no documentation""" |
2078 """ If no documentation directory is configured,""" | 2205 """ directory is configured, the location of the Python 3""" |
2079 """ the location of the Python 3 documentation is assumed to be the doc""" | 2206 """ documentation is assumed to be the doc directory underneath""" |
2080 """ directory underneath the location of the Python 3 executable on""" | 2207 """ the location of the Python 3 executable on Windows and""" |
2081 """ Windows and <i>/usr/share/doc/packages/python/html</i> on Unix.""" | 2208 """ <i>/usr/share/doc/packages/python/html</i> on Unix. Set""" |
2082 """ Set PYTHON3DOCDIR in your environment to override this. </p>""" | 2209 """ PYTHON3DOCDIR in your environment to override this.</p>""" |
2083 )) | 2210 )) |
2084 self.pythonDocAct.triggered[()].connect(self.__showPythonDoc) | 2211 self.pythonDocAct.triggered[()].connect(self.__showPythonDoc) |
2085 self.actions.append(self.pythonDocAct) | 2212 self.actions.append(self.pythonDocAct) |
2086 | 2213 |
2087 self.python2DocAct = E5Action(self.trUtf8('Python 2 Documentation'), | 2214 self.python2DocAct = E5Action( |
2088 self.trUtf8('Python &2 Documentation'), 0, 0, self, 'python2_documentation') | 2215 self.trUtf8('Python 2 Documentation'), |
2089 self.python2DocAct.setStatusTip(self.trUtf8('Open Python 2 Documentation')) | 2216 self.trUtf8('Python &2 Documentation'), |
2217 0, 0, self, 'python2_documentation') | |
2218 self.python2DocAct.setStatusTip(self.trUtf8( | |
2219 'Open Python 2 Documentation')) | |
2090 self.python2DocAct.setWhatsThis(self.trUtf8( | 2220 self.python2DocAct.setWhatsThis(self.trUtf8( |
2091 """<b>Python 2 Documentation</b>""" | 2221 """<b>Python 2 Documentation</b>""" |
2092 """<p>Display the Python 2 documentation.""" | 2222 """<p>Display the Python 2 documentation. If no documentation""" |
2093 """ If no documentation directory is configured,""" | 2223 """ directory is configured, the location of the Python 2""" |
2094 """ the location of the Python 2 documentation is assumed to be the doc""" | 2224 """ documentation is assumed to be the doc directory underneath""" |
2095 """ directory underneath the location of the configured Python 2""" | 2225 """ the location of the configured Python 2 executable on""" |
2096 """ executable on Windows and""" | 2226 """ Windows and""" |
2097 """ <i>/usr/share/doc/packages/python/html/python-docs-html</i>""" | 2227 """ <i>/usr/share/doc/packages/python/html/python-docs-html</i>""" |
2098 """ on Unix. Set PYTHON2DOCDIR in your environment to override""" | 2228 """ on Unix. Set PYTHON2DOCDIR in your environment to override""" |
2099 """ this. </p>""" | 2229 """ this. </p>""" |
2100 )) | 2230 )) |
2101 self.python2DocAct.triggered[()].connect(self.__showPython2Doc) | 2231 self.python2DocAct.triggered[()].connect(self.__showPython2Doc) |
2102 self.actions.append(self.python2DocAct) | 2232 self.actions.append(self.python2DocAct) |
2103 | 2233 |
2104 def __initEricDocAction(self): | 2234 def __initEricDocAction(self): |
2105 """ | 2235 """ |
2106 Private slot to initialize the action to show the eric5 documentation. | 2236 Private slot to initialize the action to show the eric5 documentation. |
2107 """ | 2237 """ |
2108 self.ericDocAct = E5Action(self.trUtf8("Eric API Documentation"), | 2238 self.ericDocAct = E5Action( |
2109 self.trUtf8('&Eric API Documentation'), 0, 0, self, 'eric_documentation') | 2239 self.trUtf8("Eric API Documentation"), |
2110 self.ericDocAct.setStatusTip(self.trUtf8("Open Eric API Documentation")) | 2240 self.trUtf8('&Eric API Documentation'), |
2241 0, 0, self, 'eric_documentation') | |
2242 self.ericDocAct.setStatusTip(self.trUtf8( | |
2243 "Open Eric API Documentation")) | |
2111 self.ericDocAct.setWhatsThis(self.trUtf8( | 2244 self.ericDocAct.setWhatsThis(self.trUtf8( |
2112 """<b>Eric API Documentation</b>""" | 2245 """<b>Eric API Documentation</b>""" |
2113 """<p>Display the Eric API documentation.""" | 2246 """<p>Display the Eric API documentation. The location for the""" |
2114 """ The location for the documentation is the Documentation/Source""" | 2247 """ documentation is the Documentation/Source subdirectory of""" |
2115 """ subdirectory of the eric5 installation directory.</p>""" | 2248 """ the eric5 installation directory.</p>""" |
2116 )) | 2249 )) |
2117 self.ericDocAct.triggered[()].connect(self.__showEricDoc) | 2250 self.ericDocAct.triggered[()].connect(self.__showEricDoc) |
2118 self.actions.append(self.ericDocAct) | 2251 self.actions.append(self.ericDocAct) |
2119 | 2252 |
2120 def __initPySideDocAction(self): | 2253 def __initPySideDocAction(self): |
2121 """ | 2254 """ |
2122 Private slot to initialize the action to show the PySide documentation. | 2255 Private slot to initialize the action to show the PySide documentation. |
2123 """ | 2256 """ |
2124 pyside2, pyside3 = Utilities.checkPyside() | 2257 pyside2, pyside3 = Utilities.checkPyside() |
2125 if pyside2 or pyside3: | 2258 if pyside2 or pyside3: |
2126 self.pysideDocAct = E5Action(self.trUtf8('PySide Documentation'), | 2259 self.pysideDocAct = E5Action( |
2127 self.trUtf8('Py&Side Documentation'), 0, 0, self, 'pyside_documentation') | 2260 self.trUtf8('PySide Documentation'), |
2128 self.pysideDocAct.setStatusTip(self.trUtf8('Open PySide Documentation')) | 2261 self.trUtf8('Py&Side Documentation'), |
2262 0, 0, self, 'pyside_documentation') | |
2263 self.pysideDocAct.setStatusTip(self.trUtf8( | |
2264 'Open PySide Documentation')) | |
2129 self.pysideDocAct.setWhatsThis(self.trUtf8( | 2265 self.pysideDocAct.setWhatsThis(self.trUtf8( |
2130 """<b>PySide Documentation</b>""" | 2266 """<b>PySide Documentation</b>""" |
2131 """<p>Display the PySide Documentation. Dependant upon your settings, """ | 2267 """<p>Display the PySide Documentation. Dependent upon your""" |
2132 """this will either show the help in Eric's internal help viewer, or """ | 2268 """ settings, this will either show the help in Eric's""" |
2133 """execute a web browser or Qt Assistant. </p>""" | 2269 """ internal help viewer, or execute a web browser or""" |
2270 """ Qt Assistant. </p>""" | |
2134 )) | 2271 )) |
2135 self.pysideDocAct.triggered[()].connect(self.__showPySideDoc) | 2272 self.pysideDocAct.triggered[()].connect(self.__showPySideDoc) |
2136 self.actions.append(self.pysideDocAct) | 2273 self.actions.append(self.pysideDocAct) |
2137 else: | 2274 else: |
2138 self.pysideDocAct = None | 2275 self.pysideDocAct = None |
2157 mb.addMenu(self.__menus["edit"]) | 2294 mb.addMenu(self.__menus["edit"]) |
2158 | 2295 |
2159 self.__menus["view"] = self.viewmanager.initViewMenu() | 2296 self.__menus["view"] = self.viewmanager.initViewMenu() |
2160 mb.addMenu(self.__menus["view"]) | 2297 mb.addMenu(self.__menus["view"]) |
2161 | 2298 |
2162 self.__menus["start"], self.__menus["debug"] = self.debuggerUI.initMenus() | 2299 self.__menus["start"], self.__menus["debug"] = \ |
2300 self.debuggerUI.initMenus() | |
2163 mb.addMenu(self.__menus["start"]) | 2301 mb.addMenu(self.__menus["start"]) |
2164 mb.addMenu(self.__menus["debug"]) | 2302 mb.addMenu(self.__menus["debug"]) |
2165 | 2303 |
2166 self.__menus["unittest"] = QMenu(self.trUtf8('&Unittest'), self) | 2304 self.__menus["unittest"] = QMenu(self.trUtf8('&Unittest'), self) |
2167 self.__menus["unittest"].setTearOffEnabled(True) | 2305 self.__menus["unittest"].setTearOffEnabled(True) |
2186 mb.addMenu(self.__menus["extras"]) | 2324 mb.addMenu(self.__menus["extras"]) |
2187 self.viewmanager.addToExtrasMenu(self.__menus["extras"]) | 2325 self.viewmanager.addToExtrasMenu(self.__menus["extras"]) |
2188 self.__menus["wizards"] = QMenu(self.trUtf8('Wi&zards'), self) | 2326 self.__menus["wizards"] = QMenu(self.trUtf8('Wi&zards'), self) |
2189 self.__menus["wizards"].setTearOffEnabled(True) | 2327 self.__menus["wizards"].setTearOffEnabled(True) |
2190 self.__menus["wizards"].aboutToShow.connect(self.__showWizardsMenu) | 2328 self.__menus["wizards"].aboutToShow.connect(self.__showWizardsMenu) |
2191 self.wizardsMenuAct = self.__menus["extras"].addMenu(self.__menus["wizards"]) | 2329 self.wizardsMenuAct = self.__menus["extras"].addMenu( |
2330 self.__menus["wizards"]) | |
2192 self.wizardsMenuAct.setEnabled(False) | 2331 self.wizardsMenuAct.setEnabled(False) |
2193 self.__menus["macros"] = self.viewmanager.initMacroMenu() | 2332 self.__menus["macros"] = self.viewmanager.initMacroMenu() |
2194 self.__menus["extras"].addMenu(self.__menus["macros"]) | 2333 self.__menus["extras"].addMenu(self.__menus["macros"]) |
2195 self.__menus["tools"] = QMenu(self.trUtf8('&Tools'), self) | 2334 self.__menus["tools"] = QMenu(self.trUtf8('&Tools'), self) |
2196 self.__menus["tools"].aboutToShow.connect(self.__showToolsMenu) | 2335 self.__menus["tools"].aboutToShow.connect(self.__showToolsMenu) |
2227 self.__menus["window"] = QMenu(self.trUtf8('&Window'), self) | 2366 self.__menus["window"] = QMenu(self.trUtf8('&Window'), self) |
2228 mb.addMenu(self.__menus["window"]) | 2367 mb.addMenu(self.__menus["window"]) |
2229 self.__menus["window"].setTearOffEnabled(True) | 2368 self.__menus["window"].setTearOffEnabled(True) |
2230 self.__menus["window"].aboutToShow.connect(self.__showWindowMenu) | 2369 self.__menus["window"].aboutToShow.connect(self.__showWindowMenu) |
2231 | 2370 |
2232 self.__menus["subwindow"] = QMenu(self.trUtf8("&Windows"), self.__menus["window"]) | 2371 self.__menus["subwindow"] = QMenu(self.trUtf8("&Windows"), |
2372 self.__menus["window"]) | |
2233 self.__menus["subwindow"].setTearOffEnabled(True) | 2373 self.__menus["subwindow"].setTearOffEnabled(True) |
2234 # left side | 2374 # left side |
2235 self.__menus["subwindow"].addAction(self.pbActivateAct) | 2375 self.__menus["subwindow"].addAction(self.pbActivateAct) |
2236 self.__menus["subwindow"].addAction(self.mpbActivateAct) | 2376 self.__menus["subwindow"].addAction(self.mpbActivateAct) |
2237 self.__menus["subwindow"].addAction(self.templateViewerActivateAct) | 2377 self.__menus["subwindow"].addAction(self.templateViewerActivateAct) |
2312 """ | 2452 """ |
2313 Private slot to create the toolbars. | 2453 Private slot to create the toolbars. |
2314 """ | 2454 """ |
2315 filetb = self.viewmanager.initFileToolbar(self.toolbarManager) | 2455 filetb = self.viewmanager.initFileToolbar(self.toolbarManager) |
2316 edittb = self.viewmanager.initEditToolbar(self.toolbarManager) | 2456 edittb = self.viewmanager.initEditToolbar(self.toolbarManager) |
2317 searchtb, quicksearchtb = self.viewmanager.initSearchToolbars(self.toolbarManager) | 2457 searchtb, quicksearchtb = self.viewmanager.initSearchToolbars( |
2458 self.toolbarManager) | |
2318 viewtb = self.viewmanager.initViewToolbar(self.toolbarManager) | 2459 viewtb = self.viewmanager.initViewToolbar(self.toolbarManager) |
2319 starttb, debugtb = self.debuggerUI.initToolbars(self.toolbarManager) | 2460 starttb, debugtb = self.debuggerUI.initToolbars(self.toolbarManager) |
2320 multiprojecttb = self.multiProject.initToolbar(self.toolbarManager) | 2461 multiprojecttb = self.multiProject.initToolbar(self.toolbarManager) |
2321 projecttb = self.project.initToolbar(self.toolbarManager) | 2462 projecttb = self.project.initToolbar(self.toolbarManager) |
2322 toolstb = QToolBar(self.trUtf8("Tools"), self) | 2463 toolstb = QToolBar(self.trUtf8("Tools"), self) |
2391 settingstb.addAction(self.configViewProfilesAct) | 2532 settingstb.addAction(self.configViewProfilesAct) |
2392 settingstb.addAction(self.configToolBarsAct) | 2533 settingstb.addAction(self.configToolBarsAct) |
2393 settingstb.addAction(self.shortcutsAct) | 2534 settingstb.addAction(self.shortcutsAct) |
2394 settingstb.addAction(self.showExternalToolsAct) | 2535 settingstb.addAction(self.showExternalToolsAct) |
2395 self.toolbarManager.addToolBar(settingstb, settingstb.windowTitle()) | 2536 self.toolbarManager.addToolBar(settingstb, settingstb.windowTitle()) |
2396 self.toolbarManager.addAction(self.exportShortcutsAct, settingstb.windowTitle()) | 2537 self.toolbarManager.addAction( |
2397 self.toolbarManager.addAction(self.importShortcutsAct, settingstb.windowTitle()) | 2538 self.exportShortcutsAct, settingstb.windowTitle()) |
2539 self.toolbarManager.addAction( | |
2540 self.importShortcutsAct, settingstb.windowTitle()) | |
2398 | 2541 |
2399 # setup the help toolbar | 2542 # setup the help toolbar |
2400 helptb.addAction(self.whatsThisAct) | 2543 helptb.addAction(self.whatsThisAct) |
2401 self.toolbarManager.addToolBar(helptb, helptb.windowTitle()) | 2544 self.toolbarManager.addToolBar(helptb, helptb.windowTitle()) |
2402 self.toolbarManager.addAction(self.helpviewerAct, helptb.windowTitle()) | 2545 self.toolbarManager.addAction(self.helpviewerAct, helptb.windowTitle()) |
2455 self.__toolbars["tools"] = [toolstb.windowTitle(), toolstb] | 2598 self.__toolbars["tools"] = [toolstb.windowTitle(), toolstb] |
2456 self.__toolbars["help"] = [helptb.windowTitle(), helptb] | 2599 self.__toolbars["help"] = [helptb.windowTitle(), helptb] |
2457 self.__toolbars["settings"] = [settingstb.windowTitle(), settingstb] | 2600 self.__toolbars["settings"] = [settingstb.windowTitle(), settingstb] |
2458 self.__toolbars["bookmarks"] = [bookmarktb.windowTitle(), bookmarktb] | 2601 self.__toolbars["bookmarks"] = [bookmarktb.windowTitle(), bookmarktb] |
2459 self.__toolbars["unittest"] = [unittesttb.windowTitle(), unittesttb] | 2602 self.__toolbars["unittest"] = [unittesttb.windowTitle(), unittesttb] |
2460 self.__toolbars["view_profiles"] = [profilestb.windowTitle(), profilestb] | 2603 self.__toolbars["view_profiles"] = [profilestb.windowTitle(), |
2604 profilestb] | |
2461 self.__toolbars["plugins"] = [pluginstb.windowTitle(), pluginstb] | 2605 self.__toolbars["plugins"] = [pluginstb.windowTitle(), pluginstb] |
2462 self.__toolbars["quicksearch"] = [quicksearchtb.windowTitle(), quicksearchtb] | 2606 self.__toolbars["quicksearch"] = [quicksearchtb.windowTitle(), |
2463 self.__toolbars["multiproject"] = [multiprojecttb.windowTitle(), multiprojecttb] | 2607 quicksearchtb] |
2608 self.__toolbars["multiproject"] = [multiprojecttb.windowTitle(), | |
2609 multiprojecttb] | |
2464 self.__toolbars["spelling"] = [spellingtb.windowTitle(), spellingtb] | 2610 self.__toolbars["spelling"] = [spellingtb.windowTitle(), spellingtb] |
2465 | 2611 |
2466 def __initDebugToolbarsLayout(self): | 2612 def __initDebugToolbarsLayout(self): |
2467 """ | 2613 """ |
2468 Private slot to initialize the toolbars layout for the debug profile. | 2614 Private slot to initialize the toolbars layout for the debug profile. |
2516 )) | 2662 )) |
2517 | 2663 |
2518 self.sbLine = QLabel(self.__statusBar) | 2664 self.sbLine = QLabel(self.__statusBar) |
2519 self.__statusBar.addPermanentWidget(self.sbLine) | 2665 self.__statusBar.addPermanentWidget(self.sbLine) |
2520 self.sbLine.setWhatsThis(self.trUtf8( | 2666 self.sbLine.setWhatsThis(self.trUtf8( |
2521 """<p>This part of the status bar displays the line number of the""" | 2667 """<p>This part of the status bar displays the line number of""" |
2522 """ current editor.</p>""" | 2668 """ the current editor.</p>""" |
2523 )) | 2669 )) |
2524 | 2670 |
2525 self.sbPos = QLabel(self.__statusBar) | 2671 self.sbPos = QLabel(self.__statusBar) |
2526 self.__statusBar.addPermanentWidget(self.sbPos) | 2672 self.__statusBar.addPermanentWidget(self.sbPos) |
2527 self.sbPos.setWhatsThis(self.trUtf8( | 2673 self.sbPos.setWhatsThis(self.trUtf8( |
2528 """<p>This part of the status bar displays the cursor position of""" | 2674 """<p>This part of the status bar displays the cursor position""" |
2529 """ the current editor.</p>""" | 2675 """ of the current editor.</p>""" |
2530 )) | 2676 )) |
2531 | 2677 |
2532 self.sbZoom = E5ZoomWidget(UI.PixmapCache.getPixmap("zoomOut.png"), | 2678 self.sbZoom = E5ZoomWidget(UI.PixmapCache.getPixmap("zoomOut.png"), |
2533 UI.PixmapCache.getPixmap("zoomIn.png"), | 2679 UI.PixmapCache.getPixmap("zoomIn.png"), |
2534 UI.PixmapCache.getPixmap("zoomReset.png"), | 2680 UI.PixmapCache.getPixmap("zoomReset.png"), |
2535 self.__statusBar) | 2681 self.__statusBar) |
2536 self.__statusBar.addPermanentWidget(self.sbZoom) | 2682 self.__statusBar.addPermanentWidget(self.sbZoom) |
2537 self.sbZoom.setWhatsThis(self.trUtf8( | 2683 self.sbZoom.setWhatsThis(self.trUtf8( |
2538 """<p>This part of the status bar allows zooming the current editor,""" | 2684 """<p>This part of the status bar allows zooming the current""" |
2539 """ shell or terminal.</p>""" | 2685 """ editor, shell or terminal.</p>""" |
2540 )) | 2686 )) |
2541 | 2687 |
2542 self.viewmanager.setSbInfo(self.sbLine, self.sbPos, self.sbWritable, | 2688 self.viewmanager.setSbInfo( |
2543 self.sbEncoding, self.sbLanguage, self.sbEol, | 2689 self.sbLine, self.sbPos, self.sbWritable, self.sbEncoding, |
2544 self.sbZoom) | 2690 self.sbLanguage, self.sbEol, self.sbZoom) |
2545 | 2691 |
2546 from VCS.StatusMonitorLed import StatusMonitorLed | 2692 from VCS.StatusMonitorLed import StatusMonitorLed |
2547 self.sbVcsMonitorLed = StatusMonitorLed(self.project, self.__statusBar) | 2693 self.sbVcsMonitorLed = StatusMonitorLed(self.project, self.__statusBar) |
2548 self.__statusBar.addPermanentWidget(self.sbVcsMonitorLed) | 2694 self.__statusBar.addPermanentWidget(self.sbVcsMonitorLed) |
2549 | 2695 |
2554 self.toolGroupActions = {} | 2700 self.toolGroupActions = {} |
2555 for toolGroup in self.toolGroups: | 2701 for toolGroup in self.toolGroups: |
2556 category = self.trUtf8("External Tools/{0}").format(toolGroup[0]) | 2702 category = self.trUtf8("External Tools/{0}").format(toolGroup[0]) |
2557 for tool in toolGroup[1]: | 2703 for tool in toolGroup[1]: |
2558 if tool['menutext'] != '--': | 2704 if tool['menutext'] != '--': |
2559 act = QAction(UI.PixmapCache.getIcon(tool['icon']), tool['menutext'], | 2705 act = QAction(UI.PixmapCache.getIcon(tool['icon']), |
2560 self) | 2706 tool['menutext'], self) |
2561 act.setObjectName("{0}@@{1}".format(toolGroup[0], | 2707 act.setObjectName("{0}@@{1}".format(toolGroup[0], |
2562 tool['menutext'])) | 2708 tool['menutext'])) |
2563 act.triggered[()].connect(self.__toolActionTriggered) | 2709 act.triggered[()].connect(self.__toolActionTriggered) |
2564 self.toolGroupActions[act.objectName()] = act | 2710 self.toolGroupActions[act.objectName()] = act |
2565 | 2711 |
2566 self.toolbarManager.addAction(act, category) | 2712 self.toolbarManager.addAction(act, category) |
2567 | 2713 |
2568 def __updateExternalToolsActions(self): | 2714 def __updateExternalToolsActions(self): |
2569 """ | 2715 """ |
2570 Private method to update the external tools actions for the current tool group. | 2716 Private method to update the external tools actions for the current |
2717 tool group. | |
2571 """ | 2718 """ |
2572 toolGroup = self.toolGroups[self.currentToolGroup] | 2719 toolGroup = self.toolGroups[self.currentToolGroup] |
2573 groupkey = "{0}@@".format(toolGroup[0]) | 2720 groupkey = "{0}@@".format(toolGroup[0]) |
2574 groupActionKeys = [] | 2721 groupActionKeys = [] |
2575 # step 1: get actions for this group | 2722 # step 1: get actions for this group |
2595 category = self.trUtf8("External Tools/{0}").format(toolGroup[0]) | 2742 category = self.trUtf8("External Tools/{0}").format(toolGroup[0]) |
2596 for tool in toolGroup[1]: | 2743 for tool in toolGroup[1]: |
2597 if tool['menutext'] != '--': | 2744 if tool['menutext'] != '--': |
2598 key = "{0}@@{1}".format(toolGroup[0], tool['menutext']) | 2745 key = "{0}@@{1}".format(toolGroup[0], tool['menutext']) |
2599 if key not in groupActionKeys: | 2746 if key not in groupActionKeys: |
2600 act = QAction(UI.PixmapCache.getIcon(tool['icon']), tool['menutext'], | 2747 act = QAction(UI.PixmapCache.getIcon(tool['icon']), |
2601 self) | 2748 tool['menutext'], self) |
2602 act.setObjectName(key) | 2749 act.setObjectName(key) |
2603 act.triggered[()].connect(self.__toolActionTriggered) | 2750 act.triggered[()].connect(self.__toolActionTriggered) |
2604 self.toolGroupActions[key] = act | 2751 self.toolGroupActions[key] = act |
2605 | 2752 |
2606 self.toolbarManager.addAction(act, category) | 2753 self.toolbarManager.addAction(act, category) |
2634 | 2781 |
2635 def __showSettingsMenu(self): | 2782 def __showSettingsMenu(self): |
2636 """ | 2783 """ |
2637 Private slot to show the Settings menu. | 2784 Private slot to show the Settings menu. |
2638 """ | 2785 """ |
2639 self.editMessageFilterAct.setEnabled(E5ErrorMessage.messageHandlerInstalled()) | 2786 self.editMessageFilterAct.setEnabled( |
2787 E5ErrorMessage.messageHandlerInstalled()) | |
2640 | 2788 |
2641 self.showMenu.emit("Settings", self.__menus["settings"]) | 2789 self.showMenu.emit("Settings", self.__menus["settings"]) |
2642 | 2790 |
2643 def __showNext(self): | 2791 def __showNext(self): |
2644 """ | 2792 """ |
2660 if fwidget: | 2808 if fwidget: |
2661 fwidget.prevTab() | 2809 fwidget.prevTab() |
2662 | 2810 |
2663 def __switchTab(self): | 2811 def __switchTab(self): |
2664 """ | 2812 """ |
2665 Private slot used to switch between the current and the previous current tab. | 2813 Private slot used to switch between the current and the previous |
2814 current tab. | |
2666 """ | 2815 """ |
2667 fwidget = QApplication.focusWidget() | 2816 fwidget = QApplication.focusWidget() |
2668 while fwidget and not hasattr(fwidget, 'switchTab'): | 2817 while fwidget and not hasattr(fwidget, 'switchTab'): |
2669 fwidget = fwidget.parent() | 2818 fwidget = fwidget.parent() |
2670 if fwidget: | 2819 if fwidget: |
2727 """ | 2876 """ |
2728 Public slot to show the email dialog in a given mode. | 2877 Public slot to show the email dialog in a given mode. |
2729 | 2878 |
2730 @param mode mode of the email dialog (string, "bug" or "feature") | 2879 @param mode mode of the email dialog (string, "bug" or "feature") |
2731 @param attachFile name of a file to attach to the email (string) | 2880 @param attachFile name of a file to attach to the email (string) |
2732 @param deleteAttachFile flag indicating to delete the attached file after | 2881 @param deleteAttachFile flag indicating to delete the attached file |
2733 it has been sent (boolean) | 2882 after it has been sent (boolean) |
2734 """ | 2883 """ |
2735 if Preferences.getUser("UseSystemEmailClient"): | 2884 if Preferences.getUser("UseSystemEmailClient"): |
2736 self.__showSystemEmailClient(mode, attachFile, deleteAttachFile) | 2885 self.__showSystemEmailClient(mode, attachFile, deleteAttachFile) |
2737 else: | 2886 else: |
2738 if Preferences.getUser("Email") == "" or \ | 2887 if Preferences.getUser("Email") == "" or \ |
2739 Preferences.getUser("MailServer") == "": | 2888 Preferences.getUser("MailServer") == "": |
2740 E5MessageBox.critical(self, | 2889 E5MessageBox.critical(self, |
2741 self.trUtf8("Report Bug"), | 2890 self.trUtf8("Report Bug"), |
2742 self.trUtf8("""Email address or mail server address is empty.""" | 2891 self.trUtf8( |
2743 """ Please configure your Email settings in the""" | 2892 """Email address or mail server address is empty.""" |
2744 """ Preferences Dialog.""")) | 2893 """ Please configure your Email settings in the""" |
2894 """ Preferences Dialog.""")) | |
2745 self.showPreferences("emailPage") | 2895 self.showPreferences("emailPage") |
2746 return | 2896 return |
2747 | 2897 |
2748 from .EmailDialog import EmailDialog | 2898 from .EmailDialog import EmailDialog |
2749 self.dlg = EmailDialog(mode=mode) | 2899 self.dlg = EmailDialog(mode=mode) |
2750 if attachFile is not None: | 2900 if attachFile is not None: |
2751 self.dlg.attachFile(attachFile, deleteAttachFile) | 2901 self.dlg.attachFile(attachFile, deleteAttachFile) |
2752 self.dlg.show() | 2902 self.dlg.show() |
2753 | 2903 |
2754 def __showSystemEmailClient(self, mode, attachFile=None, deleteAttachFile=False): | 2904 def __showSystemEmailClient(self, mode, attachFile=None, |
2905 deleteAttachFile=False): | |
2755 """ | 2906 """ |
2756 Private slot to show the system email dialog. | 2907 Private slot to show the system email dialog. |
2757 | 2908 |
2758 @param mode mode of the email dialog (string, "bug" or "feature") | 2909 @param mode mode of the email dialog (string, "bug" or "feature") |
2759 @param attachFile name of a file to put into the body of the | 2910 @param attachFile name of a file to put into the body of the |
2783 url.addQueryItem("body", body) | 2934 url.addQueryItem("body", body) |
2784 QDesktopServices.openUrl(url) | 2935 QDesktopServices.openUrl(url) |
2785 | 2936 |
2786 def checkForErrorLog(self): | 2937 def checkForErrorLog(self): |
2787 """ | 2938 """ |
2788 Public method to check for the presence of an error log and ask the user, | 2939 Public method to check for the presence of an error log and ask the |
2789 what to do with it. | 2940 user, what to do with it. |
2790 """ | 2941 """ |
2791 if Preferences.getUI("CheckErrorLog"): | 2942 if Preferences.getUI("CheckErrorLog"): |
2792 logFile = os.path.join(Utilities.getConfigDir(), "eric5_error.log") | 2943 logFile = os.path.join(Utilities.getConfigDir(), "eric5_error.log") |
2793 if os.path.exists(logFile): | 2944 if os.path.exists(logFile): |
2794 from .ErrorLogDialog import ErrorLogDialog | 2945 from .ErrorLogDialog import ErrorLogDialog |
2827 | 2978 |
2828 def addE5Actions(self, actions, type): | 2979 def addE5Actions(self, actions, type): |
2829 """ | 2980 """ |
2830 Public method to add actions to the list of actions. | 2981 Public method to add actions to the list of actions. |
2831 | 2982 |
2983 @param actions list of actions to be added (list of E5Action) | |
2832 @param type string denoting the action set to get. | 2984 @param type string denoting the action set to get. |
2833 It must be one of "ui" or "wizards". | 2985 It must be one of "ui" or "wizards". |
2834 @param actions list of actions to be added (list of E5Action) | |
2835 """ | 2986 """ |
2836 if type == 'ui': | 2987 if type == 'ui': |
2837 self.actions.extend(actions) | 2988 self.actions.extend(actions) |
2838 elif type == 'wizards': | 2989 elif type == 'wizards': |
2839 self.wizardsActions.extend(actions) | 2990 self.wizardsActions.extend(actions) |
2840 | 2991 |
2841 def removeE5Actions(self, actions, type='ui'): | 2992 def removeE5Actions(self, actions, type='ui'): |
2842 """ | 2993 """ |
2843 Public method to remove actions from the list of actions. | 2994 Public method to remove actions from the list of actions. |
2844 | 2995 |
2996 @param actions list of actions (list of E5Action) | |
2845 @param type string denoting the action set to get. | 2997 @param type string denoting the action set to get. |
2846 It must be one of "ui" or "wizards". | 2998 It must be one of "ui" or "wizards". |
2847 @param actions list of actions (list of E5Action) | |
2848 """ | 2999 """ |
2849 for act in actions: | 3000 for act in actions: |
2850 try: | 3001 try: |
2851 if type == 'ui': | 3002 if type == 'ui': |
2852 self.actions.remove(act) | 3003 self.actions.remove(act) |
2875 Public method to get a reference to an action of a menu. | 3026 Public method to get a reference to an action of a menu. |
2876 | 3027 |
2877 @param menuName name of the menu to search in (string) | 3028 @param menuName name of the menu to search in (string) |
2878 @param actionName object name of the action to search for | 3029 @param actionName object name of the action to search for |
2879 (string) | 3030 (string) |
3031 @return reference to the menu action (QAction) | |
2880 """ | 3032 """ |
2881 try: | 3033 try: |
2882 menu = self.__menus[menuName] | 3034 menu = self.__menus[menuName] |
2883 except KeyError: | 3035 except KeyError: |
2884 return None | 3036 return None |
2892 def getMenuBarAction(self, menuName): | 3044 def getMenuBarAction(self, menuName): |
2893 """ | 3045 """ |
2894 Public method to get a reference to an action of the main menu. | 3046 Public method to get a reference to an action of the main menu. |
2895 | 3047 |
2896 @param menuName name of the menu to search in (string) | 3048 @param menuName name of the menu to search in (string) |
3049 @return reference to the menu bar action (QAction) | |
2897 """ | 3050 """ |
2898 try: | 3051 try: |
2899 menu = self.__menus[menuName] | 3052 menu = self.__menus[menuName] |
2900 except KeyError: | 3053 except KeyError: |
2901 return None | 3054 return None |
2981 | 3134 |
2982 def __restart(self): | 3135 def __restart(self): |
2983 """ | 3136 """ |
2984 Private method to restart the application. | 3137 Private method to restart the application. |
2985 """ | 3138 """ |
2986 res = E5MessageBox.yesNo(self, | 3139 res = E5MessageBox.yesNo( |
3140 self, | |
2987 self.trUtf8("Restart application"), | 3141 self.trUtf8("Restart application"), |
2988 self.trUtf8("""The application needs to be restarted. Do it now?"""), | 3142 self.trUtf8( |
3143 """The application needs to be restarted. Do it now?"""), | |
2989 yesDefault=True) | 3144 yesDefault=True) |
2990 | 3145 |
2991 if res and self.__shutdown(): | 3146 if res and self.__shutdown(): |
2992 e5App().closeAllWindows() | 3147 e5App().closeAllWindows() |
2993 program = sys.executable | 3148 program = sys.executable |
3013 Private slot to display the Tools menu. | 3168 Private slot to display the Tools menu. |
3014 """ | 3169 """ |
3015 self.__menus["tools"].clear() | 3170 self.__menus["tools"].clear() |
3016 | 3171 |
3017 self.__menus["tools"].addMenu(self.toolGroupsMenu) | 3172 self.__menus["tools"].addMenu(self.toolGroupsMenu) |
3018 act = self.__menus["tools"].addAction(self.trUtf8("Configure Tool Groups ..."), | 3173 act = self.__menus["tools"].addAction( |
3174 self.trUtf8("Configure Tool Groups ..."), | |
3019 self.__toolGroupsConfiguration) | 3175 self.__toolGroupsConfiguration) |
3020 act.setData(-1) | 3176 act.setData(-1) |
3021 act = self.__menus["tools"].addAction( | 3177 act = self.__menus["tools"].addAction( |
3022 self.trUtf8("Configure current Tool Group ..."), | 3178 self.trUtf8("Configure current Tool Group ..."), |
3023 self.__toolsConfiguration) | 3179 self.__toolsConfiguration) |
3051 for tool in self.toolGroups[self.currentToolGroup][1]: | 3207 for tool in self.toolGroups[self.currentToolGroup][1]: |
3052 if tool['menutext'] == '--': | 3208 if tool['menutext'] == '--': |
3053 self.__menus["tools"].addSeparator() | 3209 self.__menus["tools"].addSeparator() |
3054 else: | 3210 else: |
3055 act = self.__menus["tools"].addAction( | 3211 act = self.__menus["tools"].addAction( |
3056 UI.PixmapCache.getIcon(tool['icon']), tool['menutext']) | 3212 UI.PixmapCache.getIcon(tool['icon']), |
3213 tool['menutext']) | |
3057 act.setData(idx) | 3214 act.setData(idx) |
3058 idx += 1 | 3215 idx += 1 |
3059 except IndexError: | 3216 except IndexError: |
3060 # the current tool group might have been deleted | 3217 # the current tool group might have been deleted |
3061 pass | 3218 pass |
3219 self.profiles[self.currentProfile][2][4] = state | 3376 self.profiles[self.currentProfile][2][4] = state |
3220 state = self.rightSidebar.saveState() | 3377 state = self.rightSidebar.saveState() |
3221 self.profiles[self.currentProfile][2][5] = state | 3378 self.profiles[self.currentProfile][2][5] = state |
3222 # step 2: save the visibility of the windows of the active profile | 3379 # step 2: save the visibility of the windows of the active profile |
3223 if self.layout == "Toolboxes": | 3380 if self.layout == "Toolboxes": |
3224 self.profiles[self.currentProfile][1][0] = self.lToolboxDock.isVisible() | 3381 self.profiles[self.currentProfile][1][0] = \ |
3225 self.profiles[self.currentProfile][1][1] = self.hToolboxDock.isVisible() | 3382 self.lToolboxDock.isVisible() |
3226 self.profiles[self.currentProfile][1][2] = self.rToolboxDock.isVisible() | 3383 self.profiles[self.currentProfile][1][1] = \ |
3384 self.hToolboxDock.isVisible() | |
3385 self.profiles[self.currentProfile][1][2] = \ | |
3386 self.rToolboxDock.isVisible() | |
3227 elif self.layout == "Sidebars": | 3387 elif self.layout == "Sidebars": |
3228 self.profiles[self.currentProfile][1][0] = self.leftSidebar.isVisible() | 3388 self.profiles[self.currentProfile][1][0] = \ |
3229 self.profiles[self.currentProfile][1][1] = self.bottomSidebar.isVisible() | 3389 self.leftSidebar.isVisible() |
3230 self.profiles[self.currentProfile][1][2] = self.rightSidebar.isVisible() | 3390 self.profiles[self.currentProfile][1][1] = \ |
3391 self.bottomSidebar.isVisible() | |
3392 self.profiles[self.currentProfile][1][2] = \ | |
3393 self.rightSidebar.isVisible() | |
3231 Preferences.setUI("ViewProfiles2", self.profiles) | 3394 Preferences.setUI("ViewProfiles2", self.profiles) |
3232 | 3395 |
3233 def __activateViewProfile(self, name, save=True): | 3396 def __activateViewProfile(self, name, save=True): |
3234 """ | 3397 """ |
3235 Private slot to activate a view profile. | 3398 Private slot to activate a view profile. |
3282 self.currentProfile = name | 3445 self.currentProfile = name |
3283 | 3446 |
3284 # step 5: make sure that cursor of the shell is visible | 3447 # step 5: make sure that cursor of the shell is visible |
3285 self.shell.ensureCursorVisible() | 3448 self.shell.ensureCursorVisible() |
3286 | 3449 |
3287 # step 6: make sure, that the toolbars and window menu are shown correctly | 3450 # step 6: make sure, that the toolbars and window menu are |
3451 # shown correctly | |
3288 if self.__menus["toolbars"].isTearOffMenuVisible(): | 3452 if self.__menus["toolbars"].isTearOffMenuVisible(): |
3289 self.__showToolbarsMenu() | 3453 self.__showToolbarsMenu() |
3290 if self.__menus["window"].isTearOffMenuVisible(): | 3454 if self.__menus["window"].isTearOffMenuVisible(): |
3291 self.__showWindowMenu() | 3455 self.__showWindowMenu() |
3292 | 3456 |
3367 elif self.layout == "Sidebars": | 3531 elif self.layout == "Sidebars": |
3368 self.leftSidebar.show() | 3532 self.leftSidebar.show() |
3369 self.leftSidebar.setCurrentWidget(self.projectBrowser) | 3533 self.leftSidebar.setCurrentWidget(self.projectBrowser) |
3370 else: | 3534 else: |
3371 self.projectBrowser.show() | 3535 self.projectBrowser.show() |
3372 self.projectBrowser.currentWidget().setFocus(Qt.ActiveWindowFocusReason) | 3536 self.projectBrowser.currentWidget().setFocus( |
3537 Qt.ActiveWindowFocusReason) | |
3373 | 3538 |
3374 def __activateMultiProjectBrowser(self): | 3539 def __activateMultiProjectBrowser(self): |
3375 """ | 3540 """ |
3376 Private slot to handle the activation of the project browser. | 3541 Private slot to handle the activation of the project browser. |
3377 """ | 3542 """ |
3542 Private slot to handle the toggle of the left sidebar window. | 3707 Private slot to handle the toggle of the left sidebar window. |
3543 """ | 3708 """ |
3544 hasFocus = self.leftSidebar.currentWidget().hasFocus() | 3709 hasFocus = self.leftSidebar.currentWidget().hasFocus() |
3545 shown = self.__toggleWindow(self.leftSidebar) | 3710 shown = self.__toggleWindow(self.leftSidebar) |
3546 if shown: | 3711 if shown: |
3547 self.leftSidebar.currentWidget().setFocus(Qt.ActiveWindowFocusReason) | 3712 self.leftSidebar.currentWidget().setFocus( |
3713 Qt.ActiveWindowFocusReason) | |
3548 else: | 3714 else: |
3549 if hasFocus: | 3715 if hasFocus: |
3550 self.__activateViewmanager() | 3716 self.__activateViewmanager() |
3551 | 3717 |
3552 def __toggleRightSidebar(self): | 3718 def __toggleRightSidebar(self): |
3554 Private slot to handle the toggle of the right sidebar window. | 3720 Private slot to handle the toggle of the right sidebar window. |
3555 """ | 3721 """ |
3556 hasFocus = self.rightSidebar.currentWidget().hasFocus() | 3722 hasFocus = self.rightSidebar.currentWidget().hasFocus() |
3557 shown = self.__toggleWindow(self.rightSidebar) | 3723 shown = self.__toggleWindow(self.rightSidebar) |
3558 if shown: | 3724 if shown: |
3559 self.rightSidebar.currentWidget().setFocus(Qt.ActiveWindowFocusReason) | 3725 self.rightSidebar.currentWidget().setFocus( |
3726 Qt.ActiveWindowFocusReason) | |
3560 else: | 3727 else: |
3561 if hasFocus: | 3728 if hasFocus: |
3562 self.__activateViewmanager() | 3729 self.__activateViewmanager() |
3563 | 3730 |
3564 def __toggleBottomSidebar(self): | 3731 def __toggleBottomSidebar(self): |
3566 Private slot to handle the toggle of the bottom sidebar window. | 3733 Private slot to handle the toggle of the bottom sidebar window. |
3567 """ | 3734 """ |
3568 hasFocus = self.bottomSidebar.currentWidget().hasFocus() | 3735 hasFocus = self.bottomSidebar.currentWidget().hasFocus() |
3569 shown = self.__toggleWindow(self.bottomSidebar) | 3736 shown = self.__toggleWindow(self.bottomSidebar) |
3570 if shown: | 3737 if shown: |
3571 self.bottomSidebar.currentWidget().setFocus(Qt.ActiveWindowFocusReason) | 3738 self.bottomSidebar.currentWidget().setFocus( |
3739 Qt.ActiveWindowFocusReason) | |
3572 else: | 3740 else: |
3573 if hasFocus: | 3741 if hasFocus: |
3574 self.__activateViewmanager() | 3742 self.__activateViewmanager() |
3575 | 3743 |
3576 def activateCooperationViewer(self): | 3744 def activateCooperationViewer(self): |
3654 def __toolsConfiguration(self): | 3822 def __toolsConfiguration(self): |
3655 """ | 3823 """ |
3656 Private slot to handle the tools configuration menu entry. | 3824 Private slot to handle the tools configuration menu entry. |
3657 """ | 3825 """ |
3658 from Preferences.ToolConfigurationDialog import ToolConfigurationDialog | 3826 from Preferences.ToolConfigurationDialog import ToolConfigurationDialog |
3659 dlg = ToolConfigurationDialog(self.toolGroups[self.currentToolGroup][1], self) | 3827 dlg = ToolConfigurationDialog( |
3828 self.toolGroups[self.currentToolGroup][1], self) | |
3660 if dlg.exec_() == QDialog.Accepted: | 3829 if dlg.exec_() == QDialog.Accepted: |
3661 self.toolGroups[self.currentToolGroup][1] = dlg.getToollist() | 3830 self.toolGroups[self.currentToolGroup][1] = dlg.getToollist() |
3662 self.__updateExternalToolsActions() | 3831 self.__updateExternalToolsActions() |
3663 | 3832 |
3664 def __toolGroupsConfiguration(self): | 3833 def __toolGroupsConfiguration(self): |
3665 """ | 3834 """ |
3666 Private slot to handle the tool groups configuration menu entry. | 3835 Private slot to handle the tool groups configuration menu entry. |
3667 """ | 3836 """ |
3668 from Preferences.ToolGroupConfigurationDialog import ToolGroupConfigurationDialog | 3837 from Preferences.ToolGroupConfigurationDialog import \ |
3669 dlg = ToolGroupConfigurationDialog(self.toolGroups, self.currentToolGroup, self) | 3838 ToolGroupConfigurationDialog |
3839 dlg = ToolGroupConfigurationDialog( | |
3840 self.toolGroups, self.currentToolGroup, self) | |
3670 if dlg.exec_() == QDialog.Accepted: | 3841 if dlg.exec_() == QDialog.Accepted: |
3671 self.toolGroups, self.currentToolGroup = dlg.getToolGroups() | 3842 self.toolGroups, self.currentToolGroup = dlg.getToolGroups() |
3672 | 3843 |
3673 def __createUnitTestDialog(self): | 3844 def __createUnitTestDialog(self): |
3674 """ | 3845 """ |
3676 """ | 3847 """ |
3677 if self.unittestDialog is None: | 3848 if self.unittestDialog is None: |
3678 from PyUnit.UnittestDialog import UnittestDialog | 3849 from PyUnit.UnittestDialog import UnittestDialog |
3679 self.unittestDialog = UnittestDialog( | 3850 self.unittestDialog = UnittestDialog( |
3680 None, self.debuggerUI.debugServer, self, fromEric=True) | 3851 None, self.debuggerUI.debugServer, self, fromEric=True) |
3681 self.unittestDialog.unittestFile.connect(self.viewmanager.setFileLine) | 3852 self.unittestDialog.unittestFile.connect( |
3853 self.viewmanager.setFileLine) | |
3682 self.unittestDialog.unittestStopped.connect(self.__unittestStopped) | 3854 self.unittestDialog.unittestStopped.connect(self.__unittestStopped) |
3683 | 3855 |
3684 def __unittestStopped(self): | 3856 def __unittestStopped(self): |
3685 """ | 3857 """ |
3686 Private slot to handle the end of a unit test run. | 3858 Private slot to handle the end of a unit test run. |
3696 self.unittestDialog.show() | 3868 self.unittestDialog.show() |
3697 self.unittestDialog.raise_() | 3869 self.unittestDialog.raise_() |
3698 | 3870 |
3699 def __unittestScript(self, prog=None): | 3871 def __unittestScript(self, prog=None): |
3700 """ | 3872 """ |
3701 Private slot for displaying the unittest dialog and run the current script. | 3873 Private slot for displaying the unittest dialog and run the current |
3874 script. | |
3702 | 3875 |
3703 @param prog the python program to be opened | 3876 @param prog the python program to be opened |
3704 """ | 3877 """ |
3705 if prog is None: | 3878 if prog is None: |
3706 aw = self.viewmanager.activeWindow() | 3879 aw = self.viewmanager.activeWindow() |
3718 self.utRestartAct.setEnabled(False) | 3891 self.utRestartAct.setEnabled(False) |
3719 self.utRerunFailedAct.setEnabled(False) | 3892 self.utRerunFailedAct.setEnabled(False) |
3720 | 3893 |
3721 def __unittestProject(self): | 3894 def __unittestProject(self): |
3722 """ | 3895 """ |
3723 Private slot for displaying the unittest dialog and run the current project. | 3896 Private slot for displaying the unittest dialog and run the current |
3897 project. | |
3724 """ | 3898 """ |
3725 fn = self.project.getMainScript(True) | 3899 fn = self.project.getMainScript(True) |
3726 if fn: | 3900 if fn: |
3727 tfn = Utilities.getTestFileName(fn) | 3901 tfn = Utilities.getTestFileName(fn) |
3728 if os.path.exists(tfn): | 3902 if os.path.exists(tfn): |
3743 self.utRestartAct.setEnabled(False) | 3917 self.utRestartAct.setEnabled(False) |
3744 self.utRerunFailedAct.setEnabled(False) | 3918 self.utRerunFailedAct.setEnabled(False) |
3745 | 3919 |
3746 def __unittestRestart(self): | 3920 def __unittestRestart(self): |
3747 """ | 3921 """ |
3748 Private slot to display the unittest dialog and rerun the last unit test. | 3922 Private slot to display the unittest dialog and rerun the last |
3923 unit test. | |
3749 """ | 3924 """ |
3750 self.__createUnitTestDialog() | 3925 self.__createUnitTestDialog() |
3751 self.unittestDialog.show() | 3926 self.unittestDialog.show() |
3752 self.unittestDialog.raise_() | 3927 self.unittestDialog.raise_() |
3753 self.unittestDialog.on_startButton_clicked() | 3928 self.unittestDialog.on_startButton_clicked() |
3814 ' is zero length.</p>') | 3989 ' is zero length.</p>') |
3815 .format(fn)) | 3990 .format(fn)) |
3816 return | 3991 return |
3817 | 3992 |
3818 if Utilities.isMacPlatform(): | 3993 if Utilities.isMacPlatform(): |
3819 designer, args = Utilities.prepareQtMacBundle("designer", version, args) | 3994 designer, args = Utilities.prepareQtMacBundle( |
3995 "designer", version, args) | |
3820 else: | 3996 else: |
3821 if version == 4: | 3997 if version == 4: |
3822 designer = os.path.join( | 3998 designer = os.path.join( |
3823 Utilities.getQtBinariesPath(), | 3999 Utilities.getQtBinariesPath(), |
3824 Utilities.generateQtToolName("designer")) | 4000 Utilities.generateQtToolName("designer")) |
3855 | 4031 |
3856 args = [] | 4032 args = [] |
3857 if fn is not None: | 4033 if fn is not None: |
3858 fn = fn.replace('.qm', '.ts') | 4034 fn = fn.replace('.qm', '.ts') |
3859 try: | 4035 try: |
3860 if os.path.isfile(fn) and os.path.getsize(fn) and fn not in args: | 4036 if os.path.isfile(fn) and os.path.getsize(fn) and \ |
4037 fn not in args: | |
3861 args.append(fn) | 4038 args.append(fn) |
3862 else: | 4039 else: |
3863 E5MessageBox.critical(self, | 4040 E5MessageBox.critical(self, |
3864 self.trUtf8('Problem'), | 4041 self.trUtf8('Problem'), |
3865 self.trUtf8('<p>The file <b>{0}</b> does not exist or' | 4042 self.trUtf8('<p>The file <b>{0}</b> does not exist or' |
3873 ' is zero length.</p>') | 4050 ' is zero length.</p>') |
3874 .format(fn)) | 4051 .format(fn)) |
3875 return | 4052 return |
3876 | 4053 |
3877 if Utilities.isMacPlatform(): | 4054 if Utilities.isMacPlatform(): |
3878 linguist, args = Utilities.prepareQtMacBundle("linguist", version, args) | 4055 linguist, args = Utilities.prepareQtMacBundle( |
4056 "linguist", version, args) | |
3879 else: | 4057 else: |
3880 if version == 4: | 4058 if version == 4: |
3881 linguist = os.path.join( | 4059 linguist = os.path.join( |
3882 Utilities.getQtBinariesPath(), | 4060 Utilities.getQtBinariesPath(), |
3883 Utilities.generateQtToolName("linguist")) | 4061 Utilities.generateQtToolName("linguist")) |
3919 if version == 4: | 4097 if version == 4: |
3920 args.append('-showUrl') | 4098 args.append('-showUrl') |
3921 args.append(home) | 4099 args.append(home) |
3922 | 4100 |
3923 if Utilities.isMacPlatform(): | 4101 if Utilities.isMacPlatform(): |
3924 assistant, args = Utilities.prepareQtMacBundle("assistant", version, args) | 4102 assistant, args = Utilities.prepareQtMacBundle( |
4103 "assistant", version, args) | |
3925 else: | 4104 else: |
3926 if version == 4: | 4105 if version == 4: |
3927 assistant = os.path.join( | 4106 assistant = os.path.join( |
3928 Utilities.getQtBinariesPath(), | 4107 Utilities.getQtBinariesPath(), |
3929 Utilities.generateQtToolName("assistant")) | 4108 Utilities.generateQtToolName("assistant")) |
3959 """ | 4138 """ |
3960 customViewer = Preferences.getHelp("CustomViewer") | 4139 customViewer = Preferences.getHelp("CustomViewer") |
3961 if not customViewer: | 4140 if not customViewer: |
3962 E5MessageBox.information(self, | 4141 E5MessageBox.information(self, |
3963 self.trUtf8("Help"), | 4142 self.trUtf8("Help"), |
3964 self.trUtf8("""Currently no custom viewer is selected.""" | 4143 self.trUtf8( |
3965 """ Please use the preferences dialog to specify one.""")) | 4144 """Currently no custom viewer is selected.""" |
4145 """ Please use the preferences dialog to specify one.""")) | |
3966 return | 4146 return |
3967 | 4147 |
3968 proc = QProcess() | 4148 proc = QProcess() |
3969 args = [] | 4149 args = [] |
3970 if home: | 4150 if home: |
4027 self.trUtf8('<p>The file <b>{0}</b> does not exist or' | 4207 self.trUtf8('<p>The file <b>{0}</b> does not exist or' |
4028 ' is zero length.</p>') | 4208 ' is zero length.</p>') |
4029 .format(fn)) | 4209 .format(fn)) |
4030 return | 4210 return |
4031 | 4211 |
4032 if not os.path.isfile(viewer) or not proc.startDetached(sys.executable, args): | 4212 if not os.path.isfile(viewer) or \ |
4033 E5MessageBox.critical(self, | 4213 not proc.startDetached(sys.executable, args): |
4214 E5MessageBox.critical( | |
4215 self, | |
4034 self.trUtf8('Process Generation Error'), | 4216 self.trUtf8('Process Generation Error'), |
4035 self.trUtf8( | 4217 self.trUtf8( |
4036 '<p>Could not start UI Previewer.<br>' | 4218 '<p>Could not start UI Previewer.<br>' |
4037 'Ensure that it is available as <b>{0}</b>.</p>' | 4219 'Ensure that it is available as <b>{0}</b>.</p>' |
4038 ).format(viewer)) | 4220 ).format(viewer)) |
4041 """ | 4223 """ |
4042 Private slot to start the Translation Previewer executable. | 4224 Private slot to start the Translation Previewer executable. |
4043 | 4225 |
4044 @param fileNames filenames of forms and/or translations to be previewed | 4226 @param fileNames filenames of forms and/or translations to be previewed |
4045 (list of strings) | 4227 (list of strings) |
4046 @param ignore flag indicating non existing files should be ignored (boolean) | 4228 @param ignore flag indicating non existing files should be ignored |
4229 (boolean) | |
4047 """ | 4230 """ |
4048 proc = QProcess() | 4231 proc = QProcess() |
4049 | 4232 |
4050 viewer = os.path.join(getConfig("ericDir"), "eric5_trpreviewer.py") | 4233 viewer = os.path.join(getConfig("ericDir"), "eric5_trpreviewer.py") |
4051 | 4234 |
4059 args.append(fn) | 4242 args.append(fn) |
4060 else: | 4243 else: |
4061 if not ignore: | 4244 if not ignore: |
4062 E5MessageBox.critical(self, | 4245 E5MessageBox.critical(self, |
4063 self.trUtf8('Problem'), | 4246 self.trUtf8('Problem'), |
4064 self.trUtf8('<p>The file <b>{0}</b> does not exist or' | 4247 self.trUtf8( |
4248 '<p>The file <b>{0}</b> does not exist or' | |
4065 ' is zero length.</p>') | 4249 ' is zero length.</p>') |
4066 .format(fn)) | 4250 .format(fn)) |
4067 return | 4251 return |
4068 except EnvironmentError: | 4252 except EnvironmentError: |
4069 if not ignore: | 4253 if not ignore: |
4070 E5MessageBox.critical(self, | 4254 E5MessageBox.critical(self, |
4071 self.trUtf8('Problem'), | 4255 self.trUtf8('Problem'), |
4072 self.trUtf8('<p>The file <b>{0}</b> does not exist or' | 4256 self.trUtf8( |
4257 '<p>The file <b>{0}</b> does not exist or' | |
4073 ' is zero length.</p>') | 4258 ' is zero length.</p>') |
4074 .format(fn)) | 4259 .format(fn)) |
4075 return | 4260 return |
4076 | 4261 |
4077 if not os.path.isfile(viewer) or not proc.startDetached(sys.executable, args): | 4262 if not os.path.isfile(viewer) or \ |
4078 E5MessageBox.critical(self, | 4263 not proc.startDetached(sys.executable, args): |
4264 E5MessageBox.critical( | |
4265 self, | |
4079 self.trUtf8('Process Generation Error'), | 4266 self.trUtf8('Process Generation Error'), |
4080 self.trUtf8( | 4267 self.trUtf8( |
4081 '<p>Could not start Translation Previewer.<br>' | 4268 '<p>Could not start Translation Previewer.<br>' |
4082 'Ensure that it is available as <b>{0}</b>.</p>' | 4269 'Ensure that it is available as <b>{0}</b>.</p>' |
4083 ).format(viewer)) | 4270 ).format(viewer)) |
4091 browser = os.path.join(getConfig("ericDir"), "eric5_sqlbrowser.py") | 4278 browser = os.path.join(getConfig("ericDir"), "eric5_sqlbrowser.py") |
4092 | 4279 |
4093 args = [] | 4280 args = [] |
4094 args.append(browser) | 4281 args.append(browser) |
4095 | 4282 |
4096 if not os.path.isfile(browser) or not proc.startDetached(sys.executable, args): | 4283 if not os.path.isfile(browser) or \ |
4097 E5MessageBox.critical(self, | 4284 not proc.startDetached(sys.executable, args): |
4285 E5MessageBox.critical( | |
4286 self, | |
4098 self.trUtf8('Process Generation Error'), | 4287 self.trUtf8('Process Generation Error'), |
4099 self.trUtf8( | 4288 self.trUtf8( |
4100 '<p>Could not start SQL Browser.<br>' | 4289 '<p>Could not start SQL Browser.<br>' |
4101 'Ensure that it is available as <b>{0}</b>.</p>' | 4290 'Ensure that it is available as <b>{0}</b>.</p>' |
4102 ).format(browser)) | 4291 ).format(browser)) |
4141 snap = os.path.join(getConfig("ericDir"), "eric5_snap.py") | 4330 snap = os.path.join(getConfig("ericDir"), "eric5_snap.py") |
4142 | 4331 |
4143 args = [] | 4332 args = [] |
4144 args.append(snap) | 4333 args.append(snap) |
4145 | 4334 |
4146 if not os.path.isfile(snap) or not proc.startDetached(sys.executable, args): | 4335 if not os.path.isfile(snap) or \ |
4147 E5MessageBox.critical(self, | 4336 not proc.startDetached(sys.executable, args): |
4337 E5MessageBox.critical( | |
4338 self, | |
4148 self.trUtf8('Process Generation Error'), | 4339 self.trUtf8('Process Generation Error'), |
4149 self.trUtf8( | 4340 self.trUtf8( |
4150 '<p>Could not start Snapshot tool.<br>' | 4341 '<p>Could not start Snapshot tool.<br>' |
4151 'Ensure that it is available as <b>{0}</b>.</p>' | 4342 'Ensure that it is available as <b>{0}</b>.</p>' |
4152 ).format(snap)) | 4343 ).format(snap)) |
4162 for tool in toolGroup[1]: | 4353 for tool in toolGroup[1]: |
4163 if tool['menutext'] == toolMenuText: | 4354 if tool['menutext'] == toolMenuText: |
4164 self.__startToolProcess(tool) | 4355 self.__startToolProcess(tool) |
4165 return | 4356 return |
4166 | 4357 |
4167 E5MessageBox.information(self, | 4358 E5MessageBox.information( |
4359 self, | |
4168 self.trUtf8("External Tools"), | 4360 self.trUtf8("External Tools"), |
4169 self.trUtf8("""No tool entry found for external tool '{0}' """ | 4361 self.trUtf8( |
4170 """in tool group '{1}'.""").format(toolMenuText, toolGroupName)) | 4362 """No tool entry found for external tool '{0}' """ |
4363 """in tool group '{1}'.""") | |
4364 .format(toolMenuText, toolGroupName)) | |
4171 return | 4365 return |
4172 | 4366 |
4173 E5MessageBox.information(self, | 4367 E5MessageBox.information( |
4368 self, | |
4174 self.trUtf8("External Tools"), | 4369 self.trUtf8("External Tools"), |
4175 self.trUtf8("""No toolgroup entry '{0}' found.""").format(toolGroupName)) | 4370 self.trUtf8("""No toolgroup entry '{0}' found.""") |
4371 .format(toolGroupName) | |
4372 ) | |
4176 | 4373 |
4177 def __toolExecute(self, act): | 4374 def __toolExecute(self, act): |
4178 """ | 4375 """ |
4179 Private slot to execute a particular tool. | 4376 Private slot to execute a particular tool. |
4180 | 4377 |
4319 if not os.path.splitext(pythonDocDir)[1]: | 4516 if not os.path.splitext(pythonDocDir)[1]: |
4320 home = Utilities.normjoinpath(pythonDocDir, 'index.html') | 4517 home = Utilities.normjoinpath(pythonDocDir, 'index.html') |
4321 | 4518 |
4322 if Utilities.isWindowsPlatform() and not os.path.exists(home): | 4519 if Utilities.isWindowsPlatform() and not os.path.exists(home): |
4323 pyversion = sys.hexversion >> 16 | 4520 pyversion = sys.hexversion >> 16 |
4324 vers = "{0:d}{1:d}".format((pyversion >> 8) & 0xff, pyversion & 0xff) | 4521 vers = "{0:d}{1:d}".format((pyversion >> 8) & 0xff, |
4325 home = os.path.join(pythonDocDir, "python{0}.chm".format(vers)) | 4522 pyversion & 0xff) |
4523 home = os.path.join( | |
4524 pythonDocDir, "python{0}.chm".format(vers)) | |
4326 else: | 4525 else: |
4327 home = pythonDocDir | 4526 home = pythonDocDir |
4328 | 4527 |
4329 if not os.path.exists(home): | 4528 if not os.path.exists(home): |
4330 E5MessageBox.warning(self, | 4529 E5MessageBox.warning(self, |
4365 if Utilities.isWindowsPlatform(): | 4564 if Utilities.isWindowsPlatform(): |
4366 if executable: | 4565 if executable: |
4367 default = os.path.join(os.path.dirname(executable), "doc") | 4566 default = os.path.join(os.path.dirname(executable), "doc") |
4368 else: | 4567 else: |
4369 default = "" | 4568 default = "" |
4370 pythonDocDir = Utilities.getEnvironmentEntry("PYTHON2DOCDIR", default) | 4569 pythonDocDir = \ |
4570 Utilities.getEnvironmentEntry("PYTHON2DOCDIR", default) | |
4371 else: | 4571 else: |
4372 pythonDocDir = Utilities.getEnvironmentEntry("PYTHON2DOCDIR", | 4572 pythonDocDir = Utilities.getEnvironmentEntry("PYTHON2DOCDIR", |
4373 '/usr/share/doc/packages/python/html/python-docs-html') | 4573 '/usr/share/doc/packages/python/html/python-docs-html') |
4374 if not pythonDocDir.startswith("http://") and \ | 4574 if not pythonDocDir.startswith("http://") and \ |
4375 not pythonDocDir.startswith("https://"): | 4575 not pythonDocDir.startswith("https://"): |
4549 home = "" | 4749 home = "" |
4550 if pyqt5DocDir: | 4750 if pyqt5DocDir: |
4551 if pyqt5DocDir.startswith("file://"): | 4751 if pyqt5DocDir.startswith("file://"): |
4552 pyqt5DocDir = pyqt5DocDir[7:] | 4752 pyqt5DocDir = pyqt5DocDir[7:] |
4553 if not os.path.splitext(pyqt5DocDir)[1]: | 4753 if not os.path.splitext(pyqt5DocDir)[1]: |
4554 possibleHomes = [\ | 4754 possibleHomes = [ |
4555 Utilities.normjoinpath(pyqt5DocDir, 'index.html'), | 4755 Utilities.normjoinpath( |
4556 Utilities.normjoinpath(pyqt5DocDir, 'class_reference.html'), | 4756 pyqt5DocDir, 'index.html'), |
4757 Utilities.normjoinpath( | |
4758 pyqt5DocDir, 'class_reference.html'), | |
4557 ] | 4759 ] |
4558 for possibleHome in possibleHomes: | 4760 for possibleHome in possibleHomes: |
4559 if os.path.exists(possibleHome): | 4761 if os.path.exists(possibleHome): |
4560 home = possibleHome | 4762 home = possibleHome |
4561 break | 4763 break |
4672 """ | 4874 """ |
4673 Public slot to start the help viewer. | 4875 Public slot to start the help viewer. |
4674 | 4876 |
4675 @param home filename of file to be shown (string) | 4877 @param home filename of file to be shown (string) |
4676 @keyparam searchWord word to search for (string) | 4878 @keyparam searchWord word to search for (string) |
4677 @keyparam useSingle flag indicating to use a single browser window (boolean) | 4879 @keyparam useSingle flag indicating to use a single browser window |
4880 (boolean) | |
4678 """ | 4881 """ |
4679 if len(home) > 0: | 4882 if len(home) > 0: |
4680 homeUrl = QUrl(home) | 4883 homeUrl = QUrl(home) |
4681 if not homeUrl.scheme(): | 4884 if not homeUrl.scheme(): |
4682 home = QUrl.fromLocalFile(home).toString() | 4885 home = QUrl.fromLocalFile(home).toString() |
4693 help.showMaximized() | 4896 help.showMaximized() |
4694 | 4897 |
4695 if useSingle or Preferences.getHelp("SingleHelpWindow"): | 4898 if useSingle or Preferences.getHelp("SingleHelpWindow"): |
4696 self.helpWindow = help | 4899 self.helpWindow = help |
4697 self.helpWindow.helpClosed.connect(self.__helpClosed) | 4900 self.helpWindow.helpClosed.connect(self.__helpClosed) |
4698 self.preferencesChanged.connect(self.helpWindow.preferencesChanged) | 4901 self.preferencesChanged.connect( |
4699 self.masterPasswordChanged.connect(self.helpWindow.masterPasswordChanged) | 4902 self.helpWindow.preferencesChanged) |
4903 self.masterPasswordChanged.connect( | |
4904 self.helpWindow.masterPasswordChanged) | |
4700 elif searchWord is not None: | 4905 elif searchWord is not None: |
4701 self.helpWindow.search(searchWord) | 4906 self.helpWindow.search(searchWord) |
4702 self.helpWindow.raise_() | 4907 self.helpWindow.raise_() |
4703 else: | 4908 else: |
4704 self.helpWindow.newTab(home) | 4909 self.helpWindow.newTab(home) |
4707 def __helpClosed(self): | 4912 def __helpClosed(self): |
4708 """ | 4913 """ |
4709 Private slot to handle the helpClosed signal of the help window. | 4914 Private slot to handle the helpClosed signal of the help window. |
4710 """ | 4915 """ |
4711 if Preferences.getHelp("SingleHelpWindow"): | 4916 if Preferences.getHelp("SingleHelpWindow"): |
4712 self.preferencesChanged.disconnect(self.helpWindow.preferencesChanged) | 4917 self.preferencesChanged.disconnect( |
4713 self.masterPasswordChanged.disconnect(self.helpWindow.masterPasswordChanged) | 4918 self.helpWindow.preferencesChanged) |
4919 self.masterPasswordChanged.disconnect( | |
4920 self.helpWindow.masterPasswordChanged) | |
4714 self.helpWindow = None | 4921 self.helpWindow = None |
4715 | 4922 |
4716 def __helpViewer(self): | 4923 def __helpViewer(self): |
4717 """ | 4924 """ |
4718 Private slot to start an empty help viewer. | 4925 Private slot to start an empty help viewer. |
4737 | 4944 |
4738 def getHelpViewer(self, preview=False): | 4945 def getHelpViewer(self, preview=False): |
4739 """ | 4946 """ |
4740 Public method to get a reference to the help window instance. | 4947 Public method to get a reference to the help window instance. |
4741 | 4948 |
4742 @keyparam preview flag indicating to get a help window for preview (boolean) | 4949 @keyparam preview flag indicating to get a help window for preview |
4950 (boolean) | |
4743 @return reference to the help window instance (HelpWindow) | 4951 @return reference to the help window instance (HelpWindow) |
4744 """ | 4952 """ |
4745 if self.helpWindow is None: | 4953 if self.helpWindow is None: |
4746 self.launchHelpViewer("", useSingle=True) | 4954 self.launchHelpViewer("", useSingle=True) |
4747 self.helpWindow.raise_() | 4955 self.helpWindow.raise_() |
4787 | 4995 |
4788 def __preferencesChanged(self): | 4996 def __preferencesChanged(self): |
4789 """ | 4997 """ |
4790 Private slot to handle a change of the preferences. | 4998 Private slot to handle a change of the preferences. |
4791 """ | 4999 """ |
4792 self.setStyle(Preferences.getUI("Style"), Preferences.getUI("StyleSheet")) | 5000 self.setStyle(Preferences.getUI("Style"), |
5001 Preferences.getUI("StyleSheet")) | |
4793 | 5002 |
4794 if Preferences.getUI("SingleApplicationMode"): | 5003 if Preferences.getUI("SingleApplicationMode"): |
4795 if self.SAServer is None: | 5004 if self.SAServer is None: |
4796 self.SAServer = E5SingleApplicationServer() | 5005 self.SAServer = E5SingleApplicationServer() |
4797 else: | 5006 else: |
4798 if self.SAServer is not None: | 5007 if self.SAServer is not None: |
4799 self.SAServer.shutdown() | 5008 self.SAServer.shutdown() |
4800 self.SAServer = None | 5009 self.SAServer = None |
4801 self.newWindowAct.setEnabled(not Preferences.getUI("SingleApplicationMode")) | 5010 self.newWindowAct.setEnabled( |
5011 not Preferences.getUI("SingleApplicationMode")) | |
4802 | 5012 |
4803 self.maxEditorPathLen = Preferences.getUI("CaptionFilenameLength") | 5013 self.maxEditorPathLen = Preferences.getUI("CaptionFilenameLength") |
4804 self.captionShowsFilename = Preferences.getUI("CaptionShowsFilename") | 5014 self.captionShowsFilename = Preferences.getUI("CaptionShowsFilename") |
4805 if not self.captionShowsFilename: | 5015 if not self.captionShowsFilename: |
4806 self.__setWindowCaption(editor="") | 5016 self.__setWindowCaption(editor="") |
4850 """ | 5060 """ |
4851 self.reloadAPIs.emit() | 5061 self.reloadAPIs.emit() |
4852 | 5062 |
4853 def __showExternalTools(self): | 5063 def __showExternalTools(self): |
4854 """ | 5064 """ |
4855 Private slot to display a dialog show a list of external tools used by eric5. | 5065 Private slot to display a dialog show a list of external tools used |
5066 by eric5. | |
4856 """ | 5067 """ |
4857 if self.programsDialog is None: | 5068 if self.programsDialog is None: |
4858 from Preferences.ProgramsDialog import ProgramsDialog | 5069 from Preferences.ProgramsDialog import ProgramsDialog |
4859 self.programsDialog = ProgramsDialog(self) | 5070 self.programsDialog = ProgramsDialog(self) |
4860 self.programsDialog.show() | 5071 self.programsDialog.show() |
4881 Private slot to configure the various toolbars. | 5092 Private slot to configure the various toolbars. |
4882 """ | 5093 """ |
4883 from E5Gui.E5ToolBarDialog import E5ToolBarDialog | 5094 from E5Gui.E5ToolBarDialog import E5ToolBarDialog |
4884 dlg = E5ToolBarDialog(self.toolbarManager) | 5095 dlg = E5ToolBarDialog(self.toolbarManager) |
4885 if dlg.exec_() == QDialog.Accepted: | 5096 if dlg.exec_() == QDialog.Accepted: |
4886 Preferences.setUI("ToolbarManagerState", self.toolbarManager.saveState()) | 5097 Preferences.setUI( |
5098 "ToolbarManagerState", self.toolbarManager.saveState()) | |
4887 | 5099 |
4888 def __configShortcuts(self): | 5100 def __configShortcuts(self): |
4889 """ | 5101 """ |
4890 Private slot to configure the keyboard shortcuts. | 5102 Private slot to configure the keyboard shortcuts. |
4891 """ | 5103 """ |
5000 """ | 5212 """ |
5001 Private slot to handle the editorOpened signal. | 5213 Private slot to handle the editorOpened signal. |
5002 | 5214 |
5003 @param fn filename of the opened editor (string) | 5215 @param fn filename of the opened editor (string) |
5004 """ | 5216 """ |
5005 self.wizardsMenuAct.setEnabled(len(self.__menus["wizards"].actions()) > 0) | 5217 self.wizardsMenuAct.setEnabled( |
5218 len(self.__menus["wizards"].actions()) > 0) | |
5006 | 5219 |
5007 if fn and str(fn) != "None": | 5220 if fn and str(fn) != "None": |
5008 dbs = e5App().getObject("DebugServer") | 5221 dbs = e5App().getObject("DebugServer") |
5009 for language in dbs.getSupportedLanguages(): | 5222 for language in dbs.getSupportedLanguages(): |
5010 exts = dbs.getExtensions(language) | 5223 exts = dbs.getExtensions(language) |
5057 f = QFile(fn) | 5270 f = QFile(fn) |
5058 ok = f.open(QIODevice.WriteOnly) | 5271 ok = f.open(QIODevice.WriteOnly) |
5059 if not ok: | 5272 if not ok: |
5060 E5MessageBox.critical(self, | 5273 E5MessageBox.critical(self, |
5061 self.trUtf8("Save tasks"), | 5274 self.trUtf8("Save tasks"), |
5062 self.trUtf8("<p>The tasks file <b>{0}</b> could not be written.</p>") | 5275 self.trUtf8( |
5276 "<p>The tasks file <b>{0}</b> could not be written.</p>") | |
5063 .format(fn)) | 5277 .format(fn)) |
5064 return | 5278 return |
5065 | 5279 |
5066 from E5XML.TasksWriter import TasksWriter | 5280 from E5XML.TasksWriter import TasksWriter |
5067 TasksWriter(f, False).writeXML() | 5281 TasksWriter(f, False).writeXML() |
5068 f.close() | 5282 f.close() |
5069 | 5283 |
5070 def __readTasks(self): | 5284 def __readTasks(self): |
5071 """ | 5285 """ |
5072 Private slot to read in the tasks file (.e4t) | 5286 Private slot to read in the tasks file (.e4t). |
5073 """ | 5287 """ |
5074 fn = os.path.join(Utilities.getConfigDir(), "eric5tasks.e4t") | 5288 fn = os.path.join(Utilities.getConfigDir(), "eric5tasks.e4t") |
5075 if not os.path.exists(fn): | 5289 if not os.path.exists(fn): |
5076 return | 5290 return |
5077 f = QFile(fn) | 5291 f = QFile(fn) |
5081 reader.readXML() | 5295 reader.readXML() |
5082 f.close() | 5296 f.close() |
5083 else: | 5297 else: |
5084 E5MessageBox.critical(self, | 5298 E5MessageBox.critical(self, |
5085 self.trUtf8("Read tasks"), | 5299 self.trUtf8("Read tasks"), |
5086 self.trUtf8("<p>The tasks file <b>{0}</b> could not be read.</p>") | 5300 self.trUtf8( |
5301 "<p>The tasks file <b>{0}</b> could not be read.</p>") | |
5087 .format(fn)) | 5302 .format(fn)) |
5088 | 5303 |
5089 def __writeSession(self): | 5304 def __writeSession(self): |
5090 """ | 5305 """ |
5091 Private slot to write the session data to an XML file (.e4s). | 5306 Private slot to write the session data to an XML file (.e4s). |
5097 SessionWriter(f, None).writeXML() | 5312 SessionWriter(f, None).writeXML() |
5098 f.close() | 5313 f.close() |
5099 else: | 5314 else: |
5100 E5MessageBox.critical(self, | 5315 E5MessageBox.critical(self, |
5101 self.trUtf8("Save session"), | 5316 self.trUtf8("Save session"), |
5102 self.trUtf8("<p>The session file <b>{0}</b> could not be written.</p>") | 5317 self.trUtf8( |
5318 "<p>The session file <b>{0}</b> could not be written.</p>") | |
5103 .format(fn)) | 5319 .format(fn)) |
5104 | 5320 |
5105 def __readSession(self): | 5321 def __readSession(self): |
5106 """ | 5322 """ |
5107 Private slot to read in the session file (.e4s) | 5323 Private slot to read in the session file (.e4s). |
5108 """ | 5324 """ |
5109 fn = os.path.join(Utilities.getConfigDir(), "eric5session.e4s") | 5325 fn = os.path.join(Utilities.getConfigDir(), "eric5session.e4s") |
5110 if not os.path.exists(fn): | 5326 if not os.path.exists(fn): |
5111 E5MessageBox.critical(self, | 5327 E5MessageBox.critical(self, |
5112 self.trUtf8("Read session"), | 5328 self.trUtf8("Read session"), |
5113 self.trUtf8("<p>The session file <b>{0}</b> could not be read.</p>")\ | 5329 self.trUtf8( |
5330 "<p>The session file <b>{0}</b> could not be read.</p>")\ | |
5114 .format(fn)) | 5331 .format(fn)) |
5115 return | 5332 return |
5116 | 5333 |
5117 f = QFile(fn) | 5334 f = QFile(fn) |
5118 if f.open(QIODevice.ReadOnly): | 5335 if f.open(QIODevice.ReadOnly): |
5121 reader.readXML() | 5338 reader.readXML() |
5122 f.close() | 5339 f.close() |
5123 else: | 5340 else: |
5124 E5MessageBox.critical(self, | 5341 E5MessageBox.critical(self, |
5125 self.trUtf8("Read session"), | 5342 self.trUtf8("Read session"), |
5126 self.trUtf8("<p>The session file <b>{0}</b> could not be read.</p>")\ | 5343 self.trUtf8( |
5344 "<p>The session file <b>{0}</b> could not be read.</p>")\ | |
5127 .format(fn)) | 5345 .format(fn)) |
5128 | 5346 |
5129 def showFindFileByNameDialog(self): | 5347 def showFindFileByNameDialog(self): |
5130 """ | 5348 """ |
5131 Public slot to show the Find File by Name dialog. | 5349 Public slot to show the Find File by Name dialog. |
5132 """ | 5350 """ |
5133 if self.findFileNameDialog is None: | 5351 if self.findFileNameDialog is None: |
5134 from .FindFileNameDialog import FindFileNameDialog | 5352 from .FindFileNameDialog import FindFileNameDialog |
5135 self.findFileNameDialog = FindFileNameDialog(self.project) | 5353 self.findFileNameDialog = FindFileNameDialog(self.project) |
5136 self.findFileNameDialog.sourceFile.connect(self.viewmanager.openSourceFile) | 5354 self.findFileNameDialog.sourceFile.connect( |
5355 self.viewmanager.openSourceFile) | |
5137 self.findFileNameDialog.designerFile.connect(self.__designer) | 5356 self.findFileNameDialog.designerFile.connect(self.__designer) |
5138 self.findFileNameDialog.show() | 5357 self.findFileNameDialog.show() |
5139 self.findFileNameDialog.raise_() | 5358 self.findFileNameDialog.raise_() |
5140 self.findFileNameDialog.activateWindow() | 5359 self.findFileNameDialog.activateWindow() |
5141 | 5360 |
5169 @keyparam searchDir directory to search in (string) | 5388 @keyparam searchDir directory to search in (string) |
5170 @keyparam openFiles flag indicating to operate on open files (boolean) | 5389 @keyparam openFiles flag indicating to operate on open files (boolean) |
5171 """ | 5390 """ |
5172 if self.replaceFilesDialog is None: | 5391 if self.replaceFilesDialog is None: |
5173 from .FindFileDialog import FindFileDialog | 5392 from .FindFileDialog import FindFileDialog |
5174 self.replaceFilesDialog = FindFileDialog(self.project, replaceMode=True) | 5393 self.replaceFilesDialog = \ |
5394 FindFileDialog(self.project, replaceMode=True) | |
5175 self.replaceFilesDialog.sourceFile.connect( | 5395 self.replaceFilesDialog.sourceFile.connect( |
5176 self.viewmanager.openSourceFile) | 5396 self.viewmanager.openSourceFile) |
5177 self.replaceFilesDialog.designerFile.connect(self.__designer) | 5397 self.replaceFilesDialog.designerFile.connect(self.__designer) |
5178 if searchDir: | 5398 if searchDir: |
5179 self.replaceFilesDialog.setSearchDirectory(searchDir) | 5399 self.replaceFilesDialog.setSearchDirectory(searchDir) |
5381 Preferences.setGeometry("MainMaximized", self.isMaximized()) | 5601 Preferences.setGeometry("MainMaximized", self.isMaximized()) |
5382 if not self.isMaximized(): | 5602 if not self.isMaximized(): |
5383 Preferences.setGeometry("MainGeometry", self.saveGeometry()) | 5603 Preferences.setGeometry("MainGeometry", self.saveGeometry()) |
5384 self.browser.saveToplevelDirs() | 5604 self.browser.saveToplevelDirs() |
5385 | 5605 |
5386 Preferences.setUI("ToolbarManagerState", self.toolbarManager.saveState()) | 5606 Preferences.setUI( |
5607 "ToolbarManagerState", self.toolbarManager.saveState()) | |
5387 self.__saveCurrentViewProfile(True) | 5608 self.__saveCurrentViewProfile(True) |
5388 Preferences.saveToolGroups(self.toolGroups, self.currentToolGroup) | 5609 Preferences.saveToolGroups(self.toolGroups, self.currentToolGroup) |
5389 Preferences.syncPreferences() | 5610 Preferences.syncPreferences() |
5390 self.shutdownCalled = True | 5611 self.shutdownCalled = True |
5391 return True | 5612 return True |
5398 """ | 5619 """ |
5399 Public method to show the eric5 versions available for download. | 5620 Public method to show the eric5 versions available for download. |
5400 """ | 5621 """ |
5401 self.performVersionCheck(manual=True, showVersions=True) | 5622 self.performVersionCheck(manual=True, showVersions=True) |
5402 | 5623 |
5403 def performVersionCheck(self, manual=True, alternative=0, showVersions=False): | 5624 def performVersionCheck(self, manual=True, alternative=0, |
5625 showVersions=False): | |
5404 """ | 5626 """ |
5405 Public method to check the internet for an eric5 update. | 5627 Public method to check the internet for an eric5 update. |
5406 | 5628 |
5407 @param manual flag indicating an invocation via the menu (boolean) | 5629 @param manual flag indicating an invocation via the menu (boolean) |
5408 @param alternative index of server to download from (integer) | 5630 @param alternative index of server to download from (integer) |
5409 @keyparam showVersion flag indicating the show versions mode (boolean) | 5631 @keyparam showVersions flag indicating the show versions mode (boolean) |
5410 """ | 5632 """ |
5411 if not manual: | 5633 if not manual: |
5412 if Version.startswith("@@"): | 5634 if Version.startswith("@@"): |
5413 return | 5635 return |
5414 else: | 5636 else: |
5499 self.trUtf8("""The versions information could not be""" | 5721 self.trUtf8("""The versions information could not be""" |
5500 """ downloaded for the last 7 days.""" | 5722 """ downloaded for the last 7 days.""" |
5501 """ Please go online and try again.""")) | 5723 """ Please go online and try again.""")) |
5502 return | 5724 return |
5503 else: | 5725 else: |
5504 self.performVersionCheck(self.manualUpdatesCheck, self.httpAlternative, | 5726 self.performVersionCheck(self.manualUpdatesCheck, |
5505 self.showAvailableVersions) | 5727 self.httpAlternative, |
5728 self.showAvailableVersions) | |
5506 return | 5729 return |
5507 | 5730 |
5508 self.__inVersionCheck = False | 5731 self.__inVersionCheck = False |
5509 if self.__versionCheckProgress is not None: | 5732 if self.__versionCheckProgress is not None: |
5510 self.__versionCheckProgress.reset() | 5733 self.__versionCheckProgress.reset() |
5518 "Updates/LastCheckDate", QDate.currentDate()) | 5741 "Updates/LastCheckDate", QDate.currentDate()) |
5519 self.__versionCheckResult(versions) | 5742 self.__versionCheckResult(versions) |
5520 | 5743 |
5521 def __updateVersionsUrls(self, versions): | 5744 def __updateVersionsUrls(self, versions): |
5522 """ | 5745 """ |
5523 Private method to update the URLs from which to retrieve the versions file. | 5746 Private method to update the URLs from which to retrieve the versions |
5524 | 5747 file. |
5525 @param versions contents of the downloaded versions file (list of strings) | 5748 |
5749 @param versions contents of the downloaded versions file (list of | |
5750 strings) | |
5526 """ | 5751 """ |
5527 if len(versions) > 5 and versions[4] == "---": | 5752 if len(versions) > 5 and versions[4] == "---": |
5528 line = 5 | 5753 line = 5 |
5529 urls = [] | 5754 urls = [] |
5530 while line < len(versions): | 5755 while line < len(versions): |
5535 | 5760 |
5536 def __versionCheckResult(self, versions): | 5761 def __versionCheckResult(self, versions): |
5537 """ | 5762 """ |
5538 Private method to show the result of the version check action. | 5763 Private method to show the result of the version check action. |
5539 | 5764 |
5540 @param versions contents of the downloaded versions file (list of strings) | 5765 @param versions contents of the downloaded versions file (list of |
5766 strings) | |
5541 """ | 5767 """ |
5542 url = "" | 5768 url = "" |
5543 try: | 5769 try: |
5544 if "-snapshot-" in Version: | 5770 if "-snapshot-" in Version: |
5545 # check snapshot version | 5771 # check snapshot version |
5546 if versions[2][0] == "5" and versions[2] > Version: | 5772 if versions[2][0] == "5" and versions[2] > Version: |
5547 res = E5MessageBox.yesNo(self, | 5773 res = E5MessageBox.yesNo( |
5774 self, | |
5548 self.trUtf8("Update available"), | 5775 self.trUtf8("Update available"), |
5549 self.trUtf8("""The update to <b>{0}</b> of eric5 is available""" | 5776 self.trUtf8( |
5550 """ at <b>{1}</b>. Would you like to get it?""")\ | 5777 """The update to <b>{0}</b> of eric5 is""" |
5778 """ available at <b>{1}</b>. Would you like to""" | |
5779 """ get it?""")\ | |
5551 .format(versions[2], versions[3]), | 5780 .format(versions[2], versions[3]), |
5552 yesDefault=True) | 5781 yesDefault=True) |
5553 url = res and versions[3] or '' | 5782 url = res and versions[3] or '' |
5554 elif versions[0] > Version: | 5783 elif versions[0] > Version: |
5555 res = E5MessageBox.yesNo(self, | 5784 res = E5MessageBox.yesNo( |
5785 self, | |
5556 self.trUtf8("Update available"), | 5786 self.trUtf8("Update available"), |
5557 self.trUtf8("""The update to <b>{0}</b> of eric5 is available""" | 5787 self.trUtf8( |
5558 """ at <b>{1}</b>. Would you like to get it?""")\ | 5788 """The update to <b>{0}</b> of eric5 is""" |
5789 """ available at <b>{1}</b>. Would you like to""" | |
5790 """ get it?""")\ | |
5559 .format(versions[0], versions[1]), | 5791 .format(versions[0], versions[1]), |
5560 yesDefault=True) | 5792 yesDefault=True) |
5561 url = res and versions[1] or '' | 5793 url = res and versions[1] or '' |
5562 else: | 5794 else: |
5563 if self.manualUpdatesCheck: | 5795 if self.manualUpdatesCheck: |
5564 E5MessageBox.information(self, | 5796 E5MessageBox.information( |
5797 self, | |
5565 self.trUtf8("Eric5 is up to date"), | 5798 self.trUtf8("Eric5 is up to date"), |
5566 self.trUtf8("""You are using the latest version of eric5""")) | 5799 self.trUtf8( |
5800 """You are using the latest version of""" | |
5801 """ eric5""")) | |
5567 else: | 5802 else: |
5568 # check release version | 5803 # check release version |
5569 if versions[0] > Version: | 5804 if versions[0] > Version: |
5570 res = E5MessageBox.yesNo(self, | 5805 res = E5MessageBox.yesNo( |
5806 self, | |
5571 self.trUtf8("Update available"), | 5807 self.trUtf8("Update available"), |
5572 self.trUtf8("""The update to <b>{0}</b> of eric5 is available""" | 5808 self.trUtf8( |
5573 """ at <b>{1}</b>. Would you like to get it?""")\ | 5809 """The update to <b>{0}</b> of eric5 is""" |
5810 """ available at <b>{1}</b>. Would you like""" | |
5811 """ to get it?""")\ | |
5574 .format(versions[0], versions[1]), | 5812 .format(versions[0], versions[1]), |
5575 yesDefault=True) | 5813 yesDefault=True) |
5576 url = res and versions[1] or '' | 5814 url = res and versions[1] or '' |
5577 else: | 5815 else: |
5578 if self.manualUpdatesCheck: | 5816 if self.manualUpdatesCheck: |
5579 E5MessageBox.information(self, | 5817 E5MessageBox.information( |
5818 self, | |
5580 self.trUtf8("Eric5 is up to date"), | 5819 self.trUtf8("Eric5 is up to date"), |
5581 self.trUtf8("""You are using the latest version of eric5""")) | 5820 self.trUtf8( |
5821 """You are using the latest version of""" | |
5822 """ eric5""")) | |
5582 except IndexError: | 5823 except IndexError: |
5583 E5MessageBox.warning(self, | 5824 E5MessageBox.warning(self, |
5584 self.trUtf8("Error during updates check"), | 5825 self.trUtf8("Error during updates check"), |
5585 self.trUtf8("""Could not perform updates check.""")) | 5826 self.trUtf8("""Could not perform updates check.""")) |
5586 | 5827 |
5597 | 5838 |
5598 def __showAvailableVersionInfos(self, versions): | 5839 def __showAvailableVersionInfos(self, versions): |
5599 """ | 5840 """ |
5600 Private method to show the versions available for download. | 5841 Private method to show the versions available for download. |
5601 | 5842 |
5602 @param versions contents of the downloaded versions file (list of strings) | 5843 @param versions contents of the downloaded versions file (list of |
5844 strings) | |
5603 """ | 5845 """ |
5604 versionText = self.trUtf8( | 5846 versionText = self.trUtf8( |
5605 """<h3>Available versions</h3>""" | 5847 """<h3>Available versions</h3>""" |
5606 """<table>""") | 5848 """<table>""") |
5607 line = 0 | 5849 line = 0 |
5608 while line < len(versions): | 5850 while line < len(versions): |
5609 if versions[line] == "---": | 5851 if versions[line] == "---": |
5610 break | 5852 break |
5611 | 5853 |
5612 versionText += """<tr><td>{0}</td><td><a href="{1}">{2}</a></td></tr>"""\ | 5854 versionText += """<tr><td>{0}</td><td><a href="{1}">{2}</a>""" \ |
5613 .format(versions[line], versions[line + 1], | 5855 """</td></tr>""".format( |
5856 versions[line], versions[line + 1], | |
5614 'sourceforge' in versions[line + 1] and \ | 5857 'sourceforge' in versions[line + 1] and \ |
5615 "SourceForge" or versions[line + 1]) | 5858 "SourceForge" or versions[line + 1]) |
5616 line += 2 | 5859 line += 2 |
5617 versionText += self.trUtf8("""</table>""") | 5860 versionText += self.trUtf8("""</table>""") |
5618 | 5861 |
5671 Public method to check, if the eric5 version is good compared to | 5914 Public method to check, if the eric5 version is good compared to |
5672 the required version. | 5915 the required version. |
5673 | 5916 |
5674 @param required required version (string) | 5917 @param required required version (string) |
5675 @param snapshot required snapshot version (string) | 5918 @param snapshot required snapshot version (string) |
5676 @return flag indicating, that the version is newer than the required one | 5919 @return flag indicating, that the version is newer than the required |
5677 (boolean) | 5920 one (boolean) |
5678 """ | 5921 """ |
5679 if Version.startswith("@@"): | 5922 if Version.startswith("@@"): |
5680 # development version, always newer | 5923 # development version, always newer |
5681 return True | 5924 return True |
5682 | 5925 |
5737 from .NotificationWidget import NotificationWidget | 5980 from .NotificationWidget import NotificationWidget |
5738 self.__notification = NotificationWidget(parent=self) | 5981 self.__notification = NotificationWidget(parent=self) |
5739 self.__notification.setPixmap(icon) | 5982 self.__notification.setPixmap(icon) |
5740 self.__notification.setHeading(heading) | 5983 self.__notification.setHeading(heading) |
5741 self.__notification.setText(text) | 5984 self.__notification.setText(text) |
5742 self.__notification.setTimeout(Preferences.getUI("NotificationTimeout")) | 5985 self.__notification.setTimeout( |
5986 Preferences.getUI("NotificationTimeout")) | |
5743 self.__notification.move(Preferences.getUI("NotificationPosition")) | 5987 self.__notification.move(Preferences.getUI("NotificationPosition")) |
5744 self.__notification.show() | 5988 self.__notification.show() |
5745 | 5989 |
5746 def notificationsEnabled(self): | 5990 def notificationsEnabled(self): |
5747 """ | 5991 """ |