From e05f31b70ccb1e04908a006a77d672157dd8ff6a Mon Sep 17 00:00:00 2001 From: linuswck Date: Thu, 19 Dec 2024 15:15:08 +0800 Subject: [PATCH] Disable OTA Update on client and gui --- .../linien-gui-fast-servo-rm-ota-update.patch | 43 +++++++++++++++++++ flake.nix | 4 ++ 2 files changed, 47 insertions(+) create mode 100644 fast-servo/linien-gui-fast-servo-rm-ota-update.patch diff --git a/fast-servo/linien-gui-fast-servo-rm-ota-update.patch b/fast-servo/linien-gui-fast-servo-rm-ota-update.patch new file mode 100644 index 0000000..7a23009 --- /dev/null +++ b/fast-servo/linien-gui-fast-servo-rm-ota-update.patch @@ -0,0 +1,43 @@ +diff --git a/linien_gui/ui/device_manager.py b/linien_gui/ui/device_manager.py +index e584825..16994ad 100644 +--- a/linien_gui/ui/device_manager.py ++++ b/linien_gui/ui/device_manager.py +@@ -109,19 +109,13 @@ class DeviceManager(QtWidgets.QMainWindow): + ) -> None: + loading_dialog.hide() + if not aborted: +- display_question = ( ++ # Fast Servo does not support OTA Update ++ display_error = ( + f"Server version ({remote_version}) does not match the client " +- f"({client_version}) version. Should the corresponding server " +- f"version be installed?" ++ f"({client_version}) version." ++ f"Please install a matching server and client version" + ) +- if question_dialog( +- self, display_question, "Install corresponding version?" +- ): +- show_installation_progress_widget( +- parent=self, +- device=device, +- callback=lambda: self.connect_to_device(device), +- ) ++ error_dialog(self, display_error) + + def handle_authentication_exception(): + loading_dialog.hide() +diff --git a/linien_gui/ui/main_window.py b/linien_gui/ui/main_window.py +index dad465e..8d6a0b4 100644 +--- a/linien_gui/ui/main_window.py ++++ b/linien_gui/ui/main_window.py +@@ -202,7 +202,8 @@ class MainWindow(QtWidgets.QMainWindow): + super().closeEvent(*args, **kwargs) + + def show_new_version_available(self): +- self.newVersionAvailableLabel.show() ++ # Fast Servo does not support OTA Update ++ pass + + def handle_key_press(self, key): + logger.debug(f"key pressed {key}") diff --git a/flake.nix b/flake.nix index bcf37a9..ade6a9e 100644 --- a/flake.nix +++ b/flake.nix @@ -202,6 +202,10 @@ pkgs.qt5.wrapQtAppsHook ]; + patches = [ + ./fast-servo/linien-gui-fast-servo-rm-ota-update.patch + ]; + # Makes qt-wayland appear in the qt paths injected by the wrapper - helps users # with `QT_QPA_PLATFORM=wayland` in their environment. buildInputs = [