diff --git a/VERSION b/VERSION index 9084fa2..ab67981 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.1.0 +1.1.6 \ No newline at end of file diff --git a/gnome/bin/breezy_gnome_uninstall b/gnome/bin/breezy_gnome_uninstall index 4545d2d..004458c 100755 --- a/gnome/bin/breezy_gnome_uninstall +++ b/gnome/bin/breezy_gnome_uninstall @@ -34,7 +34,7 @@ DATA_DIR="$XDG_DATA_HOME/breezy_gnome" rm -rf $DATA_DIR [ "$for_install" -eq 0 ] && echo "Uninstalling the breezydesktop@xronlinux.com GNOME extension" -gnome-extensions uninstall breezydesktop@xronlinux.com +gnome-extensions uninstall breezydesktop@xronlinux.com || true [ "$for_install" -eq 0 ] && echo "Uninstalling the Breezy Desktop UI application" rm -rf $XDG_DATA_HOME/breezydesktop diff --git a/gnome/bin/setup b/gnome/bin/setup index ee5e694..2cf0a03 100755 --- a/gnome/bin/setup +++ b/gnome/bin/setup @@ -3,16 +3,21 @@ set -e check_command() { - if ! command -v "$1" &>/dev/null; then - echo "Please install \"$1\" and make sure it's available in your \$PATH, then rerun the setup." - exit 1 - fi + for cmd in "$@"; do + if command -v "$cmd" &>/dev/null; then + return + fi + done + + echo "Please install one of the following: ${*}, and make sure it's available in your \$PATH, then rerun the setup." + exit 1 } check_command "gnome-extensions" check_command "glib-compile-schemas" check_command "update-desktop-database" check_command "gtk-update-icon-cache" +check_command "python" "python3" # This script gets packaged with the release and should do the bulk of the setup work. This allows this setup to be tied # to a specific release of the code, and guarantees it will never run along-side newer or older binaries. @@ -97,6 +102,9 @@ glib-compile-schemas $XDG_DATA_HOME/glib-2.0/schemas update-desktop-database $XDG_DATA_HOME/applications gtk-update-icon-cache +# refresh bash session so new commands in the PATH are available +hash -r + # set up the XR driver using the local binary echo "Installing xrDriver" echo "BEGIN - xr_driver_setup" diff --git a/gnome/src/extension.js b/gnome/src/extension.js index 22dbe2f..a24370f 100644 --- a/gnome/src/extension.js +++ b/gnome/src/extension.js @@ -31,9 +31,14 @@ const SUPPORTED_MONITOR_PRODUCTS = [ NESTED_MONITOR_PRODUCT ]; +const BIN_HOME = GLib.getenv('XDG_BIN_HOME') || GLib.build_filenamev([GLib.get_home_dir(), '.local', 'bin']); +const XDG_CLI_PATH = GLib.build_filenamev([BIN_HOME, 'xr_driver_cli']); +const ALT_CLI_PATH = '/usr/bin/xr_driver_cli'; + class BreezyDesktopExtension { constructor(extensionPath) { this.path = extensionPath; + this.settings = ExtensionUtils.getSettings(); // Set/destroyed by enable/disable @@ -90,6 +95,15 @@ class BreezyDesktopExtension { this._headset_as_primary_binding = this.settings.bind('headset-as-primary', this._monitor_manager, 'headset-as-primary', Gio.SettingsBindFlags.DEFAULT); + this._cli_file = Gio.file_new_for_path(XDG_CLI_PATH); + if (!this._cli_file.query_exists(null)) { + this._cli_file = Gio.file_new_for_path(ALT_CLI_PATH); + if (!this._cli_file.query_exists(null)) { + this._cli_file = null; + Globals.logger.log('ERROR: BreezyDesktopExtension enable - xr_driver_cli not found'); + } + } + this._setup(); } catch (e) { Globals.logger.log(`ERROR: BreezyDesktopExtension enable ${e.message}\n${e.stack}`); @@ -472,15 +486,12 @@ class BreezyDesktopExtension { } _toggle_xr_effect() { + if (!this._cli_file) return; + Globals.logger.log_debug('BreezyDesktopExtension _toggle_xr_effect'); - const bin_home = GLib.getenv('XDG_BIN_HOME') || GLib.build_filenamev([GLib.get_home_dir(), '.local', 'bin']); - const cli_path = GLib.build_filenamev([bin_home, 'xr_driver_cli']); - - Globals.logger.log_debug(`BreezyDesktopExtension _toggle_xr_effect path: ${cli_path}`); - let proc = Gio.Subprocess.new( - ['bash', '-c', `${cli_path} --external-mode`], + ['bash', '-c', `${this._cli_file.get_path()} --external-mode`], Gio.SubprocessFlags.STDOUT_PIPE | Gio.SubprocessFlags.STDERR_PIPE ); @@ -496,7 +507,7 @@ class BreezyDesktopExtension { // use the CLI to change the external mode, avoid using disable/enable, otherwise the driver will // shut down and recalibrate each time proc = Gio.Subprocess.new( - ['bash', '-c', `${cli_path} --${enabled ? 'disable-external' : 'breezy-desktop'}`], + ['bash', '-c', `${this._cli_file.get_path()} --${enabled ? 'disable-external' : 'breezy-desktop'}`], Gio.SubprocessFlags.STDOUT_PIPE | Gio.SubprocessFlags.STDERR_PIPE ); [success, stdout, stderr] = proc.communicate_utf8(null, null); diff --git a/modules/XRLinuxDriver b/modules/XRLinuxDriver index 91a5d65..53002af 160000 --- a/modules/XRLinuxDriver +++ b/modules/XRLinuxDriver @@ -1 +1 @@ -Subproject commit 91a5d65c57a63a8003ef4f8a2c36bc519104d54c +Subproject commit 53002afde8406eef7fe309206268ad6dc39e2da6 diff --git a/modules/sombrero b/modules/sombrero index 0ddc237..76cb6bb 160000 --- a/modules/sombrero +++ b/modules/sombrero @@ -1 +1 @@ -Subproject commit 0ddc237b5b47208eb9f3f520177920f7ea157dfd +Subproject commit 76cb6bb65e90dfe2abf5bd2db8e280ae6e03d5c6 diff --git a/ui/modules/PyXRLinuxDriverIPC b/ui/modules/PyXRLinuxDriverIPC index e6ec3e3..c3b0dda 160000 --- a/ui/modules/PyXRLinuxDriverIPC +++ b/ui/modules/PyXRLinuxDriverIPC @@ -1 +1 @@ -Subproject commit e6ec3e309e63608552becff694e5f3c9d1e5bcc3 +Subproject commit c3b0ddab302e11e517b57b621ff334faf03173de diff --git a/ui/po/breezydesktop.pot b/ui/po/breezydesktop.pot index 36933f0..9e6475c 100644 --- a/ui/po/breezydesktop.pot +++ b/ui/po/breezydesktop.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-18 11:45-0700\n" +"POT-Creation-Date: 2024-10-23 11:32-0700\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -365,6 +365,24 @@ msgstr "" msgid "Breezy Desktop was unable to detect any supported XR devices." msgstr "" +#: src/gtk/no-device.ui:23 +msgid "Auto-enable XR effect" +msgstr "" + +#: src/gtk/no-device.ui:24 +msgid "" +"Automatically enable the Breezy Desktop XR effect when supported glasses are " +"connected." +msgstr "" + +#: src/gtk/no-device.ui:34 +msgid "Start in widescreen mode" +msgstr "" + +#: src/gtk/no-device.ui:35 +msgid "Widescreen mode is not supported for all glasses." +msgstr "" + #: src/gtk/no-driver.ui:13 msgid "No driver running" msgstr "" diff --git a/ui/po/de.po b/ui/po/de.po index e6409d3..415ed1f 100644 --- a/ui/po/de.po +++ b/ui/po/de.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-18 11:45-0700\n" +"POT-Creation-Date: 2024-10-22 13:27-0700\n" "PO-Revision-Date: 2024-08-02 20:54-0700\n" "Last-Translator: \n" "Language-Team: German \n" @@ -388,6 +388,26 @@ msgstr "Kein Gerät verbunden" msgid "Breezy Desktop was unable to detect any supported XR devices." msgstr "Breezy Desktop konnte kein unterstütztes XR-Gerät erkennen." +#: src/gtk/no-device.ui:23 +#, fuzzy +msgid "Auto-enable XR effect" +msgstr "XR-Effekt" + +#: src/gtk/no-device.ui:24 +msgid "" +"Automatically enable the Breezy Desktop XR effect when supported glasses are " +"connected." +msgstr "" + +#: src/gtk/no-device.ui:34 +#, fuzzy +msgid "Start in widescreen mode" +msgstr "Breitbildmodus" + +#: src/gtk/no-device.ui:35 +msgid "Widescreen mode is not supported for all glasses." +msgstr "" + #: src/gtk/no-driver.ui:13 msgid "No driver running" msgstr "Kein Treiber wird ausgeführt" diff --git a/ui/po/es.po b/ui/po/es.po index 5e104ce..1ab354e 100644 --- a/ui/po/es.po +++ b/ui/po/es.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-18 11:45-0700\n" +"POT-Creation-Date: 2024-10-22 13:27-0700\n" "PO-Revision-Date: 2024-08-02 20:55-0700\n" "Last-Translator: \n" "Language-Team: Spanish \n" @@ -238,13 +238,15 @@ msgstr "Atajos de teclado" #: src/gtk/connected-device.ui:218 msgid "XR Effect on/off shortcut" -msgstr "" +msgstr "Atajo encendido/apagado Efecto XR" #: src/gtk/connected-device.ui:219 msgid "" "Quickly enable or disable the XR Effect. You may need to enable the effect " "manually once in order to enable the shortcut." msgstr "" +"Activa o desactiva rápidamente el Efecto XR. Es posible que necesites activar " +"el efecto manualmente una vez para habilitar el atajo." #: src/gtk/connected-device.ui:238 src/gtk/connected-device.ui:267 #: src/gtk/connected-device.ui:296 src/gtk/connected-device.ui:325 @@ -345,11 +347,11 @@ msgstr "Predeterminado" #: src/gtk/connected-device.ui:425 msgid "Text Scaling" -msgstr "" +msgstr "Escalado de Texto" #: src/gtk/connected-device.ui:426 msgid "Scaling text below 1.0 will simulate a higher resolution display" -msgstr "" +msgstr "Escalando el texto por debajo de 1.0 simulará una pantalla de mayor resolución" #: src/gtk/failed-verification.ui:13 msgid "Breezy Desktop GNOME invalid setup" @@ -387,6 +389,26 @@ msgstr "No hay dispositivo conectado" msgid "Breezy Desktop was unable to detect any supported XR devices." msgstr "Breezy Desktop no pudo detectar ningún dispositivo XR compatible." +#: src/gtk/no-device.ui:23 +msgid "Auto-enable XR effect" +msgstr "Auto-activar efecto XR" + +#: src/gtk/no-device.ui:24 +msgid "" +"Automatically enable the Breezy Desktop XR effect when supported glasses are " +"connected." +msgstr "" +"Habilita automáticamente el efecto Breezy Desktop XR cuando se conectan gafas " +"compatibles." + +#: src/gtk/no-device.ui:34 +msgid "Start in widescreen mode" +msgstr "Empezar en modo pantalla ancha" + +#: src/gtk/no-device.ui:35 +msgid "Widescreen mode is not supported for all glasses." +msgstr "El modo pantalla ancha no está soportado en todas las gafas." + #: src/gtk/no-driver.ui:13 msgid "No driver running" msgstr "No se está ejecutando ningún controlador" diff --git a/ui/po/fr.po b/ui/po/fr.po index 9bd381a..1b1c543 100644 --- a/ui/po/fr.po +++ b/ui/po/fr.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-18 11:45-0700\n" +"POT-Creation-Date: 2024-10-22 13:27-0700\n" "PO-Revision-Date: 2024-08-02 20:54-0700\n" "Last-Translator: \n" "Language-Team: French \n" @@ -392,6 +392,26 @@ msgstr "Aucun appareil connecté" msgid "Breezy Desktop was unable to detect any supported XR devices." msgstr "Breezy Desktop n'a pas pu détecter d'appareils XR pris en charge." +#: src/gtk/no-device.ui:23 +#, fuzzy +msgid "Auto-enable XR effect" +msgstr "Effet XR" + +#: src/gtk/no-device.ui:24 +msgid "" +"Automatically enable the Breezy Desktop XR effect when supported glasses are " +"connected." +msgstr "" + +#: src/gtk/no-device.ui:34 +#, fuzzy +msgid "Start in widescreen mode" +msgstr "Mode grand écran" + +#: src/gtk/no-device.ui:35 +msgid "Widescreen mode is not supported for all glasses." +msgstr "" + #: src/gtk/no-driver.ui:13 msgid "No driver running" msgstr "Aucun pilote en cours d'exécution" diff --git a/ui/po/it.po b/ui/po/it.po index 1ec6e0d..953e96c 100644 --- a/ui/po/it.po +++ b/ui/po/it.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-18 11:45-0700\n" +"POT-Creation-Date: 2024-10-22 13:27-0700\n" "PO-Revision-Date: 2024-08-02 21:14-0700\n" "Last-Translator: \n" "Language-Team: Italian \n" @@ -365,6 +365,24 @@ msgstr "" msgid "Breezy Desktop was unable to detect any supported XR devices." msgstr "" +#: src/gtk/no-device.ui:23 +msgid "Auto-enable XR effect" +msgstr "" + +#: src/gtk/no-device.ui:24 +msgid "" +"Automatically enable the Breezy Desktop XR effect when supported glasses are " +"connected." +msgstr "" + +#: src/gtk/no-device.ui:34 +msgid "Start in widescreen mode" +msgstr "" + +#: src/gtk/no-device.ui:35 +msgid "Widescreen mode is not supported for all glasses." +msgstr "" + #: src/gtk/no-driver.ui:13 msgid "No driver running" msgstr "" diff --git a/ui/po/ja.po b/ui/po/ja.po index 7948bf6..5f735f9 100644 --- a/ui/po/ja.po +++ b/ui/po/ja.po @@ -11,7 +11,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-18 11:45-0700\n" +"POT-Creation-Date: 2024-10-22 13:27-0700\n" "PO-Revision-Date: 2024-08-02 20:55-0700\n" "Last-Translator: \n" "Language-Team: Japanese \n" @@ -29,7 +29,7 @@ msgstr "メガネを3Dモードに切り替え、表示の幅を2倍にします #: src/connecteddevice.py:18 msgid "This feature is not currently supported for your device." -msgstr "この機能は現在接続されているデバイスではサポートされていません。" +msgstr "現在接続されているデバイスはこの機能に対応していません。" #: src/licensedialogcontent.py:63 msgid "Paid Tier Status" @@ -241,13 +241,15 @@ msgstr "キーボードショートカット" #: src/gtk/connected-device.ui:218 msgid "XR Effect on/off shortcut" -msgstr "" +msgstr "XRエフェクトの切り替え" #: src/gtk/connected-device.ui:219 msgid "" "Quickly enable or disable the XR Effect. You may need to enable the effect " "manually once in order to enable the shortcut." msgstr "" +"XRエフェクトの有効・無効を切り替えます。このショートカットを有効にするために" +"手動で1回XRエフェクトを有効にする必要があります。" #: src/gtk/connected-device.ui:238 src/gtk/connected-device.ui:267 #: src/gtk/connected-device.ui:296 src/gtk/connected-device.ui:325 @@ -386,7 +388,25 @@ msgstr "デバイスが接続されていません" #: src/gtk/no-device.ui:14 msgid "Breezy Desktop was unable to detect any supported XR devices." -msgstr "Breezy DesktopはサポートされているXRデバイスを検出できませんでした。" +msgstr "Breezy Desktopは対応しているXRデバイスを検出できませんでした。" + +#: src/gtk/no-device.ui:23 +msgid "Auto-enable XR effect" +msgstr "XRエフェクトの自動有効化" + +#: src/gtk/no-device.ui:24 +msgid "" +"Automatically enable the Breezy Desktop XR effect when supported glasses are " +"connected." +msgstr "対応メガネを接続するとBreezy DesktopのXRエフェクトを自動的に開始します。" + +#: src/gtk/no-device.ui:34 +msgid "Start in widescreen mode" +msgstr "ワイドスクリーンモードで起動" + +#: src/gtk/no-device.ui:35 +msgid "Widescreen mode is not supported for all glasses." +msgstr "ワイドスクリーンモードはすべてのメガネで対応しているわけではありません。" #: src/gtk/no-driver.ui:13 msgid "No driver running" diff --git a/ui/po/mo/es/LC_MESSAGES/breezydesktop.mo b/ui/po/mo/es/LC_MESSAGES/breezydesktop.mo index 7501bc7..e63ac9c 100644 Binary files a/ui/po/mo/es/LC_MESSAGES/breezydesktop.mo and b/ui/po/mo/es/LC_MESSAGES/breezydesktop.mo differ diff --git a/ui/po/mo/ja/LC_MESSAGES/breezydesktop.mo b/ui/po/mo/ja/LC_MESSAGES/breezydesktop.mo index 69a3de7..b039e79 100644 Binary files a/ui/po/mo/ja/LC_MESSAGES/breezydesktop.mo and b/ui/po/mo/ja/LC_MESSAGES/breezydesktop.mo differ diff --git a/ui/po/mo/zh_CN/LC_MESSAGES/breezydesktop.mo b/ui/po/mo/zh_CN/LC_MESSAGES/breezydesktop.mo index 1c28de9..6e6ddf1 100644 Binary files a/ui/po/mo/zh_CN/LC_MESSAGES/breezydesktop.mo and b/ui/po/mo/zh_CN/LC_MESSAGES/breezydesktop.mo differ diff --git a/ui/po/pl.po b/ui/po/pl.po index 4d3d8d0..0b599c8 100644 --- a/ui/po/pl.po +++ b/ui/po/pl.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-18 11:45-0700\n" +"POT-Creation-Date: 2024-10-22 13:27-0700\n" "PO-Revision-Date: 2024-08-16 10:26-0700\n" "Last-Translator: \n" "Language-Team: Polish \n" @@ -366,6 +366,24 @@ msgstr "" msgid "Breezy Desktop was unable to detect any supported XR devices." msgstr "" +#: src/gtk/no-device.ui:23 +msgid "Auto-enable XR effect" +msgstr "" + +#: src/gtk/no-device.ui:24 +msgid "" +"Automatically enable the Breezy Desktop XR effect when supported glasses are " +"connected." +msgstr "" + +#: src/gtk/no-device.ui:34 +msgid "Start in widescreen mode" +msgstr "" + +#: src/gtk/no-device.ui:35 +msgid "Widescreen mode is not supported for all glasses." +msgstr "" + #: src/gtk/no-driver.ui:13 msgid "No driver running" msgstr "" diff --git a/ui/po/pt_BR.po b/ui/po/pt_BR.po index d508026..1ca89cc 100644 --- a/ui/po/pt_BR.po +++ b/ui/po/pt_BR.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-18 11:45-0700\n" +"POT-Creation-Date: 2024-10-22 13:27-0700\n" "PO-Revision-Date: 2024-08-19 09:39-0700\n" "Last-Translator: \n" "Language-Team: Brazilian Portuguese \n" "Language-Team: Russian \n" @@ -389,6 +389,26 @@ msgstr "Устройство не подключено" msgid "Breezy Desktop was unable to detect any supported XR devices." msgstr "Breezy Desktop не смог обнаружить никаких поддерживаемых устройств XR." +#: src/gtk/no-device.ui:23 +#, fuzzy +msgid "Auto-enable XR effect" +msgstr "Эффект XR" + +#: src/gtk/no-device.ui:24 +msgid "" +"Automatically enable the Breezy Desktop XR effect when supported glasses are " +"connected." +msgstr "" + +#: src/gtk/no-device.ui:34 +#, fuzzy +msgid "Start in widescreen mode" +msgstr "Режим широкого экрана" + +#: src/gtk/no-device.ui:35 +msgid "Widescreen mode is not supported for all glasses." +msgstr "" + #: src/gtk/no-driver.ui:13 msgid "No driver running" msgstr "Драйвер не запущен" diff --git a/ui/po/sv.po b/ui/po/sv.po index ba37c96..2fbe58b 100644 --- a/ui/po/sv.po +++ b/ui/po/sv.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-18 11:45-0700\n" +"POT-Creation-Date: 2024-10-22 13:27-0700\n" "PO-Revision-Date: 2024-08-16 10:31-0700\n" "Last-Translator: \n" "Language-Team: Swedish \n" @@ -383,6 +383,26 @@ msgstr "Inget enhet ansluten" msgid "Breezy Desktop was unable to detect any supported XR devices." msgstr "Breezy Desktop kunde inte upptäcka enheter som stöder XR." +#: src/gtk/no-device.ui:23 +#, fuzzy +msgid "Auto-enable XR effect" +msgstr "XR-effekt" + +#: src/gtk/no-device.ui:24 +msgid "" +"Automatically enable the Breezy Desktop XR effect when supported glasses are " +"connected." +msgstr "" + +#: src/gtk/no-device.ui:34 +#, fuzzy +msgid "Start in widescreen mode" +msgstr "Bredbildsläge" + +#: src/gtk/no-device.ui:35 +msgid "Widescreen mode is not supported for all glasses." +msgstr "" + #: src/gtk/no-driver.ui:13 msgid "No driver running" msgstr "Inget drivrutin köres" diff --git a/ui/po/uk_UA.po b/ui/po/uk_UA.po index f03b93c..4189b2f 100644 --- a/ui/po/uk_UA.po +++ b/ui/po/uk_UA.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-18 11:45-0700\n" +"POT-Creation-Date: 2024-10-22 13:27-0700\n" "PO-Revision-Date: 2024-08-17 10:08-0700\n" "Last-Translator: \n" "Language-Team: Ukrainian \n" @@ -386,6 +386,26 @@ msgstr "Жоден пристрій не підключено" msgid "Breezy Desktop was unable to detect any supported XR devices." msgstr "Breezy Desktop не зміг виявити жодного підтримуваного XR пристрою." +#: src/gtk/no-device.ui:23 +#, fuzzy +msgid "Auto-enable XR effect" +msgstr "Ефект XR" + +#: src/gtk/no-device.ui:24 +msgid "" +"Automatically enable the Breezy Desktop XR effect when supported glasses are " +"connected." +msgstr "" + +#: src/gtk/no-device.ui:34 +#, fuzzy +msgid "Start in widescreen mode" +msgstr "Режим широкого екрану" + +#: src/gtk/no-device.ui:35 +msgid "Widescreen mode is not supported for all glasses." +msgstr "" + #: src/gtk/no-driver.ui:13 msgid "No driver running" msgstr "Жоден драйвер не запущений" diff --git a/ui/po/zh_CN.po b/ui/po/zh_CN.po index f40dc97..074ecd6 100644 --- a/ui/po/zh_CN.po +++ b/ui/po/zh_CN.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-18 11:45-0700\n" +"POT-Creation-Date: 2024-10-22 13:27-0700\n" "PO-Revision-Date: 2024-08-02 20:55-0700\n" "Last-Translator: \n" "Language-Team: Chinese (simplified) \n" @@ -20,296 +20,297 @@ msgstr "" msgid "" "Switches your glasses into side-by-side mode and doubles the width of the " "display." -msgstr "" +msgstr "切换到并排模式,并将显示宽度翻倍。" #: src/connecteddevice.py:18 msgid "This feature is not currently supported for your device." -msgstr "" +msgstr "您的设备目前不支援此功能。" #: src/licensedialogcontent.py:63 msgid "Paid Tier Status" -msgstr "" +msgstr "订阅等级状态" #: src/licensedialogcontent.py:71 msgid "Feature Availability" -msgstr "" +msgstr "功能可用性" #: src/licensefeaturerow.py:15 src/shortcutdialog.py:107 msgid "Disabled" -msgstr "" +msgstr "已禁用" #: src/licensefeaturerow.py:18 msgid "In trial" -msgstr "" +msgstr "试用中" #: src/licensefeaturerow.py:18 msgid "Enabled" -msgstr "" +msgstr "已启用" #: src/licensefeaturerow.py:24 src/licensetierrow.py:30 #, python-brace-format msgid " ({time_remaining} remaining)" -msgstr "" +msgstr " (剩下 {time_remaining})" #: src/licensefeaturerow.py:32 msgid "Side-by-side mode (gaming)" -msgstr "" +msgstr "并排模式(游戏)" #: src/licensefeaturerow.py:33 msgid "Smooth Follow (gaming)" -msgstr "" +msgstr "平顺跟随(游戏)" #: src/licensefeaturerow.py:34 msgid "Breezy Desktop (productivity)" -msgstr "" +msgstr "Breezy Desktop (生产力)" #: src/licensetierrow.py:24 msgid "Active" -msgstr "" +msgstr "已订阅" #: src/licensetierrow.py:24 msgid "Inactive" -msgstr "" +msgstr "未订阅" #: src/licensetierrow.py:41 -#, python-brace-format +#, fuzzy, python-brace-format msgid "${amount} USD" -msgstr "" +msgstr "${amount} 美元" #: src/licensetierrow.py:43 msgid " to renew" -msgstr "" +msgstr "续订" #: src/licensetierrow.py:45 msgid " to upgrade" -msgstr "" +msgstr "升级" #: src/licensetierrow.py:47 msgid "Paid through next renewal period" -msgstr "" +msgstr "已付费至下个续订期" #: src/licensetierrow.py:56 msgid "Gaming" -msgstr "" +msgstr "游戏" #: src/licensetierrow.py:57 msgid "Productivity" -msgstr "" +msgstr "生产力" #: src/licensetierrow.py:63 msgid " - renewing monthly" -msgstr "" +msgstr " - 每月续订" #: src/licensetierrow.py:64 msgid " - renewing yearly" -msgstr "" +msgstr " - 每年续订" #: src/licensetierrow.py:65 msgid "with lifetime access" -msgstr "" +msgstr "终身会员" #: src/licensetierrow.py:72 msgid "Monthly" -msgstr "" +msgstr "每月" #: src/licensetierrow.py:73 msgid "Yearly" -msgstr "" +msgstr "每年" #: src/licensetierrow.py:74 msgid "Lifetime" -msgstr "" +msgstr "终身" #: src/time.py:14 msgid "less than an hour" -msgstr "" +msgstr "不到一个小时" #: src/time.py:17 msgid "1 hour" -msgstr "" +msgstr "1小时" #: src/time.py:17 #, python-brace-format msgid "{time_remaining} hours" -msgstr "" +msgstr "{time_remaining} 小时" #: src/time.py:20 msgid "1 day" -msgstr "" +msgstr "1天" #: src/time.py:20 #, python-brace-format msgid "{time_remaining} days" -msgstr "" +msgstr "{time_remaining} 天" #: src/gtk/connected-device.ui:21 msgid "connected" -msgstr "" +msgstr "已连接" #: src/gtk/connected-device.ui:31 msgid "General Settings" -msgstr "" +msgstr "通用设定" #: src/gtk/connected-device.ui:41 msgid "Features" -msgstr "" +msgstr "功能" #: src/gtk/connected-device.ui:44 msgid "XR effect" -msgstr "" +msgstr "XR 效果" #: src/gtk/connected-device.ui:45 msgid "Enables the Breezy Desktop XR effect." -msgstr "" +msgstr "启用 Breezy Desktop XR 效果。" #: src/gtk/connected-device.ui:55 msgid "Widescreen mode" -msgstr "" +msgstr "宽屏模式" #: src/gtk/connected-device.ui:66 msgid "Follow mode" -msgstr "" +msgstr "跟随模式" #: src/gtk/connected-device.ui:67 msgid "Keep the virtual display near the center of your view." -msgstr "" +msgstr "虚拟显示保持在视野中心。" #: src/gtk/connected-device.ui:77 msgid "Curved display" -msgstr "" +msgstr "曲面显示" #: src/gtk/connected-device.ui:78 msgid "Switch between flat and curved displays." -msgstr "" +msgstr "平板和曲面显示模式之间切换。" #: src/gtk/connected-device.ui:91 msgid "Adjustments" -msgstr "" +msgstr "调整" #: src/gtk/connected-device.ui:94 msgid "Display distance" -msgstr "" +msgstr "显示距离" #: src/gtk/connected-device.ui:95 msgid "" "Closer appears larger, further appears smaller. Controls depth when in " "widescreen mode." -msgstr "" +msgstr "距离近看起来大,距离远看起来小。调整使用宽屏模式时的深度。" #: src/gtk/connected-device.ui:123 msgid "Display size" -msgstr "" +msgstr "显示大小" #: src/gtk/connected-device.ui:124 msgid "" "Combine with display distance to achieve a comfortable level of depth and " "size." -msgstr "" +msgstr "可以跟显示距离一起配合来实现舒适的深度和大小。" #: src/gtk/connected-device.ui:152 msgid "Display toggle distances" -msgstr "" +msgstr "显示距离立刻切换" #: src/gtk/connected-device.ui:153 msgid "" "Use the buttons to capture the current display distance for use with the " "keyboard shortcut." -msgstr "" +msgstr "使用按钮记住当时的显示距离,以设成键盘快捷键。" #: src/gtk/connected-device.ui:178 msgid "Follow threshold" -msgstr "" +msgstr "跟随阈值" #: src/gtk/connected-device.ui:179 msgid "How far away you can look before the display follows." -msgstr "" +msgstr "示屏进行跟随前可以看得多远。" #: src/gtk/connected-device.ui:209 src/gtk/connected-device.ui:215 msgid "Keyboard Shortcuts" -msgstr "" +msgstr "键盘快捷键" #: src/gtk/connected-device.ui:218 msgid "XR Effect on/off shortcut" -msgstr "" +msgstr "XR效果 开/关 快捷键" #: src/gtk/connected-device.ui:219 msgid "" "Quickly enable or disable the XR Effect. You may need to enable the effect " "manually once in order to enable the shortcut." -msgstr "" +msgstr "快速将XR效果打开/关闭。 效果可能需要手动开一次才能设成快捷键" #: src/gtk/connected-device.ui:238 src/gtk/connected-device.ui:267 #: src/gtk/connected-device.ui:296 src/gtk/connected-device.ui:325 msgid "Change" -msgstr "" +msgstr "更改" #: src/gtk/connected-device.ui:247 msgid "Re-center display shortcut" -msgstr "" +msgstr "重新居中显示快捷键" #: src/gtk/connected-device.ui:248 msgid "Pin the virtual display to the current position." -msgstr "" +msgstr "将虚拟显示固定在当前位置。" #: src/gtk/connected-device.ui:276 msgid "Display distance shortcut" -msgstr "" +msgstr "显示距离快捷键" #: src/gtk/connected-device.ui:277 msgid "Quickly toggle between two predefined distances." -msgstr "" +msgstr "快速地在两个预定的距离之间切换。" #: src/gtk/connected-device.ui:305 msgid "Toggle follow mode shortcut" -msgstr "" +msgstr "切换跟随模式快捷键" #: src/gtk/connected-device.ui:306 msgid "Quickly toggle follow mode." -msgstr "" +msgstr "快速切换跟随模式。" #: src/gtk/connected-device.ui:341 src/gtk/connected-device.ui:347 msgid "Advanced Settings" -msgstr "" +msgstr "高级设定" #: src/gtk/connected-device.ui:350 msgid "Find optimal display config" -msgstr "" +msgstr "寻找最佳显示设定" #: src/gtk/connected-device.ui:351 msgid "" "Automatically modify the glasses display configuration for maximum " "resolution and best scaling when plugged in." -msgstr "" +msgstr "连接时,可以自动修改眼镜显示设定以表现出最大解析度和最佳的对比。" #: src/gtk/connected-device.ui:361 msgid "Use highest refresh rate" -msgstr "" +msgstr "使用最高刷新率" #: src/gtk/connected-device.ui:362 msgid "Refresh rate may affect performance, disable this to set it manually." -msgstr "" +msgstr "刷新率可能会影响性能,禁用此功能即可手动设定。" #: src/gtk/connected-device.ui:372 msgid "Always primary display" -msgstr "" +msgstr "每次设置为主要显示" #: src/gtk/connected-device.ui:373 msgid "Automatically set the glasses as the primary display when plugged in." -msgstr "" +msgstr "连结时,自动将眼镜设置为主要显示。" #: src/gtk/connected-device.ui:383 msgid "Fast SBS mode switching" -msgstr "" +msgstr "快速 并排模式切换" #: src/gtk/connected-device.ui:384 msgid "" "Switches glasses to SBS mode immediately when plugged in, if widescreen mode " "is on. May cause instability." msgstr "" +"连结时,如果宽屏模式开启,眼镜会立即切换到 并排模式。这可能会导致不稳定。" #: src/gtk/connected-device.ui:394 msgid "Movement look-ahead" -msgstr "" +msgstr "移动预测" #: src/gtk/connected-device.ui:395 msgid "" @@ -317,56 +318,78 @@ msgid "" "time. Stick with default unless virtual display drags behind your head " "movements, jumps ahead, or is very shaky." msgstr "" +"透过预测头追踪位置来抵消输入延迟,预测时间超过渲染时间。" +"除非虚拟显示屏会落后,提前跳动,或者会抖,请尽量使用预设设定。" #: src/gtk/connected-device.ui:413 msgid "Default" -msgstr "" +msgstr "默认" #: src/gtk/connected-device.ui:425 msgid "Text Scaling" -msgstr "" +msgstr "字体大小比例" #: src/gtk/connected-device.ui:426 msgid "Scaling text below 1.0 will simulate a higher resolution display" -msgstr "" +msgstr "字体少于1.0则模拟解析度高的显示" #: src/gtk/failed-verification.ui:13 msgid "Breezy Desktop GNOME invalid setup" -msgstr "" +msgstr "Breezy Desktop GNOME 无效设置" #: src/gtk/failed-verification.ui:14 msgid "" "Your Breezy GNOME setup is invalid or incomplete. Please re-run the setup " "script. Report this issue if it persists." msgstr "" +"您的 Breezy GNOME 设置无效或不完整。请重新运行设置脚本。如果问题仍然存在,请" +"报告此问题。" #: src/gtk/license-dialog-content.ui:15 msgid "Donate" -msgstr "" +msgstr "捐赠" #: src/gtk/license-dialog-content.ui:31 msgid "Request a token" -msgstr "" +msgstr "申请令牌" #: src/gtk/license-dialog-content.ui:39 msgid "Verify token" -msgstr "" +msgstr "令牌验证" #: src/gtk/license-dialog.ui:5 src/gtk/window.ui:91 msgid "License Details" -msgstr "" +msgstr "许可证详细信息" #: src/gtk/no-device.ui:13 msgid "No device connected" -msgstr "" +msgstr "未连接设备" #: src/gtk/no-device.ui:14 msgid "Breezy Desktop was unable to detect any supported XR devices." -msgstr "" +msgstr "Breezy Desktop 无法检测到任何支援的 XR 设备。" + +#: src/gtk/no-device.ui:23 +msgid "Auto-enable XR effect" +msgstr "自动启动XR效果" + +#: src/gtk/no-device.ui:24 +msgid "" +"Automatically enable the Breezy Desktop XR effect when supported glasses are " +"connected." +msgstr "当支援的设备已连接,将BREEZY DESKTOP XR效果自动启动" + +#: src/gtk/no-device.ui:34 +msgid "Start in widescreen mode" +msgstr "使用宽屏模式以启动软件" + +#: src/gtk/no-device.ui:35 +msgid "Widescreen mode is not supported for all glasses." +msgstr "宽屏模式不支援每一个型号的XR眼睛" #: src/gtk/no-driver.ui:13 msgid "No driver running" -msgstr "" +msgstr "未运行驱动程序" #: src/gtk/no-driver.ui:14 msgid "" @@ -379,20 +402,29 @@ msgid "" "in the #troubleshooting channel on Discord.\n" " " msgstr "" +"\n" +" 如果您透过 AUR 安装,请确保运行推荐的后安装命令:\n" +" systemctl --user enable --now xr-driver.service\n" +"\n" +" 否则,请在 GitHub 上提交问题,或在 Discord 的 #troubleshooting 频道中创建新" +"主题。\n" +" " #: src/gtk/no-extension.ui:13 msgid "Breezy Desktop GNOME extension not ready" -msgstr "" +msgstr "Breezy Desktop GNOME 扩展未准备好" #: src/gtk/no-extension.ui:14 msgid "" "If you have just run the setup, then you may need to log out and back in to " "use it. Otherwise, please follow the Breezy GNOME setup instructions." msgstr "" +"如果您刚运行设置,则可能需要注销并重新登录才能使用它。否则,请按照 Breezy " +"GNOME 设置说明进行操作。" #: src/gtk/no-license.ui:13 msgid "No license file was found" -msgstr "" +msgstr "未找到许可证文件" #: src/gtk/no-license.ui:14 msgid "" @@ -409,43 +441,52 @@ msgid "" "lifetime access).\n" " " msgstr "" +"\n" +" 首次使用 Breezy Desktop 时,需要互联网连接以获取设备许可证。\n" +" \n" +" 不要担心,您无需立即捐赠。如果您尚未捐赠,您将获得试用许可证,以便您可以决" +"定 Breezy Desktop 是否适合您的需求。 \n" +" \n" +" 获得许可证后,无论是试用还是付费,您都可以离线使用 Breezy Desktop(直到功能" +"过期,如果您选择了终身访问,则可以无限期使用)。\n" +" " #: src/gtk/no-license.ui:27 msgid "Try Again" -msgstr "" +msgstr "重新尝试" #: src/gtk/shortcut-dialog.ui:5 msgid "Assign Keyboard Shortcut" -msgstr "" +msgstr "分配键盘快捷键" #: src/gtk/shortcut-dialog.ui:20 msgid "Press your keyboard shortcut or 'Backspace' to disable..." -msgstr "" +msgstr "按下键盘快捷键或 'Backspace' 禁用..." #: src/gtk/window.ui:10 msgid "Breezy Desktop" -msgstr "" +msgstr "Breezy Desktop" #: src/gtk/window.ui:23 msgid "Menu" -msgstr "" +msgstr "菜单" #: src/gtk/window.ui:43 msgid "Some features expire soon" -msgstr "" +msgstr "某些功能即将过期" #: src/gtk/window.ui:51 src/gtk/window.ui:76 msgid "View details" -msgstr "" +msgstr "查看详细信息" #: src/gtk/window.ui:68 msgid "Productivity features are disabled" -msgstr "" +msgstr "生产力功能已禁用" #: src/gtk/window.ui:95 msgid "Force Reset" -msgstr "" +msgstr "强制重置" #: src/gtk/window.ui:99 msgid "About BreezyDesktop" -msgstr "" +msgstr "关于 Breezy Desktop" diff --git a/ui/src/breezydesktop.in b/ui/src/breezydesktop.in index bbd44d3..2729644 100755 --- a/ui/src/breezydesktop.in +++ b/ui/src/breezydesktop.in @@ -1,4 +1,4 @@ -#!@PYTHON@ +#!/usr/bin/env python3 # breezydesktop.in # diff --git a/ui/src/configmanager.py b/ui/src/configmanager.py new file mode 100644 index 0000000..37c6b18 --- /dev/null +++ b/ui/src/configmanager.py @@ -0,0 +1,64 @@ +import sys +import threading +from gi.repository import GObject +from .xrdriveripc import XRDriverIPC + +class ConfigManager(GObject.GObject): + __gproperties__ = { + 'breezy-desktop-enabled': (bool, 'Breezy Desktop Enabled', 'Whether Breezy Desktop is enabled', False, GObject.ParamFlags.READWRITE), + } + + _instance = None + + @staticmethod + def get_instance(): + if not ConfigManager._instance: + ConfigManager._instance = ConfigManager() + + return ConfigManager._instance + + @staticmethod + def destroy_instance(): + if ConfigManager._instance: + ConfigManager._instance.stop() + ConfigManager._instance = None + + def __init__(self): + GObject.GObject.__init__(self) + self.ipc = XRDriverIPC.get_instance() + self.breezy_desktop_enabled = None + self._running = True + self._refresh_config() + + def stop(self): + self._running = False + + def _refresh_config(self): + self.config = self.ipc.retrieve_config(False) + if self._is_breezy_desktop_enabled() != self.breezy_desktop_enabled: + self.set_property('breezy-desktop-enabled', self._is_breezy_desktop_enabled()) + + if self._running: threading.Timer(1.0, self._refresh_config).start() + + def _is_breezy_desktop_enabled(self): + return self.config.get('disabled') == False and 'breezy_desktop' in self.config.get('external_mode', []) + + def _set_breezy_desktop_enabled(self, value): + if value: + self.config['disabled'] = False + self.config['output_mode'] = 'external_only' + self.config['external_mode'] = ['breezy_desktop'] + self.ipc.write_config(self.config) + else: + self.config['external_mode'] = [] + self.ipc.write_config(self.config) + + self.breezy_desktop_enabled = value + + def do_set_property(self, prop, value): + if prop.name == 'breezy-desktop-enabled': + self._set_breezy_desktop_enabled(value) + + def do_get_property(self, prop): + if prop.name == 'breezy-desktop-enabled': + return self.breezy_desktop_enabled \ No newline at end of file diff --git a/ui/src/connecteddevice.py b/ui/src/connecteddevice.py index 9554dcd..efe638e 100644 --- a/ui/src/connecteddevice.py +++ b/ui/src/connecteddevice.py @@ -1,4 +1,5 @@ from gi.repository import Gio, Gtk, GObject +from .configmanager import ConfigManager from .extensionsmanager import ExtensionsManager from .license import BREEZY_GNOME_FEATURES from .settingsmanager import SettingsManager @@ -6,7 +7,6 @@ from .shortcutdialog import bind_shortcut_settings from .statemanager import StateManager from .xrdriveripc import XRDriverIPC import gettext -import threading _ = gettext.gettext @@ -100,16 +100,18 @@ class ConnectedDevice(Gtk.Box): self.follow_mode_switch.set_active(self.state_manager.get_property('follow-mode')) self.follow_mode_switch.connect('notify::active', self._refresh_follow_mode) + self.effect_enable_switch.connect('notify::active', self._handle_switch_enabled_state) - self._refresh_enabled_state(); - self.effect_enable_switch.connect('notify::active', self._handle_enabled_state) + self.config_manager = ConfigManager.get_instance() + self.config_manager.connect('notify::breezy-desktop-enabled', self._handle_enabled_config) self.use_optimal_monitor_config_switch.connect('notify::active', self._refresh_use_optimal_monitor_config) self._handle_enabled_features(self.state_manager, None) self._handle_device_supports_sbs(self.state_manager, None) - self._handle_enabled_state(self.effect_enable_switch, None) + self._handle_enabled_config(None, None) self._refresh_use_optimal_monitor_config(self.use_optimal_monitor_config_switch, None) + self.extensions_manager.connect('notify::breezy-enabled', self._handle_enabled_config) self.connect("destroy", self._on_widget_destroy) @@ -126,30 +128,20 @@ class ConnectedDevice(Gtk.Box): self.widescreen_mode_switch.set_sensitive(state_manager.get_property('device-supports-sbs')) subtitle = self.widescreen_mode_subtitle if state_manager.get_property('device-supports-sbs') else self.widescreen_mode_not_supported_subtitle self.widescreen_mode_row.set_subtitle(subtitle) - - def _refresh_enabled_state(self): - enabled = self._is_config_enabled(self.ipc.retrieve_config()) and self.extensions_manager.is_enabled() + + def _handle_enabled_config(self, object, val): + enabled = self.config_manager.get_property('breezy-desktop-enabled') and self.extensions_manager.get_property('breezy-enabled') if enabled != self.effect_enable_switch.get_active(): self.effect_enable_switch.set_active(enabled) - - if self.active: threading.Timer(1.0, self._refresh_enabled_state).start() - - def _is_config_enabled(self, config): - return config.get('disabled') == False and 'breezy_desktop' in config.get('external_mode', []) - def _handle_enabled_state(self, switch, param): + def _handle_switch_enabled_state(self, switch, param): requesting_enabled = switch.get_active() - config = self.ipc.retrieve_config(False) + + # never turn off the extension, disabling the effect is done via configs only if requesting_enabled: self.extensions_manager.set_property('breezy-enabled', True) - if not self._is_config_enabled(config): - config['disabled'] = False - config['output_mode'] = 'external_only' - config['external_mode'] = ['breezy_desktop'] - self.ipc.write_config(config) - else: - config['external_mode'] = [] - self.ipc.write_config(config) + + self.config_manager.set_property('breezy-desktop-enabled', requesting_enabled) for widget in self.all_enabled_state_inputs: widget.set_sensitive(requesting_enabled) @@ -182,7 +174,6 @@ class ConnectedDevice(Gtk.Box): reload_display_distance_toggle_button(widget) def _on_widget_destroy(self, widget): - self.active = False self.state_manager.unbind_property('follow-mode', self.follow_mode_switch, 'active') self.settings.unbind('display-distance', self.display_distance_adjustment, 'value') self.settings.unbind('display-size', self.display_size_adjustment, 'value') diff --git a/ui/src/extensionsmanager.py b/ui/src/extensionsmanager.py index 0c1d54c..397686a 100644 --- a/ui/src/extensionsmanager.py +++ b/ui/src/extensionsmanager.py @@ -24,7 +24,7 @@ class ExtensionsManager(GObject.GObject): self.gnome_shell_extensions = self.bus.get("org.gnome.Shell.Extensions") self.gnome_shell_extensions.ExtensionStateChanged.connect(self._handle_extension_state_change) - self.remote_extension_state = None + self.remote_extension_state = self.is_enabled() def _handle_extension_state_change(self, extension_uuid, state): if extension_uuid == BREEZY_DESKTOP_UUID: diff --git a/ui/src/gtk/no-device.ui b/ui/src/gtk/no-device.ui index ecc6d51..c7d6cad 100644 --- a/ui/src/gtk/no-device.ui +++ b/ui/src/gtk/no-device.ui @@ -12,7 +12,35 @@ No device connected Breezy Desktop was unable to detect any supported XR devices. - 650 + 800 + 150 + + + + + + + Auto-enable XR effect + Automatically enable the Breezy Desktop XR effect when supported glasses are connected. + + + 3 + + + + + + + Start in widescreen mode + Widescreen mode is not supported for all glasses. + 2 + + + 3 + + + + diff --git a/ui/src/gtk/no-driver.ui b/ui/src/gtk/no-driver.ui index b0f6a29..bd9bba5 100644 --- a/ui/src/gtk/no-driver.ui +++ b/ui/src/gtk/no-driver.ui @@ -17,7 +17,7 @@ Otherwise, please file an issue on GitHub, or create a new thread in the #troubleshooting channel on Discord. - 650 + 800 diff --git a/ui/src/gtk/no-extension.ui b/ui/src/gtk/no-extension.ui index ad126bb..bc5fe43 100644 --- a/ui/src/gtk/no-extension.ui +++ b/ui/src/gtk/no-extension.ui @@ -12,7 +12,7 @@ Breezy Desktop GNOME extension not ready If you have just run the setup, then you may need to log out and back in to use it. Otherwise, please follow the Breezy GNOME setup instructions. - 650 + 800 diff --git a/ui/src/gtk/no-license.ui b/ui/src/gtk/no-license.ui index 7a5a9db..7525017 100644 --- a/ui/src/gtk/no-license.ui +++ b/ui/src/gtk/no-license.ui @@ -18,7 +18,7 @@ Once you obtain a license, trial or otherwise, you can use Breezy Desktop offline until features expire (or indefinitely, if you've chosen lifetime access). - 650 + 800 400 diff --git a/ui/src/main.py b/ui/src/main.py index d6543e4..c1472b7 100644 --- a/ui/src/main.py +++ b/ui/src/main.py @@ -34,7 +34,8 @@ gi.require_version('Adw', '1') gi.require_version('Gio', '2.0') gi.require_version('GLib', '2.0') -from gi.repository import Adw, Gtk, Gio +from gi.repository import Adw, Gtk, Gio, GLib +from .configmanager import ConfigManager from .licensedialog import LicenseDialog from .statemanager import StateManager from .window import BreezydesktopWindow @@ -64,12 +65,19 @@ sys.excepthook = excepthook XRDriverIPC.set_instance(XRDriverIPC(logger, config_dir)) +if GLib.MAJOR_VERSION * 100 + GLib.MINOR_VERSION >= 274: + APPLICATION_FLAGS = Gio.ApplicationFlags.DEFAULT_FLAGS +else: + # deprecated after Gio version 2.74 + APPLICATION_FLAGS = Gio.ApplicationFlags.FLAGS_NONE + + class BreezydesktopApplication(Adw.Application): """The main application singleton class.""" def __init__(self, version, skip_verification): super().__init__(application_id='com.xronlinux.BreezyDesktop', - flags=Gio.ApplicationFlags.DEFAULT_FLAGS) + flags=APPLICATION_FLAGS) self.version = version self.create_action('quit', self.on_quit_action, ['q']) @@ -137,6 +145,7 @@ class BreezydesktopApplication(Adw.Application): win.close() StateManager.destroy_instance() + ConfigManager.destroy_instance() self.quit() diff --git a/ui/src/meson.build b/ui/src/meson.build index cb1ecbc..0a2b141 100644 --- a/ui/src/meson.build +++ b/ui/src/meson.build @@ -29,6 +29,7 @@ configure_file( breezydesktop_sources = [ '../modules/PyXRLinuxDriverIPC/xrdriveripc.py', '__init__.py', + 'configmanager.py', 'connecteddevice.py', 'extensionsmanager.py', 'failedverification.py', diff --git a/ui/src/nodevice.py b/ui/src/nodevice.py index ed71c40..b36c656 100644 --- a/ui/src/nodevice.py +++ b/ui/src/nodevice.py @@ -1,5 +1,45 @@ -from gi.repository import Gtk +from gi.repository import Gio, Gtk +from .configmanager import ConfigManager +from .extensionsmanager import ExtensionsManager +from .settingsmanager import SettingsManager +from .statemanager import StateManager +from .xrdriveripc import XRDriverIPC @Gtk.Template(resource_path='/com/xronlinux/BreezyDesktop/gtk/no-device.ui') class NoDevice(Gtk.Box): __gtype_name__ = "NoDevice" + + effect_enable_switch = Gtk.Template.Child() + widescreen_mode_switch = Gtk.Template.Child() + + def __init__(self): + super(Gtk.Box, self).__init__() + self.init_template() + + self.ipc = XRDriverIPC.get_instance() + self.extensions_manager = ExtensionsManager.get_instance() + self.settings = SettingsManager.get_instance().settings + self.config_manager = ConfigManager.get_instance() + self.config_manager.connect('notify::breezy-desktop-enabled', self._handle_enabled_config) + + self.effect_enable_switch.connect('notify::active', self._handle_switch_enabled_state) + self.settings.bind('widescreen-mode', self.widescreen_mode_switch, 'active', Gio.SettingsBindFlags.DEFAULT) + + self._handle_enabled_config(self.config_manager, None) + + def _handle_enabled_config(self, config_manager, val): + enabled = config_manager.get_property('breezy-desktop-enabled') and self.extensions_manager.get_property('breezy-enabled') + if enabled != self.effect_enable_switch.get_active(): + self.effect_enable_switch.set_active(enabled) + + def _handle_switch_enabled_state(self, switch, param): + requesting_enabled = switch.get_active() + + # never turn off the extension, disabling the effect is done via configs only + if requesting_enabled: + self.extensions_manager.set_property('breezy-enabled', True) + + self.config_manager.set_property('breezy-desktop-enabled', requesting_enabled) + + def _on_widget_destroy(self, widget): + self.settings.unbind('widescreen-mode', self.widescreen_mode_switch, 'active') diff --git a/ui/src/statemanager.py b/ui/src/statemanager.py index f9dc84a..efb03c6 100644 --- a/ui/src/statemanager.py +++ b/ui/src/statemanager.py @@ -7,13 +7,6 @@ from .xrdriveripc import XRDriverIPC # shouldn't need a number larger than a year LICENSE_ACTION_NEEDED_MAX = 60 * 60 * 24 * 366 -class Logger: - def info(self, message): - print(message) - - def error(self, message): - print(message) - class StateManager(GObject.GObject): __gsignals__ = { 'device-update': (GObject.SIGNAL_RUN_FIRST, None, (str,)) @@ -66,15 +59,11 @@ class StateManager(GObject.GObject): self.license_present = False self.enabled_features = [] self.device_supports_sbs = False - - self.start() - - def start(self): - self.running = True + self._running = True self._refresh_state() def stop(self): - self.running = False + self._running = False def _refresh_state(self): self.state = self.ipc.retrieve_driver_state() @@ -109,7 +98,7 @@ class StateManager(GObject.GObject): self.set_property('device-supports-sbs', self.state.get('sbs_mode_supported', False)) self.set_property('widescreen-mode', self.state.get('sbs_mode_enabled', False)) - if self.running: threading.Timer(1.0, self._refresh_state).start() + if self._running: threading.Timer(1.0, self._refresh_state).start() def do_set_property(self, prop, value): if prop.name == 'driver-running':