Move config interactions to new ConfigManager class, add enable and widescreen switches when device isn't connected

This commit is contained in:
wheaney 2024-10-22 13:27:40 -07:00
parent 1c4fc94999
commit b0e2b5cca3
23 changed files with 429 additions and 90 deletions

View File

@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-10-21 13:39-0700\n" "POT-Creation-Date: 2024-10-22 13:27-0700\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
@ -17,13 +17,13 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
#: src/connecteddevice.py:20 #: src/connecteddevice.py:17
msgid "" msgid ""
"Switches your glasses into side-by-side mode and doubles the width of the " "Switches your glasses into side-by-side mode and doubles the width of the "
"display." "display."
msgstr "" msgstr ""
#: src/connecteddevice.py:21 #: src/connecteddevice.py:18
msgid "This feature is not currently supported for your device." msgid "This feature is not currently supported for your device."
msgstr "" msgstr ""
@ -365,6 +365,24 @@ msgstr ""
msgid "Breezy Desktop was unable to detect any supported XR devices." msgid "Breezy Desktop was unable to detect any supported XR devices."
msgstr "" 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 #: src/gtk/no-driver.ui:13
msgid "No driver running" msgid "No driver running"
msgstr "" msgstr ""

View File

@ -7,7 +7,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-10-21 12:23-0700\n" "POT-Creation-Date: 2024-10-22 13:27-0700\n"
"PO-Revision-Date: 2024-08-02 20:54-0700\n" "PO-Revision-Date: 2024-08-02 20:54-0700\n"
"Last-Translator: <wayne@xronlinux.com>\n" "Last-Translator: <wayne@xronlinux.com>\n"
"Language-Team: German <translation-team-de@lists.sourceforge.net>\n" "Language-Team: German <translation-team-de@lists.sourceforge.net>\n"
@ -17,7 +17,7 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: src/connecteddevice.py:20 #: src/connecteddevice.py:17
msgid "" msgid ""
"Switches your glasses into side-by-side mode and doubles the width of the " "Switches your glasses into side-by-side mode and doubles the width of the "
"display." "display."
@ -25,7 +25,7 @@ msgstr ""
"Schaltet Ihre Brille in den Side-by-Side-Modus und verdoppelt die Breite des " "Schaltet Ihre Brille in den Side-by-Side-Modus und verdoppelt die Breite des "
"Displays." "Displays."
#: src/connecteddevice.py:21 #: src/connecteddevice.py:18
msgid "This feature is not currently supported for your device." msgid "This feature is not currently supported for your device."
msgstr "Diese Funktion wird von Ihrem Gerät derzeit nicht unterstützt." msgstr "Diese Funktion wird von Ihrem Gerät derzeit nicht unterstützt."
@ -388,6 +388,26 @@ msgstr "Kein Gerät verbunden"
msgid "Breezy Desktop was unable to detect any supported XR devices." msgid "Breezy Desktop was unable to detect any supported XR devices."
msgstr "Breezy Desktop konnte kein unterstütztes XR-Gerät erkennen." 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 #: src/gtk/no-driver.ui:13
msgid "No driver running" msgid "No driver running"
msgstr "Kein Treiber wird ausgeführt" msgstr "Kein Treiber wird ausgeführt"

View File

@ -7,7 +7,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-10-21 12:23-0700\n" "POT-Creation-Date: 2024-10-22 13:27-0700\n"
"PO-Revision-Date: 2024-08-02 20:55-0700\n" "PO-Revision-Date: 2024-08-02 20:55-0700\n"
"Last-Translator: <wayne@xronlinux.com>\n" "Last-Translator: <wayne@xronlinux.com>\n"
"Language-Team: Spanish <es@tp.org.es>\n" "Language-Team: Spanish <es@tp.org.es>\n"
@ -17,14 +17,14 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: src/connecteddevice.py:20 #: src/connecteddevice.py:17
msgid "" msgid ""
"Switches your glasses into side-by-side mode and doubles the width of the " "Switches your glasses into side-by-side mode and doubles the width of the "
"display." "display."
msgstr "" msgstr ""
"Cambia tus gafas al modo lado a lado y duplica el ancho de la pantalla." "Cambia tus gafas al modo lado a lado y duplica el ancho de la pantalla."
#: src/connecteddevice.py:21 #: src/connecteddevice.py:18
msgid "This feature is not currently supported for your device." msgid "This feature is not currently supported for your device."
msgstr "Esta función no es compatible con tu dispositivo en este momento." msgstr "Esta función no es compatible con tu dispositivo en este momento."
@ -387,6 +387,26 @@ msgstr "No hay dispositivo conectado"
msgid "Breezy Desktop was unable to detect any supported XR devices." msgid "Breezy Desktop was unable to detect any supported XR devices."
msgstr "Breezy Desktop no pudo detectar ningún dispositivo XR compatible." msgstr "Breezy Desktop no pudo detectar ningún dispositivo XR compatible."
#: src/gtk/no-device.ui:23
#, fuzzy
msgid "Auto-enable XR effect"
msgstr "Efecto 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 "Modo pantalla ancha"
#: src/gtk/no-device.ui:35
msgid "Widescreen mode is not supported for all glasses."
msgstr ""
#: src/gtk/no-driver.ui:13 #: src/gtk/no-driver.ui:13
msgid "No driver running" msgid "No driver running"
msgstr "No se está ejecutando ningún controlador" msgstr "No se está ejecutando ningún controlador"

View File

@ -7,7 +7,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-10-21 12:23-0700\n" "POT-Creation-Date: 2024-10-22 13:27-0700\n"
"PO-Revision-Date: 2024-08-02 20:54-0700\n" "PO-Revision-Date: 2024-08-02 20:54-0700\n"
"Last-Translator: <wayne@xronlinux.com>\n" "Last-Translator: <wayne@xronlinux.com>\n"
"Language-Team: French <traduc@traduc.org>\n" "Language-Team: French <traduc@traduc.org>\n"
@ -17,7 +17,7 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n"
#: src/connecteddevice.py:20 #: src/connecteddevice.py:17
msgid "" msgid ""
"Switches your glasses into side-by-side mode and doubles the width of the " "Switches your glasses into side-by-side mode and doubles the width of the "
"display." "display."
@ -25,7 +25,7 @@ msgstr ""
"Basculez vos lunettes en mode Side-By-Side (Côte-à-Côte) et doublez la " "Basculez vos lunettes en mode Side-By-Side (Côte-à-Côte) et doublez la "
"largeur de l'écran." "largeur de l'écran."
#: src/connecteddevice.py:21 #: src/connecteddevice.py:18
msgid "This feature is not currently supported for your device." msgid "This feature is not currently supported for your device."
msgstr "" msgstr ""
"Cette fonctionnalité n'est actuellement pas prise en charge par votre " "Cette fonctionnalité n'est actuellement pas prise en charge par votre "
@ -392,6 +392,26 @@ msgstr "Aucun appareil connecté"
msgid "Breezy Desktop was unable to detect any supported XR devices." 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." 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 #: src/gtk/no-driver.ui:13
msgid "No driver running" msgid "No driver running"
msgstr "Aucun pilote en cours d'exécution" msgstr "Aucun pilote en cours d'exécution"

View File

@ -7,7 +7,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-10-21 12:23-0700\n" "POT-Creation-Date: 2024-10-22 13:27-0700\n"
"PO-Revision-Date: 2024-08-02 21:14-0700\n" "PO-Revision-Date: 2024-08-02 21:14-0700\n"
"Last-Translator: <wayne@xronlinux.com>\n" "Last-Translator: <wayne@xronlinux.com>\n"
"Language-Team: Italian <tp@lists.linux.it>\n" "Language-Team: Italian <tp@lists.linux.it>\n"
@ -17,13 +17,13 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: src/connecteddevice.py:20 #: src/connecteddevice.py:17
msgid "" msgid ""
"Switches your glasses into side-by-side mode and doubles the width of the " "Switches your glasses into side-by-side mode and doubles the width of the "
"display." "display."
msgstr "" msgstr ""
#: src/connecteddevice.py:21 #: src/connecteddevice.py:18
msgid "This feature is not currently supported for your device." msgid "This feature is not currently supported for your device."
msgstr "" msgstr ""
@ -365,6 +365,24 @@ msgstr ""
msgid "Breezy Desktop was unable to detect any supported XR devices." msgid "Breezy Desktop was unable to detect any supported XR devices."
msgstr "" 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 #: src/gtk/no-driver.ui:13
msgid "No driver running" msgid "No driver running"
msgstr "" msgstr ""

View File

@ -11,7 +11,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-10-21 12:23-0700\n" "POT-Creation-Date: 2024-10-22 13:27-0700\n"
"PO-Revision-Date: 2024-08-02 20:55-0700\n" "PO-Revision-Date: 2024-08-02 20:55-0700\n"
"Last-Translator: <wayne@xronlinux.com>\n" "Last-Translator: <wayne@xronlinux.com>\n"
"Language-Team: Japanese <translation-team-ja@lists.sourceforge.net>\n" "Language-Team: Japanese <translation-team-ja@lists.sourceforge.net>\n"
@ -21,13 +21,13 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=1; plural=0;\n" "Plural-Forms: nplurals=1; plural=0;\n"
#: src/connecteddevice.py:20 #: src/connecteddevice.py:17
msgid "" msgid ""
"Switches your glasses into side-by-side mode and doubles the width of the " "Switches your glasses into side-by-side mode and doubles the width of the "
"display." "display."
msgstr "メガネを3Dモードに切り替え、表示の幅を2倍にします。" msgstr "メガネを3Dモードに切り替え、表示の幅を2倍にします。"
#: src/connecteddevice.py:21 #: src/connecteddevice.py:18
msgid "This feature is not currently supported for your device." msgid "This feature is not currently supported for your device."
msgstr "この機能は現在接続されているデバイスではサポートされていません。" msgstr "この機能は現在接続されているデバイスではサポートされていません。"
@ -390,6 +390,26 @@ msgstr "デバイスが接続されていません"
msgid "Breezy Desktop was unable to detect any supported XR devices." 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
#, 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 #: src/gtk/no-driver.ui:13
msgid "No driver running" msgid "No driver running"
msgstr "ドライバーが実行されていません" msgstr "ドライバーが実行されていません"

View File

@ -7,7 +7,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-10-21 12:23-0700\n" "POT-Creation-Date: 2024-10-22 13:27-0700\n"
"PO-Revision-Date: 2024-08-16 10:26-0700\n" "PO-Revision-Date: 2024-08-16 10:26-0700\n"
"Last-Translator: <wayne@xronlinux.com>\n" "Last-Translator: <wayne@xronlinux.com>\n"
"Language-Team: Polish <translation-team-pl@lists.sourceforge.net>\n" "Language-Team: Polish <translation-team-pl@lists.sourceforge.net>\n"
@ -18,13 +18,13 @@ msgstr ""
"Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 " "Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 "
"|| n%100>=20) ? 1 : 2);\n" "|| n%100>=20) ? 1 : 2);\n"
#: src/connecteddevice.py:20 #: src/connecteddevice.py:17
msgid "" msgid ""
"Switches your glasses into side-by-side mode and doubles the width of the " "Switches your glasses into side-by-side mode and doubles the width of the "
"display." "display."
msgstr "" msgstr ""
#: src/connecteddevice.py:21 #: src/connecteddevice.py:18
msgid "This feature is not currently supported for your device." msgid "This feature is not currently supported for your device."
msgstr "" msgstr ""
@ -366,6 +366,24 @@ msgstr ""
msgid "Breezy Desktop was unable to detect any supported XR devices." msgid "Breezy Desktop was unable to detect any supported XR devices."
msgstr "" 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 #: src/gtk/no-driver.ui:13
msgid "No driver running" msgid "No driver running"
msgstr "" msgstr ""

View File

@ -7,7 +7,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-10-21 12:23-0700\n" "POT-Creation-Date: 2024-10-22 13:27-0700\n"
"PO-Revision-Date: 2024-08-19 09:39-0700\n" "PO-Revision-Date: 2024-08-19 09:39-0700\n"
"Last-Translator: <wayne@xronlinux.com>\n" "Last-Translator: <wayne@xronlinux.com>\n"
"Language-Team: Brazilian Portuguese <ldpbr-translation@lists.sourceforge." "Language-Team: Brazilian Portuguese <ldpbr-translation@lists.sourceforge."
@ -18,7 +18,7 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n"
#: src/connecteddevice.py:20 #: src/connecteddevice.py:17
msgid "" msgid ""
"Switches your glasses into side-by-side mode and doubles the width of the " "Switches your glasses into side-by-side mode and doubles the width of the "
"display." "display."
@ -26,7 +26,7 @@ msgstr ""
"Altera o modo dos óculos para lado a lado (SBS) e dobra a largura da tela " "Altera o modo dos óculos para lado a lado (SBS) e dobra a largura da tela "
"(ultrawide)." "(ultrawide)."
#: src/connecteddevice.py:21 #: src/connecteddevice.py:18
msgid "This feature is not currently supported for your device." msgid "This feature is not currently supported for your device."
msgstr "Este recurso não é atualmente suportado para o seu dispositivo." msgstr "Este recurso não é atualmente suportado para o seu dispositivo."
@ -390,6 +390,26 @@ msgid "Breezy Desktop was unable to detect any supported XR devices."
msgstr "" msgstr ""
"O Breezy Desktop não conseguiu detectar nenhum dispositivo XR suportado." "O Breezy Desktop não conseguiu detectar nenhum dispositivo XR suportado."
#: src/gtk/no-device.ui:23
#, fuzzy
msgid "Auto-enable XR effect"
msgstr "Efeito 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 "Modo Ultrawide"
#: src/gtk/no-device.ui:35
msgid "Widescreen mode is not supported for all glasses."
msgstr ""
#: src/gtk/no-driver.ui:13 #: src/gtk/no-driver.ui:13
msgid "No driver running" msgid "No driver running"
msgstr "Nenhum driver em execução" msgstr "Nenhum driver em execução"

View File

@ -7,7 +7,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-10-21 12:23-0700\n" "POT-Creation-Date: 2024-10-22 13:27-0700\n"
"PO-Revision-Date: 2024-08-17 09:39-0700\n" "PO-Revision-Date: 2024-08-17 09:39-0700\n"
"Last-Translator: <wayne@xronlinux.com>\n" "Last-Translator: <wayne@xronlinux.com>\n"
"Language-Team: Russian <gnu@d07.ru>\n" "Language-Team: Russian <gnu@d07.ru>\n"
@ -18,14 +18,14 @@ msgstr ""
"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && " "Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && "
"n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" "n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
#: src/connecteddevice.py:20 #: src/connecteddevice.py:17
msgid "" msgid ""
"Switches your glasses into side-by-side mode and doubles the width of the " "Switches your glasses into side-by-side mode and doubles the width of the "
"display." "display."
msgstr "" msgstr ""
"Переключает очки в режим «сторона к стороне» и удваивает ширину дисплея." "Переключает очки в режим «сторона к стороне» и удваивает ширину дисплея."
#: src/connecteddevice.py:21 #: src/connecteddevice.py:18
msgid "This feature is not currently supported for your device." msgid "This feature is not currently supported for your device."
msgstr "Эта функция в настоящее время не поддерживается для вашего устройства." msgstr "Эта функция в настоящее время не поддерживается для вашего устройства."
@ -389,6 +389,26 @@ msgstr "Устройство не подключено"
msgid "Breezy Desktop was unable to detect any supported XR devices." 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
#, 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 #: src/gtk/no-driver.ui:13
msgid "No driver running" msgid "No driver running"
msgstr "Драйвер не запущен" msgstr "Драйвер не запущен"

View File

@ -7,7 +7,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-10-21 12:23-0700\n" "POT-Creation-Date: 2024-10-22 13:27-0700\n"
"PO-Revision-Date: 2024-08-16 10:31-0700\n" "PO-Revision-Date: 2024-08-16 10:31-0700\n"
"Last-Translator: <wayne@xronlinux.com>\n" "Last-Translator: <wayne@xronlinux.com>\n"
"Language-Team: Swedish <tp-sv@listor.tp-sv.se>\n" "Language-Team: Swedish <tp-sv@listor.tp-sv.se>\n"
@ -17,7 +17,7 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: src/connecteddevice.py:20 #: src/connecteddevice.py:17
msgid "" msgid ""
"Switches your glasses into side-by-side mode and doubles the width of the " "Switches your glasses into side-by-side mode and doubles the width of the "
"display." "display."
@ -25,7 +25,7 @@ msgstr ""
"Växlar dina glasögon till side-by-side-läget och dubblerar bredden på " "Växlar dina glasögon till side-by-side-läget och dubblerar bredden på "
"visningen." "visningen."
#: src/connecteddevice.py:21 #: src/connecteddevice.py:18
msgid "This feature is not currently supported for your device." msgid "This feature is not currently supported for your device."
msgstr "Din enhet stöder inte den här funktionen för tillfället." msgstr "Din enhet stöder inte den här funktionen för tillfället."
@ -383,6 +383,26 @@ msgstr "Inget enhet ansluten"
msgid "Breezy Desktop was unable to detect any supported XR devices." msgid "Breezy Desktop was unable to detect any supported XR devices."
msgstr "Breezy Desktop kunde inte upptäcka enheter som stöder XR." 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 #: src/gtk/no-driver.ui:13
msgid "No driver running" msgid "No driver running"
msgstr "Inget drivrutin köres" msgstr "Inget drivrutin köres"

View File

@ -7,7 +7,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-10-21 12:23-0700\n" "POT-Creation-Date: 2024-10-22 13:27-0700\n"
"PO-Revision-Date: 2024-08-17 10:08-0700\n" "PO-Revision-Date: 2024-08-17 10:08-0700\n"
"Last-Translator: <wayne@xronlinux.com>\n" "Last-Translator: <wayne@xronlinux.com>\n"
"Language-Team: Ukrainian <trans-uk@lists.fedoraproject.org>\n" "Language-Team: Ukrainian <trans-uk@lists.fedoraproject.org>\n"
@ -18,13 +18,13 @@ msgstr ""
"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && " "Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && "
"n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" "n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
#: src/connecteddevice.py:20 #: src/connecteddevice.py:17
msgid "" msgid ""
"Switches your glasses into side-by-side mode and doubles the width of the " "Switches your glasses into side-by-side mode and doubles the width of the "
"display." "display."
msgstr "Переключає окуляри в режим «бок о бок» і подвоює ширину дисплея." msgstr "Переключає окуляри в режим «бок о бок» і подвоює ширину дисплея."
#: src/connecteddevice.py:21 #: src/connecteddevice.py:18
msgid "This feature is not currently supported for your device." msgid "This feature is not currently supported for your device."
msgstr "Ця функція наразі не підтримується на вашому пристрої." msgstr "Ця функція наразі не підтримується на вашому пристрої."
@ -386,6 +386,26 @@ msgstr "Жоден пристрій не підключено"
msgid "Breezy Desktop was unable to detect any supported XR devices." 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
#, 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 #: src/gtk/no-driver.ui:13
msgid "No driver running" msgid "No driver running"
msgstr "Жоден драйвер не запущений" msgstr "Жоден драйвер не запущений"

View File

@ -7,7 +7,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-10-21 12:23-0700\n" "POT-Creation-Date: 2024-10-22 13:27-0700\n"
"PO-Revision-Date: 2024-08-02 20:55-0700\n" "PO-Revision-Date: 2024-08-02 20:55-0700\n"
"Last-Translator: <wayne@xronlinux.com>\n" "Last-Translator: <wayne@xronlinux.com>\n"
"Language-Team: Chinese (simplified) <i18n-zh@googlegroups.com>\n" "Language-Team: Chinese (simplified) <i18n-zh@googlegroups.com>\n"
@ -16,13 +16,13 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
#: src/connecteddevice.py:20 #: src/connecteddevice.py:17
msgid "" msgid ""
"Switches your glasses into side-by-side mode and doubles the width of the " "Switches your glasses into side-by-side mode and doubles the width of the "
"display." "display."
msgstr "" msgstr ""
#: src/connecteddevice.py:21 #: src/connecteddevice.py:18
msgid "This feature is not currently supported for your device." msgid "This feature is not currently supported for your device."
msgstr "" msgstr ""
@ -364,6 +364,24 @@ msgstr ""
msgid "Breezy Desktop was unable to detect any supported XR devices." msgid "Breezy Desktop was unable to detect any supported XR devices."
msgstr "" 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 #: src/gtk/no-driver.ui:13
msgid "No driver running" msgid "No driver running"
msgstr "" msgstr ""

66
ui/src/configmanager.py Normal file
View File

@ -0,0 +1,66 @@
import sys
import threading
from gi.repository import GObject
from .time import LICENSE_WARN_SECONDS
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):
logging.info(f"Setting property {prop.name} to {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

View File

@ -1,4 +1,5 @@
from gi.repository import Gio, Gtk, GObject from gi.repository import Gio, Gtk, GObject
from .configmanager import ConfigManager
from .extensionsmanager import ExtensionsManager from .extensionsmanager import ExtensionsManager
from .license import BREEZY_GNOME_FEATURES from .license import BREEZY_GNOME_FEATURES
from .settingsmanager import SettingsManager from .settingsmanager import SettingsManager
@ -6,13 +7,9 @@ from .shortcutdialog import bind_shortcut_settings
from .statemanager import StateManager from .statemanager import StateManager
from .xrdriveripc import XRDriverIPC from .xrdriveripc import XRDriverIPC
import gettext import gettext
import logging
import threading
_ = gettext.gettext _ = gettext.gettext
logger = logging.getLogger('breezy_ui')
@Gtk.Template(resource_path='/com/xronlinux/BreezyDesktop/gtk/connected-device.ui') @Gtk.Template(resource_path='/com/xronlinux/BreezyDesktop/gtk/connected-device.ui')
class ConnectedDevice(Gtk.Box): class ConnectedDevice(Gtk.Box):
__gtype_name__ = "ConnectedDevice" __gtype_name__ = "ConnectedDevice"
@ -103,17 +100,18 @@ class ConnectedDevice(Gtk.Box):
self.follow_mode_switch.set_active(self.state_manager.get_property('follow-mode')) 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.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_thread = None self.config_manager = ConfigManager.get_instance()
self._refresh_enabled_state(); self.config_manager.connect('notify::breezy-desktop-enabled', self._handle_enabled_config)
self.effect_enable_switch.connect('notify::active', self._handle_enabled_state)
self.use_optimal_monitor_config_switch.connect('notify::active', self._refresh_use_optimal_monitor_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_enabled_features(self.state_manager, None)
self._handle_device_supports_sbs(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._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) self.connect("destroy", self._on_widget_destroy)
@ -131,33 +129,19 @@ class ConnectedDevice(Gtk.Box):
subtitle = self.widescreen_mode_subtitle if state_manager.get_property('device-supports-sbs') else self.widescreen_mode_not_supported_subtitle 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) self.widescreen_mode_row.set_subtitle(subtitle)
def _refresh_enabled_state(self): def _handle_enabled_config(self, object, val):
try: enabled = self.config_manager.get_property('breezy-desktop-enabled') and self.extensions_manager.get_property('breezy-enabled')
enabled = self._is_config_enabled(self.ipc.retrieve_config()) and self.extensions_manager.is_enabled() if enabled != self.effect_enable_switch.get_active():
if enabled != self.effect_enable_switch.get_active(): self.effect_enable_switch.set_active(enabled)
self.effect_enable_switch.set_active(enabled)
self._refresh_enabled_state_thread = threading.Timer(1.0, self._refresh_enabled_state) def _handle_switch_enabled_state(self, switch, param):
self._refresh_enabled_state_thread.start()
except Exception as e:
logger.error(f"_refresh_enabled_state {e}")
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):
requesting_enabled = switch.get_active() 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: if requesting_enabled:
self.extensions_manager.set_property('breezy-enabled', True) self.extensions_manager.set_property('breezy-enabled', True)
if not self._is_config_enabled(config):
config['disabled'] = False self.config_manager.set_property('breezy-desktop-enabled', requesting_enabled)
config['output_mode'] = 'external_only'
config['external_mode'] = ['breezy_desktop']
self.ipc.write_config(config)
else:
config['external_mode'] = []
self.ipc.write_config(config)
for widget in self.all_enabled_state_inputs: for widget in self.all_enabled_state_inputs:
widget.set_sensitive(requesting_enabled) widget.set_sensitive(requesting_enabled)
@ -190,9 +174,6 @@ class ConnectedDevice(Gtk.Box):
reload_display_distance_toggle_button(widget) reload_display_distance_toggle_button(widget)
def _on_widget_destroy(self, widget): def _on_widget_destroy(self, widget):
if self._refresh_enabled_state_thread:
self._refresh_enabled_state_thread.cancel()
self.state_manager.unbind_property('follow-mode', self.follow_mode_switch, 'active') 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-distance', self.display_distance_adjustment, 'value')
self.settings.unbind('display-size', self.display_size_adjustment, 'value') self.settings.unbind('display-size', self.display_size_adjustment, 'value')

View File

@ -24,7 +24,7 @@ class ExtensionsManager(GObject.GObject):
self.gnome_shell_extensions = self.bus.get("org.gnome.Shell.Extensions") self.gnome_shell_extensions = self.bus.get("org.gnome.Shell.Extensions")
self.gnome_shell_extensions.ExtensionStateChanged.connect(self._handle_extension_state_change) 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): def _handle_extension_state_change(self, extension_uuid, state):
if extension_uuid == BREEZY_DESKTOP_UUID: if extension_uuid == BREEZY_DESKTOP_UUID:

View File

@ -12,7 +12,35 @@
<object class="AdwStatusPage"> <object class="AdwStatusPage">
<property name="title" translatable="yes">No device connected</property> <property name="title" translatable="yes">No device connected</property>
<property name="description" translatable="yes">Breezy Desktop was unable to detect any supported XR devices.</property> <property name="description" translatable="yes">Breezy Desktop was unable to detect any supported XR devices.</property>
<property name="width-request">650</property> <property name="width-request">800</property>
<property name="height-request">150</property>
</object>
</child>
<child>
<object class="AdwPreferencesGroup">
<child>
<object class="AdwActionRow">
<property name="title" translatable="yes"><!-- feature switch -->Auto-enable XR effect</property>
<property name="subtitle" translatable="yes">Automatically enable the Breezy Desktop XR effect when supported glasses are connected.</property>
<child>
<object class="GtkSwitch" id="effect_enable_switch">
<property name="valign">3</property>
</object>
</child>
</object>
</child>
<child>
<object class="AdwActionRow" id="widescreen_mode_row">
<property name="title" translatable="yes"><!-- feature switch -->Start in widescreen mode</property>
<property name="subtitle" translatable="yes">Widescreen mode is not supported for all glasses.</property>
<property name="valign">2</property>
<child>
<object class="GtkSwitch" id="widescreen_mode_switch">
<property name="valign">3</property>
</object>
</child>
</object>
</child>
</object> </object>
</child> </child>
</template> </template>

View File

@ -17,7 +17,7 @@
Otherwise, please file an issue on GitHub, or create a new thread in the #troubleshooting channel on Discord. Otherwise, please file an issue on GitHub, or create a new thread in the #troubleshooting channel on Discord.
</property> </property>
<property name="width-request">650</property> <property name="width-request">800</property>
</object> </object>
</child> </child>
</template> </template>

View File

@ -12,7 +12,7 @@
<object class="AdwStatusPage"> <object class="AdwStatusPage">
<property name="title" translatable="yes">Breezy Desktop GNOME extension not ready</property> <property name="title" translatable="yes">Breezy Desktop GNOME extension not ready</property>
<property name="description" translatable="yes">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.</property> <property name="description" translatable="yes">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.</property>
<property name="width-request">650</property> <property name="width-request">800</property>
</object> </object>
</child> </child>
</template> </template>

View File

@ -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). 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).
</property> </property>
<property name="width-request">650</property> <property name="width-request">800</property>
<property name="height-request">400</property> <property name="height-request">400</property>
</object> </object>
</child> </child>

View File

@ -35,6 +35,7 @@ gi.require_version('Gio', '2.0')
gi.require_version('GLib', '2.0') gi.require_version('GLib', '2.0')
from gi.repository import Adw, Gtk, Gio, GLib from gi.repository import Adw, Gtk, Gio, GLib
from .configmanager import ConfigManager
from .licensedialog import LicenseDialog from .licensedialog import LicenseDialog
from .statemanager import StateManager from .statemanager import StateManager
from .window import BreezydesktopWindow from .window import BreezydesktopWindow
@ -144,6 +145,7 @@ class BreezydesktopApplication(Adw.Application):
win.close() win.close()
StateManager.destroy_instance() StateManager.destroy_instance()
ConfigManager.destroy_instance()
self.quit() self.quit()

View File

@ -29,6 +29,7 @@ configure_file(
breezydesktop_sources = [ breezydesktop_sources = [
'../modules/PyXRLinuxDriverIPC/xrdriveripc.py', '../modules/PyXRLinuxDriverIPC/xrdriveripc.py',
'__init__.py', '__init__.py',
'configmanager.py',
'connecteddevice.py', 'connecteddevice.py',
'extensionsmanager.py', 'extensionsmanager.py',
'failedverification.py', 'failedverification.py',

View File

@ -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') @Gtk.Template(resource_path='/com/xronlinux/BreezyDesktop/gtk/no-device.ui')
class NoDevice(Gtk.Box): class NoDevice(Gtk.Box):
__gtype_name__ = "NoDevice" __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')

View File

@ -7,13 +7,6 @@ from .xrdriveripc import XRDriverIPC
# shouldn't need a number larger than a year # shouldn't need a number larger than a year
LICENSE_ACTION_NEEDED_MAX = 60 * 60 * 24 * 366 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): class StateManager(GObject.GObject):
__gsignals__ = { __gsignals__ = {
'device-update': (GObject.SIGNAL_RUN_FIRST, None, (str,)) 'device-update': (GObject.SIGNAL_RUN_FIRST, None, (str,))
@ -66,15 +59,11 @@ class StateManager(GObject.GObject):
self.license_present = False self.license_present = False
self.enabled_features = [] self.enabled_features = []
self.device_supports_sbs = False self.device_supports_sbs = False
self._running = True
self.start()
def start(self):
self.running = True
self._refresh_state() self._refresh_state()
def stop(self): def stop(self):
self.running = False self._running = False
def _refresh_state(self): def _refresh_state(self):
self.state = self.ipc.retrieve_driver_state() 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('device-supports-sbs', self.state.get('sbs_mode_supported', False))
self.set_property('widescreen-mode', self.state.get('sbs_mode_enabled', 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): def do_set_property(self, prop, value):
if prop.name == 'driver-running': if prop.name == 'driver-running':