Add error handling on extensions service call during shutdown, add GLib version check for deprecated flags constant

This commit is contained in:
wheaney 2024-10-21 13:39:35 -07:00
parent 5a5c9ab2d6
commit 5e47386d23
16 changed files with 62 additions and 46 deletions

View File

@ -1 +1 @@
1.1.0 1.1.3

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-18 11:45-0700\n" "POT-Creation-Date: 2024-10-21 13:39-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:17 #: src/connecteddevice.py:20
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:18 #: src/connecteddevice.py:21
msgid "This feature is not currently supported for your device." msgid "This feature is not currently supported for your device."
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-18 11:45-0700\n" "POT-Creation-Date: 2024-10-21 12:23-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:17 #: src/connecteddevice.py:20
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:18 #: src/connecteddevice.py:21
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."

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-18 11:45-0700\n" "POT-Creation-Date: 2024-10-21 12:23-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:17 #: src/connecteddevice.py:20
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:18 #: src/connecteddevice.py:21
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."

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-18 11:45-0700\n" "POT-Creation-Date: 2024-10-21 12:23-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:17 #: src/connecteddevice.py:20
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:18 #: src/connecteddevice.py:21
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 "

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-18 11:45-0700\n" "POT-Creation-Date: 2024-10-21 12:23-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:17 #: src/connecteddevice.py:20
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:18 #: src/connecteddevice.py:21
msgid "This feature is not currently supported for your device." msgid "This feature is not currently supported for your device."
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-18 11:45-0700\n" "POT-Creation-Date: 2024-10-21 12:23-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:17 #: src/connecteddevice.py:20
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:18 #: src/connecteddevice.py:21
msgid "This feature is not currently supported for your device." msgid "This feature is not currently supported for your device."
msgstr "この機能は現在接続されているデバイスではサポートされていません。" msgstr "この機能は現在接続されているデバイスではサポートされていません。"
@ -248,8 +248,8 @@ msgid ""
"Quickly enable or disable the XR Effect. You may need to enable the effect " "Quickly enable or disable the XR Effect. You may need to enable the effect "
"manually once in order to enable the shortcut." "manually once in order to enable the shortcut."
msgstr "" msgstr ""
"XRエフェクトの有効・無効を切り替えます。" "XRエフェクトの有効・無効を切り替えます。このショートカットを有効にするために"
"このショートカットを有効にするために手動で1回XRエフェクトを有効にする必要があります。" "手動で1回XRエフェクトを有効にする必要があります。"
#: src/gtk/connected-device.ui:238 src/gtk/connected-device.ui:267 #: src/gtk/connected-device.ui:238 src/gtk/connected-device.ui:267
#: src/gtk/connected-device.ui:296 src/gtk/connected-device.ui:325 #: src/gtk/connected-device.ui:296 src/gtk/connected-device.ui:325

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-18 11:45-0700\n" "POT-Creation-Date: 2024-10-21 12:23-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:17 #: src/connecteddevice.py:20
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:18 #: src/connecteddevice.py:21
msgid "This feature is not currently supported for your device." msgid "This feature is not currently supported for your device."
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-18 11:45-0700\n" "POT-Creation-Date: 2024-10-21 12:23-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:17 #: src/connecteddevice.py:20
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:18 #: src/connecteddevice.py:21
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."

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-18 11:45-0700\n" "POT-Creation-Date: 2024-10-21 12:23-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:17 #: src/connecteddevice.py:20
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:18 #: src/connecteddevice.py:21
msgid "This feature is not currently supported for your device." msgid "This feature is not currently supported for your device."
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-18 11:45-0700\n" "POT-Creation-Date: 2024-10-21 12:23-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:17 #: src/connecteddevice.py:20
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:18 #: src/connecteddevice.py:21
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."

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-18 11:45-0700\n" "POT-Creation-Date: 2024-10-21 12:23-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:17 #: src/connecteddevice.py:20
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:18 #: src/connecteddevice.py:21
msgid "This feature is not currently supported for your device." msgid "This feature is not currently supported for your device."
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-18 11:45-0700\n" "POT-Creation-Date: 2024-10-21 12:23-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:17 #: src/connecteddevice.py:20
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:18 #: src/connecteddevice.py:21
msgid "This feature is not currently supported for your device." msgid "This feature is not currently supported for your device."
msgstr "" msgstr ""

View File

@ -6,10 +6,13 @@ 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 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"
@ -101,6 +104,7 @@ 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._refresh_enabled_state_thread = None
self._refresh_enabled_state(); self._refresh_enabled_state();
self.effect_enable_switch.connect('notify::active', self._handle_enabled_state) self.effect_enable_switch.connect('notify::active', self._handle_enabled_state)
@ -128,11 +132,14 @@ class ConnectedDevice(Gtk.Box):
self.widescreen_mode_row.set_subtitle(subtitle) self.widescreen_mode_row.set_subtitle(subtitle)
def _refresh_enabled_state(self): def _refresh_enabled_state(self):
enabled = self._is_config_enabled(self.ipc.retrieve_config()) and self.extensions_manager.is_enabled() try:
if enabled != self.effect_enable_switch.get_active(): enabled = self._is_config_enabled(self.ipc.retrieve_config()) and self.extensions_manager.is_enabled()
self.effect_enable_switch.set_active(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() self._refresh_enabled_state_thread = threading.Timer(1.0, self._refresh_enabled_state).start()
except Exception as e:
logger.error(f"_refresh_enabled_state {e}")
def _is_config_enabled(self, config): def _is_config_enabled(self, config):
return config.get('disabled') == False and 'breezy_desktop' in config.get('external_mode', []) return config.get('disabled') == False and 'breezy_desktop' in config.get('external_mode', [])
@ -182,7 +189,9 @@ 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):
self.active = False 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

@ -34,7 +34,7 @@ gi.require_version('Adw', '1')
gi.require_version('Gio', '2.0') 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 from gi.repository import Adw, Gtk, Gio, GLib
from .licensedialog import LicenseDialog from .licensedialog import LicenseDialog
from .statemanager import StateManager from .statemanager import StateManager
from .window import BreezydesktopWindow from .window import BreezydesktopWindow
@ -64,12 +64,19 @@ sys.excepthook = excepthook
XRDriverIPC.set_instance(XRDriverIPC(logger, config_dir)) 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): class BreezydesktopApplication(Adw.Application):
"""The main application singleton class.""" """The main application singleton class."""
def __init__(self, version, skip_verification): def __init__(self, version, skip_verification):
super().__init__(application_id='com.xronlinux.BreezyDesktop', super().__init__(application_id='com.xronlinux.BreezyDesktop',
flags=Gio.ApplicationFlags.DEFAULT_FLAGS) flags=APPLICATION_FLAGS)
self.version = version self.version = version
self.create_action('quit', self.on_quit_action, ['<primary>q']) self.create_action('quit', self.on_quit_action, ['<primary>q'])