From 0d3a5b087f4bb6c118abe34a14ea27b86583f812 Mon Sep 17 00:00:00 2001 From: ZenWalker Date: Fri, 24 Jun 2016 11:17:22 +0200 Subject: use GResource to store ui files file-roller commit: https://git.gnome.org/browse/file-roller/commit/?id=47619b987b77bdc258af9a554ba022c1f8834774 --- configure.ac | 3 +- data/Makefile.am | 2 +- data/ui/Makefile.am | 14 -- data/ui/add-options.ui | 124 ---------------- data/ui/batch-add-files.ui | 357 -------------------------------------------- data/ui/batch-password.ui | 163 -------------------- data/ui/delete.ui | 140 ------------------ data/ui/new.ui | 254 -------------------------------- data/ui/password.ui | 166 --------------------- data/ui/properties.ui | 275 ---------------------------------- data/ui/update.ui | 360 --------------------------------------------- po/POTFILES.in | 18 ++- src/Makefile.am | 17 ++- src/dlg-add-folder.c | 2 +- src/dlg-ask-password.c | 2 +- src/dlg-batch-add.c | 2 +- src/dlg-delete.c | 2 +- src/dlg-new.c | 2 +- src/dlg-password.c | 2 +- src/dlg-prop.c | 2 +- src/dlg-update.c | 2 +- src/engrampa.gresource.xml | 15 ++ src/fr-window.c | 2 +- src/gtk-utils.c | 19 +++ src/gtk-utils.h | 2 + src/ui.h | 119 --------------- src/ui/Makefile.am | 13 ++ src/ui/add-options.ui | 124 ++++++++++++++++ src/ui/app-menu.ui | 18 +++ src/ui/batch-add-files.ui | 357 ++++++++++++++++++++++++++++++++++++++++++++ src/ui/batch-password.ui | 163 ++++++++++++++++++++ src/ui/delete.ui | 140 ++++++++++++++++++ src/ui/menus-toolbars.ui | 106 +++++++++++++ src/ui/new.ui | 254 ++++++++++++++++++++++++++++++++ src/ui/password.ui | 166 +++++++++++++++++++++ src/ui/properties.ui | 275 ++++++++++++++++++++++++++++++++++ src/ui/update.ui | 360 +++++++++++++++++++++++++++++++++++++++++++++ 37 files changed, 2048 insertions(+), 1994 deletions(-) delete mode 100644 data/ui/Makefile.am delete mode 100644 data/ui/add-options.ui delete mode 100644 data/ui/batch-add-files.ui delete mode 100644 data/ui/batch-password.ui delete mode 100644 data/ui/delete.ui delete mode 100644 data/ui/new.ui delete mode 100644 data/ui/password.ui delete mode 100644 data/ui/properties.ui delete mode 100644 data/ui/update.ui create mode 100644 src/engrampa.gresource.xml create mode 100644 src/ui/Makefile.am create mode 100644 src/ui/add-options.ui create mode 100644 src/ui/app-menu.ui create mode 100644 src/ui/batch-add-files.ui create mode 100644 src/ui/batch-password.ui create mode 100644 src/ui/delete.ui create mode 100644 src/ui/menus-toolbars.ui create mode 100644 src/ui/new.ui create mode 100644 src/ui/password.ui create mode 100644 src/ui/properties.ui create mode 100644 src/ui/update.ui diff --git a/configure.ac b/configure.ac index a6d1520..0add897 100644 --- a/configure.ac +++ b/configure.ac @@ -20,6 +20,7 @@ GLIB_GSETTINGS AC_PATH_PROG(GLIB_GENMARSHAL, glib-genmarshal) AC_PATH_PROG(GLIB_MKENUMS, glib-mkenums) +AC_PATH_PROG(GLIB_COMPILE_RESOURCES, glib-compile-resources) dnl ========================================================================== dnl @@ -215,7 +216,6 @@ AC_CONFIG_FILES([Makefile data/Makefile data/engrampa.desktop.in data/org.mate.engrampa.gschema.xml - data/ui/Makefile data/icons/Makefile data/icons/16x16/Makefile data/icons/16x16/actions/Makefile @@ -233,6 +233,7 @@ AC_CONFIG_FILES([Makefile src/Makefile src/commands/Makefile src/sh/Makefile + src/ui/Makefile caja/Makefile caja/libcaja-engrampa.caja-extension.in help/Makefile diff --git a/data/Makefile.am b/data/Makefile.am index eab56b7..d5d6cfe 100644 --- a/data/Makefile.am +++ b/data/Makefile.am @@ -1,4 +1,4 @@ -SUBDIRS = ui icons +SUBDIRS = icons desktopdir = $(datadir)/applications desktop_in_in_files = engrampa.desktop.in.in diff --git a/data/ui/Makefile.am b/data/ui/Makefile.am deleted file mode 100644 index 09f9f79..0000000 --- a/data/ui/Makefile.am +++ /dev/null @@ -1,14 +0,0 @@ -uidir = $(datadir)/engrampa/ui -ui_DATA = \ - add-options.ui \ - batch-add-files.ui \ - batch-password.ui \ - delete.ui \ - new.ui \ - password.ui \ - properties.ui \ - update.ui - -EXTRA_DIST = $(ui_DATA) - --include $(top_srcdir)/git.mk diff --git a/data/ui/add-options.ui b/data/ui/add-options.ui deleted file mode 100644 index e7515e5..0000000 --- a/data/ui/add-options.ui +++ /dev/null @@ -1,124 +0,0 @@ - - - - - - 5 - Load Options - center-on-parent - dialog - - - True - 2 - - - True - 5 - 2 - 6 - 6 - - - True - 6 - - - gtk-remove - True - True - False - True - - - False - False - 0 - - - - - - - - - - - 1 - 2 - GTK_FILL - GTK_FILL - - - - - 280 - 150 - True - True - automatic - automatic - in - - - True - True - False - - - - - - - 1 - - - - - True - end - - - gtk-close - True - True - True - False - True - - - False - False - 0 - - - - - gtk-apply - True - True - True - False - True - - - False - False - 1 - - - - - False - end - 0 - - - - - - aod_cancelbutton - aod_okbutton - - - diff --git a/data/ui/batch-add-files.ui b/data/ui/batch-add-files.ui deleted file mode 100644 index 21f9240..0000000 --- a/data/ui/batch-add-files.ui +++ /dev/null @@ -1,357 +0,0 @@ - - - - - - 5 - Compress - False - center - normal - - - True - vertical - 2 - - - True - end - - - gtk-cancel - True - False - False - True - - - False - False - 0 - - - - - True - True - True - True - False - False - True - - - - - - False - False - 1 - - - - - gtk-help - True - True - False - False - True - - - False - False - 2 - True - - - - - False - True - end - 0 - - - - - True - 5 - 18 - - - 64 - 64 - True - 0 - - - False - False - 0 - - - - - True - vertical - 6 - - - True - 2 - 2 - 12 - 6 - - - True - 0 - _Filename: - True - center - a_add_to_entry - - - GTK_FILL - - - - - - True - 0 - _Location: - True - a_location_filechooserbutton - - - 1 - 2 - GTK_FILL - - - - - - True - False - select-folder - Location - 15 - - - 1 - 2 - 1 - 2 - GTK_FILL - GTK_FILL - - - - - True - 6 - - - True - True - True - 35 - - - 0 - - - - - True - - - - - - 1 - - - - - 1 - 2 - GTK_FILL - GTK_FILL - - - - - 0 - False - False - - - - - True - True - 6 - 6 - True - - - True - 6 - 12 - - - True - 3 - 2 - 12 - 6 - - - True - 0 - _Password: - True - a_password_entry - - - GTK_FILL - - - - - - True - True - False - - - - 1 - 2 - - - - - - _Encrypt the file list too - True - True - False - True - True - - - 2 - 1 - 2 - GTK_FILL - - - - - - True - 6 - - - Split into _volumes of - True - True - False - True - True - - - False - False - 0 - - - - - True - True - 6 - volume_adjustment - 1 - 1 - True - - - False - 1 - - - - - True - MB - - - False - False - 2 - - - - - 2 - 2 - 3 - GTK_FILL - - - - - - - - - - - - True - _Other Options - True - - - - - 1 - False - False - - - - - 1 - - - - - True - end - 1 - - - - - - a_cancel_button - a_add_button - a_help_button - - - - 10 - 0.10000000000000001 - 9999999999 - 0.10000000000000001 - 10 - - diff --git a/data/ui/batch-password.ui b/data/ui/batch-password.ui deleted file mode 100644 index faeedcd..0000000 --- a/data/ui/batch-password.ui +++ /dev/null @@ -1,163 +0,0 @@ - - - - - - 5 - False - center-on-parent - dialog - - - True - 2 - - - True - 5 - 18 - - - True - 12 - - - True - 0 - 0 - gtk-dialog-authentication - 6 - - - False - 0 - - - - - True - 12 - - - True - 0 - <span weight="bold" size="larger">Password required</span> - True - - - False - False - 0 - - - - - True - 0 - - - False - False - 1 - - - - - True - 12 - - - True - _Password: - True - pw_password_entry - - - False - False - 0 - - - - - True - True - False - - True - - - 1 - - - - - 2 - - - - - 1 - - - - - 0 - - - - - 1 - - - - - True - end - - - gtk-cancel - True - True - True - False - True - - - False - False - 0 - - - - - gtk-ok - True - True - True - True - True - False - True - - - False - False - 1 - - - - - False - end - 0 - - - - - - pw_cancel_button - pw_ok_button - - - diff --git a/data/ui/delete.ui b/data/ui/delete.ui deleted file mode 100644 index a54a4f8..0000000 --- a/data/ui/delete.ui +++ /dev/null @@ -1,140 +0,0 @@ - - - - - - 5 - Delete - False - center-on-parent - dialog - - - True - 2 - - - True - 5 - 3 - 2 - 12 - 6 - - - _Files: - True - True - False - True - True - - - 2 - 3 - GTK_FILL - - - - - - True - True - example: *.txt; *.doc - - - 1 - 2 - 2 - 3 - - - - - - _All files - True - True - False - True - True - d_files_radio - - - 2 - GTK_FILL - - - - - - _Selected files - True - True - False - True - True - d_files_radio - - - 2 - 1 - 2 - GTK_FILL - - - - - - 1 - - - - - True - end - - - gtk-cancel - True - True - False - True - - - False - False - 0 - - - - - gtk-delete - True - True - True - True - False - True - - - False - False - 1 - - - - - False - end - 0 - - - - - - d_cancel_button - d_ok_button - - - diff --git a/data/ui/new.ui b/data/ui/new.ui deleted file mode 100644 index 91454e7..0000000 --- a/data/ui/new.ui +++ /dev/null @@ -1,254 +0,0 @@ - - - - - - 5 - True - center-on-parent - normal - extra_widget - save - True - - - True - vertical - 2 - - - - - - True - end - - - gtk-cancel - True - True - False - True - - - False - False - 0 - - - - - gtk-new - True - True - True - False - True - - - False - False - 1 - - - - - gtk-help - True - True - False - True - - - False - False - 2 - True - - - - - False - end - 0 - - - - - - n_cancel_button - n_new_button - n_help_button - - - - 0.10000000149 - 1000 - 10 - 0.10000000149 - 10 - - - True - vertical - 12 - - - True - vertical - - - - - - 0 - - - - - True - True - True - - - True - 6 - - - True - vertical - 6 - - - True - - - True - 3 - 2 - 12 - 6 - - - True - 0 - _Password: - True - n_password_entry - - - 2 - - - - - 300 - True - True - False - - - - 1 - 2 - 2 - - - - - _Encrypt the file list too - True - True - False - True - True - - - 1 - 2 - 2 - 3 - - - - - - - - False - False - 0 - - - - - 0 - - - - - True - 6 - - - Split into _volumes of - True - True - False - True - True - - - False - 0 - - - - - True - True - - volume_adjustment - 1 - 1 - True - - - False - 1 - - - - - True - MB - - - False - 2 - - - - - 1 - - - - - - - - - True - _Other Options - True - - - - - False - 1 - - - - diff --git a/data/ui/password.ui b/data/ui/password.ui deleted file mode 100644 index 638f668..0000000 --- a/data/ui/password.ui +++ /dev/null @@ -1,166 +0,0 @@ - - - - - - 5 - Password - False - center-on-parent - dialog - - - True - 2 - - - True - 5 - 12 - - - True - 2 - 2 - 12 - 6 - - - _Encrypt the file list - True - True - False - True - True - - - 1 - 2 - 1 - 2 - GTK_FILL - - - - - - True - _Password: - True - pw_password_entry - - - GTK_FILL - - - - - - True - True - False - - True - - - 1 - 2 - - - - - - - - - 0 - - - - - True - 6 - - - True - gtk-dialog-info - 6 - - - False - False - 0 - - - - - True - <i><b>Note:</b> the password will be used to encrypt files you add to the current archive, and to decrypt files you extract from the current archive. When the archive is closed the password will be deleted.</i> - True - True - - - 1 - - - - - 1 - - - - - 1 - - - - - True - end - - - gtk-cancel - True - True - True - False - True - - - False - False - 0 - - - - - gtk-ok - True - True - True - True - True - False - True - - - False - False - 1 - - - - - False - end - 0 - - - - - - pw_cancel_button - pw_ok_button - - - diff --git a/data/ui/properties.ui b/data/ui/properties.ui deleted file mode 100644 index a478887..0000000 --- a/data/ui/properties.ui +++ /dev/null @@ -1,275 +0,0 @@ - - - - - - 5 - center-on-parent - dialog - - - True - 2 - - - True - 5 - 7 - 2 - 12 - 6 - - - True - 0 - center - - - GTK_FILL - - - - - - True - 0 - center - - - 3 - 4 - GTK_FILL - - - - - - True - True - 0 - True - - - 1 - 2 - 3 - 4 - GTK_FILL - - - - - - True - 0 - center - - - 1 - 2 - GTK_FILL - - - - - - True - True - 0 - True - - - 1 - 2 - 5 - 6 - GTK_FILL - - - - - - True - 0 - - - 5 - 6 - GTK_FILL - - - - - - True - True - 0 - True - - - 1 - 2 - 2 - 3 - GTK_FILL - - - - - - True - 0 - center - - - 2 - 3 - GTK_FILL - - - - - - True - 0 - - - 4 - 5 - GTK_FILL - - - - - - True - True - 0 - True - - - 1 - 2 - 4 - 5 - GTK_FILL - - - - - - True - True - 0 - True - - - 1 - 2 - 6 - 7 - GTK_FILL - - - - - - True - 0 - center - - - 6 - 7 - GTK_FILL - - - - - - True - True - 0 - True - start - - - 1 - 2 - 1 - 2 - - - - - - True - True - 0 - True - end - 30 - - - 1 - 2 - - - - - - 1 - - - - - True - end - - - gtk-help - True - True - True - True - True - False - True - - - False - False - 0 - True - - - - - gtk-close - True - True - True - False - True - - - False - False - 1 - - - - - False - end - 0 - - - - - - p_help_button - p_ok_button - - - diff --git a/data/ui/update.ui b/data/ui/update.ui deleted file mode 100644 index f3bcf21..0000000 --- a/data/ui/update.ui +++ /dev/null @@ -1,360 +0,0 @@ - - - - - - 5 - dialog - - - True - vertical - 14 - - - True - 5 - 18 - - - True - vertical - - - True - gtk-dialog-warning - 6 - - - False - 0 - - - - - 0 - - - - - True - vertical - 12 - - - True - 0 - True - True - - - False - False - 0 - - - - - True - 0 - The file has been modified with an external application. If you don't update the file in the archive, all of your changes will be lost. - True - - - False - False - 1 - - - - - 1 - - - - - 1 - - - - - True - end - - - gtk-cancel - True - True - True - False - True - - - False - False - 0 - - - - - True - True - True - False - - - True - 0 - 0 - - - True - 2 - - - True - gtk-save - - - False - False - 0 - - - - - True - _Update - True - - - False - False - 1 - - - - - - - - - False - False - 1 - - - - - False - end - 0 - - - - - - update_file_cancel_button - update_file_ok_button - - - - 5 - dialog - - - True - vertical - 14 - - - True - 5 - 18 - - - True - vertical - - - True - gtk-dialog-warning - 6 - - - False - 0 - - - - - 0 - - - - - True - vertical - 12 - - - True - 0 - True - True - - - False - False - 0 - - - - - True - 0 - True - - - False - False - 1 - - - - - True - vertical - 6 - - - True - 0 - S_elect the files you want to update: - True - update_files_treeview - - - False - False - 0 - - - - - 400 - 120 - True - True - never - in - - - True - True - False - - - - - 1 - - - - - 2 - - - - - 1 - - - - - 1 - - - - - True - end - - - gtk-cancel - True - True - True - False - True - - - False - False - 0 - - - - - True - True - True - False - - - True - 0 - 0 - - - True - 2 - - - True - gtk-save - - - False - False - 0 - - - - - True - _Update - True - - - False - False - 1 - - - - - - - - - False - False - 1 - - - - - False - end - 0 - - - - - - update_files_cancel_button - update_files_ok_button - - - diff --git a/po/POTFILES.in b/po/POTFILES.in index c0786de..01cc48b 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -9,14 +9,6 @@ copy-n-paste/eggsmclient-private.h copy-n-paste/eggsmclient-xsmp.c data/engrampa.appdata.xml.in data/engrampa.desktop.in.in -[type: gettext/glade]data/ui/add-options.ui -[type: gettext/glade]data/ui/batch-add-files.ui -[type: gettext/glade]data/ui/batch-password.ui -[type: gettext/glade]data/ui/delete.ui -[type: gettext/glade]data/ui/new.ui -[type: gettext/glade]data/ui/password.ui -[type: gettext/glade]data/ui/properties.ui -[type: gettext/glade]data/ui/update.ui [type: gettext/gsettings]data/org.mate.engrampa.gschema.xml.in caja/engrampa-module.c caja/caja-engrampa.c @@ -132,4 +124,14 @@ src/rar-utils.h src/server.c src/test-server.c src/typedefs.h +[type: gettext/glade]src/ui/add-options.ui +[type: gettext/glade]src/ui/app-menu.ui +[type: gettext/glade]src/ui/batch-add-files.ui +[type: gettext/glade]src/ui/batch-password.ui +[type: gettext/glade]src/ui/delete.ui src/ui.h +[type: gettext/glade]src/ui/menus-toolbars.ui +[type: gettext/glade]src/ui/new.ui +[type: gettext/glade]src/ui/password.ui +[type: gettext/glade]src/ui/properties.ui +[type: gettext/glade]src/ui/update.ui diff --git a/src/Makefile.am b/src/Makefile.am index 494b527..c4da5ed 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,4 +1,4 @@ -SUBDIRS = commands sh +SUBDIRS = commands sh ui bin_PROGRAMS = engrampa libexec_PROGRAMS = engrampa-server @@ -45,7 +45,10 @@ BUILT_SOURCES = \ fr-marshal.c \ fr-marshal.h \ fr-enum-types.h \ - fr-enum-types.c + fr-enum-types.c \ + fr-resources.c \ + fr-resources.h \ + $(NULL) COMMON_SOURCES = \ actions.h \ @@ -190,6 +193,12 @@ fr-enum-types.c: typedefs.h fr-enum-types.h && (cmp -s xgen-$(@F) fr-enum-types.c || cp xgen-$(@F) fr-enum-types.c ) \ && rm -f xgen-$(@F) ) +fr-resources.c: engrampa.gresource.xml $(shell $(GLIB_COMPILE_RESOURCES) --generate-dependencies engrampa.gresource.xml) + $(GLIB_COMPILE_RESOURCES) --target=$@ --sourcedir=$(srcdir) --generate --c-name fr $(srcdir)/engrampa.gresource.xml + +fr-resources.h: engrampa.gresource.xml $(shell $(GLIB_COMPILE_RESOURCES) --generate-dependencies engrampa.gresource.xml) + $(GLIB_COMPILE_RESOURCES) --target=$@ --sourcedir=$(srcdir) --generate --c-name fr $(srcdir)/engrampa.gresource.xml + engrampa_SOURCES = \ $(COMMON_SOURCES) \ main.c @@ -214,7 +223,9 @@ if ENABLE_MAGIC engrampa_LDADD += $(MAGIC_LIBS) endif -EXTRA_DIST = fr-marshal.list +EXTRA_DIST = \ + engrampa.gresource.xml \ + fr-marshal.list CLEANFILES = $(BUILT_SOURCES) diff --git a/src/dlg-add-folder.c b/src/dlg-add-folder.c index 5531100..9d74d50 100644 --- a/src/dlg-add-folder.c +++ b/src/dlg-add-folder.c @@ -801,7 +801,7 @@ load_options_cb (GtkWidget *w, aod_data = g_new0 (LoadOptionsDialogData, 1); aod_data->data = data; - aod_data->builder = _gtk_builder_new_from_file ("add-options.ui"); + aod_data->builder = _gtk_builder_new_from_resource ("add-options.ui"); if (aod_data->builder == NULL) { g_free (aod_data); return; diff --git a/src/dlg-ask-password.c b/src/dlg-ask-password.c index a29d55b..af791bf 100644 --- a/src/dlg-ask-password.c +++ b/src/dlg-ask-password.c @@ -98,7 +98,7 @@ dlg_ask_password__common (FrWindow *window, data = g_new0 (DialogData, 1); - data->builder = _gtk_builder_new_from_file ("batch-password.ui"); + data->builder = _gtk_builder_new_from_resource ("batch-password.ui"); if (data->builder == NULL) { g_free (data); return; diff --git a/src/dlg-batch-add.c b/src/dlg-batch-add.c index e192ca1..ae82eee 100644 --- a/src/dlg-batch-add.c +++ b/src/dlg-batch-add.c @@ -475,7 +475,7 @@ dlg_batch_add_files (FrWindow *window, data->settings = g_settings_new (ENGRAMPA_SCHEMA_BATCH_ADD); data->settings_general = g_settings_new (ENGRAMPA_SCHEMA_GENERAL); - data->builder = _gtk_builder_new_from_file ("batch-add-files.ui"); + data->builder = _gtk_builder_new_from_resource ("batch-add-files.ui"); if (data->builder == NULL) { g_free (data); return; diff --git a/src/dlg-delete.c b/src/dlg-delete.c index e8abe86..26f5cfd 100644 --- a/src/dlg-delete.c +++ b/src/dlg-delete.c @@ -115,7 +115,7 @@ dlg_delete__common (FrWindow *window, data->window = window; data->selected_files = selected_files; - data->builder = _gtk_builder_new_from_file ("delete.ui"); + data->builder = _gtk_builder_new_from_resource ("delete.ui"); if (data->builder == NULL) { g_free (data); return; diff --git a/src/dlg-new.c b/src/dlg-new.c index c10602d..e658abc 100644 --- a/src/dlg-new.c +++ b/src/dlg-new.c @@ -275,7 +275,7 @@ dlg_new_archive (FrWindow *window, data = g_new0 (DlgNewData, 1); - data->builder = _gtk_builder_new_from_file ("new.ui"); + data->builder = _gtk_builder_new_from_resource ("new.ui"); if (data->builder == NULL) { g_free (data); return NULL; diff --git a/src/dlg-password.c b/src/dlg-password.c index 73e8ad8..7a717b7 100644 --- a/src/dlg-password.c +++ b/src/dlg-password.c @@ -89,7 +89,7 @@ dlg_password (GtkWidget *widget, data = g_new0 (DialogData, 1); - data->builder = _gtk_builder_new_from_file ("password.ui"); + data->builder = _gtk_builder_new_from_resource ("password.ui"); if (data->builder == NULL) { g_free (data); return; diff --git a/src/dlg-prop.c b/src/dlg-prop.c index 475737d..4993826 100644 --- a/src/dlg-prop.c +++ b/src/dlg-prop.c @@ -89,7 +89,7 @@ dlg_prop (FrWindow *window) data = g_new (DialogData, 1); - data->builder = _gtk_builder_new_from_file ("properties.ui"); + data->builder = _gtk_builder_new_from_resource ("properties.ui"); if (data->builder == NULL) { g_free (data); return; diff --git a/src/dlg-update.c b/src/dlg-update.c index ddd3cac..197d24d 100644 --- a/src/dlg-update.c +++ b/src/dlg-update.c @@ -285,7 +285,7 @@ dlg_update (FrWindow *window) data = g_new0 (DialogData, 1); - data->builder = _gtk_builder_new_from_file ("update.ui"); + data->builder = _gtk_builder_new_from_resource ("update.ui"); if (data->builder == NULL) { g_free (data); return NULL; diff --git a/src/engrampa.gresource.xml b/src/engrampa.gresource.xml new file mode 100644 index 0000000..0b944bf --- /dev/null +++ b/src/engrampa.gresource.xml @@ -0,0 +1,15 @@ + + + + ui/add-options.ui + ui/app-menu.ui + ui/batch-add-files.ui + ui/batch-password.ui + ui/delete.ui + ui/menus-toolbars.ui + ui/new.ui + ui/password.ui + ui/properties.ui + ui/update.ui + + diff --git a/src/fr-window.c b/src/fr-window.c index 9a734be..df03e6c 100644 --- a/src/fr-window.c +++ b/src/fr-window.c @@ -5888,7 +5888,7 @@ fr_window_construct (FrWindow *window) g_cclosure_new_swap (G_CALLBACK (fr_window_close), window, NULL)); - if (!gtk_ui_manager_add_ui_from_string (ui, ui_info, -1, &error)) { + if (! gtk_ui_manager_add_ui_from_resource (ui, "/org/mate/Engrampa/ui/menus-toolbars.ui", &error)) { g_message ("building menus failed: %s", error->message); g_error_free (error); } 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, diff --git a/src/gtk-utils.h b/src/gtk-utils.h index 64ff68a..8c5c36a 100644 --- a/src/gtk-utils.h +++ b/src/gtk-utils.h @@ -85,6 +85,8 @@ void show_help_dialog (GtkWindow *parent, const char *section); GtkBuilder * _gtk_builder_new_from_file (const char *filename); +GtkBuilder * + _gtk_builder_new_from_resource (const char *resource_path); GtkWidget * _gtk_builder_get_widget (GtkBuilder *builder, const char *name); diff --git a/src/ui.h b/src/ui.h index 1b972d8..01656ae 100644 --- a/src/ui.h +++ b/src/ui.h @@ -271,123 +271,4 @@ static GtkRadioActionEntry sort_by_entries[] = { static guint n_sort_by_entries = G_N_ELEMENTS (sort_by_entries); -static const gchar *ui_info = -"" -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -/*" " -" " -" " -" " -" " -" " -" " -" " -" " -" "*/ -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -""; - - #endif /* UI_H */ diff --git a/src/ui/Makefile.am b/src/ui/Makefile.am new file mode 100644 index 0000000..5f1cd54 --- /dev/null +++ b/src/ui/Makefile.am @@ -0,0 +1,13 @@ +EXTRA_DIST = \ + add-options.ui \ + app-menu.ui \ + batch-add-files.ui \ + batch-password.ui \ + delete.ui \ + menus-toolbars.ui \ + new.ui \ + password.ui \ + properties.ui \ + update.ui + +-include $(top_srcdir)/git.mk diff --git a/src/ui/add-options.ui b/src/ui/add-options.ui new file mode 100644 index 0000000..e7515e5 --- /dev/null +++ b/src/ui/add-options.ui @@ -0,0 +1,124 @@ + + + + + + 5 + Load Options + center-on-parent + dialog + + + True + 2 + + + True + 5 + 2 + 6 + 6 + + + True + 6 + + + gtk-remove + True + True + False + True + + + False + False + 0 + + + + + + + + + + + 1 + 2 + GTK_FILL + GTK_FILL + + + + + 280 + 150 + True + True + automatic + automatic + in + + + True + True + False + + + + + + + 1 + + + + + True + end + + + gtk-close + True + True + True + False + True + + + False + False + 0 + + + + + gtk-apply + True + True + True + False + True + + + False + False + 1 + + + + + False + end + 0 + + + + + + aod_cancelbutton + aod_okbutton + + + diff --git a/src/ui/app-menu.ui b/src/ui/app-menu.ui new file mode 100644 index 0000000..11428d5 --- /dev/null +++ b/src/ui/app-menu.ui @@ -0,0 +1,18 @@ + + +
+ + app.help + _Help + + + app.about + _About Archive Manager + + + app.quit + _Quit + +
+
+
diff --git a/src/ui/batch-add-files.ui b/src/ui/batch-add-files.ui new file mode 100644 index 0000000..21f9240 --- /dev/null +++ b/src/ui/batch-add-files.ui @@ -0,0 +1,357 @@ + + + + + + 5 + Compress + False + center + normal + + + True + vertical + 2 + + + True + end + + + gtk-cancel + True + False + False + True + + + False + False + 0 + + + + + True + True + True + True + False + False + True + + + + + + False + False + 1 + + + + + gtk-help + True + True + False + False + True + + + False + False + 2 + True + + + + + False + True + end + 0 + + + + + True + 5 + 18 + + + 64 + 64 + True + 0 + + + False + False + 0 + + + + + True + vertical + 6 + + + True + 2 + 2 + 12 + 6 + + + True + 0 + _Filename: + True + center + a_add_to_entry + + + GTK_FILL + + + + + + True + 0 + _Location: + True + a_location_filechooserbutton + + + 1 + 2 + GTK_FILL + + + + + + True + False + select-folder + Location + 15 + + + 1 + 2 + 1 + 2 + GTK_FILL + GTK_FILL + + + + + True + 6 + + + True + True + True + 35 + + + 0 + + + + + True + + + + + + 1 + + + + + 1 + 2 + GTK_FILL + GTK_FILL + + + + + 0 + False + False + + + + + True + True + 6 + 6 + True + + + True + 6 + 12 + + + True + 3 + 2 + 12 + 6 + + + True + 0 + _Password: + True + a_password_entry + + + GTK_FILL + + + + + + True + True + False + + + + 1 + 2 + + + + + + _Encrypt the file list too + True + True + False + True + True + + + 2 + 1 + 2 + GTK_FILL + + + + + + True + 6 + + + Split into _volumes of + True + True + False + True + True + + + False + False + 0 + + + + + True + True + 6 + volume_adjustment + 1 + 1 + True + + + False + 1 + + + + + True + MB + + + False + False + 2 + + + + + 2 + 2 + 3 + GTK_FILL + + + + + + + + + + + + True + _Other Options + True + + + + + 1 + False + False + + + + + 1 + + + + + True + end + 1 + + + + + + a_cancel_button + a_add_button + a_help_button + + + + 10 + 0.10000000000000001 + 9999999999 + 0.10000000000000001 + 10 + + diff --git a/src/ui/batch-password.ui b/src/ui/batch-password.ui new file mode 100644 index 0000000..faeedcd --- /dev/null +++ b/src/ui/batch-password.ui @@ -0,0 +1,163 @@ + + + + + + 5 + False + center-on-parent + dialog + + + True + 2 + + + True + 5 + 18 + + + True + 12 + + + True + 0 + 0 + gtk-dialog-authentication + 6 + + + False + 0 + + + + + True + 12 + + + True + 0 + <span weight="bold" size="larger">Password required</span> + True + + + False + False + 0 + + + + + True + 0 + + + False + False + 1 + + + + + True + 12 + + + True + _Password: + True + pw_password_entry + + + False + False + 0 + + + + + True + True + False + + True + + + 1 + + + + + 2 + + + + + 1 + + + + + 0 + + + + + 1 + + + + + True + end + + + gtk-cancel + True + True + True + False + True + + + False + False + 0 + + + + + gtk-ok + True + True + True + True + True + False + True + + + False + False + 1 + + + + + False + end + 0 + + + + + + pw_cancel_button + pw_ok_button + + + diff --git a/src/ui/delete.ui b/src/ui/delete.ui new file mode 100644 index 0000000..a54a4f8 --- /dev/null +++ b/src/ui/delete.ui @@ -0,0 +1,140 @@ + + + + + + 5 + Delete + False + center-on-parent + dialog + + + True + 2 + + + True + 5 + 3 + 2 + 12 + 6 + + + _Files: + True + True + False + True + True + + + 2 + 3 + GTK_FILL + + + + + + True + True + example: *.txt; *.doc + + + 1 + 2 + 2 + 3 + + + + + + _All files + True + True + False + True + True + d_files_radio + + + 2 + GTK_FILL + + + + + + _Selected files + True + True + False + True + True + d_files_radio + + + 2 + 1 + 2 + GTK_FILL + + + + + + 1 + + + + + True + end + + + gtk-cancel + True + True + False + True + + + False + False + 0 + + + + + gtk-delete + True + True + True + True + False + True + + + False + False + 1 + + + + + False + end + 0 + + + + + + d_cancel_button + d_ok_button + + + diff --git a/src/ui/menus-toolbars.ui b/src/ui/menus-toolbars.ui new file mode 100644 index 0000000..b6b68ed --- /dev/null +++ b/src/ui/menus-toolbars.ui @@ -0,0 +1,106 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/ui/new.ui b/src/ui/new.ui new file mode 100644 index 0000000..91454e7 --- /dev/null +++ b/src/ui/new.ui @@ -0,0 +1,254 @@ + + + + + + 5 + True + center-on-parent + normal + extra_widget + save + True + + + True + vertical + 2 + + + + + + True + end + + + gtk-cancel + True + True + False + True + + + False + False + 0 + + + + + gtk-new + True + True + True + False + True + + + False + False + 1 + + + + + gtk-help + True + True + False + True + + + False + False + 2 + True + + + + + False + end + 0 + + + + + + n_cancel_button + n_new_button + n_help_button + + + + 0.10000000149 + 1000 + 10 + 0.10000000149 + 10 + + + True + vertical + 12 + + + True + vertical + + + + + + 0 + + + + + True + True + True + + + True + 6 + + + True + vertical + 6 + + + True + + + True + 3 + 2 + 12 + 6 + + + True + 0 + _Password: + True + n_password_entry + + + 2 + + + + + 300 + True + True + False + + + + 1 + 2 + 2 + + + + + _Encrypt the file list too + True + True + False + True + True + + + 1 + 2 + 2 + 3 + + + + + + + + False + False + 0 + + + + + 0 + + + + + True + 6 + + + Split into _volumes of + True + True + False + True + True + + + False + 0 + + + + + True + True + + volume_adjustment + 1 + 1 + True + + + False + 1 + + + + + True + MB + + + False + 2 + + + + + 1 + + + + + + + + + True + _Other Options + True + + + + + False + 1 + + + + diff --git a/src/ui/password.ui b/src/ui/password.ui new file mode 100644 index 0000000..638f668 --- /dev/null +++ b/src/ui/password.ui @@ -0,0 +1,166 @@ + + + + + + 5 + Password + False + center-on-parent + dialog + + + True + 2 + + + True + 5 + 12 + + + True + 2 + 2 + 12 + 6 + + + _Encrypt the file list + True + True + False + True + True + + + 1 + 2 + 1 + 2 + GTK_FILL + + + + + + True + _Password: + True + pw_password_entry + + + GTK_FILL + + + + + + True + True + False + + True + + + 1 + 2 + + + + + + + + + 0 + + + + + True + 6 + + + True + gtk-dialog-info + 6 + + + False + False + 0 + + + + + True + <i><b>Note:</b> the password will be used to encrypt files you add to the current archive, and to decrypt files you extract from the current archive. When the archive is closed the password will be deleted.</i> + True + True + + + 1 + + + + + 1 + + + + + 1 + + + + + True + end + + + gtk-cancel + True + True + True + False + True + + + False + False + 0 + + + + + gtk-ok + True + True + True + True + True + False + True + + + False + False + 1 + + + + + False + end + 0 + + + + + + pw_cancel_button + pw_ok_button + + + diff --git a/src/ui/properties.ui b/src/ui/properties.ui new file mode 100644 index 0000000..a478887 --- /dev/null +++ b/src/ui/properties.ui @@ -0,0 +1,275 @@ + + + + + + 5 + center-on-parent + dialog + + + True + 2 + + + True + 5 + 7 + 2 + 12 + 6 + + + True + 0 + center + + + GTK_FILL + + + + + + True + 0 + center + + + 3 + 4 + GTK_FILL + + + + + + True + True + 0 + True + + + 1 + 2 + 3 + 4 + GTK_FILL + + + + + + True + 0 + center + + + 1 + 2 + GTK_FILL + + + + + + True + True + 0 + True + + + 1 + 2 + 5 + 6 + GTK_FILL + + + + + + True + 0 + + + 5 + 6 + GTK_FILL + + + + + + True + True + 0 + True + + + 1 + 2 + 2 + 3 + GTK_FILL + + + + + + True + 0 + center + + + 2 + 3 + GTK_FILL + + + + + + True + 0 + + + 4 + 5 + GTK_FILL + + + + + + True + True + 0 + True + + + 1 + 2 + 4 + 5 + GTK_FILL + + + + + + True + True + 0 + True + + + 1 + 2 + 6 + 7 + GTK_FILL + + + + + + True + 0 + center + + + 6 + 7 + GTK_FILL + + + + + + True + True + 0 + True + start + + + 1 + 2 + 1 + 2 + + + + + + True + True + 0 + True + end + 30 + + + 1 + 2 + + + + + + 1 + + + + + True + end + + + gtk-help + True + True + True + True + True + False + True + + + False + False + 0 + True + + + + + gtk-close + True + True + True + False + True + + + False + False + 1 + + + + + False + end + 0 + + + + + + p_help_button + p_ok_button + + + diff --git a/src/ui/update.ui b/src/ui/update.ui new file mode 100644 index 0000000..f3bcf21 --- /dev/null +++ b/src/ui/update.ui @@ -0,0 +1,360 @@ + + + + + + 5 + dialog + + + True + vertical + 14 + + + True + 5 + 18 + + + True + vertical + + + True + gtk-dialog-warning + 6 + + + False + 0 + + + + + 0 + + + + + True + vertical + 12 + + + True + 0 + True + True + + + False + False + 0 + + + + + True + 0 + The file has been modified with an external application. If you don't update the file in the archive, all of your changes will be lost. + True + + + False + False + 1 + + + + + 1 + + + + + 1 + + + + + True + end + + + gtk-cancel + True + True + True + False + True + + + False + False + 0 + + + + + True + True + True + False + + + True + 0 + 0 + + + True + 2 + + + True + gtk-save + + + False + False + 0 + + + + + True + _Update + True + + + False + False + 1 + + + + + + + + + False + False + 1 + + + + + False + end + 0 + + + + + + update_file_cancel_button + update_file_ok_button + + + + 5 + dialog + + + True + vertical + 14 + + + True + 5 + 18 + + + True + vertical + + + True + gtk-dialog-warning + 6 + + + False + 0 + + + + + 0 + + + + + True + vertical + 12 + + + True + 0 + True + True + + + False + False + 0 + + + + + True + 0 + True + + + False + False + 1 + + + + + True + vertical + 6 + + + True + 0 + S_elect the files you want to update: + True + update_files_treeview + + + False + False + 0 + + + + + 400 + 120 + True + True + never + in + + + True + True + False + + + + + 1 + + + + + 2 + + + + + 1 + + + + + 1 + + + + + True + end + + + gtk-cancel + True + True + True + False + True + + + False + False + 0 + + + + + True + True + True + False + + + True + 0 + 0 + + + True + 2 + + + True + gtk-save + + + False + False + 0 + + + + + True + _Update + True + + + False + False + 1 + + + + + + + + + False + False + 1 + + + + + False + end + 0 + + + + + + update_files_cancel_button + update_files_ok_button + + + -- cgit v1.2.1