def import_tasks(self): """Import the list of tasks from a .csv file.""" path = show_open_dialog(self, "Import Shots", "CSV (*.csv)") if not path: return with context_reset_model(self.model): self._manager.import_tasks(path)
def _on_import(self): """Import the list of artists from a .csv file.""" path = show_open_dialog(self, "Import Artists", "CSV (*.csv)") if not path: return with context_reset_model(self.model): self._manager.import_artists(path)
def _on_remove(self): """Remove selected artists from the list.""" artists = tuple(self._iter_selected()) if not artists: return with context_reset_model(self.model): self._manager.remove_artists(artists) self.artistDeleted.emit()
def remove_tasks(self): """Remove selected tasks from the list.""" tasks = tuple(self._iter_selected()) if not tasks: return with context_reset_model(self.model): self._manager.remove_tasks(tasks) self.taskDeleted.emit()
def add_task(self): """Add a task to the list.""" with context_reset_model(self.model): # TODO: Use _context_insert_row self._manager.add_task()
def _on_add(self): """Add an artist to the list.""" with context_reset_model(self.model): self._manager.add_artist()