| 921 gtk_widget_set_halign(img, GTK_ALIGN_START); |
921 gtk_widget_set_halign(img, GTK_ALIGN_START); |
| 922 gtk_widget_set_valign(img, GTK_ALIGN_START); |
922 gtk_widget_set_valign(img, GTK_ALIGN_START); |
| 923 gtk_box_pack_start(GTK_BOX(hbox), img, FALSE, FALSE, 0); |
923 gtk_box_pack_start(GTK_BOX(hbox), img, FALSE, FALSE, 0); |
| 924 |
924 |
| 925 /* Cancel button */ |
925 /* Cancel button */ |
| 926 button = pidgin_dialog_add_button(GTK_DIALOG(dialog), _("Cancel"), |
926 button = gtk_dialog_add_button(GTK_DIALOG(dialog), _("Cancel"), GTK_RESPONSE_CANCEL); |
| 927 G_CALLBACK(wait_cancel_cb), data); |
927 g_signal_connect(G_OBJECT(button), "clicked", |
| |
928 G_CALLBACK(wait_cancel_cb), data); |
| 928 gtk_widget_set_can_default(button, FALSE); |
929 gtk_widget_set_can_default(button, FALSE); |
| 929 |
930 |
| 930 /* Vertical box */ |
931 /* Vertical box */ |
| 931 vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 12); |
932 vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 12); |
| 932 gtk_box_pack_start(GTK_BOX(hbox), vbox, FALSE, FALSE, 0); |
933 gtk_box_pack_start(GTK_BOX(hbox), vbox, FALSE, FALSE, 0); |
| 1923 g_signal_connect(G_OBJECT(win), "delete_event", |
1924 g_signal_connect(G_OBJECT(win), "delete_event", |
| 1924 G_CALLBACK(destroy_multifield_cb), data); |
1925 G_CALLBACK(destroy_multifield_cb), data); |
| 1925 |
1926 |
| 1926 /* Setup the main horizontal box */ |
1927 /* Setup the main horizontal box */ |
| 1927 hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 12); |
1928 hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 12); |
| 1928 gtk_container_add(GTK_CONTAINER(pidgin_dialog_get_vbox(GTK_DIALOG(win))), hbox); |
1929 gtk_container_add(GTK_CONTAINER(gtk_dialog_get_content_area(GTK_DIALOG(win))), |
| |
1930 hbox); |
| 1929 gtk_widget_show(hbox); |
1931 gtk_widget_show(hbox); |
| 1930 |
1932 |
| 1931 /* Dialog icon. */ |
1933 /* Dialog icon. */ |
| 1932 img = pidgin_request_dialog_icon(PURPLE_REQUEST_FIELDS, cpar); |
1934 img = pidgin_request_dialog_icon(PURPLE_REQUEST_FIELDS, cpar); |
| 1933 gtk_widget_set_halign(img, GTK_ALIGN_START); |
1935 gtk_widget_set_halign(img, GTK_ALIGN_START); |
| 1935 gtk_box_pack_start(GTK_BOX(hbox), img, FALSE, FALSE, 0); |
1937 gtk_box_pack_start(GTK_BOX(hbox), img, FALSE, FALSE, 0); |
| 1936 gtk_widget_show(img); |
1938 gtk_widget_show(img); |
| 1937 |
1939 |
| 1938 pidgin_request_add_help(GTK_DIALOG(win), cpar); |
1940 pidgin_request_add_help(GTK_DIALOG(win), cpar); |
| 1939 |
1941 |
| |
1942 i = 0; |
| 1940 for (GSList *it = extra_actions; it != NULL; it = it->next) { |
1943 for (GSList *it = extra_actions; it != NULL; it = it->next) { |
| 1941 PurpleKeyValuePair *extra_action = it->data; |
1944 PurpleKeyValuePair *extra_action = it->data; |
| 1942 |
1945 |
| 1943 button = pidgin_dialog_add_button(GTK_DIALOG(win), extra_action->key, |
1946 button = gtk_dialog_add_button(GTK_DIALOG(win), extra_action->key, i++); |
| |
1947 g_signal_connect(G_OBJECT(button), "clicked", |
| 1944 G_CALLBACK(multifield_extra_cb), data); |
1948 G_CALLBACK(multifield_extra_cb), data); |
| 1945 g_object_set_data(G_OBJECT(button), "extra-cb", extra_action->value); |
1949 g_object_set_data(G_OBJECT(button), "extra-cb", extra_action->value); |
| 1946 } |
1950 } |
| 1947 |
1951 |
| 1948 /* Cancel button */ |
1952 /* Cancel button */ |
| 1949 button = pidgin_dialog_add_button(GTK_DIALOG(win), cancel_text, |
1953 button = gtk_dialog_add_button(GTK_DIALOG(win), cancel_text, GTK_RESPONSE_CANCEL); |
| |
1954 g_signal_connect(G_OBJECT(button), "clicked", |
| 1950 G_CALLBACK(multifield_cancel_cb), data); |
1955 G_CALLBACK(multifield_cancel_cb), data); |
| 1951 gtk_widget_set_can_default(button, TRUE); |
1956 gtk_widget_set_can_default(button, TRUE); |
| 1952 |
1957 |
| 1953 /* OK button */ |
1958 /* OK button */ |
| 1954 if (!ok_btn) { |
1959 if (!ok_btn) { |
| 1955 gtk_window_set_default(GTK_WINDOW(win), button); |
1960 gtk_window_set_default(GTK_WINDOW(win), button); |
| 1956 } else { |
1961 } else { |
| 1957 button = pidgin_dialog_add_button(GTK_DIALOG(win), ok_text, |
1962 button = gtk_dialog_add_button(GTK_DIALOG(win), ok_text, GTK_RESPONSE_OK); |
| |
1963 g_signal_connect(G_OBJECT(button), "clicked", |
| 1958 G_CALLBACK(multifield_ok_cb), data); |
1964 G_CALLBACK(multifield_ok_cb), data); |
| 1959 data->ok_button = button; |
1965 data->ok_button = button; |
| 1960 gtk_widget_set_can_default(button, TRUE); |
1966 gtk_widget_set_can_default(button, TRUE); |
| 1961 gtk_window_set_default(GTK_WINDOW(win), button); |
1967 gtk_window_set_default(GTK_WINDOW(win), button); |
| 1962 } |
1968 } |