[network-manager-applet] all: use gresources



commit a4fa0bf297dbb148bb8ca1818eacaaaef85c803a
Author: Lubomir Rintel <lkundrak v3 sk>
Date:   Thu Dec 22 14:26:26 2016 +0100

    all: use gresources
    
    This seems like a good idea. Apart from a tiny speed improvement by
    avoiding directory lookups when loading the UI elements and condensing
    the XML data by whitespace ommission, this makes it easy to run the
    applet and the connection editor without installing them.
    
    This makes it possible to run the binaries directly from the build tree
    and not pick up the glade files from whatever happens to be installed in
    the system. Neat!

 .gitignore                                      |   10 ++++++
 configure.ac                                    |    1 +
 src/Makefile.am                                 |   15 ++++++---
 src/applet-device-ethernet.c                    |    2 +-
 src/applet-dialogs.c                            |    4 +-
 src/applet.c                                    |    2 +-
 src/applet.gresource.xml                        |    9 +++++
 src/connection-editor/Makefile.am               |   40 ++++++-----------------
 src/connection-editor/ce-page.c                 |   12 +++---
 src/connection-editor/ce-page.h                 |    2 +-
 src/connection-editor/ce.gresource.xml          |   30 +++++++++++++++++
 src/connection-editor/connection-helpers.c      |    8 ++--
 src/connection-editor/ip4-routes-dialog.c       |    4 +-
 src/connection-editor/ip6-routes-dialog.c       |    4 +-
 src/connection-editor/nm-connection-editor.c    |   10 +++---
 src/connection-editor/nm-connection-list.c      |   10 +++---
 src/connection-editor/page-bluetooth.c          |    2 +-
 src/connection-editor/page-bond.c               |    2 +-
 src/connection-editor/page-bridge-port.c        |    2 +-
 src/connection-editor/page-bridge.c             |    2 +-
 src/connection-editor/page-dcb.c                |    2 +-
 src/connection-editor/page-dsl.c                |    2 +-
 src/connection-editor/page-ethernet.c           |    2 +-
 src/connection-editor/page-general.c            |    2 +-
 src/connection-editor/page-infiniband.c         |    2 +-
 src/connection-editor/page-ip-tunnel.c          |    2 +-
 src/connection-editor/page-ip4.c                |    2 +-
 src/connection-editor/page-ip6.c                |    2 +-
 src/connection-editor/page-mobile.c             |    2 +-
 src/connection-editor/page-ppp.c                |    2 +-
 src/connection-editor/page-proxy.c              |    2 +-
 src/connection-editor/page-team-port.c          |    2 +-
 src/connection-editor/page-team.c               |    2 +-
 src/connection-editor/page-vlan.c               |    2 +-
 src/connection-editor/page-wifi-security.c      |    2 +-
 src/connection-editor/page-wifi.c               |    2 +-
 src/connection-editor/ppp-auth-methods-dialog.c |    4 +-
 src/ethernet-dialog.c                           |    4 +-
 src/libnm-gtk/Makefile.am                       |   24 +++++++++----
 src/libnm-gtk/nm-wifi-dialog.c                  |    4 +-
 src/libnm-gtk/nm.gresource.xml                  |    6 +++
 src/libnma/Makefile.am                          |   17 ++++++---
 src/libnma/nma-wifi-dialog.c                    |    4 +-
 src/libnma/nma.gresource.xml                    |    6 +++
 src/wireless-security/Makefile.am               |   28 ++++++----------
 src/wireless-security/eap-method-fast.c         |    2 +-
 src/wireless-security/eap-method-leap.c         |    2 +-
 src/wireless-security/eap-method-peap.c         |    2 +-
 src/wireless-security/eap-method-simple.c       |    2 +-
 src/wireless-security/eap-method-tls.c          |    2 +-
 src/wireless-security/eap-method-ttls.c         |    2 +-
 src/wireless-security/eap-method.c              |   12 +++---
 src/wireless-security/eap-method.h              |    2 +-
 src/wireless-security/wireless-security.c       |   12 +++---
 src/wireless-security/wireless-security.h       |    2 +-
 src/wireless-security/ws-dynamic-wep.c          |    2 +-
 src/wireless-security/ws-leap.c                 |    2 +-
 src/wireless-security/ws-wep-key.c              |    2 +-
 src/wireless-security/ws-wpa-eap.c              |    2 +-
 src/wireless-security/ws-wpa-psk.c              |    2 +-
 src/wireless-security/ws.gresource.xml          |   16 +++++++++
 61 files changed, 217 insertions(+), 149 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 7e7331d..facc259 100644
--- a/.gitignore
+++ b/.gitignore
@@ -45,16 +45,26 @@ org.gnome.nm-applet.gschema.valid
 org.gnome.nm-connection-editor.appdata.xml
 src/connection-editor/nm-connection-editor
 src/connection-editor/nm-connection-editor-service-glue.h
+src/connection-editor/ce-resources.c
+src/connection-editor/ce-resources.h
 src/libnma/libnma.pc
 src/libnma/NMA-1.0.gir
 src/libnma/NMA-1.0.typelib
+src/libnma/nma-resources.c
+src/libnma/nma-resources.h
 src/libnm-gtk/libnm-gtk.pc
 src/libnm-gtk/NMGtk-1.0.gir
 src/libnm-gtk/NMGtk-1.0.typelib
 src/libnm-gtk/tests/test-mobile-providers
+src/libnm-gtk/nm-resources.c
+src/libnm-gtk/nm-resources.h
 src/marshallers/nma-marshal.*
 src/nm-applet
 src/applet-dbus-bindings.h
+src/applet-resources.c
+src/applet-resources.h
+src/wireless-security/ws-resources.c
+src/wireless-security/ws-resources.h
 man/*.1
 
 /test-driver
diff --git a/configure.ac b/configure.ac
index e021a2e..820139e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -140,6 +140,7 @@ GOBJECT_INTROSPECTION_CHECK([0.9.6])
 
 GLIB_CONFIG_NMA
 GLIB_GSETTINGS
+AC_PATH_PROG(GLIB_COMPILE_RESOURCES, glib-compile-resources)
 
 dnl
 dnl Compiler flags
diff --git a/src/Makefile.am b/src/Makefile.am
index aaad63e..59a15cd 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -12,7 +12,6 @@ nm_applet_CPPFLAGS = \
        -DNM_VERSION_MIN_REQUIRED=NM_VERSION_1_4 \
        -DNM_VERSION_MAX_ALLOWED=NM_VERSION_1_4 \
        -DICONDIR=\""$(datadir)/icons"\"                                                \
-       -DUIDIR=\""$(uidir)"\"                                                  \
        -DBINDIR=\""$(bindir)"\"                                                                \
        -DSYSCONFDIR=\""$(sysconfdir)"\"                                                \
        -DLIBEXECDIR=\""$(libexecdir)"\" \
@@ -48,6 +47,8 @@ nm_applet_SOURCES = \
        mobile-helpers.h \
        applet-device-bt.h \
        applet-device-bt.c \
+       applet-resources.h \
+       applet-resources.c \
        fallback-icon.h
 
 if WITH_WWAN
@@ -56,6 +57,10 @@ nm_applet_SOURCES += \
        applet-device-broadband.c
 endif
 
+BUILT_SOURCES = \
+       applet-resources.h \
+       applet-resources.c
+
 nm_applet_LDADD = \
        -lm \
        $(GTK_LIBS) \
@@ -68,8 +73,8 @@ nm_applet_LDADD = \
        ${top_builddir}/src/wireless-security/libwireless-security-libnm.la \
        ${top_builddir}/src/libnma/libnma.la
 
-uidir = $(datadir)/nm-applet
-ui_DATA = gsm-unlock.ui info.ui 8021x.ui keyring.png
-
-EXTRA_DIST = $(ui_DATA)
+applet-resources.h: applet.gresource.xml
+       $(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) $< --target=$@ --sourcedir=$(srcdir) --generate-header 
--internal
 
+applet-resources.c: applet.gresource.xml $(shell $(GLIB_COMPILE_RESOURCES) --sourcedir=$(srcdir) 
--generate-dependencies $(builddir)/applet.gresource.xml)
+       $(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) $< --target=$@ --sourcedir=$(srcdir) --generate-source 
--internal
diff --git a/src/applet-device-ethernet.c b/src/applet-device-ethernet.c
index cc737dd..da2a89f 100644
--- a/src/applet-device-ethernet.c
+++ b/src/applet-device-ethernet.c
@@ -321,7 +321,7 @@ pppoe_get_secrets (SecretsRequest *req, GError **error)
 
        builder = gtk_builder_new ();
 
-       if (!gtk_builder_add_from_file (builder, UIDIR "/ce-page-dsl.ui", &tmp_error)) {
+       if (!gtk_builder_add_from_resource (builder, 
"/org/freedesktop/network-manager-applet/connection-editor/ce-page-dsl.ui", &tmp_error)) {
                g_set_error (error,
                             NM_SECRET_AGENT_ERROR,
                             NM_SECRET_AGENT_ERROR_FAILED,
diff --git a/src/applet-dialogs.c b/src/applet-dialogs.c
index 20391ec..662da03 100644
--- a/src/applet-dialogs.c
+++ b/src/applet-dialogs.c
@@ -1317,8 +1317,8 @@ applet_mobile_pin_dialog_new (const char *unlock_required,
 
        builder = gtk_builder_new ();
 
-       if (!gtk_builder_add_from_file (builder, UIDIR "/gsm-unlock.ui", &error)) {
-               g_warning ("Couldn't load builder file: %s", error->message);
+       if (!gtk_builder_add_from_resource (builder, "/org/freedesktop/network-manager-applet/gsm-unlock.ui", 
&error)) {
+               g_warning ("Couldn't load builder resource: %s", error->message);
                g_error_free (error);
                g_object_unref (builder);
                return NULL;
diff --git a/src/applet.c b/src/applet.c
index b702f8e..fff0b65 100644
--- a/src/applet.c
+++ b/src/applet.c
@@ -3234,7 +3234,7 @@ applet_startup (GApplication *app, gpointer user_data)
 
        applet->info_dialog_ui = gtk_builder_new ();
 
-       if (!gtk_builder_add_from_file (applet->info_dialog_ui, UIDIR "/info.ui", &error)) {
+       if (!gtk_builder_add_from_resource (applet->info_dialog_ui, 
"/org/freedesktop/network-manager-applet/info.ui", &error)) {
                g_warning ("Could not load info dialog UI file: %s", error->message);
                g_application_quit (app);
                return;
diff --git a/src/applet.gresource.xml b/src/applet.gresource.xml
new file mode 100644
index 0000000..1ee8519
--- /dev/null
+++ b/src/applet.gresource.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<gresources>
+       <gresource prefix="/org/freedesktop/network-manager-applet">
+               <file preprocess="xml-stripblanks">connection-editor/ce-page-dsl.ui</file>
+               <file preprocess="xml-stripblanks">gsm-unlock.ui</file>
+               <file preprocess="xml-stripblanks">info.ui</file>
+               <file preprocess="xml-stripblanks">8021x.ui</file>
+       </gresource>
+</gresources>
diff --git a/src/connection-editor/Makefile.am b/src/connection-editor/Makefile.am
index 091c1dc..03fbef9 100644
--- a/src/connection-editor/Makefile.am
+++ b/src/connection-editor/Makefile.am
@@ -7,7 +7,6 @@ nm_connection_editor_CPPFLAGS = \
        -DNM_VERSION_MIN_REQUIRED=NM_VERSION_1_4 \
        -DNM_VERSION_MAX_ALLOWED=NM_VERSION_1_4 \
        -DICONDIR=\""$(datadir)/icons"\" \
-       -DUIDIR=\""$(uidir)"\" \
        -DBINDIR=\""$(bindir)"\" \
        -DSYSCONFDIR=\""$(sysconfdir)"\" \
        -DLIBDIR=\""$(libdir)"\" \
@@ -18,7 +17,13 @@ nm_connection_editor_CPPFLAGS = \
        -I${top_srcdir}/src/wireless-security \
        -I${top_srcdir}/src/libnma
 
+BUILT_SOURCES = \
+       ce-resources.h \
+       ce-resources.c
+
 nm_connection_editor_SOURCES = \
+       ce-resources.h \
+       ce-resources.c \
        nm-connection-editor.c \
        nm-connection-editor.h \
        nm-connection-list.c \
@@ -94,33 +99,8 @@ nm_connection_editor_LDADD = \
        $(JANSSON_LIBS) \
        -lm
 
-uidir = $(datadir)/nm-applet
-ui_DATA = \
-       nm-connection-editor.ui \
-       ce-new-connection.ui \
-       ce-page-general.ui \
-       ce-page-ethernet.ui \
-       ce-page-wifi.ui \
-       ce-page-wifi-security.ui \
-       ce-page-infiniband.ui \
-       ce-page-bond.ui \
-       ce-page-team.ui \
-       ce-page-team-port.ui \
-       ce-page-bridge.ui \
-       ce-page-bridge-port.ui \
-       ce-page-proxy.ui \
-       ce-page-ip4.ui \
-       ce-ip4-routes.ui \
-       ce-page-ip6.ui \
-       ce-ip6-routes.ui \
-       ce-page-ip-tunnel.ui \
-       ce-page-dsl.ui \
-       ce-page-mobile.ui \
-       ce-page-bluetooth.ui \
-       ce-page-ppp.ui \
-       ce-ppp-auth-methods.ui \
-       ce-page-vlan.ui \
-       ce-page-dcb.ui
-
-EXTRA_DIST = $(ui_DATA)
+ce-resources.h: ce.gresource.xml
+       $(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) $< --target=$@ --sourcedir=$(srcdir) --generate-header 
--internal
 
+ce-resources.c: ce.gresource.xml $(shell $(GLIB_COMPILE_RESOURCES) --sourcedir=$(srcdir) 
--generate-dependencies $(builddir)/ce.gresource.xml)
+       $(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) $< --target=$@ --sourcedir=$(srcdir) --generate-source 
--internal
diff --git a/src/connection-editor/ce-page.c b/src/connection-editor/ce-page.c
index 68c0e04..c07157f 100644
--- a/src/connection-editor/ce-page.c
+++ b/src/connection-editor/ce-page.c
@@ -847,7 +847,7 @@ ce_page_new (GType page_type,
              NMConnection *connection,
              GtkWindow *parent_window,
              NMClient *client,
-             const char *ui_file,
+             const char *ui_resource,
              const char *widget_name,
              const char *title)
 {
@@ -855,7 +855,7 @@ ce_page_new (GType page_type,
        GError *error = NULL;
 
        g_return_val_if_fail (title != NULL, NULL);
-       if (ui_file)
+       if (ui_resource)
                g_return_val_if_fail (widget_name != NULL, NULL);
 
        self = CE_PAGE (g_object_new (page_type,
@@ -866,9 +866,9 @@ ce_page_new (GType page_type,
        self->client = client;
        self->editor = editor;
 
-       if (ui_file) {
-               if (!gtk_builder_add_from_file (self->builder, ui_file, &error)) {
-                       g_warning ("Couldn't load builder file: %s", error->message);
+       if (ui_resource) {
+               if (!gtk_builder_add_from_resource (self->builder, ui_resource, &error)) {
+                       g_warning ("Couldn't load builder resource: %s", error->message);
                        g_error_free (error);
                        g_object_unref (self);
                        return NULL;
@@ -876,7 +876,7 @@ ce_page_new (GType page_type,
 
                self->page = GTK_WIDGET (gtk_builder_get_object (self->builder, widget_name));
                if (!self->page) {
-                       g_warning ("Couldn't load page widget '%s' from %s", widget_name, ui_file);
+                       g_warning ("Couldn't load page widget '%s' from %s", widget_name, ui_resource);
                        g_object_unref (self);
                        return NULL;
                }
diff --git a/src/connection-editor/ce-page.h b/src/connection-editor/ce-page.h
index 85acdf6..29bbaa0 100644
--- a/src/connection-editor/ce-page.h
+++ b/src/connection-editor/ce-page.h
@@ -195,7 +195,7 @@ CEPage *ce_page_new (GType page_type,
                      NMConnection *connection,
                      GtkWindow *parent_window,
                      NMClient *client,
-                     const char *ui_file,
+                     const char *ui_resource,
                      const char *widget_name,
                      const char *title);
 
diff --git a/src/connection-editor/ce.gresource.xml b/src/connection-editor/ce.gresource.xml
new file mode 100644
index 0000000..b12d953
--- /dev/null
+++ b/src/connection-editor/ce.gresource.xml
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<gresources>
+       <gresource prefix="/org/freedesktop/network-manager-applet">
+               <file preprocess="xml-stripblanks">nm-connection-editor.ui</file>
+               <file preprocess="xml-stripblanks">ce-ip4-routes.ui</file>
+               <file preprocess="xml-stripblanks">ce-ip6-routes.ui</file>
+               <file preprocess="xml-stripblanks">ce-new-connection.ui</file>
+               <file preprocess="xml-stripblanks">ce-page-bluetooth.ui</file>
+               <file preprocess="xml-stripblanks">ce-page-bond.ui</file>
+               <file preprocess="xml-stripblanks">ce-page-bridge-port.ui</file>
+               <file preprocess="xml-stripblanks">ce-page-bridge.ui</file>
+               <file preprocess="xml-stripblanks">ce-page-dcb.ui</file>
+               <file preprocess="xml-stripblanks">ce-page-dsl.ui</file>
+               <file preprocess="xml-stripblanks">ce-page-ethernet.ui</file>
+               <file preprocess="xml-stripblanks">ce-page-general.ui</file>
+               <file preprocess="xml-stripblanks">ce-page-infiniband.ui</file>
+               <file preprocess="xml-stripblanks">ce-page-ip4.ui</file>
+               <file preprocess="xml-stripblanks">ce-page-ip6.ui</file>
+               <file preprocess="xml-stripblanks">ce-page-ip-tunnel.ui</file>
+               <file preprocess="xml-stripblanks">ce-page-mobile.ui</file>
+               <file preprocess="xml-stripblanks">ce-page-ppp.ui</file>
+               <file preprocess="xml-stripblanks">ce-page-proxy.ui</file>
+               <file preprocess="xml-stripblanks">ce-page-team-port.ui</file>
+               <file preprocess="xml-stripblanks">ce-page-team.ui</file>
+               <file preprocess="xml-stripblanks">ce-page-vlan.ui</file>
+               <file preprocess="xml-stripblanks">ce-page-wifi-security.ui</file>
+               <file preprocess="xml-stripblanks">ce-page-wifi.ui</file>
+               <file preprocess="xml-stripblanks">ce-ppp-auth-methods.ui</file>
+       </gresource>
+</gresources>
diff --git a/src/connection-editor/connection-helpers.c b/src/connection-editor/connection-helpers.c
index 4ad014a..39e461f 100644
--- a/src/connection-editor/connection-helpers.c
+++ b/src/connection-editor/connection-helpers.c
@@ -630,10 +630,10 @@ new_connection_dialog_full (GtkWindow *parent_window,
 
        /* load GUI */
        gui = gtk_builder_new ();
-       if (!gtk_builder_add_from_file (gui,
-                                       UIDIR "/ce-new-connection.ui",
-                                       &error)) {
-               g_warning ("Couldn't load builder file: %s", error->message);
+       if (!gtk_builder_add_from_resource (gui,
+                                           "/org/freedesktop/network-manager-applet/ce-new-connection.ui",
+                                           &error)) {
+               g_warning ("Couldn't load builder resource: %s", error->message);
                g_error_free (error);
                g_object_unref (gui);
                return;
diff --git a/src/connection-editor/ip4-routes-dialog.c b/src/connection-editor/ip4-routes-dialog.c
index edb225e..0b21bf5 100644
--- a/src/connection-editor/ip4-routes-dialog.c
+++ b/src/connection-editor/ip4-routes-dialog.c
@@ -624,8 +624,8 @@ ip4_routes_dialog_new (NMSettingIPConfig *s_ip4, gboolean automatic)
 
        builder = gtk_builder_new ();
 
-       if (!gtk_builder_add_from_file (builder, UIDIR "/ce-ip4-routes.ui", &error)) {
-               g_warning ("Couldn't load builder file: %s", error->message);
+       if (!gtk_builder_add_from_resource (builder, 
"/org/freedesktop/network-manager-applet/ce-ip4-routes.ui", &error)) {
+               g_warning ("Couldn't load builder resource: %s", error->message);
                g_error_free (error);
                return NULL;
        }
diff --git a/src/connection-editor/ip6-routes-dialog.c b/src/connection-editor/ip6-routes-dialog.c
index 95f81ad..64e060a 100644
--- a/src/connection-editor/ip6-routes-dialog.c
+++ b/src/connection-editor/ip6-routes-dialog.c
@@ -648,8 +648,8 @@ ip6_routes_dialog_new (NMSettingIPConfig *s_ip6, gboolean automatic)
 
        builder = gtk_builder_new ();
 
-       if (!gtk_builder_add_from_file (builder, UIDIR "/ce-ip6-routes.ui", &error)) {
-               g_warning ("Couldn't load builder file: %s", error->message);
+       if (!gtk_builder_add_from_resource (builder, 
"/org/freedesktop/network-manager-applet/ce-ip6-routes.ui", &error)) {
+               g_warning ("Couldn't load builder resource: %s", error->message);
                g_error_free (error);
                return NULL;
        }
diff --git a/src/connection-editor/nm-connection-editor.c b/src/connection-editor/nm-connection-editor.c
index 6032a98..70f008e 100644
--- a/src/connection-editor/nm-connection-editor.c
+++ b/src/connection-editor/nm-connection-editor.c
@@ -271,11 +271,11 @@ nm_connection_editor_init (NMConnectionEditor *editor)
 
        editor->builder = gtk_builder_new ();
 
-       if (!gtk_builder_add_objects_from_file (editor->builder,
-                                               UIDIR "/nm-connection-editor.ui",
-                                               (char **) objects,
-                                               &error)) {
-               g_warning ("Couldn't load builder file " UIDIR "/nm-connection-editor.ui: %s", 
error->message);
+       if (!gtk_builder_add_objects_from_resource (editor->builder,
+                                                   
"/org/freedesktop/network-manager-applet/nm-connection-editor.ui",
+                                                   (char **) objects,
+                                                   &error)) {
+               g_warning ("Couldn't load builder resource " 
"/org/freedesktop/network-manager-applet/nm-connection-editor.ui: %s", error->message);
                g_error_free (error);
 
                dialog = gtk_message_dialog_new (NULL, 0,
diff --git a/src/connection-editor/nm-connection-list.c b/src/connection-editor/nm-connection-list.c
index 7fc482a..1ae111d 100644
--- a/src/connection-editor/nm-connection-list.c
+++ b/src/connection-editor/nm-connection-list.c
@@ -861,11 +861,11 @@ nm_connection_list_new (void)
        /* load GUI */
        list->gui = gtk_builder_new ();
 
-       if (!gtk_builder_add_objects_from_file (list->gui,
-                                               UIDIR "/nm-connection-editor.ui",
-                                               (char **) objects,
-                                               &error)) {
-               g_warning ("Couldn't load builder file: %s", error->message);
+       if (!gtk_builder_add_objects_from_resource (list->gui,
+                                                   
"/org/freedesktop/network-manager-applet/nm-connection-editor.ui",
+                                                   (char **) objects,
+                                                   &error)) {
+               g_warning ("Couldn't load builder resource: %s", error->message);
                g_error_free (error);
                goto error;
        }
diff --git a/src/connection-editor/page-bluetooth.c b/src/connection-editor/page-bluetooth.c
index 65eed70..17d23b1 100644
--- a/src/connection-editor/page-bluetooth.c
+++ b/src/connection-editor/page-bluetooth.c
@@ -118,7 +118,7 @@ ce_page_bluetooth_new (NMConnectionEditor *editor,
                                  connection,
                                  parent_window,
                                  client,
-                                 UIDIR "/ce-page-bluetooth.ui",
+                                 "/org/freedesktop/network-manager-applet/ce-page-bluetooth.ui",
                                  "BluetoothPage",
                                  _("Bluetooth")));
        if (!self) {
diff --git a/src/connection-editor/page-bond.c b/src/connection-editor/page-bond.c
index 5af08b0..1e1c48c 100644
--- a/src/connection-editor/page-bond.c
+++ b/src/connection-editor/page-bond.c
@@ -441,7 +441,7 @@ ce_page_bond_new (NMConnectionEditor *editor,
                                          connection,
                                          parent_window,
                                          client,
-                                         UIDIR "/ce-page-bond.ui",
+                                         "/org/freedesktop/network-manager-applet/ce-page-bond.ui",
                                          "BondPage",
                                          _("Bond")));
        if (!self) {
diff --git a/src/connection-editor/page-bridge-port.c b/src/connection-editor/page-bridge-port.c
index 09bae1f..00ee9fb 100644
--- a/src/connection-editor/page-bridge-port.c
+++ b/src/connection-editor/page-bridge-port.c
@@ -100,7 +100,7 @@ ce_page_bridge_port_new (NMConnectionEditor *editor,
                                                 connection,
                                                 parent_window,
                                                 client,
-                                                UIDIR "/ce-page-bridge-port.ui",
+                                                
"/org/freedesktop/network-manager-applet/ce-page-bridge-port.ui",
                                                 "BridgePortPage",
                                                 /* Translators: a "Bridge Port" is a network
                                                  * device that is part of a bridge.
diff --git a/src/connection-editor/page-bridge.c b/src/connection-editor/page-bridge.c
index 6ebe573..62881bf 100644
--- a/src/connection-editor/page-bridge.c
+++ b/src/connection-editor/page-bridge.c
@@ -207,7 +207,7 @@ ce_page_bridge_new (NMConnectionEditor *editor,
                                          connection,
                                          parent_window,
                                          client,
-                                         UIDIR "/ce-page-bridge.ui",
+                                         "/org/freedesktop/network-manager-applet/ce-page-bridge.ui",
                                          "BridgePage",
                                          _("Bridge")));
        if (!self) {
diff --git a/src/connection-editor/page-dcb.c b/src/connection-editor/page-dcb.c
index 4d995d3..f739cac 100644
--- a/src/connection-editor/page-dcb.c
+++ b/src/connection-editor/page-dcb.c
@@ -617,7 +617,7 @@ ce_page_dcb_new (NMConnectionEditor *editor,
                                         connection,
                                         parent_window,
                                         client,
-                                        UIDIR "/ce-page-dcb.ui",
+                                        "/org/freedesktop/network-manager-applet/ce-page-dcb.ui",
                                         "DcbPage",
                                         _("DCB")));
        if (!self) {
diff --git a/src/connection-editor/page-dsl.c b/src/connection-editor/page-dsl.c
index 82a5e21..ced588a 100644
--- a/src/connection-editor/page-dsl.c
+++ b/src/connection-editor/page-dsl.c
@@ -122,7 +122,7 @@ ce_page_dsl_new (NMConnectionEditor *editor,
                                         connection,
                                         parent_window,
                                         client,
-                                        UIDIR "/ce-page-dsl.ui",
+                                        "/org/freedesktop/network-manager-applet/ce-page-dsl.ui",
                                         "DslPage",
                                         _("DSL")));
        if (!self) {
diff --git a/src/connection-editor/page-ethernet.c b/src/connection-editor/page-ethernet.c
index e565651..813fbf8 100644
--- a/src/connection-editor/page-ethernet.c
+++ b/src/connection-editor/page-ethernet.c
@@ -347,7 +347,7 @@ ce_page_ethernet_new (NMConnectionEditor *editor,
                                              connection,
                                              parent_window,
                                              client,
-                                             UIDIR "/ce-page-ethernet.ui",
+                                             "/org/freedesktop/network-manager-applet/ce-page-ethernet.ui",
                                              "EthernetPage",
                                              _("Ethernet")));
        if (!self) {
diff --git a/src/connection-editor/page-general.c b/src/connection-editor/page-general.c
index dc1bb8e..d417d13 100644
--- a/src/connection-editor/page-general.c
+++ b/src/connection-editor/page-general.c
@@ -362,7 +362,7 @@ ce_page_general_new (NMConnectionEditor *editor,
                                             connection,
                                             parent_window,
                                             client,
-                                            UIDIR "/ce-page-general.ui",
+                                            "/org/freedesktop/network-manager-applet/ce-page-general.ui",
                                             "GeneralPage",
                                             _("General")));
        if (!self) {
diff --git a/src/connection-editor/page-infiniband.c b/src/connection-editor/page-infiniband.c
index 639b353..6139447 100644
--- a/src/connection-editor/page-infiniband.c
+++ b/src/connection-editor/page-infiniband.c
@@ -143,7 +143,7 @@ ce_page_infiniband_new (NMConnectionEditor *editor,
                                                connection,
                                                parent_window,
                                                client,
-                                               UIDIR "/ce-page-infiniband.ui",
+                                               
"/org/freedesktop/network-manager-applet/ce-page-infiniband.ui",
                                                "InfinibandPage",
                                                _("InfiniBand")));
        if (!self) {
diff --git a/src/connection-editor/page-ip-tunnel.c b/src/connection-editor/page-ip-tunnel.c
index eca3a0c..ce5949f 100644
--- a/src/connection-editor/page-ip-tunnel.c
+++ b/src/connection-editor/page-ip-tunnel.c
@@ -171,7 +171,7 @@ ce_page_ip_tunnel_new (NMConnectionEditor *editor,
                                               connection,
                                               parent_window,
                                               client,
-                                              UIDIR "/ce-page-ip-tunnel.ui",
+                                              "/org/freedesktop/network-manager-applet/ce-page-ip-tunnel.ui",
                                               "IPTunnelPage",
                                               _("IP tunnel")));
        if (!self) {
diff --git a/src/connection-editor/page-ip4.c b/src/connection-editor/page-ip4.c
index fb91808..bb3dbe9 100644
--- a/src/connection-editor/page-ip4.c
+++ b/src/connection-editor/page-ip4.c
@@ -1221,7 +1221,7 @@ ce_page_ip4_new (NMConnectionEditor *editor,
                                         connection,
                                         parent_window,
                                         client,
-                                        UIDIR "/ce-page-ip4.ui",
+                                        "/org/freedesktop/network-manager-applet/ce-page-ip4.ui",
                                         "IP4Page",
                                         _("IPv4 Settings")));
        if (!self) {
diff --git a/src/connection-editor/page-ip6.c b/src/connection-editor/page-ip6.c
index 46985e9..280b4fa 100644
--- a/src/connection-editor/page-ip6.c
+++ b/src/connection-editor/page-ip6.c
@@ -1174,7 +1174,7 @@ ce_page_ip6_new (NMConnectionEditor *editor,
                                         connection,
                                         parent_window,
                                         client,
-                                        UIDIR "/ce-page-ip6.ui",
+                                        "/org/freedesktop/network-manager-applet/ce-page-ip6.ui",
                                         "IP6Page",
                                         _("IPv6 Settings")));
        if (!self) {
diff --git a/src/connection-editor/page-mobile.c b/src/connection-editor/page-mobile.c
index cbe0fb1..02ccd67 100644
--- a/src/connection-editor/page-mobile.c
+++ b/src/connection-editor/page-mobile.c
@@ -303,7 +303,7 @@ ce_page_mobile_new (NMConnectionEditor *editor,
                                            connection,
                                            parent_window,
                                            client,
-                                           UIDIR "/ce-page-mobile.ui",
+                                           "/org/freedesktop/network-manager-applet/ce-page-mobile.ui",
                                            "MobilePage",
                                            _("Mobile Broadband")));
        if (!self) {
diff --git a/src/connection-editor/page-ppp.c b/src/connection-editor/page-ppp.c
index e9b4ac6..de01bf2 100644
--- a/src/connection-editor/page-ppp.c
+++ b/src/connection-editor/page-ppp.c
@@ -274,7 +274,7 @@ ce_page_ppp_new (NMConnectionEditor *editor,
                                         connection,
                                         parent_window,
                                         client,
-                                        UIDIR "/ce-page-ppp.ui",
+                                        "/org/freedesktop/network-manager-applet/ce-page-ppp.ui",
                                         "PppPage",
                                         _("PPP Settings")));
        if (!self) {
diff --git a/src/connection-editor/page-proxy.c b/src/connection-editor/page-proxy.c
index 6d82cb3..3422239 100644
--- a/src/connection-editor/page-proxy.c
+++ b/src/connection-editor/page-proxy.c
@@ -212,7 +212,7 @@ ce_page_proxy_new (NMConnectionEditor *editor,
                                           connection,
                                           parent_window,
                                           client,
-                                          UIDIR "/ce-page-proxy.ui",
+                                          "/org/freedesktop/network-manager-applet/ce-page-proxy.ui",
                                           "ProxyPage",
                                           _("Proxy")));
        if (!self) {
diff --git a/src/connection-editor/page-team-port.c b/src/connection-editor/page-team-port.c
index 791c03c..e9d0c01 100644
--- a/src/connection-editor/page-team-port.c
+++ b/src/connection-editor/page-team-port.c
@@ -724,7 +724,7 @@ ce_page_team_port_new (NMConnectionEditor *editor,
                                               connection,
                                               parent_window,
                                               client,
-                                              UIDIR "/ce-page-team-port.ui",
+                                              "/org/freedesktop/network-manager-applet/ce-page-team-port.ui",
                                               "TeamPortPage",
                                               /* Translators: a "Team Port" is a network
                                                * device that is part of a team.
diff --git a/src/connection-editor/page-team.c b/src/connection-editor/page-team.c
index 4065202..cef8607 100644
--- a/src/connection-editor/page-team.c
+++ b/src/connection-editor/page-team.c
@@ -1148,7 +1148,7 @@ ce_page_team_new (NMConnectionEditor *editor,
                                          connection,
                                          parent_window,
                                          client,
-                                         UIDIR "/ce-page-team.ui",
+                                         "/org/freedesktop/network-manager-applet/ce-page-team.ui",
                                          "TeamPage",
                                          _("Team")));
        if (!self) {
diff --git a/src/connection-editor/page-vlan.c b/src/connection-editor/page-vlan.c
index fdd3a6b..38ce92e 100644
--- a/src/connection-editor/page-vlan.c
+++ b/src/connection-editor/page-vlan.c
@@ -588,7 +588,7 @@ ce_page_vlan_new (NMConnectionEditor *editor,
                                          connection,
                                          parent_window,
                                          client,
-                                         UIDIR "/ce-page-vlan.ui",
+                                         "/org/freedesktop/network-manager-applet/ce-page-vlan.ui",
                                          "VlanPage",
                                          _("VLAN")));
        if (!self) {
diff --git a/src/connection-editor/page-wifi-security.c b/src/connection-editor/page-wifi-security.c
index b775aa9..08d320a 100644
--- a/src/connection-editor/page-wifi-security.c
+++ b/src/connection-editor/page-wifi-security.c
@@ -420,7 +420,7 @@ ce_page_wifi_security_new (NMConnectionEditor *editor,
                                                   connection,
                                                   parent_window,
                                                   client,
-                                                  UIDIR "/ce-page-wifi-security.ui",
+                                                  
"/org/freedesktop/network-manager-applet/ce-page-wifi-security.ui",
                                                   "WifiSecurityPage",
                                                   _("Wi-Fi Security")));
        if (!self) {
diff --git a/src/connection-editor/page-wifi.c b/src/connection-editor/page-wifi.c
index e0a460f..a83507c 100644
--- a/src/connection-editor/page-wifi.c
+++ b/src/connection-editor/page-wifi.c
@@ -436,7 +436,7 @@ ce_page_wifi_new (NMConnectionEditor *editor,
                                          connection,
                                          parent_window,
                                          client,
-                                         UIDIR "/ce-page-wifi.ui",
+                                         "/org/freedesktop/network-manager-applet/ce-page-wifi.ui",
                                          "WifiPage",
                                          _("Wi-Fi")));
        if (!self) {
diff --git a/src/connection-editor/ppp-auth-methods-dialog.c b/src/connection-editor/ppp-auth-methods-dialog.c
index 3613442..346c31e 100644
--- a/src/connection-editor/ppp-auth-methods-dialog.c
+++ b/src/connection-editor/ppp-auth-methods-dialog.c
@@ -86,8 +86,8 @@ ppp_auth_methods_dialog_new (gboolean refuse_eap,
 
        builder = gtk_builder_new ();
 
-       if (!gtk_builder_add_from_file (builder, UIDIR "/ce-ppp-auth-methods.ui", &error)) {
-               g_warning ("Couldn't load builder file: %s", error->message);
+       if (!gtk_builder_add_from_resource (builder, 
"/org/freedesktop/network-manager-applet/ce-ppp-auth-methods.ui", &error)) {
+               g_warning ("Couldn't load builder resource: %s", error->message);
                g_error_free (error);
                return NULL;
        }
diff --git a/src/ethernet-dialog.c b/src/ethernet-dialog.c
index c50ffb6..2f7275a 100644
--- a/src/ethernet-dialog.c
+++ b/src/ethernet-dialog.c
@@ -80,8 +80,8 @@ nma_ethernet_dialog_new (NMConnection *connection)
 
        builder = gtk_builder_new ();
 
-       if (!gtk_builder_add_from_file (builder, UIDIR "/8021x.ui", &error)) {
-               g_warning ("Couldn't load builder file: %s", error->message);
+       if (!gtk_builder_add_from_resource (builder, "/org/freedesktop/network-manager-applet/8021x.ui", 
&error)) {
+               g_warning ("Couldn't load builder resource: %s", error->message);
                g_error_free (error);
                applet_missing_ui_warning_dialog_show ();
                g_object_unref (builder);
diff --git a/src/libnm-gtk/Makefile.am b/src/libnm-gtk/Makefile.am
index e3830f6..1e5bece 100644
--- a/src/libnm-gtk/Makefile.am
+++ b/src/libnm-gtk/Makefile.am
@@ -1,8 +1,5 @@
 SUBDIRS = . tests examples
 
-uidir = $(datadir)/libnm-gtk
-ui_DATA = wifi.ui
-
 libnmgtkdir = $(includedir)/libnm-gtk
 
 libnmgtk_HEADERS = \
@@ -15,6 +12,10 @@ libnmgtk_HEADERS = \
 
 lib_LTLIBRARIES = libnm-gtk.la
 
+BUILT_SOURCES = \
+       nm-resources.h \
+       nm-resources.c
+
 libnm_gtk_la_SOURCES = \
        nm-wifi-dialog.c \
        nm-wireless-dialog.c \
@@ -22,6 +23,8 @@ libnm_gtk_la_SOURCES = \
        nm-ui-utils.c \
        nm-mobile-providers.c \
        nm-vpn-password-dialog.c \
+       nm-resources.h \
+       nm-resources.c \
        init.c
 
 libnm_gtk_la_CFLAGS = \
@@ -30,7 +33,6 @@ libnm_gtk_la_CFLAGS = \
        $(GUDEV_CFLAGS) \
        -DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_LIB_LEGACY \
        -DICONDIR=\""$(datadir)/icons"\" \
-       -DUIDIR=\""$(uidir)"\" \
        -DBINDIR=\""$(bindir)"\" \
        -DSYSCONFDIR=\""$(sysconfdir)"\" \
        -DLIBEXECDIR=\""$(libexecdir)"\" \
@@ -52,6 +54,12 @@ EXTRA_libnm_gtk_la_DEPENDENCIES = $(srcdir)/libnm-gtk.ver
 libnm_gtk_la_LDFLAGS = -Wl,-no-undefined \
        -Wl,--version-script=$(srcdir)/libnm-gtk.ver
 
+nm-resources.h: nm.gresource.xml
+       $(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) $< --target=$@ --sourcedir=$(srcdir) --generate-header 
--internal
+
+nm-resources.c: nm.gresource.xml $(shell $(GLIB_COMPILE_RESOURCES) --sourcedir=$(srcdir) 
--generate-dependencies $(builddir)/nm.gresource.xml)
+       $(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) $< --target=$@ --sourcedir=$(srcdir) --generate-source 
--internal
+
 pkgconfigdir = $(libdir)/pkgconfig
 pkgconfig_DATA = libnm-gtk.pc
 
@@ -59,9 +67,9 @@ pkgconfig_DATA = libnm-gtk.pc
 INTROSPECTION_GIRS =
 
 if HAVE_INTROSPECTION
-introspection_sources =                        \
-       $(filter-out                    \
-               nm-wireless-dialog.%,   \
+introspection_sources =                                        \
+       $(filter-out                                    \
+               $(BUILT_SOURCES) nm-wireless-dialog.%,  \
                $(libnmgtk_HEADERS) $(libnm_gtk_la_SOURCES))
 
 NMGtk-1.0.gir: libnm-gtk.la
@@ -85,4 +93,4 @@ check-local:
 CLEANFILES = $(gir_DATA) $(typelib_DATA)
 endif
 
-EXTRA_DIST = libnm-gtk.pc.in libnm-gtk.ver check-exports.sh $(ui_DATA)
+EXTRA_DIST = libnm-gtk.pc.in libnm-gtk.ver check-exports.sh
diff --git a/src/libnm-gtk/nm-wifi-dialog.c b/src/libnm-gtk/nm-wifi-dialog.c
index 303857c..0e5e8cc 100644
--- a/src/libnm-gtk/nm-wifi-dialog.c
+++ b/src/libnm-gtk/nm-wifi-dialog.c
@@ -1396,8 +1396,8 @@ nma_wifi_dialog_init (NMAWifiDialog *self)
 
        priv->builder = gtk_builder_new ();
 
-       if (!gtk_builder_add_from_file (priv->builder, UIDIR "/wifi.ui", &error)) {
-               g_warning ("Couldn't load builder file: %s", error->message);
+       if (!gtk_builder_add_from_resource (priv->builder, "/org/freedesktop/network-manager-applet/wifi.ui", 
&error)) {
+               g_warning ("Couldn't load builder resource: %s", error->message);
                g_error_free (error);
        }
 }
diff --git a/src/libnm-gtk/nm.gresource.xml b/src/libnm-gtk/nm.gresource.xml
new file mode 100644
index 0000000..a8a181e
--- /dev/null
+++ b/src/libnm-gtk/nm.gresource.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<gresources>
+       <gresource prefix="/org/freedesktop/network-manager-applet">
+               <file preprocess="xml-stripblanks">wifi.ui</file>
+       </gresource>
+</gresources>
diff --git a/src/libnma/Makefile.am b/src/libnma/Makefile.am
index 4dde7d4..9c9c038 100644
--- a/src/libnma/Makefile.am
+++ b/src/libnma/Makefile.am
@@ -1,6 +1,3 @@
-uidir = $(datadir)/libnma
-ui_DATA = wifi.ui
-
 libnmadir = $(includedir)/libnma
 
 libnma_HEADERS = \
@@ -12,12 +9,18 @@ libnma_HEADERS = \
 
 lib_LTLIBRARIES = libnma.la
 
+BUILT_SOURCES = \
+       nma-resources.h \
+       nma-resources.c
+
 libnma_la_SOURCES = \
        nma-wifi-dialog.c \
        nma-mobile-wizard.c \
        nma-mobile-providers.c \
        nma-vpn-password-dialog.c \
        nma-ui-utils.c \
+       nma-resources.h \
+       nma-resources.c \
        init.c
 
 libnma_la_CFLAGS = \
@@ -25,7 +28,6 @@ libnma_la_CFLAGS = \
        $(LIBNM_CFLAGS) \
        $(GUDEV_CFLAGS) \
        -DICONDIR=\""$(datadir)/icons"\" \
-       -DUIDIR=\""$(uidir)"\" \
        -DBINDIR=\""$(bindir)"\" \
        -DSYSCONFDIR=\""$(sysconfdir)"\" \
        -DLIBEXECDIR=\""$(libexecdir)"\" \
@@ -48,6 +50,11 @@ EXTRA_libnma_la_DEPENDENCIES = $(srcdir)/libnma.ver
 libnma_la_LDFLAGS = -Wl,-no-undefined \
        -Wl,--version-script=$(srcdir)/libnma.ver
 
+nma-resources.h: nma.gresource.xml
+       $(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) $< --target=$@ --sourcedir=$(srcdir) --generate-header 
--internal
+
+nma-resources.c: nma.gresource.xml $(shell $(GLIB_COMPILE_RESOURCES) --sourcedir=$(srcdir) 
--generate-dependencies $(builddir)/nma.gresource.xml)
+       $(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) $< --target=$@ --sourcedir=$(srcdir) --generate-source 
--internal
 
 pkgconfigdir = $(libdir)/pkgconfig
 pkgconfig_DATA = libnma.pc
@@ -75,5 +82,3 @@ typelib_DATA = $(INTROSPECTION_GIRS:.gir=.typelib)
 
 CLEANFILES = $(gir_DATA) $(typelib_DATA)
 endif
-
-EXTRA_DIST = libnma.pc.in libnma.ver $(ui_DATA)
diff --git a/src/libnma/nma-wifi-dialog.c b/src/libnma/nma-wifi-dialog.c
index a7098ee..bc965ec 100644
--- a/src/libnma/nma-wifi-dialog.c
+++ b/src/libnma/nma-wifi-dialog.c
@@ -1391,8 +1391,8 @@ nma_wifi_dialog_init (NMAWifiDialog *self)
 
        priv->builder = gtk_builder_new ();
 
-       if (!gtk_builder_add_from_file (priv->builder, UIDIR "/wifi.ui", &error)) {
-               g_warning ("Couldn't load builder file: %s", error->message);
+       if (!gtk_builder_add_from_resource (priv->builder, "/org/freedesktop/network-manager-applet/wifi.ui", 
&error)) {
+               g_warning ("Couldn't load builder resource: %s", error->message);
                g_error_free (error);
        }
 }
diff --git a/src/libnma/nma.gresource.xml b/src/libnma/nma.gresource.xml
new file mode 100644
index 0000000..a8a181e
--- /dev/null
+++ b/src/libnma/nma.gresource.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<gresources>
+       <gresource prefix="/org/freedesktop/network-manager-applet">
+               <file preprocess="xml-stripblanks">wifi.ui</file>
+       </gresource>
+</gresources>
diff --git a/src/wireless-security/Makefile.am b/src/wireless-security/Makefile.am
index c66ba1b..08f07fc 100644
--- a/src/wireless-security/Makefile.am
+++ b/src/wireless-security/Makefile.am
@@ -2,9 +2,15 @@ noinst_LTLIBRARIES = \
        libwireless-security-libnm-glib.la \
        libwireless-security-libnm.la
 
+BUILT_SOURCES = \
+       ws-resources.h \
+       ws-resources.c
+
 wireless_security_sources = \
        wireless-security.h \
        wireless-security.c \
+       ws-resources.h \
+       ws-resources.c \
        ws-wep-key.h \
        ws-wep-key.c \
        ws-wpa-psk.h \
@@ -37,7 +43,6 @@ libwireless_security_libnm_glib_la_SOURCES = \
 
 libwireless_security_libnm_glib_la_CPPFLAGS = \
        $(GTK_CFLAGS) \
-       -DUIDIR=\""$(uidir)"\" \
        -DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_LIB_LEGACY \
        $(LIBNM_GLIB_CFLAGS) \
        "-I${top_srcdir}/shared/" \
@@ -54,7 +59,6 @@ libwireless_security_libnm_la_SOURCES = \
 
 libwireless_security_libnm_la_CPPFLAGS = \
        $(GTK_CFLAGS) \
-       -DUIDIR=\""$(uidir)"\" \
        $(LIBNM_CFLAGS) \
        "-I${top_srcdir}/shared/" \
        -I${top_srcdir}/src/utils \
@@ -65,20 +69,8 @@ libwireless_security_libnm_la_LIBADD = \
        $(LIBNM_LIBS) \
        ${top_builddir}/src/utils/libutils-libnm.la
 
-uidir = $(datadir)/nm-applet
-ui_DATA = \
-       eap-method-leap.ui \
-       eap-method-fast.ui \
-       eap-method-peap.ui \
-       eap-method-simple.ui \
-       eap-method-tls.ui \
-       eap-method-ttls.ui \
-       ws-dynamic-wep.ui \
-       ws-leap.ui \
-       ws-wep-key.ui \
-       ws-wpa-eap.ui \
-       ws-wpa-psk.ui
-
-EXTRA_DIST = \
-       $(ui_DATA)
+ws-resources.h: ws.gresource.xml
+       $(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) $< --target=$@ --sourcedir=$(srcdir) --generate-header 
--internal
 
+ws-resources.c: ws.gresource.xml $(shell $(GLIB_COMPILE_RESOURCES) --sourcedir=$(srcdir) 
--generate-dependencies $(builddir)/ws.gresource.xml)
+       $(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) $< --target=$@ --sourcedir=$(srcdir) --generate-source 
--internal
diff --git a/src/wireless-security/eap-method-fast.c b/src/wireless-security/eap-method-fast.c
index 644a213..ec1cd64 100644
--- a/src/wireless-security/eap-method-fast.c
+++ b/src/wireless-security/eap-method-fast.c
@@ -349,7 +349,7 @@ eap_method_fast_new (WirelessSecurity *ws_parent,
                                  fill_connection,
                                  update_secrets,
                                  destroy,
-                                 UIDIR "/eap-method-fast.ui",
+                                 "/org/freedesktop/network-manager-applet/eap-method-fast.ui",
                                  "eap_fast_notebook",
                                  "eap_fast_anon_identity_entry",
                                  FALSE);
diff --git a/src/wireless-security/eap-method-leap.c b/src/wireless-security/eap-method-leap.c
index e4025a3..0087bdf 100644
--- a/src/wireless-security/eap-method-leap.c
+++ b/src/wireless-security/eap-method-leap.c
@@ -199,7 +199,7 @@ eap_method_leap_new (WirelessSecurity *ws_parent,
                                  fill_connection,
                                  update_secrets,
                                  destroy,
-                                 UIDIR "/eap-method-leap.ui",
+                                 "/org/freedesktop/network-manager-applet/eap-method-leap.ui",
                                  "eap_leap_notebook",
                                  "eap_leap_username_entry",
                                  FALSE);
diff --git a/src/wireless-security/eap-method-peap.c b/src/wireless-security/eap-method-peap.c
index 6462ef2..402887c 100644
--- a/src/wireless-security/eap-method-peap.c
+++ b/src/wireless-security/eap-method-peap.c
@@ -349,7 +349,7 @@ eap_method_peap_new (WirelessSecurity *ws_parent,
                                  fill_connection,
                                  update_secrets,
                                  destroy,
-                                 UIDIR "/eap-method-peap.ui",
+                                 "/org/freedesktop/network-manager-applet/eap-method-peap.ui",
                                  "eap_peap_notebook",
                                  "eap_peap_anon_identity_entry",
                                  FALSE);
diff --git a/src/wireless-security/eap-method-simple.c b/src/wireless-security/eap-method-simple.c
index b4ee792..80de964 100644
--- a/src/wireless-security/eap-method-simple.c
+++ b/src/wireless-security/eap-method-simple.c
@@ -296,7 +296,7 @@ eap_method_simple_new (WirelessSecurity *ws_parent,
                                  fill_connection,
                                  update_secrets,
                                  destroy,
-                                 UIDIR "/eap-method-simple.ui",
+                                 "/org/freedesktop/network-manager-applet/eap-method-simple.ui",
                                  "eap_simple_notebook",
                                  "eap_simple_username_entry",
                                  flags & EAP_METHOD_SIMPLE_FLAG_PHASE2);
diff --git a/src/wireless-security/eap-method-tls.c b/src/wireless-security/eap-method-tls.c
index b246021..8d17fa4 100644
--- a/src/wireless-security/eap-method-tls.c
+++ b/src/wireless-security/eap-method-tls.c
@@ -458,7 +458,7 @@ eap_method_tls_new (WirelessSecurity *ws_parent,
                                  fill_connection,
                                  update_secrets,
                                  NULL,
-                                 UIDIR "/eap-method-tls.ui",
+                                 "/org/freedesktop/network-manager-applet/eap-method-tls.ui",
                                  "eap_tls_notebook",
                                  "eap_tls_identity_entry",
                                  phase2);
diff --git a/src/wireless-security/eap-method-ttls.c b/src/wireless-security/eap-method-ttls.c
index 0d88cf1..2d9de48 100644
--- a/src/wireless-security/eap-method-ttls.c
+++ b/src/wireless-security/eap-method-ttls.c
@@ -398,7 +398,7 @@ eap_method_ttls_new (WirelessSecurity *ws_parent,
                                  fill_connection,
                                  update_secrets,
                                  destroy,
-                                 UIDIR "/eap-method-ttls.ui",
+                                 "/org/freedesktop/network-manager-applet/eap-method-ttls.ui",
                                  "eap_ttls_notebook",
                                  "eap_ttls_anon_identity_entry",
                                  FALSE);
diff --git a/src/wireless-security/eap-method.c b/src/wireless-security/eap-method.c
index 3d43ecb..cb733e8 100644
--- a/src/wireless-security/eap-method.c
+++ b/src/wireless-security/eap-method.c
@@ -129,7 +129,7 @@ eap_method_init (gsize obj_size,
                  EMFillConnectionFunc fill_connection,
                  EMUpdateSecretsFunc update_secrets,
                  EMDestroyFunc destroy,
-                 const char *ui_file,
+                 const char *ui_resource,
                  const char *ui_widget_name,
                  const char *default_field,
                  gboolean phase2)
@@ -138,7 +138,7 @@ eap_method_init (gsize obj_size,
        GError *error = NULL;
 
        g_return_val_if_fail (obj_size > 0, NULL);
-       g_return_val_if_fail (ui_file != NULL, NULL);
+       g_return_val_if_fail (ui_resource != NULL, NULL);
        g_return_val_if_fail (ui_widget_name != NULL, NULL);
 
        method = g_slice_alloc0 (obj_size);
@@ -154,9 +154,9 @@ eap_method_init (gsize obj_size,
        method->phase2 = phase2;
 
        method->builder = gtk_builder_new ();
-       if (!gtk_builder_add_from_file (method->builder, ui_file, &error)) {
-               g_warning ("Couldn't load UI builder file %s: %s",
-                          ui_file, error->message);
+       if (!gtk_builder_add_from_resource (method->builder, ui_resource, &error)) {
+               g_warning ("Couldn't load UI builder resource %s: %s",
+                          ui_resource, error->message);
                eap_method_unref (method);
                return NULL;
        }
@@ -164,7 +164,7 @@ eap_method_init (gsize obj_size,
        method->ui_widget = GTK_WIDGET (gtk_builder_get_object (method->builder, ui_widget_name));
        if (!method->ui_widget) {
                g_warning ("Couldn't load UI widget '%s' from UI file %s",
-                          ui_widget_name, ui_file);
+                          ui_widget_name, ui_resource);
                eap_method_unref (method);
                return NULL;
        }
diff --git a/src/wireless-security/eap-method.h b/src/wireless-security/eap-method.h
index 171d1ca..eee91b6 100644
--- a/src/wireless-security/eap-method.h
+++ b/src/wireless-security/eap-method.h
@@ -87,7 +87,7 @@ EAPMethod *eap_method_init (gsize obj_size,
                             EMFillConnectionFunc fill_connection,
                             EMUpdateSecretsFunc update_secrets,
                             EMDestroyFunc destroy,
-                            const char *ui_file,
+                            const char *ui_resource,
                             const char *ui_widget_name,
                             const char *default_field,
                             gboolean phase2);
diff --git a/src/wireless-security/wireless-security.c b/src/wireless-security/wireless-security.c
index 3e0535f..e88e503 100644
--- a/src/wireless-security/wireless-security.c
+++ b/src/wireless-security/wireless-security.c
@@ -146,7 +146,7 @@ wireless_security_init (gsize obj_size,
                         WSFillConnectionFunc fill_connection,
                         WSUpdateSecretsFunc update_secrets,
                         WSDestroyFunc destroy,
-                        const char *ui_file,
+                        const char *ui_resource,
                         const char *ui_widget_name,
                         const char *default_field)
 {
@@ -154,7 +154,7 @@ wireless_security_init (gsize obj_size,
        GError *error = NULL;
 
        g_return_val_if_fail (obj_size > 0, NULL);
-       g_return_val_if_fail (ui_file != NULL, NULL);
+       g_return_val_if_fail (ui_resource != NULL, NULL);
        g_return_val_if_fail (ui_widget_name != NULL, NULL);
 
        sec = g_slice_alloc0 (obj_size);
@@ -170,9 +170,9 @@ wireless_security_init (gsize obj_size,
        sec->default_field = default_field;
 
        sec->builder = gtk_builder_new ();
-       if (!gtk_builder_add_from_file (sec->builder, ui_file, &error)) {
-               g_warning ("Couldn't load UI builder file %s: %s",
-                          ui_file, error->message);
+       if (!gtk_builder_add_from_resource (sec->builder, ui_resource, &error)) {
+               g_warning ("Couldn't load UI builder resource %s: %s",
+                          ui_resource, error->message);
                g_error_free (error);
                wireless_security_unref (sec);
                return NULL;
@@ -181,7 +181,7 @@ wireless_security_init (gsize obj_size,
        sec->ui_widget = GTK_WIDGET (gtk_builder_get_object (sec->builder, ui_widget_name));
        if (!sec->ui_widget) {
                g_warning ("Couldn't load UI widget '%s' from UI file %s",
-                          ui_widget_name, ui_file);
+                          ui_widget_name, ui_resource);
                wireless_security_unref (sec);
                return NULL;
        }
diff --git a/src/wireless-security/wireless-security.h b/src/wireless-security/wireless-security.h
index 9fb83de..cb6553b 100644
--- a/src/wireless-security/wireless-security.h
+++ b/src/wireless-security/wireless-security.h
@@ -107,7 +107,7 @@ WirelessSecurity *wireless_security_init (gsize obj_size,
                                           WSFillConnectionFunc fill_connection,
                                           WSUpdateSecretsFunc update_secrets,
                                           WSDestroyFunc destroy,
-                                          const char *ui_file,
+                                          const char *ui_resource,
                                           const char *ui_widget_name,
                                           const char *default_field);
 
diff --git a/src/wireless-security/ws-dynamic-wep.c b/src/wireless-security/ws-dynamic-wep.c
index db55119..810a105 100644
--- a/src/wireless-security/ws-dynamic-wep.c
+++ b/src/wireless-security/ws-dynamic-wep.c
@@ -109,7 +109,7 @@ ws_dynamic_wep_new (NMConnection *connection,
                                         fill_connection,
                                         update_secrets,
                                         destroy,
-                                        UIDIR "/ws-dynamic-wep.ui",
+                                        "/org/freedesktop/network-manager-applet/ws-dynamic-wep.ui",
                                         "dynamic_wep_notebook",
                                         NULL);
        if (!parent)
diff --git a/src/wireless-security/ws-leap.c b/src/wireless-security/ws-leap.c
index 83b90bb..0d2ce75 100644
--- a/src/wireless-security/ws-leap.c
+++ b/src/wireless-security/ws-leap.c
@@ -154,7 +154,7 @@ ws_leap_new (NMConnection *connection, gboolean secrets_only)
                                         fill_connection,
                                         update_secrets,
                                         NULL,
-                                        UIDIR "/ws-leap.ui",
+                                        "/org/freedesktop/network-manager-applet/ws-leap.ui",
                                         "leap_notebook",
                                         "leap_username_entry");
        if (!parent)
diff --git a/src/wireless-security/ws-wep-key.c b/src/wireless-security/ws-wep-key.c
index 045ac4b..c7472ca 100644
--- a/src/wireless-security/ws-wep-key.c
+++ b/src/wireless-security/ws-wep-key.c
@@ -264,7 +264,7 @@ ws_wep_key_new (NMConnection *connection,
                                         fill_connection,
                                         update_secrets,
                                         destroy,
-                                        UIDIR "/ws-wep-key.ui",
+                                        "/org/freedesktop/network-manager-applet/ws-wep-key.ui",
                                         "wep_key_notebook",
                                         "wep_key_entry");
        if (!parent)
diff --git a/src/wireless-security/ws-wpa-eap.c b/src/wireless-security/ws-wpa-eap.c
index d83218d..2479a3e 100644
--- a/src/wireless-security/ws-wpa-eap.c
+++ b/src/wireless-security/ws-wpa-eap.c
@@ -110,7 +110,7 @@ ws_wpa_eap_new (NMConnection *connection,
                                         fill_connection,
                                         update_secrets,
                                         destroy,
-                                        UIDIR "/ws-wpa-eap.ui",
+                                        "/org/freedesktop/network-manager-applet/ws-wpa-eap.ui",
                                         "wpa_eap_notebook",
                                         NULL);
        if (!parent)
diff --git a/src/wireless-security/ws-wpa-psk.c b/src/wireless-security/ws-wpa-psk.c
index e56f348..befe68b 100644
--- a/src/wireless-security/ws-wpa-psk.c
+++ b/src/wireless-security/ws-wpa-psk.c
@@ -182,7 +182,7 @@ ws_wpa_psk_new (NMConnection *connection, gboolean secrets_only)
                                         fill_connection,
                                         update_secrets,
                                         NULL,
-                                        UIDIR "/ws-wpa-psk.ui",
+                                        "/org/freedesktop/network-manager-applet/ws-wpa-psk.ui",
                                         "wpa_psk_notebook",
                                         "wpa_psk_entry");
        if (!parent)
diff --git a/src/wireless-security/ws.gresource.xml b/src/wireless-security/ws.gresource.xml
new file mode 100644
index 0000000..7aa6c0f
--- /dev/null
+++ b/src/wireless-security/ws.gresource.xml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<gresources>
+       <gresource prefix="/org/freedesktop/network-manager-applet">
+               <file preprocess="xml-stripblanks">ws-dynamic-wep.ui</file>
+               <file preprocess="xml-stripblanks">ws-leap.ui</file>
+               <file preprocess="xml-stripblanks">ws-wep-key.ui</file>
+               <file preprocess="xml-stripblanks">ws-wpa-eap.ui</file>
+               <file preprocess="xml-stripblanks">ws-wpa-psk.ui</file>
+               <file preprocess="xml-stripblanks">eap-method-fast.ui</file>
+               <file preprocess="xml-stripblanks">eap-method-leap.ui</file>
+               <file preprocess="xml-stripblanks">eap-method-peap.ui</file>
+               <file preprocess="xml-stripblanks">eap-method-simple.ui</file>
+               <file preprocess="xml-stripblanks">eap-method-tls.ui</file>
+               <file preprocess="xml-stripblanks">eap-method-ttls.ui</file>
+       </gresource>
+</gresources>


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]