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

wncklet: Convert to GResource

parent 8a1060a1
......@@ -6,9 +6,6 @@ AM_CPPFLAGS = \
-I$(top_srcdir)/libpanel-applet \
-I$(top_builddir)/libpanel-applet \
-DGNOMELOCALEDIR=\""$(prefix)/$(DATADIRNAME)/locale"\" \
-DPAGER_BUILDERDIR=\""$(uidir)"\" \
-DTASKLIST_BUILDERDIR=\""$(uidir)"\" \
-DWNCK_MENU_UI_DIR=\""$(xmluidir)"\" \
-DWNCK_I_KNOW_THIS_IS_UNSTABLE \
$(DISABLE_DEPRECATED_CFLAGS)
......@@ -24,7 +21,8 @@ WNCKLET_SOURCES = \
workspace-switcher.c \
workspace-switcher.h \
showdesktop.c \
showdesktop.h
showdesktop.h \
$(BUILT_SOURCES)
WNCKLET_LDADD = \
../../libpanel-applet/libpanel-applet-4.la \
......@@ -75,20 +73,28 @@ org.gnome.panel.applet.WnckletFactory.service: $(service_in_files)
$< > $@
endif
uidir = $(datadir)/gnome-panel/ui
ui_DATA = workspace-switcher.ui window-list.ui
ui_FILES = \
window-list-menu.xml \
window-list.ui \
workspace-switcher-menu.xml \
workspace-switcher.ui
xmluidir = $(datadir)/gnome-panel/ui
xmlui_DATA = \
workspace-switcher-menu.xml \
window-list-menu.xml
wncklet-resources.c: 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)/$<
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 = \
org.gnome.panel.Wncklet.panel-applet.in.in \
$(service_in_files) \
$(xmlui_DATA) \
$(ui_DATA)
$(ui_FILES)
CLEANFILES = $(applet_DATA) $(applet_DATA).in $(service_DATA)
CLEANFILES = $(BUILT_SOURCES) $(applet_DATA) $(applet_DATA).in $(service_DATA)
-include $(top_srcdir)/git.mk
......@@ -358,7 +358,6 @@ window_list_applet_fill (PanelApplet *applet)
TasklistData *tasklist;
GtkActionGroup *action_group;
GtkAction *action;
gchar *ui_path;
tasklist = g_new0 (TasklistData, 1);
......@@ -434,10 +433,9 @@ window_list_applet_fill (PanelApplet *applet)
tasklist_menu_actions,
G_N_ELEMENTS (tasklist_menu_actions),
tasklist);
ui_path = g_build_filename (WNCK_MENU_UI_DIR, "window-list-menu.xml", NULL);
panel_applet_setup_menu_from_file (PANEL_APPLET (tasklist->applet),
ui_path, action_group);
g_free (ui_path);
panel_applet_setup_menu_from_resource (PANEL_APPLET (tasklist->applet),
WNCKLET_RESOURCE_PATH "window-list-menu.xml",
action_group);
action = gtk_action_group_get_action (action_group, "TasklistPreferences");
g_object_bind_property (tasklist->applet, "locked-down",
......@@ -589,18 +587,10 @@ display_properties_dialog (GtkAction *action,
{
if (tasklist->properties_dialog == NULL) {
GtkBuilder *builder;
GError *error;
builder = gtk_builder_new ();
gtk_builder_set_translation_domain (builder, GETTEXT_PACKAGE);
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;
}
gtk_builder_add_from_resource (builder, WNCKLET_RESOURCE_PATH "window-list.ui", NULL);
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 @@
#include <gtk/gtk.h>
#include <panel-applet.h>
#define WNCKLET_RESOURCE_PATH "/org/gnome/panel/applet/wncklet/"
G_BEGIN_DECLS
void wncklet_display_help (GtkWidget *widget,
......
......@@ -307,7 +307,6 @@ workspace_switcher_applet_fill (PanelApplet *applet)
PagerData *pager;
GtkActionGroup *action_group;
GtkAction *action;
gchar *ui_path;
gboolean display_names;
panel_applet_add_preferences (applet, "/schemas/apps/workspace_switcher_applet/prefs", NULL);
......@@ -384,10 +383,9 @@ workspace_switcher_applet_fill (PanelApplet *applet)
pager_menu_actions,
G_N_ELEMENTS (pager_menu_actions),
pager);
ui_path = g_build_filename (WNCK_MENU_UI_DIR, "workspace-switcher-menu.xml", NULL);
panel_applet_setup_menu_from_file (PANEL_APPLET (pager->applet),
ui_path, action_group);
g_free (ui_path);
panel_applet_setup_menu_from_resource (PANEL_APPLET (pager->applet),
WNCKLET_RESOURCE_PATH "workspace-switcher-menu.xml",
action_group);
action = gtk_action_group_get_action (action_group, "PagerPreferences");
g_object_bind_property (pager->applet, "locked-down",
......@@ -787,18 +785,10 @@ display_properties_dialog (GtkAction *action,
{
if (pager->properties_dialog == NULL) {
GtkBuilder *builder;
GError *error;
builder = gtk_builder_new ();
gtk_builder_set_translation_domain (builder, GETTEXT_PACKAGE);
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;
}
gtk_builder_add_from_resource (builder, WNCKLET_RESOURCE_PATH "workspace-switcher.ui", NULL);
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