Add error handling on extensions service call during shutdown, add GLib version check for deprecated flags constant
This commit is contained in:
parent
5a5c9ab2d6
commit
5e47386d23
|
|
@ -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-21 13:39-0700\n"
|
||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||
|
|
@ -17,13 +17,13 @@ msgstr ""
|
|||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
|
||||
#: src/connecteddevice.py:17
|
||||
#: src/connecteddevice.py:20
|
||||
msgid ""
|
||||
"Switches your glasses into side-by-side mode and doubles the width of the "
|
||||
"display."
|
||||
msgstr ""
|
||||
|
||||
#: src/connecteddevice.py:18
|
||||
#: src/connecteddevice.py:21
|
||||
msgid "This feature is not currently supported for your device."
|
||||
msgstr ""
|
||||
|
||||
|
|
|
|||
|
|
@ -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-21 12:23-0700\n"
|
||||
"PO-Revision-Date: 2024-08-02 20:54-0700\n"
|
||||
"Last-Translator: <wayne@xronlinux.com>\n"
|
||||
"Language-Team: German <translation-team-de@lists.sourceforge.net>\n"
|
||||
|
|
@ -17,7 +17,7 @@ msgstr ""
|
|||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||
|
||||
#: src/connecteddevice.py:17
|
||||
#: src/connecteddevice.py:20
|
||||
msgid ""
|
||||
"Switches your glasses into side-by-side mode and doubles the width of the "
|
||||
"display."
|
||||
|
|
@ -25,7 +25,7 @@ msgstr ""
|
|||
"Schaltet Ihre Brille in den Side-by-Side-Modus und verdoppelt die Breite des "
|
||||
"Displays."
|
||||
|
||||
#: src/connecteddevice.py:18
|
||||
#: src/connecteddevice.py:21
|
||||
msgid "This feature is not currently supported for your device."
|
||||
msgstr "Diese Funktion wird von Ihrem Gerät derzeit nicht unterstützt."
|
||||
|
||||
|
|
|
|||
|
|
@ -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-21 12:23-0700\n"
|
||||
"PO-Revision-Date: 2024-08-02 20:55-0700\n"
|
||||
"Last-Translator: <wayne@xronlinux.com>\n"
|
||||
"Language-Team: Spanish <es@tp.org.es>\n"
|
||||
|
|
@ -17,14 +17,14 @@ msgstr ""
|
|||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||
|
||||
#: src/connecteddevice.py:17
|
||||
#: src/connecteddevice.py:20
|
||||
msgid ""
|
||||
"Switches your glasses into side-by-side mode and doubles the width of the "
|
||||
"display."
|
||||
msgstr ""
|
||||
"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."
|
||||
msgstr "Esta función no es compatible con tu dispositivo en este momento."
|
||||
|
||||
|
|
|
|||
|
|
@ -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-21 12:23-0700\n"
|
||||
"PO-Revision-Date: 2024-08-02 20:54-0700\n"
|
||||
"Last-Translator: <wayne@xronlinux.com>\n"
|
||||
"Language-Team: French <traduc@traduc.org>\n"
|
||||
|
|
@ -17,7 +17,7 @@ msgstr ""
|
|||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
|
||||
|
||||
#: src/connecteddevice.py:17
|
||||
#: src/connecteddevice.py:20
|
||||
msgid ""
|
||||
"Switches your glasses into side-by-side mode and doubles the width of the "
|
||||
"display."
|
||||
|
|
@ -25,7 +25,7 @@ msgstr ""
|
|||
"Basculez vos lunettes en mode Side-By-Side (Côte-à-Côte) et doublez la "
|
||||
"largeur de l'écran."
|
||||
|
||||
#: src/connecteddevice.py:18
|
||||
#: src/connecteddevice.py:21
|
||||
msgid "This feature is not currently supported for your device."
|
||||
msgstr ""
|
||||
"Cette fonctionnalité n'est actuellement pas prise en charge par votre "
|
||||
|
|
|
|||
|
|
@ -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-21 12:23-0700\n"
|
||||
"PO-Revision-Date: 2024-08-02 21:14-0700\n"
|
||||
"Last-Translator: <wayne@xronlinux.com>\n"
|
||||
"Language-Team: Italian <tp@lists.linux.it>\n"
|
||||
|
|
@ -17,13 +17,13 @@ msgstr ""
|
|||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||
|
||||
#: src/connecteddevice.py:17
|
||||
#: src/connecteddevice.py:20
|
||||
msgid ""
|
||||
"Switches your glasses into side-by-side mode and doubles the width of the "
|
||||
"display."
|
||||
msgstr ""
|
||||
|
||||
#: src/connecteddevice.py:18
|
||||
#: src/connecteddevice.py:21
|
||||
msgid "This feature is not currently supported for your device."
|
||||
msgstr ""
|
||||
|
||||
|
|
|
|||
10
ui/po/ja.po
10
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-21 12:23-0700\n"
|
||||
"PO-Revision-Date: 2024-08-02 20:55-0700\n"
|
||||
"Last-Translator: <wayne@xronlinux.com>\n"
|
||||
"Language-Team: Japanese <translation-team-ja@lists.sourceforge.net>\n"
|
||||
|
|
@ -21,13 +21,13 @@ msgstr ""
|
|||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Plural-Forms: nplurals=1; plural=0;\n"
|
||||
|
||||
#: src/connecteddevice.py:17
|
||||
#: src/connecteddevice.py:20
|
||||
msgid ""
|
||||
"Switches your glasses into side-by-side mode and doubles the width of the "
|
||||
"display."
|
||||
msgstr "メガネを3Dモードに切り替え、表示の幅を2倍にします。"
|
||||
|
||||
#: src/connecteddevice.py:18
|
||||
#: src/connecteddevice.py:21
|
||||
msgid "This feature is not currently supported for your device."
|
||||
msgstr "この機能は現在接続されているデバイスではサポートされていません。"
|
||||
|
||||
|
|
@ -248,8 +248,8 @@ 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エフェクトを有効にする必要があります。"
|
||||
"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
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -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-21 12:23-0700\n"
|
||||
"PO-Revision-Date: 2024-08-16 10:26-0700\n"
|
||||
"Last-Translator: <wayne@xronlinux.com>\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 "
|
||||
"|| n%100>=20) ? 1 : 2);\n"
|
||||
|
||||
#: src/connecteddevice.py:17
|
||||
#: src/connecteddevice.py:20
|
||||
msgid ""
|
||||
"Switches your glasses into side-by-side mode and doubles the width of the "
|
||||
"display."
|
||||
msgstr ""
|
||||
|
||||
#: src/connecteddevice.py:18
|
||||
#: src/connecteddevice.py:21
|
||||
msgid "This feature is not currently supported for your device."
|
||||
msgstr ""
|
||||
|
||||
|
|
|
|||
|
|
@ -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-21 12:23-0700\n"
|
||||
"PO-Revision-Date: 2024-08-19 09:39-0700\n"
|
||||
"Last-Translator: <wayne@xronlinux.com>\n"
|
||||
"Language-Team: Brazilian Portuguese <ldpbr-translation@lists.sourceforge."
|
||||
|
|
@ -18,7 +18,7 @@ msgstr ""
|
|||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
|
||||
|
||||
#: src/connecteddevice.py:17
|
||||
#: src/connecteddevice.py:20
|
||||
msgid ""
|
||||
"Switches your glasses into side-by-side mode and doubles the width of the "
|
||||
"display."
|
||||
|
|
@ -26,7 +26,7 @@ msgstr ""
|
|||
"Altera o modo dos óculos para lado a lado (SBS) e dobra a largura da tela "
|
||||
"(ultrawide)."
|
||||
|
||||
#: src/connecteddevice.py:18
|
||||
#: src/connecteddevice.py:21
|
||||
msgid "This feature is not currently supported for your device."
|
||||
msgstr "Este recurso não é atualmente suportado para o seu dispositivo."
|
||||
|
||||
|
|
|
|||
|
|
@ -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-21 12:23-0700\n"
|
||||
"PO-Revision-Date: 2024-08-17 09:39-0700\n"
|
||||
"Last-Translator: <wayne@xronlinux.com>\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 && "
|
||||
"n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
|
||||
|
||||
#: src/connecteddevice.py:17
|
||||
#: src/connecteddevice.py:20
|
||||
msgid ""
|
||||
"Switches your glasses into side-by-side mode and doubles the width of the "
|
||||
"display."
|
||||
msgstr ""
|
||||
"Переключает очки в режим «сторона к стороне» и удваивает ширину дисплея."
|
||||
|
||||
#: src/connecteddevice.py:18
|
||||
#: src/connecteddevice.py:21
|
||||
msgid "This feature is not currently supported for your device."
|
||||
msgstr "Эта функция в настоящее время не поддерживается для вашего устройства."
|
||||
|
||||
|
|
|
|||
|
|
@ -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-21 12:23-0700\n"
|
||||
"PO-Revision-Date: 2024-08-16 10:31-0700\n"
|
||||
"Last-Translator: <wayne@xronlinux.com>\n"
|
||||
"Language-Team: Swedish <tp-sv@listor.tp-sv.se>\n"
|
||||
|
|
@ -17,7 +17,7 @@ msgstr ""
|
|||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||
|
||||
#: src/connecteddevice.py:17
|
||||
#: src/connecteddevice.py:20
|
||||
msgid ""
|
||||
"Switches your glasses into side-by-side mode and doubles the width of the "
|
||||
"display."
|
||||
|
|
@ -25,7 +25,7 @@ msgstr ""
|
|||
"Växlar dina glasögon till side-by-side-läget och dubblerar bredden på "
|
||||
"visningen."
|
||||
|
||||
#: src/connecteddevice.py:18
|
||||
#: src/connecteddevice.py:21
|
||||
msgid "This feature is not currently supported for your device."
|
||||
msgstr "Din enhet stöder inte den här funktionen för tillfället."
|
||||
|
||||
|
|
|
|||
|
|
@ -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-21 12:23-0700\n"
|
||||
"PO-Revision-Date: 2024-08-17 10:08-0700\n"
|
||||
"Last-Translator: <wayne@xronlinux.com>\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 && "
|
||||
"n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
|
||||
|
||||
#: src/connecteddevice.py:17
|
||||
#: src/connecteddevice.py:20
|
||||
msgid ""
|
||||
"Switches your glasses into side-by-side mode and doubles the width of the "
|
||||
"display."
|
||||
msgstr "Переключає окуляри в режим «бок о бок» і подвоює ширину дисплея."
|
||||
|
||||
#: src/connecteddevice.py:18
|
||||
#: src/connecteddevice.py:21
|
||||
msgid "This feature is not currently supported for your device."
|
||||
msgstr "Ця функція наразі не підтримується на вашому пристрої."
|
||||
|
||||
|
|
|
|||
|
|
@ -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-21 12:23-0700\n"
|
||||
"PO-Revision-Date: 2024-08-02 20:55-0700\n"
|
||||
"Last-Translator: <wayne@xronlinux.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-Transfer-Encoding: 8bit\n"
|
||||
|
||||
#: src/connecteddevice.py:17
|
||||
#: src/connecteddevice.py:20
|
||||
msgid ""
|
||||
"Switches your glasses into side-by-side mode and doubles the width of the "
|
||||
"display."
|
||||
msgstr ""
|
||||
|
||||
#: src/connecteddevice.py:18
|
||||
#: src/connecteddevice.py:21
|
||||
msgid "This feature is not currently supported for your device."
|
||||
msgstr ""
|
||||
|
||||
|
|
|
|||
|
|
@ -6,10 +6,13 @@ from .shortcutdialog import bind_shortcut_settings
|
|||
from .statemanager import StateManager
|
||||
from .xrdriveripc import XRDriverIPC
|
||||
import gettext
|
||||
import logging
|
||||
import threading
|
||||
|
||||
_ = gettext.gettext
|
||||
|
||||
logger = logging.getLogger('breezy_ui')
|
||||
|
||||
@Gtk.Template(resource_path='/com/xronlinux/BreezyDesktop/gtk/connected-device.ui')
|
||||
class ConnectedDevice(Gtk.Box):
|
||||
__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.connect('notify::active', self._refresh_follow_mode)
|
||||
|
||||
self._refresh_enabled_state_thread = None
|
||||
self._refresh_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)
|
||||
|
||||
def _refresh_enabled_state(self):
|
||||
enabled = self._is_config_enabled(self.ipc.retrieve_config()) and self.extensions_manager.is_enabled()
|
||||
if enabled != self.effect_enable_switch.get_active():
|
||||
self.effect_enable_switch.set_active(enabled)
|
||||
try:
|
||||
enabled = self._is_config_enabled(self.ipc.retrieve_config()) and self.extensions_manager.is_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):
|
||||
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)
|
||||
|
||||
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.settings.unbind('display-distance', self.display_distance_adjustment, 'value')
|
||||
self.settings.unbind('display-size', self.display_size_adjustment, 'value')
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ 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 .licensedialog import LicenseDialog
|
||||
from .statemanager import StateManager
|
||||
from .window import BreezydesktopWindow
|
||||
|
|
@ -64,12 +64,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, ['<primary>q'])
|
||||
|
|
|
|||
Loading…
Reference in New Issue