UI/UserInterface.py

Mon, 25 Mar 2013 03:11:06 +0100

author
T.Rzepka <Tobias.Rzepka@gmail.com>
date
Mon, 25 Mar 2013 03:11:06 +0100
branch
Py2 comp.
changeset 2525
8b507a9a2d40
parent 2474
8727522a69d5
child 2550
e15087ddb41e
permissions
-rw-r--r--

Script changes: Future import added, super calls modified and unicode behavior for str.

0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1 # -*- coding: utf-8 -*-
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2
2302
f29e9405c851 Updated copyright for 2013.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2298
diff changeset
3 # Copyright (c) 2002 - 2013 Detlev Offenbach <detlev@die-offenbachs.de>
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
4 #
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
5
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
6 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
7 Module implementing the main user interface.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
8 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
9
2525
8b507a9a2d40 Script changes: Future import added, super calls modified and unicode behavior for str.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents: 2474
diff changeset
10 from __future__ import unicode_literals # __IGNORE_WARNING__
8b507a9a2d40 Script changes: Future import added, super calls modified and unicode behavior for str.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents: 2474
diff changeset
11 try:
8b507a9a2d40 Script changes: Future import added, super calls modified and unicode behavior for str.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents: 2474
diff changeset
12 str = unicode
8b507a9a2d40 Script changes: Future import added, super calls modified and unicode behavior for str.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents: 2474
diff changeset
13 except (NameError):
8b507a9a2d40 Script changes: Future import added, super calls modified and unicode behavior for str.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents: 2474
diff changeset
14 pass
8b507a9a2d40 Script changes: Future import added, super calls modified and unicode behavior for str.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents: 2474
diff changeset
15
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
16 import os
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
17 import sys
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
18 import logging
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
19
1112
8a7d1b9d18db Improved code quality by getting rid of star imports. That way pyflakes can do its job. A few bugs fixed found by flakes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
20 from PyQt4.QtCore import QTimer, QFile, QFileInfo, pyqtSignal, PYQT_VERSION_STR, QDate, \
8a7d1b9d18db Improved code quality by getting rid of star imports. That way pyflakes can do its job. A few bugs fixed found by flakes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
21 QIODevice, QByteArray, qVersion, QProcess, QSize, QUrl, QObject, Qt
8a7d1b9d18db Improved code quality by getting rid of star imports. That way pyflakes can do its job. A few bugs fixed found by flakes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
22 from PyQt4.QtGui import QSizePolicy, QWidget, QKeySequence, QDesktopServices, \
2101
5bac7dee9e1a Introduced the E5MainWindow class allowing to set a style for all the main windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2094
diff changeset
23 QWhatsThis, QToolBar, QDialog, QSplitter, QApplication, QMenu, QProgressDialog, \
5bac7dee9e1a Introduced the E5MainWindow class allowing to set a style for all the main windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2094
diff changeset
24 QVBoxLayout, QDockWidget, QAction, QLabel
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
25 from PyQt4.Qsci import QSCINTILLA_VERSION_STR
270
41505c92ac31 Added code to enhance the proxy configuration and removed the usage of QHttp.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 266
diff changeset
26 from PyQt4.QtNetwork import QNetworkProxyFactory, QNetworkAccessManager, \
41505c92ac31 Added code to enhance the proxy configuration and removed the usage of QHttp.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 266
diff changeset
27 QNetworkRequest, QNetworkReply
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
28
1112
8a7d1b9d18db Improved code quality by getting rid of star imports. That way pyflakes can do its job. A few bugs fixed found by flakes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
29 from .Info import Version, BugAddress, Program, FeatureAddress
12
1d8dd9706f46 First commit after changing to Python 3.1.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7
diff changeset
30 from . import Config
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
31
55
b5c84934de9c Renamed E4Gui to E5Gui.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 53
diff changeset
32 from E5Gui.E5SingleApplication import E5SingleApplicationServer
b5c84934de9c Renamed E4Gui to E5Gui.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 53
diff changeset
33 from E5Gui.E5Action import E5Action, createActionGroup
b5c84934de9c Renamed E4Gui to E5Gui.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 53
diff changeset
34 from E5Gui.E5ToolBarManager import E5ToolBarManager
882
34b86be88bf0 Redid the native file dialog code to be future proof.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 880
diff changeset
35 from E5Gui import E5MessageBox, E5FileDialog
537
72b32daeb8d6 Continued replacing QMessageBox methods with own methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 536
diff changeset
36 from E5Gui.E5Application import e5App
2101
5bac7dee9e1a Introduced the E5MainWindow class allowing to set a style for all the main windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2094
diff changeset
37 from E5Gui.E5MainWindow import E5MainWindow
2334
fc69ad77e18a Introduced a zoom widget in the status bar of several windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2331
diff changeset
38 from E5Gui.E5ZoomWidget import E5ZoomWidget
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
39
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
40 import Preferences
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
41 import Utilities
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
42
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
43 import UI.PixmapCache
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
44
500
c3abc7895a01 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 496
diff changeset
45 from E5Network.E5NetworkProxyFactory import E5NetworkProxyFactory, \
c3abc7895a01 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 496
diff changeset
46 proxyAuthenticationRequired
2354
c63de4af553d Centralized the SSL error handling in E5SslErrorHandler.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2347
diff changeset
47 try:
c63de4af553d Centralized the SSL error handling in E5SslErrorHandler.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2347
diff changeset
48 from E5Network.E5SslErrorHandler import E5SslErrorHandler
c63de4af553d Centralized the SSL error handling in E5SslErrorHandler.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2347
diff changeset
49 SSL_AVAILABLE = True
c63de4af553d Centralized the SSL error handling in E5SslErrorHandler.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2347
diff changeset
50 except ImportError:
c63de4af553d Centralized the SSL error handling in E5SslErrorHandler.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2347
diff changeset
51 SSL_AVAILABLE = False
270
41505c92ac31 Added code to enhance the proxy configuration and removed the usage of QHttp.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 266
diff changeset
52
15
f6ccc31d6e72 Started to rename stuff for eric5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 13
diff changeset
53 from eric5config import getConfig
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
54
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
55
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
56 class Redirector(QObject):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
57 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
58 Helper class used to redirect stdout and stderr to the log window
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
59
500
c3abc7895a01 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 496
diff changeset
60 @signal appendStderr(str) emitted to write data to stderr logger
c3abc7895a01 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 496
diff changeset
61 @signal appendStdout(str) emitted to write data to stdout logger
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
62 """
500
c3abc7895a01 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 496
diff changeset
63 appendStderr = pyqtSignal(str)
c3abc7895a01 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 496
diff changeset
64 appendStdout = pyqtSignal(str)
c3abc7895a01 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 496
diff changeset
65
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
66 def __init__(self, stderr):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
67 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
68 Constructor
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
69
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
70 @param stderr flag indicating stderr is being redirected
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
71 """
2525
8b507a9a2d40 Script changes: Future import added, super calls modified and unicode behavior for str.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents: 2474
diff changeset
72 super(Redirector, self).__init__()
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
73 self.stderr = stderr
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
74 self.buffer = ''
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
75
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
76 def __nWrite(self, n):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
77 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
78 Private method used to write data.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
79
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
80 @param n max number of bytes to write
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
81 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
82 if n:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
83 line = self.buffer[:n]
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
84 if self.stderr:
500
c3abc7895a01 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 496
diff changeset
85 self.appendStderr.emit(line)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
86 else:
500
c3abc7895a01 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 496
diff changeset
87 self.appendStdout.emit(line)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
88 self.buffer = self.buffer[n:]
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
89
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
90 def __bufferedWrite(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
91 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
92 Private method returning number of characters to write.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
93
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
94 @return number of characters buffered or length of buffered line (integer)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
95 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
96 return self.buffer.rfind('\n') + 1
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
97
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
98 def flush(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
99 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
100 Public method used to flush the buffered data.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
101 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
102 self.__nWrite(len(self.buffer))
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
103
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
104 def write(self, s):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
105 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
106 Public method used to write data.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
107
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
108 @param s data to be written (it must support the str-method)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
109 """
12
1d8dd9706f46 First commit after changing to Python 3.1.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7
diff changeset
110 self.buffer += str(s)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
111 self.__nWrite(self.__bufferedWrite())
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
112
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 934
diff changeset
113
2101
5bac7dee9e1a Introduced the E5MainWindow class allowing to set a style for all the main windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2094
diff changeset
114 class UserInterface(E5MainWindow):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
115 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
116 Class implementing the main user interface.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
117
500
c3abc7895a01 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 496
diff changeset
118 @signal appendStderr(str) emitted to write data to stderr logger
c3abc7895a01 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 496
diff changeset
119 @signal appendStdout(str) emitted to write data to stdout logger
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
120 @signal preferencesChanged() emitted after the preferences were changed
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
121 @signal reloadAPIs() emitted to reload the api information
500
c3abc7895a01 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 496
diff changeset
122 @signal showMenu(str, QMenu) emitted when a menu is about to be shown. The name
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
123 of the menu and a reference to the menu are given.
1127
b1802ebe0066 Added capability to encrypt saved passwords with a master password and rearranged some configuration parameters related to security.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1117
diff changeset
124 @signal masterPasswordChanged(str, str) emitted after the master
b1802ebe0066 Added capability to encrypt saved passwords with a master password and rearranged some configuration parameters related to security.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1117
diff changeset
125 password has been changed with the old and the new password
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
126 """
500
c3abc7895a01 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 496
diff changeset
127 appendStderr = pyqtSignal(str)
c3abc7895a01 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 496
diff changeset
128 appendStdout = pyqtSignal(str)
492
01f3384d535a Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 486
diff changeset
129 preferencesChanged = pyqtSignal()
500
c3abc7895a01 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 496
diff changeset
130 reloadAPIs = pyqtSignal()
c3abc7895a01 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 496
diff changeset
131 showMenu = pyqtSignal(str, QMenu)
1127
b1802ebe0066 Added capability to encrypt saved passwords with a master password and rearranged some configuration parameters related to security.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1117
diff changeset
132 masterPasswordChanged = pyqtSignal(str, str)
492
01f3384d535a Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 486
diff changeset
133
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
134 maxFilePathLen = 100
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
135 maxMenuFilePathLen = 75
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
136
2137
5a9bdcb8c934 Added the 'addSideWidget()' and 'removeSideWidget()' methods to the UserInterface class to allow plug-in developers to add a plug-in widget to the left or bottom side containers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2114
diff changeset
137 LeftSide = 1
5a9bdcb8c934 Added the 'addSideWidget()' and 'removeSideWidget()' methods to the UserInterface class to allow plug-in developers to add a plug-in widget to the left or bottom side containers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2114
diff changeset
138 BottomSide = 2
5a9bdcb8c934 Added the 'addSideWidget()' and 'removeSideWidget()' methods to the UserInterface class to allow plug-in developers to add a plug-in widget to the left or bottom side containers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2114
diff changeset
139 RightSide = 3
5a9bdcb8c934 Added the 'addSideWidget()' and 'removeSideWidget()' methods to the UserInterface class to allow plug-in developers to add a plug-in widget to the left or bottom side containers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2114
diff changeset
140
128
13e96bd0f5a5 Fixed an issue with handling the focus and (de-)activation of actions as it changes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 97
diff changeset
141 def __init__(self, app, locale, splash, plugin, noOpenAtStartup, restartArguments):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
142 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
143 Constructor
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
144
128
13e96bd0f5a5 Fixed an issue with handling the focus and (de-)activation of actions as it changes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 97
diff changeset
145 @param app reference to the application object (E5Application)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
146 @param locale locale to be used by the UI (string)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
147 @param splash reference to the splashscreen (UI.SplashScreen.SplashScreen)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
148 @param plugin filename of a plugin to be loaded (used for plugin development)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
149 @param noOpenAtStartup flag indicating that the open at startup option
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
150 should not be executed (boolean)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
151 @param restartArguments list of command line parameters to be used for a
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
152 restart (list of strings)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
153 """
2525
8b507a9a2d40 Script changes: Future import added, super calls modified and unicode behavior for str.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents: 2474
diff changeset
154 super(UserInterface, self).__init__()
733
a7fdfe0b9222 Fixed a strange warning message from Qt.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 608
diff changeset
155 self.setAttribute(Qt.WA_DeleteOnClose)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
156
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
157 self.__restartArgs = restartArguments[:]
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
158
2101
5bac7dee9e1a Introduced the E5MainWindow class allowing to set a style for all the main windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2094
diff changeset
159 self.setStyle(Preferences.getUI("Style"), Preferences.getUI("StyleSheet"))
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
160
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
161 self.maxEditorPathLen = Preferences.getUI("CaptionFilenameLength")
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
162 self.locale = locale
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
163 self.__noOpenAtStartup = noOpenAtStartup
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
164
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
165 self.layout, self.embeddedShell, self.embeddedFileBrowser = \
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
166 Preferences.getUILayout()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
167
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
168 self.passiveMode = Preferences.getDebugger("PassiveDbgEnabled")
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
169
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
170 g = Preferences.getGeometry("MainGeometry")
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
171 if g.isEmpty():
816
53e282890577 Made the toolbars of the initial layout more minimalistic.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 802
diff changeset
172 s = QSize(1280, 1024)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
173 self.resize(s)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
174 else:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
175 self.restoreGeometry(g)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
176 self.__startup = True
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
177
270
41505c92ac31 Added code to enhance the proxy configuration and removed the usage of QHttp.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 266
diff changeset
178 self.__proxyFactory = E5NetworkProxyFactory()
41505c92ac31 Added code to enhance the proxy configuration and removed the usage of QHttp.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 266
diff changeset
179 QNetworkProxyFactory.setApplicationProxyFactory(self.__proxyFactory)
41505c92ac31 Added code to enhance the proxy configuration and removed the usage of QHttp.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 266
diff changeset
180
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
181 self.capProject = ""
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
182 self.capEditor = ""
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
183 self.captionShowsFilename = Preferences.getUI("CaptionShowsFilename")
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
184
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
185 QApplication.setWindowIcon(UI.PixmapCache.getIcon("eric.png"))
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
186 self.setWindowIcon(UI.PixmapCache.getIcon("eric.png"))
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
187 self.__setWindowCaption()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
188
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
189 # load the view profiles
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
190 self.profiles = Preferences.getUI("ViewProfiles")
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
191
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
192 # Generate the debug server object
2409
df3820f08247 Continued implementing the delayed import.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2400
diff changeset
193 from Debugger.DebugServer import DebugServer
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
194 debugServer = DebugServer()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
195
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
196 # Generate an empty project object and multi project object
2409
df3820f08247 Continued implementing the delayed import.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2400
diff changeset
197 from Project.Project import Project
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
198 self.project = Project(self)
2409
df3820f08247 Continued implementing the delayed import.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2400
diff changeset
199
df3820f08247 Continued implementing the delayed import.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2400
diff changeset
200 from MultiProject.MultiProject import MultiProject
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
201 self.multiProject = MultiProject(self.project, self)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
202
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
203 splash.showMessage(self.trUtf8("Initializing Plugin Manager..."))
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
204
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
205 # Initialize the Plugin Manager (Plugins are initialized later
2409
df3820f08247 Continued implementing the delayed import.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2400
diff changeset
206 from PluginManager.PluginManager import PluginManager
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 934
diff changeset
207 self.pluginManager = PluginManager(self, develPlugin=plugin)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
208
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
209 splash.showMessage(self.trUtf8("Generating Main User Interface..."))
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
210
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
211 # Create the main window now so that we can connect QActions to it.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
212 logging.debug("Creating Layout...")
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
213 self.__createLayout(debugServer)
2182
fc3210851b07 Changed the layout of the right side widgets and added a sub menu for the switching between the 'inner' windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2155
diff changeset
214 self.__currentRightWidget = None
fc3210851b07 Changed the layout of the right side widgets and added a sub menu for the switching between the 'inner' windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2155
diff changeset
215 self.__currentBottomWidget = None
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
216
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
217 # Generate the debugger part of the ui
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
218 logging.debug("Creating Debugger UI...")
2409
df3820f08247 Continued implementing the delayed import.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2400
diff changeset
219 from Debugger.DebugUI import DebugUI
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 934
diff changeset
220 self.debuggerUI = DebugUI(self, self.viewmanager, debugServer,
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
221 self.debugViewer, self.project)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
222 self.debugViewer.setDebugger(self.debuggerUI)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
223 self.shell.setDebuggerUI(self.debuggerUI)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
224
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
225 # Generate the redirection helpers
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
226 self.stdout = Redirector(False)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
227 self.stderr = Redirector(True)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
228
1490
ed6f2208297d Changes to speed up the start-up phase by creating some dialog on demand.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1486
diff changeset
229 # set a few dialog members for dialogs created on demand
ed6f2208297d Changes to speed up the start-up phase by creating some dialog on demand.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1486
diff changeset
230 self.programsDialog = None
ed6f2208297d Changes to speed up the start-up phase by creating some dialog on demand.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1486
diff changeset
231 self.shortcutsDialog = None
ed6f2208297d Changes to speed up the start-up phase by creating some dialog on demand.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1486
diff changeset
232 self.unittestDialog = None
ed6f2208297d Changes to speed up the start-up phase by creating some dialog on demand.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1486
diff changeset
233 self.findFileNameDialog = None
ed6f2208297d Changes to speed up the start-up phase by creating some dialog on demand.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1486
diff changeset
234 self.diffDlg = None
ed6f2208297d Changes to speed up the start-up phase by creating some dialog on demand.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1486
diff changeset
235 self.compareDlg = None
ed6f2208297d Changes to speed up the start-up phase by creating some dialog on demand.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1486
diff changeset
236 self.findFilesDialog = None
ed6f2208297d Changes to speed up the start-up phase by creating some dialog on demand.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1486
diff changeset
237 self.replaceFilesDialog = None
2190
abd65b78425e Added a notification system and updated the source documentation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2184
diff changeset
238 self.__notification = None
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
239
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
240 # now setup the connections
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
241 splash.showMessage(self.trUtf8("Setting up connections..."))
476
121633976eca Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 470
diff changeset
242 app.focusChanged.connect(
121633976eca Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 470
diff changeset
243 self.viewmanager.appFocusChanged)
121633976eca Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 470
diff changeset
244 self.browser.sourceFile[str].connect(
121633976eca Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 470
diff changeset
245 self.viewmanager.openSourceFile)
121633976eca Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 470
diff changeset
246 self.browser.sourceFile[str, int].connect(
121633976eca Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 470
diff changeset
247 self.viewmanager.openSourceFile)
121633976eca Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 470
diff changeset
248 self.browser.sourceFile[str, int, str].connect(
121633976eca Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 470
diff changeset
249 self.viewmanager.openSourceFile)
500
c3abc7895a01 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 496
diff changeset
250 self.browser.designerFile.connect(self.__designer)
c3abc7895a01 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 496
diff changeset
251 self.browser.linguistFile.connect(self.__linguist4)
c3abc7895a01 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 496
diff changeset
252 self.browser.projectFile.connect(self.project.openProject)
c3abc7895a01 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 496
diff changeset
253 self.browser.multiProjectFile.connect(self.multiProject.openMultiProject)
c3abc7895a01 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 496
diff changeset
254 self.browser.pixmapEditFile.connect(self.__editPixmap)
c3abc7895a01 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 496
diff changeset
255 self.browser.pixmapFile.connect(self.__showPixmap)
c3abc7895a01 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 496
diff changeset
256 self.browser.svgFile.connect(self.__showSvg)
c3abc7895a01 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 496
diff changeset
257 self.browser.unittestOpen.connect(self.__unittestScript)
c3abc7895a01 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 496
diff changeset
258 self.browser.trpreview.connect(self.__TRPreviewer)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
259
476
121633976eca Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 470
diff changeset
260 self.debugViewer.exceptionLogger.sourceFile.connect(
121633976eca Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 470
diff changeset
261 self.viewmanager.openSourceFile)
121633976eca Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 470
diff changeset
262
121633976eca Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 470
diff changeset
263 self.debugViewer.sourceFile.connect(self.viewmanager.showDebugSource)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
264
500
c3abc7895a01 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 496
diff changeset
265 self.taskViewer.displayFile.connect(self.viewmanager.openSourceFile)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
266
476
121633976eca Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 470
diff changeset
267 self.projectBrowser.psBrowser.sourceFile[str].connect(
121633976eca Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 470
diff changeset
268 self.viewmanager.openSourceFile)
121633976eca Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 470
diff changeset
269 self.projectBrowser.psBrowser.sourceFile[str, int].connect(
121633976eca Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 470
diff changeset
270 self.viewmanager.openSourceFile)
121633976eca Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 470
diff changeset
271 self.projectBrowser.psBrowser.sourceFile[str, int, str].connect(
121633976eca Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 470
diff changeset
272 self.viewmanager.openSourceFile)
500
c3abc7895a01 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 496
diff changeset
273 self.projectBrowser.psBrowser.closeSourceWindow.connect(
c3abc7895a01 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 496
diff changeset
274 self.viewmanager.closeWindow)
c3abc7895a01 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 496
diff changeset
275 self.projectBrowser.psBrowser.unittestOpen.connect(self.__unittestScript)
c3abc7895a01 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 496
diff changeset
276
c3abc7895a01 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 496
diff changeset
277 self.projectBrowser.pfBrowser.designerFile.connect(self.__designer)
476
121633976eca Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 470
diff changeset
278 self.projectBrowser.pfBrowser.sourceFile.connect(
121633976eca Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 470
diff changeset
279 self.viewmanager.openSourceFile)
500
c3abc7895a01 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 496
diff changeset
280 self.projectBrowser.pfBrowser.uipreview.connect(self.__UIPreviewer)
c3abc7895a01 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 496
diff changeset
281 self.projectBrowser.pfBrowser.trpreview.connect(self.__TRPreviewer)
c3abc7895a01 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 496
diff changeset
282 self.projectBrowser.pfBrowser.closeSourceWindow.connect(
c3abc7895a01 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 496
diff changeset
283 self.viewmanager.closeWindow)
c3abc7895a01 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 496
diff changeset
284 self.projectBrowser.pfBrowser.appendStderr.connect(self.appendToStderr)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
285
476
121633976eca Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 470
diff changeset
286 self.projectBrowser.prBrowser.sourceFile.connect(
121633976eca Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 470
diff changeset
287 self.viewmanager.openSourceFile)
500
c3abc7895a01 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 496
diff changeset
288 self.projectBrowser.prBrowser.closeSourceWindow.connect(
c3abc7895a01 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 496
diff changeset
289 self.viewmanager.closeWindow)
c3abc7895a01 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 496
diff changeset
290 self.projectBrowser.prBrowser.appendStderr.connect(self.appendToStderr)
c3abc7895a01 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 496
diff changeset
291
c3abc7895a01 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 496
diff changeset
292 self.projectBrowser.ptBrowser.linguistFile.connect(self.__linguist4)
476
121633976eca Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 470
diff changeset
293 self.projectBrowser.ptBrowser.sourceFile.connect(
121633976eca Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 470
diff changeset
294 self.viewmanager.openSourceFile)
500
c3abc7895a01 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 496
diff changeset
295 self.projectBrowser.ptBrowser.trpreview[list].connect(self.__TRPreviewer)
c3abc7895a01 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 496
diff changeset
296 self.projectBrowser.ptBrowser.trpreview[list, bool].connect(self.__TRPreviewer)
c3abc7895a01 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 496
diff changeset
297 self.projectBrowser.ptBrowser.closeSourceWindow.connect(
c3abc7895a01 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 496
diff changeset
298 self.viewmanager.closeWindow)
c3abc7895a01 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 496
diff changeset
299 self.projectBrowser.ptBrowser.appendStdout.connect(self.appendToStdout)
c3abc7895a01 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 496
diff changeset
300 self.projectBrowser.ptBrowser.appendStderr.connect(self.appendToStderr)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
301
476
121633976eca Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 470
diff changeset
302 self.projectBrowser.piBrowser.sourceFile[str].connect(
121633976eca Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 470
diff changeset
303 self.viewmanager.openSourceFile)
121633976eca Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 470
diff changeset
304 self.projectBrowser.piBrowser.sourceFile[str, int].connect(
121633976eca Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 470
diff changeset
305 self.viewmanager.openSourceFile)
500
c3abc7895a01 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 496
diff changeset
306 self.projectBrowser.piBrowser.closeSourceWindow.connect(
c3abc7895a01 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 496
diff changeset
307 self.viewmanager.closeWindow)
c3abc7895a01 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 496
diff changeset
308 self.projectBrowser.piBrowser.appendStdout.connect(self.appendToStdout)
c3abc7895a01 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 496
diff changeset
309 self.projectBrowser.piBrowser.appendStderr.connect(self.appendToStderr)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
310
476
121633976eca Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 470
diff changeset
311 self.projectBrowser.poBrowser.sourceFile.connect(
121633976eca Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 470
diff changeset
312 self.viewmanager.openSourceFile)
500
c3abc7895a01 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 496
diff changeset
313 self.projectBrowser.poBrowser.closeSourceWindow.connect(
c3abc7895a01 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 496
diff changeset
314 self.viewmanager.closeWindow)
c3abc7895a01 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 496
diff changeset
315 self.projectBrowser.poBrowser.pixmapEditFile.connect(self.__editPixmap)
c3abc7895a01 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 496
diff changeset
316 self.projectBrowser.poBrowser.pixmapFile.connect(self.__showPixmap)
c3abc7895a01 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 496
diff changeset
317 self.projectBrowser.poBrowser.svgFile.connect(self.__showSvg)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
318
486
e4711a55e482 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 482
diff changeset
319 self.project.sourceFile.connect(self.viewmanager.openSourceFile)
e4711a55e482 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 482
diff changeset
320 self.project.projectOpened.connect(self.viewmanager.projectOpened)
1754
4e2f87d03546 Fixed an issue in the editor caused by double connecting to a signal.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1726
diff changeset
321 self.project.projectClosed.connect(self.viewmanager.projectClosed)
500
c3abc7895a01 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 496
diff changeset
322 self.project.projectFileRenamed.connect(self.viewmanager.projectFileRenamed)
c3abc7895a01 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 496
diff changeset
323 self.project.lexerAssociationsChanged.connect(
c3abc7895a01 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 496
diff changeset
324 self.viewmanager.projectLexerAssociationsChanged)
486
e4711a55e482 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 482
diff changeset
325 self.project.newProject.connect(self.__newProject)
e4711a55e482 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 482
diff changeset
326 self.project.projectOpened.connect(self.__projectOpened)
e4711a55e482 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 482
diff changeset
327 self.project.projectOpened.connect(self.__activateProjectBrowser)
e4711a55e482 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 482
diff changeset
328 self.project.projectClosed.connect(self.__projectClosed)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
329
500
c3abc7895a01 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 496
diff changeset
330 self.multiProject.multiProjectOpened.connect(self.__activateMultiProjectBrowser)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
331
482
4650a72c307a Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 481
diff changeset
332 self.debuggerUI.resetUI.connect(self.viewmanager.handleResetUI)
4650a72c307a Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 481
diff changeset
333 self.debuggerUI.resetUI.connect(self.debugViewer.handleResetUI)
2182
fc3210851b07 Changed the layout of the right side widgets and added a sub menu for the switching between the 'inner' windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2155
diff changeset
334 self.debuggerUI.resetUI.connect(self.__debuggingDone)
482
4650a72c307a Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 481
diff changeset
335 self.debuggerUI.debuggingStarted.connect(self.browser.handleProgramChange)
4650a72c307a Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 481
diff changeset
336 self.debuggerUI.debuggingStarted.connect(
4650a72c307a Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 481
diff changeset
337 self.debugViewer.exceptionLogger.debuggingStarted)
4650a72c307a Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 481
diff changeset
338 self.debuggerUI.debuggingStarted.connect(self.debugViewer.handleDebuggingStarted)
4650a72c307a Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 481
diff changeset
339 self.debuggerUI.debuggingStarted.connect(self.__programChange)
4650a72c307a Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 481
diff changeset
340 self.debuggerUI.debuggingStarted.connect(self.__debuggingStarted)
4650a72c307a Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 481
diff changeset
341 self.debuggerUI.compileForms.connect(
4650a72c307a Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 481
diff changeset
342 self.projectBrowser.pfBrowser.compileChangedForms)
4650a72c307a Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 481
diff changeset
343 self.debuggerUI.compileResources.connect(
4650a72c307a Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 481
diff changeset
344 self.projectBrowser.prBrowser.compileChangedResources)
755
e81e1f8d7874 Added display of suppressed client termination messages.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 733
diff changeset
345 self.debuggerUI.appendStdout.connect(self.appendToStdout)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
346
481
ad71812ba395 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 476
diff changeset
347 debugServer.passiveDebugStarted.connect(
ad71812ba395 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 476
diff changeset
348 self.debugViewer.exceptionLogger.debuggingStarted)
ad71812ba395 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 476
diff changeset
349 debugServer.passiveDebugStarted.connect(self.debugViewer.handleDebuggingStarted)
ad71812ba395 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 476
diff changeset
350 debugServer.clientException.connect(self.debugViewer.exceptionLogger.addException)
ad71812ba395 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 476
diff changeset
351 debugServer.clientLine.connect(
ad71812ba395 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 476
diff changeset
352 self.debugViewer.breakpointViewer.highlightBreakpoint)
ad71812ba395 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 476
diff changeset
353 debugServer.clientProcessStdout.connect(self.appendToStdout)
ad71812ba395 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 476
diff changeset
354 debugServer.clientProcessStderr.connect(self.appendToStderr)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
355
500
c3abc7895a01 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 496
diff changeset
356 self.stdout.appendStdout.connect(self.appendToStdout)
c3abc7895a01 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 496
diff changeset
357 self.stderr.appendStderr.connect(self.appendToStderr)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
358
492
01f3384d535a Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 486
diff changeset
359 self.preferencesChanged.connect(self.viewmanager.preferencesChanged)
500
c3abc7895a01 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 496
diff changeset
360 self.reloadAPIs.connect(self.viewmanager.getAPIsManager().reloadAPIs)
492
01f3384d535a Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 486
diff changeset
361 self.preferencesChanged.connect(self.logViewer.preferencesChanged)
500
c3abc7895a01 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 496
diff changeset
362 self.appendStdout.connect(self.logViewer.appendToStdout)
c3abc7895a01 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 496
diff changeset
363 self.appendStderr.connect(self.logViewer.appendToStderr)
492
01f3384d535a Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 486
diff changeset
364 self.preferencesChanged.connect(self.shell.handlePreferencesChanged)
01f3384d535a Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 486
diff changeset
365 self.preferencesChanged.connect(self.project.handlePreferencesChanged)
01f3384d535a Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 486
diff changeset
366 self.preferencesChanged.connect(self.projectBrowser.handlePreferencesChanged)
01f3384d535a Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 486
diff changeset
367 self.preferencesChanged.connect(
01f3384d535a Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 486
diff changeset
368 self.projectBrowser.psBrowser.handlePreferencesChanged)
01f3384d535a Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 486
diff changeset
369 self.preferencesChanged.connect(
01f3384d535a Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 486
diff changeset
370 self.projectBrowser.pfBrowser.handlePreferencesChanged)
01f3384d535a Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 486
diff changeset
371 self.preferencesChanged.connect(
01f3384d535a Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 486
diff changeset
372 self.projectBrowser.prBrowser.handlePreferencesChanged)
01f3384d535a Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 486
diff changeset
373 self.preferencesChanged.connect(
01f3384d535a Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 486
diff changeset
374 self.projectBrowser.ptBrowser.handlePreferencesChanged)
01f3384d535a Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 486
diff changeset
375 self.preferencesChanged.connect(
01f3384d535a Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 486
diff changeset
376 self.projectBrowser.piBrowser.handlePreferencesChanged)
01f3384d535a Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 486
diff changeset
377 self.preferencesChanged.connect(
01f3384d535a Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 486
diff changeset
378 self.projectBrowser.poBrowser.handlePreferencesChanged)
01f3384d535a Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 486
diff changeset
379 self.preferencesChanged.connect(self.browser.handlePreferencesChanged)
01f3384d535a Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 486
diff changeset
380 self.preferencesChanged.connect(self.taskViewer.handlePreferencesChanged)
01f3384d535a Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 486
diff changeset
381 self.preferencesChanged.connect(self.pluginManager.preferencesChanged)
01f3384d535a Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 486
diff changeset
382 self.preferencesChanged.connect(debugServer.preferencesChanged)
1926
474057fbefe0 Added the configurable capability to automatically show the source, when the call frame is changed in the callstack viewer of the local variables viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1852
diff changeset
383 self.preferencesChanged.connect(self.debugViewer.preferencesChanged)
492
01f3384d535a Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 486
diff changeset
384 self.preferencesChanged.connect(self.cooperation.preferencesChanged)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
385
500
c3abc7895a01 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 496
diff changeset
386 self.viewmanager.editorSaved.connect(self.project.repopulateItem)
486
e4711a55e482 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 482
diff changeset
387 self.viewmanager.lastEditorClosed.connect(self.__lastEditorClosed)
e4711a55e482 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 482
diff changeset
388 self.viewmanager.editorOpened.connect(self.__editorOpened)
500
c3abc7895a01 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 496
diff changeset
389 self.viewmanager.changeCaption.connect(self.__setWindowCaption)
486
e4711a55e482 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 482
diff changeset
390 self.viewmanager.checkActions.connect(self.__checkActions)
500
c3abc7895a01 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 496
diff changeset
391 self.viewmanager.editorChanged.connect(self.projectBrowser.handleEditorChanged)
486
e4711a55e482 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 482
diff changeset
392 self.viewmanager.checkActions.connect(self.cooperation.checkEditorActions)
158
6a561f87bc07 Added shared editor functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 150
diff changeset
393
2347
a4a4d710ebe8 Fixed the feedback of a changed zoom value from the editors, shell or terminal to the view manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2334
diff changeset
394 self.shell.zoomValueChanged.connect(self.viewmanager.zoomValueChanged)
a4a4d710ebe8 Fixed the feedback of a changed zoom value from the editors, shell or terminal to the view manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2334
diff changeset
395
500
c3abc7895a01 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 496
diff changeset
396 self.cooperation.shareEditor.connect(self.viewmanager.shareEditor)
c3abc7895a01 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 496
diff changeset
397 self.cooperation.startEdit.connect(self.viewmanager.startSharedEdit)
c3abc7895a01 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 496
diff changeset
398 self.cooperation.sendEdit.connect(self.viewmanager.sendSharedEdit)
c3abc7895a01 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 496
diff changeset
399 self.cooperation.cancelEdit.connect(self.viewmanager.cancelSharedEdit)
c3abc7895a01 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 496
diff changeset
400 self.cooperation.connected.connect(self.viewmanager.shareConnected)
c3abc7895a01 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 496
diff changeset
401 self.cooperation.editorCommand.connect(self.viewmanager.receive)
158
6a561f87bc07 Added shared editor functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 150
diff changeset
402 self.viewmanager.setCooperationClient(self.cooperation.getClient())
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
403
500
c3abc7895a01 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 496
diff changeset
404 self.symbolsViewer.insertSymbol.connect(self.viewmanager.insertSymbol)
c3abc7895a01 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 496
diff changeset
405
c3abc7895a01 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 496
diff changeset
406 self.numbersViewer.insertNumber.connect(self.viewmanager.insertNumber)
372
237c3fe739f5 Added a numbers viewer to convert numbers into various formats.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 365
diff changeset
407
2258
9ca42fd3ecc0 Added a signal to the IRC widget fired after the autoconnect was initiated. This will make the IRC pane the current one on the right side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2237
diff changeset
408 self.irc.autoConnected.connect(self.__ircAutoConnected)
9ca42fd3ecc0 Added a signal to the IRC widget fired after the autoconnect was initiated. This will make the IRC pane the current one on the right side.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2237
diff changeset
409
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
410 # create the toolbar manager object
55
b5c84934de9c Renamed E4Gui to E5Gui.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 53
diff changeset
411 self.toolbarManager = E5ToolBarManager(self, self)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
412 self.toolbarManager.setMainWindow(self)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
413
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
414 # Initialize the tool groups and list of started tools
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
415 splash.showMessage(self.trUtf8("Initializing Tools..."))
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
416 self.toolGroups, self.currentToolGroup = Preferences.readToolGroups()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
417 self.toolProcs = []
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
418 self.__initExternalToolsActions()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
419
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
420 # create a dummy help window for shortcuts handling
2409
df3820f08247 Continued implementing the delayed import.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2400
diff changeset
421 from Helpviewer.HelpWindow import HelpWindow
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
422 self.dummyHelpViewer = HelpWindow(None, '.', None, 'help viewer', True, True)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
423
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
424 # register all relevant objects
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
425 splash.showMessage(self.trUtf8("Registering Objects..."))
53
c3eb7cc1ff8b Renamed e5App to e5App.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 50
diff changeset
426 e5App().registerObject("UserInterface", self)
c3eb7cc1ff8b Renamed e5App to e5App.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 50
diff changeset
427 e5App().registerObject("DebugUI", self.debuggerUI)
c3eb7cc1ff8b Renamed e5App to e5App.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 50
diff changeset
428 e5App().registerObject("DebugServer", debugServer)
c3eb7cc1ff8b Renamed e5App to e5App.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 50
diff changeset
429 e5App().registerObject("ViewManager", self.viewmanager)
c3eb7cc1ff8b Renamed e5App to e5App.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 50
diff changeset
430 e5App().registerObject("Project", self.project)
c3eb7cc1ff8b Renamed e5App to e5App.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 50
diff changeset
431 e5App().registerObject("ProjectBrowser", self.projectBrowser)
c3eb7cc1ff8b Renamed e5App to e5App.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 50
diff changeset
432 e5App().registerObject("MultiProject", self.multiProject)
c3eb7cc1ff8b Renamed e5App to e5App.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 50
diff changeset
433 e5App().registerObject("TaskViewer", self.taskViewer)
c3eb7cc1ff8b Renamed e5App to e5App.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 50
diff changeset
434 e5App().registerObject("TemplateViewer", self.templateViewer)
c3eb7cc1ff8b Renamed e5App to e5App.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 50
diff changeset
435 e5App().registerObject("Shell", self.shell)
c3eb7cc1ff8b Renamed e5App to e5App.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 50
diff changeset
436 e5App().registerObject("DummyHelpViewer", self.dummyHelpViewer)
c3eb7cc1ff8b Renamed e5App to e5App.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 50
diff changeset
437 e5App().registerObject("PluginManager", self.pluginManager)
c3eb7cc1ff8b Renamed e5App to e5App.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 50
diff changeset
438 e5App().registerObject("ToolbarManager", self.toolbarManager)
150
6ca76837a2d4 Forgot to register the new cooperation object.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 149
diff changeset
439 e5App().registerObject("Cooperation", self.cooperation)
2227
b7aceb255831 First commit of the simple IRC client for eric. It is usable but not yet complete.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2214
diff changeset
440 e5App().registerObject("IRC", self.irc)
365
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 357
diff changeset
441 e5App().registerObject("Symbols", self.symbolsViewer)
372
237c3fe739f5 Added a numbers viewer to convert numbers into various formats.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 365
diff changeset
442 e5App().registerObject("Numbers", self.numbersViewer)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
443
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
444 # Initialize the actions, menus, toolbars and statusbar
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
445 splash.showMessage(self.trUtf8("Initializing Actions..."))
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
446 self.__initActions()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
447 splash.showMessage(self.trUtf8("Initializing Menus..."))
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
448 self.__initMenus()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
449 splash.showMessage(self.trUtf8("Initializing Toolbars..."))
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
450 self.__initToolbars()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
451 splash.showMessage(self.trUtf8("Initializing Statusbar..."))
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
452 self.__initStatusbar()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
453
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
454 # Initialise the instance variables.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
455 self.currentProg = None
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
456 self.isProg = False
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
457 self.utEditorOpen = False
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
458 self.utProjectOpen = False
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
459
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
460 self.inDragDrop = False
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
461 self.setAcceptDrops(True)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
462
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
463 self.currentProfile = None
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
464
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
465 self.shutdownCalled = False
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
466 self.inCloseEevent = False
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
467
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
468 # now redirect stdout and stderr
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
469 # TODO: release - reenable redirection
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
470 ## sys.stdout = self.stdout
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
471 ## sys.stderr = self.stderr
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
472
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
473 # now fire up the single application server
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
474 if Preferences.getUI("SingleApplicationMode"):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
475 splash.showMessage(self.trUtf8("Initializing Single Application Server..."))
55
b5c84934de9c Renamed E4Gui to E5Gui.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 53
diff changeset
476 self.SAServer = E5SingleApplicationServer()
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
477 else:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
478 self.SAServer = None
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
479
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
480 # now finalize the plugin manager setup
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
481 self.pluginManager.finalizeSetup()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
482 # now activate plugins having autoload set to True
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
483 splash.showMessage(self.trUtf8("Activating Plugins..."))
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
484 self.pluginManager.activatePlugins()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
485
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
486 # now read the keyboard shortcuts for all the actions
2409
df3820f08247 Continued implementing the delayed import.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2400
diff changeset
487 from Preferences import Shortcuts
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
488 Shortcuts.readShortcuts()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
489
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
490 # restore toolbar manager state
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
491 splash.showMessage(self.trUtf8("Restoring Toolbarmanager..."))
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
492 self.toolbarManager.restoreState(Preferences.getUI("ToolbarManagerState"))
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
493
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
494 # now activate the initial view profile
1279
facfc314dfeb Added some startup splash messages.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1232
diff changeset
495 splash.showMessage(self.trUtf8("Setting View Profile..."))
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
496 self.__setEditProfile()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
497
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
498 # now read the saved tasks
1279
facfc314dfeb Added some startup splash messages.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1232
diff changeset
499 splash.showMessage(self.trUtf8("Reading Tasks..."))
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
500 self.__readTasks()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
501
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
502 # now read the saved templates
1279
facfc314dfeb Added some startup splash messages.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1232
diff changeset
503 splash.showMessage(self.trUtf8("Reading Templates..."))
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
504 self.templateViewer.readTemplates()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
505
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
506 # now start the debug client
1279
facfc314dfeb Added some startup splash messages.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1232
diff changeset
507 splash.showMessage(self.trUtf8("Starting Debugger..."))
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
508 debugServer.startClient(False)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
509
270
41505c92ac31 Added code to enhance the proxy configuration and removed the usage of QHttp.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 266
diff changeset
510 # attributes for the network objects
41505c92ac31 Added code to enhance the proxy configuration and removed the usage of QHttp.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 266
diff changeset
511 self.__networkManager = QNetworkAccessManager(self)
500
c3abc7895a01 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 496
diff changeset
512 self.__networkManager.proxyAuthenticationRequired.connect(
286
652f5159f1c3 Prepared to have individual proxies per scheme.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 270
diff changeset
513 proxyAuthenticationRequired)
798
5c1786fad576 Fixed an issue with Qt installations that don't support SSL.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
514 if SSL_AVAILABLE:
2354
c63de4af553d Centralized the SSL error handling in E5SslErrorHandler.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2347
diff changeset
515 self.__sslErrorHandler = E5SslErrorHandler(self)
798
5c1786fad576 Fixed an issue with Qt installations that don't support SSL.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
516 self.__networkManager.sslErrors.connect(self.__sslErrors)
270
41505c92ac31 Added code to enhance the proxy configuration and removed the usage of QHttp.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 266
diff changeset
517 self.__replies = []
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
518
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
519 # attribute for the help window
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
520 self.helpWindow = None
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
521
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
522 # list of web addresses serving the versions file
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
523 self.__httpAlternatives = Preferences.getUI("VersionsUrls5")
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
524 self.__inVersionCheck = False
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
525 self.__versionCheckProgress = None
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
526
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
527 # set spellchecker defaults
2409
df3820f08247 Continued implementing the delayed import.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2400
diff changeset
528 from QScintilla.SpellChecker import SpellChecker
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
529 SpellChecker.setDefaultLanguage(
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
530 Preferences.getEditor("SpellCheckingDefaultLanguage"))
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
531
934
657269549914 Changed the configuration dialog to remember the last show page name.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 927
diff changeset
532 # attribute for the last shown configuration page
657269549914 Changed the configuration dialog to remember the last show page name.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 927
diff changeset
533 self.__lastConfigurationPageName = ""
657269549914 Changed the configuration dialog to remember the last show page name.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 927
diff changeset
534
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
535 def __createLayout(self, debugServer):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
536 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
537 Private method to create the layout of the various windows.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
538
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
539 @param debugServer reference to the debug server object
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
540 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
541 # Create the view manager depending on the configuration setting
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
542 logging.debug("Creating Viewmanager...")
2409
df3820f08247 Continued implementing the delayed import.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2400
diff changeset
543 import ViewManager
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
544 self.viewmanager = \
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
545 ViewManager.factory(self, self, debugServer, self.pluginManager)
2425
ace8a08028f3 Fixed the main window layout after the previewer change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2424
diff changeset
546 leftWidget = QWidget()
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
547 layout = QVBoxLayout()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
548 layout.setContentsMargins(1, 1, 1, 1)
2362
68a92d01c1cc Made the search and replace widgets scrollable (customisation for smaller screens).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2361
diff changeset
549 layout.setSpacing(1)
2425
ace8a08028f3 Fixed the main window layout after the previewer change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2424
diff changeset
550 layout.addWidget(self.viewmanager)
2362
68a92d01c1cc Made the search and replace widgets scrollable (customisation for smaller screens).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2361
diff changeset
551 layout.addWidget(self.viewmanager.searchWidget())
68a92d01c1cc Made the search and replace widgets scrollable (customisation for smaller screens).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2361
diff changeset
552 layout.addWidget(self.viewmanager.replaceWidget())
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
553 self.viewmanager.setSizePolicy(QSizePolicy.Preferred, QSizePolicy.Expanding)
2425
ace8a08028f3 Fixed the main window layout after the previewer change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2424
diff changeset
554 leftWidget.setLayout(layout)
2362
68a92d01c1cc Made the search and replace widgets scrollable (customisation for smaller screens).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2361
diff changeset
555 self.viewmanager.searchWidget().hide()
68a92d01c1cc Made the search and replace widgets scrollable (customisation for smaller screens).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2361
diff changeset
556 self.viewmanager.replaceWidget().hide()
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
557
2425
ace8a08028f3 Fixed the main window layout after the previewer change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2424
diff changeset
558 splitter = QSplitter(Qt.Horizontal)
ace8a08028f3 Fixed the main window layout after the previewer change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2424
diff changeset
559 splitter.addWidget(leftWidget)
ace8a08028f3 Fixed the main window layout after the previewer change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2424
diff changeset
560 self.setCentralWidget(splitter)
ace8a08028f3 Fixed the main window layout after the previewer change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2424
diff changeset
561
2424
8fe1fdc174ab Added the capability to preview HTML, Mardown and ReST files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2411
diff changeset
562 # Create previewer
8fe1fdc174ab Added the capability to preview HTML, Mardown and ReST files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2411
diff changeset
563 logging.debug("Creating Previewer...")
8fe1fdc174ab Added the capability to preview HTML, Mardown and ReST files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2411
diff changeset
564 from .Previewer import Previewer
8fe1fdc174ab Added the capability to preview HTML, Mardown and ReST files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2411
diff changeset
565 self.__previewer = Previewer(self.viewmanager, splitter)
8fe1fdc174ab Added the capability to preview HTML, Mardown and ReST files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2411
diff changeset
566 splitter.addWidget(self.__previewer)
8fe1fdc174ab Added the capability to preview HTML, Mardown and ReST files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2411
diff changeset
567
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
568 # Create layout with toolbox windows embedded in dock windows
1852
12d37ab1baf3 Removed the user interface layout types "Floating Windows" and "Dock Windows".
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1843
diff changeset
569 if self.layout == "Toolboxes":
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
570 logging.debug("Creating toolboxes...")
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
571 self.__createToolboxesLayout(debugServer)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
572
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
573 # Create layout with sidebar windows embedded in dock windows
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
574 elif self.layout == "Sidebars":
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
575 logging.debug("Creating sidebars...")
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
576 self.__createSidebarsLayout(debugServer)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
577
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
578 else:
1852
12d37ab1baf3 Removed the user interface layout types "Floating Windows" and "Dock Windows".
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1843
diff changeset
579 raise ValueError("Wrong layout type given ({0})".format(self.layout))
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
580 logging.debug("Created Layout")
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
581
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
582 def __createToolboxesLayout(self, debugServer):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
583 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
584 Private method to create the Toolboxes layout.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
585
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
586 @param debugServer reference to the debug server object
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
587 """
2400
c1726b754f96 Started with delaying the import upon the time it is needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2370
diff changeset
588 from E5Gui.E5ToolBox import E5VerticalToolBox, E5HorizontalToolBox
c1726b754f96 Started with delaying the import upon the time it is needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2370
diff changeset
589
2182
fc3210851b07 Changed the layout of the right side widgets and added a sub menu for the switching between the 'inner' windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2155
diff changeset
590 # Create the left toolbox
fc3210851b07 Changed the layout of the right side widgets and added a sub menu for the switching between the 'inner' windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2155
diff changeset
591 self.lToolboxDock = self.__createDockWindow("lToolboxDock")
fc3210851b07 Changed the layout of the right side widgets and added a sub menu for the switching between the 'inner' windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2155
diff changeset
592 self.lToolbox = E5VerticalToolBox(self.lToolboxDock)
fc3210851b07 Changed the layout of the right side widgets and added a sub menu for the switching between the 'inner' windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2155
diff changeset
593 self.__setupDockWindow(self.lToolboxDock, Qt.LeftDockWidgetArea,
fc3210851b07 Changed the layout of the right side widgets and added a sub menu for the switching between the 'inner' windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2155
diff changeset
594 self.lToolbox, self.trUtf8("Left Toolbox"))
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
595
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
596 # Create the horizontal toolbox
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
597 self.hToolboxDock = self.__createDockWindow("hToolboxDock")
55
b5c84934de9c Renamed E4Gui to E5Gui.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 53
diff changeset
598 self.hToolbox = E5HorizontalToolBox(self.hToolboxDock)
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 934
diff changeset
599 self.__setupDockWindow(self.hToolboxDock, Qt.BottomDockWidgetArea,
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
600 self.hToolbox, self.trUtf8("Horizontal Toolbox"))
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
601
2182
fc3210851b07 Changed the layout of the right side widgets and added a sub menu for the switching between the 'inner' windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2155
diff changeset
602 # Create the right toolbox
fc3210851b07 Changed the layout of the right side widgets and added a sub menu for the switching between the 'inner' windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2155
diff changeset
603 self.rToolboxDock = self.__createDockWindow("rToolboxDock")
fc3210851b07 Changed the layout of the right side widgets and added a sub menu for the switching between the 'inner' windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2155
diff changeset
604 self.rToolbox = E5VerticalToolBox(self.rToolboxDock)
fc3210851b07 Changed the layout of the right side widgets and added a sub menu for the switching between the 'inner' windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2155
diff changeset
605 self.__setupDockWindow(self.rToolboxDock, Qt.RightDockWidgetArea,
fc3210851b07 Changed the layout of the right side widgets and added a sub menu for the switching between the 'inner' windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2155
diff changeset
606 self.rToolbox, self.trUtf8("Right Toolbox"))
fc3210851b07 Changed the layout of the right side widgets and added a sub menu for the switching between the 'inner' windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2155
diff changeset
607
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
608 # Create the project browser
2409
df3820f08247 Continued implementing the delayed import.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2400
diff changeset
609 from Project.ProjectBrowser import ProjectBrowser
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
610 self.projectBrowser = ProjectBrowser(self.project, None,
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
611 embeddedBrowser=(self.embeddedFileBrowser == 2))
2182
fc3210851b07 Changed the layout of the right side widgets and added a sub menu for the switching between the 'inner' windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2155
diff changeset
612 self.lToolbox.addItem(self.projectBrowser,
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 934
diff changeset
613 UI.PixmapCache.getIcon("projectViewer.png"),
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
614 self.trUtf8("Project-Viewer"))
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
615
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
616 # Create the multi project browser
2409
df3820f08247 Continued implementing the delayed import.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2400
diff changeset
617 from MultiProject.MultiProjectBrowser import MultiProjectBrowser
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
618 self.multiProjectBrowser = MultiProjectBrowser(self.multiProject)
2182
fc3210851b07 Changed the layout of the right side widgets and added a sub menu for the switching between the 'inner' windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2155
diff changeset
619 self.lToolbox.addItem(self.multiProjectBrowser,
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 934
diff changeset
620 UI.PixmapCache.getIcon("multiProjectViewer.png"),
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
621 self.trUtf8("Multiproject-Viewer"))
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
622
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
623 # Create the template viewer part of the user interface
2409
df3820f08247 Continued implementing the delayed import.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2400
diff changeset
624 from Templates.TemplateViewer import TemplateViewer
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 934
diff changeset
625 self.templateViewer = TemplateViewer(None,
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
626 self.viewmanager)
2182
fc3210851b07 Changed the layout of the right side widgets and added a sub menu for the switching between the 'inner' windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2155
diff changeset
627 self.lToolbox.addItem(self.templateViewer,
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 934
diff changeset
628 UI.PixmapCache.getIcon("templateViewer.png"),
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
629 self.trUtf8("Template-Viewer"))
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
630
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
631 # Create the debug viewer maybe without the embedded shell
2409
df3820f08247 Continued implementing the delayed import.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2400
diff changeset
632 from Debugger.DebugViewer import DebugViewer
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 934
diff changeset
633 self.debugViewer = DebugViewer(debugServer, True, self.viewmanager,
2182
fc3210851b07 Changed the layout of the right side widgets and added a sub menu for the switching between the 'inner' windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2155
diff changeset
634 None,
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 934
diff changeset
635 embeddedShell=self.embeddedShell,
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
636 embeddedBrowser=(self.embeddedFileBrowser == 1))
2182
fc3210851b07 Changed the layout of the right side widgets and added a sub menu for the switching between the 'inner' windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2155
diff changeset
637 self.rToolbox.addItem(self.debugViewer,
fc3210851b07 Changed the layout of the right side widgets and added a sub menu for the switching between the 'inner' windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2155
diff changeset
638 UI.PixmapCache.getIcon("debugViewer.png"),
fc3210851b07 Changed the layout of the right side widgets and added a sub menu for the switching between the 'inner' windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2155
diff changeset
639 self.trUtf8("Debug-Viewer"))
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
640
149
a134031209be Added stage 1 of the cooperation functions (chat system).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 137
diff changeset
641 # Create the chat part of the user interface
2409
df3820f08247 Continued implementing the delayed import.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2400
diff changeset
642 from Cooperation.ChatWidget import ChatWidget
2190
abd65b78425e Added a notification system and updated the source documentation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2184
diff changeset
643 self.cooperation = ChatWidget(self)
2182
fc3210851b07 Changed the layout of the right side widgets and added a sub menu for the switching between the 'inner' windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2155
diff changeset
644 self.rToolbox.addItem(self.cooperation,
fc3210851b07 Changed the layout of the right side widgets and added a sub menu for the switching between the 'inner' windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2155
diff changeset
645 UI.PixmapCache.getIcon("cooperation.png"),
fc3210851b07 Changed the layout of the right side widgets and added a sub menu for the switching between the 'inner' windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2155
diff changeset
646 self.trUtf8("Cooperation"))
149
a134031209be Added stage 1 of the cooperation functions (chat system).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 137
diff changeset
647
2227
b7aceb255831 First commit of the simple IRC client for eric. It is usable but not yet complete.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2214
diff changeset
648 # Create the IRC part of the user interface
2409
df3820f08247 Continued implementing the delayed import.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2400
diff changeset
649 from Network.IRC.IrcWidget import IrcWidget
2227
b7aceb255831 First commit of the simple IRC client for eric. It is usable but not yet complete.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2214
diff changeset
650 self.irc = IrcWidget(self)
b7aceb255831 First commit of the simple IRC client for eric. It is usable but not yet complete.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2214
diff changeset
651 self.rToolbox.addItem(self.irc,
b7aceb255831 First commit of the simple IRC client for eric. It is usable but not yet complete.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2214
diff changeset
652 UI.PixmapCache.getIcon("irc.png"),
b7aceb255831 First commit of the simple IRC client for eric. It is usable but not yet complete.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2214
diff changeset
653 self.trUtf8("IRC"))
b7aceb255831 First commit of the simple IRC client for eric. It is usable but not yet complete.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2214
diff changeset
654
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
655 # Create the task viewer part of the user interface
2409
df3820f08247 Continued implementing the delayed import.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2400
diff changeset
656 from Tasks.TaskViewer import TaskViewer
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
657 self.taskViewer = TaskViewer(None, self.project)
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 934
diff changeset
658 self.hToolbox.addItem(self.taskViewer,
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 934
diff changeset
659 UI.PixmapCache.getIcon("task.png"),
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
660 self.trUtf8("Task-Viewer"))
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
661
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
662 # Create the log viewer part of the user interface
2409
df3820f08247 Continued implementing the delayed import.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2400
diff changeset
663 from .LogView import LogViewer
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
664 self.logViewer = LogViewer()
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 934
diff changeset
665 self.hToolbox.addItem(self.logViewer,
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 934
diff changeset
666 UI.PixmapCache.getIcon("logViewer.png"),
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
667 self.trUtf8("Log-Viewer"))
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
668
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
669 if self.embeddedShell:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
670 self.shell = self.debugViewer.shell
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
671 else:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
672 # Create the shell
2409
df3820f08247 Continued implementing the delayed import.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2400
diff changeset
673 from QScintilla.Shell import ShellAssembly
1833
f7cd855680f1 Added the capability to search in the output of the shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1830
diff changeset
674 self.shellAssembly = ShellAssembly(debugServer, self.viewmanager, True)
f7cd855680f1 Added the capability to search in the output of the shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1830
diff changeset
675 self.shell = self.shellAssembly.shell()
f7cd855680f1 Added the capability to search in the output of the shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1830
diff changeset
676 self.hToolbox.insertItem(0, self.shellAssembly,
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 934
diff changeset
677 UI.PixmapCache.getIcon("shell.png"),
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
678 self.trUtf8("Shell"))
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
679
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
680 if self.embeddedFileBrowser == 0: # separate window
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
681 # Create the file browser
2409
df3820f08247 Continued implementing the delayed import.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2400
diff changeset
682 from .Browser import Browser
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
683 self.browser = Browser()
2182
fc3210851b07 Changed the layout of the right side widgets and added a sub menu for the switching between the 'inner' windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2155
diff changeset
684 self.lToolbox.addItem(self.browser,
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 934
diff changeset
685 UI.PixmapCache.getIcon("browser.png"),
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
686 self.trUtf8("File-Browser"))
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 934
diff changeset
687 elif self.embeddedFileBrowser == 1: # embedded in debug browser
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
688 self.browser = self.debugViewer.browser
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
689 else: # embedded in project browser
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
690 self.browser = self.projectBrowser.fileBrowser
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
691
365
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 357
diff changeset
692 # Create the symbols viewer
2409
df3820f08247 Continued implementing the delayed import.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2400
diff changeset
693 from .SymbolsWidget import SymbolsWidget
365
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 357
diff changeset
694 self.symbolsViewer = SymbolsWidget()
2182
fc3210851b07 Changed the layout of the right side widgets and added a sub menu for the switching between the 'inner' windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2155
diff changeset
695 self.lToolbox.addItem(self.symbolsViewer,
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 934
diff changeset
696 UI.PixmapCache.getIcon("symbols.png"),
365
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 357
diff changeset
697 self.trUtf8("Symbols"))
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 357
diff changeset
698
372
237c3fe739f5 Added a numbers viewer to convert numbers into various formats.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 365
diff changeset
699 # Create the numbers viewer
2409
df3820f08247 Continued implementing the delayed import.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2400
diff changeset
700 from .NumbersWidget import NumbersWidget
372
237c3fe739f5 Added a numbers viewer to convert numbers into various formats.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 365
diff changeset
701 self.numbersViewer = NumbersWidget()
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 934
diff changeset
702 self.hToolbox.addItem(self.numbersViewer,
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 934
diff changeset
703 UI.PixmapCache.getIcon("numbers.png"),
372
237c3fe739f5 Added a numbers viewer to convert numbers into various formats.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 365
diff changeset
704 self.trUtf8("Numbers"))
237c3fe739f5 Added a numbers viewer to convert numbers into various formats.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 365
diff changeset
705
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
706 self.hToolbox.setCurrentIndex(0)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
707
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
708 def __createSidebarsLayout(self, debugServer):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
709 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
710 Private method to create the Sidebars layout.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
711
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
712 @param debugServer reference to the debug server object
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
713 """
2400
c1726b754f96 Started with delaying the import upon the time it is needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2370
diff changeset
714 from E5Gui.E5SideBar import E5SideBar
c1726b754f96 Started with delaying the import upon the time it is needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2370
diff changeset
715
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
716 # Create the left sidebar
55
b5c84934de9c Renamed E4Gui to E5Gui.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 53
diff changeset
717 self.leftSidebar = E5SideBar(E5SideBar.West)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
718
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
719 # Create the bottom sidebar
55
b5c84934de9c Renamed E4Gui to E5Gui.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 53
diff changeset
720 self.bottomSidebar = E5SideBar(E5SideBar.South)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
721
2182
fc3210851b07 Changed the layout of the right side widgets and added a sub menu for the switching between the 'inner' windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2155
diff changeset
722 # Create the right sidebar
fc3210851b07 Changed the layout of the right side widgets and added a sub menu for the switching between the 'inner' windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2155
diff changeset
723 self.rightSidebar = E5SideBar(E5SideBar.East)
fc3210851b07 Changed the layout of the right side widgets and added a sub menu for the switching between the 'inner' windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2155
diff changeset
724
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
725 # Create the project browser
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
726 logging.debug("Creating Project Browser...")
2409
df3820f08247 Continued implementing the delayed import.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2400
diff changeset
727 from Project.ProjectBrowser import ProjectBrowser
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
728 self.projectBrowser = ProjectBrowser(self.project, None,
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
729 embeddedBrowser=(self.embeddedFileBrowser == 2))
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 934
diff changeset
730 self.leftSidebar.addTab(self.projectBrowser,
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 934
diff changeset
731 UI.PixmapCache.getIcon("projectViewer.png"),
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
732 self.trUtf8("Project-Viewer"))
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
733
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
734 # Create the multi project browser
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
735 logging.debug("Creating Multiproject Browser...")
2409
df3820f08247 Continued implementing the delayed import.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2400
diff changeset
736 from MultiProject.MultiProjectBrowser import MultiProjectBrowser
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
737 self.multiProjectBrowser = MultiProjectBrowser(self.multiProject)
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 934
diff changeset
738 self.leftSidebar.addTab(self.multiProjectBrowser,
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 934
diff changeset
739 UI.PixmapCache.getIcon("multiProjectViewer.png"),
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
740 self.trUtf8("Multiproject-Viewer"))
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
741
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
742 # Create the template viewer part of the user interface
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
743 logging.debug("Creating Template Viewer...")
2409
df3820f08247 Continued implementing the delayed import.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2400
diff changeset
744 from Templates.TemplateViewer import TemplateViewer
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 934
diff changeset
745 self.templateViewer = TemplateViewer(None,
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
746 self.viewmanager)
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 934
diff changeset
747 self.leftSidebar.addTab(self.templateViewer,
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 934
diff changeset
748 UI.PixmapCache.getIcon("templateViewer.png"),
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
749 self.trUtf8("Template-Viewer"))
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
750
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
751 # Create the debug viewer maybe without the embedded shell
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
752 logging.debug("Creating Debug Viewer...")
2409
df3820f08247 Continued implementing the delayed import.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2400
diff changeset
753 from Debugger.DebugViewer import DebugViewer
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 934
diff changeset
754 self.debugViewer = DebugViewer(debugServer, True, self.viewmanager,
2182
fc3210851b07 Changed the layout of the right side widgets and added a sub menu for the switching between the 'inner' windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2155
diff changeset
755 None,
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 934
diff changeset
756 embeddedShell=self.embeddedShell,
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
757 embeddedBrowser=(self.embeddedFileBrowser == 1))
2182
fc3210851b07 Changed the layout of the right side widgets and added a sub menu for the switching between the 'inner' windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2155
diff changeset
758 self.rightSidebar.addTab(self.debugViewer,
fc3210851b07 Changed the layout of the right side widgets and added a sub menu for the switching between the 'inner' windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2155
diff changeset
759 UI.PixmapCache.getIcon("debugViewer.png"), self.trUtf8("Debug-Viewer"))
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
760
149
a134031209be Added stage 1 of the cooperation functions (chat system).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 137
diff changeset
761 # Create the chat part of the user interface
2182
fc3210851b07 Changed the layout of the right side widgets and added a sub menu for the switching between the 'inner' windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2155
diff changeset
762 logging.debug("Creating Chat Widget...")
2409
df3820f08247 Continued implementing the delayed import.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2400
diff changeset
763 from Cooperation.ChatWidget import ChatWidget
2190
abd65b78425e Added a notification system and updated the source documentation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2184
diff changeset
764 self.cooperation = ChatWidget(self)
2182
fc3210851b07 Changed the layout of the right side widgets and added a sub menu for the switching between the 'inner' windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2155
diff changeset
765 self.rightSidebar.addTab(self.cooperation,
fc3210851b07 Changed the layout of the right side widgets and added a sub menu for the switching between the 'inner' windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2155
diff changeset
766 UI.PixmapCache.getIcon("cooperation.png"), self.trUtf8("Cooperation"))
149
a134031209be Added stage 1 of the cooperation functions (chat system).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 137
diff changeset
767
2227
b7aceb255831 First commit of the simple IRC client for eric. It is usable but not yet complete.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2214
diff changeset
768 # Create the IRC part of the user interface
b7aceb255831 First commit of the simple IRC client for eric. It is usable but not yet complete.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2214
diff changeset
769 logging.debug("Creating IRC Widget...")
2409
df3820f08247 Continued implementing the delayed import.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2400
diff changeset
770 from Network.IRC.IrcWidget import IrcWidget
2227
b7aceb255831 First commit of the simple IRC client for eric. It is usable but not yet complete.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2214
diff changeset
771 self.irc = IrcWidget(self)
b7aceb255831 First commit of the simple IRC client for eric. It is usable but not yet complete.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2214
diff changeset
772 self.rightSidebar.addTab(self.irc,
b7aceb255831 First commit of the simple IRC client for eric. It is usable but not yet complete.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2214
diff changeset
773 UI.PixmapCache.getIcon("irc.png"), self.trUtf8("IRC"))
b7aceb255831 First commit of the simple IRC client for eric. It is usable but not yet complete.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2214
diff changeset
774
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
775 # Create the task viewer part of the user interface
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
776 logging.debug("Creating Task Viewer...")
2409
df3820f08247 Continued implementing the delayed import.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2400
diff changeset
777 from Tasks.TaskViewer import TaskViewer
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
778 self.taskViewer = TaskViewer(None, self.project)
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 934
diff changeset
779 self.bottomSidebar.addTab(self.taskViewer,
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 934
diff changeset
780 UI.PixmapCache.getIcon("task.png"),
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
781 self.trUtf8("Task-Viewer"))
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
782
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
783 # Create the log viewer part of the user interface
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
784 logging.debug("Creating Log Viewer...")
2409
df3820f08247 Continued implementing the delayed import.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2400
diff changeset
785 from .LogView import LogViewer
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
786 self.logViewer = LogViewer()
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 934
diff changeset
787 self.bottomSidebar.addTab(self.logViewer,
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 934
diff changeset
788 UI.PixmapCache.getIcon("logViewer.png"),
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
789 self.trUtf8("Log-Viewer"))
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
790
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
791 if self.embeddedShell:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
792 self.shell = self.debugViewer.shell
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
793 else:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
794 # Create the shell
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
795 logging.debug("Creating Shell...")
2409
df3820f08247 Continued implementing the delayed import.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2400
diff changeset
796 from QScintilla.Shell import ShellAssembly
1833
f7cd855680f1 Added the capability to search in the output of the shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1830
diff changeset
797 self.shellAssembly = ShellAssembly(debugServer, self.viewmanager, True)
f7cd855680f1 Added the capability to search in the output of the shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1830
diff changeset
798 self.shell = self.shellAssembly.shell()
f7cd855680f1 Added the capability to search in the output of the shell window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1830
diff changeset
799 self.bottomSidebar.insertTab(0, self.shellAssembly,
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 934
diff changeset
800 UI.PixmapCache.getIcon("shell.png"),
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
801 self.trUtf8("Shell"))
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
802
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
803 if self.embeddedFileBrowser == 0: # separate window
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
804 # Create the file browser
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
805 logging.debug("Creating File Browser...")
2409
df3820f08247 Continued implementing the delayed import.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2400
diff changeset
806 from .Browser import Browser
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
807 self.browser = Browser()
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 934
diff changeset
808 self.leftSidebar.addTab(self.browser,
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 934
diff changeset
809 UI.PixmapCache.getIcon("browser.png"),
365
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 357
diff changeset
810 self.trUtf8("File-Browser"))
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 934
diff changeset
811 elif self.embeddedFileBrowser == 1: # embedded in debug browser
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
812 self.browser = self.debugViewer.browser
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
813 else: # embedded in project browser
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
814 self.browser = self.projectBrowser.fileBrowser
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
815
365
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 357
diff changeset
816 # Create the symbols viewer
2409
df3820f08247 Continued implementing the delayed import.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2400
diff changeset
817 logging.debug("Creating Symbols Viewer...")
df3820f08247 Continued implementing the delayed import.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2400
diff changeset
818 from .SymbolsWidget import SymbolsWidget
365
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 357
diff changeset
819 self.symbolsViewer = SymbolsWidget()
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 934
diff changeset
820 self.leftSidebar.addTab(self.symbolsViewer,
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 934
diff changeset
821 UI.PixmapCache.getIcon("symbols.png"),
365
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 357
diff changeset
822 self.trUtf8("Symbols"))
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 357
diff changeset
823
372
237c3fe739f5 Added a numbers viewer to convert numbers into various formats.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 365
diff changeset
824 # Create the numbers viewer
2409
df3820f08247 Continued implementing the delayed import.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2400
diff changeset
825 logging.debug("Creating Numbers Viewer...")
df3820f08247 Continued implementing the delayed import.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2400
diff changeset
826 from .NumbersWidget import NumbersWidget
372
237c3fe739f5 Added a numbers viewer to convert numbers into various formats.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 365
diff changeset
827 self.numbersViewer = NumbersWidget()
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 934
diff changeset
828 self.bottomSidebar.addTab(self.numbersViewer,
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 934
diff changeset
829 UI.PixmapCache.getIcon("numbers.png"),
372
237c3fe739f5 Added a numbers viewer to convert numbers into various formats.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 365
diff changeset
830 self.trUtf8("Numbers"))
237c3fe739f5 Added a numbers viewer to convert numbers into various formats.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 365
diff changeset
831
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
832 self.bottomSidebar.setCurrentIndex(0)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
833
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
834 # create the central widget
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
835 logging.debug("Creating central widget...")
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
836 cw = self.centralWidget() # save the current central widget
2182
fc3210851b07 Changed the layout of the right side widgets and added a sub menu for the switching between the 'inner' windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2155
diff changeset
837 self.leftSplitter = QSplitter(Qt.Horizontal)
fc3210851b07 Changed the layout of the right side widgets and added a sub menu for the switching between the 'inner' windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2155
diff changeset
838 self.rightSplitter = QSplitter(Qt.Horizontal)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
839 self.verticalSplitter = QSplitter(Qt.Vertical)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
840 self.verticalSplitter.addWidget(cw)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
841 self.verticalSplitter.addWidget(self.bottomSidebar)
2182
fc3210851b07 Changed the layout of the right side widgets and added a sub menu for the switching between the 'inner' windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2155
diff changeset
842 self.rightSplitter.addWidget(self.verticalSplitter)
fc3210851b07 Changed the layout of the right side widgets and added a sub menu for the switching between the 'inner' windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2155
diff changeset
843 self.rightSplitter.addWidget(self.rightSidebar)
fc3210851b07 Changed the layout of the right side widgets and added a sub menu for the switching between the 'inner' windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2155
diff changeset
844 self.leftSplitter.addWidget(self.leftSidebar)
fc3210851b07 Changed the layout of the right side widgets and added a sub menu for the switching between the 'inner' windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2155
diff changeset
845 self.leftSplitter.addWidget(self.rightSplitter)
fc3210851b07 Changed the layout of the right side widgets and added a sub menu for the switching between the 'inner' windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2155
diff changeset
846 self.setCentralWidget(self.leftSplitter)
fc3210851b07 Changed the layout of the right side widgets and added a sub menu for the switching between the 'inner' windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2155
diff changeset
847
fc3210851b07 Changed the layout of the right side widgets and added a sub menu for the switching between the 'inner' windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2155
diff changeset
848 self.leftSidebar.setSplitter(self.leftSplitter)
fc3210851b07 Changed the layout of the right side widgets and added a sub menu for the switching between the 'inner' windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2155
diff changeset
849 self.rightSidebar.setSplitter(self.rightSplitter)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
850 self.bottomSidebar.setSplitter(self.verticalSplitter)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
851
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
852 def __configureDockareaCornerUsage(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
853 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
854 Private method to configure the usage of the dockarea corners.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
855 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
856 if Preferences.getUI("TopLeftByLeft"):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
857 self.setCorner(Qt.TopLeftCorner, Qt.LeftDockWidgetArea)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
858 else:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
859 self.setCorner(Qt.TopLeftCorner, Qt.TopDockWidgetArea)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
860 if Preferences.getUI("BottomLeftByLeft"):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
861 self.setCorner(Qt.BottomLeftCorner, Qt.LeftDockWidgetArea)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
862 else:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
863 self.setCorner(Qt.BottomLeftCorner, Qt.BottomDockWidgetArea)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
864 if Preferences.getUI("TopRightByRight"):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
865 self.setCorner(Qt.TopRightCorner, Qt.RightDockWidgetArea)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
866 else:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
867 self.setCorner(Qt.TopRightCorner, Qt.TopDockWidgetArea)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
868 if Preferences.getUI("BottomRightByRight"):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
869 self.setCorner(Qt.BottomRightCorner, Qt.RightDockWidgetArea)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
870 else:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
871 self.setCorner(Qt.BottomRightCorner, Qt.BottomDockWidgetArea)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
872
2137
5a9bdcb8c934 Added the 'addSideWidget()' and 'removeSideWidget()' methods to the UserInterface class to allow plug-in developers to add a plug-in widget to the left or bottom side containers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2114
diff changeset
873 def addSideWidget(self, side, widget, icon, label):
5a9bdcb8c934 Added the 'addSideWidget()' and 'removeSideWidget()' methods to the UserInterface class to allow plug-in developers to add a plug-in widget to the left or bottom side containers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2114
diff changeset
874 """
5a9bdcb8c934 Added the 'addSideWidget()' and 'removeSideWidget()' methods to the UserInterface class to allow plug-in developers to add a plug-in widget to the left or bottom side containers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2114
diff changeset
875 Public method to add a widget to the sides.
5a9bdcb8c934 Added the 'addSideWidget()' and 'removeSideWidget()' methods to the UserInterface class to allow plug-in developers to add a plug-in widget to the left or bottom side containers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2114
diff changeset
876
5a9bdcb8c934 Added the 'addSideWidget()' and 'removeSideWidget()' methods to the UserInterface class to allow plug-in developers to add a plug-in widget to the left or bottom side containers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2114
diff changeset
877 @param side side to add the widget to (UserInterface.LeftSide,
5a9bdcb8c934 Added the 'addSideWidget()' and 'removeSideWidget()' methods to the UserInterface class to allow plug-in developers to add a plug-in widget to the left or bottom side containers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2114
diff changeset
878 UserInterface.BottomSide)
5a9bdcb8c934 Added the 'addSideWidget()' and 'removeSideWidget()' methods to the UserInterface class to allow plug-in developers to add a plug-in widget to the left or bottom side containers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2114
diff changeset
879 @param widget reference to the widget to add (QWidget)
5a9bdcb8c934 Added the 'addSideWidget()' and 'removeSideWidget()' methods to the UserInterface class to allow plug-in developers to add a plug-in widget to the left or bottom side containers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2114
diff changeset
880 @param icon icon to be used (QIcon)
5a9bdcb8c934 Added the 'addSideWidget()' and 'removeSideWidget()' methods to the UserInterface class to allow plug-in developers to add a plug-in widget to the left or bottom side containers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2114
diff changeset
881 @param label label text to be shown (string)
5a9bdcb8c934 Added the 'addSideWidget()' and 'removeSideWidget()' methods to the UserInterface class to allow plug-in developers to add a plug-in widget to the left or bottom side containers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2114
diff changeset
882 """
5a9bdcb8c934 Added the 'addSideWidget()' and 'removeSideWidget()' methods to the UserInterface class to allow plug-in developers to add a plug-in widget to the left or bottom side containers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2114
diff changeset
883 assert side in [UserInterface.LeftSide, UserInterface.BottomSide]
5a9bdcb8c934 Added the 'addSideWidget()' and 'removeSideWidget()' methods to the UserInterface class to allow plug-in developers to add a plug-in widget to the left or bottom side containers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2114
diff changeset
884
5a9bdcb8c934 Added the 'addSideWidget()' and 'removeSideWidget()' methods to the UserInterface class to allow plug-in developers to add a plug-in widget to the left or bottom side containers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2114
diff changeset
885 if self.layout == "Toolboxes":
5a9bdcb8c934 Added the 'addSideWidget()' and 'removeSideWidget()' methods to the UserInterface class to allow plug-in developers to add a plug-in widget to the left or bottom side containers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2114
diff changeset
886 if side == UserInterface.LeftSide:
2182
fc3210851b07 Changed the layout of the right side widgets and added a sub menu for the switching between the 'inner' windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2155
diff changeset
887 self.lToolbox.addItem(widget, icon, label)
2137
5a9bdcb8c934 Added the 'addSideWidget()' and 'removeSideWidget()' methods to the UserInterface class to allow plug-in developers to add a plug-in widget to the left or bottom side containers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2114
diff changeset
888 elif side == UserInterface.BottomSide:
5a9bdcb8c934 Added the 'addSideWidget()' and 'removeSideWidget()' methods to the UserInterface class to allow plug-in developers to add a plug-in widget to the left or bottom side containers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2114
diff changeset
889 self.hToolbox.addItem(widget, icon, label)
2182
fc3210851b07 Changed the layout of the right side widgets and added a sub menu for the switching between the 'inner' windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2155
diff changeset
890 elif side == UserInterface.RightSide:
fc3210851b07 Changed the layout of the right side widgets and added a sub menu for the switching between the 'inner' windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2155
diff changeset
891 self.rToolbox.addItem(widget, icon, label)
2137
5a9bdcb8c934 Added the 'addSideWidget()' and 'removeSideWidget()' methods to the UserInterface class to allow plug-in developers to add a plug-in widget to the left or bottom side containers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2114
diff changeset
892 elif self.layout == "Sidebars":
5a9bdcb8c934 Added the 'addSideWidget()' and 'removeSideWidget()' methods to the UserInterface class to allow plug-in developers to add a plug-in widget to the left or bottom side containers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2114
diff changeset
893 if side == UserInterface.LeftSide:
5a9bdcb8c934 Added the 'addSideWidget()' and 'removeSideWidget()' methods to the UserInterface class to allow plug-in developers to add a plug-in widget to the left or bottom side containers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2114
diff changeset
894 self.leftSidebar.addTab(widget, icon, label)
5a9bdcb8c934 Added the 'addSideWidget()' and 'removeSideWidget()' methods to the UserInterface class to allow plug-in developers to add a plug-in widget to the left or bottom side containers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2114
diff changeset
895 elif side == UserInterface.BottomSide:
5a9bdcb8c934 Added the 'addSideWidget()' and 'removeSideWidget()' methods to the UserInterface class to allow plug-in developers to add a plug-in widget to the left or bottom side containers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2114
diff changeset
896 self.bottomSidebar.addTab(widget, icon, label)
2182
fc3210851b07 Changed the layout of the right side widgets and added a sub menu for the switching between the 'inner' windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2155
diff changeset
897 elif side == UserInterface.RightSide:
fc3210851b07 Changed the layout of the right side widgets and added a sub menu for the switching between the 'inner' windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2155
diff changeset
898 self.rightSidebar.addTab(widget, icon, label)
2137
5a9bdcb8c934 Added the 'addSideWidget()' and 'removeSideWidget()' methods to the UserInterface class to allow plug-in developers to add a plug-in widget to the left or bottom side containers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2114
diff changeset
899
5a9bdcb8c934 Added the 'addSideWidget()' and 'removeSideWidget()' methods to the UserInterface class to allow plug-in developers to add a plug-in widget to the left or bottom side containers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2114
diff changeset
900 def removeSideWidget(self, widget):
5a9bdcb8c934 Added the 'addSideWidget()' and 'removeSideWidget()' methods to the UserInterface class to allow plug-in developers to add a plug-in widget to the left or bottom side containers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2114
diff changeset
901 """
5a9bdcb8c934 Added the 'addSideWidget()' and 'removeSideWidget()' methods to the UserInterface class to allow plug-in developers to add a plug-in widget to the left or bottom side containers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2114
diff changeset
902 Public method to remove a widget added using addSideWidget().
5a9bdcb8c934 Added the 'addSideWidget()' and 'removeSideWidget()' methods to the UserInterface class to allow plug-in developers to add a plug-in widget to the left or bottom side containers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2114
diff changeset
903
5a9bdcb8c934 Added the 'addSideWidget()' and 'removeSideWidget()' methods to the UserInterface class to allow plug-in developers to add a plug-in widget to the left or bottom side containers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2114
diff changeset
904 @param widget reference to the widget to remove (QWidget)
5a9bdcb8c934 Added the 'addSideWidget()' and 'removeSideWidget()' methods to the UserInterface class to allow plug-in developers to add a plug-in widget to the left or bottom side containers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2114
diff changeset
905 """
5a9bdcb8c934 Added the 'addSideWidget()' and 'removeSideWidget()' methods to the UserInterface class to allow plug-in developers to add a plug-in widget to the left or bottom side containers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2114
diff changeset
906 if self.layout == "Toolboxes":
2182
fc3210851b07 Changed the layout of the right side widgets and added a sub menu for the switching between the 'inner' windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2155
diff changeset
907 for container in [self.lToolbox, self.hToolbox, self.rToolbox]:
2137
5a9bdcb8c934 Added the 'addSideWidget()' and 'removeSideWidget()' methods to the UserInterface class to allow plug-in developers to add a plug-in widget to the left or bottom side containers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2114
diff changeset
908 index = container.indexOf(widget)
5a9bdcb8c934 Added the 'addSideWidget()' and 'removeSideWidget()' methods to the UserInterface class to allow plug-in developers to add a plug-in widget to the left or bottom side containers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2114
diff changeset
909 if index != -1:
5a9bdcb8c934 Added the 'addSideWidget()' and 'removeSideWidget()' methods to the UserInterface class to allow plug-in developers to add a plug-in widget to the left or bottom side containers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2114
diff changeset
910 container.removeItem(index)
5a9bdcb8c934 Added the 'addSideWidget()' and 'removeSideWidget()' methods to the UserInterface class to allow plug-in developers to add a plug-in widget to the left or bottom side containers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2114
diff changeset
911 elif self.layout == "Sidebars":
2182
fc3210851b07 Changed the layout of the right side widgets and added a sub menu for the switching between the 'inner' windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2155
diff changeset
912 for container in [self.leftSidebar, self.bottomSidebar, self.rightSidebar]:
2137
5a9bdcb8c934 Added the 'addSideWidget()' and 'removeSideWidget()' methods to the UserInterface class to allow plug-in developers to add a plug-in widget to the left or bottom side containers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2114
diff changeset
913 index = container.indexOf(widget)
5a9bdcb8c934 Added the 'addSideWidget()' and 'removeSideWidget()' methods to the UserInterface class to allow plug-in developers to add a plug-in widget to the left or bottom side containers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2114
diff changeset
914 if index != -1:
5a9bdcb8c934 Added the 'addSideWidget()' and 'removeSideWidget()' methods to the UserInterface class to allow plug-in developers to add a plug-in widget to the left or bottom side containers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2114
diff changeset
915 container.removeTab(index)
5a9bdcb8c934 Added the 'addSideWidget()' and 'removeSideWidget()' methods to the UserInterface class to allow plug-in developers to add a plug-in widget to the left or bottom side containers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2114
diff changeset
916
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
917 def showLogTab(self, tabname):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
918 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
919 Public method to show a particular Log-Viewer tab.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
920
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
921 @param tabname string naming the tab to be shown (string)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
922 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
923 if Preferences.getUI("LogViewerAutoRaise"):
1852
12d37ab1baf3 Removed the user interface layout types "Floating Windows" and "Dock Windows".
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1843
diff changeset
924 if self.layout == "Toolboxes":
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
925 self.hToolboxDock.show()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
926 self.hToolbox.setCurrentWidget(self.logViewer)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
927 self.hToolboxDock.raise_()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
928 elif self.layout == "Sidebars":
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
929 self.bottomSidebar.show()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
930 self.bottomSidebar.setCurrentWidget(self.logViewer)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
931 self.bottomSidebar.raise_()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
932 if self.bottomSidebar.isAutoHiding():
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
933 self.bottomSidebar.setFocus()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
934
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 934
diff changeset
935 def __openOnStartup(self, startupType=None):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
936 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
937 Private method to open the last file, project or multiproject.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
938
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
939 @param startupType type of startup requested (string, one of
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
940 "Nothing", "File", "Project", "MultiProject" or "Session")
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
941 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
942 startupTypeMapping = {
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 934
diff changeset
943 "Nothing": 0,
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 934
diff changeset
944 "File": 1,
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 934
diff changeset
945 "Project": 2,
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 934
diff changeset
946 "MultiProject": 3,
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 934
diff changeset
947 "Session": 4,
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
948 }
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
949
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
950 if startupType is None:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
951 startup = Preferences.getUI("OpenOnStartup")
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
952 else:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
953 try:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
954 startup = startupTypeMapping[startupType]
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
955 except KeyError:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
956 startup = Preferences.getUI("OpenOnStartup")
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
957
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
958 if startup == 0:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
959 # open nothing
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
960 pass
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
961 elif startup == 1:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
962 # open last file
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
963 recent = self.viewmanager.getMostRecent()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
964 if recent is not None:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
965 self.viewmanager.openFiles(recent)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
966 elif startup == 2:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
967 # open last project
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
968 recent = self.project.getMostRecent()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
969 if recent is not None:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
970 self.project.openProject(recent)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
971 elif startup == 3:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
972 # open last multiproject
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
973 recent = self.multiProject.getMostRecent()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
974 if recent is not None:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
975 self.multiProject.openMultiProject(recent)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
976 elif startup == 4:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
977 # open from session file
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
978 self.__readSession()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
979
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
980 def processArgs(self, args):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
981 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
982 Public method to process the command line args passed to the UI.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
983
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
984 @param args list of files to open<br />
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
985 The args are processed one at a time. All arguments after a
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 934
diff changeset
986 '--' option are considered debug arguments to the program
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
987 for the debugger. All files named before the '--' option
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 934
diff changeset
988 are opened in a text editor, unless the argument ends in
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 934
diff changeset
989 .e4p, then it is opened as a project file. If it ends in
608
d8fea1e76975 Removed capability to write compressed project (and related) files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 599
diff changeset
990 .e4m, it is opened as a multiproject.
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
991 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
992 # no args, return
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
993 if args is None:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
994 if not self.__noOpenAtStartup:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
995 self.__openOnStartup()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
996 return
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
997
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
998 opens = 0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
999
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1000 # holds space delimited list of command args, if any
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1001 argsStr = None
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1002 # flag indicating '--' options was found
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1003 ddseen = False
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1004
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1005 if Utilities.isWindowsPlatform():
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1006 argChars = ['-', '/']
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1007 else:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1008 argChars = ['-']
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1009
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1010 for arg in args:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1011 # handle a request to start with last session
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1012 if arg == '--start-session':
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1013 self.__openOnStartup("Session")
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1014 # ignore all further arguments
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1015 return
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1016
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1017 if arg == '--' and not ddseen:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1018 ddseen = True
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1019 continue
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1020
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1021 if arg[0] in argChars or ddseen:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1022 if argsStr is None:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1023 argsStr = arg
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1024 else:
432
497e188ee86e Did some more string format conversions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 381
diff changeset
1025 argsStr = "{0} {1}".format(argsStr, arg)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1026 continue
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1027
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1028 ext = os.path.splitext(arg)[1]
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1029 ext = os.path.normcase(ext)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1030
608
d8fea1e76975 Removed capability to write compressed project (and related) files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 599
diff changeset
1031 if ext in ['.e4p']:
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1032 self.project.openProject(arg)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1033 opens += 1
608
d8fea1e76975 Removed capability to write compressed project (and related) files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 599
diff changeset
1034 elif ext in ['.e4m']:
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1035 self.multiProject.openMultiProject(arg)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1036 opens += 1
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1037 else:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1038 self.viewmanager.openFiles(arg)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1039 opens += 1
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1040
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1041 # store away any args we had
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1042 if argsStr is not None:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1043 self.debuggerUI.setArgvHistory(argsStr)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1044
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1045 if opens == 0:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1046 # no files, project or multiproject was given
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1047 if not self.__noOpenAtStartup:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1048 self.__openOnStartup()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1049
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1050 def __createDockWindow(self, name):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1051 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1052 Private method to create a dock window with common properties.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1053
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1054 @param name object name of the new dock window (string)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1055 @return the generated dock window (QDockWindow)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1056 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1057 dock = QDockWidget()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1058 dock.setObjectName(name)
564
b3d966393ba9 Did some code cleanup.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 553
diff changeset
1059 dock.setFeatures(
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1060 QDockWidget.DockWidgetFeatures(QDockWidget.AllDockWidgetFeatures))
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1061 return dock
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1062
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1063 def __setupDockWindow(self, dock, where, widget, caption):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1064 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1065 Private method to configure the dock window created with __createDockWindow().
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1066
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1067 @param dock the dock window (QDockWindow)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1068 @param where dock area to be docked to (Qt.DockWidgetArea)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1069 @param widget widget to be shown in the dock window (QWidget)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1070 @param caption caption of the dock window (string)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1071 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1072 if caption is None:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1073 caption = ""
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1074 self.addDockWidget(where, dock)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1075 dock.setWidget(widget)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1076 dock.setWindowTitle(caption)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1077 dock.show()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1078
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 934
diff changeset
1079 def __setWindowCaption(self, editor=None, project=None):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1080 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1081 Private method to set the caption of the Main Window.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1082
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1083 @param editor filename to be displayed (string)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1084 @param project project name to be displayed (string)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1085 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1086 if editor is not None and self.captionShowsFilename:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offe