Mercurial > pidgin.yaz
annotate src/gtknotify.c @ 12849:c0fbdea8828b
[gaim-migrate @ 15199]
SF Patch #1230429 from Jean-Yves Lefort
"Block instant messages in core if a prpl does not
support privacy."
I modified this to use the gaim_privacy_check() Sadrul added a while back. I
also cleaned up the loose end, rather than leaving a function that always
returned TRUE. Finally, I added the same check to the chat invite handler.
committer: Tailor Script <tailor@pidgin.im>
author | Richard Laager <rlaager@wiktel.com> |
---|---|
date | Thu, 12 Jan 2006 06:44:23 +0000 |
parents | 852df2d9d4f8 |
children | 14a103c0e4d5 |
rev | line source |
---|---|
5437 | 1 /** |
2 * @file gtknotify.c GTK+ Notification API | |
3 * @ingroup gtkui | |
4 * | |
5 * gaim | |
6 * | |
8046 | 7 * Gaim is the legal property of its developers, whose names are too numerous |
8 * to list here. Please refer to the COPYRIGHT file distributed with this | |
9 * source distribution. | |
6465
fb64cc87bc96
[gaim-migrate @ 6974]
Christian Hammond <chipx86@chipx86.com>
parents:
6381
diff
changeset
|
10 * |
5437 | 11 * This program is free software; you can redistribute it and/or modify |
12 * it under the terms of the GNU General Public License as published by | |
13 * the Free Software Foundation; either version 2 of the License, or | |
14 * (at your option) any later version. | |
15 * | |
16 * This program is distributed in the hope that it will be useful, | |
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
19 * GNU General Public License for more details. | |
20 * | |
21 * You should have received a copy of the GNU General Public License | |
22 * along with this program; if not, write to the Free Software | |
23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
24 */ | |
9791 | 25 #include "internal.h" |
26 #include "gtkgaim.h" | |
5872
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5794
diff
changeset
|
27 |
7455 | 28 #include <gdk/gdkkeysyms.h> |
29 | |
6381
e006685f75aa
[gaim-migrate @ 6886]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
30 #include "connection.h" |
8284 | 31 #include "debug.h" |
6381
e006685f75aa
[gaim-migrate @ 6886]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
32 #include "prefs.h" |
10297
ec140184437b
[gaim-migrate @ 11480]
Luke Schierer <lschiere@pidgin.im>
parents:
10260
diff
changeset
|
33 #include "gtkstock.h" |
6465
fb64cc87bc96
[gaim-migrate @ 6974]
Christian Hammond <chipx86@chipx86.com>
parents:
6381
diff
changeset
|
34 #include "util.h" |
5437 | 35 |
10439 | 36 #include "gtkblist.h" |
6381
e006685f75aa
[gaim-migrate @ 6886]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
37 #include "gtkimhtml.h" |
5872
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5794
diff
changeset
|
38 #include "gtknotify.h" |
6381
e006685f75aa
[gaim-migrate @ 6886]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
39 #include "gtkutils.h" |
5872
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5794
diff
changeset
|
40 |
5519
42a20beb80a7
[gaim-migrate @ 5919]
Christian Hammond <chipx86@chipx86.com>
parents:
5476
diff
changeset
|
41 typedef struct |
42a20beb80a7
[gaim-migrate @ 5919]
Christian Hammond <chipx86@chipx86.com>
parents:
5476
diff
changeset
|
42 { |
5563
9eb5b13fd412
[gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents:
5543
diff
changeset
|
43 GaimConnection *gc; |
5519
42a20beb80a7
[gaim-migrate @ 5919]
Christian Hammond <chipx86@chipx86.com>
parents:
5476
diff
changeset
|
44 char *url; |
42a20beb80a7
[gaim-migrate @ 5919]
Christian Hammond <chipx86@chipx86.com>
parents:
5476
diff
changeset
|
45 GtkWidget *label; |
12647
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
46 GtkTreeIter iter; |
5519
42a20beb80a7
[gaim-migrate @ 5919]
Christian Hammond <chipx86@chipx86.com>
parents:
5476
diff
changeset
|
47 } GaimNotifyMailData; |
42a20beb80a7
[gaim-migrate @ 5919]
Christian Hammond <chipx86@chipx86.com>
parents:
5476
diff
changeset
|
48 |
10439 | 49 typedef struct |
50 { | |
51 GaimAccount *account; | |
52 GtkListStore *model; | |
53 GtkWidget *treeview; | |
54 GtkWidget *window; | |
55 } GaimNotifySearchResultsData; | |
56 | |
11359 | 57 typedef struct |
10439 | 58 { |
11359 | 59 GaimNotifySearchButton *button; |
60 GaimNotifySearchResultsData *data; | |
61 | |
62 } GaimNotifySearchResultsButtonData; | |
10439 | 63 |
12647
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
64 enum |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
65 { |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
66 GAIM_MAIL_ICON, |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
67 GAIM_MAIL_TO, |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
68 GAIM_MAIL_FROM, |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
69 GAIM_MAIL_SUBJECT, |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
70 GAIM_MAIL_DATA, |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
71 COLUMNS_GAIM_MAIL |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
72 }; |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
73 |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
74 typedef struct _GaimMailDialog GaimMailDialog; |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
75 |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
76 struct _GaimMailDialog |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
77 { |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
78 GtkWidget *dialog; |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
79 GtkWidget *treeview; |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
80 GtkTreeStore *treemodel; |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
81 GtkLabel *label; |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
82 }; |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
83 |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
84 static GaimMailDialog *mail_dialog = NULL; |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
85 |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
86 static void *gaim_gtk_notify_emails(GaimConnection *gc, size_t count, gboolean detailed, |
5519
42a20beb80a7
[gaim-migrate @ 5919]
Christian Hammond <chipx86@chipx86.com>
parents:
5476
diff
changeset
|
87 const char **subjects, |
5476
9bcd8cd625ae
[gaim-migrate @ 5872]
Christian Hammond <chipx86@chipx86.com>
parents:
5437
diff
changeset
|
88 const char **froms, const char **tos, |
12242
976677e67239
[gaim-migrate @ 14544]
Richard Laager <rlaager@wiktel.com>
parents:
12227
diff
changeset
|
89 const char **urls); |
5476
9bcd8cd625ae
[gaim-migrate @ 5872]
Christian Hammond <chipx86@chipx86.com>
parents:
5437
diff
changeset
|
90 |
5519
42a20beb80a7
[gaim-migrate @ 5919]
Christian Hammond <chipx86@chipx86.com>
parents:
5476
diff
changeset
|
91 static void |
6354
76af8c066f8c
[gaim-migrate @ 6853]
Christian Hammond <chipx86@chipx86.com>
parents:
6106
diff
changeset
|
92 message_response_cb(GtkDialog *dialog, gint id, GtkWidget *widget) |
6104 | 93 { |
6357 | 94 gaim_notify_close(GAIM_NOTIFY_MESSAGE, widget); |
6104 | 95 } |
96 | |
97 static void | |
12647
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
98 email_nondetailed_cb(GtkDialog *dialog, gint id, GaimNotifyMailData *data) |
5519
42a20beb80a7
[gaim-migrate @ 5919]
Christian Hammond <chipx86@chipx86.com>
parents:
5476
diff
changeset
|
99 { |
12647
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
100 if (id == GTK_RESPONSE_OK) |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
101 gaim_notify_uri(NULL, data->url); |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
102 gaim_notify_close(GAIM_NOTIFY_EMAILS, data); |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
103 gtk_widget_destroy(GTK_WIDGET(dialog)); |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
104 } |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
105 |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
106 static void |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
107 email_response_cb(GtkDialog *dlg, gint id, GaimMailDialog *dialog) |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
108 { |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
109 GaimNotifyMailData *data = NULL; |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
110 GtkTreeIter iter; |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
111 |
10260 | 112 if (id == GTK_RESPONSE_YES) |
12647
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
113 { |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
114 GtkTreeSelection *selection; |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
115 |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
116 selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(dialog->treeview)); |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
117 |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
118 if (gtk_tree_selection_get_selected(selection, NULL, &iter)) |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
119 { |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
120 gtk_tree_model_get(GTK_TREE_MODEL(dialog->treemodel), &iter, |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
121 GAIM_MAIL_DATA, &data, -1); |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
122 gaim_notify_uri(NULL, data->url); |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
123 |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
124 gtk_tree_store_remove(dialog->treemodel, &iter); |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
125 gaim_notify_close(GAIM_NOTIFY_EMAILS, data); |
5519
42a20beb80a7
[gaim-migrate @ 5919]
Christian Hammond <chipx86@chipx86.com>
parents:
5476
diff
changeset
|
126 |
12647
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
127 if (gtk_tree_model_get_iter_first(GTK_TREE_MODEL(mail_dialog->treemodel), &iter)) |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
128 return; |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
129 } |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
130 else |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
131 return; |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
132 } |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
133 else |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
134 { |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
135 while (gtk_tree_model_get_iter_first(GTK_TREE_MODEL(mail_dialog->treemodel), &iter)) |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
136 { |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
137 gtk_tree_model_get(GTK_TREE_MODEL(dialog->treemodel), &iter, |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
138 GAIM_MAIL_DATA, &data, -1); |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
139 |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
140 if (id == GTK_RESPONSE_ACCEPT) |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
141 gaim_notify_uri(NULL, data->url); |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
142 |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
143 gtk_tree_store_remove(dialog->treemodel, &iter); |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
144 gaim_notify_close(GAIM_NOTIFY_EMAILS, data); |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
145 } |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
146 } |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
147 gtk_widget_destroy(dialog->dialog); |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
148 g_free(dialog); |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
149 mail_dialog = NULL; |
5519
42a20beb80a7
[gaim-migrate @ 5919]
Christian Hammond <chipx86@chipx86.com>
parents:
5476
diff
changeset
|
150 } |
42a20beb80a7
[gaim-migrate @ 5919]
Christian Hammond <chipx86@chipx86.com>
parents:
5476
diff
changeset
|
151 |
7007
da1430478acf
[gaim-migrate @ 7564]
Christian Hammond <chipx86@chipx86.com>
parents:
6982
diff
changeset
|
152 static void |
da1430478acf
[gaim-migrate @ 7564]
Christian Hammond <chipx86@chipx86.com>
parents:
6982
diff
changeset
|
153 formatted_close_cb(GtkWidget *win, GdkEvent *event, void *user_data) |
da1430478acf
[gaim-migrate @ 7564]
Christian Hammond <chipx86@chipx86.com>
parents:
6982
diff
changeset
|
154 { |
da1430478acf
[gaim-migrate @ 7564]
Christian Hammond <chipx86@chipx86.com>
parents:
6982
diff
changeset
|
155 gaim_notify_close(GAIM_NOTIFY_FORMATTED, win); |
da1430478acf
[gaim-migrate @ 7564]
Christian Hammond <chipx86@chipx86.com>
parents:
6982
diff
changeset
|
156 } |
da1430478acf
[gaim-migrate @ 7564]
Christian Hammond <chipx86@chipx86.com>
parents:
6982
diff
changeset
|
157 |
10439 | 158 static void |
159 searchresults_close_cb(GaimNotifySearchResultsData *data, GdkEvent *event, void *user_data) | |
160 { | |
161 gaim_notify_close(GAIM_NOTIFY_SEARCHRESULTS, data); | |
162 } | |
163 | |
164 static void | |
11359 | 165 searchresults_callback_wrapper_cb(GtkWidget *widget, GaimNotifySearchResultsButtonData *bd) |
10439 | 166 { |
11359 | 167 GaimNotifySearchResultsData *data = bd->data; |
168 | |
10439 | 169 GtkTreeSelection *selection; |
170 GtkTreeModel *model; | |
171 GtkTreeIter iter; | |
11359 | 172 GaimNotifySearchButton *button; |
173 GList *row = NULL; | |
174 gchar *str; | |
175 int i; | |
10439 | 176 |
177 g_return_if_fail(data != NULL); | |
178 | |
179 selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(data->treeview)); | |
180 | |
181 if (gtk_tree_selection_get_selected(selection, &model, &iter)) | |
182 { | |
11359 | 183 for (i = 1; i < gtk_tree_model_get_n_columns(GTK_TREE_MODEL(model)); i++) { |
184 gtk_tree_model_get(GTK_TREE_MODEL(model), &iter, i, &str, -1); | |
185 row = g_list_append(row, str); | |
186 } | |
10439 | 187 } |
11359 | 188 |
189 button = bd->button; | |
190 button->callback(gaim_account_get_connection(data->account), row); | |
10439 | 191 } |
192 | |
5437 | 193 static void * |
194 gaim_gtk_notify_message(GaimNotifyMsgType type, const char *title, | |
12242
976677e67239
[gaim-migrate @ 14544]
Richard Laager <rlaager@wiktel.com>
parents:
12227
diff
changeset
|
195 const char *primary, const char *secondary) |
5437 | 196 { |
197 GtkWidget *dialog; | |
198 GtkWidget *hbox; | |
199 GtkWidget *label; | |
200 GtkWidget *img = NULL; | |
201 char label_text[2048]; | |
202 const char *icon_name = NULL; | |
10774 | 203 char *primary_esc, *secondary_esc; |
5437 | 204 |
8338
354bba6ad254
[gaim-migrate @ 9062]
Christian Hammond <chipx86@chipx86.com>
parents:
8337
diff
changeset
|
205 switch (type) |
354bba6ad254
[gaim-migrate @ 9062]
Christian Hammond <chipx86@chipx86.com>
parents:
8337
diff
changeset
|
206 { |
5437 | 207 case GAIM_NOTIFY_MSG_ERROR: |
208 icon_name = GAIM_STOCK_DIALOG_ERROR; | |
209 break; | |
210 | |
211 case GAIM_NOTIFY_MSG_WARNING: | |
212 icon_name = GAIM_STOCK_DIALOG_WARNING; | |
213 break; | |
214 | |
215 case GAIM_NOTIFY_MSG_INFO: | |
216 icon_name = GAIM_STOCK_DIALOG_INFO; | |
217 break; | |
218 | |
219 default: | |
220 icon_name = NULL; | |
221 break; | |
222 } | |
223 | |
8338
354bba6ad254
[gaim-migrate @ 9062]
Christian Hammond <chipx86@chipx86.com>
parents:
8337
diff
changeset
|
224 if (icon_name != NULL) |
354bba6ad254
[gaim-migrate @ 9062]
Christian Hammond <chipx86@chipx86.com>
parents:
8337
diff
changeset
|
225 { |
5437 | 226 img = gtk_image_new_from_stock(icon_name, GTK_ICON_SIZE_DIALOG); |
227 gtk_misc_set_alignment(GTK_MISC(img), 0, 0); | |
228 } | |
229 | |
7678 | 230 dialog = gtk_dialog_new_with_buttons(title ? title : GAIM_ALERT_TITLE, |
10260 | 231 NULL, 0, GTK_STOCK_CLOSE, |
232 GTK_RESPONSE_CLOSE, NULL); | |
8338
354bba6ad254
[gaim-migrate @ 9062]
Christian Hammond <chipx86@chipx86.com>
parents:
8337
diff
changeset
|
233 |
8523
013d256e8ded
[gaim-migrate @ 9262]
Christian Hammond <chipx86@chipx86.com>
parents:
8356
diff
changeset
|
234 gtk_window_set_role(GTK_WINDOW(dialog), "notify_dialog"); |
013d256e8ded
[gaim-migrate @ 9262]
Christian Hammond <chipx86@chipx86.com>
parents:
8356
diff
changeset
|
235 |
5437 | 236 g_signal_connect(G_OBJECT(dialog), "response", |
6104 | 237 G_CALLBACK(message_response_cb), dialog); |
5437 | 238 |
11243 | 239 gtk_container_set_border_width(GTK_CONTAINER(dialog), GAIM_HIG_BORDER); |
5437 | 240 gtk_window_set_resizable(GTK_WINDOW(dialog), FALSE); |
241 gtk_dialog_set_has_separator(GTK_DIALOG(dialog), FALSE); | |
11243 | 242 gtk_box_set_spacing(GTK_BOX(GTK_DIALOG(dialog)->vbox), GAIM_HIG_BORDER); |
243 gtk_container_set_border_width(GTK_CONTAINER(GTK_DIALOG(dialog)->vbox), GAIM_HIG_BOX_SPACE); | |
5437 | 244 |
11243 | 245 hbox = gtk_hbox_new(FALSE, GAIM_HIG_BORDER); |
5437 | 246 gtk_container_add(GTK_CONTAINER(GTK_DIALOG(dialog)->vbox), hbox); |
247 | |
248 if (img != NULL) | |
249 gtk_box_pack_start(GTK_BOX(hbox), img, FALSE, FALSE, 0); | |
250 | |
10774 | 251 primary_esc = g_markup_escape_text(primary, -1); |
252 secondary_esc = (secondary != NULL) ? g_markup_escape_text(secondary, -1) : NULL; | |
5437 | 253 g_snprintf(label_text, sizeof(label_text), |
254 "<span weight=\"bold\" size=\"larger\">%s</span>\n\n%s", | |
10774 | 255 primary_esc, (secondary ? secondary_esc : "")); |
256 g_free(primary_esc); | |
257 g_free(secondary_esc); | |
5437 | 258 |
259 label = gtk_label_new(NULL); | |
260 | |
261 gtk_label_set_markup(GTK_LABEL(label), label_text); | |
262 gtk_label_set_line_wrap(GTK_LABEL(label), TRUE); | |
263 gtk_misc_set_alignment(GTK_MISC(label), 0, 0); | |
264 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); | |
265 | |
266 gtk_widget_show_all(dialog); | |
267 | |
268 return dialog; | |
269 } | |
270 | |
271 static void * | |
12647
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
272 gaim_gtk_notify_email(GaimConnection *gc, const char *subject, const char *from, |
12242
976677e67239
[gaim-migrate @ 14544]
Richard Laager <rlaager@wiktel.com>
parents:
12227
diff
changeset
|
273 const char *to, const char *url) |
5437 | 274 { |
12647
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
275 return gaim_gtk_notify_emails(gc, 1, (subject != NULL), |
5524
101384b068c1
[gaim-migrate @ 5924]
Christian Hammond <chipx86@chipx86.com>
parents:
5519
diff
changeset
|
276 (subject == NULL ? NULL : &subject), |
101384b068c1
[gaim-migrate @ 5924]
Christian Hammond <chipx86@chipx86.com>
parents:
5519
diff
changeset
|
277 (from == NULL ? NULL : &from), |
101384b068c1
[gaim-migrate @ 5924]
Christian Hammond <chipx86@chipx86.com>
parents:
5519
diff
changeset
|
278 (to == NULL ? NULL : &to), |
12242
976677e67239
[gaim-migrate @ 14544]
Richard Laager <rlaager@wiktel.com>
parents:
12227
diff
changeset
|
279 (url == NULL ? NULL : &url)); |
5437 | 280 } |
281 | |
282 static void * | |
12647
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
283 gaim_gtk_notify_emails(GaimConnection *gc, size_t count, gboolean detailed, |
5519
42a20beb80a7
[gaim-migrate @ 5919]
Christian Hammond <chipx86@chipx86.com>
parents:
5476
diff
changeset
|
284 const char **subjects, const char **froms, |
12242
976677e67239
[gaim-migrate @ 14544]
Richard Laager <rlaager@wiktel.com>
parents:
12227
diff
changeset
|
285 const char **tos, const char **urls) |
5437 | 286 { |
12647
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
287 GaimNotifyMailData *data = NULL; |
5519
42a20beb80a7
[gaim-migrate @ 5919]
Christian Hammond <chipx86@chipx86.com>
parents:
5476
diff
changeset
|
288 GtkWidget *dialog; |
42a20beb80a7
[gaim-migrate @ 5919]
Christian Hammond <chipx86@chipx86.com>
parents:
5476
diff
changeset
|
289 GtkWidget *vbox; |
42a20beb80a7
[gaim-migrate @ 5919]
Christian Hammond <chipx86@chipx86.com>
parents:
5476
diff
changeset
|
290 GtkWidget *hbox; |
42a20beb80a7
[gaim-migrate @ 5919]
Christian Hammond <chipx86@chipx86.com>
parents:
5476
diff
changeset
|
291 GtkWidget *label; |
42a20beb80a7
[gaim-migrate @ 5919]
Christian Hammond <chipx86@chipx86.com>
parents:
5476
diff
changeset
|
292 GtkWidget *img; |
42a20beb80a7
[gaim-migrate @ 5919]
Christian Hammond <chipx86@chipx86.com>
parents:
5476
diff
changeset
|
293 char *detail_text; |
42a20beb80a7
[gaim-migrate @ 5919]
Christian Hammond <chipx86@chipx86.com>
parents:
5476
diff
changeset
|
294 char *label_text; |
12647
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
295 GtkTreeIter iter; |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
296 GaimAccount *account; |
5519
42a20beb80a7
[gaim-migrate @ 5919]
Christian Hammond <chipx86@chipx86.com>
parents:
5476
diff
changeset
|
297 |
12647
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
298 account = gaim_connection_get_account(gc); |
5524
101384b068c1
[gaim-migrate @ 5924]
Christian Hammond <chipx86@chipx86.com>
parents:
5519
diff
changeset
|
299 |
12647
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
300 if (mail_dialog == NULL || !detailed) |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
301 { |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
302 GtkCellRenderer *rend; |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
303 GtkTreeViewColumn *column; |
5519
42a20beb80a7
[gaim-migrate @ 5919]
Christian Hammond <chipx86@chipx86.com>
parents:
5476
diff
changeset
|
304 |
12647
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
305 dialog = gtk_dialog_new_with_buttons(_("New Mail"), NULL, 0, |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
306 GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE, |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
307 NULL); |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
308 if (detailed) |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
309 gtk_window_set_role(GTK_WINDOW(dialog), "new_mail_detailed"); |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
310 else |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
311 gtk_window_set_role(GTK_WINDOW(dialog), "new_mail"); |
5519
42a20beb80a7
[gaim-migrate @ 5919]
Christian Hammond <chipx86@chipx86.com>
parents:
5476
diff
changeset
|
312 |
12647
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
313 if (!detailed && urls) |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
314 { |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
315 gtk_dialog_add_button(GTK_DIALOG(dialog), |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
316 GAIM_STOCK_OPEN_MAIL, GTK_RESPONSE_OK); |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
317 } |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
318 else if (detailed && mail_dialog == NULL) |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
319 { |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
320 gtk_dialog_add_button(GTK_DIALOG(dialog), |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
321 _("Open All Messages"), GTK_RESPONSE_ACCEPT); |
5519
42a20beb80a7
[gaim-migrate @ 5919]
Christian Hammond <chipx86@chipx86.com>
parents:
5476
diff
changeset
|
322 |
12647
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
323 gtk_dialog_add_button(GTK_DIALOG(dialog), |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
324 GAIM_STOCK_OPEN_MAIL, GTK_RESPONSE_YES); |
5519
42a20beb80a7
[gaim-migrate @ 5919]
Christian Hammond <chipx86@chipx86.com>
parents:
5476
diff
changeset
|
325 } |
42a20beb80a7
[gaim-migrate @ 5919]
Christian Hammond <chipx86@chipx86.com>
parents:
5476
diff
changeset
|
326 |
12647
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
327 /* Setup the dialog */ |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
328 gtk_container_set_border_width(GTK_CONTAINER(dialog), GAIM_HIG_BOX_SPACE); |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
329 gtk_container_set_border_width(GTK_CONTAINER(GTK_DIALOG(dialog)->vbox), GAIM_HIG_BOX_SPACE); |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
330 gtk_dialog_set_has_separator(GTK_DIALOG(dialog), FALSE); |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
331 gtk_box_set_spacing(GTK_BOX(GTK_DIALOG(dialog)->vbox), GAIM_HIG_BORDER); |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
332 |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
333 /* Setup the main horizontal box */ |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
334 hbox = gtk_hbox_new(FALSE, GAIM_HIG_BORDER); |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
335 gtk_container_add(GTK_CONTAINER(GTK_DIALOG(dialog)->vbox), hbox); |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
336 |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
337 /* Dialog icon */ |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
338 img = gtk_image_new_from_stock(GAIM_STOCK_DIALOG_INFO, |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
339 GTK_ICON_SIZE_DIALOG); |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
340 gtk_misc_set_alignment(GTK_MISC(img), 0, 0); |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
341 gtk_box_pack_start(GTK_BOX(hbox), img, FALSE, FALSE, 0); |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
342 |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
343 /* Vertical box */ |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
344 vbox = gtk_vbox_new(FALSE, GAIM_HIG_BORDER); |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
345 |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
346 gtk_box_pack_start(GTK_BOX(hbox), vbox, TRUE, TRUE, 0); |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
347 |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
348 if (mail_dialog == NULL && detailed) |
8338
354bba6ad254
[gaim-migrate @ 9062]
Christian Hammond <chipx86@chipx86.com>
parents:
8337
diff
changeset
|
349 { |
12647
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
350 GtkWidget *sw; |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
351 |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
352 /* Golden ratio it up! */ |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
353 gtk_widget_set_size_request(dialog, 475, 200); |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
354 |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
355 sw = gtk_scrolled_window_new(NULL, NULL); |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
356 gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW(sw), GTK_SHADOW_IN); |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
357 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS); |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
358 |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
359 mail_dialog = g_new0(GaimMailDialog, 1); |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
360 mail_dialog->dialog = dialog; |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
361 |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
362 mail_dialog->treemodel = gtk_tree_store_new(COLUMNS_GAIM_MAIL, |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
363 GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_POINTER); |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
364 mail_dialog->treeview = gtk_tree_view_new_with_model(GTK_TREE_MODEL(mail_dialog->treemodel)); |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
365 |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
366 g_signal_connect(G_OBJECT(dialog), "response", |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
367 G_CALLBACK(email_response_cb), mail_dialog); |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
368 |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
369 column = gtk_tree_view_column_new(); |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
370 gtk_tree_view_column_set_resizable(column, TRUE); |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
371 gtk_tree_view_column_set_title(column, _("Account")); |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
372 rend = gtk_cell_renderer_pixbuf_new(); |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
373 gtk_tree_view_column_pack_start(column, rend, FALSE); |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
374 gtk_tree_view_column_set_attributes(column, rend, "pixbuf", GAIM_MAIL_ICON, NULL); |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
375 rend = gtk_cell_renderer_text_new(); |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
376 gtk_tree_view_column_pack_start(column, rend, TRUE); |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
377 gtk_tree_view_column_set_attributes(column, rend, "markup", GAIM_MAIL_TO, NULL); |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
378 gtk_tree_view_append_column(GTK_TREE_VIEW(mail_dialog->treeview), column); |
5519
42a20beb80a7
[gaim-migrate @ 5919]
Christian Hammond <chipx86@chipx86.com>
parents:
5476
diff
changeset
|
379 |
12647
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
380 column = gtk_tree_view_column_new(); |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
381 gtk_tree_view_column_set_resizable(column, TRUE); |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
382 gtk_tree_view_column_set_title(column, _("From")); |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
383 rend = gtk_cell_renderer_text_new(); |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
384 gtk_tree_view_column_pack_start(column, rend, TRUE); |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
385 gtk_tree_view_column_set_attributes(column, rend, "markup", GAIM_MAIL_FROM, NULL); |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
386 gtk_tree_view_append_column(GTK_TREE_VIEW(mail_dialog->treeview), column); |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
387 |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
388 column = gtk_tree_view_column_new(); |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
389 gtk_tree_view_column_set_resizable(column, TRUE); |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
390 gtk_tree_view_column_set_title(column, _("Subject")); |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
391 rend = gtk_cell_renderer_text_new(); |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
392 gtk_tree_view_column_pack_start(column, rend, TRUE); |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
393 gtk_tree_view_column_set_attributes(column, rend, "markup", GAIM_MAIL_SUBJECT, NULL); |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
394 gtk_tree_view_append_column(GTK_TREE_VIEW(mail_dialog->treeview), column); |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
395 |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
396 gtk_container_add(GTK_CONTAINER(sw), mail_dialog->treeview); |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
397 |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
398 label = gtk_label_new(NULL); |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
399 gtk_label_set_markup(GTK_LABEL(label), _("<span weight=\"bold\" size=\"larger\">You have mail!</span>")); |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
400 gtk_label_set_line_wrap(GTK_LABEL(label), TRUE); |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
401 gtk_misc_set_alignment(GTK_MISC(label), 0, 0); |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
402 gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0); |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
403 gtk_box_pack_start(GTK_BOX(vbox), sw, TRUE, TRUE, 0); |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
404 } |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
405 } |
5519
42a20beb80a7
[gaim-migrate @ 5919]
Christian Hammond <chipx86@chipx86.com>
parents:
5476
diff
changeset
|
406 |
12647
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
407 if (detailed) |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
408 { |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
409 dialog = mail_dialog->dialog; |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
410 while (count--) |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
411 { |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
412 char *from_text = NULL, *subject_text = NULL; |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
413 GdkPixbuf *pixbuf, *scale = NULL; |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
414 |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
415 if (froms != NULL) |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
416 from_text = g_markup_escape_text(*froms, -1); |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
417 |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
418 if (subjects != NULL) |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
419 subject_text = g_markup_escape_text(*subjects, -1); |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
420 |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
421 data = g_new0(GaimNotifyMailData, 1); |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
422 data->url = g_strdup(*urls); |
5519
42a20beb80a7
[gaim-migrate @ 5919]
Christian Hammond <chipx86@chipx86.com>
parents:
5476
diff
changeset
|
423 |
12647
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
424 pixbuf = gaim_gtk_create_prpl_icon(account); |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
425 if (pixbuf != NULL) |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
426 { |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
427 scale = gdk_pixbuf_scale_simple(pixbuf, 16, 16, |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
428 GDK_INTERP_BILINEAR); |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
429 g_object_unref(pixbuf); |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
430 } |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
431 |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
432 gtk_tree_store_append(mail_dialog->treemodel, &iter, NULL); |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
433 gtk_tree_store_set(mail_dialog->treemodel, &iter, |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
434 GAIM_MAIL_ICON, scale, |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
435 GAIM_MAIL_TO, *tos, |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
436 GAIM_MAIL_FROM, from_text, |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
437 GAIM_MAIL_SUBJECT, subject_text, |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
438 GAIM_MAIL_DATA, data, |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
439 -1); |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
440 data->iter = iter; |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
441 urls++; |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
442 froms++; |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
443 subjects++; |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
444 tos++; |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
445 } |
5519
42a20beb80a7
[gaim-migrate @ 5919]
Christian Hammond <chipx86@chipx86.com>
parents:
5476
diff
changeset
|
446 } |
8338
354bba6ad254
[gaim-migrate @ 9062]
Christian Hammond <chipx86@chipx86.com>
parents:
8337
diff
changeset
|
447 else |
354bba6ad254
[gaim-migrate @ 9062]
Christian Hammond <chipx86@chipx86.com>
parents:
8337
diff
changeset
|
448 { |
12647
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
449 data = g_new0(GaimNotifyMailData, 1); |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
450 data->url = g_strdup(*urls); |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
451 |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
452 g_signal_connect(G_OBJECT(dialog), "response", |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
453 G_CALLBACK(email_nondetailed_cb), data); |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
454 |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
455 detail_text = g_strdup_printf(ngettext("%s has %d new message.", |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
456 "%s has %d new messages.", |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
457 (int)count), |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
458 *tos, (int)count); |
5519
42a20beb80a7
[gaim-migrate @ 5919]
Christian Hammond <chipx86@chipx86.com>
parents:
5476
diff
changeset
|
459 label_text = g_strdup_printf( |
5543 | 460 _("<span weight=\"bold\" size=\"larger\">You have mail!</span>" |
461 "\n\n%s"), detail_text); | |
5519
42a20beb80a7
[gaim-migrate @ 5919]
Christian Hammond <chipx86@chipx86.com>
parents:
5476
diff
changeset
|
462 |
12647
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
463 label = gtk_label_new(NULL); |
5519
42a20beb80a7
[gaim-migrate @ 5919]
Christian Hammond <chipx86@chipx86.com>
parents:
5476
diff
changeset
|
464 |
12647
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
465 gtk_label_set_markup(GTK_LABEL(label), label_text); |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
466 gtk_label_set_line_wrap(GTK_LABEL(label), TRUE); |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
467 gtk_misc_set_alignment(GTK_MISC(label), 0, 0); |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
468 gtk_box_pack_start(GTK_BOX(vbox), label, TRUE, TRUE, 0); |
5519
42a20beb80a7
[gaim-migrate @ 5919]
Christian Hammond <chipx86@chipx86.com>
parents:
5476
diff
changeset
|
469 |
12647
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
470 g_free(label_text); |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
471 g_free(detail_text); |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
472 gtk_window_set_resizable(GTK_WINDOW(dialog), FALSE); |
852df2d9d4f8
[gaim-migrate @ 14985]
Richard Laager <rlaager@wiktel.com>
parents:
12624
diff
changeset
|
473 } |
5519
42a20beb80a7
[gaim-migrate @ 5919]
Christian Hammond <chipx86@chipx86.com>
parents:
5476
diff
changeset
|
474 gtk_widget_show_all(dialog); |
42a20beb80a7
[gaim-migrate @ 5919]
Christian Hammond <chipx86@chipx86.com>
parents:
5476
diff
changeset
|
475 |
42a20beb80a7
[gaim-migrate @ 5919]
Christian Hammond <chipx86@chipx86.com>
parents:
5476
diff
changeset
|
476 return data; |
5437 | 477 } |
478 | |
8337
65ae6930b45a
[gaim-migrate @ 9061]
Christian Hammond <chipx86@chipx86.com>
parents:
8284
diff
changeset
|
479 static gboolean |
10875
a118e50116df
[gaim-migrate @ 12566]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
10774
diff
changeset
|
480 formatted_input_cb(GtkWidget *win, GdkEventKey *event, gpointer data) |
7455 | 481 { |
8337
65ae6930b45a
[gaim-migrate @ 9061]
Christian Hammond <chipx86@chipx86.com>
parents:
8284
diff
changeset
|
482 if (event->keyval == GDK_Escape) |
65ae6930b45a
[gaim-migrate @ 9061]
Christian Hammond <chipx86@chipx86.com>
parents:
8284
diff
changeset
|
483 { |
10875
a118e50116df
[gaim-migrate @ 12566]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
10774
diff
changeset
|
484 gaim_notify_close(GAIM_NOTIFY_FORMATTED, win); |
8337
65ae6930b45a
[gaim-migrate @ 9061]
Christian Hammond <chipx86@chipx86.com>
parents:
8284
diff
changeset
|
485 |
7455 | 486 return TRUE; |
487 } | |
8337
65ae6930b45a
[gaim-migrate @ 9061]
Christian Hammond <chipx86@chipx86.com>
parents:
8284
diff
changeset
|
488 |
7455 | 489 return FALSE; |
490 } | |
491 | |
6381
e006685f75aa
[gaim-migrate @ 6886]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
492 static void * |
e006685f75aa
[gaim-migrate @ 6886]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
493 gaim_gtk_notify_formatted(const char *title, const char *primary, |
12242
976677e67239
[gaim-migrate @ 14544]
Richard Laager <rlaager@wiktel.com>
parents:
12227
diff
changeset
|
494 const char *secondary, const char *text) |
6381
e006685f75aa
[gaim-migrate @ 6886]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
495 { |
e006685f75aa
[gaim-migrate @ 6886]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
496 GtkWidget *window; |
e006685f75aa
[gaim-migrate @ 6886]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
497 GtkWidget *vbox; |
e006685f75aa
[gaim-migrate @ 6886]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
498 GtkWidget *label; |
e006685f75aa
[gaim-migrate @ 6886]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
499 GtkWidget *button; |
e006685f75aa
[gaim-migrate @ 6886]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
500 GtkWidget *imhtml; |
10181 | 501 GtkWidget *frame; |
6381
e006685f75aa
[gaim-migrate @ 6886]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
502 int options = 0; |
e006685f75aa
[gaim-migrate @ 6886]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
503 char label_text[2048]; |
10774 | 504 char *linked_text, *primary_esc, *secondary_esc; |
6381
e006685f75aa
[gaim-migrate @ 6886]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
505 |
e006685f75aa
[gaim-migrate @ 6886]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
506 window = gtk_window_new(GTK_WINDOW_TOPLEVEL); |
8345 | 507 gtk_window_set_title(GTK_WINDOW(window), title); |
6381
e006685f75aa
[gaim-migrate @ 6886]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
508 gtk_window_set_type_hint(GTK_WINDOW(window), GDK_WINDOW_TYPE_HINT_DIALOG); |
11243 | 509 gtk_container_set_border_width(GTK_CONTAINER(window), GAIM_HIG_BORDER); |
6381
e006685f75aa
[gaim-migrate @ 6886]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
510 |
7007
da1430478acf
[gaim-migrate @ 7564]
Christian Hammond <chipx86@chipx86.com>
parents:
6982
diff
changeset
|
511 g_signal_connect(G_OBJECT(window), "delete_event", |
da1430478acf
[gaim-migrate @ 7564]
Christian Hammond <chipx86@chipx86.com>
parents:
6982
diff
changeset
|
512 G_CALLBACK(formatted_close_cb), NULL); |
da1430478acf
[gaim-migrate @ 7564]
Christian Hammond <chipx86@chipx86.com>
parents:
6982
diff
changeset
|
513 |
6381
e006685f75aa
[gaim-migrate @ 6886]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
514 /* Setup the main vbox */ |
11243 | 515 vbox = gtk_vbox_new(FALSE, GAIM_HIG_BORDER); |
6381
e006685f75aa
[gaim-migrate @ 6886]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
516 gtk_container_add(GTK_CONTAINER(window), vbox); |
e006685f75aa
[gaim-migrate @ 6886]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
517 gtk_widget_show(vbox); |
e006685f75aa
[gaim-migrate @ 6886]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
518 |
e006685f75aa
[gaim-migrate @ 6886]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
519 /* Setup the descriptive label */ |
10774 | 520 primary_esc = g_markup_escape_text(primary, -1); |
521 secondary_esc = (secondary != NULL) ? g_markup_escape_text(secondary, -1) : NULL; | |
6381
e006685f75aa
[gaim-migrate @ 6886]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
522 g_snprintf(label_text, sizeof(label_text), |
8338
354bba6ad254
[gaim-migrate @ 9062]
Christian Hammond <chipx86@chipx86.com>
parents:
8337
diff
changeset
|
523 "<span weight=\"bold\" size=\"larger\">%s</span>%s%s", |
10774 | 524 primary_esc, |
8338
354bba6ad254
[gaim-migrate @ 9062]
Christian Hammond <chipx86@chipx86.com>
parents:
8337
diff
changeset
|
525 (secondary ? "\n" : ""), |
10774 | 526 (secondary ? secondary_esc : "")); |
527 g_free(primary_esc); | |
528 g_free(secondary_esc); | |
6381
e006685f75aa
[gaim-migrate @ 6886]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
529 |
e006685f75aa
[gaim-migrate @ 6886]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
530 label = gtk_label_new(NULL); |
e006685f75aa
[gaim-migrate @ 6886]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
531 |
e006685f75aa
[gaim-migrate @ 6886]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
532 gtk_label_set_markup(GTK_LABEL(label), label_text); |
e006685f75aa
[gaim-migrate @ 6886]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
533 gtk_label_set_line_wrap(GTK_LABEL(label), TRUE); |
e006685f75aa
[gaim-migrate @ 6886]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
534 gtk_misc_set_alignment(GTK_MISC(label), 0, 0); |
e006685f75aa
[gaim-migrate @ 6886]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
535 gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0); |
e006685f75aa
[gaim-migrate @ 6886]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
536 gtk_widget_show(label); |
e006685f75aa
[gaim-migrate @ 6886]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
537 |
10181 | 538 /* Add the imhtml */ |
539 frame = gaim_gtk_create_imhtml(FALSE, &imhtml, NULL); | |
9005 | 540 gtk_widget_set_name(imhtml, "gaim_gtknotify_imhtml"); |
11723
9537977703bb
[gaim-migrate @ 14014]
Richard Laager <rlaager@wiktel.com>
parents:
11533
diff
changeset
|
541 gtk_imhtml_set_format_functions(GTK_IMHTML(imhtml), |
9537977703bb
[gaim-migrate @ 14014]
Richard Laager <rlaager@wiktel.com>
parents:
11533
diff
changeset
|
542 gtk_imhtml_get_format_functions(GTK_IMHTML(imhtml)) | GTK_IMHTML_IMAGE); |
10181 | 543 gtk_widget_set_size_request(imhtml, 300, 250); |
544 gtk_box_pack_start(GTK_BOX(vbox), frame, TRUE, TRUE, 0); | |
545 gtk_widget_show(frame); | |
6381
e006685f75aa
[gaim-migrate @ 6886]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
546 |
e006685f75aa
[gaim-migrate @ 6886]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
547 /* Add the Close button. */ |
e006685f75aa
[gaim-migrate @ 6886]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
548 button = gtk_button_new_from_stock(GTK_STOCK_CLOSE); |
e006685f75aa
[gaim-migrate @ 6886]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
549 gtk_box_pack_start(GTK_BOX(vbox), button, FALSE, FALSE, 0); |
e006685f75aa
[gaim-migrate @ 6886]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
550 gtk_widget_show(button); |
e006685f75aa
[gaim-migrate @ 6886]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
551 |
6872 | 552 g_signal_connect_swapped(G_OBJECT(button), "clicked", |
8338
354bba6ad254
[gaim-migrate @ 9062]
Christian Hammond <chipx86@chipx86.com>
parents:
8337
diff
changeset
|
553 G_CALLBACK(formatted_close_cb), window); |
7455 | 554 g_signal_connect(G_OBJECT(window), "key_press_event", |
8338
354bba6ad254
[gaim-migrate @ 9062]
Christian Hammond <chipx86@chipx86.com>
parents:
8337
diff
changeset
|
555 G_CALLBACK(formatted_input_cb), NULL); |
7455 | 556 |
6381
e006685f75aa
[gaim-migrate @ 6886]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
557 /* Add the text to the gtkimhtml */ |
11293 | 558 if (!gaim_prefs_get_bool("/gaim/gtk/conversations/show_incoming_formatting")) |
10497 | 559 options |= GTK_IMHTML_NO_COLOURS | GTK_IMHTML_NO_FONTS | GTK_IMHTML_NO_SIZES; |
6381
e006685f75aa
[gaim-migrate @ 6886]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
560 |
10503 | 561 options |= GTK_IMHTML_NO_COMMENTS; |
562 options |= GTK_IMHTML_NO_TITLE; | |
563 options |= GTK_IMHTML_NO_NEWLINE; | |
564 options |= GTK_IMHTML_NO_SCROLL; | |
6381
e006685f75aa
[gaim-migrate @ 6886]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
565 |
8882 | 566 /* Make sure URLs are clickable */ |
567 linked_text = gaim_markup_linkify(text); | |
10181 | 568 gtk_imhtml_append_text(GTK_IMHTML(imhtml), linked_text, options); |
8882 | 569 g_free(linked_text); |
7078 | 570 |
6381
e006685f75aa
[gaim-migrate @ 6886]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
571 /* Show the window */ |
e006685f75aa
[gaim-migrate @ 6886]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
572 gtk_widget_show(window); |
e006685f75aa
[gaim-migrate @ 6886]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
573 |
e006685f75aa
[gaim-migrate @ 6886]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
574 return window; |
e006685f75aa
[gaim-migrate @ 6886]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
575 } |
e006685f75aa
[gaim-migrate @ 6886]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
576 |
11359 | 577 static void |
578 gaim_gtk_notify_searchresults_new_rows(GaimConnection *gc, GaimNotifySearchResults *results, | |
12220
64254fbabc7b
[gaim-migrate @ 14522]
Richard Laager <rlaager@wiktel.com>
parents:
11723
diff
changeset
|
579 void *data_, gpointer user_data) |
11359 | 580 { |
581 GaimNotifySearchResultsData *data = data_; | |
582 GtkListStore *model = data->model; | |
583 GtkTreeIter iter; | |
584 GdkPixbuf *icon, *scaled; | |
12257
ca27de274225
[gaim-migrate @ 14559]
Richard Laager <rlaager@wiktel.com>
parents:
12242
diff
changeset
|
585 guint col_num; |
ca27de274225
[gaim-migrate @ 14559]
Richard Laager <rlaager@wiktel.com>
parents:
12242
diff
changeset
|
586 guint i; |
ca27de274225
[gaim-migrate @ 14559]
Richard Laager <rlaager@wiktel.com>
parents:
12242
diff
changeset
|
587 guint j; |
11359 | 588 |
589 gtk_list_store_clear(data->model); | |
590 | |
591 icon = gaim_gtk_create_prpl_icon(gaim_connection_get_account(gc)); | |
592 scaled = gdk_pixbuf_scale_simple(icon, 16, 16, GDK_INTERP_BILINEAR); | |
593 | |
594 /* +1 is for the automagically created Status column. */ | |
595 col_num = gaim_notify_searchresults_get_columns_count(results) + 1; | |
596 | |
597 for (i = 0; i < gaim_notify_searchresults_get_rows_count(results); i++) { | |
598 GList *row = gaim_notify_searchresults_row_get(results, i); | |
599 | |
600 gtk_list_store_append(model, &iter); | |
601 gtk_list_store_set(model, &iter, 0, scaled, -1); | |
602 | |
603 for (j = 1; j < col_num; j++) { | |
12600
e856f985a0b9
[gaim-migrate @ 14934]
Richard Laager <rlaager@wiktel.com>
parents:
12477
diff
changeset
|
604 GValue v; |
11359 | 605 char *escaped = g_markup_escape_text(g_list_nth_data(row, j - 1), -1); |
606 | |
12600
e856f985a0b9
[gaim-migrate @ 14934]
Richard Laager <rlaager@wiktel.com>
parents:
12477
diff
changeset
|
607 v.g_type = 0; |
11359 | 608 g_value_init(&v, G_TYPE_STRING); |
609 g_value_set_string(&v, escaped); | |
610 gtk_list_store_set_value(model, &iter, j, &v); | |
611 g_free(escaped); | |
612 } | |
613 } | |
614 } | |
615 | |
9797 | 616 static void * |
10439 | 617 gaim_gtk_notify_searchresults(GaimConnection *gc, const char *title, |
618 const char *primary, const char *secondary, | |
12242
976677e67239
[gaim-migrate @ 14544]
Richard Laager <rlaager@wiktel.com>
parents:
12227
diff
changeset
|
619 GaimNotifySearchResults *results) |
10439 | 620 { |
621 GtkWidget *window; | |
11359 | 622 GtkWidget *treeview; |
12624
851b0bd7eb52
[gaim-migrate @ 14960]
Christopher O'Brien <siege@pidgin.im>
parents:
12600
diff
changeset
|
623 GtkWidget *close_button; |
11359 | 624 GType *col_types; |
625 GtkListStore *model; | |
626 GtkCellRenderer *renderer; | |
12257
ca27de274225
[gaim-migrate @ 14559]
Richard Laager <rlaager@wiktel.com>
parents:
12242
diff
changeset
|
627 guint col_num; |
ca27de274225
[gaim-migrate @ 14559]
Richard Laager <rlaager@wiktel.com>
parents:
12242
diff
changeset
|
628 guint i; |
11359 | 629 |
10439 | 630 GtkWidget *vbox; |
631 GtkWidget *button_area; | |
632 GtkWidget *label; | |
633 GtkWidget *sw; | |
634 GaimNotifySearchResultsData *data; | |
635 char *label_text; | |
10774 | 636 char *primary_esc, *secondary_esc; |
10439 | 637 |
12257
ca27de274225
[gaim-migrate @ 14559]
Richard Laager <rlaager@wiktel.com>
parents:
12242
diff
changeset
|
638 g_return_val_if_fail(gc != NULL, NULL); |
ca27de274225
[gaim-migrate @ 14559]
Richard Laager <rlaager@wiktel.com>
parents:
12242
diff
changeset
|
639 g_return_val_if_fail(results != NULL, NULL); |
ca27de274225
[gaim-migrate @ 14559]
Richard Laager <rlaager@wiktel.com>
parents:
12242
diff
changeset
|
640 |
10439 | 641 data = g_malloc(sizeof(GaimNotifySearchResultsData)); |
642 | |
643 /* Create the window */ | |
644 window = gtk_window_new(GTK_WINDOW_TOPLEVEL); | |
645 gtk_window_set_title(GTK_WINDOW(window), (title ? title :_("Search Results"))); | |
646 gtk_window_set_type_hint(GTK_WINDOW(window), GDK_WINDOW_TYPE_HINT_DIALOG); | |
11243 | 647 gtk_container_set_border_width(GTK_CONTAINER(window), GAIM_HIG_BORDER); |
10439 | 648 |
649 g_signal_connect_swapped(G_OBJECT(window), "delete_event", | |
650 G_CALLBACK(searchresults_close_cb), data); | |
651 | |
652 /* Setup the main vbox */ | |
11243 | 653 vbox = gtk_vbox_new(FALSE, GAIM_HIG_BORDER); |
10439 | 654 gtk_container_add(GTK_CONTAINER(window), vbox); |
655 gtk_widget_show(vbox); | |
656 | |
657 /* Setup the descriptive label */ | |
10774 | 658 primary_esc = (primary != NULL) ? g_markup_escape_text(primary, -1) : NULL; |
659 secondary_esc = (secondary != NULL) ? g_markup_escape_text(secondary, -1) : NULL; | |
10439 | 660 label_text = g_strdup_printf( |
661 "<span weight=\"bold\" size=\"larger\">%s</span>%s%s", | |
10774 | 662 (primary ? primary_esc : ""), |
10439 | 663 (primary && secondary ? "\n" : ""), |
10774 | 664 (secondary ? secondary_esc : "")); |
665 g_free(primary_esc); | |
666 g_free(secondary_esc); | |
10439 | 667 label = gtk_label_new(NULL); |
668 gtk_label_set_markup(GTK_LABEL(label), label_text); | |
669 gtk_label_set_line_wrap(GTK_LABEL(label), TRUE); | |
670 gtk_misc_set_alignment(GTK_MISC(label), 0, 0); | |
671 gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0); | |
672 gtk_widget_show(label); | |
673 g_free(label_text); | |
674 | |
11359 | 675 /* +1 is for the automagically created Status column. */ |
676 col_num = gaim_notify_searchresults_get_columns_count(results) + 1; | |
677 | |
10439 | 678 /* Setup the list model */ |
11359 | 679 col_types = g_new0(GType, col_num); |
680 | |
681 /* There always is this first column. */ | |
682 col_types[0] = GDK_TYPE_PIXBUF; | |
683 for (i = 1; i < col_num; i++) { | |
684 col_types[i] = G_TYPE_STRING; | |
685 } | |
686 model = gtk_list_store_newv(col_num, col_types); | |
10439 | 687 |
688 /* Setup the scrolled window containing the treeview */ | |
689 sw = gtk_scrolled_window_new(NULL, NULL); | |
690 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), | |
691 GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS); | |
692 gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(sw), | |
693 GTK_SHADOW_IN); | |
694 gtk_box_pack_start(GTK_BOX(vbox), sw, TRUE, TRUE, 0); | |
695 gtk_widget_show(sw); | |
696 | |
697 /* Setup the treeview */ | |
698 treeview = gtk_tree_view_new_with_model(GTK_TREE_MODEL(model)); | |
699 gtk_tree_view_set_rules_hint(GTK_TREE_VIEW(treeview), TRUE); | |
11359 | 700 gtk_widget_set_size_request(treeview, 500, 400); |
10439 | 701 gtk_tree_selection_set_mode(gtk_tree_view_get_selection(GTK_TREE_VIEW(treeview)), |
702 GTK_SELECTION_SINGLE); | |
11359 | 703 gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(treeview), TRUE); |
10439 | 704 gtk_container_add(GTK_CONTAINER(sw), treeview); |
705 gtk_widget_show(treeview); | |
706 | |
11359 | 707 renderer = gtk_cell_renderer_pixbuf_new(); |
10439 | 708 gtk_tree_view_insert_column_with_attributes(GTK_TREE_VIEW(treeview), |
11359 | 709 -1, "", renderer, "pixbuf", 0, NULL); |
10439 | 710 |
11359 | 711 for (i = 1; i < col_num; i++) { |
712 renderer = gtk_cell_renderer_text_new(); | |
10439 | 713 |
11359 | 714 gtk_tree_view_insert_column_with_attributes(GTK_TREE_VIEW(treeview), -1, |
715 gaim_notify_searchresults_column_get_title(results, i-1), | |
716 renderer, "text", i, NULL); | |
717 } | |
718 | |
10439 | 719 /* Setup the button area */ |
720 button_area = gtk_hbutton_box_new(); | |
721 gtk_box_pack_start(GTK_BOX(vbox), button_area, FALSE, FALSE, 0); | |
722 gtk_button_box_set_layout(GTK_BUTTON_BOX(button_area), GTK_BUTTONBOX_END); | |
11243 | 723 gtk_box_set_spacing(GTK_BOX(button_area), GAIM_HIG_BORDER); |
10439 | 724 gtk_widget_show(button_area); |
725 | |
12257
ca27de274225
[gaim-migrate @ 14559]
Richard Laager <rlaager@wiktel.com>
parents:
12242
diff
changeset
|
726 for (i = 0; i < g_list_length(results->buttons); i++) { |
ca27de274225
[gaim-migrate @ 14559]
Richard Laager <rlaager@wiktel.com>
parents:
12242
diff
changeset
|
727 GaimNotifySearchButton *b = g_list_nth_data(results->buttons, i); |
12624
851b0bd7eb52
[gaim-migrate @ 14960]
Christopher O'Brien <siege@pidgin.im>
parents:
12600
diff
changeset
|
728 GtkWidget *button = NULL; |
11359 | 729 switch (b->type) { |
12624
851b0bd7eb52
[gaim-migrate @ 14960]
Christopher O'Brien <siege@pidgin.im>
parents:
12600
diff
changeset
|
730 case GAIM_NOTIFY_BUTTON_LABELED: |
851b0bd7eb52
[gaim-migrate @ 14960]
Christopher O'Brien <siege@pidgin.im>
parents:
12600
diff
changeset
|
731 if(b->label) { |
851b0bd7eb52
[gaim-migrate @ 14960]
Christopher O'Brien <siege@pidgin.im>
parents:
12600
diff
changeset
|
732 button = gtk_button_new_with_label(b->label); |
851b0bd7eb52
[gaim-migrate @ 14960]
Christopher O'Brien <siege@pidgin.im>
parents:
12600
diff
changeset
|
733 } else { |
851b0bd7eb52
[gaim-migrate @ 14960]
Christopher O'Brien <siege@pidgin.im>
parents:
12600
diff
changeset
|
734 gaim_debug_warning("gtknotify", "Missing button label"); |
851b0bd7eb52
[gaim-migrate @ 14960]
Christopher O'Brien <siege@pidgin.im>
parents:
12600
diff
changeset
|
735 } |
851b0bd7eb52
[gaim-migrate @ 14960]
Christopher O'Brien <siege@pidgin.im>
parents:
12600
diff
changeset
|
736 break; |
11359 | 737 case GAIM_NOTIFY_BUTTON_CONTINUE: |
738 button = gtk_button_new_from_stock(GTK_STOCK_GO_FORWARD); | |
739 break; | |
12624
851b0bd7eb52
[gaim-migrate @ 14960]
Christopher O'Brien <siege@pidgin.im>
parents:
12600
diff
changeset
|
740 case GAIM_NOTIFY_BUTTON_ADD: |
11359 | 741 button = gtk_button_new_from_stock(GTK_STOCK_ADD); |
742 break; | |
12624
851b0bd7eb52
[gaim-migrate @ 14960]
Christopher O'Brien <siege@pidgin.im>
parents:
12600
diff
changeset
|
743 case GAIM_NOTIFY_BUTTON_INFO: |
851b0bd7eb52
[gaim-migrate @ 14960]
Christopher O'Brien <siege@pidgin.im>
parents:
12600
diff
changeset
|
744 button = gtk_button_new_from_stock(GAIM_STOCK_INFO); |
851b0bd7eb52
[gaim-migrate @ 14960]
Christopher O'Brien <siege@pidgin.im>
parents:
12600
diff
changeset
|
745 break; |
851b0bd7eb52
[gaim-migrate @ 14960]
Christopher O'Brien <siege@pidgin.im>
parents:
12600
diff
changeset
|
746 case GAIM_NOTIFY_BUTTON_IM: |
851b0bd7eb52
[gaim-migrate @ 14960]
Christopher O'Brien <siege@pidgin.im>
parents:
12600
diff
changeset
|
747 button = gtk_button_new_from_stock(GAIM_STOCK_IM); |
851b0bd7eb52
[gaim-migrate @ 14960]
Christopher O'Brien <siege@pidgin.im>
parents:
12600
diff
changeset
|
748 break; |
851b0bd7eb52
[gaim-migrate @ 14960]
Christopher O'Brien <siege@pidgin.im>
parents:
12600
diff
changeset
|
749 case GAIM_NOTIFY_BUTTON_JOIN: |
851b0bd7eb52
[gaim-migrate @ 14960]
Christopher O'Brien <siege@pidgin.im>
parents:
12600
diff
changeset
|
750 button = gtk_button_new_from_stock(GAIM_STOCK_CHAT); |
851b0bd7eb52
[gaim-migrate @ 14960]
Christopher O'Brien <siege@pidgin.im>
parents:
12600
diff
changeset
|
751 break; |
851b0bd7eb52
[gaim-migrate @ 14960]
Christopher O'Brien <siege@pidgin.im>
parents:
12600
diff
changeset
|
752 case GAIM_NOTIFY_BUTTON_INVITE: |
851b0bd7eb52
[gaim-migrate @ 14960]
Christopher O'Brien <siege@pidgin.im>
parents:
12600
diff
changeset
|
753 button = gtk_button_new_from_stock(GAIM_STOCK_INVITE); |
851b0bd7eb52
[gaim-migrate @ 14960]
Christopher O'Brien <siege@pidgin.im>
parents:
12600
diff
changeset
|
754 break; |
11359 | 755 default: |
756 gaim_debug_warning("gtknotify", "Incorrect button type: %d\n", b->type); | |
757 } | |
758 if (button != NULL) { | |
12624
851b0bd7eb52
[gaim-migrate @ 14960]
Christopher O'Brien <siege@pidgin.im>
parents:
12600
diff
changeset
|
759 GaimNotifySearchResultsButtonData *bd; |
851b0bd7eb52
[gaim-migrate @ 14960]
Christopher O'Brien <siege@pidgin.im>
parents:
12600
diff
changeset
|
760 |
11359 | 761 gtk_box_pack_start(GTK_BOX(button_area), button, FALSE, FALSE, 0); |
762 gtk_widget_show(button); | |
12624
851b0bd7eb52
[gaim-migrate @ 14960]
Christopher O'Brien <siege@pidgin.im>
parents:
12600
diff
changeset
|
763 |
851b0bd7eb52
[gaim-migrate @ 14960]
Christopher O'Brien <siege@pidgin.im>
parents:
12600
diff
changeset
|
764 bd = g_new0(GaimNotifySearchResultsButtonData, 1); |
851b0bd7eb52
[gaim-migrate @ 14960]
Christopher O'Brien <siege@pidgin.im>
parents:
12600
diff
changeset
|
765 bd->button = b; |
851b0bd7eb52
[gaim-migrate @ 14960]
Christopher O'Brien <siege@pidgin.im>
parents:
12600
diff
changeset
|
766 bd->data = data; |
851b0bd7eb52
[gaim-migrate @ 14960]
Christopher O'Brien <siege@pidgin.im>
parents:
12600
diff
changeset
|
767 |
851b0bd7eb52
[gaim-migrate @ 14960]
Christopher O'Brien <siege@pidgin.im>
parents:
12600
diff
changeset
|
768 g_signal_connect(G_OBJECT(button), "clicked", |
851b0bd7eb52
[gaim-migrate @ 14960]
Christopher O'Brien <siege@pidgin.im>
parents:
12600
diff
changeset
|
769 G_CALLBACK(searchresults_callback_wrapper_cb), bd); |
11359 | 770 } |
771 } | |
10439 | 772 |
773 /* Add the Close button */ | |
774 close_button = gtk_button_new_from_stock(GTK_STOCK_CLOSE); | |
775 gtk_box_pack_start(GTK_BOX(button_area), close_button, FALSE, FALSE, 0); | |
776 gtk_widget_show(close_button); | |
777 | |
12624
851b0bd7eb52
[gaim-migrate @ 14960]
Christopher O'Brien <siege@pidgin.im>
parents:
12600
diff
changeset
|
778 g_signal_connect_swapped(G_OBJECT(close_button), "clicked", |
851b0bd7eb52
[gaim-migrate @ 14960]
Christopher O'Brien <siege@pidgin.im>
parents:
12600
diff
changeset
|
779 G_CALLBACK(searchresults_close_cb), data); |
851b0bd7eb52
[gaim-migrate @ 14960]
Christopher O'Brien <siege@pidgin.im>
parents:
12600
diff
changeset
|
780 |
10439 | 781 data->account = gc->account; |
782 data->model = model; | |
783 data->treeview = treeview; | |
784 data->window = window; | |
785 | |
11359 | 786 /* Insert rows. */ |
787 gaim_gtk_notify_searchresults_new_rows(gc, results, data, NULL); | |
788 | |
10439 | 789 /* Show the window */ |
790 gtk_widget_show(window); | |
791 return data; | |
792 } | |
793 | |
794 static void * | |
9797 | 795 gaim_gtk_notify_userinfo(GaimConnection *gc, const char *who, |
12242
976677e67239
[gaim-migrate @ 14544]
Richard Laager <rlaager@wiktel.com>
parents:
12227
diff
changeset
|
796 const char *text) |
9797 | 797 { |
11533
c9b815aeddc1
[gaim-migrate @ 13782]
Richard Laager <rlaager@wiktel.com>
parents:
11359
diff
changeset
|
798 char *primary; |
c9b815aeddc1
[gaim-migrate @ 13782]
Richard Laager <rlaager@wiktel.com>
parents:
11359
diff
changeset
|
799 void *ui_handle; |
c9b815aeddc1
[gaim-migrate @ 13782]
Richard Laager <rlaager@wiktel.com>
parents:
11359
diff
changeset
|
800 |
c9b815aeddc1
[gaim-migrate @ 13782]
Richard Laager <rlaager@wiktel.com>
parents:
11359
diff
changeset
|
801 primary = g_strdup_printf(_("Info for %s"), who); |
12242
976677e67239
[gaim-migrate @ 14544]
Richard Laager <rlaager@wiktel.com>
parents:
12227
diff
changeset
|
802 ui_handle = gaim_gtk_notify_formatted(_("Buddy Information"), primary, NULL, text); |
11533
c9b815aeddc1
[gaim-migrate @ 13782]
Richard Laager <rlaager@wiktel.com>
parents:
11359
diff
changeset
|
803 g_free(primary); |
c9b815aeddc1
[gaim-migrate @ 13782]
Richard Laager <rlaager@wiktel.com>
parents:
11359
diff
changeset
|
804 return ui_handle; |
9797 | 805 } |
806 | |
5437 | 807 static void |
5519
42a20beb80a7
[gaim-migrate @ 5919]
Christian Hammond <chipx86@chipx86.com>
parents:
5476
diff
changeset
|
808 gaim_gtk_close_notify(GaimNotifyType type, void *ui_handle) |
5437 | 809 { |
8338
354bba6ad254
[gaim-migrate @ 9062]
Christian Hammond <chipx86@chipx86.com>
parents:
8337
diff
changeset
|
810 if (type == GAIM_NOTIFY_EMAIL || type == GAIM_NOTIFY_EMAILS) |
354bba6ad254
[gaim-migrate @ 9062]
Christian Hammond <chipx86@chipx86.com>
parents:
8337
diff
changeset
|
811 { |
5519
42a20beb80a7
[gaim-migrate @ 5919]
Christian Hammond <chipx86@chipx86.com>
parents:
5476
diff
changeset
|
812 GaimNotifyMailData *data = (GaimNotifyMailData *)ui_handle; |
42a20beb80a7
[gaim-migrate @ 5919]
Christian Hammond <chipx86@chipx86.com>
parents:
5476
diff
changeset
|
813 |
42a20beb80a7
[gaim-migrate @ 5919]
Christian Hammond <chipx86@chipx86.com>
parents:
5476
diff
changeset
|
814 g_free(data->url); |
42a20beb80a7
[gaim-migrate @ 5919]
Christian Hammond <chipx86@chipx86.com>
parents:
5476
diff
changeset
|
815 g_free(data); |
42a20beb80a7
[gaim-migrate @ 5919]
Christian Hammond <chipx86@chipx86.com>
parents:
5476
diff
changeset
|
816 } |
10439 | 817 else if (type == GAIM_NOTIFY_SEARCHRESULTS) |
818 { | |
819 GaimNotifySearchResultsData *data = (GaimNotifySearchResultsData *)ui_handle; | |
820 | |
821 gtk_widget_destroy(data->window); | |
822 | |
823 g_free(data); | |
824 } | |
10750
d5a00882d118
[gaim-migrate @ 12353]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
10732
diff
changeset
|
825 else if (ui_handle != NULL) |
5519
42a20beb80a7
[gaim-migrate @ 5919]
Christian Hammond <chipx86@chipx86.com>
parents:
5476
diff
changeset
|
826 gtk_widget_destroy(GTK_WIDGET(ui_handle)); |
5437 | 827 } |
828 | |
8272 | 829 #ifndef _WIN32 |
830 static gint | |
8338
354bba6ad254
[gaim-migrate @ 9062]
Christian Hammond <chipx86@chipx86.com>
parents:
8337
diff
changeset
|
831 uri_command(const char *command, gboolean sync) |
8272 | 832 { |
9777 | 833 gchar *escaped, *tmp; |
8272 | 834 GError *error = NULL; |
835 gint ret = 0; | |
836 | |
10732
c4cb90065e1d
[gaim-migrate @ 12334]
Luke Schierer <lschiere@pidgin.im>
parents:
10503
diff
changeset
|
837 escaped = g_markup_escape_text(command, -1); |
9777 | 838 gaim_debug_misc("gtknotify", "Executing %s\n", escaped); |
8278 | 839 |
8338
354bba6ad254
[gaim-migrate @ 9062]
Christian Hammond <chipx86@chipx86.com>
parents:
8337
diff
changeset
|
840 if (!gaim_program_is_valid(command)) |
354bba6ad254
[gaim-migrate @ 9062]
Christian Hammond <chipx86@chipx86.com>
parents:
8337
diff
changeset
|
841 { |
9777 | 842 tmp = g_strdup_printf(_("The browser command <b>%s</b> is invalid."), |
843 escaped ? escaped : "(none)"); | |
8272 | 844 gaim_notify_error(NULL, NULL, _("Unable to open URL"), tmp); |
845 g_free(tmp); | |
846 | |
8338
354bba6ad254
[gaim-migrate @ 9062]
Christian Hammond <chipx86@chipx86.com>
parents:
8337
diff
changeset
|
847 } |
354bba6ad254
[gaim-migrate @ 9062]
Christian Hammond <chipx86@chipx86.com>
parents:
8337
diff
changeset
|
848 else if (sync) |
354bba6ad254
[gaim-migrate @ 9062]
Christian Hammond <chipx86@chipx86.com>
parents:
8337
diff
changeset
|
849 { |
8272 | 850 gint status; |
8338
354bba6ad254
[gaim-migrate @ 9062]
Christian Hammond <chipx86@chipx86.com>
parents:
8337
diff
changeset
|
851 |
354bba6ad254
[gaim-migrate @ 9062]
Christian Hammond <chipx86@chipx86.com>
parents:
8337
diff
changeset
|
852 if (!g_spawn_command_line_sync(command, NULL, NULL, &status, &error)) |
354bba6ad254
[gaim-migrate @ 9062]
Christian Hammond <chipx86@chipx86.com>
parents:
8337
diff
changeset
|
853 { |
9777 | 854 tmp = g_strdup_printf(_("Error launching <b>%s</b>: %s"), |
855 escaped, error->message); | |
8272 | 856 gaim_notify_error(NULL, NULL, _("Unable to open URL"), tmp); |
857 g_free(tmp); | |
858 g_error_free(error); | |
8338
354bba6ad254
[gaim-migrate @ 9062]
Christian Hammond <chipx86@chipx86.com>
parents:
8337
diff
changeset
|
859 } |
354bba6ad254
[gaim-migrate @ 9062]
Christian Hammond <chipx86@chipx86.com>
parents:
8337
diff
changeset
|
860 else |
8272 | 861 ret = status; |
8338
354bba6ad254
[gaim-migrate @ 9062]
Christian Hammond <chipx86@chipx86.com>
parents:
8337
diff
changeset
|
862 } |
354bba6ad254
[gaim-migrate @ 9062]
Christian Hammond <chipx86@chipx86.com>
parents:
8337
diff
changeset
|
863 else |
354bba6ad254
[gaim-migrate @ 9062]
Christian Hammond <chipx86@chipx86.com>
parents:
8337
diff
changeset
|
864 { |
354bba6ad254
[gaim-migrate @ 9062]
Christian Hammond <chipx86@chipx86.com>
parents:
8337
diff
changeset
|
865 if (!g_spawn_command_line_async(command, &error)) |
354bba6ad254
[gaim-migrate @ 9062]
Christian Hammond <chipx86@chipx86.com>
parents:
8337
diff
changeset
|
866 { |
9777 | 867 tmp = g_strdup_printf(_("Error launching <b>%s</b>: %s"), |
868 escaped, error->message); | |
8272 | 869 gaim_notify_error(NULL, NULL, _("Unable to open URL"), tmp); |
870 g_free(tmp); | |
871 g_error_free(error); | |
872 } | |
873 } | |
874 | |
9777 | 875 g_free(escaped); |
876 | |
8272 | 877 return ret; |
878 } | |
8338
354bba6ad254
[gaim-migrate @ 9062]
Christian Hammond <chipx86@chipx86.com>
parents:
8337
diff
changeset
|
879 #endif /* _WIN32 */ |
8272 | 880 |
7136 | 881 static void * |
10240
95ca0db2d01d
[gaim-migrate @ 11377]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
10209
diff
changeset
|
882 gaim_gtk_notify_uri(const char *uri) |
7136 | 883 { |
884 #ifndef _WIN32 | |
12477
d90eae2387b5
[gaim-migrate @ 14788]
Richard Laager <rlaager@wiktel.com>
parents:
12257
diff
changeset
|
885 char *escaped = g_shell_quote(uri); |
7136 | 886 char *command = NULL; |
8272 | 887 char *remote_command = NULL; |
7136 | 888 const char *web_browser; |
8272 | 889 int place; |
7136 | 890 |
891 web_browser = gaim_prefs_get_string("/gaim/gtk/browsers/browser"); | |
8272 | 892 place = gaim_prefs_get_int("/gaim/gtk/browsers/place"); |
7136 | 893 |
10060 | 894 /* if they are running gnome, use the gnome web browser */ |
10061 | 895 if (gaim_running_gnome() == TRUE) |
10060 | 896 { |
12477
d90eae2387b5
[gaim-migrate @ 14788]
Richard Laager <rlaager@wiktel.com>
parents:
12257
diff
changeset
|
897 command = g_strdup_printf("gnome-open %s", escaped); |
10061 | 898 } |
10060 | 899 else if (!strcmp(web_browser, "epiphany") || |
9405 | 900 !strcmp(web_browser, "galeon")) |
8338
354bba6ad254
[gaim-migrate @ 9062]
Christian Hammond <chipx86@chipx86.com>
parents:
8337
diff
changeset
|
901 { |
8272 | 902 if (place == GAIM_BROWSER_NEW_WINDOW) |
12477
d90eae2387b5
[gaim-migrate @ 14788]
Richard Laager <rlaager@wiktel.com>
parents:
12257
diff
changeset
|
903 command = g_strdup_printf("%s -w %s", web_browser, escaped); |
8272 | 904 else if (place == GAIM_BROWSER_NEW_TAB) |
12477
d90eae2387b5
[gaim-migrate @ 14788]
Richard Laager <rlaager@wiktel.com>
parents:
12257
diff
changeset
|
905 command = g_strdup_printf("%s -n %s", web_browser, escaped); |
8338
354bba6ad254
[gaim-migrate @ 9062]
Christian Hammond <chipx86@chipx86.com>
parents:
8337
diff
changeset
|
906 else |
12477
d90eae2387b5
[gaim-migrate @ 14788]
Richard Laager <rlaager@wiktel.com>
parents:
12257
diff
changeset
|
907 command = g_strdup_printf("%s %s", web_browser, escaped); |
9405 | 908 } |
909 else if (!strcmp(web_browser, "gnome-open")) | |
910 { | |
12477
d90eae2387b5
[gaim-migrate @ 14788]
Richard Laager <rlaager@wiktel.com>
parents:
12257
diff
changeset
|
911 command = g_strdup_printf("gnome-open %s", escaped); |
8338
354bba6ad254
[gaim-migrate @ 9062]
Christian Hammond <chipx86@chipx86.com>
parents:
8337
diff
changeset
|
912 } |
354bba6ad254
[gaim-migrate @ 9062]
Christian Hammond <chipx86@chipx86.com>
parents:
8337
diff
changeset
|
913 else if (!strcmp(web_browser, "kfmclient")) |
354bba6ad254
[gaim-migrate @ 9062]
Christian Hammond <chipx86@chipx86.com>
parents:
8337
diff
changeset
|
914 { |
12477
d90eae2387b5
[gaim-migrate @ 14788]
Richard Laager <rlaager@wiktel.com>
parents:
12257
diff
changeset
|
915 command = g_strdup_printf("kfmclient openURL %s", escaped); |
8338
354bba6ad254
[gaim-migrate @ 9062]
Christian Hammond <chipx86@chipx86.com>
parents:
8337
diff
changeset
|
916 /* |
354bba6ad254
[gaim-migrate @ 9062]
Christian Hammond <chipx86@chipx86.com>
parents:
8337
diff
changeset
|
917 * Does Konqueror have options to open in new tab |
354bba6ad254
[gaim-migrate @ 9062]
Christian Hammond <chipx86@chipx86.com>
parents:
8337
diff
changeset
|
918 * and/or current window? |
354bba6ad254
[gaim-migrate @ 9062]
Christian Hammond <chipx86@chipx86.com>
parents:
8337
diff
changeset
|
919 */ |
354bba6ad254
[gaim-migrate @ 9062]
Christian Hammond <chipx86@chipx86.com>
parents:
8337
diff
changeset
|
920 } |
354bba6ad254
[gaim-migrate @ 9062]
Christian Hammond <chipx86@chipx86.com>
parents:
8337
diff
changeset
|
921 else if (!strcmp(web_browser, "mozilla") || |
354bba6ad254
[gaim-migrate @ 9062]
Christian Hammond <chipx86@chipx86.com>
parents:
8337
diff
changeset
|
922 !strcmp(web_browser, "mozilla-firebird") || |
354bba6ad254
[gaim-migrate @ 9062]
Christian Hammond <chipx86@chipx86.com>
parents:
8337
diff
changeset
|
923 !strcmp(web_browser, "firefox")) |
354bba6ad254
[gaim-migrate @ 9062]
Christian Hammond <chipx86@chipx86.com>
parents:
8337
diff
changeset
|
924 { |
9399 | 925 char *args = ""; |
926 | |
12477
d90eae2387b5
[gaim-migrate @ 14788]
Richard Laager <rlaager@wiktel.com>
parents:
12257
diff
changeset
|
927 command = g_strdup_printf("%s %s", web_browser, escaped); |
8272 | 928 |
9399 | 929 /* |
930 * Firefox 0.9 and higher require a "-a firefox" option when | |
931 * using -remote commands. This breaks older versions of | |
932 * mozilla. So we include this other handly little string | |
933 * when calling firefox. If the API for remote calls changes | |
934 * any more in firefox then firefox should probably be split | |
935 * apart from mozilla-firebird and mozilla... but this is good | |
936 * for now. | |
937 */ | |
938 if (!strcmp(web_browser, "firefox")) | |
939 args = "-a firefox"; | |
940 | |
8272 | 941 if (place == GAIM_BROWSER_NEW_WINDOW) |
9399 | 942 remote_command = g_strdup_printf("%s %s -remote " |
12477
d90eae2387b5
[gaim-migrate @ 14788]
Richard Laager <rlaager@wiktel.com>
parents:
12257
diff
changeset
|
943 "openURL(%s,new-window)", |
d90eae2387b5
[gaim-migrate @ 14788]
Richard Laager <rlaager@wiktel.com>
parents:
12257
diff
changeset
|
944 web_browser, args, escaped); |
8272 | 945 else if (place == GAIM_BROWSER_NEW_TAB) |
9399 | 946 remote_command = g_strdup_printf("%s %s -remote " |
12477
d90eae2387b5
[gaim-migrate @ 14788]
Richard Laager <rlaager@wiktel.com>
parents:
12257
diff
changeset
|
947 "openURL(%s,new-tab)", |
d90eae2387b5
[gaim-migrate @ 14788]
Richard Laager <rlaager@wiktel.com>
parents:
12257
diff
changeset
|
948 web_browser, args, escaped); |
8272 | 949 else if (place == GAIM_BROWSER_CURRENT) |
9399 | 950 remote_command = g_strdup_printf("%s %s -remote " |
12477
d90eae2387b5
[gaim-migrate @ 14788]
Richard Laager <rlaager@wiktel.com>
parents:
12257
diff
changeset
|
951 "openURL(%s)", |
d90eae2387b5
[gaim-migrate @ 14788]
Richard Laager <rlaager@wiktel.com>
parents:
12257
diff
changeset
|
952 web_browser, args, escaped); |
8338
354bba6ad254
[gaim-migrate @ 9062]
Christian Hammond <chipx86@chipx86.com>
parents:
8337
diff
changeset
|
953 } |
9405 | 954 else if (!strcmp(web_browser, "netscape")) |
955 { | |
12477
d90eae2387b5
[gaim-migrate @ 14788]
Richard Laager <rlaager@wiktel.com>
parents:
12257
diff
changeset
|
956 command = g_strdup_printf("netscape %s", escaped); |
9405 | 957 |
958 if (place == GAIM_BROWSER_NEW_WINDOW) | |
959 { | |
960 remote_command = g_strdup_printf("netscape -remote " | |
12477
d90eae2387b5
[gaim-migrate @ 14788]
Richard Laager <rlaager@wiktel.com>
parents:
12257
diff
changeset
|
961 "openURL(%s,new-window)", |
d90eae2387b5
[gaim-migrate @ 14788]
Richard Laager <rlaager@wiktel.com>
parents:
12257
diff
changeset
|
962 escaped); |
9405 | 963 } |
964 else if (place == GAIM_BROWSER_CURRENT) | |
965 { | |
966 remote_command = g_strdup_printf("netscape -remote " | |
12477
d90eae2387b5
[gaim-migrate @ 14788]
Richard Laager <rlaager@wiktel.com>
parents:
12257
diff
changeset
|
967 "openURL(%s)", escaped); |
9405 | 968 } |
969 } | |
970 else if (!strcmp(web_browser, "opera")) | |
971 { | |
972 if (place == GAIM_BROWSER_NEW_WINDOW) | |
12477
d90eae2387b5
[gaim-migrate @ 14788]
Richard Laager <rlaager@wiktel.com>
parents:
12257
diff
changeset
|
973 command = g_strdup_printf("opera -newwindow %s", escaped); |
9405 | 974 else if (place == GAIM_BROWSER_NEW_TAB) |
12477
d90eae2387b5
[gaim-migrate @ 14788]
Richard Laager <rlaager@wiktel.com>
parents:
12257
diff
changeset
|
975 command = g_strdup_printf("opera -newpage %s", escaped); |
9405 | 976 else if (place == GAIM_BROWSER_CURRENT) |
977 { | |
978 remote_command = g_strdup_printf("opera -remote " | |
12477
d90eae2387b5
[gaim-migrate @ 14788]
Richard Laager <rlaager@wiktel.com>
parents:
12257
diff
changeset
|
979 "openURL(%s)", escaped); |
d90eae2387b5
[gaim-migrate @ 14788]
Richard Laager <rlaager@wiktel.com>
parents:
12257
diff
changeset
|
980 command = g_strdup_printf("opera %s", escaped); |
9405 | 981 } |
982 else | |
12477
d90eae2387b5
[gaim-migrate @ 14788]
Richard Laager <rlaager@wiktel.com>
parents:
12257
diff
changeset
|
983 command = g_strdup_printf("opera %s", escaped); |
9405 | 984 |
985 } | |
8338
354bba6ad254
[gaim-migrate @ 9062]
Christian Hammond <chipx86@chipx86.com>
parents:
8337
diff
changeset
|
986 else if (!strcmp(web_browser, "custom")) |
354bba6ad254
[gaim-migrate @ 9062]
Christian Hammond <chipx86@chipx86.com>
parents:
8337
diff
changeset
|
987 { |
7136 | 988 const char *web_command; |
989 | |
990 web_command = gaim_prefs_get_string("/gaim/gtk/browsers/command"); | |
991 | |
8338
354bba6ad254
[gaim-migrate @ 9062]
Christian Hammond <chipx86@chipx86.com>
parents:
8337
diff
changeset
|
992 if (web_command == NULL || *web_command == '\0') |
354bba6ad254
[gaim-migrate @ 9062]
Christian Hammond <chipx86@chipx86.com>
parents:
8337
diff
changeset
|
993 { |
7136 | 994 gaim_notify_error(NULL, NULL, _("Unable to open URL"), |
995 _("The 'Manual' browser command has been " | |
996 "chosen, but no command has been set.")); | |
997 return NULL; | |
998 } | |
999 | |
1000 if (strstr(web_command, "%s")) | |
12477
d90eae2387b5
[gaim-migrate @ 14788]
Richard Laager <rlaager@wiktel.com>
parents:
12257
diff
changeset
|
1001 command = gaim_strreplace(web_command, "%s", escaped); |
8338
354bba6ad254
[gaim-migrate @ 9062]
Christian Hammond <chipx86@chipx86.com>
parents:
8337
diff
changeset
|
1002 else |
354bba6ad254
[gaim-migrate @ 9062]
Christian Hammond <chipx86@chipx86.com>
parents:
8337
diff
changeset
|
1003 { |
7136 | 1004 /* |
1005 * There is no "%s" in the browser command. Assume the user | |
1006 * wanted the URL tacked on to the end of the command. | |
1007 */ | |
12477
d90eae2387b5
[gaim-migrate @ 14788]
Richard Laager <rlaager@wiktel.com>
parents:
12257
diff
changeset
|
1008 command = g_strdup_printf("%s %s", web_command, escaped); |
7136 | 1009 } |
1010 } | |
1011 | |
12477
d90eae2387b5
[gaim-migrate @ 14788]
Richard Laager <rlaager@wiktel.com>
parents:
12257
diff
changeset
|
1012 g_free(escaped); |
d90eae2387b5
[gaim-migrate @ 14788]
Richard Laager <rlaager@wiktel.com>
parents:
12257
diff
changeset
|
1013 |
8338
354bba6ad254
[gaim-migrate @ 9062]
Christian Hammond <chipx86@chipx86.com>
parents:
8337
diff
changeset
|
1014 if (remote_command != NULL) |
354bba6ad254
[gaim-migrate @ 9062]
Christian Hammond <chipx86@chipx86.com>
parents:
8337
diff
changeset
|
1015 { |
8272 | 1016 /* try the remote command first */ |
1017 if (uri_command(remote_command, TRUE) != 0) | |
1018 uri_command(command, FALSE); | |
8338
354bba6ad254
[gaim-migrate @ 9062]
Christian Hammond <chipx86@chipx86.com>
parents:
8337
diff
changeset
|
1019 |
8272 | 1020 g_free(remote_command); |
8338
354bba6ad254
[gaim-migrate @ 9062]
Christian Hammond <chipx86@chipx86.com>
parents:
8337
diff
changeset
|
1021 |
354bba6ad254
[gaim-migrate @ 9062]
Christian Hammond <chipx86@chipx86.com>
parents:
8337
diff
changeset
|
1022 } |
354bba6ad254
[gaim-migrate @ 9062]
Christian Hammond <chipx86@chipx86.com>
parents:
8337
diff
changeset
|
1023 else |
8272 | 1024 uri_command(command, FALSE); |
7136 | 1025 |
1026 g_free(command); | |
1027 | |
8338
354bba6ad254
[gaim-migrate @ 9062]
Christian Hammond <chipx86@chipx86.com>
parents:
8337
diff
changeset
|
1028 #else /* !_WIN32 */ |
10240
95ca0db2d01d
[gaim-migrate @ 11377]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
10209
diff
changeset
|
1029 wgaim_notify_uri(uri); |
8338
354bba6ad254
[gaim-migrate @ 9062]
Christian Hammond <chipx86@chipx86.com>
parents:
8337
diff
changeset
|
1030 #endif /* !_WIN32 */ |
7136 | 1031 |
1032 return NULL; | |
1033 } | |
1034 | |
5437 | 1035 static GaimNotifyUiOps ops = |
1036 { | |
1037 gaim_gtk_notify_message, | |
1038 gaim_gtk_notify_email, | |
1039 gaim_gtk_notify_emails, | |
6381
e006685f75aa
[gaim-migrate @ 6886]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
1040 gaim_gtk_notify_formatted, |
10439 | 1041 gaim_gtk_notify_searchresults, |
11359 | 1042 gaim_gtk_notify_searchresults_new_rows, |
9797 | 1043 gaim_gtk_notify_userinfo, |
6465
fb64cc87bc96
[gaim-migrate @ 6974]
Christian Hammond <chipx86@chipx86.com>
parents:
6381
diff
changeset
|
1044 gaim_gtk_notify_uri, |
5437 | 1045 gaim_gtk_close_notify |
1046 }; | |
1047 | |
1048 GaimNotifyUiOps * | |
7035
feb3d21a7794
[gaim-migrate @ 7598]
Christian Hammond <chipx86@chipx86.com>
parents:
7007
diff
changeset
|
1049 gaim_gtk_notify_get_ui_ops(void) |
5437 | 1050 { |
1051 return &ops; | |
1052 } |