Mercurial > pidgin
comparison src/gtknotify.c @ 10260:a2bbfdcc325d
[gaim-migrate @ 11403]
Patch from Matthew A. Nicholson (therealman11) to add a title to the
email notification dialog.
committer: Tailor Script <tailor@pidgin.im>
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Thu, 25 Nov 2004 16:09:47 +0000 |
parents | 95ca0db2d01d |
children | ec140184437b |
comparison
equal
deleted
inserted
replaced
10259:1aa83016fbe0 | 10260:a2bbfdcc325d |
---|---|
59 } | 59 } |
60 | 60 |
61 static void | 61 static void |
62 email_response_cb(GtkDialog *dialog, gint id, GaimNotifyMailData *data) | 62 email_response_cb(GtkDialog *dialog, gint id, GaimNotifyMailData *data) |
63 { | 63 { |
64 if (id == 0) | 64 if (id == GTK_RESPONSE_YES) |
65 gaim_notify_uri(NULL, data->url); | 65 gaim_notify_uri(NULL, data->url); |
66 | 66 |
67 gaim_notify_close(GAIM_NOTIFY_EMAILS, data); | 67 gaim_notify_close(GAIM_NOTIFY_EMAILS, data); |
68 } | 68 } |
69 | 69 |
109 img = gtk_image_new_from_stock(icon_name, GTK_ICON_SIZE_DIALOG); | 109 img = gtk_image_new_from_stock(icon_name, GTK_ICON_SIZE_DIALOG); |
110 gtk_misc_set_alignment(GTK_MISC(img), 0, 0); | 110 gtk_misc_set_alignment(GTK_MISC(img), 0, 0); |
111 } | 111 } |
112 | 112 |
113 dialog = gtk_dialog_new_with_buttons(title ? title : GAIM_ALERT_TITLE, | 113 dialog = gtk_dialog_new_with_buttons(title ? title : GAIM_ALERT_TITLE, |
114 NULL, 0, GTK_STOCK_CLOSE, | 114 NULL, 0, GTK_STOCK_CLOSE, |
115 GTK_RESPONSE_ACCEPT, NULL); | 115 GTK_RESPONSE_CLOSE, NULL); |
116 | 116 |
117 gtk_window_set_role(GTK_WINDOW(dialog), "notify_dialog"); | 117 gtk_window_set_role(GTK_WINDOW(dialog), "notify_dialog"); |
118 | 118 |
119 g_signal_connect(G_OBJECT(dialog), "response", | 119 g_signal_connect(G_OBJECT(dialog), "response", |
120 G_CALLBACK(message_response_cb), dialog); | 120 G_CALLBACK(message_response_cb), dialog); |
177 | 177 |
178 data = g_new0(GaimNotifyMailData, 1); | 178 data = g_new0(GaimNotifyMailData, 1); |
179 | 179 |
180 data->url = g_strdup(urls[0]); | 180 data->url = g_strdup(urls[0]); |
181 | 181 |
182 /* Create the dialog. */ | 182 /* Create the dialog */ |
183 data->dialog = dialog = gtk_dialog_new(); | 183 dialog = gtk_dialog_new_with_buttons("New Mail", NULL, 0, |
184 | 184 GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE, |
185 gtk_dialog_add_button(GTK_DIALOG(dialog), GTK_STOCK_CLOSE, 1); | 185 NULL); |
186 data->dialog = dialog; | |
186 | 187 |
187 if (urls != NULL) | 188 if (urls != NULL) |
188 gtk_dialog_add_button(GTK_DIALOG(dialog), GAIM_STOCK_OPEN_MAIL, 0); | 189 gtk_dialog_add_button(GTK_DIALOG(dialog), |
190 GAIM_STOCK_OPEN_MAIL, GTK_RESPONSE_YES); | |
189 | 191 |
190 g_signal_connect(G_OBJECT(dialog), "response", | 192 g_signal_connect(G_OBJECT(dialog), "response", |
191 G_CALLBACK(email_response_cb), data); | 193 G_CALLBACK(email_response_cb), data); |
192 | 194 |
193 /* Setup the dialog */ | 195 /* Setup the dialog */ |
199 | 201 |
200 /* Setup the main horizontal box */ | 202 /* Setup the main horizontal box */ |
201 hbox = gtk_hbox_new(FALSE, 12); | 203 hbox = gtk_hbox_new(FALSE, 12); |
202 gtk_container_add(GTK_CONTAINER(GTK_DIALOG(dialog)->vbox), hbox); | 204 gtk_container_add(GTK_CONTAINER(GTK_DIALOG(dialog)->vbox), hbox); |
203 | 205 |
204 /* Dialog icon. */ | 206 /* Dialog icon */ |
205 img = gtk_image_new_from_stock(GAIM_STOCK_DIALOG_INFO, | 207 img = gtk_image_new_from_stock(GAIM_STOCK_DIALOG_INFO, |
206 GTK_ICON_SIZE_DIALOG); | 208 GTK_ICON_SIZE_DIALOG); |
207 gtk_misc_set_alignment(GTK_MISC(img), 0, 0); | 209 gtk_misc_set_alignment(GTK_MISC(img), 0, 0); |
208 gtk_box_pack_start(GTK_BOX(hbox), img, FALSE, FALSE, 0); | 210 gtk_box_pack_start(GTK_BOX(hbox), img, FALSE, FALSE, 0); |
209 | 211 |