[frogr] Raised minium dependencies: GTK+ >= 3.4 and GLib >= 2.32
- From: Mario Sanchez Prada <msanchez src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [frogr] Raised minium dependencies: GTK+ >= 3.4 and GLib >= 2.32
- Date: Tue, 27 Nov 2012 10:47:46 +0000 (UTC)
commit c61c483b9931bc6a60318a656fc90ac15cc47c7f
Author: Mario Sanchez Prada <msanchez gnome org>
Date: Tue Nov 13 10:43:58 2012 +0100
Raised minium dependencies: GTK+ >= 3.4 and GLib >= 2.32
This will allow both to remove conditional code and simplify the
creation of the global menu in Mac OS X, once we port frogr to
GtkApplication (first) and GMenu (second).
configure.ac | 70 +++--------------------------------
src/Makefile.am | 12 ------
src/examples/example.c | 4 --
src/frogr-about-dialog.c | 43 ----------------------
src/frogr-auth-dialog.c | 9 +++--
src/frogr-controller.c | 4 --
src/frogr-controller.h | 2 -
src/frogr-details-dialog.c | 47 +++++++++++++++---------
src/frogr-gtk-compat.c | 84 -------------------------------------------
src/frogr-gtk-compat.h | 58 -----------------------------
src/frogr-main-view.c | 21 +----------
src/frogr-settings-dialog.c | 58 ++++++++++++-----------------
12 files changed, 66 insertions(+), 346 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index fa5246b..7c89a7b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -18,11 +18,16 @@ CFLAGS="$CFLAGS -DG_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED -DGDK_DISABLE_DE
# (Platform independent) dependencies for frogr
-GLIB_MIN_VERSION=2.22
+GLIB_MIN_VERSION=2.32
PKG_CHECK_MODULES(GLIB, glib-2.0 >= $GLIB_MIN_VERSION gthread-2.0)
FROGR_CFLAGS="$FROGR_CFLAGS $GLIB_CFLAGS"
FROGR_LIBS="$FROGR_LIBS $GLIB_LIBS"
+GTK3_MIN_VERSION=3.4
+PKG_CHECK_MODULES(GTK3, gtk+-3.0 >= $GTK3_MIN_VERSION)
+FROGR_CFLAGS=$GTK3_CFLAGS
+FROGR_LIBS=$GTK3_LIBS
+
EXIF_MIN_VERSION=0.6.14
PKG_CHECK_MODULES(EXIF, libexif >= $EXIF_MIN_VERSION)
FROGR_CFLAGS="$FROGR_CFLAGS $EXIF_CFLAGS"
@@ -114,68 +119,6 @@ fi
FROGR_CFLAGS="$FROGR_CFLAGS $LIBSOUP_CFLAGS"
FROGR_LIBS="$FROGR_LIBS $LIBSOUP_LIBS"
-# Select target version of GTK to use
-
-AC_MSG_CHECKING([GTK+ version to use])
-
-if test "x$platform" = "xGNOME"; then
- # For the GNOME platform allow using GTK2 and GTK3 (default for GNOME)
- AC_ARG_WITH([gtk],
- [AS_HELP_STRING([--with-gtk=2.0|3.0], [GTK+ version to use (default: 3.0)])],
- [case "$with_gtk" in
- 2.0|3.0) ;;
- *) AC_MSG_ERROR([Wrong GTK+ version]) ;;
- esac],
- [with_gtk=3.0])
-else
- # Other non-GNOME platforms (e.g. MacOSX) to support GTK2 only
- with_gtk=2.0
-fi
-
-GTK2_MIN_VERSION=2.16
-GTK3_MIN_VERSION=3.0
-
-case "$with_gtk" in
- 2.0) GTK_MIN_VERSION=$GTK2_MIN_VERSION
- GTK_API_VERSION=2.0
- ;;
- 3.0) GTK_MIN_VERSION=$GTK3_MIN_VERSION
- GTK_API_VERSION=3.0
- ;;
-esac
-
-# Make GTK API version available to the code
-AC_SUBST([GTK_API_VERSION])
-
-if test "x$with_gtk" = "x3.0"; then
- PKG_CHECK_MODULES(GTK3, gtk+-$GTK_API_VERSION >= $GTK_MIN_VERSION,
- [have_gtk_3="yes"], [have_gtk_3="no"])
-
- if test "x$have_gtk_3" = "xyes"; then
- GTK_CFLAGS=$GTK3_CFLAGS
- GTK_LIBS=$GTK3_LIBS
- else
- GTK_MIN_VERSION=$GTK2_MIN_VERSION
- GTK_API_VERSION=2.0
- with_gtk=2.0
- fi
-fi
-
-if test "x$with_gtk" = "x2.0"; then
- PKG_CHECK_MODULES(GTK2, gtk+-$GTK_API_VERSION >= $GTK_MIN_VERSION,
- [have_gtk_2="yes"], [have_gtk_2="no"])
- if test "x$have_gtk_2" = "xyes"; then
- GTK_CFLAGS=$GTK2_CFLAGS
- GTK_LIBS=$GTK2_LIBS
- fi
-fi
-
-AM_CONDITIONAL([GTK_API_VERSION_2],[test "$GTK_API_VERSION" = "2.0"])
-AM_CONDITIONAL([GTK_API_VERSION_3],[test "$GTK_API_VERSION" = "3.0"])
-
-FROGR_CFLAGS="$FROGR_CFLAGS $GTK_CFLAGS"
-FROGR_LIBS="$FROGR_LIBS $GTK_LIBS"
-
# Translations
FROGR_LOCALE_DIR='${localedir}'
AM_GLIB_DEFINE_LOCALEDIR([FROGR_LOCALE_DIR])
@@ -225,7 +168,6 @@ echo "*** frogr is ready to be compiled ***"
echo "*************************************"
echo ""
echo "Platform : $platform"
-echo "Using GTK+ version : $with_gtk"
echo "Using libsoup variant : $with_libsoup"
echo "Enable debug : $enable_debug"
echo ""
diff --git a/src/Makefile.am b/src/Makefile.am
index 3ddbeb2..5d9780d 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -27,16 +27,6 @@ frogr_LDADD = \
frogr_CFLAGS = $(FROGR_CFLAGS) \
-DDATA_DIR=\"$(DATA_DIR)\"
-if GTK_API_VERSION_2
-frogr_CFLAGS += \
- -DGTK_API_VERSION_2=1
-endif
-
-if GTK_API_VERSION_3
-frogr_CFLAGS += \
- -DGTK_API_VERSION_3=1
-endif
-
if !HAVE_MAC_INTEGRATION
frogr_LDFLAGS = -export-dynamic
endif
@@ -67,8 +57,6 @@ frogr_SOURCES = \
frogr-global-defs.h \
frogr-group.c \
frogr-group.h \
- frogr-gtk-compat.c \
- frogr-gtk-compat.h \
frogr-live-entry.c \
frogr-live-entry.h \
frogr-location.c \
diff --git a/src/examples/example.c b/src/examples/example.c
index 9f33e57..f8574ad 100644
--- a/src/examples/example.c
+++ b/src/examples/example.c
@@ -728,10 +728,6 @@ main (int argc,
g_type_init ();
#endif
-#if !GLIB_CHECK_VERSION(2,32,0)
- g_thread_init (NULL);
-#endif
-
g_print ("Running flicksoup example...\n\n");
/* Find full path to the testing photo */
diff --git a/src/frogr-about-dialog.c b/src/frogr-about-dialog.c
index cbcd99a..fc614d4 100644
--- a/src/frogr-about-dialog.c
+++ b/src/frogr-about-dialog.c
@@ -44,38 +44,6 @@ static const gchar *appdescr = N_("A Flickr remote organizer for GNOME\n");
static const gchar *copyright = "(c) 2009-2012 Mario Sanchez Prada";
static const gchar *website = "http://live.gnome.org/Frogr";
-#ifndef GTK_API_VERSION_3
-static const gchar *license =
- "frogr is free software: you can redistribute\n"
- "it and/or modify it under the terms of the GNU\n"
- "General Public License version 3 as published by\n"
- "the Free Software Foundation.\n"
- "\n"
- "frogr is distributed in the hope that it will\n"
- "be useful, but WITHOUT ANY WARRANTY; without even\n"
- "the implied warranty of MERCHANTABILITY or FITNESS\n"
- "FOR A PARTICULAR PURPOSE. See the GNU General\n"
- "Public License for more details.\n"
- "\n"
- "You should have received a copy of the GNU General\n"
- "Public License along with frogr. If not, see\n"
- "http://www.gnu.org/licenses/\n\n"
- "This program uses its own implementation of Flickr API,\n"
- "but it's neither approved nor certified by flickr.";
-#endif
-
-#if !GTK_CHECK_VERSION (2,24,0) || MAC_INTEGRATION
-static void
-_frogr_about_dialog_uri_hook (GtkAboutDialog *about,
- const gchar *link,
- gpointer data)
-{
- gchar *uri = g_strconcat (data, link, NULL);
- frogr_util_open_uri (uri);
- g_free (uri);
-}
-#endif
-
void
frogr_about_dialog_show (GtkWindow *parent)
{
@@ -88,13 +56,6 @@ frogr_about_dialog_show (GtkWindow *parent)
logo = gdk_pixbuf_new_from_file (icon_full_path, NULL);
g_free (icon_full_path);
-#if !GTK_CHECK_VERSION (2,24,0) || MAC_INTEGRATION
- /* Install about dialog hooks */
- gtk_about_dialog_set_url_hook (_frogr_about_dialog_uri_hook, "", NULL);
- gtk_about_dialog_set_email_hook (_frogr_about_dialog_uri_hook, "mailto:",
- NULL);
-#endif
-
version = g_strdup_printf ("%s~unreleased", VERSION);
/* Show about dialog */
@@ -104,11 +65,7 @@ frogr_about_dialog_show (GtkWindow *parent)
"artists", artists,
"comments", _(appdescr),
"copyright", copyright,
-#ifdef GTK_API_VERSION_3
"license-type", GTK_LICENSE_GPL_3_0,
-#else
- "license", license,
-#endif
"version", version,
"website", website,
"logo", logo,
diff --git a/src/frogr-auth-dialog.c b/src/frogr-auth-dialog.c
index bfc8b96..a1075f2 100644
--- a/src/frogr-auth-dialog.c
+++ b/src/frogr-auth-dialog.c
@@ -22,7 +22,6 @@
#include "frogr-controller.h"
#include "frogr-global-defs.h"
-#include "frogr-gtk-compat.h"
#include "frogr-util.h"
#include <config.h>
@@ -109,7 +108,8 @@ _build_verification_code_entry_widget (GtkWidget *dialog)
gchar *entry_key = NULL;
gint i = 0;
- hbox = frogr_gtk_compat_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
+ hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
+ gtk_box_set_homogeneous (GTK_BOX (hbox), FALSE);
for (i = 0; i < 3; i++)
{
entry = gtk_entry_new ();
@@ -126,7 +126,7 @@ _build_verification_code_entry_widget (GtkWidget *dialog)
NULL);
if (i < 2)
{
- separator = frogr_gtk_compat_separator_new (GTK_ORIENTATION_HORIZONTAL);
+ separator = gtk_separator_new (GTK_ORIENTATION_HORIZONTAL);
gtk_box_pack_start (GTK_BOX (hbox), separator, TRUE, TRUE, 0);
}
}
@@ -157,7 +157,8 @@ _ask_for_auth_confirmation (GtkWindow *parent)
/* Fill action area */
content_area = gtk_dialog_get_content_area (GTK_DIALOG (dialog));
- vbox = frogr_gtk_compat_box_new (GTK_ORIENTATION_VERTICAL, 0);
+ vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
+ gtk_box_set_homogeneous (GTK_BOX (vbox), FALSE);
/* Description label */
label = gtk_label_new (auth_txt);
diff --git a/src/frogr-controller.c b/src/frogr-controller.c
index 64e71b5..550399a 100644
--- a/src/frogr-controller.c
+++ b/src/frogr-controller.c
@@ -2136,10 +2136,8 @@ frogr_controller_init (FrogrController *self)
host, port, username, password);
}
-#ifdef GTK_API_VERSION_3
/* Select the dark theme if needed */
frogr_controller_set_use_dark_theme (self, frogr_config_get_use_dark_theme (priv->config));
-#endif
}
@@ -2835,7 +2833,6 @@ frogr_controller_save_project_to_file (FrogrController *self, const gchar *path)
g_object_unref (json_gen);
}
-#ifdef GTK_API_VERSION_3
void
frogr_controller_set_use_dark_theme (FrogrController *self, gboolean value)
{
@@ -2844,4 +2841,3 @@ frogr_controller_set_use_dark_theme (FrogrController *self, gboolean value)
gtk_settings = gtk_settings_get_default ();
g_object_set (G_OBJECT (gtk_settings), "gtk-application-prefer-dark-theme", value, NULL);
}
-#endif
diff --git a/src/frogr-controller.h b/src/frogr-controller.h
index a929ebd..491ec42 100644
--- a/src/frogr-controller.h
+++ b/src/frogr-controller.h
@@ -130,9 +130,7 @@ void frogr_controller_load_project_from_file (FrogrController *self, const gchar
void frogr_controller_save_project_to_file (FrogrController *self, const gchar *path);
-#ifdef GTK_API_VERSION_3
void frogr_controller_set_use_dark_theme (FrogrController *self, gboolean value);
-#endif
G_END_DECLS
diff --git a/src/frogr-details-dialog.c b/src/frogr-details-dialog.c
index 57e7f29..59d8819 100644
--- a/src/frogr-details-dialog.c
+++ b/src/frogr-details-dialog.c
@@ -23,7 +23,6 @@
#include "frogr-config.h"
#include "frogr-controller.h"
#include "frogr-global-defs.h"
-#include "frogr-gtk-compat.h"
#include "frogr-live-entry.h"
#include "frogr-main-view.h"
#include "frogr-model.h"
@@ -167,8 +166,10 @@ _create_widgets (FrogrDetailsDialog *self)
main_vbox = gtk_dialog_get_content_area (GTK_DIALOG (self));
- hbox = frogr_gtk_compat_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
- vbox = frogr_gtk_compat_box_new (GTK_ORIENTATION_VERTICAL, 0);
+ hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
+ gtk_box_set_homogeneous (GTK_BOX (hbox), FALSE);
+ vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
+ gtk_box_set_homogeneous (GTK_BOX (vbox), FALSE);
/* Left side (image, radio buttons, checkboxes...) */
@@ -192,8 +193,10 @@ _create_widgets (FrogrDetailsDialog *self)
/* Visibility */
- section_vbox = frogr_gtk_compat_box_new (GTK_ORIENTATION_VERTICAL, 6);
- visibility_vbox = frogr_gtk_compat_box_new (GTK_ORIENTATION_VERTICAL, 6);
+ section_vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
+ gtk_box_set_homogeneous (GTK_BOX (section_vbox), FALSE);
+ visibility_vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
+ gtk_box_set_homogeneous (GTK_BOX (visibility_vbox), FALSE);
markup = g_markup_printf_escaped ("<span weight=\"bold\">%s</span>",
_("Visibility"));
@@ -205,7 +208,8 @@ _create_widgets (FrogrDetailsDialog *self)
gtk_container_add (GTK_CONTAINER (align), widget);
gtk_box_pack_start (GTK_BOX (section_vbox), align, FALSE, FALSE, 0);
- internal_hbox = frogr_gtk_compat_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
+ internal_hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
+ gtk_box_set_homogeneous (GTK_BOX (internal_hbox), FALSE);
widget = gtk_radio_button_new_with_mnemonic (NULL, _("_Private"));
gtk_box_pack_start (GTK_BOX (internal_hbox), widget, FALSE, FALSE, 0);
@@ -217,7 +221,8 @@ _create_widgets (FrogrDetailsDialog *self)
gtk_box_pack_start (GTK_BOX (visibility_vbox), internal_hbox, FALSE, FALSE, 0);
- private_vbox = frogr_gtk_compat_box_new (GTK_ORIENTATION_VERTICAL, 6);
+ private_vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
+ gtk_box_set_homogeneous (GTK_BOX (private_vbox), FALSE);
widget = gtk_check_button_new_with_mnemonic (_("Visible to _Family"));
gtk_box_pack_start (GTK_BOX (private_vbox), widget, FALSE, FALSE, 0);
@@ -227,12 +232,14 @@ _create_widgets (FrogrDetailsDialog *self)
gtk_box_pack_start (GTK_BOX (private_vbox), widget, FALSE, FALSE, 0);
priv->friend_cb = widget;
- internal_hbox = frogr_gtk_compat_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
+ internal_hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
+ gtk_box_set_homogeneous (GTK_BOX (internal_hbox), FALSE);
gtk_box_pack_start (GTK_BOX (internal_hbox), private_vbox, FALSE, FALSE, 12);
gtk_box_pack_start (GTK_BOX (visibility_vbox), internal_hbox, FALSE, FALSE, 0);
- internal_hbox = frogr_gtk_compat_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
+ internal_hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
+ gtk_box_set_homogeneous (GTK_BOX (internal_hbox), FALSE);
gtk_box_pack_start (GTK_BOX (internal_hbox), visibility_vbox, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (section_vbox), internal_hbox, FALSE, FALSE, 0);
@@ -241,8 +248,10 @@ _create_widgets (FrogrDetailsDialog *self)
/* Content type */
- section_vbox = frogr_gtk_compat_box_new (GTK_ORIENTATION_VERTICAL, 6);
- content_type_hbox = frogr_gtk_compat_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
+ section_vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
+ gtk_box_set_homogeneous (GTK_BOX (section_vbox), FALSE);
+ content_type_hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
+ gtk_box_set_homogeneous (GTK_BOX (content_type_hbox), FALSE);
markup = g_markup_printf_escaped ("<span weight=\"bold\">%s</span>",
_("Content Type"));
@@ -272,8 +281,10 @@ _create_widgets (FrogrDetailsDialog *self)
/* Safety level */
- section_vbox = frogr_gtk_compat_box_new (GTK_ORIENTATION_VERTICAL, 6);
- safety_level_hbox = frogr_gtk_compat_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
+ section_vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
+ gtk_box_set_homogeneous (GTK_BOX (section_vbox), FALSE);
+ safety_level_hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
+ gtk_box_set_homogeneous (GTK_BOX (safety_level_hbox), FALSE);
markup = g_markup_printf_escaped ("<span weight=\"bold\">%s</span>",
_("Safety Level"));
@@ -303,7 +314,8 @@ _create_widgets (FrogrDetailsDialog *self)
/* License type */
- section_vbox = frogr_gtk_compat_box_new (GTK_ORIENTATION_VERTICAL, 6);
+ section_vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
+ gtk_box_set_homogeneous (GTK_BOX (section_vbox), FALSE);
markup = g_markup_printf_escaped ("<span weight=\"bold\">%s</span>",
_("License Type"));
@@ -315,9 +327,9 @@ _create_widgets (FrogrDetailsDialog *self)
gtk_container_add (GTK_CONTAINER (align), widget);
gtk_box_pack_start (GTK_BOX (section_vbox), align, FALSE, FALSE, 0);
- widget = frogr_gtk_compat_combo_box_text_new ();
+ widget = gtk_combo_box_text_new ();
for (i = 0; license_descriptions[i]; i++)
- frogr_gtk_compat_combo_box_text_insert (GTK_COMBO_BOX (widget), i, _(license_descriptions[i]));
+ gtk_combo_box_text_insert (GTK_COMBO_BOX_TEXT (widget), i, NULL, _(license_descriptions[i]));
priv->license_cb = widget;
gtk_box_pack_start (GTK_BOX (section_vbox), widget, FALSE, FALSE, 0);
@@ -326,7 +338,8 @@ _create_widgets (FrogrDetailsDialog *self)
/* Other properties */
- section_vbox = frogr_gtk_compat_box_new (GTK_ORIENTATION_VERTICAL, 6);
+ section_vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
+ gtk_box_set_homogeneous (GTK_BOX (section_vbox), FALSE);
markup = g_markup_printf_escaped ("<span weight=\"bold\">%s</span>",
_("Other Properties"));
diff --git a/src/frogr-main-view.c b/src/frogr-main-view.c
index c6a502f..f22da8e 100644
--- a/src/frogr-main-view.c
+++ b/src/frogr-main-view.c
@@ -27,7 +27,6 @@
#include "frogr-config.h"
#include "frogr-controller.h"
#include "frogr-global-defs.h"
-#include "frogr-gtk-compat.h"
#include "frogr-model.h"
#include "frogr-picture.h"
#include "frogr-util.h"
@@ -1914,6 +1913,7 @@ frogr_main_view_init (FrogrMainView *self)
GtkWidget *progress_vbox;
GtkWidget *progress_bar;
GtkWidget *progress_label;
+ GtkWidget *toolbar;
const gchar *icons_path;
gchar *full_path;
GList *icons = NULL;
@@ -1922,10 +1922,6 @@ frogr_main_view_init (FrogrMainView *self)
GtkWidget *main_vbox;
#endif
-#ifdef GTK_API_VERSION_3
- GtkWidget *toolbar;
-#endif
-
/* Init model, controller and configuration */
priv->model = frogr_model_new ();
priv->controller = g_object_ref (frogr_controller_get_instance ());
@@ -1981,11 +1977,9 @@ frogr_main_view_init (FrogrMainView *self)
gtk_box_reorder_child (GTK_BOX (main_vbox), priv->menu_bar, 0);
#endif
-#ifdef GTK_API_VERSION_3
toolbar = GTK_WIDGET (gtk_builder_get_object (builder, "toolbar"));
gtk_style_context_add_class (gtk_widget_get_style_context (toolbar),
GTK_STYLE_CLASS_PRIMARY_TOOLBAR);
-#endif
icon_view = GTK_WIDGET (gtk_builder_get_object (builder, "icon_view"));
priv->icon_view = icon_view;
@@ -2118,12 +2112,7 @@ frogr_main_view_init (FrogrMainView *self)
gtk_box_pack_start (GTK_BOX (progress_vbox), progress_label, FALSE, FALSE, 6);
progress_bar = gtk_progress_bar_new ();
-
-#ifdef GTK_API_VERSION_3
- /* In GTK3, we need to make this explicit, otherwise no text will be
- shown superimposed over the progress bar */
gtk_progress_bar_set_show_text (GTK_PROGRESS_BAR (progress_bar), TRUE);
-#endif
gtk_box_pack_start (GTK_BOX (progress_vbox), progress_bar, FALSE, FALSE, 6);
@@ -2286,9 +2275,7 @@ frogr_main_view_show_progress (FrogrMainView *self, const gchar *text)
/* Reset values */
gtk_progress_bar_set_text (GTK_PROGRESS_BAR (priv->progress_bar), "");
gtk_progress_bar_set_fraction (GTK_PROGRESS_BAR (priv->progress_bar), 0.0);
-#ifdef GTK_API_VERSION_3
gtk_progress_bar_set_show_text (GTK_PROGRESS_BAR (priv->progress_bar), FALSE);
-#endif
gtk_widget_show_all (GTK_WIDGET (priv->progress_dialog));
gtk_window_present (GTK_WINDOW (priv->progress_dialog));
@@ -2317,9 +2304,7 @@ frogr_main_view_set_progress_status_text (FrogrMainView *self, const gchar *text
/* Set superimposed text, if specified */
if (text != NULL)
{
-#ifdef GTK_API_VERSION_3
gtk_progress_bar_set_show_text (GTK_PROGRESS_BAR (priv->progress_bar), TRUE);
-#endif
gtk_progress_bar_set_text (GTK_PROGRESS_BAR (priv->progress_bar), text);
}
}
@@ -2355,11 +2340,7 @@ frogr_main_view_pulse_progress (FrogrMainView *self)
gtk_progress_bar_pulse (GTK_PROGRESS_BAR (priv->progress_bar));
/* Empty text for this */
-#ifdef GTK_API_VERSION_3
gtk_progress_bar_set_show_text (GTK_PROGRESS_BAR (priv->progress_bar), FALSE);
-#else
- gtk_progress_bar_set_text (GTK_PROGRESS_BAR (priv->progress_bar), NULL);
-#endif
}
void
diff --git a/src/frogr-settings-dialog.c b/src/frogr-settings-dialog.c
index c022400..f16b636 100644
--- a/src/frogr-settings-dialog.c
+++ b/src/frogr-settings-dialog.c
@@ -23,7 +23,6 @@
#include "frogr-config.h"
#include "frogr-controller.h"
#include "frogr-global-defs.h"
-#include "frogr-gtk-compat.h"
#include "frogr-util.h"
#include <config.h>
@@ -69,9 +68,7 @@ typedef struct _FrogrSettingsDialogPrivate {
GtkWidget *enable_tags_autocompletion_cb;
GtkWidget *keep_file_extensions_cb;
GtkWidget *import_tags_cb;
-#ifdef GTK_API_VERSION_3
GtkWidget *use_dark_theme_cb;
-#endif
gboolean public_visibility;
gboolean family_visibility;
@@ -81,9 +78,7 @@ typedef struct _FrogrSettingsDialogPrivate {
gboolean enable_tags_autocompletion;
gboolean keep_file_extensions;
gboolean import_tags;
-#ifdef GTK_API_VERSION_3
gboolean use_dark_theme;
-#endif
FspLicense license;
FspSafetyLevel safety_level;
@@ -183,7 +178,8 @@ _add_general_page (FrogrSettingsDialog *self, GtkNotebook *notebook)
priv = FROGR_SETTINGS_DIALOG_GET_PRIVATE (self);
- vbox = frogr_gtk_compat_box_new (GTK_ORIENTATION_VERTICAL, 6);
+ vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
+ gtk_box_set_homogeneous (GTK_BOX (vbox), FALSE);
/* Default Visibility */
@@ -198,8 +194,10 @@ _add_general_page (FrogrSettingsDialog *self, GtkNotebook *notebook)
gtk_container_add (GTK_CONTAINER (align), label);
gtk_box_pack_start (GTK_BOX (vbox), align, FALSE, FALSE, 6);
- box1 = frogr_gtk_compat_box_new (GTK_ORIENTATION_VERTICAL, 6);
- box2 = frogr_gtk_compat_box_new (GTK_ORIENTATION_HORIZONTAL, 12);
+ box1 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
+ gtk_box_set_homogeneous (GTK_BOX (box1), FALSE);
+ box2 = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 12);
+ gtk_box_set_homogeneous (GTK_BOX (box2), FALSE);
_add_toggleable_item (self, GTK_BOX (box2), NULL, TRUE, _("_Private"), &priv->private_rb);
_add_toggleable_item (self, GTK_BOX (box2), GTK_RADIO_BUTTON (priv->private_rb),
@@ -207,14 +205,16 @@ _add_general_page (FrogrSettingsDialog *self, GtkNotebook *notebook)
gtk_box_pack_start (GTK_BOX (box1), box2, FALSE, FALSE, 0);
- box2 = frogr_gtk_compat_box_new (GTK_ORIENTATION_VERTICAL, 6);
+ box2 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
+ gtk_box_set_homogeneous (GTK_BOX (box2), FALSE);
_add_toggleable_item (self, GTK_BOX (box2), NULL, FALSE,
_("Visible to _Family"), &priv->family_cb);
_add_toggleable_item (self, GTK_BOX (box2), NULL, FALSE,
_("Visible to F_riends"), &priv->friend_cb);
- padding_hbox = frogr_gtk_compat_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
+ padding_hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
+ gtk_box_set_homogeneous (GTK_BOX (padding_hbox), FALSE);
gtk_box_pack_start (GTK_BOX (padding_hbox), box2, FALSE, FALSE, 12);
gtk_box_pack_start (GTK_BOX (box1), padding_hbox, FALSE, FALSE, 0);
@@ -234,7 +234,8 @@ _add_general_page (FrogrSettingsDialog *self, GtkNotebook *notebook)
gtk_container_add (GTK_CONTAINER (align), label);
gtk_box_pack_start (GTK_BOX (vbox), align, FALSE, FALSE, 6);
- box1 = frogr_gtk_compat_box_new (GTK_ORIENTATION_HORIZONTAL, 12);
+ box1 = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 12);
+ gtk_box_set_homogeneous (GTK_BOX (box1), FALSE);
_add_toggleable_item (self, GTK_BOX (box1), NULL, TRUE,
_("P_hoto"), &priv->photo_content_rb);
@@ -258,7 +259,8 @@ _add_general_page (FrogrSettingsDialog *self, GtkNotebook *notebook)
gtk_container_add (GTK_CONTAINER (align), label);
gtk_box_pack_start (GTK_BOX (vbox), align, FALSE, FALSE, 6);
- box1 = frogr_gtk_compat_box_new (GTK_ORIENTATION_HORIZONTAL, 12);
+ box1 = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 12);
+ gtk_box_set_homogeneous (GTK_BOX (box1), FALSE);
_add_toggleable_item (self, GTK_BOX (box1), NULL, TRUE,
_("S_afe"), &priv->safe_rb);
@@ -282,9 +284,9 @@ _add_general_page (FrogrSettingsDialog *self, GtkNotebook *notebook)
gtk_container_add (GTK_CONTAINER (align), label);
gtk_box_pack_start (GTK_BOX (vbox), align, FALSE, FALSE, 6);
- combo = frogr_gtk_compat_combo_box_text_new ();
+ combo = gtk_combo_box_text_new ();
for (i = 0; license_descriptions[i]; i++)
- frogr_gtk_compat_combo_box_text_insert (GTK_COMBO_BOX (combo), i, _(license_descriptions[i]));
+ gtk_combo_box_text_insert (GTK_COMBO_BOX_TEXT (combo), i, NULL, _(license_descriptions[i]));
gtk_box_pack_start (GTK_BOX (vbox), combo, FALSE, FALSE, 0);
priv->license_cb = combo;
@@ -306,7 +308,8 @@ _add_general_page (FrogrSettingsDialog *self, GtkNotebook *notebook)
gtk_container_add (GTK_CONTAINER (align), label);
gtk_box_pack_start (GTK_BOX (vbox), align, FALSE, FALSE, 6);
- box1 = frogr_gtk_compat_box_new (GTK_ORIENTATION_VERTICAL, 6);
+ box1 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
+ gtk_box_set_homogeneous (GTK_BOX (box1), FALSE);
_add_toggleable_item (self, GTK_BOX (box1), NULL, FALSE,
_("Set Geo_location Information for Pictures"),
@@ -335,7 +338,8 @@ _add_connection_page (FrogrSettingsDialog *self, GtkNotebook *notebook)
priv = FROGR_SETTINGS_DIALOG_GET_PRIVATE (self);
- vbox = frogr_gtk_compat_box_new (GTK_ORIENTATION_VERTICAL, 6);
+ vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
+ gtk_box_set_homogeneous (GTK_BOX (vbox), FALSE);
/* Proxy settings */
@@ -478,7 +482,8 @@ _add_misc_page (FrogrSettingsDialog *self, GtkNotebook *notebook)
priv = FROGR_SETTINGS_DIALOG_GET_PRIVATE (self);
- vbox = frogr_gtk_compat_box_new (GTK_ORIENTATION_VERTICAL, 6);
+ vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
+ gtk_box_set_homogeneous (GTK_BOX (vbox), FALSE);
/* Other Stuff */
@@ -493,7 +498,8 @@ _add_misc_page (FrogrSettingsDialog *self, GtkNotebook *notebook)
gtk_container_add (GTK_CONTAINER (align), label);
gtk_box_pack_start (GTK_BOX (vbox), align, FALSE, FALSE, 6);
- box = frogr_gtk_compat_box_new (GTK_ORIENTATION_VERTICAL, 6);
+ box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
+ gtk_box_set_homogeneous (GTK_BOX (box), FALSE);
_add_toggleable_item (self, GTK_BOX (box), NULL, FALSE,
_("Ena_ble Tags Auto-Completion"),
@@ -502,11 +508,9 @@ _add_misc_page (FrogrSettingsDialog *self, GtkNotebook *notebook)
_("_Import Tags from Pictures Metadata"),
&priv->import_tags_cb);
-#ifdef GTK_API_VERSION_3
_add_toggleable_item (self, GTK_BOX (box), NULL, FALSE,
_("Use _Dark GTK Theme"),
&priv->use_dark_theme_cb);
-#endif
_add_toggleable_item (self, GTK_BOX (box), NULL, FALSE,
_("_Keep File Extensions in Titles when Loading"),
@@ -536,9 +540,7 @@ _fill_dialog_with_data (FrogrSettingsDialog *self)
priv->enable_tags_autocompletion = frogr_config_get_tags_autocompletion (priv->config);
priv->keep_file_extensions = frogr_config_get_keep_file_extensions (priv->config);
priv->import_tags = frogr_config_get_import_tags_from_metadata (priv->config);
-#ifdef GTK_API_VERSION_3
priv->use_dark_theme = frogr_config_get_use_dark_theme (priv->config);
-#endif
priv->use_proxy = frogr_config_get_use_proxy (priv->config);
#ifdef HAVE_LIBSOUP_GNOME
priv->use_gnome_proxy = frogr_config_get_use_gnome_proxy (priv->config);
@@ -604,10 +606,8 @@ _fill_dialog_with_data (FrogrSettingsDialog *self)
priv->keep_file_extensions);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (priv->import_tags_cb),
priv->import_tags);
-#ifdef GTK_API_VERSION_3
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (priv->use_dark_theme_cb),
priv->use_dark_theme);
-#endif
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (priv->use_proxy_cb),
priv->use_proxy);
#ifdef HAVE_LIBSOUP_GNOME
@@ -651,9 +651,7 @@ _save_data (FrogrSettingsDialog *self)
frogr_config_set_tags_autocompletion (priv->config, priv->enable_tags_autocompletion);
frogr_config_set_keep_file_extensions (priv->config, priv->keep_file_extensions);
frogr_config_set_import_tags_from_metadata (priv->config, priv->import_tags);
-#ifdef GTK_API_VERSION_3
frogr_config_set_use_dark_theme (priv->config, priv->use_dark_theme);
-#endif
frogr_config_set_use_proxy (priv->config, priv->use_proxy);
#ifdef HAVE_LIBSOUP_GNOME
@@ -816,13 +814,11 @@ _on_button_toggled (GtkToggleButton *button, gpointer data)
DEBUG ("import tags from pictures metadata set to %s", active ? "TRUE" : "FALSE");
}
-#ifdef GTK_API_VERSION_3
if (GTK_WIDGET (button) == priv->use_dark_theme_cb)
{
priv->use_dark_theme = active;
DEBUG ("Use Dark Theme set to %s", active ? "TRUE" : "FALSE");
}
-#endif
if (GTK_WIDGET (button) == priv->use_proxy_cb)
{
@@ -907,10 +903,8 @@ static void _dialog_response_cb (GtkDialog *dialog, gint response, gpointer data
else
frogr_controller_set_proxy (priv->controller, FALSE, NULL, NULL, NULL, NULL);
-#ifdef GTK_API_VERSION_3
/* Update dark theme related stuff */
frogr_controller_set_use_dark_theme (priv->controller, priv->use_dark_theme);
-#endif
}
gtk_widget_hide (GTK_WIDGET (self));
@@ -986,9 +980,7 @@ frogr_settings_dialog_init (FrogrSettingsDialog *self)
priv->enable_tags_autocompletion_cb = NULL;
priv->keep_file_extensions_cb = NULL;
priv->import_tags_cb = NULL;
-#ifdef GTK_API_VERSION_3
priv->use_dark_theme_cb = NULL;
-#endif
priv->use_proxy_cb = NULL;
priv->use_gnome_proxy_cb = NULL;
priv->proxy_host_label = NULL;
@@ -1010,9 +1002,7 @@ frogr_settings_dialog_init (FrogrSettingsDialog *self)
priv->enable_tags_autocompletion = TRUE;
priv->keep_file_extensions = FALSE;
priv->import_tags = TRUE;
-#ifdef GTK_API_VERSION_3
priv->use_dark_theme = TRUE;
-#endif
priv->use_proxy = FALSE;
priv->use_gnome_proxy = FALSE;
priv->proxy_host = NULL;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]