TimeTracker/TimeTrackEntry.py

changeset 12
6c91abc72022
parent 11
1eabdd26c44e
child 15
645506ab3376
--- a/TimeTracker/TimeTrackEntry.py	Sun Oct 21 15:33:36 2012 +0200
+++ b/TimeTracker/TimeTrackEntry.py	Sun Oct 21 17:03:22 2012 +0200
@@ -183,6 +183,14 @@
         
         return minutes
     
+    def getID(self):
+        """
+        Public method to get the ID of the entry.
+        
+        @return ID of the entry (integer)
+        """
+        return self.__id
+    
     def setID(self, eid):
         """
         Public method to assign an ID to the entry.
@@ -191,6 +199,58 @@
         """
         self.__id = eid
     
+    def getStartDateTime(self):
+        """
+        Public method to get the start date and time.
+        
+        @return start date and time (QDateTime)
+        """
+        return self.__startDateTime
+    
+    def setStartDateTime(self, startDateTime):
+        """
+        Public method to set the start date and time.
+        
+        @param startDateTime start date and time (QDateTime)
+        """
+        if startDateTime.isValid():
+            self.__startDateTime = startDateTime
+    
+    def getDuration(self):
+        """
+        Public slot to get the duration.
+        
+        @return duration (integer)
+        """
+        return self.__duration
+    
+    def setDuration(self, duration):
+        """
+        Public method to set the duration.
+        
+        @param duration duration in minutes (integer)
+        """
+        if duration >= 0:
+            self.__duration = duration
+    
+    def addDuration(self, duration):
+        """
+        Public method to add a duration.
+        
+        @param duration duration to be added in minutes (integer). Negative values
+            are ignored.
+        """
+        if duration > 0:
+            self.__duration += duration
+    
+    def getTask(self):
+        """
+        Public method to get the task description.
+        
+        @return task description (string)
+        """
+        return self.__task
+    
     def setTask(self, description):
         """
         Public method to set the task description.
@@ -201,6 +261,14 @@
                                  .replace("\n", " ")\
                                  .replace("\r", " ")
     
+    def getComment(self):
+        """
+        Public method to get the comment.
+        
+        @return comment (string)
+        """
+        return self.__comment
+    
     def setComment(self, comment):
         """
         Public method to set a comment.
@@ -211,16 +279,6 @@
                                 .replace("\n", " ")\
                                 .replace("\r", " ")
     
-    def addDuration(self, duration):
-        """
-        Public method to add a duration.
-        
-        @param duration duration to be added in minutes (integer). Negative values
-            are ignored.
-        """
-        if duration > 0:
-            self.__duration += duration
-    
     def getEntryData(self):
         """
         Public method to get the entry data.
@@ -238,27 +296,3 @@
             self.__comment,
             self.__paused,
         )
-    
-    def getStartDateTime(self):
-        """
-        Public method to get the start date and time.
-        
-        @return start date and time (QDateTime)
-        """
-        return self.__startDateTime
-    
-    def getDuration(self):
-        """
-        Public slot to get the duration.
-        
-        @return duration (integer)
-        """
-        return self.__duration
-    
-    def getID(self):
-        """
-        Public method to get the ID of the entry.
-        
-        @return ID of the entry (integer)
-        """
-        return self.__id

eric ide

mercurial