Skip to content

Commit

Permalink
Load eom-image-properties-dialog.ui with a gresource
Browse files Browse the repository at this point in the history
  • Loading branch information
raveit65 authored and vkareh committed Aug 1, 2018
1 parent 8734d0e commit 70fd470
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion data/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ gsettings_SCHEMAS = org.mate.eom.gschema.xml

uidir = $(pkgdatadir)
ui_DATA = \
eom-image-properties-dialog.ui \
eom-multiple-save-as-dialog.ui \
eom-preferences-dialog.ui \
eom-toolbar.xml
Expand All @@ -33,6 +32,7 @@ pkgconfig_DATA = eom.pc
EXTRA_DIST = \
$(ui_DATA) \
eom.css \
eom-image-properties-dialog.ui \
eom-ui.xml \
metadata-sidebar.ui \
$(DESKTOP_IN_FILES) \
Expand Down
10 changes: 4 additions & 6 deletions src/eom-properties-dialog.c
Original file line number Diff line number Diff line change
Expand Up @@ -569,13 +569,11 @@ eom_properties_dialog_class_init (EomPropertiesDialogClass *klass)
G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS));

gchar* data;
gsize data_size;
g_file_get_contents(g_build_filename (EOM_DATA_DIR, "eom-image-properties-dialog.ui", NULL), &data, &data_size, NULL);
GBytes *bytes = g_bytes_new_static(data, data_size);
gtk_widget_class_set_template((GtkWidgetClass *) klass, bytes);

GtkWidgetClass *wklass = (GtkWidgetClass*) klass;

gtk_widget_class_set_template_from_resource (wklass,
"/org/mate/eom/ui/eom-image-properties-dialog.ui");

gtk_widget_class_bind_template_child_private(wklass,
EomPropertiesDialog,
notebook);
Expand Down
1 change: 1 addition & 0 deletions src/eom.gresource.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<gresources>
<gresource prefix="/org/mate/eom/ui">
<file>eom.css</file>
<file compressed="true" preprocess="xml-stripblanks">eom-image-properties-dialog.ui</file>
<file compressed="true" preprocess="xml-stripblanks">eom-ui.xml</file>
<file compressed="true" preprocess="xml-stripblanks">metadata-sidebar.ui</file>
</gresource>
Expand Down

0 comments on commit 70fd470

Please sign in to comment.