Version bump for testing.
This commit is contained in:
@@ -23,5 +23,5 @@
|
||||
# Forked from Orca screen reader.
|
||||
# Cthulhu project: https://git.stormux.org/storm/cthulhu
|
||||
|
||||
version = "2026.01.10"
|
||||
codeName = "master"
|
||||
version = "2026.01.12"
|
||||
codeName = "testing"
|
||||
|
||||
@@ -32,6 +32,8 @@ __copyright__ = "Copyright (c) 2005-2009 Sun Microsystems Inc."
|
||||
__license__ = "LGPL"
|
||||
|
||||
import gettext
|
||||
import importlib.resources as resources
|
||||
import os
|
||||
from gi.repository import Gtk
|
||||
|
||||
from .cthulhu_i18n import _
|
||||
@@ -52,7 +54,7 @@ class GtkBuilderWrapper:
|
||||
# Load GtkBuilder file.
|
||||
self.builder = Gtk.Builder()
|
||||
self.builder.set_translation_domain(gettext.textdomain())
|
||||
self.builder.add_from_file(fileName)
|
||||
self._add_builder_from_file(fileName)
|
||||
self.gtkWindow = self.builder.get_object(windowName)
|
||||
|
||||
# Force the localization of widgets to work around a GtkBuilder
|
||||
@@ -69,6 +71,24 @@ class GtkBuilderWrapper:
|
||||
instance_attributes[attribute] = getattr(self, attribute)
|
||||
self.builder.connect_signals(instance_attributes)
|
||||
|
||||
def _add_builder_from_file(self, fileName):
|
||||
if os.path.exists(fileName):
|
||||
self.builder.add_from_file(fileName)
|
||||
return
|
||||
|
||||
resourceName = os.path.basename(fileName)
|
||||
try:
|
||||
uiPath = resources.files(__package__).joinpath(resourceName)
|
||||
except Exception:
|
||||
uiPath = None
|
||||
|
||||
if uiPath and uiPath.is_file():
|
||||
with resources.as_file(uiPath) as resolvedPath:
|
||||
self.builder.add_from_file(str(resolvedPath))
|
||||
return
|
||||
|
||||
self.builder.add_from_file(fileName)
|
||||
|
||||
def set_cthulhu_icon(self):
|
||||
"""Get the icon in all sizes from the current theme and set them as
|
||||
default for all application windows.
|
||||
|
||||
Reference in New Issue
Block a user