TimeTracker/TimeTrackerWidget.py

changeset 15
645506ab3376
parent 14
25f7323b308d
child 31
db0afa672b75
diff -r 25f7323b308d -r 645506ab3376 TimeTracker/TimeTrackerWidget.py
--- a/TimeTracker/TimeTrackerWidget.py	Sun Oct 21 17:17:53 2012 +0200
+++ b/TimeTracker/TimeTrackerWidget.py	Sun Oct 21 19:23:08 2012 +0200
@@ -137,7 +137,15 @@
         """
         Private slot to manually add an entry.
         """
-        # TODO: implement this
+        tasks = []
+        for index in range(self.taskCombo.count()):
+            tasks.append(self.taskCombo.itemText(index))
+        comments = []
+        for index in range(self.commentCombo.count()):
+            comments.append(self.commentCombo.itemText(index))
+        dlg = TimeTrackerEntryDialog(self.__tracker, None, tasks, comments)
+        if dlg.exec_() == QDialog.Accepted:
+            self.__tracker.addTrackerEntry(*dlg.getData())
     
     def __editEntry(self):
         """
@@ -155,7 +163,7 @@
                 comments = []
                 for index in range(self.commentCombo.count()):
                     comments.append(self.commentCombo.itemText(index))
-                dlg = TimeTrackerEntryDialog(entry, tasks, comments)
+                dlg = TimeTrackerEntryDialog(self.__tracker, entry, tasks, comments)
                 if dlg.exec_() == QDialog.Accepted:
                     start, duration, task, comment = dlg.getData()
                     
@@ -165,7 +173,7 @@
                     entry.setComment(comment)
                     self.__tracker.entryChanged()
                     
-                    eid, date, time, duration, task, comment, paused = entry.getEntryData()
+                    date, time, duration, task, comment = entry.getEntryData()[1:-1]
                     itm.setText(0, self.tr("{0}, {1}", "date, time").format(date, time))
                     itm.setText(1, self.tr("{0} min").format(duration))
                     itm.setText(2, task)

eric ide

mercurial