summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElliott Sales de Andrade <qulogic@pidgin.im>2011-10-09 03:35:22 +0000
committerElliott Sales de Andrade <qulogic@pidgin.im>2011-10-09 03:35:22 +0000
commite7aec25293fa551ce3116fd160e5c3213495c0de (patch)
tree3ad70454a1a6e039582039c06f280541117772fb
parent11444cc72daf8e517522658f74fff7595e45d1c7 (diff)
downloadpidgin-e7aec25293fa551ce3116fd160e5c3213495c0de.tar.gz
Fix calls to GTK_WIDGET_SET_FLAGS, which oddly enough does not seem to
be deprecated even though the underlying GTK_OBJECT_FLAGS is.
-rw-r--r--pidgin/gtkdialogs.c4
-rw-r--r--pidgin/gtkrequest.c23
-rw-r--r--pidgin/gtkstatusbox.c8
3 files changed, 30 insertions, 5 deletions
diff --git a/pidgin/gtkdialogs.c b/pidgin/gtkdialogs.c
index f569ec597f..6c12901fa0 100644
--- a/pidgin/gtkdialogs.c
+++ b/pidgin/gtkdialogs.c
@@ -462,7 +462,11 @@ pidgin_build_help_dialog(const char *title, const char *role, GString *string)
button = pidgin_dialog_add_button(GTK_DIALOG(win), GTK_STOCK_CLOSE,
G_CALLBACK(destroy_win), win);
+#if GTK_CHECK_VERSION(2,18,0)
+ gtk_widget_set_can_default(button, TRUE);
+#else
GTK_WIDGET_SET_FLAGS(button, GTK_CAN_DEFAULT);
+#endif
gtk_widget_grab_default(button);
gtk_widget_show_all(win);
diff --git a/pidgin/gtkrequest.c b/pidgin/gtkrequest.c
index b0f4227c83..23ed979514 100644
--- a/pidgin/gtkrequest.c
+++ b/pidgin/gtkrequest.c
@@ -39,6 +39,21 @@
#include <gdk/gdkkeysyms.h>
+#if !GTK_CHECK_VERSION(2,18,0)
+#define gtk_widget_set_can_default(x,y) do {\
+ if (y) \
+ GTK_WIDGET_SET_FLAGS(x, GTK_CAN_DEFAULT); \
+ else \
+ GTK_WIDGET_UNSET_FLAGS(x, GTK_CAN_DEFAULT); \
+} while(0)
+#define gtk_widget_set_can_focus(x,y) do {\
+ if (y) \
+ GTK_WIDGET_SET_FLAGS(x, GTK_CAN_FOCUS); \
+ else \
+ GTK_WIDGET_UNSET_FLAGS(x, GTK_CAN_FOCUS); \
+} while(0)
+#endif
+
static GtkWidget * create_account_field(PurpleRequestField *field);
typedef struct
@@ -731,8 +746,8 @@ pidgin_request_action_with_icon(const char *title, const char *primary,
if (default_action == PURPLE_DEFAULT_ACTION_NONE) {
- GTK_WIDGET_SET_FLAGS(img, GTK_CAN_DEFAULT);
- GTK_WIDGET_SET_FLAGS(img, GTK_CAN_FOCUS);
+ gtk_widget_set_can_default(img, TRUE);
+ gtk_widget_set_can_focus(img, TRUE);
gtk_widget_grab_focus(img);
gtk_widget_grab_default(img);
} else
@@ -1270,12 +1285,12 @@ pidgin_request_fields(const char *title, const char *primary,
/* Cancel button */
button = pidgin_dialog_add_button(GTK_DIALOG(win), text_to_stock(cancel_text), G_CALLBACK(multifield_cancel_cb), data);
- GTK_WIDGET_SET_FLAGS(button, GTK_CAN_DEFAULT);
+ gtk_widget_set_can_default(button, TRUE);
/* OK button */
button = pidgin_dialog_add_button(GTK_DIALOG(win), text_to_stock(ok_text), G_CALLBACK(multifield_ok_cb), data);
data->ok_button = button;
- GTK_WIDGET_SET_FLAGS(button, GTK_CAN_DEFAULT);
+ gtk_widget_set_can_default(button, TRUE);
gtk_window_set_default(GTK_WINDOW(win), button);
pidgin_widget_decorate_account(hbox, account);
diff --git a/pidgin/gtkstatusbox.c b/pidgin/gtkstatusbox.c
index f163b68c33..f1d5c422ff 100644
--- a/pidgin/gtkstatusbox.c
+++ b/pidgin/gtkstatusbox.c
@@ -72,6 +72,12 @@
#if !GTK_CHECK_VERSION(2,18,0)
#define gtk_widget_is_sensitive(x) GTK_WIDGET_IS_SENSITIVE(x)
+#define gtk_widget_set_has_window(x, y) do { \
+ if (y) \
+ GTK_WIDGET_UNSET_FLAGS(x, GTK_WIDGET_NO_WINDOW); \
+ else \
+ GTK_WIDGET_SET_FLAGS(x, GTK_WIDGET_NO_WINDOW); \
+} while (0)
#endif
static void imhtml_changed_cb(GtkTextBuffer *buffer, void *data);
@@ -1753,7 +1759,7 @@ pidgin_status_box_init (PidginStatusBox *status_box)
GtkWidget *toplevel;
GtkTreeSelection *sel;
- GTK_WIDGET_SET_FLAGS (status_box, GTK_NO_WINDOW);
+ gtk_widget_set_has_window(GTK_WIDGET(status_box), FALSE);
status_box->imhtml_visible = FALSE;
status_box->network_available = purple_network_is_available();
status_box->connecting = FALSE;