From 8c19823f0b4d6fce9676bc6cdca4bb2edf44ce58 Mon Sep 17 00:00:00 2001 From: Oz N Tiram Date: Tue, 14 Jun 2016 15:08:11 +0200 Subject: Modify glade file for the new glade format and use it for gtk3 * Add glade ui for gtk+3 * Remove usage of things like GTKHBox, GTKHButtonBox and other deprecated widgets --- configure.ac | 2 + mate-screenshot/data/Makefile.am | 6 +- mate-screenshot/data/mate-screenshot-gtk3.ui | 225 +++++++++++++++++++++++++++ mate-screenshot/src/screenshot-dialog.c | 5 + 4 files changed, 237 insertions(+), 1 deletion(-) create mode 100644 mate-screenshot/data/mate-screenshot-gtk3.ui diff --git a/configure.ac b/configure.ac index af693de0..3f161f34 100644 --- a/configure.ac +++ b/configure.ac @@ -92,6 +92,8 @@ esac AC_SUBST(GTK_API_VERSION) AC_SUBST(GTK_REQUIRED) +AM_CONDITIONAL([WITH_GTK3],[test "$with_gtk" = "3.0"]) + # common checks PKG_CHECK_MODULES(GLIB, glib-2.0 >= $GLIB_REQUIRED) AC_SUBST(GLIB_CFLAGS) diff --git a/mate-screenshot/data/Makefile.am b/mate-screenshot/data/Makefile.am index 548b64be..ae781d46 100644 --- a/mate-screenshot/data/Makefile.am +++ b/mate-screenshot/data/Makefile.am @@ -4,9 +4,13 @@ mate_screenshot_DATA = $(mate_screenshot_in_files:.desktop.in=.desktop) @INTLTOOL_DESKTOP_RULE@ man_MANS = mate-screenshot.1 - +if WITH_GTK3 +uidir = $(datadir)/mate-screenshot +ui_DATA = mate-screenshot-gtk3.ui +else uidir = $(datadir)/mate-screenshot ui_DATA = mate-screenshot.ui +endif @INTLTOOL_XML_RULE@ appdatadir = $(datadir)/appdata diff --git a/mate-screenshot/data/mate-screenshot-gtk3.ui b/mate-screenshot/data/mate-screenshot-gtk3.ui new file mode 100644 index 00000000..7d149221 --- /dev/null +++ b/mate-screenshot/data/mate-screenshot-gtk3.ui @@ -0,0 +1,225 @@ + + + + + + + False + 5 + Save Screenshot new-glade + False + dialog + + + + True + False + vertical + 2 + + + True + False + end + + + gtk-help + True + True + True + False + True + + + False + True + 0 + + + + + C_opy to Clipboard + True + True + True + False + True + + + + False + True + 1 + + + + + gtk-cancel + True + True + True + False + True + + + False + True + 2 + + + + + gtk-save + True + True + True + True + False + True + + + False + True + 3 + + + + + False + True + end + 0 + + + + + True + False + 5 + vertical + 18 + + + True + False + 12 + + + True + False + 0 + 0 + in + 0 + 0 + + + True + False + + + + + False + True + 0 + + + + + True + False + 6 + 12 + + + True + False + 0 + _Name: + True + filename_entry + + + 0 + 0 + 1 + 1 + + + + + True + False + 0 + Save in _folder: + True + + + 0 + 1 + 1 + 1 + + + + + True + True + * + True + 32 + + + 1 + 0 + 1 + 1 + + + + + True + False + + + + + + 1 + 1 + 1 + 1 + + + + + True + True + 1 + + + + + True + True + 0 + + + + + True + True + 1 + + + + + + help_button + copy_button + cancel_button + ok_button + + + diff --git a/mate-screenshot/src/screenshot-dialog.c b/mate-screenshot/src/screenshot-dialog.c index 7c5fae6d..5f5fd098 100644 --- a/mate-screenshot/src/screenshot-dialog.c +++ b/mate-screenshot/src/screenshot-dialog.c @@ -234,7 +234,12 @@ screenshot_dialog_new (GdkPixbuf *screenshot, dialog = g_new0 (ScreenshotDialog, 1); dialog->ui = gtk_builder_new (); +#if GTK_CHECK_VERSION (3, 0, 0) + res = gtk_builder_add_from_file (dialog->ui, UIDIR "/mate-screenshot-gtk3.ui", &error); +#else res = gtk_builder_add_from_file (dialog->ui, UIDIR "/mate-screenshot.ui", &error); +#endif + dialog->screenshot = screenshot; if (res == 0) -- cgit v1.2.1