Commit 9fbca7df authored by Vincent Untz's avatar Vincent Untz

wncklet: Convert to GResource

parent 8a1060a1
...@@ -6,9 +6,6 @@ AM_CPPFLAGS = \ ...@@ -6,9 +6,6 @@ AM_CPPFLAGS = \
-I$(top_srcdir)/libpanel-applet \ -I$(top_srcdir)/libpanel-applet \
-I$(top_builddir)/libpanel-applet \ -I$(top_builddir)/libpanel-applet \
-DGNOMELOCALEDIR=\""$(prefix)/$(DATADIRNAME)/locale"\" \ -DGNOMELOCALEDIR=\""$(prefix)/$(DATADIRNAME)/locale"\" \
-DPAGER_BUILDERDIR=\""$(uidir)"\" \
-DTASKLIST_BUILDERDIR=\""$(uidir)"\" \
-DWNCK_MENU_UI_DIR=\""$(xmluidir)"\" \
-DWNCK_I_KNOW_THIS_IS_UNSTABLE \ -DWNCK_I_KNOW_THIS_IS_UNSTABLE \
$(DISABLE_DEPRECATED_CFLAGS) $(DISABLE_DEPRECATED_CFLAGS)
...@@ -24,7 +21,8 @@ WNCKLET_SOURCES = \ ...@@ -24,7 +21,8 @@ WNCKLET_SOURCES = \
workspace-switcher.c \ workspace-switcher.c \
workspace-switcher.h \ workspace-switcher.h \
showdesktop.c \ showdesktop.c \
showdesktop.h showdesktop.h \
$(BUILT_SOURCES)
WNCKLET_LDADD = \ WNCKLET_LDADD = \
../../libpanel-applet/libpanel-applet-4.la \ ../../libpanel-applet/libpanel-applet-4.la \
...@@ -75,20 +73,28 @@ org.gnome.panel.applet.WnckletFactory.service: $(service_in_files) ...@@ -75,20 +73,28 @@ org.gnome.panel.applet.WnckletFactory.service: $(service_in_files)
$< > $@ $< > $@
endif endif
uidir = $(datadir)/gnome-panel/ui ui_FILES = \
ui_DATA = workspace-switcher.ui window-list.ui window-list-menu.xml \
window-list.ui \
workspace-switcher-menu.xml \
workspace-switcher.ui
xmluidir = $(datadir)/gnome-panel/ui
xmlui_DATA = \ wncklet-resources.c: wncklet.gresource.xml $(shell $(GLIB_COMPILE_RESOURCES) --generate-dependencies wncklet.gresource.xml)
workspace-switcher-menu.xml \ $(AM_V_GEN)$(GLIB_COMPILE_RESOURCES) --target=$@ --sourcedir=$(srcdir) --generate --c-name wncklet $(srcdir)/$<
window-list-menu.xml
wncklet-resources.h: wncklet.gresource.xml $(shell $(GLIB_COMPILE_RESOURCES) --generate-dependencies wncklet.gresource.xml)
$(AM_V_GEN)$(GLIB_COMPILE_RESOURCES) --target=$@ --sourcedir=$(srcdir) --generate --c-name wncklet $(srcdir)/$<
BUILT_SOURCES = \
wncklet-resources.c \
wncklet-resources.h
EXTRA_DIST = \ EXTRA_DIST = \
org.gnome.panel.Wncklet.panel-applet.in.in \ org.gnome.panel.Wncklet.panel-applet.in.in \
$(service_in_files) \ $(service_in_files) \
$(xmlui_DATA) \ $(ui_FILES)
$(ui_DATA)
CLEANFILES = $(applet_DATA) $(applet_DATA).in $(service_DATA) CLEANFILES = $(BUILT_SOURCES) $(applet_DATA) $(applet_DATA).in $(service_DATA)
-include $(top_srcdir)/git.mk -include $(top_srcdir)/git.mk
...@@ -358,7 +358,6 @@ window_list_applet_fill (PanelApplet *applet) ...@@ -358,7 +358,6 @@ window_list_applet_fill (PanelApplet *applet)
TasklistData *tasklist; TasklistData *tasklist;
GtkActionGroup *action_group; GtkActionGroup *action_group;
GtkAction *action; GtkAction *action;
gchar *ui_path;
tasklist = g_new0 (TasklistData, 1); tasklist = g_new0 (TasklistData, 1);
...@@ -434,10 +433,9 @@ window_list_applet_fill (PanelApplet *applet) ...@@ -434,10 +433,9 @@ window_list_applet_fill (PanelApplet *applet)
tasklist_menu_actions, tasklist_menu_actions,
G_N_ELEMENTS (tasklist_menu_actions), G_N_ELEMENTS (tasklist_menu_actions),
tasklist); tasklist);
ui_path = g_build_filename (WNCK_MENU_UI_DIR, "window-list-menu.xml", NULL); panel_applet_setup_menu_from_resource (PANEL_APPLET (tasklist->applet),
panel_applet_setup_menu_from_file (PANEL_APPLET (tasklist->applet), WNCKLET_RESOURCE_PATH "window-list-menu.xml",
ui_path, action_group); action_group);
g_free (ui_path);
action = gtk_action_group_get_action (action_group, "TasklistPreferences"); action = gtk_action_group_get_action (action_group, "TasklistPreferences");
g_object_bind_property (tasklist->applet, "locked-down", g_object_bind_property (tasklist->applet, "locked-down",
...@@ -589,18 +587,10 @@ display_properties_dialog (GtkAction *action, ...@@ -589,18 +587,10 @@ display_properties_dialog (GtkAction *action,
{ {
if (tasklist->properties_dialog == NULL) { if (tasklist->properties_dialog == NULL) {
GtkBuilder *builder; GtkBuilder *builder;
GError *error;
builder = gtk_builder_new (); builder = gtk_builder_new ();
gtk_builder_set_translation_domain (builder, GETTEXT_PACKAGE); gtk_builder_set_translation_domain (builder, GETTEXT_PACKAGE);
gtk_builder_add_from_resource (builder, WNCKLET_RESOURCE_PATH "window-list.ui", NULL);
error = NULL;
gtk_builder_add_from_file (builder, TASKLIST_BUILDERDIR "/window-list.ui", &error);
if (error) {
g_warning ("Error loading preferences: %s", error->message);
g_error_free (error);
return;
}
tasklist->properties_dialog = WID ("tasklist_properties_dialog"); tasklist->properties_dialog = WID ("tasklist_properties_dialog");
......
<?xml version="1.0" encoding="UTF-8"?>
<gresources>
<gresource prefix="/org/gnome/panel/applet/wncklet">
<file compressed="true">window-list.ui</file>
<file compressed="true">window-list-menu.xml</file>
<file compressed="true">workspace-switcher.ui</file>
<file compressed="true">workspace-switcher-menu.xml</file>
</gresource>
</gresources>
...@@ -30,6 +30,8 @@ ...@@ -30,6 +30,8 @@
#include <gtk/gtk.h> #include <gtk/gtk.h>
#include <panel-applet.h> #include <panel-applet.h>
#define WNCKLET_RESOURCE_PATH "/org/gnome/panel/applet/wncklet/"
G_BEGIN_DECLS G_BEGIN_DECLS
void wncklet_display_help (GtkWidget *widget, void wncklet_display_help (GtkWidget *widget,
......
...@@ -307,7 +307,6 @@ workspace_switcher_applet_fill (PanelApplet *applet) ...@@ -307,7 +307,6 @@ workspace_switcher_applet_fill (PanelApplet *applet)
PagerData *pager; PagerData *pager;
GtkActionGroup *action_group; GtkActionGroup *action_group;
GtkAction *action; GtkAction *action;
gchar *ui_path;
gboolean display_names; gboolean display_names;
panel_applet_add_preferences (applet, "/schemas/apps/workspace_switcher_applet/prefs", NULL); panel_applet_add_preferences (applet, "/schemas/apps/workspace_switcher_applet/prefs", NULL);
...@@ -384,10 +383,9 @@ workspace_switcher_applet_fill (PanelApplet *applet) ...@@ -384,10 +383,9 @@ workspace_switcher_applet_fill (PanelApplet *applet)
pager_menu_actions, pager_menu_actions,
G_N_ELEMENTS (pager_menu_actions), G_N_ELEMENTS (pager_menu_actions),
pager); pager);
ui_path = g_build_filename (WNCK_MENU_UI_DIR, "workspace-switcher-menu.xml", NULL); panel_applet_setup_menu_from_resource (PANEL_APPLET (pager->applet),
panel_applet_setup_menu_from_file (PANEL_APPLET (pager->applet), WNCKLET_RESOURCE_PATH "workspace-switcher-menu.xml",
ui_path, action_group); action_group);
g_free (ui_path);
action = gtk_action_group_get_action (action_group, "PagerPreferences"); action = gtk_action_group_get_action (action_group, "PagerPreferences");
g_object_bind_property (pager->applet, "locked-down", g_object_bind_property (pager->applet, "locked-down",
...@@ -787,18 +785,10 @@ display_properties_dialog (GtkAction *action, ...@@ -787,18 +785,10 @@ display_properties_dialog (GtkAction *action,
{ {
if (pager->properties_dialog == NULL) { if (pager->properties_dialog == NULL) {
GtkBuilder *builder; GtkBuilder *builder;
GError *error;
builder = gtk_builder_new (); builder = gtk_builder_new ();
gtk_builder_set_translation_domain (builder, GETTEXT_PACKAGE); gtk_builder_set_translation_domain (builder, GETTEXT_PACKAGE);
gtk_builder_add_from_resource (builder, WNCKLET_RESOURCE_PATH "workspace-switcher.ui", NULL);
error = NULL;
gtk_builder_add_from_file (builder, PAGER_BUILDERDIR "/workspace-switcher.ui", &error);
if (error) {
g_warning ("Error loading preferences: %s", error->message);
g_error_free (error);
return;
}
pager->properties_dialog = WID ("pager_properties_dialog"); pager->properties_dialog = WID ("pager_properties_dialog");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment