src/eric7/Plugins/VcsPlugins/vcsPySvn/ProjectHelper.py

branch
eric7
changeset 9413
80c06d472826
parent 9221
bf71ee032bb4
child 9473
3f23dbf37dbe
equal deleted inserted replaced
9412:45e7bb09c120 9413:80c06d472826
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 PySvnProjectHelper(VcsProjectHelper): 23 class PySvnProjectHelper(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 "pysvn_new", 58 "pysvn_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 "pysvn_update", 80 "pysvn_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 "pysvn_commit", 102 "pysvn_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 "pysvn_log_browser", 124 "pysvn_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 "pysvn_diff", 147 "pysvn_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 "pysvn_extendeddiff", 169 "pysvn_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 "pysvn_urldiff", 191 "pysvn_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 "pysvn_status", 213 "pysvn_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 "pysvn_changelists", 232 "pysvn_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.svnRepoInfoAct = EricAction( 247 self.svnRepoInfoAct = EricAction(
247 self.tr("Show repository info"), 248 self.tr("Show repository info"),
248 UI.PixmapCache.getIcon("vcsRepo"), 249 EricPixmapCache.getIcon("vcsRepo"),
249 self.tr("Show repository info"), 250 self.tr("Show repository info"),
250 0, 251 0,
251 0, 252 0,
252 self, 253 self,
253 "pysvn_repoinfo", 254 "pysvn_repoinfo",
265 self.svnRepoInfoAct.triggered.connect(self.__svnInfo) 266 self.svnRepoInfoAct.triggered.connect(self.__svnInfo)
266 self.actions.append(self.svnRepoInfoAct) 267 self.actions.append(self.svnRepoInfoAct)
267 268
268 self.vcsTagAct = EricAction( 269 self.vcsTagAct = EricAction(
269 self.tr("Tag in repository"), 270 self.tr("Tag in repository"),
270 UI.PixmapCache.getIcon("vcsTag"), 271 EricPixmapCache.getIcon("vcsTag"),
271 self.tr("&Tag in repository..."), 272 self.tr("&Tag in repository..."),
272 0, 273 0,
273 0, 274 0,
274 self, 275 self,
275 "pysvn_tag", 276 "pysvn_tag",
284 self.vcsTagAct.triggered.connect(self._vcsTag) 285 self.vcsTagAct.triggered.connect(self._vcsTag)
285 self.actions.append(self.vcsTagAct) 286 self.actions.append(self.vcsTagAct)
286 287
287 self.vcsExportAct = EricAction( 288 self.vcsExportAct = EricAction(
288 self.tr("Export from repository"), 289 self.tr("Export from repository"),
289 UI.PixmapCache.getIcon("vcsExport"), 290 EricPixmapCache.getIcon("vcsExport"),
290 self.tr("&Export from repository..."), 291 self.tr("&Export from repository..."),
291 0, 292 0,
292 0, 293 0,
293 self, 294 self,
294 "pysvn_export", 295 "pysvn_export",
321 self.vcsPropsAct.triggered.connect(self._vcsCommandOptions) 322 self.vcsPropsAct.triggered.connect(self._vcsCommandOptions)
322 self.actions.append(self.vcsPropsAct) 323 self.actions.append(self.vcsPropsAct)
323 324
324 self.vcsRevertAct = EricAction( 325 self.vcsRevertAct = EricAction(
325 self.tr("Revert changes"), 326 self.tr("Revert changes"),
326 UI.PixmapCache.getIcon("vcsRevert"), 327 EricPixmapCache.getIcon("vcsRevert"),
327 self.tr("Re&vert changes"), 328 self.tr("Re&vert changes"),
328 0, 329 0,
329 0, 330 0,
330 self, 331 self,
331 "pysvn_revert", 332 "pysvn_revert",
342 self.vcsRevertAct.triggered.connect(self._vcsRevert) 343 self.vcsRevertAct.triggered.connect(self._vcsRevert)
343 self.actions.append(self.vcsRevertAct) 344 self.actions.append(self.vcsRevertAct)
344 345
345 self.vcsMergeAct = EricAction( 346 self.vcsMergeAct = EricAction(
346 self.tr("Merge"), 347 self.tr("Merge"),
347 UI.PixmapCache.getIcon("vcsMerge"), 348 EricPixmapCache.getIcon("vcsMerge"),
348 self.tr("Mer&ge changes..."), 349 self.tr("Mer&ge changes..."),
349 0, 350 0,
350 0, 351 0,
351 self, 352 self,
352 "pysvn_merge", 353 "pysvn_merge",
364 self.vcsMergeAct.triggered.connect(self._vcsMerge) 365 self.vcsMergeAct.triggered.connect(self._vcsMerge)
365 self.actions.append(self.vcsMergeAct) 366 self.actions.append(self.vcsMergeAct)
366 367
367 self.vcsSwitchAct = EricAction( 368 self.vcsSwitchAct = EricAction(
368 self.tr("Switch"), 369 self.tr("Switch"),
369 UI.PixmapCache.getIcon("vcsSwitch"), 370 EricPixmapCache.getIcon("vcsSwitch"),
370 self.tr("S&witch..."), 371 self.tr("S&witch..."),
371 0, 372 0,
372 0, 373 0,
373 self, 374 self,
374 "pysvn_switch", 375 "pysvn_switch",
543 self.svnPropDelAct.triggered.connect(self.__svnPropDel) 544 self.svnPropDelAct.triggered.connect(self.__svnPropDel)
544 self.actions.append(self.svnPropDelAct) 545 self.actions.append(self.svnPropDelAct)
545 546
546 self.svnRelocateAct = EricAction( 547 self.svnRelocateAct = EricAction(
547 self.tr("Relocate"), 548 self.tr("Relocate"),
548 UI.PixmapCache.getIcon("vcsSwitch"), 549 EricPixmapCache.getIcon("vcsSwitch"),
549 self.tr("Relocate..."), 550 self.tr("Relocate..."),
550 0, 551 0,
551 0, 552 0,
552 self, 553 self,
553 "pysvn_relocate", 554 "pysvn_relocate",
565 self.svnRelocateAct.triggered.connect(self.__svnRelocate) 566 self.svnRelocateAct.triggered.connect(self.__svnRelocate)
566 self.actions.append(self.svnRelocateAct) 567 self.actions.append(self.svnRelocateAct)
567 568
568 self.svnRepoBrowserAct = EricAction( 569 self.svnRepoBrowserAct = EricAction(
569 self.tr("Repository Browser"), 570 self.tr("Repository Browser"),
570 UI.PixmapCache.getIcon("vcsRepoBrowser"), 571 EricPixmapCache.getIcon("vcsRepoBrowser"),
571 self.tr("Repository Browser..."), 572 self.tr("Repository Browser..."),
572 0, 573 0,
573 0, 574 0,
574 self, 575 self,
575 "pysvn_repo_browser", 576 "pysvn_repo_browser",
624 @param menu reference to the menu to be populated (QMenu) 625 @param menu reference to the menu to be populated (QMenu)
625 """ 626 """
626 menu.clear() 627 menu.clear()
627 628
628 act = menu.addAction( 629 act = menu.addAction(
629 UI.PixmapCache.getIcon( 630 EricPixmapCache.getIcon(
630 os.path.join("VcsPlugins", "vcsPySvn", "icons", "pysvn.svg") 631 os.path.join("VcsPlugins", "vcsPySvn", "icons", "pysvn.svg")
631 ), 632 ),
632 self.vcs.vcsName(), 633 self.vcs.vcsName(),
633 self._vcsInfoDisplay, 634 self._vcsInfoDisplay,
634 ) 635 )
688 @param ui reference to the main window (UserInterface) 689 @param ui reference to the main window (UserInterface)
689 @param toolbarManager reference to a toolbar manager object 690 @param toolbarManager reference to a toolbar manager object
690 (EricToolBarManager) 691 (EricToolBarManager)
691 """ 692 """
692 self.__toolbar = QToolBar(self.tr("Subversion (pysvn)"), ui) 693 self.__toolbar = QToolBar(self.tr("Subversion (pysvn)"), ui)
693 self.__toolbar.setIconSize(UI.Config.ToolBarIconSize) 694 self.__toolbar.setIconSize(Config.ToolBarIconSize)
694 self.__toolbar.setObjectName("PySvnToolbar") 695 self.__toolbar.setObjectName("PySvnToolbar")
695 self.__toolbar.setToolTip(self.tr("Subversion (pysvn)")) 696 self.__toolbar.setToolTip(self.tr("Subversion (pysvn)"))
696 697
697 self.__toolbar.addAction(self.svnLogBrowserAct) 698 self.__toolbar.addAction(self.svnLogBrowserAct)
698 self.__toolbar.addAction(self.vcsStatusAct) 699 self.__toolbar.addAction(self.vcsStatusAct)

eric ide

mercurial