| 37 #include "pidginstock.h" |
37 #include "pidginstock.h" |
| 38 #include "gtkblist.h" |
38 #include "gtkblist.h" |
| 39 |
39 |
| 40 #include <gdk/gdkkeysyms.h> |
40 #include <gdk/gdkkeysyms.h> |
| 41 |
41 |
| |
42 #if !GTK_CHECK_VERSION(2,18,0) |
| |
43 #define gtk_widget_set_can_default(x,y) do {\ |
| |
44 if (y) \ |
| |
45 GTK_WIDGET_SET_FLAGS(x, GTK_CAN_DEFAULT); \ |
| |
46 else \ |
| |
47 GTK_WIDGET_UNSET_FLAGS(x, GTK_CAN_DEFAULT); \ |
| |
48 } while(0) |
| |
49 #define gtk_widget_set_can_focus(x,y) do {\ |
| |
50 if (y) \ |
| |
51 GTK_WIDGET_SET_FLAGS(x, GTK_CAN_FOCUS); \ |
| |
52 else \ |
| |
53 GTK_WIDGET_UNSET_FLAGS(x, GTK_CAN_FOCUS); \ |
| |
54 } while(0) |
| |
55 #endif |
| |
56 |
| 42 static GtkWidget * create_account_field(PurpleRequestField *field); |
57 static GtkWidget * create_account_field(PurpleRequestField *field); |
| 43 |
58 |
| 44 typedef struct |
59 typedef struct |
| 45 { |
60 { |
| 46 PurpleRequestType type; |
61 PurpleRequestType type; |
| 729 |
744 |
| 730 g_free(label_text); |
745 g_free(label_text); |
| 731 |
746 |
| 732 |
747 |
| 733 if (default_action == PURPLE_DEFAULT_ACTION_NONE) { |
748 if (default_action == PURPLE_DEFAULT_ACTION_NONE) { |
| 734 GTK_WIDGET_SET_FLAGS(img, GTK_CAN_DEFAULT); |
749 gtk_widget_set_can_default(img, TRUE); |
| 735 GTK_WIDGET_SET_FLAGS(img, GTK_CAN_FOCUS); |
750 gtk_widget_set_can_focus(img, TRUE); |
| 736 gtk_widget_grab_focus(img); |
751 gtk_widget_grab_focus(img); |
| 737 gtk_widget_grab_default(img); |
752 gtk_widget_grab_default(img); |
| 738 } else |
753 } else |
| 739 /* |
754 /* |
| 740 * Need to invert the default_action number because the |
755 * Need to invert the default_action number because the |
| 1268 gtk_box_pack_start(GTK_BOX(hbox), img, FALSE, FALSE, 0); |
1283 gtk_box_pack_start(GTK_BOX(hbox), img, FALSE, FALSE, 0); |
| 1269 gtk_widget_show(img); |
1284 gtk_widget_show(img); |
| 1270 |
1285 |
| 1271 /* Cancel button */ |
1286 /* Cancel button */ |
| 1272 button = pidgin_dialog_add_button(GTK_DIALOG(win), text_to_stock(cancel_text), G_CALLBACK(multifield_cancel_cb), data); |
1287 button = pidgin_dialog_add_button(GTK_DIALOG(win), text_to_stock(cancel_text), G_CALLBACK(multifield_cancel_cb), data); |
| 1273 GTK_WIDGET_SET_FLAGS(button, GTK_CAN_DEFAULT); |
1288 gtk_widget_set_can_default(button, TRUE); |
| 1274 |
1289 |
| 1275 /* OK button */ |
1290 /* OK button */ |
| 1276 button = pidgin_dialog_add_button(GTK_DIALOG(win), text_to_stock(ok_text), G_CALLBACK(multifield_ok_cb), data); |
1291 button = pidgin_dialog_add_button(GTK_DIALOG(win), text_to_stock(ok_text), G_CALLBACK(multifield_ok_cb), data); |
| 1277 data->ok_button = button; |
1292 data->ok_button = button; |
| 1278 GTK_WIDGET_SET_FLAGS(button, GTK_CAN_DEFAULT); |
1293 gtk_widget_set_can_default(button, TRUE); |
| 1279 gtk_window_set_default(GTK_WINDOW(win), button); |
1294 gtk_window_set_default(GTK_WINDOW(win), button); |
| 1280 |
1295 |
| 1281 pidgin_widget_decorate_account(hbox, account); |
1296 pidgin_widget_decorate_account(hbox, account); |
| 1282 |
1297 |
| 1283 /* Setup the vbox */ |
1298 /* Setup the vbox */ |