Skip to content

File tree

6 files changed

+58
-74
lines changed

6 files changed

+58
-74
lines changed

‎mate-panel/Makefile.am‎

Lines changed: 36 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,14 @@ AM_CPPFLAGS = \
1313
-I$(top_builddir)/mate-panel \
1414
-I$(top_builddir)/mate-panel/libpanel-util \
1515
-DMATELOCALEDIR=\""$(prefix)/$(DATADIRNAME)/locale"\" \
16-
-DBUILDERDIR=\""$(uidir)"\" \
1716
-DPANELDATADIR=\""$(datadir)/mate-panel"\" \
18-
-DDATADIR=\""$(datadir)"\"
19-
-DICONDIR=\""$(datadir)/mate-panel/pixmaps"\" \
17+
-DDATADIR=\""$(datadir)"\" \
2018
$(DISABLE_DEPRECATED_CFLAGS)
2119

2220
AM_CFLAGS = $(WARN_CFLAGS)
2321

2422
panel_sources = \
25-
panel-typebuiltins.c \
26-
panel-typebuiltins.h \
27-
panel-marshal.c \
28-
panel-marshal.h \
23+
$(mate_panel_BUILT_SOURCES) \
2924
main.c \
3025
panel-widget.c \
3126
button-widget.c \
@@ -159,10 +154,10 @@ mate_desktop_item_edit_LDADD = \
159154
-lX11
160155

161156
mate_panel_test_applets_SOURCES = \
157+
$(panel_test_applets_BUILT_SOURCES) \
162158
panel-modules.c \
163159
panel-applet-info.c \
164160
panel-applets-manager.c \
165-
panel-marshal.c \
166161
panel-test-applets.c
167162

168163
mate_panel_test_applets_CPPFLAGS = \
@@ -218,17 +213,41 @@ panel-typebuiltins.h: @REBUILD@ $(panel_enum_headers)
218213
--eprod "GType @enum_name@_get_type (void);\n" \
219214
$(panel_enum_headers) > $@
220215

221-
BUILT_SOURCES = \
216+
mate_panel_BUILT_SOURCES = \
222217
panel-typebuiltins.c \
223218
panel-typebuiltins.h \
219+
panel-resources.c \
220+
panel-resources.h \
224221
panel-marshal.c \
225222
panel-marshal.h
226223

227-
uidir = $(datadir)/mate-panel/ui
228-
ui_DATA = \
224+
panel_test_applets_BUILT_SOURCES = \
225+
panel-test-applets-resources.c \
226+
panel-test-applets-resources.h \
227+
panel-marshal.c \
228+
panel-marshal.h
229+
230+
BUILT_SOURCES = \
231+
$(mate_panel_BUILT_SOURCES) \
232+
$(panel_test_applets_BUILT_SOURCES)
233+
234+
ui_FILES = \
229235
panel-properties-dialog.ui \
230-
panel-run-dialog.ui \
231-
panel-test-applets.ui
236+
panel-run-dialog.ui
237+
238+
panel-resources.c: panel.gresource.xml $(shell $(GLIB_COMPILE_RESOURCES) --sourcedir=$(srcdir) --generate-dependencies $(srcdir)/panel.gresource.xml)
239+
$(AM_V_GEN)$(GLIB_COMPILE_RESOURCES) --target=$@ --sourcedir=$(srcdir) --generate --c-name panel $<
240+
241+
panel-resources.h: panel.gresource.xml $(shell $(GLIB_COMPILE_RESOURCES) --sourcedir=$(srcdir) --generate-dependencies $(srcdir)/panel.gresource.xml)
242+
$(AM_V_GEN)$(GLIB_COMPILE_RESOURCES) --target=$@ --sourcedir=$(srcdir) --generate --c-name panel $<
243+
244+
uitest_FILES = panel-test-applets.ui
245+
246+
panel-test-applets-resources.c: panel-test-applets.gresource.xml $(shell $(GLIB_COMPILE_RESOURCES) --sourcedir=$(srcdir) --generate-dependencies $(srcdir)/panel-test-applets.gresource.xml)
247+
$(AM_V_GEN)$(GLIB_COMPILE_RESOURCES) --target=$@ --sourcedir=$(srcdir) --generate --c-name panel $<
248+
249+
panel-test-applets-resources.h: panel-test-applets.gresource.xml $(shell $(GLIB_COMPILE_RESOURCES) --sourcedir=$(srcdir) --generate-dependencies $(srcdir)/panel-test-applets.gresource.xml)
250+
$(AM_V_GEN)$(GLIB_COMPILE_RESOURCES) --target=$@ --sourcedir=$(srcdir) --generate --c-name panel $<
232251

233252
desktopdir = $(datadir)/applications
234253
desktop_in_files = mate-panel.desktop.in
@@ -237,7 +256,10 @@ desktop_DATA = $(desktop_in_files:.desktop.in=.desktop)
237256
@INTLTOOL_DESKTOP_RULE@
238257

239258
EXTRA_DIST = \
240-
$(ui_DATA) \
259+
$(ui_FILES) \
260+
panel.gresource.xml \
261+
$(uitest_FILES) \
262+
panel-test-applets.gresource.xml \
241263
panel-marshal.list \
242264
$(entries_DATA) \
243265
$(desktop_in_files)

‎mate-panel/panel-properties-dialog.c‎

Lines changed: 3 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
#include <glib/gi18n.h>
3131
#include <gio/gio.h>
3232

33-
#include <libpanel-util/panel-error.h>
3433
#include <libpanel-util/panel-glib.h>
3534
#include <libpanel-util/panel-gtk.h>
3635
#include <libpanel-util/panel-icon-chooser.h>
@@ -911,7 +910,6 @@ panel_properties_dialog_present (PanelToplevel *toplevel)
911910
{
912911
PanelPropertiesDialog *dialog;
913912
GtkBuilder *gui;
914-
GError *error;
915913

916914
if (!panel_properties_dialog_quark)
917915
panel_properties_dialog_quark =
@@ -927,29 +925,9 @@ panel_properties_dialog_present (PanelToplevel *toplevel)
927925

928926
gui = gtk_builder_new ();
929927
gtk_builder_set_translation_domain (gui, GETTEXT_PACKAGE);
930-
931-
error = NULL;
932-
gtk_builder_add_from_file (gui,
933-
BUILDERDIR "/panel-properties-dialog.ui",
934-
&error);
935-
936-
if (error) {
937-
char *secondary;
938-
939-
secondary = g_strdup_printf (_("Unable to load file '%s': %s."),
940-
BUILDERDIR"/panel-properties-dialog.ui",
941-
error->message);
942-
panel_error_dialog (GTK_WINDOW (toplevel),
943-
gtk_window_get_screen (GTK_WINDOW (toplevel)),
944-
"cannot_display_properties_dialog", TRUE,
945-
_("Could not display properties dialog"),
946-
secondary);
947-
g_free (secondary);
948-
g_error_free (error);
949-
g_object_unref (gui);
950-
951-
return;
952-
}
928+
gtk_builder_add_from_resource (gui,
929+
PANEL_RESOURCE_PATH "panel-properties-dialog.ui",
930+
NULL);
953931

954932
dialog = panel_properties_dialog_new (toplevel, gui);
955933

‎mate-panel/panel-run-dialog.c‎

Lines changed: 4 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555
#include "panel-globals.h"
5656
#include "panel-enums.h"
5757
#include "panel-profile.h"
58+
#include "panel-schemas.h"
5859
#include "panel-stock-icons.h"
5960
#include "panel-multiscreen.h"
6061
#include "menu.h"
@@ -2011,7 +2012,6 @@ panel_run_dialog_present (GdkScreen *screen,
20112012
guint32 activate_time)
20122013
{
20132014
GtkBuilder *gui;
2014-
GError *error;
20152015

20162016
if (panel_lockdown_get_disable_command_line ())
20172017
return;
@@ -2026,28 +2026,9 @@ panel_run_dialog_present (GdkScreen *screen,
20262026

20272027
gui = gtk_builder_new ();
20282028
gtk_builder_set_translation_domain (gui, GETTEXT_PACKAGE);
2029-
2030-
error = NULL;
2031-
gtk_builder_add_from_file (gui,
2032-
BUILDERDIR "/panel-run-dialog.ui",
2033-
&error);
2034-
2035-
if (error) {
2036-
char *secondary;
2037-
2038-
secondary = g_strdup_printf (_("Unable to load file '%s': %s."),
2039-
BUILDERDIR"/panel-run-dialog.ui",
2040-
error->message);
2041-
panel_error_dialog (NULL, screen, "cannot_display_run_dialog",
2042-
TRUE,
2043-
_("Could not display run dialog"),
2044-
secondary);
2045-
g_free (secondary);
2046-
g_error_free (error);
2047-
g_object_unref (gui);
2048-
2049-
return;
2050-
}
2029+
gtk_builder_add_from_resource (gui,
2030+
PANEL_RESOURCE_PATH "panel-run-dialog.ui",
2031+
NULL);
20512032

20522033
static_dialog = panel_run_dialog_new (screen, gui, activate_time);
20532034

‎mate-panel/panel-test-applets.c‎

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,6 @@ int
335335
main (int argc, char **argv)
336336
{
337337
GtkBuilder *builder;
338-
char *uifile;
339338
char *applets_dir;
340339
GError *error;
341340

@@ -374,17 +373,7 @@ main (int argc, char **argv)
374373

375374
builder = gtk_builder_new ();
376375
gtk_builder_set_translation_domain (builder, GETTEXT_PACKAGE);
377-
378-
uifile = BUILDERDIR "/panel-test-applets.ui";
379-
gtk_builder_add_from_file (builder, uifile, &error);
380-
381-
if (error) {
382-
g_warning ("Error loading \"%s\": %s", uifile, error->message);
383-
g_error_free (error);
384-
panel_cleanup_do ();
385-
386-
return 1;
387-
}
376+
gtk_builder_add_from_resource (builder, "/org/mate/panel/test/panel-test-applets.ui", NULL);
388377

389378
gtk_builder_connect_signals (builder, NULL);
390379

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<gresources>
3+
<gresource prefix="/org/mate/panel/test">
4+
<file compressed="true">panel-test-applets.ui</file>
5+
</gresource>
6+
</gresources>

‎mate-panel/panel.gresource.xml‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<gresources>
3+
<gresource prefix="/org/mate/panel">
4+
<file compressed="true">panel-properties-dialog.ui</file>
5+
<file compressed="true">panel-run-dialog.ui</file>
6+
<file alias="anim/wanda.png">../applets/fish/wanda.png</file>
7+
</gresource>
8+
</gresources>

0 commit comments

Comments
 (0)