Plugins/VcsPlugins/vcsMercurial/BookmarksExtension/ProjectHelper.py

changeset 1087
fb8cd56819a9
parent 1074
ed2585464f12
child 1106
3e57cd52e0f6
equal deleted inserted replaced
1086:b48ce064b224 1087:fb8cd56819a9
5 5
6 """ 6 """
7 Module implementing the bookmarks extension project helper. 7 Module implementing the bookmarks extension project helper.
8 """ 8 """
9 9
10 from PyQt4.QtCore import QObject
11 from PyQt4.QtGui import QMenu 10 from PyQt4.QtGui import QMenu
12 11
13 from E5Gui.E5Action import E5Action 12 from E5Gui.E5Action import E5Action
14 13
14 from ..HgExtensionProjectHelper import HgExtensionProjectHelper
15
15 import UI.PixmapCache 16 import UI.PixmapCache
16 17
17 18
18 class BookmarksProjectHelper(QObject): 19 class BookmarksProjectHelper(HgExtensionProjectHelper):
19 """ 20 """
20 Class implementing the bookmarks extension project helper. 21 Class implementing the bookmarks extension project helper.
21 """ 22 """
22 def __init__(self): 23 def __init__(self):
23 """ 24 """
24 Constructor 25 Constructor
25 """ 26 """
26 QObject.__init__(self) 27 super().__init__()
27
28 self.actions = []
29
30 self.initActions()
31
32 def setObjects(self, vcsObject, projectObject):
33 """
34 Public method to set references to the vcs and project objects.
35
36 @param vcsObject reference to the vcs object
37 @param projectObject reference to the project object
38 """
39 self.vcs = vcsObject
40 self.project = projectObject
41
42 def getActions(self):
43 """
44 Public method to get a list of all actions.
45
46 @return list of all actions (list of E5Action)
47 """
48 return self.actions[:]
49 28
50 def initActions(self): 29 def initActions(self):
51 """ 30 """
52 Public method to generate the action objects. 31 Public method to generate the action objects.
53 """ 32 """
207 return menu 186 return menu
208 187
209 def menuTitle(self): 188 def menuTitle(self):
210 """ 189 """
211 Public method to get the menu title. 190 Public method to get the menu title.
191
192 @return title of the menu (string)
212 """ 193 """
213 return self.trUtf8("Bookmarks") 194 return self.trUtf8("Bookmarks")
214 195
215 def __hgBookmarksList(self): 196 def __hgBookmarksList(self):
216 """ 197 """

eric ide

mercurial