188 |
188 |
189 def __editEntry(self): |
189 def __editEntry(self): |
190 """ |
190 """ |
191 Private slot to edit the selected tracker entry. |
191 Private slot to edit the selected tracker entry. |
192 """ |
192 """ |
|
193 from .TimeTrackerEntryDialog import TimeTrackerEntryDialog |
|
194 |
193 itm = self.entriesList.selectedItems()[0] |
195 itm = self.entriesList.selectedItems()[0] |
194 eid = itm.data(0, Qt.ItemDataRole.UserRole) |
196 eid = itm.data(0, Qt.ItemDataRole.UserRole) |
195 if eid > -1: |
197 if eid > -1: |
196 # the current entry is edited via the elements of this widget |
198 # the current entry is edited via the elements of this widget |
197 entry = self.__tracker.getEntry(eid) |
199 entry = self.__tracker.getEntry(eid) |
198 if entry is not None: |
200 if entry is not None: |
199 from .TimeTrackerEntryDialog import TimeTrackerEntryDialog |
|
200 |
|
201 tasks = [ |
201 tasks = [ |
202 self.taskCombo.itemText(index) |
202 self.taskCombo.itemText(index) |
203 for index in range(self.taskCombo.count()) |
203 for index in range(self.taskCombo.count()) |
204 ] |
204 ] |
205 comments = [ |
205 comments = [ |
233 Private slot to delete the selected tracker entries. |
233 Private slot to delete the selected tracker entries. |
234 """ |
234 """ |
235 res = EricMessageBox.yesNo( |
235 res = EricMessageBox.yesNo( |
236 self, |
236 self, |
237 self.tr("Delete Selected Entries"), |
237 self.tr("Delete Selected Entries"), |
238 self.tr("""Do you really want to delete the selected""" """ entries?"""), |
238 self.tr("""Do you really want to delete the selected entries?"""), |
239 ) |
239 ) |
240 if res: |
240 if res: |
241 for item in self.entriesList.selectedItems(): |
241 for item in self.entriesList.selectedItems(): |
242 eid = item.data(0, Qt.ItemDataRole.UserRole) |
242 eid = item.data(0, Qt.ItemDataRole.UserRole) |
243 if eid > -1: |
243 if eid > -1: |
302 if QFileInfo(fname).exists(): |
302 if QFileInfo(fname).exists(): |
303 res = EricMessageBox.yesNo( |
303 res = EricMessageBox.yesNo( |
304 self, |
304 self, |
305 self.tr("Export Time Tracker Entries"), |
305 self.tr("Export Time Tracker Entries"), |
306 self.tr( |
306 self.tr( |
307 "<p>The file <b>{0}</b> already exists." " Overwrite it?</p>" |
307 "<p>The file <b>{0}</b> already exists. Overwrite it?</p>" |
308 ).format(fname), |
308 ).format(fname), |
309 icon=EricMessageBox.Warning, |
309 icon=EricMessageBox.Warning, |
310 ) |
310 ) |
311 if not res: |
311 if not res: |
312 return |
312 return |