Mercurial > pidgin.yaz
annotate pidgin/gtknotify.c @ 28411:7115d04c525a
merge of '2b68579960365fea9a55bc39baf90eb59c42f972'
and '3ce9883eaf090e4ec49d632e99ae336882b209cd'
author | Paul Aurich <paul@darkrain42.org> |
---|---|
date | Sat, 22 Aug 2009 18:30:53 +0000 |
parents | f6cdf5f72479 |
children | 4b61989ab198 |
rev | line source |
---|---|
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1 /** |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2 * @file gtknotify.c GTK+ Notification API |
16193
247e421c4fa6
Rename the Doxygen group from gtkui to pidgin.
Richard Laager <rlaager@wiktel.com>
parents:
16062
diff
changeset
|
3 * @ingroup pidgin |
20251
6b8bc3309ab7
applied changes from 8a731bbd0197fbcc91a705c2d8f528154216defa
Richard Laager <rlaager@wiktel.com>
parents:
20217
diff
changeset
|
4 */ |
6b8bc3309ab7
applied changes from 8a731bbd0197fbcc91a705c2d8f528154216defa
Richard Laager <rlaager@wiktel.com>
parents:
20217
diff
changeset
|
5 |
6b8bc3309ab7
applied changes from 8a731bbd0197fbcc91a705c2d8f528154216defa
Richard Laager <rlaager@wiktel.com>
parents:
20217
diff
changeset
|
6 /* pidgin |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7 * |
15871
66dff3dfdea6
Re-sed the copyright notices so they don't all talk about Purple.
Richard Laager <rlaager@wiktel.com>
parents:
15823
diff
changeset
|
8 * Pidgin is the legal property of its developers, whose names are too numerous |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
9 * to list here. Please refer to the COPYRIGHT file distributed with this |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
10 * source distribution. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
11 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
12 * This program is free software; you can redistribute it and/or modify |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
13 * it under the terms of the GNU General Public License as published by |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
14 * the Free Software Foundation; either version 2 of the License, or |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
15 * (at your option) any later version. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
16 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
17 * This program is distributed in the hope that it will be useful, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
20 * GNU General Public License for more details. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
21 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
22 * You should have received a copy of the GNU General Public License |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
23 * along with this program; if not, write to the Free Software |
19680
44b4e8bd759b
The FSF changed its address a while ago; our files were out of date.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
19653
diff
changeset
|
24 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
25 */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
26 #include "internal.h" |
15514 | 27 #include "pidgin.h" |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
28 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
29 #include <gdk/gdkkeysyms.h> |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
30 |
26268
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
31 #include "account.h" |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
32 #include "connection.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
33 #include "debug.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
34 #include "prefs.h" |
15822
84b0f9b23ede
According to etags, pidgin/ should be completely clean of references to 'gaim' as a client
Sean Egan <seanegan@gmail.com>
parents:
15821
diff
changeset
|
35 #include "pidginstock.h" |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
36 #include "util.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
37 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
38 #include "gtkblist.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
39 #include "gtkimhtml.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
40 #include "gtknotify.h" |
26268
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
41 #include "gtkpounce.h" |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
42 #include "gtkutils.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
43 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
44 typedef struct |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
45 { |
17858
c1c533448097
sadrul's fix for the userinfo notify crash on disconnect that was caused by
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16988
diff
changeset
|
46 GtkWidget *window; |
c1c533448097
sadrul's fix for the userinfo notify crash on disconnect that was caused by
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16988
diff
changeset
|
47 int count; |
c1c533448097
sadrul's fix for the userinfo notify crash on disconnect that was caused by
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16988
diff
changeset
|
48 } PidginUserInfo; |
c1c533448097
sadrul's fix for the userinfo notify crash on disconnect that was caused by
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16988
diff
changeset
|
49 |
c1c533448097
sadrul's fix for the userinfo notify crash on disconnect that was caused by
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16988
diff
changeset
|
50 typedef struct |
c1c533448097
sadrul's fix for the userinfo notify crash on disconnect that was caused by
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16988
diff
changeset
|
51 { |
15823 | 52 PurpleAccount *account; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
53 char *url; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
54 GtkWidget *label; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
55 int count; |
22826
66914f306712
More plumbing work.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22208
diff
changeset
|
56 gboolean purple_has_handle; |
15821 | 57 } PidginNotifyMailData; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
58 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
59 typedef struct |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
60 { |
15823 | 61 PurpleAccount *account; |
26268
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
62 PurplePounce *pounce; |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
63 } PidginNotifyPounceData; |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
64 |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
65 |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
66 typedef struct |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
67 { |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
68 PurpleAccount *account; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
69 GtkListStore *model; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
70 GtkWidget *treeview; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
71 GtkWidget *window; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
72 gpointer user_data; |
15823 | 73 PurpleNotifySearchResults *results; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
74 |
15821 | 75 } PidginNotifySearchResultsData; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
76 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
77 typedef struct |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
78 { |
15823 | 79 PurpleNotifySearchButton *button; |
15821 | 80 PidginNotifySearchResultsData *data; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
81 |
15821 | 82 } PidginNotifySearchResultsButtonData; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
83 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
84 enum |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
85 { |
15820
c02a897a67c7
More Gaim to Pidgin changes
Sean Egan <seanegan@gmail.com>
parents:
15735
diff
changeset
|
86 PIDGIN_MAIL_ICON, |
c02a897a67c7
More Gaim to Pidgin changes
Sean Egan <seanegan@gmail.com>
parents:
15735
diff
changeset
|
87 PIDGIN_MAIL_TEXT, |
c02a897a67c7
More Gaim to Pidgin changes
Sean Egan <seanegan@gmail.com>
parents:
15735
diff
changeset
|
88 PIDGIN_MAIL_DATA, |
c02a897a67c7
More Gaim to Pidgin changes
Sean Egan <seanegan@gmail.com>
parents:
15735
diff
changeset
|
89 COLUMNS_PIDGIN_MAIL |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
90 }; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
91 |
26268
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
92 enum |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
93 { |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
94 PIDGIN_POUNCE_ICON, |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
95 PIDGIN_POUNCE_ALIAS, |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
96 PIDGIN_POUNCE_EVENT, |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
97 PIDGIN_POUNCE_TEXT, |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
98 PIDGIN_POUNCE_DATE, |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
99 PIDGIN_POUNCE_DATA, |
27344
975a29213f35
Use mail_dialog consistently, instead of switching from one line to the next. Various other cleanups, too.
Paul Aurich <paul@darkrain42.org>
parents:
27342
diff
changeset
|
100 COLUMNS_PIDGIN_POUNCE |
26268
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
101 }; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
102 |
26268
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
103 |
27339
c7768f23f519
Remove the PidginMailDialog typedef.
Paul Aurich <paul@darkrain42.org>
parents:
27338
diff
changeset
|
104 typedef struct _PidginNotifyDialog |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
105 { |
27338
c245c583a1a6
Remove a few layers of evil abstraction.
Paul Aurich <paul@darkrain42.org>
parents:
27337
diff
changeset
|
106 /* |
c245c583a1a6
Remove a few layers of evil abstraction.
Paul Aurich <paul@darkrain42.org>
parents:
27337
diff
changeset
|
107 * This must be first so PidginNotifyDialog can masquerade as the |
c245c583a1a6
Remove a few layers of evil abstraction.
Paul Aurich <paul@darkrain42.org>
parents:
27337
diff
changeset
|
108 * dialog widget. |
c245c583a1a6
Remove a few layers of evil abstraction.
Paul Aurich <paul@darkrain42.org>
parents:
27337
diff
changeset
|
109 */ |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
110 GtkWidget *dialog; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
111 GtkWidget *treeview; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
112 GtkTreeStore *treemodel; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
113 GtkLabel *label; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
114 GtkWidget *open_button; |
26268
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
115 GtkWidget *dismiss_button; |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
116 GtkWidget *edit_button; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
117 int total_count; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
118 gboolean in_use; |
27339
c7768f23f519
Remove the PidginMailDialog typedef.
Paul Aurich <paul@darkrain42.org>
parents:
27338
diff
changeset
|
119 } PidginNotifyDialog; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
120 |
26268
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
121 typedef enum |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
122 { |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
123 PIDGIN_NOTIFY_MAIL, |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
124 PIDGIN_NOTIFY_POUNCE, |
27117
9c36a340fcaf
Setting `dialog->open_button = button` when `button` is not yet assigned
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26922
diff
changeset
|
125 PIDGIN_NOTIFY_TYPES |
26268
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
126 } PidginNotifyType; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
127 |
26268
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
128 static PidginNotifyDialog *mail_dialog = NULL; |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
129 static PidginNotifyDialog *pounce_dialog = NULL; |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
130 |
27344
975a29213f35
Use mail_dialog consistently, instead of switching from one line to the next. Various other cleanups, too.
Paul Aurich <paul@darkrain42.org>
parents:
27342
diff
changeset
|
131 static PidginNotifyDialog *pidgin_create_notification_dialog(PidginNotifyType type); |
15823 | 132 static void *pidgin_notify_emails(PurpleConnection *gc, size_t count, gboolean detailed, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
133 const char **subjects, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
134 const char **froms, const char **tos, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
135 const char **urls); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
136 |
22826
66914f306712
More plumbing work.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22208
diff
changeset
|
137 static void pidgin_close_notify(PurpleNotifyType type, void *ui_handle); |
66914f306712
More plumbing work.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22208
diff
changeset
|
138 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
139 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
140 message_response_cb(GtkDialog *dialog, gint id, GtkWidget *widget) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
141 { |
15823 | 142 purple_notify_close(PURPLE_NOTIFY_MESSAGE, widget); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
143 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
144 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
145 static void |
26268
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
146 pounce_response_close(PidginNotifyDialog *dialog) |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
147 { |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
148 GtkTreeIter iter; |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
149 PidginNotifyPounceData *pounce_data; |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
150 |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
151 while (gtk_tree_model_get_iter_first( |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
152 GTK_TREE_MODEL(pounce_dialog->treemodel), &iter)) { |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
153 gtk_tree_model_get(GTK_TREE_MODEL(pounce_dialog->treemodel), &iter, |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
154 PIDGIN_POUNCE_DATA, &pounce_data, |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
155 -1); |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
156 gtk_tree_store_remove(dialog->treemodel, &iter); |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
157 |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
158 g_free(pounce_data); |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
159 } |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
160 |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
161 gtk_widget_destroy(pounce_dialog->dialog); |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
162 g_free(pounce_dialog); |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
163 pounce_dialog = NULL; |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
164 } |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
165 |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
166 static void |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
167 delete_foreach(GtkTreeModel *model, GtkTreePath *path, |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
168 GtkTreeIter *iter, gpointer data) |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
169 { |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
170 PidginNotifyPounceData *pounce_data; |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
171 |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
172 gtk_tree_model_get(model, iter, |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
173 PIDGIN_POUNCE_DATA, &pounce_data, |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
174 -1); |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
175 |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
176 if (pounce_data != NULL) |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
177 g_free(pounce_data); |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
178 } |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
179 |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
180 static void |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
181 append_to_list(GtkTreeModel *model, GtkTreePath *path, |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
182 GtkTreeIter *iter, gpointer data) |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
183 { |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
184 GList **list = data; |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
185 *list = g_list_prepend(*list, gtk_tree_path_copy(path)); |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
186 } |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
187 static void |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
188 pounce_response_dismiss() |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
189 { |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
190 GtkTreeSelection *selection; |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
191 GList *list = NULL; |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
192 |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
193 selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(pounce_dialog->treeview)); |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
194 gtk_tree_selection_selected_foreach(selection, delete_foreach, pounce_dialog); |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
195 gtk_tree_selection_selected_foreach(selection, append_to_list, &list); |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
196 |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
197 while (list) { |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
198 GtkTreeIter iter; |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
199 if (gtk_tree_model_get_iter(GTK_TREE_MODEL(pounce_dialog->treemodel), &iter, |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
200 list->data)) { |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
201 gtk_tree_store_remove(GTK_TREE_STORE(pounce_dialog->treemodel), &iter); |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
202 } |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
203 gtk_tree_path_free(list->data); |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
204 list = g_list_delete_link(list, list); |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
205 } |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
206 } |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
207 |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
208 static void |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
209 pounce_response_edit_cb(GtkTreeModel *model, GtkTreePath *path, |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
210 GtkTreeIter *iter, gpointer data) |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
211 { |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
212 PidginNotifyPounceData *pounce_data; |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
213 PidginNotifyDialog *dialog = (PidginNotifyDialog*)data; |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
214 PurplePounce *pounce; |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
215 GList *list; |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
216 |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
217 list = purple_pounces_get_all(); |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
218 |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
219 gtk_tree_model_get(GTK_TREE_MODEL(dialog->treemodel), iter, |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
220 PIDGIN_POUNCE_DATA, &pounce_data, |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
221 -1); |
27337
357405dc8b2c
Remove trailing whitespace
Paul Aurich <paul@darkrain42.org>
parents:
27325
diff
changeset
|
222 |
26268
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
223 for (; list != NULL; list = list->next) { |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
224 pounce = list->data; |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
225 if (pounce == pounce_data->pounce) { |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
226 pidgin_pounce_editor_show(pounce_data->account, NULL, pounce_data->pounce); |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
227 return; |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
228 } |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
229 } |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
230 |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
231 purple_debug_warning("gtknotify", "Pounce was destroyed.\n"); |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
232 } |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
233 |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
234 static void |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
235 pounce_response_cb(GtkDialog *dlg, gint id, PidginNotifyDialog *dialog) |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
236 { |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
237 GtkTreeSelection *selection = NULL; |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
238 |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
239 switch (id) { |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
240 case GTK_RESPONSE_CLOSE: |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
241 case GTK_RESPONSE_DELETE_EVENT: |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
242 pounce_response_close(dialog); |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
243 break; |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
244 case GTK_RESPONSE_NO: |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
245 pounce_response_dismiss(); |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
246 break; |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
247 case GTK_RESPONSE_APPLY: |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
248 selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(dialog->treeview)); |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
249 gtk_tree_selection_selected_foreach(selection, pounce_response_edit_cb, |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
250 dialog); |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
251 break; |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
252 } |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
253 } |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
254 |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
255 static void |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
256 pounce_row_selected_cb(GtkTreeView *tv, GtkTreePath *path, |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
257 GtkTreeViewColumn *col, gpointer data) |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
258 { |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
259 GtkTreeIter iter; |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
260 GtkTreeSelection *selection; |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
261 gboolean selected; |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
262 GList *list; |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
263 |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
264 selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(pounce_dialog->treeview)); |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
265 |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
266 selected = gtk_tree_selection_get_selected(selection, |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
267 NULL, &iter); |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
268 |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
269 if (selected) { |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
270 PurplePounce *pounce; |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
271 PidginNotifyPounceData *pounce_data; |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
272 |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
273 list = purple_pounces_get_all(); |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
274 |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
275 gtk_tree_model_get(GTK_TREE_MODEL(pounce_dialog->treemodel), &iter, |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
276 PIDGIN_POUNCE_DATA, &pounce_data, |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
277 -1); |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
278 |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
279 gtk_widget_set_sensitive(pounce_dialog->edit_button, FALSE); |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
280 |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
281 for (; list != NULL; list = list->next) { |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
282 pounce = list->data; |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
283 if (pounce == pounce_data->pounce) { |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
284 gtk_widget_set_sensitive(pounce_dialog->edit_button, TRUE); |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
285 break; |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
286 } |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
287 } |
27337
357405dc8b2c
Remove trailing whitespace
Paul Aurich <paul@darkrain42.org>
parents:
27325
diff
changeset
|
288 |
26268
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
289 gtk_widget_set_sensitive(pounce_dialog->dismiss_button, TRUE); |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
290 } else { |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
291 gtk_widget_set_sensitive(pounce_dialog->edit_button, FALSE); |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
292 gtk_widget_set_sensitive(pounce_dialog->dismiss_button, FALSE); |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
293 } |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
294 |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
295 |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
296 } |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
297 |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
298 static void |
28407
f6cdf5f72479
Add a row-activation event for the Pounces dialog to open a new conversation window.
salinasv@gmail.com
parents:
27344
diff
changeset
|
299 pounce_row_activated_cb(GtkTreeView *tv, GtkTreePath *path, |
f6cdf5f72479
Add a row-activation event for the Pounces dialog to open a new conversation window.
salinasv@gmail.com
parents:
27344
diff
changeset
|
300 GtkTreeViewColumn *col, gpointer data) |
f6cdf5f72479
Add a row-activation event for the Pounces dialog to open a new conversation window.
salinasv@gmail.com
parents:
27344
diff
changeset
|
301 { |
f6cdf5f72479
Add a row-activation event for the Pounces dialog to open a new conversation window.
salinasv@gmail.com
parents:
27344
diff
changeset
|
302 PidginNotifyPounceData *pounce_data; |
f6cdf5f72479
Add a row-activation event for the Pounces dialog to open a new conversation window.
salinasv@gmail.com
parents:
27344
diff
changeset
|
303 PurpleAccount *account; |
f6cdf5f72479
Add a row-activation event for the Pounces dialog to open a new conversation window.
salinasv@gmail.com
parents:
27344
diff
changeset
|
304 GtkTreeIter iter; |
f6cdf5f72479
Add a row-activation event for the Pounces dialog to open a new conversation window.
salinasv@gmail.com
parents:
27344
diff
changeset
|
305 |
f6cdf5f72479
Add a row-activation event for the Pounces dialog to open a new conversation window.
salinasv@gmail.com
parents:
27344
diff
changeset
|
306 if(!gtk_tree_model_get_iter(GTK_TREE_MODEL(pounce_dialog->treemodel), &iter, path)) |
f6cdf5f72479
Add a row-activation event for the Pounces dialog to open a new conversation window.
salinasv@gmail.com
parents:
27344
diff
changeset
|
307 return; |
f6cdf5f72479
Add a row-activation event for the Pounces dialog to open a new conversation window.
salinasv@gmail.com
parents:
27344
diff
changeset
|
308 |
f6cdf5f72479
Add a row-activation event for the Pounces dialog to open a new conversation window.
salinasv@gmail.com
parents:
27344
diff
changeset
|
309 gtk_tree_model_get(GTK_TREE_MODEL(pounce_dialog->treemodel), &iter, |
f6cdf5f72479
Add a row-activation event for the Pounces dialog to open a new conversation window.
salinasv@gmail.com
parents:
27344
diff
changeset
|
310 PIDGIN_POUNCE_DATA, &pounce_data, -1); |
f6cdf5f72479
Add a row-activation event for the Pounces dialog to open a new conversation window.
salinasv@gmail.com
parents:
27344
diff
changeset
|
311 |
f6cdf5f72479
Add a row-activation event for the Pounces dialog to open a new conversation window.
salinasv@gmail.com
parents:
27344
diff
changeset
|
312 account = pounce_data->account; |
f6cdf5f72479
Add a row-activation event for the Pounces dialog to open a new conversation window.
salinasv@gmail.com
parents:
27344
diff
changeset
|
313 |
f6cdf5f72479
Add a row-activation event for the Pounces dialog to open a new conversation window.
salinasv@gmail.com
parents:
27344
diff
changeset
|
314 purple_conversation_new(PURPLE_CONV_TYPE_IM, account, |
f6cdf5f72479
Add a row-activation event for the Pounces dialog to open a new conversation window.
salinasv@gmail.com
parents:
27344
diff
changeset
|
315 purple_account_get_username(account)); |
f6cdf5f72479
Add a row-activation event for the Pounces dialog to open a new conversation window.
salinasv@gmail.com
parents:
27344
diff
changeset
|
316 |
f6cdf5f72479
Add a row-activation event for the Pounces dialog to open a new conversation window.
salinasv@gmail.com
parents:
27344
diff
changeset
|
317 pounce_response_dismiss(); |
f6cdf5f72479
Add a row-activation event for the Pounces dialog to open a new conversation window.
salinasv@gmail.com
parents:
27344
diff
changeset
|
318 } |
f6cdf5f72479
Add a row-activation event for the Pounces dialog to open a new conversation window.
salinasv@gmail.com
parents:
27344
diff
changeset
|
319 |
f6cdf5f72479
Add a row-activation event for the Pounces dialog to open a new conversation window.
salinasv@gmail.com
parents:
27344
diff
changeset
|
320 static void |
27338
c245c583a1a6
Remove a few layers of evil abstraction.
Paul Aurich <paul@darkrain42.org>
parents:
27337
diff
changeset
|
321 reset_mail_dialog(GtkDialog *unused) |
c245c583a1a6
Remove a few layers of evil abstraction.
Paul Aurich <paul@darkrain42.org>
parents:
27337
diff
changeset
|
322 { |
c245c583a1a6
Remove a few layers of evil abstraction.
Paul Aurich <paul@darkrain42.org>
parents:
27337
diff
changeset
|
323 if (mail_dialog->in_use) |
c245c583a1a6
Remove a few layers of evil abstraction.
Paul Aurich <paul@darkrain42.org>
parents:
27337
diff
changeset
|
324 return; |
c245c583a1a6
Remove a few layers of evil abstraction.
Paul Aurich <paul@darkrain42.org>
parents:
27337
diff
changeset
|
325 gtk_widget_destroy(mail_dialog->dialog); |
c245c583a1a6
Remove a few layers of evil abstraction.
Paul Aurich <paul@darkrain42.org>
parents:
27337
diff
changeset
|
326 g_free(mail_dialog); |
c245c583a1a6
Remove a few layers of evil abstraction.
Paul Aurich <paul@darkrain42.org>
parents:
27337
diff
changeset
|
327 mail_dialog = NULL; |
c245c583a1a6
Remove a few layers of evil abstraction.
Paul Aurich <paul@darkrain42.org>
parents:
27337
diff
changeset
|
328 } |
c245c583a1a6
Remove a few layers of evil abstraction.
Paul Aurich <paul@darkrain42.org>
parents:
27337
diff
changeset
|
329 |
c245c583a1a6
Remove a few layers of evil abstraction.
Paul Aurich <paul@darkrain42.org>
parents:
27337
diff
changeset
|
330 static void |
27344
975a29213f35
Use mail_dialog consistently, instead of switching from one line to the next. Various other cleanups, too.
Paul Aurich <paul@darkrain42.org>
parents:
27342
diff
changeset
|
331 email_response_cb(GtkDialog *unused, gint id, PidginNotifyDialog *unused2) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
332 { |
15821 | 333 PidginNotifyMailData *data = NULL; |
27344
975a29213f35
Use mail_dialog consistently, instead of switching from one line to the next. Various other cleanups, too.
Paul Aurich <paul@darkrain42.org>
parents:
27342
diff
changeset
|
334 GtkTreeModel *model = GTK_TREE_MODEL(mail_dialog->treemodel); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
335 GtkTreeIter iter; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
336 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
337 if (id == GTK_RESPONSE_YES) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
338 { |
27325
ecdc58da4cdd
Clear the notifications via a signal instead of pidgin_close_notify.
Paul Aurich <paul@darkrain42.org>
parents:
27318
diff
changeset
|
339 /* A single row activated. Remove that row. */ |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
340 GtkTreeSelection *selection; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
341 |
27344
975a29213f35
Use mail_dialog consistently, instead of switching from one line to the next. Various other cleanups, too.
Paul Aurich <paul@darkrain42.org>
parents:
27342
diff
changeset
|
342 selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(mail_dialog->treeview)); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
343 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
344 if (gtk_tree_selection_get_selected(selection, NULL, &iter)) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
345 { |
27344
975a29213f35
Use mail_dialog consistently, instead of switching from one line to the next. Various other cleanups, too.
Paul Aurich <paul@darkrain42.org>
parents:
27342
diff
changeset
|
346 gtk_tree_model_get(model, &iter, PIDGIN_MAIL_DATA, &data, -1); |
15823 | 347 purple_notify_uri(NULL, data->url); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
348 |
27344
975a29213f35
Use mail_dialog consistently, instead of switching from one line to the next. Various other cleanups, too.
Paul Aurich <paul@darkrain42.org>
parents:
27342
diff
changeset
|
349 gtk_tree_store_remove(mail_dialog->treemodel, &iter); |
23927
128f1d7e12ff
Some cleanup and a little leak fix that I thought I committed a while ago.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
23926
diff
changeset
|
350 if (data->purple_has_handle) |
128f1d7e12ff
Some cleanup and a little leak fix that I thought I committed a while ago.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
23926
diff
changeset
|
351 purple_notify_close(PURPLE_NOTIFY_EMAILS, data); |
128f1d7e12ff
Some cleanup and a little leak fix that I thought I committed a while ago.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
23926
diff
changeset
|
352 else |
128f1d7e12ff
Some cleanup and a little leak fix that I thought I committed a while ago.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
23926
diff
changeset
|
353 pidgin_close_notify(PURPLE_NOTIFY_EMAILS, data); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
354 |
27344
975a29213f35
Use mail_dialog consistently, instead of switching from one line to the next. Various other cleanups, too.
Paul Aurich <paul@darkrain42.org>
parents:
27342
diff
changeset
|
355 if (gtk_tree_model_get_iter_first(model, &iter)) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
356 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
357 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
358 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
359 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
360 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
361 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
362 { |
27325
ecdc58da4cdd
Clear the notifications via a signal instead of pidgin_close_notify.
Paul Aurich <paul@darkrain42.org>
parents:
27318
diff
changeset
|
363 /* Remove all the rows */ |
27344
975a29213f35
Use mail_dialog consistently, instead of switching from one line to the next. Various other cleanups, too.
Paul Aurich <paul@darkrain42.org>
parents:
27342
diff
changeset
|
364 while (gtk_tree_model_get_iter_first(model, &iter)) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
365 { |
27344
975a29213f35
Use mail_dialog consistently, instead of switching from one line to the next. Various other cleanups, too.
Paul Aurich <paul@darkrain42.org>
parents:
27342
diff
changeset
|
366 gtk_tree_model_get(model, &iter, PIDGIN_MAIL_DATA, &data, -1); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
367 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
368 if (id == GTK_RESPONSE_ACCEPT) |
15823 | 369 purple_notify_uri(NULL, data->url); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
370 |
27344
975a29213f35
Use mail_dialog consistently, instead of switching from one line to the next. Various other cleanups, too.
Paul Aurich <paul@darkrain42.org>
parents:
27342
diff
changeset
|
371 gtk_tree_store_remove(mail_dialog->treemodel, &iter); |
22826
66914f306712
More plumbing work.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22208
diff
changeset
|
372 if (data->purple_has_handle) |
66914f306712
More plumbing work.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22208
diff
changeset
|
373 purple_notify_close(PURPLE_NOTIFY_EMAILS, data); |
66914f306712
More plumbing work.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22208
diff
changeset
|
374 else |
66914f306712
More plumbing work.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22208
diff
changeset
|
375 pidgin_close_notify(PURPLE_NOTIFY_EMAILS, data); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
376 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
377 } |
27338
c245c583a1a6
Remove a few layers of evil abstraction.
Paul Aurich <paul@darkrain42.org>
parents:
27337
diff
changeset
|
378 |
c245c583a1a6
Remove a few layers of evil abstraction.
Paul Aurich <paul@darkrain42.org>
parents:
27337
diff
changeset
|
379 reset_mail_dialog(NULL); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
380 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
381 |
27344
975a29213f35
Use mail_dialog consistently, instead of switching from one line to the next. Various other cleanups, too.
Paul Aurich <paul@darkrain42.org>
parents:
27342
diff
changeset
|
382 static void |
975a29213f35
Use mail_dialog consistently, instead of switching from one line to the next. Various other cleanups, too.
Paul Aurich <paul@darkrain42.org>
parents:
27342
diff
changeset
|
383 email_row_activated_cb(GtkTreeView *tv, GtkTreePath *path, |
975a29213f35
Use mail_dialog consistently, instead of switching from one line to the next. Various other cleanups, too.
Paul Aurich <paul@darkrain42.org>
parents:
27342
diff
changeset
|
384 GtkTreeViewColumn *col, gpointer data) |
975a29213f35
Use mail_dialog consistently, instead of switching from one line to the next. Various other cleanups, too.
Paul Aurich <paul@darkrain42.org>
parents:
27342
diff
changeset
|
385 { |
975a29213f35
Use mail_dialog consistently, instead of switching from one line to the next. Various other cleanups, too.
Paul Aurich <paul@darkrain42.org>
parents:
27342
diff
changeset
|
386 email_response_cb(NULL, GTK_RESPONSE_YES, NULL); |
19316
c5898e7d70fa
Open emails by doubleclicking the row.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18860
diff
changeset
|
387 } |
c5898e7d70fa
Open emails by doubleclicking the row.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18860
diff
changeset
|
388 |
21913
2a591a5b3322
Make some more event handlers return appropriate gboolean values. This turns
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21888
diff
changeset
|
389 static gboolean |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
390 formatted_close_cb(GtkWidget *win, GdkEvent *event, void *user_data) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
391 { |
15823 | 392 purple_notify_close(PURPLE_NOTIFY_FORMATTED, win); |
21913
2a591a5b3322
Make some more event handlers return appropriate gboolean values. This turns
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21888
diff
changeset
|
393 return FALSE; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
394 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
395 |
21913
2a591a5b3322
Make some more event handlers return appropriate gboolean values. This turns
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21888
diff
changeset
|
396 static gboolean |
15821 | 397 searchresults_close_cb(PidginNotifySearchResultsData *data, GdkEvent *event, gpointer user_data) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
398 { |
15823 | 399 purple_notify_close(PURPLE_NOTIFY_SEARCHRESULTS, data); |
21913
2a591a5b3322
Make some more event handlers return appropriate gboolean values. This turns
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21888
diff
changeset
|
400 return FALSE; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
401 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
402 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
403 static void |
15821 | 404 searchresults_callback_wrapper_cb(GtkWidget *widget, PidginNotifySearchResultsButtonData *bd) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
405 { |
15821 | 406 PidginNotifySearchResultsData *data = bd->data; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
407 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
408 GtkTreeSelection *selection; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
409 GtkTreeModel *model; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
410 GtkTreeIter iter; |
15823 | 411 PurpleNotifySearchButton *button; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
412 GList *row = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
413 gchar *str; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
414 int i; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
415 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
416 g_return_if_fail(data != NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
417 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
418 selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(data->treeview)); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
419 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
420 if (gtk_tree_selection_get_selected(selection, &model, &iter)) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
421 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
422 for (i = 1; i < gtk_tree_model_get_n_columns(GTK_TREE_MODEL(model)); i++) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
423 gtk_tree_model_get(GTK_TREE_MODEL(model), &iter, i, &str, -1); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
424 row = g_list_append(row, str); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
425 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
426 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
427 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
428 button = bd->button; |
15823 | 429 button->callback(purple_account_get_connection(data->account), row, data->user_data); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
430 g_list_foreach(row, (GFunc)g_free, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
431 g_list_free(row); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
432 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
433 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
434 static void * |
15823 | 435 pidgin_notify_message(PurpleNotifyMsgType type, const char *title, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
436 const char *primary, const char *secondary) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
437 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
438 GtkWidget *dialog; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
439 GtkWidget *hbox; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
440 GtkWidget *label; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
441 GtkWidget *img = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
442 char label_text[2048]; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
443 const char *icon_name = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
444 char *primary_esc, *secondary_esc; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
445 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
446 switch (type) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
447 { |
15823 | 448 case PURPLE_NOTIFY_MSG_ERROR: |
15436 | 449 icon_name = PIDGIN_STOCK_DIALOG_ERROR; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
450 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
451 |
15823 | 452 case PURPLE_NOTIFY_MSG_WARNING: |
15436 | 453 icon_name = PIDGIN_STOCK_DIALOG_WARNING; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
454 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
455 |
15823 | 456 case PURPLE_NOTIFY_MSG_INFO: |
15436 | 457 icon_name = PIDGIN_STOCK_DIALOG_INFO; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
458 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
459 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
460 default: |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
461 icon_name = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
462 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
463 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
464 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
465 if (icon_name != NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
466 { |
15436 | 467 img = gtk_image_new_from_stock(icon_name, gtk_icon_size_from_name(PIDGIN_ICON_SIZE_TANGO_HUGE)); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
468 gtk_misc_set_alignment(GTK_MISC(img), 0, 0); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
469 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
470 |
15821 | 471 dialog = gtk_dialog_new_with_buttons(title ? title : PIDGIN_ALERT_TITLE, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
472 NULL, 0, GTK_STOCK_CLOSE, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
473 GTK_RESPONSE_CLOSE, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
474 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
475 gtk_window_set_role(GTK_WINDOW(dialog), "notify_dialog"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
476 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
477 g_signal_connect(G_OBJECT(dialog), "response", |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
478 G_CALLBACK(message_response_cb), dialog); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
479 |
15821 | 480 gtk_container_set_border_width(GTK_CONTAINER(dialog), PIDGIN_HIG_BORDER); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
481 gtk_window_set_resizable(GTK_WINDOW(dialog), FALSE); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
482 gtk_dialog_set_has_separator(GTK_DIALOG(dialog), FALSE); |
15821 | 483 gtk_box_set_spacing(GTK_BOX(GTK_DIALOG(dialog)->vbox), PIDGIN_HIG_BORDER); |
484 gtk_container_set_border_width(GTK_CONTAINER(GTK_DIALOG(dialog)->vbox), PIDGIN_HIG_BOX_SPACE); | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
485 |
15821 | 486 hbox = gtk_hbox_new(FALSE, PIDGIN_HIG_BORDER); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
487 gtk_container_add(GTK_CONTAINER(GTK_DIALOG(dialog)->vbox), hbox); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
488 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
489 if (img != NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
490 gtk_box_pack_start(GTK_BOX(hbox), img, FALSE, FALSE, 0); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
491 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
492 primary_esc = g_markup_escape_text(primary, -1); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
493 secondary_esc = (secondary != NULL) ? g_markup_escape_text(secondary, -1) : NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
494 g_snprintf(label_text, sizeof(label_text), |
21198
b6136fd465a0
If there is no secondary text in a notify, avoid adding "\n\n" and creating
Richard Laager <rlaager@wiktel.com>
parents:
20740
diff
changeset
|
495 "<span weight=\"bold\" size=\"larger\">%s</span>%s%s", |
b6136fd465a0
If there is no secondary text in a notify, avoid adding "\n\n" and creating
Richard Laager <rlaager@wiktel.com>
parents:
20740
diff
changeset
|
496 primary_esc, (secondary ? "\n\n" : ""), |
b6136fd465a0
If there is no secondary text in a notify, avoid adding "\n\n" and creating
Richard Laager <rlaager@wiktel.com>
parents:
20740
diff
changeset
|
497 (secondary ? secondary_esc : "")); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
498 g_free(primary_esc); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
499 g_free(secondary_esc); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
500 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
501 label = gtk_label_new(NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
502 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
503 gtk_label_set_markup(GTK_LABEL(label), label_text); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
504 gtk_label_set_line_wrap(GTK_LABEL(label), TRUE); |
18860
0a8dc9eb4f8e
Allow notification labels to be selectable (for copy-and-paste purposes). Fixes #563.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18547
diff
changeset
|
505 gtk_label_set_selectable(GTK_LABEL(label), TRUE); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
506 gtk_misc_set_alignment(GTK_MISC(label), 0, 0); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
507 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
508 |
21888
c88a3f2dbb52
Try to make a window transient for a suitable parent window. This currently
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21227
diff
changeset
|
509 pidgin_auto_parent_window(dialog); |
c88a3f2dbb52
Try to make a window transient for a suitable parent window. This currently
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21227
diff
changeset
|
510 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
511 gtk_widget_show_all(dialog); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
512 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
513 return dialog; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
514 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
515 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
516 static void |
27339
c7768f23f519
Remove the PidginMailDialog typedef.
Paul Aurich <paul@darkrain42.org>
parents:
27338
diff
changeset
|
517 selection_changed_cb(GtkTreeSelection *sel, PidginNotifyDialog *dialog) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
518 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
519 GtkTreeIter iter; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
520 GtkTreeModel *model; |
15821 | 521 PidginNotifyMailData *data; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
522 gboolean active = TRUE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
523 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
524 if (gtk_tree_selection_get_selected(sel, &model, &iter) == FALSE) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
525 active = FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
526 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
527 { |
15820
c02a897a67c7
More Gaim to Pidgin changes
Sean Egan <seanegan@gmail.com>
parents:
15735
diff
changeset
|
528 gtk_tree_model_get(model, &iter, PIDGIN_MAIL_DATA, &data, -1); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
529 if (data->url == NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
530 active = FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
531 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
532 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
533 gtk_widget_set_sensitive(dialog->open_button, active); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
534 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
535 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
536 static void * |
15823 | 537 pidgin_notify_email(PurpleConnection *gc, const char *subject, const char *from, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
538 const char *to, const char *url) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
539 { |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15436
diff
changeset
|
540 return pidgin_notify_emails(gc, 1, (subject != NULL), |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
541 (subject == NULL ? NULL : &subject), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
542 (from == NULL ? NULL : &from), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
543 (to == NULL ? NULL : &to), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
544 (url == NULL ? NULL : &url)); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
545 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
546 |
15735
427ca6a0aa87
Fix the last change.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
15734
diff
changeset
|
547 static int |
427ca6a0aa87
Fix the last change.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
15734
diff
changeset
|
548 mail_window_focus_cb(GtkWidget *widget, GdkEventFocus *focus, gpointer null) |
427ca6a0aa87
Fix the last change.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
15734
diff
changeset
|
549 { |
427ca6a0aa87
Fix the last change.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
15734
diff
changeset
|
550 pidgin_set_urgent(GTK_WINDOW(widget), FALSE); |
427ca6a0aa87
Fix the last change.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
15734
diff
changeset
|
551 return 0; |
427ca6a0aa87
Fix the last change.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
15734
diff
changeset
|
552 } |
427ca6a0aa87
Fix the last change.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
15734
diff
changeset
|
553 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
554 /* count == 0 means this is a detailed mail notification. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
555 * count > 0 mean non-detailed. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
556 */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
557 static void * |
22840
502bac8b2b4c
Fix a double free caused by my previous leak fix not covering all possible
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22826
diff
changeset
|
558 pidgin_notify_add_mail(GtkTreeStore *treemodel, PurpleAccount *account, char *notification, const char *url, int count, gboolean clear, gboolean *new_data) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
559 { |
15821 | 560 PidginNotifyMailData *data = NULL; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
561 GtkTreeIter iter; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
562 GdkPixbuf *icon; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
563 gboolean new_n = TRUE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
564 |
20217
d4e250c3cd44
applied changes from 4bb1d6cbfe69a2e7782336a7e6e93e438a8bdbfc
Richard Laager <rlaager@wiktel.com>
parents:
19680
diff
changeset
|
565 if (count > 0 || clear) { |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
566 /* Allow only one non-detailed email notification for each account */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
567 if (gtk_tree_model_get_iter_first(GTK_TREE_MODEL(treemodel), &iter)) { |
20217
d4e250c3cd44
applied changes from 4bb1d6cbfe69a2e7782336a7e6e93e438a8bdbfc
Richard Laager <rlaager@wiktel.com>
parents:
19680
diff
changeset
|
568 gboolean advanced; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
569 do { |
20217
d4e250c3cd44
applied changes from 4bb1d6cbfe69a2e7782336a7e6e93e438a8bdbfc
Richard Laager <rlaager@wiktel.com>
parents:
19680
diff
changeset
|
570 advanced = FALSE; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
571 gtk_tree_model_get(GTK_TREE_MODEL(treemodel), &iter, |
15820
c02a897a67c7
More Gaim to Pidgin changes
Sean Egan <seanegan@gmail.com>
parents:
15735
diff
changeset
|
572 PIDGIN_MAIL_DATA, &data, -1); |
27318
8ecd6945a96a
Avoid a null deref when clearing mail notifications. Refs #9345.
Paul Aurich <paul@darkrain42.org>
parents:
27268
diff
changeset
|
573 if (data && data->account == account) { |
20217
d4e250c3cd44
applied changes from 4bb1d6cbfe69a2e7782336a7e6e93e438a8bdbfc
Richard Laager <rlaager@wiktel.com>
parents:
19680
diff
changeset
|
574 if (clear) { |
20290
008865326919
Fix building on very old gtk where gtk_tree_store_remove didn't return a
Stu Tomlinson <stu@nosnilmot.com>
parents:
20253
diff
changeset
|
575 #if GTK_CHECK_VERSION(2,2,0) |
20217
d4e250c3cd44
applied changes from 4bb1d6cbfe69a2e7782336a7e6e93e438a8bdbfc
Richard Laager <rlaager@wiktel.com>
parents:
19680
diff
changeset
|
576 advanced = gtk_tree_store_remove(treemodel, &iter); |
20290
008865326919
Fix building on very old gtk where gtk_tree_store_remove didn't return a
Stu Tomlinson <stu@nosnilmot.com>
parents:
20253
diff
changeset
|
577 #else |
008865326919
Fix building on very old gtk where gtk_tree_store_remove didn't return a
Stu Tomlinson <stu@nosnilmot.com>
parents:
20253
diff
changeset
|
578 gtk_tree_store_remove(treemodel, &iter); |
008865326919
Fix building on very old gtk where gtk_tree_store_remove didn't return a
Stu Tomlinson <stu@nosnilmot.com>
parents:
20253
diff
changeset
|
579 advanced = (iter.stamp == 0) ? FALSE : TRUE; |
008865326919
Fix building on very old gtk where gtk_tree_store_remove didn't return a
Stu Tomlinson <stu@nosnilmot.com>
parents:
20253
diff
changeset
|
580 #endif |
27342
8796eaaca38a
Fix the mail_dialog->total_count and use that to tell when the dialog is empty.
Paul Aurich <paul@darkrain42.org>
parents:
27340
diff
changeset
|
581 mail_dialog->total_count -= data->count; |
8796eaaca38a
Fix the mail_dialog->total_count and use that to tell when the dialog is empty.
Paul Aurich <paul@darkrain42.org>
parents:
27340
diff
changeset
|
582 |
27268
25db53cfc12c
Make sure uninitialized variable is not used. This might fix #9345,
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
27117
diff
changeset
|
583 if (data->purple_has_handle) |
25db53cfc12c
Make sure uninitialized variable is not used. This might fix #9345,
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
27117
diff
changeset
|
584 purple_notify_close(PURPLE_NOTIFY_EMAILS, data); |
25db53cfc12c
Make sure uninitialized variable is not used. This might fix #9345,
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
27117
diff
changeset
|
585 else |
25db53cfc12c
Make sure uninitialized variable is not used. This might fix #9345,
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
27117
diff
changeset
|
586 pidgin_close_notify(PURPLE_NOTIFY_EMAILS, data); |
20217
d4e250c3cd44
applied changes from 4bb1d6cbfe69a2e7782336a7e6e93e438a8bdbfc
Richard Laager <rlaager@wiktel.com>
parents:
19680
diff
changeset
|
587 /* We're completely done if we've processed all entries */ |
d4e250c3cd44
applied changes from 4bb1d6cbfe69a2e7782336a7e6e93e438a8bdbfc
Richard Laager <rlaager@wiktel.com>
parents:
19680
diff
changeset
|
588 if (!advanced) |
d4e250c3cd44
applied changes from 4bb1d6cbfe69a2e7782336a7e6e93e438a8bdbfc
Richard Laager <rlaager@wiktel.com>
parents:
19680
diff
changeset
|
589 return NULL; |
d4e250c3cd44
applied changes from 4bb1d6cbfe69a2e7782336a7e6e93e438a8bdbfc
Richard Laager <rlaager@wiktel.com>
parents:
19680
diff
changeset
|
590 } else if (data->count > 0) { |
d4e250c3cd44
applied changes from 4bb1d6cbfe69a2e7782336a7e6e93e438a8bdbfc
Richard Laager <rlaager@wiktel.com>
parents:
19680
diff
changeset
|
591 new_n = FALSE; |
d4e250c3cd44
applied changes from 4bb1d6cbfe69a2e7782336a7e6e93e438a8bdbfc
Richard Laager <rlaager@wiktel.com>
parents:
19680
diff
changeset
|
592 g_free(data->url); |
d4e250c3cd44
applied changes from 4bb1d6cbfe69a2e7782336a7e6e93e438a8bdbfc
Richard Laager <rlaager@wiktel.com>
parents:
19680
diff
changeset
|
593 data->url = NULL; |
d4e250c3cd44
applied changes from 4bb1d6cbfe69a2e7782336a7e6e93e438a8bdbfc
Richard Laager <rlaager@wiktel.com>
parents:
19680
diff
changeset
|
594 mail_dialog->total_count -= data->count; |
d4e250c3cd44
applied changes from 4bb1d6cbfe69a2e7782336a7e6e93e438a8bdbfc
Richard Laager <rlaager@wiktel.com>
parents:
19680
diff
changeset
|
595 break; |
d4e250c3cd44
applied changes from 4bb1d6cbfe69a2e7782336a7e6e93e438a8bdbfc
Richard Laager <rlaager@wiktel.com>
parents:
19680
diff
changeset
|
596 } |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
597 } |
20217
d4e250c3cd44
applied changes from 4bb1d6cbfe69a2e7782336a7e6e93e438a8bdbfc
Richard Laager <rlaager@wiktel.com>
parents:
19680
diff
changeset
|
598 } while (advanced || gtk_tree_model_iter_next(GTK_TREE_MODEL(treemodel), &iter)); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
599 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
600 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
601 |
20253
6f4defb6f399
applied changes from c0104c111e903cfec5d0a95e0ae9dafb72f0dcbf
Richard Laager <rlaager@wiktel.com>
parents:
20251
diff
changeset
|
602 if (clear) |
6f4defb6f399
applied changes from c0104c111e903cfec5d0a95e0ae9dafb72f0dcbf
Richard Laager <rlaager@wiktel.com>
parents:
20251
diff
changeset
|
603 return NULL; |
6f4defb6f399
applied changes from c0104c111e903cfec5d0a95e0ae9dafb72f0dcbf
Richard Laager <rlaager@wiktel.com>
parents:
20251
diff
changeset
|
604 |
6f4defb6f399
applied changes from c0104c111e903cfec5d0a95e0ae9dafb72f0dcbf
Richard Laager <rlaager@wiktel.com>
parents:
20251
diff
changeset
|
605 icon = pidgin_create_prpl_icon(account, PIDGIN_PRPL_ICON_MEDIUM); |
6f4defb6f399
applied changes from c0104c111e903cfec5d0a95e0ae9dafb72f0dcbf
Richard Laager <rlaager@wiktel.com>
parents:
20251
diff
changeset
|
606 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
607 if (new_n) { |
15821 | 608 data = g_new0(PidginNotifyMailData, 1); |
22826
66914f306712
More plumbing work.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22208
diff
changeset
|
609 data->purple_has_handle = TRUE; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
610 gtk_tree_store_append(treemodel, &iter, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
611 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
612 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
613 if (url != NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
614 data->url = g_strdup(url); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
615 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
616 gtk_tree_store_set(treemodel, &iter, |
15820
c02a897a67c7
More Gaim to Pidgin changes
Sean Egan <seanegan@gmail.com>
parents:
15735
diff
changeset
|
617 PIDGIN_MAIL_ICON, icon, |
c02a897a67c7
More Gaim to Pidgin changes
Sean Egan <seanegan@gmail.com>
parents:
15735
diff
changeset
|
618 PIDGIN_MAIL_TEXT, notification, |
c02a897a67c7
More Gaim to Pidgin changes
Sean Egan <seanegan@gmail.com>
parents:
15735
diff
changeset
|
619 PIDGIN_MAIL_DATA, data, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
620 -1); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
621 data->account = account; |
27342
8796eaaca38a
Fix the mail_dialog->total_count and use that to tell when the dialog is empty.
Paul Aurich <paul@darkrain42.org>
parents:
27340
diff
changeset
|
622 /* count == 0 indicates we're adding a single detailed e-mail */ |
8796eaaca38a
Fix the mail_dialog->total_count and use that to tell when the dialog is empty.
Paul Aurich <paul@darkrain42.org>
parents:
27340
diff
changeset
|
623 data->count = count > 0 ? count : 1; |
22826
66914f306712
More plumbing work.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22208
diff
changeset
|
624 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
625 if (icon) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
626 g_object_unref(icon); |
22840
502bac8b2b4c
Fix a double free caused by my previous leak fix not covering all possible
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22826
diff
changeset
|
627 |
502bac8b2b4c
Fix a double free caused by my previous leak fix not covering all possible
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22826
diff
changeset
|
628 if (new_data) |
502bac8b2b4c
Fix a double free caused by my previous leak fix not covering all possible
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22826
diff
changeset
|
629 *new_data = new_n; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
630 return data; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
631 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
632 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
633 static void * |
15823 | 634 pidgin_notify_emails(PurpleConnection *gc, size_t count, gboolean detailed, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
635 const char **subjects, const char **froms, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
636 const char **tos, const char **urls) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
637 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
638 char *notification; |
15823 | 639 PurpleAccount *account; |
22840
502bac8b2b4c
Fix a double free caused by my previous leak fix not covering all possible
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22826
diff
changeset
|
640 PidginNotifyMailData *data = NULL, *data2; |
27268
25db53cfc12c
Make sure uninitialized variable is not used. This might fix #9345,
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
27117
diff
changeset
|
641 gboolean new_data = FALSE; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
642 |
20217
d4e250c3cd44
applied changes from 4bb1d6cbfe69a2e7782336a7e6e93e438a8bdbfc
Richard Laager <rlaager@wiktel.com>
parents:
19680
diff
changeset
|
643 /* Don't bother updating if there aren't new emails and we don't have any displayed currently */ |
d4e250c3cd44
applied changes from 4bb1d6cbfe69a2e7782336a7e6e93e438a8bdbfc
Richard Laager <rlaager@wiktel.com>
parents:
19680
diff
changeset
|
644 if (count == 0 && mail_dialog == NULL) |
d4e250c3cd44
applied changes from 4bb1d6cbfe69a2e7782336a7e6e93e438a8bdbfc
Richard Laager <rlaager@wiktel.com>
parents:
19680
diff
changeset
|
645 return NULL; |
d4e250c3cd44
applied changes from 4bb1d6cbfe69a2e7782336a7e6e93e438a8bdbfc
Richard Laager <rlaager@wiktel.com>
parents:
19680
diff
changeset
|
646 |
15823 | 647 account = purple_connection_get_account(gc); |
27344
975a29213f35
Use mail_dialog consistently, instead of switching from one line to the next. Various other cleanups, too.
Paul Aurich <paul@darkrain42.org>
parents:
27342
diff
changeset
|
648 if (mail_dialog == NULL) |
975a29213f35
Use mail_dialog consistently, instead of switching from one line to the next. Various other cleanups, too.
Paul Aurich <paul@darkrain42.org>
parents:
27342
diff
changeset
|
649 mail_dialog = pidgin_create_notification_dialog(PIDGIN_NOTIFY_MAIL); |
20217
d4e250c3cd44
applied changes from 4bb1d6cbfe69a2e7782336a7e6e93e438a8bdbfc
Richard Laager <rlaager@wiktel.com>
parents:
19680
diff
changeset
|
650 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
651 mail_dialog->total_count += count; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
652 if (detailed) { |
27342
8796eaaca38a
Fix the mail_dialog->total_count and use that to tell when the dialog is empty.
Paul Aurich <paul@darkrain42.org>
parents:
27340
diff
changeset
|
653 for ( ; count; --count) { |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
654 char *to_text = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
655 char *from_text = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
656 char *subject_text = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
657 char *tmp; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
658 gboolean first = TRUE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
659 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
660 if (tos != NULL) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
661 tmp = g_markup_escape_text(*tos, -1); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
662 to_text = g_strdup_printf("<b>%s</b>: %s\n", _("Account"), tmp); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
663 g_free(tmp); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
664 first = FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
665 tos++; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
666 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
667 if (froms != NULL) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
668 tmp = g_markup_escape_text(*froms, -1); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
669 from_text = g_strdup_printf("%s<b>%s</b>: %s\n", first ? "<br>" : "", _("Sender"), tmp); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
670 g_free(tmp); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
671 first = FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
672 froms++; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
673 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
674 if (subjects != NULL) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
675 tmp = g_markup_escape_text(*subjects, -1); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
676 subject_text = g_strdup_printf("%s<b>%s</b>: %s", first ? "<br>" : "", _("Subject"), tmp); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
677 g_free(tmp); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
678 first = FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
679 subjects++; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
680 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
681 #define SAFE(x) ((x) ? (x) : "") |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
682 notification = g_strdup_printf("%s%s%s", SAFE(to_text), SAFE(from_text), SAFE(subject_text)); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
683 #undef SAFE |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
684 g_free(to_text); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
685 g_free(from_text); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
686 g_free(subject_text); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
687 |
22826
66914f306712
More plumbing work.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22208
diff
changeset
|
688 /* If we don't keep track of this, will leak "data" for each of the notifications except the last */ |
22840
502bac8b2b4c
Fix a double free caused by my previous leak fix not covering all possible
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22826
diff
changeset
|
689 data2 = pidgin_notify_add_mail(mail_dialog->treemodel, account, notification, urls ? *urls : NULL, 0, FALSE, &new_data); |
27268
25db53cfc12c
Make sure uninitialized variable is not used. This might fix #9345,
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
27117
diff
changeset
|
690 if (data2 && new_data) { |
22840
502bac8b2b4c
Fix a double free caused by my previous leak fix not covering all possible
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22826
diff
changeset
|
691 if (data) |
502bac8b2b4c
Fix a double free caused by my previous leak fix not covering all possible
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22826
diff
changeset
|
692 data->purple_has_handle = FALSE; |
502bac8b2b4c
Fix a double free caused by my previous leak fix not covering all possible
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22826
diff
changeset
|
693 data = data2; |
502bac8b2b4c
Fix a double free caused by my previous leak fix not covering all possible
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22826
diff
changeset
|
694 } |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
695 g_free(notification); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
696 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
697 if (urls != NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
698 urls++; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
699 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
700 } else { |
20217
d4e250c3cd44
applied changes from 4bb1d6cbfe69a2e7782336a7e6e93e438a8bdbfc
Richard Laager <rlaager@wiktel.com>
parents:
19680
diff
changeset
|
701 if (count > 0) { |
d4e250c3cd44
applied changes from 4bb1d6cbfe69a2e7782336a7e6e93e438a8bdbfc
Richard Laager <rlaager@wiktel.com>
parents:
19680
diff
changeset
|
702 notification = g_strdup_printf(ngettext("%s has %d new message.", |
d4e250c3cd44
applied changes from 4bb1d6cbfe69a2e7782336a7e6e93e438a8bdbfc
Richard Laager <rlaager@wiktel.com>
parents:
19680
diff
changeset
|
703 "%s has %d new messages.", |
d4e250c3cd44
applied changes from 4bb1d6cbfe69a2e7782336a7e6e93e438a8bdbfc
Richard Laager <rlaager@wiktel.com>
parents:
19680
diff
changeset
|
704 (int)count), |
d4e250c3cd44
applied changes from 4bb1d6cbfe69a2e7782336a7e6e93e438a8bdbfc
Richard Laager <rlaager@wiktel.com>
parents:
19680
diff
changeset
|
705 *tos, (int)count); |
22840
502bac8b2b4c
Fix a double free caused by my previous leak fix not covering all possible
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22826
diff
changeset
|
706 data2 = pidgin_notify_add_mail(mail_dialog->treemodel, account, notification, urls ? *urls : NULL, count, FALSE, &new_data); |
27268
25db53cfc12c
Make sure uninitialized variable is not used. This might fix #9345,
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
27117
diff
changeset
|
707 if (data2 && new_data) { |
22840
502bac8b2b4c
Fix a double free caused by my previous leak fix not covering all possible
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22826
diff
changeset
|
708 if (data) |
502bac8b2b4c
Fix a double free caused by my previous leak fix not covering all possible
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22826
diff
changeset
|
709 data->purple_has_handle = FALSE; |
502bac8b2b4c
Fix a double free caused by my previous leak fix not covering all possible
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22826
diff
changeset
|
710 data = data2; |
502bac8b2b4c
Fix a double free caused by my previous leak fix not covering all possible
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22826
diff
changeset
|
711 } |
20217
d4e250c3cd44
applied changes from 4bb1d6cbfe69a2e7782336a7e6e93e438a8bdbfc
Richard Laager <rlaager@wiktel.com>
parents:
19680
diff
changeset
|
712 g_free(notification); |
d4e250c3cd44
applied changes from 4bb1d6cbfe69a2e7782336a7e6e93e438a8bdbfc
Richard Laager <rlaager@wiktel.com>
parents:
19680
diff
changeset
|
713 } else { |
d4e250c3cd44
applied changes from 4bb1d6cbfe69a2e7782336a7e6e93e438a8bdbfc
Richard Laager <rlaager@wiktel.com>
parents:
19680
diff
changeset
|
714 /* Clear out all mails for the account */ |
22840
502bac8b2b4c
Fix a double free caused by my previous leak fix not covering all possible
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22826
diff
changeset
|
715 pidgin_notify_add_mail(mail_dialog->treemodel, account, NULL, NULL, 0, TRUE, NULL); |
20217
d4e250c3cd44
applied changes from 4bb1d6cbfe69a2e7782336a7e6e93e438a8bdbfc
Richard Laager <rlaager@wiktel.com>
parents:
19680
diff
changeset
|
716 |
27342
8796eaaca38a
Fix the mail_dialog->total_count and use that to tell when the dialog is empty.
Paul Aurich <paul@darkrain42.org>
parents:
27340
diff
changeset
|
717 if (mail_dialog->total_count == 0) { |
8796eaaca38a
Fix the mail_dialog->total_count and use that to tell when the dialog is empty.
Paul Aurich <paul@darkrain42.org>
parents:
27340
diff
changeset
|
718 /* |
8796eaaca38a
Fix the mail_dialog->total_count and use that to tell when the dialog is empty.
Paul Aurich <paul@darkrain42.org>
parents:
27340
diff
changeset
|
719 * There is no API to clear the headline specifically |
8796eaaca38a
Fix the mail_dialog->total_count and use that to tell when the dialog is empty.
Paul Aurich <paul@darkrain42.org>
parents:
27340
diff
changeset
|
720 * This will trigger reset_mail_dialog() |
8796eaaca38a
Fix the mail_dialog->total_count and use that to tell when the dialog is empty.
Paul Aurich <paul@darkrain42.org>
parents:
27340
diff
changeset
|
721 */ |
20217
d4e250c3cd44
applied changes from 4bb1d6cbfe69a2e7782336a7e6e93e438a8bdbfc
Richard Laager <rlaager@wiktel.com>
parents:
19680
diff
changeset
|
722 pidgin_blist_set_headline(NULL, NULL, NULL, NULL, NULL); |
20253
6f4defb6f399
applied changes from c0104c111e903cfec5d0a95e0ae9dafb72f0dcbf
Richard Laager <rlaager@wiktel.com>
parents:
20251
diff
changeset
|
723 return NULL; |
20217
d4e250c3cd44
applied changes from 4bb1d6cbfe69a2e7782336a7e6e93e438a8bdbfc
Richard Laager <rlaager@wiktel.com>
parents:
19680
diff
changeset
|
724 } |
d4e250c3cd44
applied changes from 4bb1d6cbfe69a2e7782336a7e6e93e438a8bdbfc
Richard Laager <rlaager@wiktel.com>
parents:
19680
diff
changeset
|
725 } |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
726 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
727 |
27344
975a29213f35
Use mail_dialog consistently, instead of switching from one line to the next. Various other cleanups, too.
Paul Aurich <paul@darkrain42.org>
parents:
27342
diff
changeset
|
728 if (!GTK_WIDGET_VISIBLE(mail_dialog->dialog)) { |
975a29213f35
Use mail_dialog consistently, instead of switching from one line to the next. Various other cleanups, too.
Paul Aurich <paul@darkrain42.org>
parents:
27342
diff
changeset
|
729 GdkPixbuf *pixbuf = gtk_widget_render_icon(mail_dialog->dialog, PIDGIN_STOCK_DIALOG_MAIL, |
15436 | 730 gtk_icon_size_from_name(PIDGIN_ICON_SIZE_TANGO_EXTRA_SMALL), NULL); |
23182
e0bcb8cfda74
Use "email" and "Email" consistently. This is potentially controversial,
Richard Laager <rlaager@wiktel.com>
parents:
22840
diff
changeset
|
731 char *label_text = g_strdup_printf(ngettext("<b>%d new email.</b>", |
e0bcb8cfda74
Use "email" and "Email" consistently. This is potentially controversial,
Richard Laager <rlaager@wiktel.com>
parents:
22840
diff
changeset
|
732 "<b>%d new emails.</b>", |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
733 mail_dialog->total_count), mail_dialog->total_count); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
734 mail_dialog->in_use = TRUE; /* So that _set_headline doesn't accidentally |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
735 remove the notifications when replacing an |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
736 old notification. */ |
20217
d4e250c3cd44
applied changes from 4bb1d6cbfe69a2e7782336a7e6e93e438a8bdbfc
Richard Laager <rlaager@wiktel.com>
parents:
19680
diff
changeset
|
737 pidgin_blist_set_headline(label_text, |
27344
975a29213f35
Use mail_dialog consistently, instead of switching from one line to the next. Various other cleanups, too.
Paul Aurich <paul@darkrain42.org>
parents:
27342
diff
changeset
|
738 pixbuf, G_CALLBACK(gtk_widget_show_all), mail_dialog->dialog, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
739 (GDestroyNotify)reset_mail_dialog); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
740 mail_dialog->in_use = FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
741 g_free(label_text); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
742 if (pixbuf) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
743 g_object_unref(pixbuf); |
27344
975a29213f35
Use mail_dialog consistently, instead of switching from one line to the next. Various other cleanups, too.
Paul Aurich <paul@darkrain42.org>
parents:
27342
diff
changeset
|
744 } else if (!GTK_WIDGET_HAS_FOCUS(mail_dialog->dialog)) |
975a29213f35
Use mail_dialog consistently, instead of switching from one line to the next. Various other cleanups, too.
Paul Aurich <paul@darkrain42.org>
parents:
27342
diff
changeset
|
745 pidgin_set_urgent(GTK_WINDOW(mail_dialog->dialog), TRUE); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
746 |
22826
66914f306712
More plumbing work.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22208
diff
changeset
|
747 return data; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
748 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
749 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
750 static gboolean |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
751 formatted_input_cb(GtkWidget *win, GdkEventKey *event, gpointer data) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
752 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
753 if (event->keyval == GDK_Escape) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
754 { |
15823 | 755 purple_notify_close(PURPLE_NOTIFY_FORMATTED, win); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
756 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
757 return TRUE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
758 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
759 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
760 return FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
761 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
762 |
16988
563a42d98e3a
Fix ticket #387.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16681
diff
changeset
|
763 static GtkIMHtmlOptions |
22007
c38d72677c8a
Probe for -Wstrict-prototypes to get some more warnings. I then cleaned up
Richard Laager <rlaager@wiktel.com>
parents:
21913
diff
changeset
|
764 notify_imhtml_options(void) |
16988
563a42d98e3a
Fix ticket #387.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16681
diff
changeset
|
765 { |
563a42d98e3a
Fix ticket #387.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16681
diff
changeset
|
766 GtkIMHtmlOptions options = 0; |
563a42d98e3a
Fix ticket #387.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16681
diff
changeset
|
767 |
563a42d98e3a
Fix ticket #387.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16681
diff
changeset
|
768 if (!purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/conversations/show_incoming_formatting")) |
563a42d98e3a
Fix ticket #387.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16681
diff
changeset
|
769 options |= GTK_IMHTML_NO_COLOURS | GTK_IMHTML_NO_FONTS | GTK_IMHTML_NO_SIZES; |
563a42d98e3a
Fix ticket #387.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16681
diff
changeset
|
770 |
563a42d98e3a
Fix ticket #387.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16681
diff
changeset
|
771 options |= GTK_IMHTML_NO_COMMENTS; |
563a42d98e3a
Fix ticket #387.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16681
diff
changeset
|
772 options |= GTK_IMHTML_NO_TITLE; |
563a42d98e3a
Fix ticket #387.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16681
diff
changeset
|
773 options |= GTK_IMHTML_NO_NEWLINE; |
563a42d98e3a
Fix ticket #387.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16681
diff
changeset
|
774 options |= GTK_IMHTML_NO_SCROLL; |
563a42d98e3a
Fix ticket #387.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16681
diff
changeset
|
775 return options; |
563a42d98e3a
Fix ticket #387.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16681
diff
changeset
|
776 } |
563a42d98e3a
Fix ticket #387.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16681
diff
changeset
|
777 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
778 static void * |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15436
diff
changeset
|
779 pidgin_notify_formatted(const char *title, const char *primary, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
780 const char *secondary, const char *text) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
781 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
782 GtkWidget *window; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
783 GtkWidget *vbox; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
784 GtkWidget *label; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
785 GtkWidget *button; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
786 GtkWidget *imhtml; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
787 GtkWidget *frame; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
788 char label_text[2048]; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
789 char *linked_text, *primary_esc, *secondary_esc; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
790 |
19366
bd18c02bba9f
Use GtkDialog more often. Thanks nix_nix. Fixes #2618
Sean Egan <seanegan@gmail.com>
parents:
19316
diff
changeset
|
791 window = gtk_dialog_new(); |
bd18c02bba9f
Use GtkDialog more often. Thanks nix_nix. Fixes #2618
Sean Egan <seanegan@gmail.com>
parents:
19316
diff
changeset
|
792 gtk_window_set_title(GTK_WINDOW(window), title); |
bd18c02bba9f
Use GtkDialog more often. Thanks nix_nix. Fixes #2618
Sean Egan <seanegan@gmail.com>
parents:
19316
diff
changeset
|
793 gtk_container_set_border_width(GTK_CONTAINER(window), PIDGIN_HIG_BORDER); |
bd18c02bba9f
Use GtkDialog more often. Thanks nix_nix. Fixes #2618
Sean Egan <seanegan@gmail.com>
parents:
19316
diff
changeset
|
794 gtk_window_set_resizable(GTK_WINDOW(window), TRUE); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
795 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
796 g_signal_connect(G_OBJECT(window), "delete_event", |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
797 G_CALLBACK(formatted_close_cb), NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
798 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
799 /* Setup the main vbox */ |
19366
bd18c02bba9f
Use GtkDialog more often. Thanks nix_nix. Fixes #2618
Sean Egan <seanegan@gmail.com>
parents:
19316
diff
changeset
|
800 vbox = GTK_DIALOG(window)->vbox; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
801 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
802 /* Setup the descriptive label */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
803 primary_esc = g_markup_escape_text(primary, -1); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
804 secondary_esc = (secondary != NULL) ? g_markup_escape_text(secondary, -1) : NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
805 g_snprintf(label_text, sizeof(label_text), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
806 "<span weight=\"bold\" size=\"larger\">%s</span>%s%s", |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
807 primary_esc, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
808 (secondary ? "\n" : ""), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
809 (secondary ? secondary_esc : "")); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
810 g_free(primary_esc); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
811 g_free(secondary_esc); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
812 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
813 label = gtk_label_new(NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
814 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
815 gtk_label_set_markup(GTK_LABEL(label), label_text); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
816 gtk_label_set_line_wrap(GTK_LABEL(label), TRUE); |
18860
0a8dc9eb4f8e
Allow notification labels to be selectable (for copy-and-paste purposes). Fixes #563.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18547
diff
changeset
|
817 gtk_label_set_selectable(GTK_LABEL(label), TRUE); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
818 gtk_misc_set_alignment(GTK_MISC(label), 0, 0); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
819 gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
820 gtk_widget_show(label); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
821 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
822 /* Add the imhtml */ |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15436
diff
changeset
|
823 frame = pidgin_create_imhtml(FALSE, &imhtml, NULL, NULL); |
16198
88a93f78b489
I don't like the pidginfoo_bar widget names that resulted from the sed.
Richard Laager <rlaager@wiktel.com>
parents:
16193
diff
changeset
|
824 gtk_widget_set_name(imhtml, "pidgin_notify_imhtml"); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
825 gtk_imhtml_set_format_functions(GTK_IMHTML(imhtml), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
826 gtk_imhtml_get_format_functions(GTK_IMHTML(imhtml)) | GTK_IMHTML_IMAGE); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
827 gtk_widget_set_size_request(imhtml, 300, 250); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
828 gtk_box_pack_start(GTK_BOX(vbox), frame, TRUE, TRUE, 0); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
829 gtk_widget_show(frame); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
830 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
831 /* Add the Close button. */ |
19366
bd18c02bba9f
Use GtkDialog more often. Thanks nix_nix. Fixes #2618
Sean Egan <seanegan@gmail.com>
parents:
19316
diff
changeset
|
832 button = gtk_dialog_add_button(GTK_DIALOG(window), GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE); |
18860
0a8dc9eb4f8e
Allow notification labels to be selectable (for copy-and-paste purposes). Fixes #563.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18547
diff
changeset
|
833 gtk_widget_grab_focus(button); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
834 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
835 g_signal_connect_swapped(G_OBJECT(button), "clicked", |
24380
9b61b1088dfb
Fix an assertion failure/unlikely crash when:
Mark Doliner <mark@kingant.net>
parents:
23927
diff
changeset
|
836 G_CALLBACK(formatted_close_cb), window); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
837 g_signal_connect(G_OBJECT(window), "key_press_event", |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
838 G_CALLBACK(formatted_input_cb), NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
839 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
840 /* Make sure URLs are clickable */ |
15823 | 841 linked_text = purple_markup_linkify(text); |
16988
563a42d98e3a
Fix ticket #387.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16681
diff
changeset
|
842 gtk_imhtml_append_text(GTK_IMHTML(imhtml), linked_text, notify_imhtml_options()); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
843 g_free(linked_text); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
844 |
16988
563a42d98e3a
Fix ticket #387.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16681
diff
changeset
|
845 g_object_set_data(G_OBJECT(window), "info-widget", imhtml); |
563a42d98e3a
Fix ticket #387.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16681
diff
changeset
|
846 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
847 /* Show the window */ |
21888
c88a3f2dbb52
Try to make a window transient for a suitable parent window. This currently
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21227
diff
changeset
|
848 pidgin_auto_parent_window(window); |
c88a3f2dbb52
Try to make a window transient for a suitable parent window. This currently
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21227
diff
changeset
|
849 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
850 gtk_widget_show(window); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
851 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
852 return window; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
853 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
854 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
855 static void |
15823 | 856 pidgin_notify_searchresults_new_rows(PurpleConnection *gc, PurpleNotifySearchResults *results, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
857 void *data_) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
858 { |
15821 | 859 PidginNotifySearchResultsData *data = data_; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
860 GtkListStore *model = data->model; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
861 GtkTreeIter iter; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
862 GdkPixbuf *pixbuf; |
20100
a3f07fa68e90
Access search results directly instead of going through the API because
Mark Doliner <mark@kingant.net>
parents:
20074
diff
changeset
|
863 GList *row, *column; |
a3f07fa68e90
Access search results directly instead of going through the API because
Mark Doliner <mark@kingant.net>
parents:
20074
diff
changeset
|
864 guint n; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
865 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
866 gtk_list_store_clear(data->model); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
867 |
15823 | 868 pixbuf = pidgin_create_prpl_icon(purple_connection_get_account(gc), 0.5); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
869 |
20100
a3f07fa68e90
Access search results directly instead of going through the API because
Mark Doliner <mark@kingant.net>
parents:
20074
diff
changeset
|
870 for (row = results->rows; row != NULL; row = row->next) { |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
871 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
872 gtk_list_store_append(model, &iter); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
873 gtk_list_store_set(model, &iter, 0, pixbuf, -1); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
874 |
20100
a3f07fa68e90
Access search results directly instead of going through the API because
Mark Doliner <mark@kingant.net>
parents:
20074
diff
changeset
|
875 n = 1; |
a3f07fa68e90
Access search results directly instead of going through the API because
Mark Doliner <mark@kingant.net>
parents:
20074
diff
changeset
|
876 for (column = row->data; column != NULL; column = column->next) { |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
877 GValue v; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
878 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
879 v.g_type = 0; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
880 g_value_init(&v, G_TYPE_STRING); |
20100
a3f07fa68e90
Access search results directly instead of going through the API because
Mark Doliner <mark@kingant.net>
parents:
20074
diff
changeset
|
881 g_value_set_string(&v, column->data); |
a3f07fa68e90
Access search results directly instead of going through the API because
Mark Doliner <mark@kingant.net>
parents:
20074
diff
changeset
|
882 gtk_list_store_set_value(model, &iter, n, &v); |
a3f07fa68e90
Access search results directly instead of going through the API because
Mark Doliner <mark@kingant.net>
parents:
20074
diff
changeset
|
883 n++; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
884 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
885 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
886 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
887 if (pixbuf != NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
888 g_object_unref(pixbuf); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
889 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
890 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
891 static void * |
15823 | 892 pidgin_notify_searchresults(PurpleConnection *gc, const char *title, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
893 const char *primary, const char *secondary, |
15823 | 894 PurpleNotifySearchResults *results, gpointer user_data) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
895 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
896 GtkWidget *window; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
897 GtkWidget *treeview; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
898 GtkWidget *close_button; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
899 GType *col_types; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
900 GtkListStore *model; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
901 GtkCellRenderer *renderer; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
902 guint col_num; |
20905
38ee359ea4aa
Fix pidgin_notify_searchresults to use the actual title for column headers,
Stu Tomlinson <stu@nosnilmot.com>
parents:
20740
diff
changeset
|
903 GList *columniter; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
904 guint i; |
24497
f10aba5592c6
The other day while struct hiding, I noticed a for loop that was checking
Richard Laager <rlaager@wiktel.com>
parents:
24380
diff
changeset
|
905 GList *l; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
906 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
907 GtkWidget *vbox; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
908 GtkWidget *label; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
909 GtkWidget *sw; |
15821 | 910 PidginNotifySearchResultsData *data; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
911 char *label_text; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
912 char *primary_esc, *secondary_esc; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
913 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
914 g_return_val_if_fail(gc != NULL, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
915 g_return_val_if_fail(results != NULL, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
916 |
15821 | 917 data = g_malloc(sizeof(PidginNotifySearchResultsData)); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
918 data->user_data = user_data; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
919 data->results = results; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
920 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
921 /* Create the window */ |
19366
bd18c02bba9f
Use GtkDialog more often. Thanks nix_nix. Fixes #2618
Sean Egan <seanegan@gmail.com>
parents:
19316
diff
changeset
|
922 window = gtk_dialog_new(); |
bd18c02bba9f
Use GtkDialog more often. Thanks nix_nix. Fixes #2618
Sean Egan <seanegan@gmail.com>
parents:
19316
diff
changeset
|
923 gtk_window_set_title(GTK_WINDOW(window), title ? title :_("Search Results")); |
bd18c02bba9f
Use GtkDialog more often. Thanks nix_nix. Fixes #2618
Sean Egan <seanegan@gmail.com>
parents:
19316
diff
changeset
|
924 gtk_container_set_border_width(GTK_CONTAINER(window), PIDGIN_HIG_BORDER); |
bd18c02bba9f
Use GtkDialog more often. Thanks nix_nix. Fixes #2618
Sean Egan <seanegan@gmail.com>
parents:
19316
diff
changeset
|
925 gtk_window_set_resizable(GTK_WINDOW(window), TRUE); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
926 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
927 g_signal_connect_swapped(G_OBJECT(window), "delete_event", |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
928 G_CALLBACK(searchresults_close_cb), data); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
929 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
930 /* Setup the main vbox */ |
19366
bd18c02bba9f
Use GtkDialog more often. Thanks nix_nix. Fixes #2618
Sean Egan <seanegan@gmail.com>
parents:
19316
diff
changeset
|
931 vbox = GTK_DIALOG(window)->vbox; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
932 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
933 /* Setup the descriptive label */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
934 primary_esc = (primary != NULL) ? g_markup_escape_text(primary, -1) : NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
935 secondary_esc = (secondary != NULL) ? g_markup_escape_text(secondary, -1) : NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
936 label_text = g_strdup_printf( |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
937 "<span weight=\"bold\" size=\"larger\">%s</span>%s%s", |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
938 (primary ? primary_esc : ""), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
939 (primary && secondary ? "\n" : ""), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
940 (secondary ? secondary_esc : "")); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
941 g_free(primary_esc); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
942 g_free(secondary_esc); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
943 label = gtk_label_new(NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
944 gtk_label_set_markup(GTK_LABEL(label), label_text); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
945 gtk_label_set_line_wrap(GTK_LABEL(label), TRUE); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
946 gtk_misc_set_alignment(GTK_MISC(label), 0, 0); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
947 gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
948 gtk_widget_show(label); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
949 g_free(label_text); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
950 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
951 /* +1 is for the automagically created Status column. */ |
20100
a3f07fa68e90
Access search results directly instead of going through the API because
Mark Doliner <mark@kingant.net>
parents:
20074
diff
changeset
|
952 col_num = g_list_length(results->columns) + 1; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
953 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
954 /* Setup the list model */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
955 col_types = g_new0(GType, col_num); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
956 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
957 /* There always is this first column. */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
958 col_types[0] = GDK_TYPE_PIXBUF; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
959 for (i = 1; i < col_num; i++) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
960 col_types[i] = G_TYPE_STRING; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
961 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
962 model = gtk_list_store_newv(col_num, col_types); |
22826
66914f306712
More plumbing work.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22208
diff
changeset
|
963 g_free(col_types); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
964 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
965 /* Setup the scrolled window containing the treeview */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
966 sw = gtk_scrolled_window_new(NULL, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
967 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
968 GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
969 gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(sw), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
970 GTK_SHADOW_IN); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
971 gtk_box_pack_start(GTK_BOX(vbox), sw, TRUE, TRUE, 0); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
972 gtk_widget_show(sw); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
973 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
974 /* Setup the treeview */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
975 treeview = gtk_tree_view_new_with_model(GTK_TREE_MODEL(model)); |
22087
d943df776c09
It turns out the tree-models need to be unref'ed.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22007
diff
changeset
|
976 g_object_unref(G_OBJECT(model)); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
977 gtk_tree_view_set_rules_hint(GTK_TREE_VIEW(treeview), TRUE); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
978 gtk_widget_set_size_request(treeview, 500, 400); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
979 gtk_tree_selection_set_mode(gtk_tree_view_get_selection(GTK_TREE_VIEW(treeview)), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
980 GTK_SELECTION_SINGLE); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
981 gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(treeview), TRUE); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
982 gtk_container_add(GTK_CONTAINER(sw), treeview); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
983 gtk_widget_show(treeview); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
984 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
985 renderer = gtk_cell_renderer_pixbuf_new(); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
986 gtk_tree_view_insert_column_with_attributes(GTK_TREE_VIEW(treeview), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
987 -1, "", renderer, "pixbuf", 0, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
988 |
20100
a3f07fa68e90
Access search results directly instead of going through the API because
Mark Doliner <mark@kingant.net>
parents:
20074
diff
changeset
|
989 i = 1; |
20905
38ee359ea4aa
Fix pidgin_notify_searchresults to use the actual title for column headers,
Stu Tomlinson <stu@nosnilmot.com>
parents:
20740
diff
changeset
|
990 for (columniter = results->columns; columniter != NULL; columniter = columniter->next) { |
38ee359ea4aa
Fix pidgin_notify_searchresults to use the actual title for column headers,
Stu Tomlinson <stu@nosnilmot.com>
parents:
20740
diff
changeset
|
991 PurpleNotifySearchColumn *column = columniter->data; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
992 renderer = gtk_cell_renderer_text_new(); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
993 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
994 gtk_tree_view_insert_column_with_attributes(GTK_TREE_VIEW(treeview), -1, |
20905
38ee359ea4aa
Fix pidgin_notify_searchresults to use the actual title for column headers,
Stu Tomlinson <stu@nosnilmot.com>
parents:
20740
diff
changeset
|
995 column->title, renderer, "text", i, NULL); |
20100
a3f07fa68e90
Access search results directly instead of going through the API because
Mark Doliner <mark@kingant.net>
parents:
20074
diff
changeset
|
996 i++; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
997 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
998 |
24497
f10aba5592c6
The other day while struct hiding, I noticed a for loop that was checking
Richard Laager <rlaager@wiktel.com>
parents:
24380
diff
changeset
|
999 for (l = results->buttons; l; l = l->next) { |
f10aba5592c6
The other day while struct hiding, I noticed a for loop that was checking
Richard Laager <rlaager@wiktel.com>
parents:
24380
diff
changeset
|
1000 PurpleNotifySearchButton *b = l->data; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1001 GtkWidget *button = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1002 switch (b->type) { |
15823 | 1003 case PURPLE_NOTIFY_BUTTON_LABELED: |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1004 if(b->label) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1005 button = gtk_button_new_with_label(b->label); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1006 } else { |
19653
941965d6fd88
Patch from QuLogic. Fixes #2903 ('Missing newlines in debug messages.')
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19366
diff
changeset
|
1007 purple_debug_warning("gtknotify", "Missing button label\n"); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1008 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1009 break; |
15823 | 1010 case PURPLE_NOTIFY_BUTTON_CONTINUE: |
19366
bd18c02bba9f
Use GtkDialog more often. Thanks nix_nix. Fixes #2618
Sean Egan <seanegan@gmail.com>
parents:
19316
diff
changeset
|
1011 button = gtk_dialog_add_button(GTK_DIALOG(window), GTK_STOCK_GO_FORWARD, GTK_RESPONSE_NONE); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1012 break; |
15823 | 1013 case PURPLE_NOTIFY_BUTTON_ADD: |
19366
bd18c02bba9f
Use GtkDialog more often. Thanks nix_nix. Fixes #2618
Sean Egan <seanegan@gmail.com>
parents:
19316
diff
changeset
|
1014 button = gtk_dialog_add_button(GTK_DIALOG(window), GTK_STOCK_ADD, GTK_RESPONSE_NONE); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1015 break; |
15823 | 1016 case PURPLE_NOTIFY_BUTTON_INFO: |
19366
bd18c02bba9f
Use GtkDialog more often. Thanks nix_nix. Fixes #2618
Sean Egan <seanegan@gmail.com>
parents:
19316
diff
changeset
|
1017 button = gtk_dialog_add_button(GTK_DIALOG(window), PIDGIN_STOCK_TOOLBAR_USER_INFO, GTK_RESPONSE_NONE); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1018 break; |
15823 | 1019 case PURPLE_NOTIFY_BUTTON_IM: |
19366
bd18c02bba9f
Use GtkDialog more often. Thanks nix_nix. Fixes #2618
Sean Egan <seanegan@gmail.com>
parents:
19316
diff
changeset
|
1020 button = gtk_dialog_add_button(GTK_DIALOG(window), PIDGIN_STOCK_TOOLBAR_MESSAGE_NEW, GTK_RESPONSE_NONE); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1021 break; |
15823 | 1022 case PURPLE_NOTIFY_BUTTON_JOIN: |
19366
bd18c02bba9f
Use GtkDialog more often. Thanks nix_nix. Fixes #2618
Sean Egan <seanegan@gmail.com>
parents:
19316
diff
changeset
|
1023 button = gtk_dialog_add_button(GTK_DIALOG(window), PIDGIN_STOCK_CHAT, GTK_RESPONSE_NONE); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1024 break; |
15823 | 1025 case PURPLE_NOTIFY_BUTTON_INVITE: |
19366
bd18c02bba9f
Use GtkDialog more often. Thanks nix_nix. Fixes #2618
Sean Egan <seanegan@gmail.com>
parents:
19316
diff
changeset
|
1026 button = gtk_dialog_add_button(GTK_DIALOG(window), PIDGIN_STOCK_INVITE, GTK_RESPONSE_NONE); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1027 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1028 default: |
15823 | 1029 purple_debug_warning("gtknotify", "Incorrect button type: %d\n", b->type); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1030 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1031 if (button != NULL) { |
15821 | 1032 PidginNotifySearchResultsButtonData *bd; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1033 |
15821 | 1034 bd = g_new0(PidginNotifySearchResultsButtonData, 1); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1035 bd->button = b; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1036 bd->data = data; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1037 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1038 g_signal_connect(G_OBJECT(button), "clicked", |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1039 G_CALLBACK(searchresults_callback_wrapper_cb), bd); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1040 g_signal_connect_swapped(G_OBJECT(button), "destroy", G_CALLBACK(g_free), bd); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1041 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1042 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1043 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1044 /* Add the Close button */ |
19366
bd18c02bba9f
Use GtkDialog more often. Thanks nix_nix. Fixes #2618
Sean Egan <seanegan@gmail.com>
parents:
19316
diff
changeset
|
1045 close_button = gtk_dialog_add_button(GTK_DIALOG(window), GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1046 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1047 g_signal_connect_swapped(G_OBJECT(close_button), "clicked", |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1048 G_CALLBACK(searchresults_close_cb), data); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1049 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1050 data->account = gc->account; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1051 data->model = model; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1052 data->treeview = treeview; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1053 data->window = window; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1054 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1055 /* Insert rows. */ |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15436
diff
changeset
|
1056 pidgin_notify_searchresults_new_rows(gc, results, data); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1057 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1058 /* Show the window */ |
21888
c88a3f2dbb52
Try to make a window transient for a suitable parent window. This currently
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21227
diff
changeset
|
1059 pidgin_auto_parent_window(window); |
c88a3f2dbb52
Try to make a window transient for a suitable parent window. This currently
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21227
diff
changeset
|
1060 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1061 gtk_widget_show(window); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1062 return data; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1063 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1064 |
16988
563a42d98e3a
Fix ticket #387.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16681
diff
changeset
|
1065 /** Xerox'ed from Finch! How the tables have turned!! ;) **/ |
563a42d98e3a
Fix ticket #387.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16681
diff
changeset
|
1066 /** User information. **/ |
563a42d98e3a
Fix ticket #387.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16681
diff
changeset
|
1067 static GHashTable *userinfo; |
563a42d98e3a
Fix ticket #387.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16681
diff
changeset
|
1068 |
563a42d98e3a
Fix ticket #387.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16681
diff
changeset
|
1069 static char * |
563a42d98e3a
Fix ticket #387.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16681
diff
changeset
|
1070 userinfo_hash(PurpleAccount *account, const char *who) |
563a42d98e3a
Fix ticket #387.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16681
diff
changeset
|
1071 { |
563a42d98e3a
Fix ticket #387.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16681
diff
changeset
|
1072 char key[256]; |
563a42d98e3a
Fix ticket #387.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16681
diff
changeset
|
1073 snprintf(key, sizeof(key), "%s - %s", purple_account_get_username(account), purple_normalize(account, who)); |
563a42d98e3a
Fix ticket #387.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16681
diff
changeset
|
1074 return g_utf8_strup(key, -1); |
563a42d98e3a
Fix ticket #387.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16681
diff
changeset
|
1075 } |
563a42d98e3a
Fix ticket #387.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16681
diff
changeset
|
1076 |
563a42d98e3a
Fix ticket #387.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16681
diff
changeset
|
1077 static void |
563a42d98e3a
Fix ticket #387.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16681
diff
changeset
|
1078 remove_userinfo(GtkWidget *widget, gpointer key) |
563a42d98e3a
Fix ticket #387.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16681
diff
changeset
|
1079 { |
17858
c1c533448097
sadrul's fix for the userinfo notify crash on disconnect that was caused by
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16988
diff
changeset
|
1080 PidginUserInfo *pinfo = g_hash_table_lookup(userinfo, key); |
c1c533448097
sadrul's fix for the userinfo notify crash on disconnect that was caused by
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16988
diff
changeset
|
1081 |
c1c533448097
sadrul's fix for the userinfo notify crash on disconnect that was caused by
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16988
diff
changeset
|
1082 while (pinfo->count--) |
c1c533448097
sadrul's fix for the userinfo notify crash on disconnect that was caused by
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16988
diff
changeset
|
1083 purple_notify_close(PURPLE_NOTIFY_USERINFO, widget); |
c1c533448097
sadrul's fix for the userinfo notify crash on disconnect that was caused by
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16988
diff
changeset
|
1084 |
16988
563a42d98e3a
Fix ticket #387.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16681
diff
changeset
|
1085 g_hash_table_remove(userinfo, key); |
563a42d98e3a
Fix ticket #387.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16681
diff
changeset
|
1086 } |
563a42d98e3a
Fix ticket #387.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16681
diff
changeset
|
1087 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1088 static void * |
15823 | 1089 pidgin_notify_userinfo(PurpleConnection *gc, const char *who, |
1090 PurpleNotifyUserInfo *user_info) | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1091 { |
16988
563a42d98e3a
Fix ticket #387.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16681
diff
changeset
|
1092 char *info; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1093 void *ui_handle; |
16988
563a42d98e3a
Fix ticket #387.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16681
diff
changeset
|
1094 char *key = userinfo_hash(purple_connection_get_account(gc), who); |
17858
c1c533448097
sadrul's fix for the userinfo notify crash on disconnect that was caused by
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16988
diff
changeset
|
1095 PidginUserInfo *pinfo = NULL; |
16988
563a42d98e3a
Fix ticket #387.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16681
diff
changeset
|
1096 |
563a42d98e3a
Fix ticket #387.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16681
diff
changeset
|
1097 if (!userinfo) { |
17858
c1c533448097
sadrul's fix for the userinfo notify crash on disconnect that was caused by
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16988
diff
changeset
|
1098 userinfo = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, g_free); |
16988
563a42d98e3a
Fix ticket #387.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16681
diff
changeset
|
1099 } |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1100 |
15823 | 1101 info = purple_notify_user_info_get_text_with_newline(user_info, "<br />"); |
17858
c1c533448097
sadrul's fix for the userinfo notify crash on disconnect that was caused by
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16988
diff
changeset
|
1102 pinfo = g_hash_table_lookup(userinfo, key); |
c1c533448097
sadrul's fix for the userinfo notify crash on disconnect that was caused by
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16988
diff
changeset
|
1103 if (pinfo != NULL) { |
c1c533448097
sadrul's fix for the userinfo notify crash on disconnect that was caused by
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16988
diff
changeset
|
1104 GtkIMHtml *imhtml = g_object_get_data(G_OBJECT(pinfo->window), "info-widget"); |
16988
563a42d98e3a
Fix ticket #387.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16681
diff
changeset
|
1105 char *linked_text = purple_markup_linkify(info); |
563a42d98e3a
Fix ticket #387.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16681
diff
changeset
|
1106 gtk_imhtml_clear(imhtml); |
563a42d98e3a
Fix ticket #387.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16681
diff
changeset
|
1107 gtk_imhtml_append_text(imhtml, linked_text, notify_imhtml_options()); |
563a42d98e3a
Fix ticket #387.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16681
diff
changeset
|
1108 g_free(linked_text); |
563a42d98e3a
Fix ticket #387.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16681
diff
changeset
|
1109 g_free(key); |
17858
c1c533448097
sadrul's fix for the userinfo notify crash on disconnect that was caused by
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16988
diff
changeset
|
1110 ui_handle = pinfo->window; |
c1c533448097
sadrul's fix for the userinfo notify crash on disconnect that was caused by
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16988
diff
changeset
|
1111 pinfo->count++; |
16988
563a42d98e3a
Fix ticket #387.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16681
diff
changeset
|
1112 } else { |
563a42d98e3a
Fix ticket #387.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16681
diff
changeset
|
1113 char *primary = g_strdup_printf(_("Info for %s"), who); |
563a42d98e3a
Fix ticket #387.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16681
diff
changeset
|
1114 ui_handle = pidgin_notify_formatted(_("Buddy Information"), primary, NULL, info); |
17858
c1c533448097
sadrul's fix for the userinfo notify crash on disconnect that was caused by
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16988
diff
changeset
|
1115 g_signal_handlers_disconnect_by_func(G_OBJECT(ui_handle), G_CALLBACK(formatted_close_cb), NULL); |
16988
563a42d98e3a
Fix ticket #387.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16681
diff
changeset
|
1116 g_signal_connect(G_OBJECT(ui_handle), "destroy", G_CALLBACK(remove_userinfo), key); |
563a42d98e3a
Fix ticket #387.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16681
diff
changeset
|
1117 g_free(primary); |
17858
c1c533448097
sadrul's fix for the userinfo notify crash on disconnect that was caused by
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16988
diff
changeset
|
1118 pinfo = g_new0(PidginUserInfo, 1); |
c1c533448097
sadrul's fix for the userinfo notify crash on disconnect that was caused by
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16988
diff
changeset
|
1119 pinfo->window = ui_handle; |
c1c533448097
sadrul's fix for the userinfo notify crash on disconnect that was caused by
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16988
diff
changeset
|
1120 pinfo->count = 1; |
c1c533448097
sadrul's fix for the userinfo notify crash on disconnect that was caused by
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16988
diff
changeset
|
1121 g_hash_table_insert(userinfo, key, pinfo); |
16988
563a42d98e3a
Fix ticket #387.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16681
diff
changeset
|
1122 } |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1123 g_free(info); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1124 return ui_handle; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1125 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1126 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1127 static void |
15823 | 1128 pidgin_close_notify(PurpleNotifyType type, void *ui_handle) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1129 { |
15823 | 1130 if (type == PURPLE_NOTIFY_EMAIL || type == PURPLE_NOTIFY_EMAILS) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1131 { |
15821 | 1132 PidginNotifyMailData *data = (PidginNotifyMailData *)ui_handle; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1133 |
26268
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
1134 if (data) { |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
1135 g_free(data->url); |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
1136 g_free(data); |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
1137 } |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1138 } |
15823 | 1139 else if (type == PURPLE_NOTIFY_SEARCHRESULTS) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1140 { |
15821 | 1141 PidginNotifySearchResultsData *data = (PidginNotifySearchResultsData *)ui_handle; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1142 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1143 gtk_widget_destroy(data->window); |
15823 | 1144 purple_notify_searchresults_free(data->results); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1145 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1146 g_free(data); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1147 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1148 else if (ui_handle != NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1149 gtk_widget_destroy(GTK_WIDGET(ui_handle)); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1150 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1151 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1152 #ifndef _WIN32 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1153 static gint |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1154 uri_command(const char *command, gboolean sync) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1155 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1156 gchar *tmp; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1157 GError *error = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1158 gint ret = 0; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1159 |
15823 | 1160 purple_debug_misc("gtknotify", "Executing %s\n", command); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1161 |
15823 | 1162 if (!purple_program_is_valid(command)) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1163 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1164 tmp = g_strdup_printf(_("The browser command \"%s\" is invalid."), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1165 command ? command : "(none)"); |
15823 | 1166 purple_notify_error(NULL, NULL, _("Unable to open URL"), tmp); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1167 g_free(tmp); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1168 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1169 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1170 else if (sync) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1171 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1172 gint status; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1173 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1174 if (!g_spawn_command_line_sync(command, NULL, NULL, &status, &error)) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1175 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1176 tmp = g_strdup_printf(_("Error launching \"%s\": %s"), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1177 command, error->message); |
15823 | 1178 purple_notify_error(NULL, NULL, _("Unable to open URL"), tmp); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1179 g_free(tmp); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1180 g_error_free(error); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1181 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1182 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1183 ret = status; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1184 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1185 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1186 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1187 if (!g_spawn_command_line_async(command, &error)) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1188 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1189 tmp = g_strdup_printf(_("Error launching \"%s\": %s"), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1190 command, error->message); |
15823 | 1191 purple_notify_error(NULL, NULL, _("Unable to open URL"), tmp); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1192 g_free(tmp); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1193 g_error_free(error); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1194 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1195 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1196 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1197 return ret; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1198 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1199 #endif /* _WIN32 */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1200 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1201 static void * |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15436
diff
changeset
|
1202 pidgin_notify_uri(const char *uri) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1203 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1204 #ifndef _WIN32 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1205 char *escaped = g_shell_quote(uri); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1206 char *command = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1207 char *remote_command = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1208 const char *web_browser; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1209 int place; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1210 |
16062
07554cc5d090
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <stu@nosnilmot.com>
parents:
15871
diff
changeset
|
1211 web_browser = purple_prefs_get_string(PIDGIN_PREFS_ROOT "/browsers/browser"); |
07554cc5d090
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <stu@nosnilmot.com>
parents:
15871
diff
changeset
|
1212 place = purple_prefs_get_int(PIDGIN_PREFS_ROOT "/browsers/place"); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1213 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1214 /* if they are running gnome, use the gnome web browser */ |
15823 | 1215 if (purple_running_gnome() == TRUE) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1216 { |
22208
c77098cebf23
Use xdg-open instead of gnome-open, if possible. We might want to use
Stu Tomlinson <stu@nosnilmot.com>
parents:
22087
diff
changeset
|
1217 char *tmp = g_find_program_in_path("xdg-open"); |
c77098cebf23
Use xdg-open instead of gnome-open, if possible. We might want to use
Stu Tomlinson <stu@nosnilmot.com>
parents:
22087
diff
changeset
|
1218 if (tmp == NULL) |
c77098cebf23
Use xdg-open instead of gnome-open, if possible. We might want to use
Stu Tomlinson <stu@nosnilmot.com>
parents:
22087
diff
changeset
|
1219 command = g_strdup_printf("gnome-open %s", escaped); |
c77098cebf23
Use xdg-open instead of gnome-open, if possible. We might want to use
Stu Tomlinson <stu@nosnilmot.com>
parents:
22087
diff
changeset
|
1220 else |
c77098cebf23
Use xdg-open instead of gnome-open, if possible. We might want to use
Stu Tomlinson <stu@nosnilmot.com>
parents:
22087
diff
changeset
|
1221 command = g_strdup_printf("xdg-open %s", escaped); |
c77098cebf23
Use xdg-open instead of gnome-open, if possible. We might want to use
Stu Tomlinson <stu@nosnilmot.com>
parents:
22087
diff
changeset
|
1222 g_free(tmp); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1223 } |
15823 | 1224 else if (purple_running_osx() == TRUE) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1225 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1226 command = g_strdup_printf("open %s", escaped); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1227 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1228 else if (!strcmp(web_browser, "epiphany") || |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1229 !strcmp(web_browser, "galeon")) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1230 { |
15507 | 1231 if (place == PIDGIN_BROWSER_NEW_WINDOW) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1232 command = g_strdup_printf("%s -w %s", web_browser, escaped); |
15507 | 1233 else if (place == PIDGIN_BROWSER_NEW_TAB) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1234 command = g_strdup_printf("%s -n %s", web_browser, escaped); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1235 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1236 command = g_strdup_printf("%s %s", web_browser, escaped); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1237 } |
22208
c77098cebf23
Use xdg-open instead of gnome-open, if possible. We might want to use
Stu Tomlinson <stu@nosnilmot.com>
parents:
22087
diff
changeset
|
1238 else if (!strcmp(web_browser, "xdg-open")) |
c77098cebf23
Use xdg-open instead of gnome-open, if possible. We might want to use
Stu Tomlinson <stu@nosnilmot.com>
parents:
22087
diff
changeset
|
1239 { |
c77098cebf23
Use xdg-open instead of gnome-open, if possible. We might want to use
Stu Tomlinson <stu@nosnilmot.com>
parents:
22087
diff
changeset
|
1240 command = g_strdup_printf("xdg-open %s", escaped); |
c77098cebf23
Use xdg-open instead of gnome-open, if possible. We might want to use
Stu Tomlinson <stu@nosnilmot.com>
parents:
22087
diff
changeset
|
1241 } |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1242 else if (!strcmp(web_browser, "gnome-open")) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1243 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1244 command = g_strdup_printf("gnome-open %s", escaped); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1245 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1246 else if (!strcmp(web_browser, "kfmclient")) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1247 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1248 command = g_strdup_printf("kfmclient openURL %s", escaped); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1249 /* |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1250 * Does Konqueror have options to open in new tab |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1251 * and/or current window? |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1252 */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1253 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1254 else if (!strcmp(web_browser, "mozilla") || |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1255 !strcmp(web_browser, "mozilla-firebird") || |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1256 !strcmp(web_browser, "firefox") || |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1257 !strcmp(web_browser, "seamonkey")) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1258 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1259 char *args = ""; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1260 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1261 command = g_strdup_printf("%s %s", web_browser, escaped); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1262 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1263 /* |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1264 * Firefox 0.9 and higher require a "-a firefox" option when |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1265 * using -remote commands. This breaks older versions of |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1266 * mozilla. So we include this other handly little string |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1267 * when calling firefox. If the API for remote calls changes |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1268 * any more in firefox then firefox should probably be split |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1269 * apart from mozilla-firebird and mozilla... but this is good |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1270 * for now. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1271 */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1272 if (!strcmp(web_browser, "firefox")) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1273 args = "-a firefox"; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1274 |
15507 | 1275 if (place == PIDGIN_BROWSER_NEW_WINDOW) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1276 remote_command = g_strdup_printf("%s %s -remote " |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1277 "openURL(%s,new-window)", |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1278 web_browser, args, escaped); |
15507 | 1279 else if (place == PIDGIN_BROWSER_NEW_TAB) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1280 remote_command = g_strdup_printf("%s %s -remote " |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1281 "openURL(%s,new-tab)", |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1282 web_browser, args, escaped); |
15507 | 1283 else if (place == PIDGIN_BROWSER_CURRENT) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1284 remote_command = g_strdup_printf("%s %s -remote " |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1285 "openURL(%s)", |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1286 web_browser, args, escaped); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1287 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1288 else if (!strcmp(web_browser, "netscape")) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1289 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1290 command = g_strdup_printf("netscape %s", escaped); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1291 |
15507 | 1292 if (place == PIDGIN_BROWSER_NEW_WINDOW) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1293 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1294 remote_command = g_strdup_printf("netscape -remote " |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1295 "openURL(%s,new-window)", |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1296 escaped); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1297 } |
15507 | 1298 else if (place == PIDGIN_BROWSER_CURRENT) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1299 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1300 remote_command = g_strdup_printf("netscape -remote " |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1301 "openURL(%s)", escaped); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1302 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1303 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1304 else if (!strcmp(web_browser, "opera")) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1305 { |
15507 | 1306 if (place == PIDGIN_BROWSER_NEW_WINDOW) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1307 command = g_strdup_printf("opera -newwindow %s", escaped); |
15507 | 1308 else if (place == PIDGIN_BROWSER_NEW_TAB) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1309 command = g_strdup_printf("opera -newpage %s", escaped); |
15507 | 1310 else if (place == PIDGIN_BROWSER_CURRENT) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1311 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1312 remote_command = g_strdup_printf("opera -remote " |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1313 "openURL(%s)", escaped); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1314 command = g_strdup_printf("opera %s", escaped); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1315 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1316 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1317 command = g_strdup_printf("opera %s", escaped); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1318 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1319 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1320 else if (!strcmp(web_browser, "custom")) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1321 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1322 const char *web_command; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1323 |
16062
07554cc5d090
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <stu@nosnilmot.com>
parents:
15871
diff
changeset
|
1324 web_command = purple_prefs_get_path(PIDGIN_PREFS_ROOT "/browsers/command"); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1325 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1326 if (web_command == NULL || *web_command == '\0') |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1327 { |
15823 | 1328 purple_notify_error(NULL, NULL, _("Unable to open URL"), |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1329 _("The 'Manual' browser command has been " |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1330 "chosen, but no command has been set.")); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1331 return NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1332 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1333 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1334 if (strstr(web_command, "%s")) |
15823 | 1335 command = purple_strreplace(web_command, "%s", escaped); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1336 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1337 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1338 /* |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1339 * There is no "%s" in the browser command. Assume the user |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1340 * wanted the URL tacked on to the end of the command. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1341 */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1342 command = g_strdup_printf("%s %s", web_command, escaped); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1343 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1344 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1345 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1346 g_free(escaped); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1347 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1348 if (remote_command != NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1349 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1350 /* try the remote command first */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1351 if (uri_command(remote_command, TRUE) != 0) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1352 uri_command(command, FALSE); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1353 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1354 g_free(remote_command); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1355 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1356 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1357 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1358 uri_command(command, FALSE); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1359 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1360 g_free(command); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1361 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1362 #else /* !_WIN32 */ |
15515
75ffc646647f
Win32 de-gaimification of pidgin
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15509
diff
changeset
|
1363 winpidgin_notify_uri(uri); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1364 #endif /* !_WIN32 */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1365 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1366 return NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1367 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1368 |
27338
c245c583a1a6
Remove a few layers of evil abstraction.
Paul Aurich <paul@darkrain42.org>
parents:
27337
diff
changeset
|
1369 void |
c245c583a1a6
Remove a few layers of evil abstraction.
Paul Aurich <paul@darkrain42.org>
parents:
27337
diff
changeset
|
1370 pidgin_notify_pounce_add(PurpleAccount *account, PurplePounce *pounce, |
c245c583a1a6
Remove a few layers of evil abstraction.
Paul Aurich <paul@darkrain42.org>
parents:
27337
diff
changeset
|
1371 const char *alias, const char *event, const char *message, const char *date) |
26268
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
1372 { |
27338
c245c583a1a6
Remove a few layers of evil abstraction.
Paul Aurich <paul@darkrain42.org>
parents:
27337
diff
changeset
|
1373 GdkPixbuf *icon; |
c245c583a1a6
Remove a few layers of evil abstraction.
Paul Aurich <paul@darkrain42.org>
parents:
27337
diff
changeset
|
1374 GtkTreeIter iter; |
c245c583a1a6
Remove a few layers of evil abstraction.
Paul Aurich <paul@darkrain42.org>
parents:
27337
diff
changeset
|
1375 PidginNotifyPounceData *pounce_data; |
c245c583a1a6
Remove a few layers of evil abstraction.
Paul Aurich <paul@darkrain42.org>
parents:
27337
diff
changeset
|
1376 |
27344
975a29213f35
Use mail_dialog consistently, instead of switching from one line to the next. Various other cleanups, too.
Paul Aurich <paul@darkrain42.org>
parents:
27342
diff
changeset
|
1377 if (pounce_dialog == NULL) |
975a29213f35
Use mail_dialog consistently, instead of switching from one line to the next. Various other cleanups, too.
Paul Aurich <paul@darkrain42.org>
parents:
27342
diff
changeset
|
1378 pounce_dialog = pidgin_create_notification_dialog(PIDGIN_NOTIFY_POUNCE); |
27338
c245c583a1a6
Remove a few layers of evil abstraction.
Paul Aurich <paul@darkrain42.org>
parents:
27337
diff
changeset
|
1379 |
c245c583a1a6
Remove a few layers of evil abstraction.
Paul Aurich <paul@darkrain42.org>
parents:
27337
diff
changeset
|
1380 icon = pidgin_create_prpl_icon(account, PIDGIN_PRPL_ICON_SMALL); |
c245c583a1a6
Remove a few layers of evil abstraction.
Paul Aurich <paul@darkrain42.org>
parents:
27337
diff
changeset
|
1381 |
c245c583a1a6
Remove a few layers of evil abstraction.
Paul Aurich <paul@darkrain42.org>
parents:
27337
diff
changeset
|
1382 pounce_data = g_new(PidginNotifyPounceData, 1); |
c245c583a1a6
Remove a few layers of evil abstraction.
Paul Aurich <paul@darkrain42.org>
parents:
27337
diff
changeset
|
1383 |
c245c583a1a6
Remove a few layers of evil abstraction.
Paul Aurich <paul@darkrain42.org>
parents:
27337
diff
changeset
|
1384 pounce_data->account = account; |
c245c583a1a6
Remove a few layers of evil abstraction.
Paul Aurich <paul@darkrain42.org>
parents:
27337
diff
changeset
|
1385 pounce_data->pounce = pounce; |
c245c583a1a6
Remove a few layers of evil abstraction.
Paul Aurich <paul@darkrain42.org>
parents:
27337
diff
changeset
|
1386 |
c245c583a1a6
Remove a few layers of evil abstraction.
Paul Aurich <paul@darkrain42.org>
parents:
27337
diff
changeset
|
1387 gtk_tree_store_append(pounce_dialog->treemodel, &iter, NULL); |
c245c583a1a6
Remove a few layers of evil abstraction.
Paul Aurich <paul@darkrain42.org>
parents:
27337
diff
changeset
|
1388 |
c245c583a1a6
Remove a few layers of evil abstraction.
Paul Aurich <paul@darkrain42.org>
parents:
27337
diff
changeset
|
1389 gtk_tree_store_set(pounce_dialog->treemodel, &iter, |
c245c583a1a6
Remove a few layers of evil abstraction.
Paul Aurich <paul@darkrain42.org>
parents:
27337
diff
changeset
|
1390 PIDGIN_POUNCE_ICON, icon, |
c245c583a1a6
Remove a few layers of evil abstraction.
Paul Aurich <paul@darkrain42.org>
parents:
27337
diff
changeset
|
1391 PIDGIN_POUNCE_ALIAS, alias, |
c245c583a1a6
Remove a few layers of evil abstraction.
Paul Aurich <paul@darkrain42.org>
parents:
27337
diff
changeset
|
1392 PIDGIN_POUNCE_EVENT, event, |
c245c583a1a6
Remove a few layers of evil abstraction.
Paul Aurich <paul@darkrain42.org>
parents:
27337
diff
changeset
|
1393 PIDGIN_POUNCE_TEXT, (message != NULL)? message : _("No message"), |
c245c583a1a6
Remove a few layers of evil abstraction.
Paul Aurich <paul@darkrain42.org>
parents:
27337
diff
changeset
|
1394 PIDGIN_POUNCE_DATE, date, |
c245c583a1a6
Remove a few layers of evil abstraction.
Paul Aurich <paul@darkrain42.org>
parents:
27337
diff
changeset
|
1395 PIDGIN_POUNCE_DATA, pounce_data, |
c245c583a1a6
Remove a few layers of evil abstraction.
Paul Aurich <paul@darkrain42.org>
parents:
27337
diff
changeset
|
1396 -1); |
c245c583a1a6
Remove a few layers of evil abstraction.
Paul Aurich <paul@darkrain42.org>
parents:
27337
diff
changeset
|
1397 |
c245c583a1a6
Remove a few layers of evil abstraction.
Paul Aurich <paul@darkrain42.org>
parents:
27337
diff
changeset
|
1398 if (icon) |
c245c583a1a6
Remove a few layers of evil abstraction.
Paul Aurich <paul@darkrain42.org>
parents:
27337
diff
changeset
|
1399 g_object_unref(icon); |
c245c583a1a6
Remove a few layers of evil abstraction.
Paul Aurich <paul@darkrain42.org>
parents:
27337
diff
changeset
|
1400 |
27344
975a29213f35
Use mail_dialog consistently, instead of switching from one line to the next. Various other cleanups, too.
Paul Aurich <paul@darkrain42.org>
parents:
27342
diff
changeset
|
1401 gtk_widget_show_all(pounce_dialog->dialog); |
27338
c245c583a1a6
Remove a few layers of evil abstraction.
Paul Aurich <paul@darkrain42.org>
parents:
27337
diff
changeset
|
1402 |
c245c583a1a6
Remove a few layers of evil abstraction.
Paul Aurich <paul@darkrain42.org>
parents:
27337
diff
changeset
|
1403 return; |
c245c583a1a6
Remove a few layers of evil abstraction.
Paul Aurich <paul@darkrain42.org>
parents:
27337
diff
changeset
|
1404 } |
c245c583a1a6
Remove a few layers of evil abstraction.
Paul Aurich <paul@darkrain42.org>
parents:
27337
diff
changeset
|
1405 |
c245c583a1a6
Remove a few layers of evil abstraction.
Paul Aurich <paul@darkrain42.org>
parents:
27337
diff
changeset
|
1406 static PidginNotifyDialog * |
27344
975a29213f35
Use mail_dialog consistently, instead of switching from one line to the next. Various other cleanups, too.
Paul Aurich <paul@darkrain42.org>
parents:
27342
diff
changeset
|
1407 pidgin_create_notification_dialog(PidginNotifyType type) |
27338
c245c583a1a6
Remove a few layers of evil abstraction.
Paul Aurich <paul@darkrain42.org>
parents:
27337
diff
changeset
|
1408 { |
c245c583a1a6
Remove a few layers of evil abstraction.
Paul Aurich <paul@darkrain42.org>
parents:
27337
diff
changeset
|
1409 GtkTreeStore *model = NULL; |
26268
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
1410 GtkWidget *dialog = NULL; |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
1411 GtkWidget *label = NULL; |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
1412 GtkWidget *sw; |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
1413 GtkCellRenderer *rend; |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
1414 GtkTreeViewColumn *column; |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
1415 GtkWidget *button = NULL; |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
1416 GtkWidget *vbox = NULL; |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
1417 GtkTreeSelection *sel; |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
1418 PidginNotifyDialog *spec_dialog = NULL; |
27337
357405dc8b2c
Remove trailing whitespace
Paul Aurich <paul@darkrain42.org>
parents:
27325
diff
changeset
|
1419 |
26268
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
1420 g_return_val_if_fail(type < PIDGIN_NOTIFY_TYPES, NULL); |
27337
357405dc8b2c
Remove trailing whitespace
Paul Aurich <paul@darkrain42.org>
parents:
27325
diff
changeset
|
1421 |
27338
c245c583a1a6
Remove a few layers of evil abstraction.
Paul Aurich <paul@darkrain42.org>
parents:
27337
diff
changeset
|
1422 if (type == PIDGIN_NOTIFY_MAIL) { |
27344
975a29213f35
Use mail_dialog consistently, instead of switching from one line to the next. Various other cleanups, too.
Paul Aurich <paul@darkrain42.org>
parents:
27342
diff
changeset
|
1423 g_return_val_if_fail(mail_dialog == NULL, mail_dialog); |
27338
c245c583a1a6
Remove a few layers of evil abstraction.
Paul Aurich <paul@darkrain42.org>
parents:
27337
diff
changeset
|
1424 |
c245c583a1a6
Remove a few layers of evil abstraction.
Paul Aurich <paul@darkrain42.org>
parents:
27337
diff
changeset
|
1425 model = gtk_tree_store_new(COLUMNS_PIDGIN_MAIL, |
c245c583a1a6
Remove a few layers of evil abstraction.
Paul Aurich <paul@darkrain42.org>
parents:
27337
diff
changeset
|
1426 GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_POINTER); |
c245c583a1a6
Remove a few layers of evil abstraction.
Paul Aurich <paul@darkrain42.org>
parents:
27337
diff
changeset
|
1427 |
c245c583a1a6
Remove a few layers of evil abstraction.
Paul Aurich <paul@darkrain42.org>
parents:
27337
diff
changeset
|
1428 } else if (type == PIDGIN_NOTIFY_POUNCE) { |
27344
975a29213f35
Use mail_dialog consistently, instead of switching from one line to the next. Various other cleanups, too.
Paul Aurich <paul@darkrain42.org>
parents:
27342
diff
changeset
|
1429 g_return_val_if_fail(pounce_dialog == NULL, pounce_dialog); |
27338
c245c583a1a6
Remove a few layers of evil abstraction.
Paul Aurich <paul@darkrain42.org>
parents:
27337
diff
changeset
|
1430 |
27344
975a29213f35
Use mail_dialog consistently, instead of switching from one line to the next. Various other cleanups, too.
Paul Aurich <paul@darkrain42.org>
parents:
27342
diff
changeset
|
1431 model = gtk_tree_store_new(COLUMNS_PIDGIN_POUNCE, |
27338
c245c583a1a6
Remove a few layers of evil abstraction.
Paul Aurich <paul@darkrain42.org>
parents:
27337
diff
changeset
|
1432 GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, |
c245c583a1a6
Remove a few layers of evil abstraction.
Paul Aurich <paul@darkrain42.org>
parents:
27337
diff
changeset
|
1433 G_TYPE_STRING, G_TYPE_POINTER); |
c245c583a1a6
Remove a few layers of evil abstraction.
Paul Aurich <paul@darkrain42.org>
parents:
27337
diff
changeset
|
1434 } |
c245c583a1a6
Remove a few layers of evil abstraction.
Paul Aurich <paul@darkrain42.org>
parents:
27337
diff
changeset
|
1435 |
26268
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
1436 dialog = gtk_dialog_new_with_buttons(NULL, NULL, 0, |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
1437 GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE, |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
1438 NULL); |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
1439 |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
1440 /* Setup the dialog */ |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
1441 gtk_container_set_border_width(GTK_CONTAINER(dialog), PIDGIN_HIG_BOX_SPACE); |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
1442 gtk_container_set_border_width(GTK_CONTAINER(GTK_DIALOG(dialog)->vbox), PIDGIN_HIG_BOX_SPACE); |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
1443 gtk_dialog_set_has_separator(GTK_DIALOG(dialog), FALSE); |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
1444 gtk_box_set_spacing(GTK_BOX(GTK_DIALOG(dialog)->vbox), PIDGIN_HIG_BORDER); |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
1445 |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
1446 /* Vertical box */ |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
1447 vbox = GTK_DIALOG(dialog)->vbox; |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
1448 |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
1449 /* Golden ratio it up! */ |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
1450 gtk_widget_set_size_request(dialog, 550, 400); |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
1451 |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
1452 sw = gtk_scrolled_window_new(NULL, NULL); |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
1453 gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW(sw), GTK_SHADOW_IN); |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
1454 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS); |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
1455 |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
1456 spec_dialog = g_new0(PidginNotifyDialog, 1); |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
1457 spec_dialog->dialog = dialog; |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
1458 |
27338
c245c583a1a6
Remove a few layers of evil abstraction.
Paul Aurich <paul@darkrain42.org>
parents:
27337
diff
changeset
|
1459 spec_dialog->treemodel = model; |
c245c583a1a6
Remove a few layers of evil abstraction.
Paul Aurich <paul@darkrain42.org>
parents:
27337
diff
changeset
|
1460 spec_dialog->treeview = gtk_tree_view_new_with_model(GTK_TREE_MODEL(model)); |
c245c583a1a6
Remove a few layers of evil abstraction.
Paul Aurich <paul@darkrain42.org>
parents:
27337
diff
changeset
|
1461 g_object_unref(G_OBJECT(model)); |
27337
357405dc8b2c
Remove trailing whitespace
Paul Aurich <paul@darkrain42.org>
parents:
27325
diff
changeset
|
1462 |
26268
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
1463 gtk_tree_view_set_rules_hint(GTK_TREE_VIEW(spec_dialog->treeview), TRUE); |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
1464 gtk_container_add(GTK_CONTAINER(sw), spec_dialog->treeview); |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
1465 |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
1466 if (type == PIDGIN_NOTIFY_MAIL) { |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
1467 gtk_window_set_title(GTK_WINDOW(dialog), _("New Mail")); |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
1468 gtk_window_set_role(GTK_WINDOW(dialog), "new_mail_detailed"); |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
1469 g_signal_connect(G_OBJECT(dialog), "focus-in-event", |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
1470 G_CALLBACK(mail_window_focus_cb), NULL); |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
1471 |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
1472 gtk_dialog_add_button(GTK_DIALOG(dialog), |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
1473 _("Open All Messages"), GTK_RESPONSE_ACCEPT); |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
1474 |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
1475 button = gtk_dialog_add_button(GTK_DIALOG(dialog), |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
1476 PIDGIN_STOCK_OPEN_MAIL, GTK_RESPONSE_YES); |
27117
9c36a340fcaf
Setting `dialog->open_button = button` when `button` is not yet assigned
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26922
diff
changeset
|
1477 spec_dialog->open_button = button; |
26268
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
1478 |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
1479 gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(spec_dialog->treeview), FALSE); |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
1480 |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
1481 gtk_tree_view_set_search_column(GTK_TREE_VIEW(spec_dialog->treeview), PIDGIN_MAIL_TEXT); |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
1482 gtk_tree_view_set_search_equal_func(GTK_TREE_VIEW(spec_dialog->treeview), |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
1483 pidgin_tree_view_search_equal_func, NULL, NULL); |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
1484 |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
1485 g_signal_connect(G_OBJECT(dialog), "response", |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
1486 G_CALLBACK(email_response_cb), spec_dialog); |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
1487 g_signal_connect(G_OBJECT(gtk_tree_view_get_selection(GTK_TREE_VIEW(spec_dialog->treeview))), |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
1488 "changed", G_CALLBACK(selection_changed_cb), spec_dialog); |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
1489 g_signal_connect(G_OBJECT(spec_dialog->treeview), "row-activated", G_CALLBACK(email_row_activated_cb), NULL); |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
1490 |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
1491 column = gtk_tree_view_column_new(); |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
1492 gtk_tree_view_column_set_resizable(column, TRUE); |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
1493 rend = gtk_cell_renderer_pixbuf_new(); |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
1494 gtk_tree_view_column_pack_start(column, rend, FALSE); |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
1495 |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
1496 gtk_tree_view_column_set_attributes(column, rend, "pixbuf", PIDGIN_MAIL_ICON, NULL); |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
1497 rend = gtk_cell_renderer_text_new(); |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
1498 gtk_tree_view_column_pack_start(column, rend, TRUE); |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
1499 gtk_tree_view_column_set_attributes(column, rend, "markup", PIDGIN_MAIL_TEXT, NULL); |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
1500 gtk_tree_view_append_column(GTK_TREE_VIEW(spec_dialog->treeview), column); |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
1501 |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
1502 label = gtk_label_new(NULL); |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
1503 gtk_label_set_markup(GTK_LABEL(label), _("<span weight=\"bold\" size=\"larger\">You have mail!</span>")); |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
1504 |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
1505 } else if (type == PIDGIN_NOTIFY_POUNCE) { |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
1506 gtk_window_set_title(GTK_WINDOW(dialog), _("New Pounces")); |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
1507 |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
1508 button = gtk_dialog_add_button(GTK_DIALOG(dialog), |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
1509 _("Dismiss"), GTK_RESPONSE_NO); |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
1510 gtk_widget_set_sensitive(button, FALSE); |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
1511 spec_dialog->dismiss_button = button; |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
1512 |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
1513 button = gtk_dialog_add_button(GTK_DIALOG(dialog), |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
1514 PIDGIN_STOCK_EDIT, GTK_RESPONSE_APPLY); |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
1515 gtk_widget_set_sensitive(button, FALSE); |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
1516 spec_dialog->edit_button = button; |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
1517 |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
1518 g_signal_connect(G_OBJECT(dialog), "response", |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
1519 G_CALLBACK(pounce_response_cb), spec_dialog); |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
1520 |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
1521 column = gtk_tree_view_column_new(); |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
1522 gtk_tree_view_column_set_title(column, _("Buddy")); |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
1523 gtk_tree_view_column_set_resizable(column, TRUE); |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
1524 rend = gtk_cell_renderer_pixbuf_new(); |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
1525 gtk_tree_view_column_pack_start(column, rend, FALSE); |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
1526 |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
1527 gtk_tree_view_column_set_attributes(column, rend, "pixbuf", PIDGIN_POUNCE_ICON, NULL); |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
1528 rend = gtk_cell_renderer_text_new(); |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
1529 gtk_tree_view_column_pack_start(column, rend, FALSE); |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
1530 gtk_tree_view_column_add_attribute(column, rend, "text", PIDGIN_POUNCE_ALIAS); |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
1531 gtk_tree_view_append_column(GTK_TREE_VIEW(spec_dialog->treeview), column); |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
1532 |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
1533 column = gtk_tree_view_column_new(); |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
1534 gtk_tree_view_column_set_title(column, _("Event")); |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
1535 gtk_tree_view_column_set_resizable(column, TRUE); |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
1536 rend = gtk_cell_renderer_text_new(); |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
1537 gtk_tree_view_column_pack_start(column, rend, FALSE); |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
1538 gtk_tree_view_column_add_attribute(column, rend, "text", PIDGIN_POUNCE_EVENT); |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
1539 gtk_tree_view_append_column(GTK_TREE_VIEW(spec_dialog->treeview), column); |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
1540 |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
1541 column = gtk_tree_view_column_new(); |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
1542 gtk_tree_view_column_set_title(column, _("Message")); |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
1543 gtk_tree_view_column_set_resizable(column, TRUE); |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
1544 rend = gtk_cell_renderer_text_new(); |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
1545 gtk_tree_view_column_pack_start(column, rend, FALSE); |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
1546 gtk_tree_view_column_add_attribute(column, rend, "text", PIDGIN_POUNCE_TEXT); |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
1547 gtk_tree_view_append_column(GTK_TREE_VIEW(spec_dialog->treeview), column); |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
1548 |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
1549 column = gtk_tree_view_column_new(); |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
1550 gtk_tree_view_column_set_title(column, _("Date")); |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
1551 gtk_tree_view_column_set_resizable(column, TRUE); |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
1552 rend = gtk_cell_renderer_text_new(); |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
1553 gtk_tree_view_column_pack_start(column, rend, FALSE); |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
1554 gtk_tree_view_column_add_attribute(column, rend, "text", PIDGIN_POUNCE_DATE); |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
1555 gtk_tree_view_append_column(GTK_TREE_VIEW(spec_dialog->treeview), column); |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
1556 |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
1557 label = gtk_label_new(NULL); |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
1558 gtk_label_set_markup(GTK_LABEL(label), _("<span weight=\"bold\" size=\"larger\">You have pounced!</span>")); |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
1559 |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
1560 sel = gtk_tree_view_get_selection(GTK_TREE_VIEW(spec_dialog->treeview)); |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
1561 gtk_tree_selection_set_mode(sel, GTK_SELECTION_SINGLE); |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
1562 g_signal_connect(G_OBJECT(sel), "changed", |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
1563 G_CALLBACK(pounce_row_selected_cb), NULL); |
28407
f6cdf5f72479
Add a row-activation event for the Pounces dialog to open a new conversation window.
salinasv@gmail.com
parents:
27344
diff
changeset
|
1564 g_signal_connect(G_OBJECT(spec_dialog->treeview), "row-activated", |
f6cdf5f72479
Add a row-activation event for the Pounces dialog to open a new conversation window.
salinasv@gmail.com
parents:
27344
diff
changeset
|
1565 G_CALLBACK(pounce_row_activated_cb), NULL); |
26268
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
1566 } |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
1567 |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
1568 gtk_label_set_line_wrap(GTK_LABEL(label), TRUE); |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
1569 gtk_misc_set_alignment(GTK_MISC(label), 0, 0); |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
1570 gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0); |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
1571 gtk_box_pack_start(GTK_BOX(vbox), sw, TRUE, TRUE, 2); |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
1572 |
27338
c245c583a1a6
Remove a few layers of evil abstraction.
Paul Aurich <paul@darkrain42.org>
parents:
27337
diff
changeset
|
1573 return spec_dialog; |
26268
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
1574 } |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24497
diff
changeset
|
1575 |
27325
ecdc58da4cdd
Clear the notifications via a signal instead of pidgin_close_notify.
Paul Aurich <paul@darkrain42.org>
parents:
27318
diff
changeset
|
1576 static void |
ecdc58da4cdd
Clear the notifications via a signal instead of pidgin_close_notify.
Paul Aurich <paul@darkrain42.org>
parents:
27318
diff
changeset
|
1577 signed_off_cb(PurpleConnection *gc, gpointer unused) |
ecdc58da4cdd
Clear the notifications via a signal instead of pidgin_close_notify.
Paul Aurich <paul@darkrain42.org>
parents:
27318
diff
changeset
|
1578 { |
ecdc58da4cdd
Clear the notifications via a signal instead of pidgin_close_notify.
Paul Aurich <paul@darkrain42.org>
parents:
27318
diff
changeset
|
1579 /* Clear any pending emails for this account */ |
ecdc58da4cdd
Clear the notifications via a signal instead of pidgin_close_notify.
Paul Aurich <paul@darkrain42.org>
parents:
27318
diff
changeset
|
1580 pidgin_notify_emails(gc, 0, FALSE, NULL, NULL, NULL, NULL); |
27340
fc920924cea3
Close the mail dialog at signoff if it's empty. Closes #9345.
Paul Aurich <paul@darkrain42.org>
parents:
27339
diff
changeset
|
1581 |
27342
8796eaaca38a
Fix the mail_dialog->total_count and use that to tell when the dialog is empty.
Paul Aurich <paul@darkrain42.org>
parents:
27340
diff
changeset
|
1582 if (mail_dialog != NULL && mail_dialog->total_count == 0) |
27340
fc920924cea3
Close the mail dialog at signoff if it's empty. Closes #9345.
Paul Aurich <paul@darkrain42.org>
parents:
27339
diff
changeset
|
1583 reset_mail_dialog(NULL); |
27325
ecdc58da4cdd
Clear the notifications via a signal instead of pidgin_close_notify.
Paul Aurich <paul@darkrain42.org>
parents:
27318
diff
changeset
|
1584 } |
ecdc58da4cdd
Clear the notifications via a signal instead of pidgin_close_notify.
Paul Aurich <paul@darkrain42.org>
parents:
27318
diff
changeset
|
1585 |
ecdc58da4cdd
Clear the notifications via a signal instead of pidgin_close_notify.
Paul Aurich <paul@darkrain42.org>
parents:
27318
diff
changeset
|
1586 static void* |
ecdc58da4cdd
Clear the notifications via a signal instead of pidgin_close_notify.
Paul Aurich <paul@darkrain42.org>
parents:
27318
diff
changeset
|
1587 pidgin_notify_get_handle(void) |
ecdc58da4cdd
Clear the notifications via a signal instead of pidgin_close_notify.
Paul Aurich <paul@darkrain42.org>
parents:
27318
diff
changeset
|
1588 { |
ecdc58da4cdd
Clear the notifications via a signal instead of pidgin_close_notify.
Paul Aurich <paul@darkrain42.org>
parents:
27318
diff
changeset
|
1589 static int handle; |
ecdc58da4cdd
Clear the notifications via a signal instead of pidgin_close_notify.
Paul Aurich <paul@darkrain42.org>
parents:
27318
diff
changeset
|
1590 return &handle; |
ecdc58da4cdd
Clear the notifications via a signal instead of pidgin_close_notify.
Paul Aurich <paul@darkrain42.org>
parents:
27318
diff
changeset
|
1591 } |
ecdc58da4cdd
Clear the notifications via a signal instead of pidgin_close_notify.
Paul Aurich <paul@darkrain42.org>
parents:
27318
diff
changeset
|
1592 |
ecdc58da4cdd
Clear the notifications via a signal instead of pidgin_close_notify.
Paul Aurich <paul@darkrain42.org>
parents:
27318
diff
changeset
|
1593 void pidgin_notify_init(void) |
ecdc58da4cdd
Clear the notifications via a signal instead of pidgin_close_notify.
Paul Aurich <paul@darkrain42.org>
parents:
27318
diff
changeset
|
1594 { |
ecdc58da4cdd
Clear the notifications via a signal instead of pidgin_close_notify.
Paul Aurich <paul@darkrain42.org>
parents:
27318
diff
changeset
|
1595 void *handle = pidgin_notify_get_handle(); |
ecdc58da4cdd
Clear the notifications via a signal instead of pidgin_close_notify.
Paul Aurich <paul@darkrain42.org>
parents:
27318
diff
changeset
|
1596 |
ecdc58da4cdd
Clear the notifications via a signal instead of pidgin_close_notify.
Paul Aurich <paul@darkrain42.org>
parents:
27318
diff
changeset
|
1597 purple_signal_connect(purple_connections_get_handle(), "signed-off", |
ecdc58da4cdd
Clear the notifications via a signal instead of pidgin_close_notify.
Paul Aurich <paul@darkrain42.org>
parents:
27318
diff
changeset
|
1598 handle, PURPLE_CALLBACK(signed_off_cb), NULL); |
ecdc58da4cdd
Clear the notifications via a signal instead of pidgin_close_notify.
Paul Aurich <paul@darkrain42.org>
parents:
27318
diff
changeset
|
1599 } |
ecdc58da4cdd
Clear the notifications via a signal instead of pidgin_close_notify.
Paul Aurich <paul@darkrain42.org>
parents:
27318
diff
changeset
|
1600 |
ecdc58da4cdd
Clear the notifications via a signal instead of pidgin_close_notify.
Paul Aurich <paul@darkrain42.org>
parents:
27318
diff
changeset
|
1601 void pidgin_notify_uninit(void) |
ecdc58da4cdd
Clear the notifications via a signal instead of pidgin_close_notify.
Paul Aurich <paul@darkrain42.org>
parents:
27318
diff
changeset
|
1602 { |
ecdc58da4cdd
Clear the notifications via a signal instead of pidgin_close_notify.
Paul Aurich <paul@darkrain42.org>
parents:
27318
diff
changeset
|
1603 purple_signals_disconnect_by_handle(pidgin_notify_get_handle()); |
ecdc58da4cdd
Clear the notifications via a signal instead of pidgin_close_notify.
Paul Aurich <paul@darkrain42.org>
parents:
27318
diff
changeset
|
1604 } |
ecdc58da4cdd
Clear the notifications via a signal instead of pidgin_close_notify.
Paul Aurich <paul@darkrain42.org>
parents:
27318
diff
changeset
|
1605 |
15823 | 1606 static PurpleNotifyUiOps ops = |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1607 { |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15436
diff
changeset
|
1608 pidgin_notify_message, |
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15436
diff
changeset
|
1609 pidgin_notify_email, |
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15436
diff
changeset
|
1610 pidgin_notify_emails, |
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15436
diff
changeset
|
1611 pidgin_notify_formatted, |
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15436
diff
changeset
|
1612 pidgin_notify_searchresults, |
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15436
diff
changeset
|
1613 pidgin_notify_searchresults_new_rows, |
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15436
diff
changeset
|
1614 pidgin_notify_userinfo, |
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15436
diff
changeset
|
1615 pidgin_notify_uri, |
16681
fbf111436896
Patch from John 'rekkanoryo' Bailey to add the padding struct members in pidgin
Gary Kramlich <grim@reaperworld.com>
parents:
16198
diff
changeset
|
1616 pidgin_close_notify, |
fbf111436896
Patch from John 'rekkanoryo' Bailey to add the padding struct members in pidgin
Gary Kramlich <grim@reaperworld.com>
parents:
16198
diff
changeset
|
1617 NULL, |
fbf111436896
Patch from John 'rekkanoryo' Bailey to add the padding struct members in pidgin
Gary Kramlich <grim@reaperworld.com>
parents:
16198
diff
changeset
|
1618 NULL, |
fbf111436896
Patch from John 'rekkanoryo' Bailey to add the padding struct members in pidgin
Gary Kramlich <grim@reaperworld.com>
parents:
16198
diff
changeset
|
1619 NULL, |
fbf111436896
Patch from John 'rekkanoryo' Bailey to add the padding struct members in pidgin
Gary Kramlich <grim@reaperworld.com>
parents:
16198
diff
changeset
|
1620 NULL |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1621 }; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1622 |
15823 | 1623 PurpleNotifyUiOps * |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15436
diff
changeset
|
1624 pidgin_notify_get_ui_ops(void) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1625 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1626 return &ops; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1627 } |