PluginTimeTracker.py

changeset 71
29c55e28d9b5
parent 69
021ac1e44e32
child 73
9c5a741085c3
equal deleted inserted replaced
70:b6ee8515e569 71:29c55e28d9b5
22 # Start-Of-Header 22 # Start-Of-Header
23 name = "Time Tracker Plugin" 23 name = "Time Tracker Plugin"
24 author = "Detlev Offenbach <detlev@die-offenbachs.de>" 24 author = "Detlev Offenbach <detlev@die-offenbachs.de>"
25 autoactivate = True 25 autoactivate = True
26 deactivateable = True 26 deactivateable = True
27 version = "2.0.5" 27 version = "2.0.6"
28 className = "TimeTrackerPlugin" 28 className = "TimeTrackerPlugin"
29 packageName = "TimeTracker" 29 packageName = "TimeTracker"
30 shortDescription = "Time Tracker to keep track of the project time." 30 shortDescription = "Time Tracker to keep track of the project time."
31 longDescription = \ 31 longDescription = \
32 """This plug-in implements a time tracker to keep track""" \ 32 """This plug-in implements a time tracker to keep track""" \
59 """ 59 """
60 Module function returning data as required by the configuration dialog. 60 Module function returning data as required by the configuration dialog.
61 61
62 @return dictionary containing the relevant data 62 @return dictionary containing the relevant data
63 """ 63 """
64 if e5App().getObject("UserInterface").versionIsNewer('5.2.99', '20121012'): 64 return {
65 return { 65 "timeTrackerPage": [
66 "timeTrackerPage": [ 66 QCoreApplication.translate("TimeTrackerPlugin",
67 QCoreApplication.translate("TimeTrackerPlugin", 67 "Time Tracker"),
68 "Time Tracker"), 68 os.path.join("TimeTracker", "icons", "clock.png"),
69 os.path.join("TimeTracker", "icons", "clock.png"), 69 createTimeTrackerPage, None, None],
70 createTimeTrackerPage, None, None], 70 }
71 }
72 else:
73 return {}
74 71
75 72
76 def prepareUninstall(): 73 def prepareUninstall():
77 """ 74 """
78 Module function to prepare for an uninstallation. 75 Module function to prepare for an uninstallation.
111 """ 108 """
112 self.__object = None 109 self.__object = None
113 110
114 self.__e5project = e5App().getObject("Project") 111 self.__e5project = e5App().getObject("Project")
115 112
116 def __checkVersions(self):
117 """
118 Private function to check that the eric6 version is ok.
119
120 @return flag indicating version is ok (boolean)
121 """
122 global error
123
124 if self.__ui.versionIsNewer('5.99.99', '20140701'):
125 error = ""
126 else:
127 error = self.tr("eric6 version is too old, {0}, {1} or newer"
128 " needed.").format("6.0.0", "20140701")
129 return False
130
131 return True
132
133 def activate(self): 113 def activate(self):
134 """ 114 """
135 Public method to activate this plugin. 115 Public method to activate this plugin.
136 116
137 @return tuple of None and activation status (boolean) 117 @return tuple of None and activation status (boolean)
138 """ 118 """
139 global error 119 global error
140 error = "" # clear previous error 120 error = "" # clear previous error
141
142 if not self.__checkVersions():
143 return None, False
144 121
145 global timeTrackerPluginObject 122 global timeTrackerPluginObject
146 timeTrackerPluginObject = self 123 timeTrackerPluginObject = self
147 124
148 self.__object = TimeTracker(self, self.__ui) 125 self.__object = TimeTracker(self, self.__ui)

eric ide

mercurial