147 act.setEnabled(len(self.entriesList.selectedItems()) != 0) |
147 act.setEnabled(len(self.entriesList.selectedItems()) != 0) |
148 menu.addAction(self.tr("Export All"), self.__exportEntries) |
148 menu.addAction(self.tr("Export All"), self.__exportEntries) |
149 menu.addSeparator() |
149 menu.addSeparator() |
150 menu.addAction(self.tr("Remove duplicates"), self.__removeDuplicates) |
150 menu.addAction(self.tr("Remove duplicates"), self.__removeDuplicates) |
151 menu.addAction(self.tr("Merge duplicates"), self.__mergeDuplicates) |
151 menu.addAction(self.tr("Merge duplicates"), self.__mergeDuplicates) |
152 menu.exec_(QCursor.pos()) |
152 menu.exec(QCursor.pos()) |
153 |
153 |
154 def __addEntry(self): |
154 def __addEntry(self): |
155 """ |
155 """ |
156 Private slot to manually add an entry. |
156 Private slot to manually add an entry. |
157 """ |
157 """ |
162 tasks.append(self.taskCombo.itemText(index)) |
162 tasks.append(self.taskCombo.itemText(index)) |
163 comments = [] |
163 comments = [] |
164 for index in range(self.commentCombo.count()): |
164 for index in range(self.commentCombo.count()): |
165 comments.append(self.commentCombo.itemText(index)) |
165 comments.append(self.commentCombo.itemText(index)) |
166 dlg = TimeTrackerEntryDialog(self.__tracker, None, tasks, comments) |
166 dlg = TimeTrackerEntryDialog(self.__tracker, None, tasks, comments) |
167 if dlg.exec_() == QDialog.Accepted: |
167 if dlg.exec() == QDialog.Accepted: |
168 self.__tracker.addTrackerEntry(*dlg.getData()) |
168 self.__tracker.addTrackerEntry(*dlg.getData()) |
169 |
169 |
170 def __editEntry(self): |
170 def __editEntry(self): |
171 """ |
171 """ |
172 Private slot to edit the selected tracker entry. |
172 Private slot to edit the selected tracker entry. |
185 comments = [] |
185 comments = [] |
186 for index in range(self.commentCombo.count()): |
186 for index in range(self.commentCombo.count()): |
187 comments.append(self.commentCombo.itemText(index)) |
187 comments.append(self.commentCombo.itemText(index)) |
188 dlg = TimeTrackerEntryDialog(self.__tracker, entry, tasks, |
188 dlg = TimeTrackerEntryDialog(self.__tracker, entry, tasks, |
189 comments) |
189 comments) |
190 if dlg.exec_() == QDialog.Accepted: |
190 if dlg.exec() == QDialog.Accepted: |
191 start, duration, task, comment = dlg.getData() |
191 start, duration, task, comment = dlg.getData() |
192 |
192 |
193 entry.setStartDateTime(start) |
193 entry.setStartDateTime(start) |
194 entry.setDuration(duration) |
194 entry.setDuration(duration) |
195 entry.setTask(task) |
195 entry.setTask(task) |