diff options
author | ZenWalker <[email protected]> | 2016-06-24 11:17:22 +0200 |
---|---|---|
committer | ZenWalker <[email protected]> | 2016-06-24 23:14:17 +0200 |
commit | 0d3a5b087f4bb6c118abe34a14ea27b86583f812 (patch) | |
tree | 79e93750318b932a626668fe9e046b7ab2c896df /src/gtk-utils.c | |
parent | bcee9bdc706d1cf65bf800c2bcc96b236dab6ec5 (diff) | |
download | engrampa-0d3a5b087f4bb6c118abe34a14ea27b86583f812.tar.bz2 engrampa-0d3a5b087f4bb6c118abe34a14ea27b86583f812.tar.xz |
use GResource to store ui files
file-roller commit:
https://git.gnome.org/browse/file-roller/commit/?id=47619b987b77bdc258af9a554ba022c1f8834774
Diffstat (limited to 'src/gtk-utils.c')
-rw-r--r-- | src/gtk-utils.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/gtk-utils.c b/src/gtk-utils.c index 5835eb6..ce4758b 100644 --- a/src/gtk-utils.c +++ b/src/gtk-utils.c @@ -26,6 +26,7 @@ #include "gtk-utils.h" #define LOAD_BUFFER_SIZE 65536 +#define ENGRAMPA_RESOURCE_UI_PATH "/org/mate/Engrampa/ui/" static void count_selected (GtkTreeModel *model, @@ -804,6 +805,24 @@ _gtk_builder_new_from_file (const char *ui_file) return builder; } +GtkBuilder * +_gtk_builder_new_from_resource (const char *resource_path) +{ + GtkBuilder *builder; + char *full_path; + GError *error = NULL; + + builder = gtk_builder_new (); + full_path = g_strconcat (ENGRAMPA_RESOURCE_UI_PATH, resource_path, NULL); + if (! gtk_builder_add_from_resource (builder, full_path, &error)) { + g_warning ("%s\n", error->message); + g_clear_error (&error); + } + g_free (full_path); + + return builder; +} + GtkWidget * _gtk_builder_get_widget (GtkBuilder *builder, |