diff --git a/docs/changes/4.1.3.md b/docs/changes/4.1.3.md index fa7d307f63..63f1e96ff2 100644 --- a/docs/changes/4.1.3.md +++ b/docs/changes/4.1.3.md @@ -41,6 +41,7 @@ Changes in command line arguments: - [NXDRIVE-1666](https://jira.nuxeo.com/browse/NXDRIVE-1666): Handle lock conflicts in DirectEdit - [NXDRIVE-1667](https://jira.nuxeo.com/browse/NXDRIVE-1667): Filter out any error in `get_opened_files()` - [NXDRIVE-1668](https://jira.nuxeo.com/browse/NXDRIVE-1668): Handle `TrashPermissionError` when moving a file to the trash +- [NXDRIVE-1672](https://jira.nuxeo.com/browse/NXDRIVE-1672): Ensure `Application.update_status()` is passed an Engine - [NXDRIVE-1677](https://jira.nuxeo.com/browse/NXDRIVE-1677): [Windows] Copy-paste and rename a local file while Drive is running does not work - [NXDRIVE-1682](https://jira.nuxeo.com/browse/NXDRIVE-1682): Make the updater more robust against inappropriate server response diff --git a/nxdrive/gui/application.py b/nxdrive/gui/application.py index f358a0365a..4e5fe2da5a 100644 --- a/nxdrive/gui/application.py +++ b/nxdrive/gui/application.py @@ -512,7 +512,7 @@ def _file_already_exists(self, oldpath: Path, newpath: Path) -> None: newpath.unlink() @pyqtSlot(object) - def dropped_engine(self, engine: "Engine") -> None: + def dropped_engine(self, engine: Engine) -> None: # Update icon in case the engine dropped was syncing self.change_systray_icon() @@ -570,7 +570,7 @@ def refresh_conflicts(self, uid: str) -> None: self.ignoreds_model.addFiles(self.api.get_unsynchronizeds(uid)) @pyqtSlot() - def show_conflicts_resolution(self, engine: "Engine") -> None: + def show_conflicts_resolution(self, engine: Engine) -> None: """ Display the conflicts/errors window. """ self.refresh_conflicts(engine.uid) self._window_root(self.conflicts_window).setEngine.emit(engine.uid) @@ -622,7 +622,7 @@ def destroyed_filters_dialog(self) -> None: self.filters_dlg = None @pyqtSlot() - def show_filters(self, engine: "Engine") -> None: + def show_filters(self, engine: Engine) -> None: if self.filters_dlg: self.filters_dlg.close() self.filters_dlg = None @@ -722,7 +722,7 @@ def auth() -> None: dialog.exec_() @pyqtSlot(object) - def _connect_engine(self, engine: "Engine") -> None: + def _connect_engine(self, engine: Engine) -> None: engine.syncStarted.connect(self.change_systray_icon) engine.syncCompleted.connect(self.change_systray_icon) engine.invalidAuthentication.connect(self.change_systray_icon) @@ -1251,15 +1251,18 @@ def _handle_connection(self) -> None: del con log.info("Successfully closed server socket") - def update_status(self, engine: "Engine") -> None: + def update_status(self, engine: Engine) -> None: """ Update the systray status for synchronization, conflicts/errors and software updates. """ sync_state = error_state = update_state = "" + if not isinstance(engine, Engine): + log.error(f"Need an Engine, got {engine!r}") + return + update_state = self.manager.updater.status - self.refresh_conflicts(engine.uid) # Check synchronization state if self.manager.restart_needed: