eric6/Plugins/VcsPlugins/vcsMercurial/PurgeExtension/ProjectHelper.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 7971
ff2971513d6d
permissions
-rw-r--r--

Updated copyright for 2021.

1071
ac0f74c0b870 Added support for the Mercurial purge extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1 # -*- coding: utf-8 -*-
ac0f74c0b870 Added support for the Mercurial purge extension.
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) 2011 - 2021 Detlev Offenbach <detlev@die-offenbachs.de>
1071
ac0f74c0b870 Added support for the Mercurial purge extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
4 #
ac0f74c0b870 Added support for the Mercurial purge extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
5
ac0f74c0b870 Added support for the Mercurial purge extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
6 """
ac0f74c0b870 Added support for the Mercurial purge extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
7 Module implementing the purge extension project helper.
ac0f74c0b870 Added support for the Mercurial purge extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
8 """
ac0f74c0b870 Added support for the Mercurial purge extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
9
3656
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
10 from PyQt5.QtWidgets import QMenu
1071
ac0f74c0b870 Added support for the Mercurial purge extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
11
ac0f74c0b870 Added support for the Mercurial purge extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
12 from E5Gui.E5Action import E5Action
ac0f74c0b870 Added support for the Mercurial purge extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
13
1087
fb8cd56819a9 Changed the Mercurial extension interface code to use custom base classes instead of inheriting QObject directly.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1074
diff changeset
14 from ..HgExtensionProjectHelper import HgExtensionProjectHelper
fb8cd56819a9 Changed the Mercurial extension interface code to use custom base classes instead of inheriting QObject directly.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1074
diff changeset
15
1071
ac0f74c0b870 Added support for the Mercurial purge extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
16 import UI.PixmapCache
ac0f74c0b870 Added support for the Mercurial purge extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
17
ac0f74c0b870 Added support for the Mercurial purge extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
18
1087
fb8cd56819a9 Changed the Mercurial extension interface code to use custom base classes instead of inheriting QObject directly.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1074
diff changeset
19 class PurgeProjectHelper(HgExtensionProjectHelper):
1071
ac0f74c0b870 Added support for the Mercurial purge extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
20 """
ac0f74c0b870 Added support for the Mercurial purge extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
21 Class implementing the purge extension project helper.
ac0f74c0b870 Added support for the Mercurial purge extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
22 """
ac0f74c0b870 Added support for the Mercurial purge extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
23 def __init__(self):
ac0f74c0b870 Added support for the Mercurial purge extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
24 """
ac0f74c0b870 Added support for the Mercurial purge extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
25 Constructor
ac0f74c0b870 Added support for the Mercurial purge extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
26 """
2525
8b507a9a2d40 Script changes: Future import added, super calls modified and unicode behavior for str.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents: 2302
diff changeset
27 super(PurgeProjectHelper, self).__init__()
1071
ac0f74c0b870 Added support for the Mercurial purge extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
28
ac0f74c0b870 Added support for the Mercurial purge extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
29 def initActions(self):
ac0f74c0b870 Added support for the Mercurial purge extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
30 """
ac0f74c0b870 Added support for the Mercurial purge extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
31 Public method to generate the action objects.
ac0f74c0b870 Added support for the Mercurial purge extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
32 """
3023
34ce20603bf7 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3008
diff changeset
33 self.hgPurgeAct = E5Action(
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
34 self.tr('Purge Files'),
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
35 UI.PixmapCache.getIcon("fileDelete"),
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
36 self.tr('Purge Files'),
3023
34ce20603bf7 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3008
diff changeset
37 0, 0, self, 'mercurial_purge')
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
38 self.hgPurgeAct.setStatusTip(self.tr(
1071
ac0f74c0b870 Added support for the Mercurial purge extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
39 'Delete files and directories not known to Mercurial'
ac0f74c0b870 Added support for the Mercurial purge extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
40 ))
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
41 self.hgPurgeAct.setWhatsThis(self.tr(
1071
ac0f74c0b870 Added support for the Mercurial purge extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
42 """<b>Purge Files</b>"""
ac0f74c0b870 Added support for the Mercurial purge extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
43 """<p>This deletes files and directories not known to Mercurial."""
ac0f74c0b870 Added support for the Mercurial purge extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
44 """ That means that purge will delete:<ul>"""
3008
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2302
diff changeset
45 """<li>unknown files (marked with "not tracked" in the status"""
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2302
diff changeset
46 """ dialog)</li>"""
1071
ac0f74c0b870 Added support for the Mercurial purge extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
47 """<li>empty directories</li>"""
ac0f74c0b870 Added support for the Mercurial purge extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
48 """</ul>Note that ignored files will be left untouched.</p>"""
ac0f74c0b870 Added support for the Mercurial purge extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
49 ))
3345
071afe8be2a1 Changed signal/slot usage to not use constructs like 'triggered[()].connect(...)' anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3190
diff changeset
50 self.hgPurgeAct.triggered.connect(self.__hgPurge)
1071
ac0f74c0b870 Added support for the Mercurial purge extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
51 self.actions.append(self.hgPurgeAct)
ac0f74c0b870 Added support for the Mercurial purge extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
52
3023
34ce20603bf7 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3008
diff changeset
53 self.hgPurgeAllAct = E5Action(
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
54 self.tr('Purge All Files'),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
55 self.tr('Purge All Files'),
3023
34ce20603bf7 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3008
diff changeset
56 0, 0, self, 'mercurial_purge_all')
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
57 self.hgPurgeAllAct.setStatusTip(self.tr(
3008
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2302
diff changeset
58 'Delete files and directories not known to Mercurial including'
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2302
diff changeset
59 ' ignored ones'
1071
ac0f74c0b870 Added support for the Mercurial purge extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
60 ))
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
61 self.hgPurgeAllAct.setWhatsThis(self.tr(
1071
ac0f74c0b870 Added support for the Mercurial purge extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
62 """<b>Purge All Files</b>"""
ac0f74c0b870 Added support for the Mercurial purge extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
63 """<p>This deletes files and directories not known to Mercurial."""
ac0f74c0b870 Added support for the Mercurial purge extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
64 """ That means that purge will delete:<ul>"""
3008
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2302
diff changeset
65 """<li>unknown files (marked with "not tracked" in the status"""
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2302
diff changeset
66 """ dialog)</li>"""
1071
ac0f74c0b870 Added support for the Mercurial purge extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
67 """<li>empty directories</li>"""
ac0f74c0b870 Added support for the Mercurial purge extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
68 """<li>ignored files and directories</li>"""
ac0f74c0b870 Added support for the Mercurial purge extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
69 """</ul></p>"""
ac0f74c0b870 Added support for the Mercurial purge extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
70 ))
3345
071afe8be2a1 Changed signal/slot usage to not use constructs like 'triggered[()].connect(...)' anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3190
diff changeset
71 self.hgPurgeAllAct.triggered.connect(self.__hgPurgeAll)
1071
ac0f74c0b870 Added support for the Mercurial purge extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
72 self.actions.append(self.hgPurgeAllAct)
ac0f74c0b870 Added support for the Mercurial purge extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
73
3023
34ce20603bf7 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3008
diff changeset
74 self.hgPurgeListAct = E5Action(
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
75 self.tr('List Files to be Purged'),
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
76 UI.PixmapCache.getIcon("fileDeleteList"),
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
77 self.tr('List Files to be Purged...'),
3023
34ce20603bf7 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3008
diff changeset
78 0, 0, self, 'mercurial_purge_list')
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
79 self.hgPurgeListAct.setStatusTip(self.tr(
1071
ac0f74c0b870 Added support for the Mercurial purge extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
80 'List files and directories not known to Mercurial'
ac0f74c0b870 Added support for the Mercurial purge extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
81 ))
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
82 self.hgPurgeListAct.setWhatsThis(self.tr(
1071
ac0f74c0b870 Added support for the Mercurial purge extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
83 """<b>List Files to be Purged</b>"""
ac0f74c0b870 Added support for the Mercurial purge extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
84 """<p>This lists files and directories not known to Mercurial."""
ac0f74c0b870 Added support for the Mercurial purge extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
85 """ These would be deleted by the "Purge Files" menu entry.</p>"""
ac0f74c0b870 Added support for the Mercurial purge extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
86 ))
3345
071afe8be2a1 Changed signal/slot usage to not use constructs like 'triggered[()].connect(...)' anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3190
diff changeset
87 self.hgPurgeListAct.triggered.connect(self.__hgPurgeList)
1071
ac0f74c0b870 Added support for the Mercurial purge extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
88 self.actions.append(self.hgPurgeListAct)
ac0f74c0b870 Added support for the Mercurial purge extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
89
3008
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2302
diff changeset
90 self.hgPurgeAllListAct = E5Action(
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
91 self.tr('List All Files to be Purged'),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
92 self.tr('List All Files to be Purged...'),
3008
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2302
diff changeset
93 0, 0, self, 'mercurial_purge_all_list')
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
94 self.hgPurgeAllListAct.setStatusTip(self.tr(
3008
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2302
diff changeset
95 'List files and directories not known to Mercurial including'
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2302
diff changeset
96 ' ignored ones'
1071
ac0f74c0b870 Added support for the Mercurial purge extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
97 ))
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
98 self.hgPurgeAllListAct.setWhatsThis(self.tr(
1071
ac0f74c0b870 Added support for the Mercurial purge extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
99 """<b>List All Files to be Purged</b>"""
3008
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2302
diff changeset
100 """<p>This lists files and directories not known to Mercurial"""
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2302
diff changeset
101 """ including ignored ones. These would be deleted by the"""
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2302
diff changeset
102 """ "Purge All Files" menu entry.</p>"""
1071
ac0f74c0b870 Added support for the Mercurial purge extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
103 ))
3345
071afe8be2a1 Changed signal/slot usage to not use constructs like 'triggered[()].connect(...)' anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3190
diff changeset
104 self.hgPurgeAllListAct.triggered.connect(self.__hgPurgeAllList)
1071
ac0f74c0b870 Added support for the Mercurial purge extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
105 self.actions.append(self.hgPurgeAllListAct)
ac0f74c0b870 Added support for the Mercurial purge extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
106
ac0f74c0b870 Added support for the Mercurial purge extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
107 def initMenu(self, mainMenu):
ac0f74c0b870 Added support for the Mercurial purge extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
108 """
ac0f74c0b870 Added support for the Mercurial purge extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
109 Public method to generate the extension menu.
ac0f74c0b870 Added support for the Mercurial purge extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
110
ac0f74c0b870 Added support for the Mercurial purge extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
111 @param mainMenu reference to the main menu (QMenu)
ac0f74c0b870 Added support for the Mercurial purge extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
112 @return populated menu (QMenu)
ac0f74c0b870 Added support for the Mercurial purge extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
113 """
1074
ed2585464f12 Changed the logic of the Mercurials extension menu creation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1073
diff changeset
114 menu = QMenu(self.menuTitle(), mainMenu)
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
115 menu.setIcon(UI.PixmapCache.getIcon("fileDelete"))
1073
9f0c4b4eccb1 Made a few of the Mercurial menus tearable.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1071
diff changeset
116 menu.setTearOffEnabled(True)
1071
ac0f74c0b870 Added support for the Mercurial purge extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
117
ac0f74c0b870 Added support for the Mercurial purge extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
118 menu.addAction(self.hgPurgeAct)
ac0f74c0b870 Added support for the Mercurial purge extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
119 menu.addAction(self.hgPurgeAllAct)
ac0f74c0b870 Added support for the Mercurial purge extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
120 menu.addSeparator()
ac0f74c0b870 Added support for the Mercurial purge extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
121 menu.addAction(self.hgPurgeListAct)
ac0f74c0b870 Added support for the Mercurial purge extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
122 menu.addAction(self.hgPurgeAllListAct)
ac0f74c0b870 Added support for the Mercurial purge extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
123
ac0f74c0b870 Added support for the Mercurial purge extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
124 return menu
ac0f74c0b870 Added support for the Mercurial purge extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
125
1074
ed2585464f12 Changed the logic of the Mercurials extension menu creation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1073
diff changeset
126 def menuTitle(self):
ed2585464f12 Changed the logic of the Mercurials extension menu creation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1073
diff changeset
127 """
ed2585464f12 Changed the logic of the Mercurials extension menu creation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1073
diff changeset
128 Public method to get the menu title.
1087
fb8cd56819a9 Changed the Mercurial extension interface code to use custom base classes instead of inheriting QObject directly.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1074
diff changeset
129
fb8cd56819a9 Changed the Mercurial extension interface code to use custom base classes instead of inheriting QObject directly.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1074
diff changeset
130 @return title of the menu (string)
1074
ed2585464f12 Changed the logic of the Mercurials extension menu creation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1073
diff changeset
131 """
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
132 return self.tr("Purge")
1074
ed2585464f12 Changed the logic of the Mercurials extension menu creation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1073
diff changeset
133
1071
ac0f74c0b870 Added support for the Mercurial purge extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
134 def __hgPurge(self):
ac0f74c0b870 Added support for the Mercurial purge extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
135 """
ac0f74c0b870 Added support for the Mercurial purge extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
136 Private slot used to remove files not tracked by Mercurial.
ac0f74c0b870 Added support for the Mercurial purge extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
137 """
7257
c4d0cac9b5c9 Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
138 self.vcs.getExtensionObject("purge").hgPurge(
c4d0cac9b5c9 Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
139 self.project.getProjectPath(), deleteAll=False)
1071
ac0f74c0b870 Added support for the Mercurial purge extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
140
ac0f74c0b870 Added support for the Mercurial purge extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
141 def __hgPurgeAll(self):
ac0f74c0b870 Added support for the Mercurial purge extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
142 """
ac0f74c0b870 Added support for the Mercurial purge extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
143 Private slot used to remove all files not tracked by Mercurial.
ac0f74c0b870 Added support for the Mercurial purge extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
144 """
7257
c4d0cac9b5c9 Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
145 self.vcs.getExtensionObject("purge").hgPurge(
c4d0cac9b5c9 Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
146 self.project.getProjectPath(), deleteAll=True)
1071
ac0f74c0b870 Added support for the Mercurial purge extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
147
ac0f74c0b870 Added support for the Mercurial purge extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
148 def __hgPurgeList(self):
ac0f74c0b870 Added support for the Mercurial purge extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
149 """
ac0f74c0b870 Added support for the Mercurial purge extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
150 Private slot used to list files not tracked by Mercurial.
ac0f74c0b870 Added support for the Mercurial purge extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
151 """
7257
c4d0cac9b5c9 Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
152 self.vcs.getExtensionObject("purge").hgPurgeList(
c4d0cac9b5c9 Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
153 self.project.getProjectPath(), deleteAll=False)
1071
ac0f74c0b870 Added support for the Mercurial purge extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
154
ac0f74c0b870 Added support for the Mercurial purge extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
155 def __hgPurgeAllList(self):
ac0f74c0b870 Added support for the Mercurial purge extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
156 """
ac0f74c0b870 Added support for the Mercurial purge extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
157 Private slot used to list all files not tracked by Mercurial.
ac0f74c0b870 Added support for the Mercurial purge extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
158 """
7257
c4d0cac9b5c9 Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
159 self.vcs.getExtensionObject("purge").hgPurgeList(
c4d0cac9b5c9 Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
160 self.project.getProjectPath(), deleteAll=True)

eric ide

mercurial