GtkWidget* browser;
const gchar* dialog_title;
GtkWidget* dialog;
+ GtkWidget* content_area;
gint width, height;
GtkWidget* xfce_heading;
GtkWidget* hbox;
dialog_title = _("Configure Advertisement filters");
dialog = gtk_dialog_new_with_buttons (dialog_title, GTK_WINDOW (browser),
-#if GTK_CHECK_VERSION(3,0,0)
- GTK_DIALOG_DESTROY_WITH_PARENT,
-#else
GTK_DIALOG_DESTROY_WITH_PARENT | GTK_DIALOG_NO_SEPARATOR,
-#endif
#if !HAVE_OSX
#if !HAVE_HILDON
GTK_STOCK_HELP, GTK_RESPONSE_HELP,
GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE,
#endif
NULL);
+ content_area = gtk_dialog_get_content_area (GTK_DIALOG (dialog));
g_signal_connect (dialog, "destroy",
G_CALLBACK (gtk_widget_destroyed), &dialog);
gtk_window_set_icon_name (GTK_WINDOW (dialog), GTK_STOCK_PROPERTIES);
/* TODO: We need mnemonics */
if ((xfce_heading = sokoke_xfce_header_new (
gtk_window_get_icon_name (GTK_WINDOW (dialog)), dialog_title)))
-#if GTK_CHECK_VERSION(3,0,0)
- gtk_box_pack_start (gtk_dialog_get_content_area (GTK_DIALOG (dialog)),
- xfce_heading, FALSE, FALSE, 0);
+ gtk_box_pack_start (GTK_BOX (content_area), xfce_heading, FALSE, FALSE, 0);
hbox = gtk_hbox_new (FALSE, 0);
- gtk_box_pack_start (gtk_dialog_get_content_area (GTK_DIALOG (dialog)), hbox,
- TRUE, TRUE, 12);
-#else
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox),
- xfce_heading, FALSE, FALSE, 0);
- hbox = gtk_hbox_new (FALSE, 0);
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), hbox,
- TRUE, TRUE, 12);
-#endif
+ gtk_box_pack_start (GTK_BOX (content_area), hbox, TRUE, TRUE, 12);
vbox = gtk_vbox_new (FALSE, 0);
gtk_box_pack_start (GTK_BOX (hbox), vbox, TRUE, TRUE, 4);
button = gtk_label_new (NULL);
G_CALLBACK (adblock_preferences_help_clicked_cb), dialog); */
gtk_box_pack_end (GTK_BOX (hbox),
button, FALSE, FALSE, 4);
-#if GTK_CHECK_VERSION(3,0,0)
- gtk_box_pack_end (gtk_dialog_get_content_area(GTK_DIALOG (dialog)),
+ gtk_box_pack_end (GTK_BOX (content_area),
hbox, FALSE, FALSE, 0);
-#else
- gtk_box_pack_end (GTK_BOX (GTK_DIALOG (dialog)->vbox),
- hbox, FALSE, FALSE, 0);
-#endif
#endif
-#if GTK_CHECK_VERSION(3,0,0)
- gtk_widget_show_all (gtk_dialog_get_content_area(GTK_DIALOG (dialog)));
-#else
- gtk_widget_show_all (GTK_DIALOG (dialog)->vbox);
-#endif
+ gtk_widget_show_all (content_area);
g_object_unref (browser);
MidoriApp* app;
GtkWidget* browser;
GtkWidget* dialog;
+ GtkWidget* content_area;
GtkSizeGroup* sizegroup;
GtkWidget* hbox;
GtkWidget* label;
title = _("Edit rule");
dialog = gtk_dialog_new_with_buttons (title, GTK_WINDOW (browser),
-#if GTK_CHECK_VERSION(3,0,0)
- GTK_DIALOG_DESTROY_WITH_PARENT,
-#else
GTK_DIALOG_DESTROY_WITH_PARENT | GTK_DIALOG_NO_SEPARATOR,
-#endif
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GTK_STOCK_ADD, GTK_RESPONSE_ACCEPT,
NULL);
+ content_area = gtk_dialog_get_content_area (GTK_DIALOG (dialog));
gtk_window_set_icon_name (GTK_WINDOW (dialog), GTK_STOCK_ADD);
gtk_container_set_border_width (GTK_CONTAINER (dialog), 5);
-#if GTK_CHECK_VERSION(3,0,0)
- gtk_container_set_border_width (gtk_dialog_get_content_area (GTK_DIALOG (dialog)), 5);
-#else
- gtk_container_set_border_width (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), 5);
-#endif
+ gtk_container_set_border_width (GTK_CONTAINER (content_area), 5);
sizegroup = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
hbox = gtk_hbox_new (FALSE, 8);
gtk_entry_set_text (GTK_ENTRY (entry),
g_object_get_data (G_OBJECT (widget), "uri"));
gtk_box_pack_start (GTK_BOX (hbox), entry, TRUE, TRUE, 0);
-#if GTK_CHECK_VERSION(3,0,0)
- gtk_container_add (gtk_dialog_get_content_area (GTK_DIALOG (dialog)), hbox);
-#else
- gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), hbox);
-#endif
+ gtk_container_add (GTK_CONTAINER (content_area), hbox);
gtk_widget_show_all (hbox);
gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_ACCEPT);
WebKitHitTestResultContext context;
WebKitHitTestResult* hit_test;
-#if GTK_CHECK_VERSION(3,0,0)
gdk_window_get_pointer (gtk_widget_get_window(GTK_WIDGET (web_view)), &x, &y, NULL);
-#else
- gdk_window_get_pointer (GTK_WIDGET (web_view)->window, &x, &y, NULL);
-#endif
event.x = x;
event.y = y;
hit_test = webkit_web_view_get_hit_test_result (web_view, &event);
#include <midori/midori.h>
#include <midori/sokoke.h>
-#include <glib.h>
#include <glib/gstdio.h>
#include "config.h"
dialog = gtk_dialog_new_with_buttons (
_("New feed"), GTK_WINDOW (priv->browser),
-#if GTK_CHECK_VERSION(3,0,0)
- GTK_DIALOG_DESTROY_WITH_PARENT,
-#else
GTK_DIALOG_DESTROY_WITH_PARENT | GTK_DIALOG_NO_SEPARATOR,
-#endif
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GTK_STOCK_ADD, GTK_RESPONSE_ACCEPT,
NULL);
gtk_window_set_icon_name (GTK_WINDOW (dialog), GTK_STOCK_ADD);
gtk_container_set_border_width (GTK_CONTAINER (dialog), 5);
-#if GTK_CHECK_VERSION(3,0,0)
gtk_container_set_border_width (GTK_CONTAINER(gtk_dialog_get_content_area( GTK_DIALOG (dialog))), 5);
-#else
- gtk_container_set_border_width (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), 5);
-#endif
sizegroup = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
hbox = gtk_hbox_new (FALSE, 8);
gtk_entry_set_activates_default (GTK_ENTRY (entry), TRUE);
gtk_entry_set_text (GTK_ENTRY (entry), "");
gtk_box_pack_start (GTK_BOX (hbox), entry, TRUE, TRUE, 0);
-#if GTK_CHECK_VERSION(3,0,0)
gtk_container_add (GTK_CONTAINER(gtk_dialog_get_content_area (GTK_DIALOG (dialog))), hbox);
-#else
- gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), hbox);
-#endif
gtk_widget_show_all (hbox);
gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_ACCEPT);
dialog_title = _("Customize Keyboard shortcuts");
dialog = gtk_dialog_new_with_buttons (dialog_title, GTK_WINDOW (browser),
-#if GTK_CHECK_VERSION(3,0,0)
- GTK_DIALOG_DESTROY_WITH_PARENT,
-#else
GTK_DIALOG_DESTROY_WITH_PARENT | GTK_DIALOG_NO_SEPARATOR,
-#endif
#if !HAVE_OSX
GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE,
#endif
g_signal_connect (dialog, "response",
G_CALLBACK (shortcuts_preferences_response_cb), NULL);
-#if GTK_CHECK_VERSION(3,0,0)
dialog_vbox = gtk_dialog_get_content_area(GTK_DIALOG(dialog));
-#else
- dialog_vbox = GTK_DIALOG (dialog)->vbox;
-#endif
if ((xfce_heading = sokoke_xfce_header_new (
gtk_window_get_icon_name (GTK_WINDOW (dialog)), dialog_title)))
gtk_box_pack_start (GTK_BOX (dialog_vbox),
0, GTK_SORT_ASCENDING);
g_object_unref (model);
-#if GTK_CHECK_VERSION(3,0,0)
gtk_widget_show_all (gtk_dialog_get_content_area(GTK_DIALOG (dialog)));
-#else
- gtk_widget_show_all (GTK_DIALOG (dialog)->vbox);
-#endif
g_object_unref (browser);
else GTK_WIDGET_UNSET_FLAGS (wdgt, GTK_REALIZED)
#endif
+#if GTK_CHECK_VERSION (3, 0, 0)
+ #define GTK_DIALOG_NO_SEPARATOR 0
+#endif
+
#if !GTK_CHECK_VERSION(2, 12, 0)
void
#endif
#include "katze-http-auth.h"
+#include "gtk3-compat.h"
#include <libsoup/soup.h>
#include <gtk/gtk.h>
#include <glib/gi18n.h>
#include <glib/gstdio.h>
-#if !GTK_CHECK_VERSION (2, 14, 0)
- #define gtk_dialog_get_content_area(dialog) dialog->vbox
-#endif
-
struct _KatzeHttpAuth
{
GObject parent_instance;
dialog = gtk_dialog_new_with_buttons (_("Authentication Required"),
NULL,
-#if GTK_CHECK_VERSION(3,0,0)
- GTK_DIALOG_DESTROY_WITH_PARENT,
-#else
GTK_DIALOG_DESTROY_WITH_PARENT | GTK_DIALOG_NO_SEPARATOR,
-#endif
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GTK_STOCK_OK, GTK_RESPONSE_OK,
NULL);
title = new_bookmark ? _("New bookmark") : _("Edit bookmark");
dialog = gtk_dialog_new_with_buttons (
title, GTK_WINDOW (browser),
-#if GTK_CHECK_VERSION(3,0,0)
- GTK_DIALOG_DESTROY_WITH_PARENT,
-#else
GTK_DIALOG_DESTROY_WITH_PARENT | GTK_DIALOG_NO_SEPARATOR,
-#endif
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
new_bookmark ? GTK_STOCK_ADD : GTK_STOCK_SAVE, GTK_RESPONSE_ACCEPT,
NULL);
dialog = gtk_dialog_new_with_buttons (
_("Import bookmarks..."), GTK_WINDOW (browser),
-#if GTK_CHECK_VERSION(3,0,0)
- GTK_DIALOG_DESTROY_WITH_PARENT,
-#else
GTK_DIALOG_DESTROY_WITH_PARENT | GTK_DIALOG_NO_SEPARATOR,
-#endif
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
_("_Import bookmarks"), GTK_RESPONSE_ACCEPT,
NULL);
/* i18n: Dialog: Clear Private Data, in the Tools menu */
dialog = gtk_dialog_new_with_buttons (_("Clear Private Data"),
GTK_WINDOW (browser),
-#if GTK_CHECK_VERSION(3,0,0)
- GTK_DIALOG_DESTROY_WITH_PARENT,
-#else
GTK_DIALOG_DESTROY_WITH_PARENT | GTK_DIALOG_NO_SEPARATOR,
-#endif
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
_("_Clear private data"), GTK_RESPONSE_ACCEPT, NULL);
content_area = gtk_dialog_get_content_area (GTK_DIALOG (dialog));
dialog = gtk_dialog_new_with_buttons (
new_engine ? _("Add search engine") : _("Edit search engine"),
toplevel ? GTK_WINDOW (toplevel) : NULL,
-#if GTK_CHECK_VERSION(3,0,0)
- GTK_DIALOG_DESTROY_WITH_PARENT,
-#else
GTK_DIALOG_DESTROY_WITH_PARENT | GTK_DIALOG_NO_SEPARATOR,
-#endif
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
new_engine ? GTK_STOCK_ADD : GTK_STOCK_SAVE, GTK_RESPONSE_ACCEPT,
NULL);
gtk_widget_get_toplevel (search_action->last_proxy) : NULL;
dialog = gtk_dialog_new_with_buttons (dialog_title,
toplevel ? GTK_WINDOW (toplevel) : NULL,
-#if GTK_CHECK_VERSION(3,0,0)
- GTK_DIALOG_DESTROY_WITH_PARENT,
-#else
GTK_DIALOG_DESTROY_WITH_PARENT | GTK_DIALOG_NO_SEPARATOR,
-#endif
#if !HAVE_OSX
#if !HAVE_HILDON
GTK_STOCK_HELP, GTK_RESPONSE_HELP,