diff options
-rw-r--r-- | data/meson.build | 9 | ||||
-rw-r--r-- | data/ppm.gresources.xml | 7 | ||||
-rw-r--r-- | data/ui/ppm-provider-assistant.ui (renamed from src/ppm-provider-assistant.ui) | 0 | ||||
-rw-r--r-- | data/ui/ppm.ui (renamed from src/ppm.ui) | 0 | ||||
-rw-r--r-- | src/meson.build | 6 | ||||
-rw-r--r-- | src/ppm/__init__.py.in | 2 | ||||
-rwxr-xr-x | src/prepaid-manager-applet.py | 7 |
7 files changed, 24 insertions, 7 deletions
diff --git a/data/meson.build b/data/meson.build index 9af0850..55f36ec 100644 --- a/data/meson.build +++ b/data/meson.build @@ -33,5 +33,14 @@ if appstream_util.found() ) endif +ppm_resources = gnome.compile_resources( + 'ppm', + 'ppm.gresources.xml', + gresource_bundle: true, + c_name: 'ppm', + install: true, + install_dir: pkgdatadir, +) + iconsdir = join_paths(get_option('datadir'), 'icons') install_subdir('hicolor/', install_dir: iconsdir) diff --git a/data/ppm.gresources.xml b/data/ppm.gresources.xml new file mode 100644 index 0000000..36e93a1 --- /dev/null +++ b/data/ppm.gresources.xml @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="UTF-8"?> +<gresources> + <gresource prefix="/org/gnome/PrepaidManager"> + <file>ui/ppm.ui</file> + <file>ui/ppm-provider-assistant.ui</file> + </gresource> +</gresources> diff --git a/src/ppm-provider-assistant.ui b/data/ui/ppm-provider-assistant.ui index 590e18d..590e18d 100644 --- a/src/ppm-provider-assistant.ui +++ b/data/ui/ppm-provider-assistant.ui diff --git a/src/ppm.ui b/data/ui/ppm.ui index 6eee0c0..6eee0c0 100644 --- a/src/ppm.ui +++ b/data/ui/ppm.ui diff --git a/src/meson.build b/src/meson.build index 6cbdb8d..170ebe5 100644 --- a/src/meson.build +++ b/src/meson.build @@ -9,11 +9,7 @@ configure_file( install_dir: get_option('bindir') ) -sources = [ - package + '.py', - 'ppm.ui', - 'ppm-provider-assistant.ui', -] +sources = [package + '.py'] install_data(sources, install_dir: pkgdatadir) subdir('ppm') diff --git a/src/ppm/__init__.py.in b/src/ppm/__init__.py.in index 7b36d80..a423777 100644 --- a/src/ppm/__init__.py.in +++ b/src/ppm/__init__.py.in @@ -2,6 +2,6 @@ gettext_app = '@PACKAGE@' gettext_dir = '@GETTEXTDIR@' -ui_dir = '@PKGDATADIR@' +data_dir = '@PKGDATADIR@' version = '@VERSION@' prgname = '@PACKAGE@' diff --git a/src/prepaid-manager-applet.py b/src/prepaid-manager-applet.py index 59cef7a..9f6278c 100755 --- a/src/prepaid-manager-applet.py +++ b/src/prepaid-manager-applet.py @@ -32,6 +32,7 @@ from ppm.accountdb import AccountDB import gettext import gi +from gi.repository import Gio from gi.repository import GObject from gi.repository import GLib gi.require_version('Gtk', '3.0') @@ -41,6 +42,10 @@ from gi.repository import Gdk # noqa: E402 _ = None +# Needs to happen early so we can use it to create classes based on templates +resource = Gio.Resource.load(os.path.join(ppm.data_dir, "ppm.gresource")) +resource._register() + # The controller receives input and initiates a response by making calls on model # objects. A controller accepts input from the user and instructs the model and @@ -319,7 +324,7 @@ class PPMObject(object): """Load the user interfade description""" self.builder = Gtk.Builder() self.builder.set_translation_domain(ppm.gettext_app) - self.builder.add_from_file(os.path.join(ppm.ui_dir, '%s.ui' % ui)) + self.builder.add_from_resource('/org/gnome/PrepaidManager/ui/%s.ui' % ui) self.builder.connect_signals(self) def _add_elem(self, name): |