9 |
9 |
10 import os |
10 import os |
11 |
11 |
12 from PyQt6.QtWidgets import QToolBar |
12 from PyQt6.QtWidgets import QToolBar |
13 |
13 |
14 from VCS.ProjectHelper import VcsProjectHelper |
14 from eric7.VCS.ProjectHelper import VcsProjectHelper |
15 |
15 |
16 from EricGui.EricAction import EricAction |
16 from eric7.EricGui.EricAction import EricAction |
17 from EricWidgets.EricApplication import ericApp |
17 from eric7.EricWidgets.EricApplication import ericApp |
18 |
18 |
19 import UI.PixmapCache |
19 from eric7.EricGui import EricPixmapCache |
|
20 from eric7.UI import Config |
20 |
21 |
21 |
22 |
22 class SvnProjectHelper(VcsProjectHelper): |
23 class SvnProjectHelper(VcsProjectHelper): |
23 """ |
24 """ |
24 Class implementing the VCS project helper for Subversion. |
25 Class implementing the VCS project helper for Subversion. |
47 """ |
48 """ |
48 Public method to generate the action objects. |
49 Public method to generate the action objects. |
49 """ |
50 """ |
50 self.vcsNewAct = EricAction( |
51 self.vcsNewAct = EricAction( |
51 self.tr("New from repository"), |
52 self.tr("New from repository"), |
52 UI.PixmapCache.getIcon("vcsCheckout"), |
53 EricPixmapCache.getIcon("vcsCheckout"), |
53 self.tr("&New from repository..."), |
54 self.tr("&New from repository..."), |
54 0, |
55 0, |
55 0, |
56 0, |
56 self, |
57 self, |
57 "subversion_new", |
58 "subversion_new", |
69 self.vcsNewAct.triggered.connect(self._vcsCheckout) |
70 self.vcsNewAct.triggered.connect(self._vcsCheckout) |
70 self.actions.append(self.vcsNewAct) |
71 self.actions.append(self.vcsNewAct) |
71 |
72 |
72 self.vcsUpdateAct = EricAction( |
73 self.vcsUpdateAct = EricAction( |
73 self.tr("Update from repository"), |
74 self.tr("Update from repository"), |
74 UI.PixmapCache.getIcon("vcsUpdate"), |
75 EricPixmapCache.getIcon("vcsUpdate"), |
75 self.tr("&Update from repository"), |
76 self.tr("&Update from repository"), |
76 0, |
77 0, |
77 0, |
78 0, |
78 self, |
79 self, |
79 "subversion_update", |
80 "subversion_update", |
91 self.vcsUpdateAct.triggered.connect(self._vcsUpdate) |
92 self.vcsUpdateAct.triggered.connect(self._vcsUpdate) |
92 self.actions.append(self.vcsUpdateAct) |
93 self.actions.append(self.vcsUpdateAct) |
93 |
94 |
94 self.vcsCommitAct = EricAction( |
95 self.vcsCommitAct = EricAction( |
95 self.tr("Commit changes to repository"), |
96 self.tr("Commit changes to repository"), |
96 UI.PixmapCache.getIcon("vcsCommit"), |
97 EricPixmapCache.getIcon("vcsCommit"), |
97 self.tr("&Commit changes to repository..."), |
98 self.tr("&Commit changes to repository..."), |
98 0, |
99 0, |
99 0, |
100 0, |
100 self, |
101 self, |
101 "subversion_commit", |
102 "subversion_commit", |
113 self.vcsCommitAct.triggered.connect(self._vcsCommit) |
114 self.vcsCommitAct.triggered.connect(self._vcsCommit) |
114 self.actions.append(self.vcsCommitAct) |
115 self.actions.append(self.vcsCommitAct) |
115 |
116 |
116 self.svnLogBrowserAct = EricAction( |
117 self.svnLogBrowserAct = EricAction( |
117 self.tr("Show log browser"), |
118 self.tr("Show log browser"), |
118 UI.PixmapCache.getIcon("vcsLog"), |
119 EricPixmapCache.getIcon("vcsLog"), |
119 self.tr("Show log browser"), |
120 self.tr("Show log browser"), |
120 0, |
121 0, |
121 0, |
122 0, |
122 self, |
123 self, |
123 "subversion_log_browser", |
124 "subversion_log_browser", |
136 self.svnLogBrowserAct.triggered.connect(self._vcsLogBrowser) |
137 self.svnLogBrowserAct.triggered.connect(self._vcsLogBrowser) |
137 self.actions.append(self.svnLogBrowserAct) |
138 self.actions.append(self.svnLogBrowserAct) |
138 |
139 |
139 self.vcsDiffAct = EricAction( |
140 self.vcsDiffAct = EricAction( |
140 self.tr("Show differences"), |
141 self.tr("Show differences"), |
141 UI.PixmapCache.getIcon("vcsDiff"), |
142 EricPixmapCache.getIcon("vcsDiff"), |
142 self.tr("Show &difference"), |
143 self.tr("Show &difference"), |
143 0, |
144 0, |
144 0, |
145 0, |
145 self, |
146 self, |
146 "subversion_diff", |
147 "subversion_diff", |
158 self.vcsDiffAct.triggered.connect(self._vcsDiff) |
159 self.vcsDiffAct.triggered.connect(self._vcsDiff) |
159 self.actions.append(self.vcsDiffAct) |
160 self.actions.append(self.vcsDiffAct) |
160 |
161 |
161 self.svnExtDiffAct = EricAction( |
162 self.svnExtDiffAct = EricAction( |
162 self.tr("Show differences (extended)"), |
163 self.tr("Show differences (extended)"), |
163 UI.PixmapCache.getIcon("vcsDiff"), |
164 EricPixmapCache.getIcon("vcsDiff"), |
164 self.tr("Show differences (extended)"), |
165 self.tr("Show differences (extended)"), |
165 0, |
166 0, |
166 0, |
167 0, |
167 self, |
168 self, |
168 "subversion_extendeddiff", |
169 "subversion_extendeddiff", |
180 self.svnExtDiffAct.triggered.connect(self.__svnExtendedDiff) |
181 self.svnExtDiffAct.triggered.connect(self.__svnExtendedDiff) |
181 self.actions.append(self.svnExtDiffAct) |
182 self.actions.append(self.svnExtDiffAct) |
182 |
183 |
183 self.svnUrlDiffAct = EricAction( |
184 self.svnUrlDiffAct = EricAction( |
184 self.tr("Show differences (URLs)"), |
185 self.tr("Show differences (URLs)"), |
185 UI.PixmapCache.getIcon("vcsDiff"), |
186 EricPixmapCache.getIcon("vcsDiff"), |
186 self.tr("Show differences (URLs)"), |
187 self.tr("Show differences (URLs)"), |
187 0, |
188 0, |
188 0, |
189 0, |
189 self, |
190 self, |
190 "subversion_urldiff", |
191 "subversion_urldiff", |
202 self.svnUrlDiffAct.triggered.connect(self.__svnUrlDiff) |
203 self.svnUrlDiffAct.triggered.connect(self.__svnUrlDiff) |
203 self.actions.append(self.svnUrlDiffAct) |
204 self.actions.append(self.svnUrlDiffAct) |
204 |
205 |
205 self.vcsStatusAct = EricAction( |
206 self.vcsStatusAct = EricAction( |
206 self.tr("Show status"), |
207 self.tr("Show status"), |
207 UI.PixmapCache.getIcon("vcsStatus"), |
208 EricPixmapCache.getIcon("vcsStatus"), |
208 self.tr("Show &status"), |
209 self.tr("Show &status"), |
209 0, |
210 0, |
210 0, |
211 0, |
211 self, |
212 self, |
212 "subversion_status", |
213 "subversion_status", |
221 self.vcsStatusAct.triggered.connect(self._vcsStatus) |
222 self.vcsStatusAct.triggered.connect(self._vcsStatus) |
222 self.actions.append(self.vcsStatusAct) |
223 self.actions.append(self.vcsStatusAct) |
223 |
224 |
224 self.svnChangeListsAct = EricAction( |
225 self.svnChangeListsAct = EricAction( |
225 self.tr("Show change lists"), |
226 self.tr("Show change lists"), |
226 UI.PixmapCache.getIcon("vcsChangeLists"), |
227 EricPixmapCache.getIcon("vcsChangeLists"), |
227 self.tr("Show change lists"), |
228 self.tr("Show change lists"), |
228 0, |
229 0, |
229 0, |
230 0, |
230 self, |
231 self, |
231 "subversion_changelists", |
232 "subversion_changelists", |
243 self.svnChangeListsAct.triggered.connect(self.__svnChangeLists) |
244 self.svnChangeListsAct.triggered.connect(self.__svnChangeLists) |
244 self.actions.append(self.svnChangeListsAct) |
245 self.actions.append(self.svnChangeListsAct) |
245 |
246 |
246 self.vcsTagAct = EricAction( |
247 self.vcsTagAct = EricAction( |
247 self.tr("Tag in repository"), |
248 self.tr("Tag in repository"), |
248 UI.PixmapCache.getIcon("vcsTag"), |
249 EricPixmapCache.getIcon("vcsTag"), |
249 self.tr("&Tag in repository..."), |
250 self.tr("&Tag in repository..."), |
250 0, |
251 0, |
251 0, |
252 0, |
252 self, |
253 self, |
253 "subversion_tag", |
254 "subversion_tag", |
262 self.vcsTagAct.triggered.connect(self._vcsTag) |
263 self.vcsTagAct.triggered.connect(self._vcsTag) |
263 self.actions.append(self.vcsTagAct) |
264 self.actions.append(self.vcsTagAct) |
264 |
265 |
265 self.vcsExportAct = EricAction( |
266 self.vcsExportAct = EricAction( |
266 self.tr("Export from repository"), |
267 self.tr("Export from repository"), |
267 UI.PixmapCache.getIcon("vcsExport"), |
268 EricPixmapCache.getIcon("vcsExport"), |
268 self.tr("&Export from repository..."), |
269 self.tr("&Export from repository..."), |
269 0, |
270 0, |
270 0, |
271 0, |
271 self, |
272 self, |
272 "subversion_export", |
273 "subversion_export", |
299 self.vcsPropsAct.triggered.connect(self._vcsCommandOptions) |
300 self.vcsPropsAct.triggered.connect(self._vcsCommandOptions) |
300 self.actions.append(self.vcsPropsAct) |
301 self.actions.append(self.vcsPropsAct) |
301 |
302 |
302 self.vcsRevertAct = EricAction( |
303 self.vcsRevertAct = EricAction( |
303 self.tr("Revert changes"), |
304 self.tr("Revert changes"), |
304 UI.PixmapCache.getIcon("vcsRevert"), |
305 EricPixmapCache.getIcon("vcsRevert"), |
305 self.tr("Re&vert changes"), |
306 self.tr("Re&vert changes"), |
306 0, |
307 0, |
307 0, |
308 0, |
308 self, |
309 self, |
309 "subversion_revert", |
310 "subversion_revert", |
320 self.vcsRevertAct.triggered.connect(self._vcsRevert) |
321 self.vcsRevertAct.triggered.connect(self._vcsRevert) |
321 self.actions.append(self.vcsRevertAct) |
322 self.actions.append(self.vcsRevertAct) |
322 |
323 |
323 self.vcsMergeAct = EricAction( |
324 self.vcsMergeAct = EricAction( |
324 self.tr("Merge"), |
325 self.tr("Merge"), |
325 UI.PixmapCache.getIcon("vcsMerge"), |
326 EricPixmapCache.getIcon("vcsMerge"), |
326 self.tr("Mer&ge changes..."), |
327 self.tr("Mer&ge changes..."), |
327 0, |
328 0, |
328 0, |
329 0, |
329 self, |
330 self, |
330 "subversion_merge", |
331 "subversion_merge", |
342 self.vcsMergeAct.triggered.connect(self._vcsMerge) |
343 self.vcsMergeAct.triggered.connect(self._vcsMerge) |
343 self.actions.append(self.vcsMergeAct) |
344 self.actions.append(self.vcsMergeAct) |
344 |
345 |
345 self.vcsSwitchAct = EricAction( |
346 self.vcsSwitchAct = EricAction( |
346 self.tr("Switch"), |
347 self.tr("Switch"), |
347 UI.PixmapCache.getIcon("vcsSwitch"), |
348 EricPixmapCache.getIcon("vcsSwitch"), |
348 self.tr("S&witch..."), |
349 self.tr("S&witch..."), |
349 0, |
350 0, |
350 0, |
351 0, |
351 self, |
352 self, |
352 "subversion_switch", |
353 "subversion_switch", |
526 self.svnPropDelAct.triggered.connect(self.__svnPropDel) |
527 self.svnPropDelAct.triggered.connect(self.__svnPropDel) |
527 self.actions.append(self.svnPropDelAct) |
528 self.actions.append(self.svnPropDelAct) |
528 |
529 |
529 self.svnRelocateAct = EricAction( |
530 self.svnRelocateAct = EricAction( |
530 self.tr("Relocate"), |
531 self.tr("Relocate"), |
531 UI.PixmapCache.getIcon("vcsSwitch"), |
532 EricPixmapCache.getIcon("vcsSwitch"), |
532 self.tr("Relocate..."), |
533 self.tr("Relocate..."), |
533 0, |
534 0, |
534 0, |
535 0, |
535 self, |
536 self, |
536 "subversion_relocate", |
537 "subversion_relocate", |
548 self.svnRelocateAct.triggered.connect(self.__svnRelocate) |
549 self.svnRelocateAct.triggered.connect(self.__svnRelocate) |
549 self.actions.append(self.svnRelocateAct) |
550 self.actions.append(self.svnRelocateAct) |
550 |
551 |
551 self.svnRepoBrowserAct = EricAction( |
552 self.svnRepoBrowserAct = EricAction( |
552 self.tr("Repository Browser"), |
553 self.tr("Repository Browser"), |
553 UI.PixmapCache.getIcon("vcsRepoBrowser"), |
554 EricPixmapCache.getIcon("vcsRepoBrowser"), |
554 self.tr("Repository Browser..."), |
555 self.tr("Repository Browser..."), |
555 0, |
556 0, |
556 0, |
557 0, |
557 self, |
558 self, |
558 "subversion_repo_browser", |
559 "subversion_repo_browser", |
612 @param menu reference to the menu to be populated (QMenu) |
613 @param menu reference to the menu to be populated (QMenu) |
613 """ |
614 """ |
614 menu.clear() |
615 menu.clear() |
615 |
616 |
616 act = menu.addAction( |
617 act = menu.addAction( |
617 UI.PixmapCache.getIcon( |
618 EricPixmapCache.getIcon( |
618 os.path.join("VcsPlugins", "vcsSubversion", "icons", "subversion.svg") |
619 os.path.join("VcsPlugins", "vcsSubversion", "icons", "subversion.svg") |
619 ), |
620 ), |
620 self.vcs.vcsName(), |
621 self.vcs.vcsName(), |
621 self._vcsInfoDisplay, |
622 self._vcsInfoDisplay, |
622 ) |
623 ) |
675 @param ui reference to the main window (UserInterface) |
676 @param ui reference to the main window (UserInterface) |
676 @param toolbarManager reference to a toolbar manager object |
677 @param toolbarManager reference to a toolbar manager object |
677 (EricToolBarManager) |
678 (EricToolBarManager) |
678 """ |
679 """ |
679 self.__toolbar = QToolBar(self.tr("Subversion (svn)"), ui) |
680 self.__toolbar = QToolBar(self.tr("Subversion (svn)"), ui) |
680 self.__toolbar.setIconSize(UI.Config.ToolBarIconSize) |
681 self.__toolbar.setIconSize(Config.ToolBarIconSize) |
681 self.__toolbar.setObjectName("SubversionToolbar") |
682 self.__toolbar.setObjectName("SubversionToolbar") |
682 self.__toolbar.setToolTip(self.tr("Subversion (svn)")) |
683 self.__toolbar.setToolTip(self.tr("Subversion (svn)")) |
683 |
684 |
684 self.__toolbar.addAction(self.svnLogBrowserAct) |
685 self.__toolbar.addAction(self.svnLogBrowserAct) |
685 self.__toolbar.addAction(self.vcsStatusAct) |
686 self.__toolbar.addAction(self.vcsStatusAct) |