eric6/Project/ProjectBrowser.py

Wed, 30 Dec 2020 11:00:44 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Wed, 30 Dec 2020 11:00:44 +0100
branch
maintenance
changeset 7924
8a96736d465e
parent 7780
41420f82c0ac
child 7960
e8fc383322f7
permissions
-rw-r--r--

Updated copyright for 2021.

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
7924
8a96736d465e Updated copyright for 2021.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7780
diff changeset
3 # Copyright (c) 2002 - 2021 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 """
3670
f0cb7579c0b4 Finished renaming eric5 for PyQt5 to eric6.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3656
diff changeset
7 Module implementing the project browser part of the eric6 UI.
0
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
3656
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3600
diff changeset
10 from PyQt5.QtCore import Qt
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3600
diff changeset
11 from PyQt5.QtGui import QColor
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3600
diff changeset
12 from PyQt5.QtWidgets import QApplication
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
13
55
b5c84934de9c Renamed E4Gui to E5Gui.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 15
diff changeset
14 from E5Gui.E5TabWidget import E5TabWidget
3369
6580dc0fe205 Added click functions to the project browser VCS status LED.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3190
diff changeset
15 from E5Gui.E5Led import E5ClickableLed
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
16
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
17 import UI.PixmapCache
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
18 import Preferences
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
19
7265
0665c4d509c9 Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
20 from .ProjectBrowserFlags import (
0665c4d509c9 Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
21 SourcesBrowserFlag, FormsBrowserFlag, ResourcesBrowserFlag,
0665c4d509c9 Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
22 TranslationsBrowserFlag, InterfacesBrowserFlag, OthersBrowserFlag,
0665c4d509c9 Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
23 ProtocolsBrowserFlag, AllBrowsersFlag
0665c4d509c9 Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
24 )
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
25
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
26
55
b5c84934de9c Renamed E4Gui to E5Gui.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 15
diff changeset
27 class ProjectBrowser(E5TabWidget):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
28 """
3670
f0cb7579c0b4 Finished renaming eric5 for PyQt5 to eric6.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3656
diff changeset
29 Class implementing the project browser part of the eric6 UI.
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
30
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
31 It generates a widget with up to seven tabs. The individual tabs contain
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
32 the project sources browser, the project forms browser,
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
33 the project resources browser, the project translations browser,
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
34 the project interfaces (IDL) browser and a browser for stuff,
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
35 that doesn't fit these categories. Optionally it contains an additional
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
36 tab with the file system browser.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
37 """
6416
a915f8dd1ca6 File-Browser, Shell: changed code so file-browser and shell are always a standalone windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6285
diff changeset
38 def __init__(self, project, parent=None):
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 Constructor
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
41
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
42 @param project reference to the project object
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
43 @param parent parent widget (QWidget)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
44 """
55
b5c84934de9c Renamed E4Gui to E5Gui.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 15
diff changeset
45 E5TabWidget.__init__(self, parent)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
46 self.project = project
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
47
7533
88261c96484b Removed the '.png' extension from all call to get an icon or a pixmap from the PixmapCache because this is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
48 self.setWindowIcon(UI.PixmapCache.getIcon("eric"))
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
49
1422
47f1dffa398e Fixed the tab bar issue observed for some styles (like Mac Aqua).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1112
diff changeset
50 self.setUsesScrollButtons(True)
47f1dffa398e Fixed the tab bar issue observed for some styles (like Mac Aqua).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1112
diff changeset
51
3369
6580dc0fe205 Added click functions to the project browser VCS status LED.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3190
diff changeset
52 self.vcsStatusIndicator = E5ClickableLed(self)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
53 self.setCornerWidget(self.vcsStatusIndicator, Qt.TopLeftCorner)
3369
6580dc0fe205 Added click functions to the project browser VCS status LED.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3190
diff changeset
54 self.vcsStatusIndicator.clicked.connect(
6580dc0fe205 Added click functions to the project browser VCS status LED.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3190
diff changeset
55 self.__vcsStatusIndicatorClicked)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
56 self.vcsStatusColorNames = {
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
57 "A": "VcsAdded",
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
58 "M": "VcsModified",
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
59 "O": "VcsRemoved",
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
60 "R": "VcsReplaced",
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
61 "U": "VcsUpdate",
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
62 "Z": "VcsConflict",
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
63 }
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
64 self.vcsStatusText = {
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
65 " ": self.tr("up to date"),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
66 "A": self.tr("files added"),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
67 "M": self.tr("local modifications"),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
68 "O": self.tr("files removed"),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
69 "R": self.tr("files replaced"),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
70 "U": self.tr("update required"),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
71 "Z": self.tr("conflict"),
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
72 }
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
73 self.__vcsStateChanged(" ")
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
74
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
75 # step 1: create all the individual browsers
2408
dc3a7c9d8f6e Continued implementing the delayed import.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2302
diff changeset
76 from .ProjectSourcesBrowser import ProjectSourcesBrowser
dc3a7c9d8f6e Continued implementing the delayed import.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2302
diff changeset
77 from .ProjectFormsBrowser import ProjectFormsBrowser
dc3a7c9d8f6e Continued implementing the delayed import.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2302
diff changeset
78 from .ProjectTranslationsBrowser import ProjectTranslationsBrowser
dc3a7c9d8f6e Continued implementing the delayed import.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2302
diff changeset
79 from .ProjectResourcesBrowser import ProjectResourcesBrowser
dc3a7c9d8f6e Continued implementing the delayed import.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2302
diff changeset
80 from .ProjectInterfacesBrowser import ProjectInterfacesBrowser
dc3a7c9d8f6e Continued implementing the delayed import.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2302
diff changeset
81 from .ProjectOthersBrowser import ProjectOthersBrowser
5968
c5112b5cb7a9 Started to add support for Google protobuf protocol files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
82 from .ProjectProtocolsBrowser import ProjectProtocolsBrowser
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
83 # sources browser
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
84 self.psBrowser = ProjectSourcesBrowser(self.project)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
85 # forms browser
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
86 self.pfBrowser = ProjectFormsBrowser(self.project)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
87 # resources browser
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
88 self.prBrowser = ProjectResourcesBrowser(self.project)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
89 # translations browser
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
90 self.ptBrowser = ProjectTranslationsBrowser(self.project)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
91 # interfaces (IDL) browser
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
92 self.piBrowser = ProjectInterfacesBrowser(self.project)
5968
c5112b5cb7a9 Started to add support for Google protobuf protocol files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
93 # protocols (protobuf) browser
c5112b5cb7a9 Started to add support for Google protobuf protocol files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
94 self.ppBrowser = ProjectProtocolsBrowser(self.project)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
95 # others browser
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
96 self.poBrowser = ProjectOthersBrowser(self.project)
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 # step 2: connect all the browsers
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
99 # connect the sources browser
486
e4711a55e482 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 216
diff changeset
100 self.project.projectClosed.connect(self.psBrowser._projectClosed)
e4711a55e482 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 216
diff changeset
101 self.project.projectOpened.connect(self.psBrowser._projectOpened)
e4711a55e482 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 216
diff changeset
102 self.project.newProject.connect(self.psBrowser._newProject)
500
c3abc7895a01 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 486
diff changeset
103 self.project.reinitVCS.connect(self.psBrowser._initMenusAndVcs)
3522
260420562809 Added code to reinitialize the project browser context menus upon a change of the project properties.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3448
diff changeset
104 self.project.projectPropertiesChanged.connect(
260420562809 Added code to reinitialize the project browser context menus upon a change of the project properties.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3448
diff changeset
105 self.psBrowser._initMenusAndVcs)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
106
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
107 # connect the forms browser
486
e4711a55e482 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 216
diff changeset
108 self.project.projectClosed.connect(self.pfBrowser._projectClosed)
e4711a55e482 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 216
diff changeset
109 self.project.projectOpened.connect(self.pfBrowser._projectOpened)
e4711a55e482 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 216
diff changeset
110 self.project.newProject.connect(self.pfBrowser._newProject)
500
c3abc7895a01 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 486
diff changeset
111 self.project.reinitVCS.connect(self.pfBrowser._initMenusAndVcs)
3522
260420562809 Added code to reinitialize the project browser context menus upon a change of the project properties.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3448
diff changeset
112 self.project.projectPropertiesChanged.connect(
260420562809 Added code to reinitialize the project browser context menus upon a change of the project properties.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3448
diff changeset
113 self.pfBrowser._initMenusAndVcs)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
114
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
115 # connect the resources browser
486
e4711a55e482 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 216
diff changeset
116 self.project.projectClosed.connect(self.prBrowser._projectClosed)
e4711a55e482 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 216
diff changeset
117 self.project.projectOpened.connect(self.prBrowser._projectOpened)
e4711a55e482 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 216
diff changeset
118 self.project.newProject.connect(self.prBrowser._newProject)
500
c3abc7895a01 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 486
diff changeset
119 self.project.reinitVCS.connect(self.prBrowser._initMenusAndVcs)
3522
260420562809 Added code to reinitialize the project browser context menus upon a change of the project properties.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3448
diff changeset
120 self.project.projectPropertiesChanged.connect(
260420562809 Added code to reinitialize the project browser context menus upon a change of the project properties.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3448
diff changeset
121 self.prBrowser._initMenusAndVcs)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
122
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
123 # connect the translations browser
486
e4711a55e482 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 216
diff changeset
124 self.project.projectClosed.connect(self.ptBrowser._projectClosed)
e4711a55e482 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 216
diff changeset
125 self.project.projectOpened.connect(self.ptBrowser._projectOpened)
e4711a55e482 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 216
diff changeset
126 self.project.newProject.connect(self.ptBrowser._newProject)
500
c3abc7895a01 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 486
diff changeset
127 self.project.reinitVCS.connect(self.ptBrowser._initMenusAndVcs)
3522
260420562809 Added code to reinitialize the project browser context menus upon a change of the project properties.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3448
diff changeset
128 self.project.projectPropertiesChanged.connect(
260420562809 Added code to reinitialize the project browser context menus upon a change of the project properties.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3448
diff changeset
129 self.ptBrowser._initMenusAndVcs)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
130
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
131 # connect the interfaces (IDL) browser
486
e4711a55e482 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 216
diff changeset
132 self.project.projectClosed.connect(self.piBrowser._projectClosed)
e4711a55e482 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 216
diff changeset
133 self.project.projectOpened.connect(self.piBrowser._projectOpened)
e4711a55e482 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 216
diff changeset
134 self.project.newProject.connect(self.piBrowser._newProject)
500
c3abc7895a01 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 486
diff changeset
135 self.project.reinitVCS.connect(self.piBrowser._initMenusAndVcs)
3522
260420562809 Added code to reinitialize the project browser context menus upon a change of the project properties.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3448
diff changeset
136 self.project.projectPropertiesChanged.connect(
260420562809 Added code to reinitialize the project browser context menus upon a change of the project properties.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3448
diff changeset
137 self.piBrowser._initMenusAndVcs)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
138
5968
c5112b5cb7a9 Started to add support for Google protobuf protocol files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
139 # connect the protocols (protobuf) browser
c5112b5cb7a9 Started to add support for Google protobuf protocol files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
140 self.project.projectClosed.connect(self.ppBrowser._projectClosed)
c5112b5cb7a9 Started to add support for Google protobuf protocol files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
141 self.project.projectOpened.connect(self.ppBrowser._projectOpened)
c5112b5cb7a9 Started to add support for Google protobuf protocol files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
142 self.project.newProject.connect(self.ppBrowser._newProject)
c5112b5cb7a9 Started to add support for Google protobuf protocol files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
143 self.project.reinitVCS.connect(self.ppBrowser._initMenusAndVcs)
c5112b5cb7a9 Started to add support for Google protobuf protocol files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
144 self.project.projectPropertiesChanged.connect(
c5112b5cb7a9 Started to add support for Google protobuf protocol files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
145 self.ppBrowser._initMenusAndVcs)
c5112b5cb7a9 Started to add support for Google protobuf protocol files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
146
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
147 # connect the others browser
486
e4711a55e482 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 216
diff changeset
148 self.project.projectClosed.connect(self.poBrowser._projectClosed)
e4711a55e482 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 216
diff changeset
149 self.project.projectOpened.connect(self.poBrowser._projectOpened)
e4711a55e482 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 216
diff changeset
150 self.project.newProject.connect(self.poBrowser._newProject)
500
c3abc7895a01 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 486
diff changeset
151 self.project.reinitVCS.connect(self.poBrowser._initMenusAndVcs)
3522
260420562809 Added code to reinitialize the project browser context menus upon a change of the project properties.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3448
diff changeset
152 self.project.projectPropertiesChanged.connect(
260420562809 Added code to reinitialize the project browser context menus upon a change of the project properties.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3448
diff changeset
153 self.poBrowser._initMenusAndVcs)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
154
6285
045dc4c38701 Corrected a typo in several files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
155 # add signal connection to ourselves
486
e4711a55e482 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 216
diff changeset
156 self.project.projectOpened.connect(self.__projectOpened)
e4711a55e482 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 216
diff changeset
157 self.project.projectClosed.connect(self.__projectClosed)
e4711a55e482 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 216
diff changeset
158 self.project.newProject.connect(self.__newProject)
2995
63d874899b8b Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2965
diff changeset
159 self.project.projectPropertiesChanged.connect(
63d874899b8b Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2965
diff changeset
160 self.__projectPropertiesChanged)
500
c3abc7895a01 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 486
diff changeset
161 self.currentChanged.connect(self.__currentChanged)
c3abc7895a01 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 486
diff changeset
162 self.project.getModel().vcsStateChanged.connect(self.__vcsStateChanged)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
163
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
164 self.__currentBrowsersFlags = 0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
165 self.__projectPropertiesChanged()
6416
a915f8dd1ca6 File-Browser, Shell: changed code so file-browser and shell are always a standalone windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6285
diff changeset
166 self.setCurrentIndex(0)
0
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 def __setBrowsersAvailable(self, browserFlags):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
169 """
2965
d133c7edd88a Continued correcting doc strings by using the new doc string checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2769
diff changeset
170 Private method to add selected browsers to the project browser.
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
171
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
172 @param browserFlags flags indicating the browsers to add (integer)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
173 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
174 # step 1: remove all tabs
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
175 while self.count() > 0:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
176 self.removeTab(0)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
177
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
178 # step 2: add browsers
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
179 if browserFlags & SourcesBrowserFlag:
3030
4a0a82ddd9d2 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2995
diff changeset
180 index = self.addTab(
4a0a82ddd9d2 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2995
diff changeset
181 self.psBrowser,
7533
88261c96484b Removed the '.png' extension from all call to get an icon or a pixmap from the PixmapCache because this is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
182 UI.PixmapCache.getIcon("projectSources"), '')
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
183 self.setTabToolTip(index, self.psBrowser.windowTitle())
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 if browserFlags & FormsBrowserFlag:
3030
4a0a82ddd9d2 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2995
diff changeset
186 index = self.addTab(
4a0a82ddd9d2 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2995
diff changeset
187 self.pfBrowser,
7533
88261c96484b Removed the '.png' extension from all call to get an icon or a pixmap from the PixmapCache because this is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
188 UI.PixmapCache.getIcon("projectForms"), '')
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
189 self.setTabToolTip(index, self.pfBrowser.windowTitle())
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
190
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
191 if browserFlags & ResourcesBrowserFlag:
3030
4a0a82ddd9d2 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2995
diff changeset
192 index = self.addTab(
4a0a82ddd9d2 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2995
diff changeset
193 self.prBrowser,
7533
88261c96484b Removed the '.png' extension from all call to get an icon or a pixmap from the PixmapCache because this is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
194 UI.PixmapCache.getIcon("projectResources"), '')
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
195 self.setTabToolTip(index, self.prBrowser.windowTitle())
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
196
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
197 if browserFlags & TranslationsBrowserFlag:
3030
4a0a82ddd9d2 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2995
diff changeset
198 index = self.addTab(
4a0a82ddd9d2 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2995
diff changeset
199 self.ptBrowser,
7533
88261c96484b Removed the '.png' extension from all call to get an icon or a pixmap from the PixmapCache because this is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
200 UI.PixmapCache.getIcon("projectTranslations"), '')
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
201 self.setTabToolTip(index, self.ptBrowser.windowTitle())
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 if browserFlags & InterfacesBrowserFlag:
3030
4a0a82ddd9d2 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2995
diff changeset
204 index = self.addTab(
4a0a82ddd9d2 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2995
diff changeset
205 self.piBrowser,
7533
88261c96484b Removed the '.png' extension from all call to get an icon or a pixmap from the PixmapCache because this is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
206 UI.PixmapCache.getIcon("projectInterfaces"), '')
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
207 self.setTabToolTip(index, self.piBrowser.windowTitle())
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
208
5968
c5112b5cb7a9 Started to add support for Google protobuf protocol files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
209 if browserFlags & ProtocolsBrowserFlag:
c5112b5cb7a9 Started to add support for Google protobuf protocol files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
210 index = self.addTab(
c5112b5cb7a9 Started to add support for Google protobuf protocol files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
211 self.ppBrowser,
7533
88261c96484b Removed the '.png' extension from all call to get an icon or a pixmap from the PixmapCache because this is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
212 UI.PixmapCache.getIcon("protobuf"), '')
5968
c5112b5cb7a9 Started to add support for Google protobuf protocol files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
213 self.setTabToolTip(index, self.ppBrowser.windowTitle())
c5112b5cb7a9 Started to add support for Google protobuf protocol files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
214
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
215 if browserFlags & OthersBrowserFlag:
3030
4a0a82ddd9d2 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2995
diff changeset
216 index = self.addTab(
4a0a82ddd9d2 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2995
diff changeset
217 self.poBrowser,
7533
88261c96484b Removed the '.png' extension from all call to get an icon or a pixmap from the PixmapCache because this is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
218 UI.PixmapCache.getIcon("projectOthers"), '')
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
219 self.setTabToolTip(index, self.poBrowser.windowTitle())
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
220
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
221 QApplication.processEvents()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
222
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
223 def __currentChanged(self, index):
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 Private slot to handle the currentChanged(int) signal.
2965
d133c7edd88a Continued correcting doc strings by using the new doc string checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2769
diff changeset
226
d133c7edd88a Continued correcting doc strings by using the new doc string checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2769
diff changeset
227 @param index index of the tab (integer)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
228 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
229 if index > -1:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
230 browser = self.widget(index)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
231 if browser is not None:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
232 browser.layoutDisplay()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
233
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
234 def __projectOpened(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
235 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
236 Private slot to handle the projectOpened signal.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
237 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
238 self.__projectPropertiesChanged()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
239 self.setCurrentIndex(0)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
240 self.__vcsStateChanged(" ")
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
241
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
242 def __projectClosed(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
243 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
244 Private slot to handle the projectClosed signal.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
245 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
246 self.__projectPropertiesChanged()
6416
a915f8dd1ca6 File-Browser, Shell: changed code so file-browser and shell are always a standalone windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6285
diff changeset
247 self.setCurrentIndex(0)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
248 self.__setSourcesIcon()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
249 self.__vcsStateChanged(" ")
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
250
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
251 def __newProject(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
252 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
253 Private slot to handle the newProject signal.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
254 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
255 self.setCurrentIndex(0)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
256 self.__projectPropertiesChanged()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
257
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
258 def __projectPropertiesChanged(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
259 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
260 Private slot to handle the projectPropertiesChanged signal.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
261 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
262 if self.project.isOpen():
2995
63d874899b8b Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2965
diff changeset
263 flags = Preferences.getProjectBrowserFlags(
63d874899b8b Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2965
diff changeset
264 self.project.getProjectType())
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
265 else:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
266 flags = AllBrowsersFlag
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
267
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
268 if flags != self.__currentBrowsersFlags:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
269 self.__currentBrowsersFlags = flags
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
270 self.__setBrowsersAvailable(flags)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
271
6416
a915f8dd1ca6 File-Browser, Shell: changed code so file-browser and shell are always a standalone windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6285
diff changeset
272 endIndex = self.count()
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
273 for index in range(endIndex):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
274 self.setTabEnabled(index, self.project.isOpen())
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
275
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
276 self.__setSourcesIcon()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
277
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
278 def __setSourcesIcon(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
279 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
280 Private method to set the right icon for the sources browser tab.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
281 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
282 if not self.project.isOpen():
7533
88261c96484b Removed the '.png' extension from all call to get an icon or a pixmap from the PixmapCache because this is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
283 icon = UI.PixmapCache.getIcon("projectSources")
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
284 else:
7635
0cdead130a81 Removed support for Python2 and removed support for Qt4 (PyQt4 and pyside).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7533
diff changeset
285 if self.project.getProjectLanguage() == "Python3":
5100
2c193da9b94f Finished cleaning up some code related to the Project class and data structures.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
286 if self.project.isMixedLanguageProject():
7533
88261c96484b Removed the '.png' extension from all call to get an icon or a pixmap from the PixmapCache because this is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
287 icon = UI.PixmapCache.getIcon("projectSourcesPyMixed")
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
288 else:
7533
88261c96484b Removed the '.png' extension from all call to get an icon or a pixmap from the PixmapCache because this is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
289 icon = UI.PixmapCache.getIcon("projectSourcesPy")
7178
43e994af5ee0 MicroPython: added more MicroPython type related handling.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6942
diff changeset
290 elif self.project.getProjectLanguage() == "MicroPython":
43e994af5ee0 MicroPython: added more MicroPython type related handling.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6942
diff changeset
291 icon = UI.PixmapCache.getIcon("micropython")
5100
2c193da9b94f Finished cleaning up some code related to the Project class and data structures.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
292 elif self.project.getProjectLanguage() == "Ruby":
2c193da9b94f Finished cleaning up some code related to the Project class and data structures.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
293 if self.project.isMixedLanguageProject():
7533
88261c96484b Removed the '.png' extension from all call to get an icon or a pixmap from the PixmapCache because this is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
294 icon = UI.PixmapCache.getIcon("projectSourcesRbMixed")
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
295 else:
7533
88261c96484b Removed the '.png' extension from all call to get an icon or a pixmap from the PixmapCache because this is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
296 icon = UI.PixmapCache.getIcon("projectSourcesRb")
5100
2c193da9b94f Finished cleaning up some code related to the Project class and data structures.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
297 elif self.project.getProjectLanguage() == "JavaScript":
7533
88261c96484b Removed the '.png' extension from all call to get an icon or a pixmap from the PixmapCache because this is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
298 icon = UI.PixmapCache.getIcon("projectSourcesJavaScript")
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
299 else:
7533
88261c96484b Removed the '.png' extension from all call to get an icon or a pixmap from the PixmapCache because this is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
300 icon = UI.PixmapCache.getIcon("projectSources")
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
301 self.setTabIcon(self.indexOf(self.psBrowser), icon)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
302
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
303 def handleEditorChanged(self, fn):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
304 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
305 Public slot to handle the editorChanged signal.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
306
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
307 @param fn filename of the changed file (string)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
308 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
309 if Preferences.getProject("FollowEditor"):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
310 if self.project.isProjectSource(fn):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
311 self.psBrowser.selectFile(fn)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
312 elif self.project.isProjectForm(fn):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
313 self.pfBrowser.selectFile(fn)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
314 elif self.project.isProjectInterface(fn):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
315 self.piBrowser.selectFile(fn)
5969
584c21b6587a Continued to add support for Google protobuf protocol files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5968
diff changeset
316 elif self.project.isProjectProtocol(fn):
584c21b6587a Continued to add support for Google protobuf protocol files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5968
diff changeset
317 self.ppBrowser.selectFile(fn)
5988
3cd2d5b75cdb Fixed some methods in the project browser to also cope with the new protocol browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5969
diff changeset
318 elif self.project.isProjectProtocol(fn):
3cd2d5b75cdb Fixed some methods in the project browser to also cope with the new protocol browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5969
diff changeset
319 self.ppBrowser.selectFile(fn)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
320
2769
8cbebde7a984 Added support to highlight the current class/method name of the current editor to the project sources viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2408
diff changeset
321 def handleEditorLineChanged(self, fn, lineno):
8cbebde7a984 Added support to highlight the current class/method name of the current editor to the project sources viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2408
diff changeset
322 """
8cbebde7a984 Added support to highlight the current class/method name of the current editor to the project sources viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2408
diff changeset
323 Public slot to handle the editorLineChanged signal.
8cbebde7a984 Added support to highlight the current class/method name of the current editor to the project sources viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2408
diff changeset
324
8cbebde7a984 Added support to highlight the current class/method name of the current editor to the project sources viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2408
diff changeset
325 @param fn filename of the changed file (string)
8cbebde7a984 Added support to highlight the current class/method name of the current editor to the project sources viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2408
diff changeset
326 @param lineno one based line number of the item (integer)
8cbebde7a984 Added support to highlight the current class/method name of the current editor to the project sources viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2408
diff changeset
327 """
7265
0665c4d509c9 Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
328 if (
0665c4d509c9 Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
329 Preferences.getProject("FollowEditor") and
0665c4d509c9 Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
330 Preferences.getProject("FollowCursorLine")
0665c4d509c9 Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
331 ):
2769
8cbebde7a984 Added support to highlight the current class/method name of the current editor to the project sources viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2408
diff changeset
332 if self.project.isProjectSource(fn):
8cbebde7a984 Added support to highlight the current class/method name of the current editor to the project sources viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2408
diff changeset
333 self.psBrowser.selectFileLine(fn, lineno)
8cbebde7a984 Added support to highlight the current class/method name of the current editor to the project sources viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2408
diff changeset
334
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
335 def getProjectBrowsers(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
336 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
337 Public method to get references to the individual project browsers.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
338
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
339 @return list of references to project browsers
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
340 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
341 return [self.psBrowser, self.pfBrowser, self.prBrowser,
5988
3cd2d5b75cdb Fixed some methods in the project browser to also cope with the new protocol browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5969
diff changeset
342 self.ptBrowser, self.piBrowser, self.ppBrowser,
3cd2d5b75cdb Fixed some methods in the project browser to also cope with the new protocol browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5969
diff changeset
343 self.poBrowser]
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
344
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
345 def getProjectBrowser(self, name):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
346 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
347 Public method to get a reference to the named project browser.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
348
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
349 @param name name of the requested project browser (string).
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
350 Valid names are "sources, forms, resources, translations,
5988
3cd2d5b75cdb Fixed some methods in the project browser to also cope with the new protocol browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5969
diff changeset
351 interfaces, protocols, others".
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
352 @return reference to the requested browser or None
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
353 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
354 if name == "sources":
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
355 return self.psBrowser
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
356 elif name == "forms":
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
357 return self.pfBrowser
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
358 elif name == "resources":
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
359 return self.prBrowser
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
360 elif name == "translations":
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
361 return self.ptBrowser
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
362 elif name == "interfaces":
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
363 return self.piBrowser
5988
3cd2d5b75cdb Fixed some methods in the project browser to also cope with the new protocol browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5969
diff changeset
364 elif name == "protocols":
3cd2d5b75cdb Fixed some methods in the project browser to also cope with the new protocol browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5969
diff changeset
365 return self.ppBrowser
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
366 elif name == "others":
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
367 return self.poBrowser
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
368 else:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
369 return None
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
370
3600
7d17c492ab95 Started implementing functionality to save expanded file and directory entries of the project browsers to the session.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3532
diff changeset
371 def getProjectBrowserNames(self):
7d17c492ab95 Started implementing functionality to save expanded file and directory entries of the project browsers to the session.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3532
diff changeset
372 """
7d17c492ab95 Started implementing functionality to save expanded file and directory entries of the project browsers to the session.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3532
diff changeset
373 Public method to get the names of the various project browsers.
7d17c492ab95 Started implementing functionality to save expanded file and directory entries of the project browsers to the session.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3532
diff changeset
374
7d17c492ab95 Started implementing functionality to save expanded file and directory entries of the project browsers to the session.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3532
diff changeset
375 @return list of project browser names (list of string)
7d17c492ab95 Started implementing functionality to save expanded file and directory entries of the project browsers to the session.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3532
diff changeset
376 """
7d17c492ab95 Started implementing functionality to save expanded file and directory entries of the project browsers to the session.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3532
diff changeset
377 return ["sources", "forms", "resources",
5988
3cd2d5b75cdb Fixed some methods in the project browser to also cope with the new protocol browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5969
diff changeset
378 "translations", "interfaces", "protocols", "others"]
3600
7d17c492ab95 Started implementing functionality to save expanded file and directory entries of the project browsers to the session.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3532
diff changeset
379
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
380 def handlePreferencesChanged(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
381 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
382 Public slot used to handle the preferencesChanged signal.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
383 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
384 self.__projectPropertiesChanged()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
385 self.__vcsStateChanged(self.currentVcsStatus)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
386
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
387 def __vcsStateChanged(self, state):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
388 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
389 Private slot to handle a change in the vcs state.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
390
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
391 @param state new vcs state (string)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
392 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
393 self.currentVcsStatus = state
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
394 if state == " " or state not in self.vcsStatusColorNames:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
395 self.vcsStatusIndicator.setColor(QColor(Qt.lightGray))
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
396 else:
564
b3d966393ba9 Did some code cleanup.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 500
diff changeset
397 self.vcsStatusIndicator.setColor(
2995
63d874899b8b Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2965
diff changeset
398 Preferences.getProjectBrowserColour(
63d874899b8b Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2965
diff changeset
399 self.vcsStatusColorNames[state]))
1627
f3280c6a04ba Fixed an issue that can cause a crash in the project browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
400 if state not in self.vcsStatusText:
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
401 self.vcsStatusIndicator.setToolTip(self.tr("unknown status"))
1627
f3280c6a04ba Fixed an issue that can cause a crash in the project browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
402 else:
f3280c6a04ba Fixed an issue that can cause a crash in the project browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
403 self.vcsStatusIndicator.setToolTip(self.vcsStatusText[state])
3369
6580dc0fe205 Added click functions to the project browser VCS status LED.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3190
diff changeset
404
6580dc0fe205 Added click functions to the project browser VCS status LED.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3190
diff changeset
405 def __vcsStatusIndicatorClicked(self, pos):
6580dc0fe205 Added click functions to the project browser VCS status LED.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3190
diff changeset
406 """
6580dc0fe205 Added click functions to the project browser VCS status LED.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3190
diff changeset
407 Private slot to react upon clicks on the VCS indicator LED.
6580dc0fe205 Added click functions to the project browser VCS status LED.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3190
diff changeset
408
6580dc0fe205 Added click functions to the project browser VCS status LED.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3190
diff changeset
409 @param pos position of the click (QPoint)
6580dc0fe205 Added click functions to the project browser VCS status LED.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3190
diff changeset
410 """
6580dc0fe205 Added click functions to the project browser VCS status LED.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3190
diff changeset
411 vcs = self.project.getVcs()
6580dc0fe205 Added click functions to the project browser VCS status LED.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3190
diff changeset
412 if vcs:
6580dc0fe205 Added click functions to the project browser VCS status LED.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3190
diff changeset
413 if self.currentVcsStatus == " ":
6580dc0fe205 Added click functions to the project browser VCS status LED.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3190
diff changeset
414 # call log browser dialog
6580dc0fe205 Added click functions to the project browser VCS status LED.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3190
diff changeset
415 vcs.vcsLogBrowser(self.project.getProjectPath())
6580dc0fe205 Added click functions to the project browser VCS status LED.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3190
diff changeset
416 else:
6580dc0fe205 Added click functions to the project browser VCS status LED.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3190
diff changeset
417 # call status dialog
6580dc0fe205 Added click functions to the project browser VCS status LED.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3190
diff changeset
418 vcs.vcsStatus(self.project.getProjectPath())

eric ide

mercurial