33 def __init__(self, vcsObject, projectObject, parent=None, name=None): |
33 def __init__(self, vcsObject, projectObject, parent=None, name=None): |
34 """ |
34 """ |
35 Constructor |
35 Constructor |
36 |
36 |
37 @param vcsObject reference to the vcs object |
37 @param vcsObject reference to the vcs object |
|
38 @type VersionControl |
38 @param projectObject reference to the project object |
39 @param projectObject reference to the project object |
39 @param parent parent widget (QWidget) |
40 @type Project |
40 @param name name of this object (string) |
41 @param parent parent widget |
|
42 @type QWidget |
|
43 @param name name of this object |
|
44 @type str |
41 """ |
45 """ |
42 super().__init__(parent) |
46 super().__init__(parent) |
43 if name: |
47 if name: |
44 self.setObjectName(name) |
48 self.setObjectName(name) |
45 |
49 |
55 def setObjects(self, vcsObject, projectObject): |
59 def setObjects(self, vcsObject, projectObject): |
56 """ |
60 """ |
57 Public method to set references to the vcs and project objects. |
61 Public method to set references to the vcs and project objects. |
58 |
62 |
59 @param vcsObject reference to the vcs object |
63 @param vcsObject reference to the vcs object |
|
64 @type VersionControl |
60 @param projectObject reference to the project object |
65 @param projectObject reference to the project object |
|
66 @type Project |
61 """ |
67 """ |
62 self.vcs = vcsObject |
68 self.vcs = vcsObject |
63 self.project = projectObject |
69 self.project = projectObject |
64 |
70 |
65 def initActions(self): |
71 def initActions(self): |
144 |
150 |
145 def initMenu(self, menu): |
151 def initMenu(self, menu): |
146 """ |
152 """ |
147 Public method to generate the VCS menu. |
153 Public method to generate the VCS menu. |
148 |
154 |
149 @param menu reference to the menu to be populated (QMenu) |
155 @param menu reference to the menu to be populated |
|
156 @type QMenu |
150 """ |
157 """ |
151 menu.clear() |
158 menu.clear() |
152 |
159 |
153 menu.addAction(self.vcsNewAct) |
160 menu.addAction(self.vcsNewAct) |
154 menu.addAction(self.vcsExportAct) |
161 menu.addAction(self.vcsExportAct) |
158 |
165 |
159 def initToolbar(self, ui, toolbarManager): # noqa: U100 |
166 def initToolbar(self, ui, toolbarManager): # noqa: U100 |
160 """ |
167 """ |
161 Public slot to initialize the VCS toolbar. |
168 Public slot to initialize the VCS toolbar. |
162 |
169 |
163 @param ui reference to the main window (UserInterface) |
170 @param ui reference to the main window |
|
171 @type UserInterface |
164 @param toolbarManager reference to a toolbar manager object |
172 @param toolbarManager reference to a toolbar manager object |
165 (EricToolBarManager) |
173 @type EricToolBarManager |
166 @return the toolbar generated (QToolBar) |
174 @return the toolbar generated |
|
175 @rtype QToolBar |
167 """ |
176 """ |
168 return None # __IGNORE_WARNING_M831__ |
177 return None # __IGNORE_WARNING_M831__ |
169 |
178 |
170 def initBasicToolbar(self, ui, toolbarManager): |
179 def initBasicToolbar(self, ui, toolbarManager): |
171 """ |
180 """ |
172 Public slot to initialize the basic VCS toolbar. |
181 Public slot to initialize the basic VCS toolbar. |
173 |
182 |
174 @param ui reference to the main window (UserInterface) |
183 @param ui reference to the main window |
|
184 @type UserInterface |
175 @param toolbarManager reference to a toolbar manager object |
185 @param toolbarManager reference to a toolbar manager object |
176 (EricToolBarManager) |
186 @type EricToolBarManager |
177 @return the toolbar generated (QToolBar) |
187 @return the toolbar generated |
|
188 @rtype QToolBar |
178 """ |
189 """ |
179 tb = QToolBar(QCoreApplication.translate("VcsProjectHelper", "VCS"), ui) |
190 tb = QToolBar(QCoreApplication.translate("VcsProjectHelper", "VCS"), ui) |
180 tb.setObjectName("VersionControlToolbar") |
191 tb.setObjectName("VersionControlToolbar") |
181 tb.setToolTip(QCoreApplication.translate("VcsProjectHelper", "VCS")) |
192 tb.setToolTip(QCoreApplication.translate("VcsProjectHelper", "VCS")) |
182 |
193 |
200 def _vcsCheckout(self, export=False): |
211 def _vcsCheckout(self, export=False): |
201 """ |
212 """ |
202 Protected slot used to create a local project from the repository. |
213 Protected slot used to create a local project from the repository. |
203 |
214 |
204 @param export flag indicating whether an export or a checkout |
215 @param export flag indicating whether an export or a checkout |
205 should be performed |
216 should be performed |
|
217 @type bool |
206 """ |
218 """ |
207 if not self.project or not self.project.checkDirty(): |
219 if not self.project or not self.project.checkDirty(): |
208 return |
220 return |
209 |
221 |
210 vcsSystemsDict = ( |
222 vcsSystemsDict = ( |