Mercurial > pidgin
annotate pidgin/gtknotify.c @ 32808:b8cbd52e26b1
Remove _with_imgstore suffix on this function. There isn't a version
without it anyway.
author | Elliott Sales de Andrade <qulogic@pidgin.im> |
---|---|
date | Thu, 31 May 2012 00:36:55 +0000 |
parents | 763d65f3f758 |
children |
rev | line source |
---|---|
15373
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 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7 * |
15870
66dff3dfdea6
Re-sed the copyright notices so they don't all talk about Purple.
Richard Laager <rlaager@wiktel.com>
parents:
15822
diff
changeset
|
8 * Pidgin is the legal property of its developers, whose names are too numerous |
15373
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 |
19681
44b4e8bd759b
The FSF changed its address a while ago; our files were out of date.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
19654
diff
changeset
|
24 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA |
15373
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" |
15513 | 27 #include "pidgin.h" |
15373
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 |
26186
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
31 #include "account.h" |
15373
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" |
15821
84b0f9b23ede
According to etags, pidgin/ should be completely clean of references to 'gaim' as a client
Sean Egan <seanegan@gmail.com>
parents:
15820
diff
changeset
|
35 #include "pidginstock.h" |
15373
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 "gtknotify.h" |
26186
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
40 #include "gtkpounce.h" |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
41 #include "gtkutils.h" |
32059 | 42 #include "gtkwebview.h" |
15373
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 { |
17620
c1c533448097
sadrul's fix for the userinfo notify crash on disconnect that was caused by
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16977
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:
16977
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:
16977
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:
16977
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:
16977
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:
16977
diff
changeset
|
51 { |
15822 | 52 PurpleAccount *account; |
15373
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; |
22851
66914f306712
More plumbing work.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22208
diff
changeset
|
56 gboolean purple_has_handle; |
15820 | 57 } PidginNotifyMailData; |
15373
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 { |
15822 | 61 PurpleAccount *account; |
26186
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
62 PurplePounce *pounce; |
28072
74ce58c7bc30
Further pounce dialog improvements. Refs #10037.
Paul Aurich <paul@darkrain42.org>
parents:
28062
diff
changeset
|
63 char *pouncee; |
26186
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
64 } PidginNotifyPounceData; |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
65 |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
66 |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
67 typedef struct |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
68 { |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
69 PurpleAccount *account; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
70 GtkListStore *model; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
71 GtkWidget *treeview; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
72 GtkWidget *window; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
73 gpointer user_data; |
15822 | 74 PurpleNotifySearchResults *results; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
75 |
15820 | 76 } PidginNotifySearchResultsData; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
77 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
78 typedef struct |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
79 { |
15822 | 80 PurpleNotifySearchButton *button; |
15820 | 81 PidginNotifySearchResultsData *data; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
82 |
15820 | 83 } PidginNotifySearchResultsButtonData; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
84 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
85 enum |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
86 { |
15819
c02a897a67c7
More Gaim to Pidgin changes
Sean Egan <seanegan@gmail.com>
parents:
15734
diff
changeset
|
87 PIDGIN_MAIL_ICON, |
c02a897a67c7
More Gaim to Pidgin changes
Sean Egan <seanegan@gmail.com>
parents:
15734
diff
changeset
|
88 PIDGIN_MAIL_TEXT, |
c02a897a67c7
More Gaim to Pidgin changes
Sean Egan <seanegan@gmail.com>
parents:
15734
diff
changeset
|
89 PIDGIN_MAIL_DATA, |
c02a897a67c7
More Gaim to Pidgin changes
Sean Egan <seanegan@gmail.com>
parents:
15734
diff
changeset
|
90 COLUMNS_PIDGIN_MAIL |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
91 }; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
92 |
26186
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
93 enum |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
94 { |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
95 PIDGIN_POUNCE_ICON, |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
96 PIDGIN_POUNCE_ALIAS, |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
97 PIDGIN_POUNCE_EVENT, |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
98 PIDGIN_POUNCE_TEXT, |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
99 PIDGIN_POUNCE_DATE, |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
100 PIDGIN_POUNCE_DATA, |
27262
975a29213f35
Use mail_dialog consistently, instead of switching from one line to the next. Various other cleanups, too.
Paul Aurich <paul@darkrain42.org>
parents:
27260
diff
changeset
|
101 COLUMNS_PIDGIN_POUNCE |
26186
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
102 }; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
103 |
26186
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
104 |
27257
c7768f23f519
Remove the PidginMailDialog typedef.
Paul Aurich <paul@darkrain42.org>
parents:
27256
diff
changeset
|
105 typedef struct _PidginNotifyDialog |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
106 { |
27256
c245c583a1a6
Remove a few layers of evil abstraction.
Paul Aurich <paul@darkrain42.org>
parents:
27255
diff
changeset
|
107 /* |
c245c583a1a6
Remove a few layers of evil abstraction.
Paul Aurich <paul@darkrain42.org>
parents:
27255
diff
changeset
|
108 * This must be first so PidginNotifyDialog can masquerade as the |
c245c583a1a6
Remove a few layers of evil abstraction.
Paul Aurich <paul@darkrain42.org>
parents:
27255
diff
changeset
|
109 * dialog widget. |
c245c583a1a6
Remove a few layers of evil abstraction.
Paul Aurich <paul@darkrain42.org>
parents:
27255
diff
changeset
|
110 */ |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
111 GtkWidget *dialog; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
112 GtkWidget *treeview; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
113 GtkTreeStore *treemodel; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
114 GtkLabel *label; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
115 GtkWidget *open_button; |
26186
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
116 GtkWidget *dismiss_button; |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
117 GtkWidget *edit_button; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
118 int total_count; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
119 gboolean in_use; |
27257
c7768f23f519
Remove the PidginMailDialog typedef.
Paul Aurich <paul@darkrain42.org>
parents:
27256
diff
changeset
|
120 } PidginNotifyDialog; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
121 |
26186
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
122 typedef enum |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
123 { |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
124 PIDGIN_NOTIFY_MAIL, |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
125 PIDGIN_NOTIFY_POUNCE, |
27035
9c36a340fcaf
Setting `dialog->open_button = button` when `button` is not yet assigned
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26840
diff
changeset
|
126 PIDGIN_NOTIFY_TYPES |
26186
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
127 } PidginNotifyType; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
128 |
26186
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
129 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:
24552
diff
changeset
|
130 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:
24552
diff
changeset
|
131 |
27262
975a29213f35
Use mail_dialog consistently, instead of switching from one line to the next. Various other cleanups, too.
Paul Aurich <paul@darkrain42.org>
parents:
27260
diff
changeset
|
132 static PidginNotifyDialog *pidgin_create_notification_dialog(PidginNotifyType type); |
15822 | 133 static void *pidgin_notify_emails(PurpleConnection *gc, size_t count, gboolean detailed, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
134 const char **subjects, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
135 const char **froms, const char **tos, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
136 const char **urls); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
137 |
22851
66914f306712
More plumbing work.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22208
diff
changeset
|
138 static void pidgin_close_notify(PurpleNotifyType type, void *ui_handle); |
66914f306712
More plumbing work.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22208
diff
changeset
|
139 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
140 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
141 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
|
142 { |
15822 | 143 purple_notify_close(PURPLE_NOTIFY_MESSAGE, widget); |
15373
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 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
146 static void |
26186
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
147 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:
24552
diff
changeset
|
148 { |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
149 GtkTreeIter iter; |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
150 PidginNotifyPounceData *pounce_data; |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
151 |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
152 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:
24552
diff
changeset
|
153 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:
24552
diff
changeset
|
154 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:
24552
diff
changeset
|
155 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:
24552
diff
changeset
|
156 -1); |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
157 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:
24552
diff
changeset
|
158 |
28072
74ce58c7bc30
Further pounce dialog improvements. Refs #10037.
Paul Aurich <paul@darkrain42.org>
parents:
28062
diff
changeset
|
159 g_free(pounce_data->pouncee); |
26186
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
160 g_free(pounce_data); |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
161 } |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
162 |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
163 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:
24552
diff
changeset
|
164 g_free(pounce_dialog); |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
165 pounce_dialog = NULL; |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
166 } |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
167 |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
168 static void |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
169 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:
24552
diff
changeset
|
170 GtkTreeIter *iter, gpointer data) |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
171 { |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
172 PidginNotifyPounceData *pounce_data; |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
173 |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
174 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:
24552
diff
changeset
|
175 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:
24552
diff
changeset
|
176 -1); |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
177 |
28072
74ce58c7bc30
Further pounce dialog improvements. Refs #10037.
Paul Aurich <paul@darkrain42.org>
parents:
28062
diff
changeset
|
178 if (pounce_data != NULL) { |
74ce58c7bc30
Further pounce dialog improvements. Refs #10037.
Paul Aurich <paul@darkrain42.org>
parents:
28062
diff
changeset
|
179 g_free(pounce_data->pouncee); |
26186
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
180 g_free(pounce_data); |
28072
74ce58c7bc30
Further pounce dialog improvements. Refs #10037.
Paul Aurich <paul@darkrain42.org>
parents:
28062
diff
changeset
|
181 } |
74ce58c7bc30
Further pounce dialog improvements. Refs #10037.
Paul Aurich <paul@darkrain42.org>
parents:
28062
diff
changeset
|
182 } |
74ce58c7bc30
Further pounce dialog improvements. Refs #10037.
Paul Aurich <paul@darkrain42.org>
parents:
28062
diff
changeset
|
183 |
74ce58c7bc30
Further pounce dialog improvements. Refs #10037.
Paul Aurich <paul@darkrain42.org>
parents:
28062
diff
changeset
|
184 static void |
74ce58c7bc30
Further pounce dialog improvements. Refs #10037.
Paul Aurich <paul@darkrain42.org>
parents:
28062
diff
changeset
|
185 open_im_foreach(GtkTreeModel *model, GtkTreePath *path, |
74ce58c7bc30
Further pounce dialog improvements. Refs #10037.
Paul Aurich <paul@darkrain42.org>
parents:
28062
diff
changeset
|
186 GtkTreeIter *iter, gpointer data) |
74ce58c7bc30
Further pounce dialog improvements. Refs #10037.
Paul Aurich <paul@darkrain42.org>
parents:
28062
diff
changeset
|
187 { |
74ce58c7bc30
Further pounce dialog improvements. Refs #10037.
Paul Aurich <paul@darkrain42.org>
parents:
28062
diff
changeset
|
188 PidginNotifyPounceData *pounce_data; |
74ce58c7bc30
Further pounce dialog improvements. Refs #10037.
Paul Aurich <paul@darkrain42.org>
parents:
28062
diff
changeset
|
189 |
74ce58c7bc30
Further pounce dialog improvements. Refs #10037.
Paul Aurich <paul@darkrain42.org>
parents:
28062
diff
changeset
|
190 gtk_tree_model_get(model, iter, |
74ce58c7bc30
Further pounce dialog improvements. Refs #10037.
Paul Aurich <paul@darkrain42.org>
parents:
28062
diff
changeset
|
191 PIDGIN_POUNCE_DATA, &pounce_data, |
74ce58c7bc30
Further pounce dialog improvements. Refs #10037.
Paul Aurich <paul@darkrain42.org>
parents:
28062
diff
changeset
|
192 -1); |
74ce58c7bc30
Further pounce dialog improvements. Refs #10037.
Paul Aurich <paul@darkrain42.org>
parents:
28062
diff
changeset
|
193 |
74ce58c7bc30
Further pounce dialog improvements. Refs #10037.
Paul Aurich <paul@darkrain42.org>
parents:
28062
diff
changeset
|
194 if (pounce_data != NULL) { |
74ce58c7bc30
Further pounce dialog improvements. Refs #10037.
Paul Aurich <paul@darkrain42.org>
parents:
28062
diff
changeset
|
195 PurpleConversation *conv; |
74ce58c7bc30
Further pounce dialog improvements. Refs #10037.
Paul Aurich <paul@darkrain42.org>
parents:
28062
diff
changeset
|
196 |
74ce58c7bc30
Further pounce dialog improvements. Refs #10037.
Paul Aurich <paul@darkrain42.org>
parents:
28062
diff
changeset
|
197 conv = purple_conversation_new(PURPLE_CONV_TYPE_IM, |
74ce58c7bc30
Further pounce dialog improvements. Refs #10037.
Paul Aurich <paul@darkrain42.org>
parents:
28062
diff
changeset
|
198 pounce_data->account, pounce_data->pouncee); |
74ce58c7bc30
Further pounce dialog improvements. Refs #10037.
Paul Aurich <paul@darkrain42.org>
parents:
28062
diff
changeset
|
199 purple_conversation_present(conv); |
74ce58c7bc30
Further pounce dialog improvements. Refs #10037.
Paul Aurich <paul@darkrain42.org>
parents:
28062
diff
changeset
|
200 } |
26186
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
201 } |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
202 |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
203 static void |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
204 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:
24552
diff
changeset
|
205 GtkTreeIter *iter, gpointer data) |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
206 { |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
207 GList **list = data; |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
208 *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:
24552
diff
changeset
|
209 } |
28062
4b61989ab198
Close the Pounce dialog when you dismiss the last pounce.
salinasv@gmail.com
parents:
28057
diff
changeset
|
210 |
26186
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
211 static void |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
212 pounce_response_dismiss() |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
213 { |
28084
9affcab62522
pounce dialog: Try to always have a row selected. Fixes #10037.
Paul Aurich <paul@darkrain42.org>
parents:
28083
diff
changeset
|
214 GtkTreeModel *model = GTK_TREE_MODEL(pounce_dialog->treemodel); |
26186
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
215 GtkTreeSelection *selection; |
28062
4b61989ab198
Close the Pounce dialog when you dismiss the last pounce.
salinasv@gmail.com
parents:
28057
diff
changeset
|
216 GtkTreeIter iter; |
28084
9affcab62522
pounce dialog: Try to always have a row selected. Fixes #10037.
Paul Aurich <paul@darkrain42.org>
parents:
28083
diff
changeset
|
217 GtkTreeIter new_selection; |
26186
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
218 GList *list = NULL; |
28084
9affcab62522
pounce dialog: Try to always have a row selected. Fixes #10037.
Paul Aurich <paul@darkrain42.org>
parents:
28083
diff
changeset
|
219 gboolean found_selection = FALSE; |
26186
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
220 |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
221 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:
24552
diff
changeset
|
222 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:
24552
diff
changeset
|
223 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:
24552
diff
changeset
|
224 |
28084
9affcab62522
pounce dialog: Try to always have a row selected. Fixes #10037.
Paul Aurich <paul@darkrain42.org>
parents:
28083
diff
changeset
|
225 g_return_if_fail(list != NULL); |
9affcab62522
pounce dialog: Try to always have a row selected. Fixes #10037.
Paul Aurich <paul@darkrain42.org>
parents:
28083
diff
changeset
|
226 |
9affcab62522
pounce dialog: Try to always have a row selected. Fixes #10037.
Paul Aurich <paul@darkrain42.org>
parents:
28083
diff
changeset
|
227 if (list->next == NULL) { |
9affcab62522
pounce dialog: Try to always have a row selected. Fixes #10037.
Paul Aurich <paul@darkrain42.org>
parents:
28083
diff
changeset
|
228 gtk_tree_model_get_iter(model, &new_selection, list->data); |
9affcab62522
pounce dialog: Try to always have a row selected. Fixes #10037.
Paul Aurich <paul@darkrain42.org>
parents:
28083
diff
changeset
|
229 if (gtk_tree_model_iter_next(model, &new_selection)) |
9affcab62522
pounce dialog: Try to always have a row selected. Fixes #10037.
Paul Aurich <paul@darkrain42.org>
parents:
28083
diff
changeset
|
230 found_selection = TRUE; |
9affcab62522
pounce dialog: Try to always have a row selected. Fixes #10037.
Paul Aurich <paul@darkrain42.org>
parents:
28083
diff
changeset
|
231 else { |
9affcab62522
pounce dialog: Try to always have a row selected. Fixes #10037.
Paul Aurich <paul@darkrain42.org>
parents:
28083
diff
changeset
|
232 /* This is the last thing in the list */ |
9affcab62522
pounce dialog: Try to always have a row selected. Fixes #10037.
Paul Aurich <paul@darkrain42.org>
parents:
28083
diff
changeset
|
233 GtkTreePath *path; |
9affcab62522
pounce dialog: Try to always have a row selected. Fixes #10037.
Paul Aurich <paul@darkrain42.org>
parents:
28083
diff
changeset
|
234 |
9affcab62522
pounce dialog: Try to always have a row selected. Fixes #10037.
Paul Aurich <paul@darkrain42.org>
parents:
28083
diff
changeset
|
235 /* Because gtk_tree_model_iter_prev doesn't exist... */ |
9affcab62522
pounce dialog: Try to always have a row selected. Fixes #10037.
Paul Aurich <paul@darkrain42.org>
parents:
28083
diff
changeset
|
236 gtk_tree_model_get_iter(model, &new_selection, list->data); |
9affcab62522
pounce dialog: Try to always have a row selected. Fixes #10037.
Paul Aurich <paul@darkrain42.org>
parents:
28083
diff
changeset
|
237 path = gtk_tree_model_get_path(model, &new_selection); |
9affcab62522
pounce dialog: Try to always have a row selected. Fixes #10037.
Paul Aurich <paul@darkrain42.org>
parents:
28083
diff
changeset
|
238 if (gtk_tree_path_prev(path)) { |
9affcab62522
pounce dialog: Try to always have a row selected. Fixes #10037.
Paul Aurich <paul@darkrain42.org>
parents:
28083
diff
changeset
|
239 gtk_tree_model_get_iter(model, &new_selection, path); |
9affcab62522
pounce dialog: Try to always have a row selected. Fixes #10037.
Paul Aurich <paul@darkrain42.org>
parents:
28083
diff
changeset
|
240 found_selection = TRUE; |
9affcab62522
pounce dialog: Try to always have a row selected. Fixes #10037.
Paul Aurich <paul@darkrain42.org>
parents:
28083
diff
changeset
|
241 } |
9affcab62522
pounce dialog: Try to always have a row selected. Fixes #10037.
Paul Aurich <paul@darkrain42.org>
parents:
28083
diff
changeset
|
242 |
9affcab62522
pounce dialog: Try to always have a row selected. Fixes #10037.
Paul Aurich <paul@darkrain42.org>
parents:
28083
diff
changeset
|
243 gtk_tree_path_free(path); |
9affcab62522
pounce dialog: Try to always have a row selected. Fixes #10037.
Paul Aurich <paul@darkrain42.org>
parents:
28083
diff
changeset
|
244 } |
9affcab62522
pounce dialog: Try to always have a row selected. Fixes #10037.
Paul Aurich <paul@darkrain42.org>
parents:
28083
diff
changeset
|
245 } |
9affcab62522
pounce dialog: Try to always have a row selected. Fixes #10037.
Paul Aurich <paul@darkrain42.org>
parents:
28083
diff
changeset
|
246 |
26186
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
247 while (list) { |
28084
9affcab62522
pounce dialog: Try to always have a row selected. Fixes #10037.
Paul Aurich <paul@darkrain42.org>
parents:
28083
diff
changeset
|
248 if (gtk_tree_model_get_iter(model, &iter, list->data)) { |
26186
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
249 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:
24552
diff
changeset
|
250 } |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
251 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:
24552
diff
changeset
|
252 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:
24552
diff
changeset
|
253 } |
28062
4b61989ab198
Close the Pounce dialog when you dismiss the last pounce.
salinasv@gmail.com
parents:
28057
diff
changeset
|
254 |
28084
9affcab62522
pounce dialog: Try to always have a row selected. Fixes #10037.
Paul Aurich <paul@darkrain42.org>
parents:
28083
diff
changeset
|
255 if (gtk_tree_model_get_iter_first(model, &iter)) { |
9affcab62522
pounce dialog: Try to always have a row selected. Fixes #10037.
Paul Aurich <paul@darkrain42.org>
parents:
28083
diff
changeset
|
256 if (found_selection) |
9affcab62522
pounce dialog: Try to always have a row selected. Fixes #10037.
Paul Aurich <paul@darkrain42.org>
parents:
28083
diff
changeset
|
257 gtk_tree_selection_select_iter(selection, &new_selection); |
9affcab62522
pounce dialog: Try to always have a row selected. Fixes #10037.
Paul Aurich <paul@darkrain42.org>
parents:
28083
diff
changeset
|
258 else |
9affcab62522
pounce dialog: Try to always have a row selected. Fixes #10037.
Paul Aurich <paul@darkrain42.org>
parents:
28083
diff
changeset
|
259 gtk_tree_selection_select_iter(selection, &iter); |
9affcab62522
pounce dialog: Try to always have a row selected. Fixes #10037.
Paul Aurich <paul@darkrain42.org>
parents:
28083
diff
changeset
|
260 } else |
28062
4b61989ab198
Close the Pounce dialog when you dismiss the last pounce.
salinasv@gmail.com
parents:
28057
diff
changeset
|
261 pounce_response_close(pounce_dialog); |
26186
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
262 } |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
263 |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
264 static void |
28072
74ce58c7bc30
Further pounce dialog improvements. Refs #10037.
Paul Aurich <paul@darkrain42.org>
parents:
28062
diff
changeset
|
265 pounce_response_open_ims() |
74ce58c7bc30
Further pounce dialog improvements. Refs #10037.
Paul Aurich <paul@darkrain42.org>
parents:
28062
diff
changeset
|
266 { |
74ce58c7bc30
Further pounce dialog improvements. Refs #10037.
Paul Aurich <paul@darkrain42.org>
parents:
28062
diff
changeset
|
267 GtkTreeSelection *selection; |
74ce58c7bc30
Further pounce dialog improvements. Refs #10037.
Paul Aurich <paul@darkrain42.org>
parents:
28062
diff
changeset
|
268 |
74ce58c7bc30
Further pounce dialog improvements. Refs #10037.
Paul Aurich <paul@darkrain42.org>
parents:
28062
diff
changeset
|
269 selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(pounce_dialog->treeview)); |
74ce58c7bc30
Further pounce dialog improvements. Refs #10037.
Paul Aurich <paul@darkrain42.org>
parents:
28062
diff
changeset
|
270 gtk_tree_selection_selected_foreach(selection, open_im_foreach, pounce_dialog); |
28084
9affcab62522
pounce dialog: Try to always have a row selected. Fixes #10037.
Paul Aurich <paul@darkrain42.org>
parents:
28083
diff
changeset
|
271 |
28072
74ce58c7bc30
Further pounce dialog improvements. Refs #10037.
Paul Aurich <paul@darkrain42.org>
parents:
28062
diff
changeset
|
272 pounce_response_dismiss(); |
74ce58c7bc30
Further pounce dialog improvements. Refs #10037.
Paul Aurich <paul@darkrain42.org>
parents:
28062
diff
changeset
|
273 } |
74ce58c7bc30
Further pounce dialog improvements. Refs #10037.
Paul Aurich <paul@darkrain42.org>
parents:
28062
diff
changeset
|
274 |
74ce58c7bc30
Further pounce dialog improvements. Refs #10037.
Paul Aurich <paul@darkrain42.org>
parents:
28062
diff
changeset
|
275 static void |
26186
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
276 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:
24552
diff
changeset
|
277 GtkTreeIter *iter, gpointer data) |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
278 { |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
279 PidginNotifyPounceData *pounce_data; |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
280 PidginNotifyDialog *dialog = (PidginNotifyDialog*)data; |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
281 PurplePounce *pounce; |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
282 GList *list; |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
283 |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
284 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:
24552
diff
changeset
|
285 |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
286 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:
24552
diff
changeset
|
287 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:
24552
diff
changeset
|
288 -1); |
27255
357405dc8b2c
Remove trailing whitespace
Paul Aurich <paul@darkrain42.org>
parents:
27243
diff
changeset
|
289 |
26186
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
290 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:
24552
diff
changeset
|
291 pounce = list->data; |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
292 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:
24552
diff
changeset
|
293 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:
24552
diff
changeset
|
294 return; |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
295 } |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
296 } |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
297 |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
298 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:
24552
diff
changeset
|
299 } |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
300 |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
301 static void |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
302 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:
24552
diff
changeset
|
303 { |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
304 GtkTreeSelection *selection = NULL; |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
305 |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
306 switch (id) { |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
307 case GTK_RESPONSE_CLOSE: |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
308 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:
24552
diff
changeset
|
309 pounce_response_close(dialog); |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
310 break; |
28072
74ce58c7bc30
Further pounce dialog improvements. Refs #10037.
Paul Aurich <paul@darkrain42.org>
parents:
28062
diff
changeset
|
311 case GTK_RESPONSE_YES: |
74ce58c7bc30
Further pounce dialog improvements. Refs #10037.
Paul Aurich <paul@darkrain42.org>
parents:
28062
diff
changeset
|
312 pounce_response_open_ims(); |
74ce58c7bc30
Further pounce dialog improvements. Refs #10037.
Paul Aurich <paul@darkrain42.org>
parents:
28062
diff
changeset
|
313 break; |
26186
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
314 case GTK_RESPONSE_NO: |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
315 pounce_response_dismiss(); |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
316 break; |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
317 case GTK_RESPONSE_APPLY: |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
318 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:
24552
diff
changeset
|
319 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:
24552
diff
changeset
|
320 dialog); |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
321 break; |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
322 } |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
323 } |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
324 |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
325 static void |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
326 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:
24552
diff
changeset
|
327 GtkTreeViewColumn *col, gpointer data) |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
328 { |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
329 GtkTreeSelection *selection; |
28072
74ce58c7bc30
Further pounce dialog improvements. Refs #10037.
Paul Aurich <paul@darkrain42.org>
parents:
28062
diff
changeset
|
330 int count; |
26186
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
331 |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
332 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:
24552
diff
changeset
|
333 |
28072
74ce58c7bc30
Further pounce dialog improvements. Refs #10037.
Paul Aurich <paul@darkrain42.org>
parents:
28062
diff
changeset
|
334 count = gtk_tree_selection_count_selected_rows(selection); |
26186
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
335 |
28072
74ce58c7bc30
Further pounce dialog improvements. Refs #10037.
Paul Aurich <paul@darkrain42.org>
parents:
28062
diff
changeset
|
336 if (count == 0) { |
74ce58c7bc30
Further pounce dialog improvements. Refs #10037.
Paul Aurich <paul@darkrain42.org>
parents:
28062
diff
changeset
|
337 gtk_widget_set_sensitive(pounce_dialog->open_button, FALSE); |
74ce58c7bc30
Further pounce dialog improvements. Refs #10037.
Paul Aurich <paul@darkrain42.org>
parents:
28062
diff
changeset
|
338 gtk_widget_set_sensitive(pounce_dialog->edit_button, FALSE); |
74ce58c7bc30
Further pounce dialog improvements. Refs #10037.
Paul Aurich <paul@darkrain42.org>
parents:
28062
diff
changeset
|
339 gtk_widget_set_sensitive(pounce_dialog->dismiss_button, FALSE); |
74ce58c7bc30
Further pounce dialog improvements. Refs #10037.
Paul Aurich <paul@darkrain42.org>
parents:
28062
diff
changeset
|
340 } else if (count == 1) { |
74ce58c7bc30
Further pounce dialog improvements. Refs #10037.
Paul Aurich <paul@darkrain42.org>
parents:
28062
diff
changeset
|
341 GList *pounces; |
74ce58c7bc30
Further pounce dialog improvements. Refs #10037.
Paul Aurich <paul@darkrain42.org>
parents:
28062
diff
changeset
|
342 GList *list; |
26186
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
343 PidginNotifyPounceData *pounce_data; |
28072
74ce58c7bc30
Further pounce dialog improvements. Refs #10037.
Paul Aurich <paul@darkrain42.org>
parents:
28062
diff
changeset
|
344 GtkTreeIter iter; |
26186
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
345 |
28072
74ce58c7bc30
Further pounce dialog improvements. Refs #10037.
Paul Aurich <paul@darkrain42.org>
parents:
28062
diff
changeset
|
346 list = gtk_tree_selection_get_selected_rows(selection, NULL); |
74ce58c7bc30
Further pounce dialog improvements. Refs #10037.
Paul Aurich <paul@darkrain42.org>
parents:
28062
diff
changeset
|
347 gtk_tree_model_get_iter(GTK_TREE_MODEL(pounce_dialog->treemodel), |
74ce58c7bc30
Further pounce dialog improvements. Refs #10037.
Paul Aurich <paul@darkrain42.org>
parents:
28062
diff
changeset
|
348 &iter, list->data); |
26186
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
349 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:
24552
diff
changeset
|
350 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:
24552
diff
changeset
|
351 -1); |
28072
74ce58c7bc30
Further pounce dialog improvements. Refs #10037.
Paul Aurich <paul@darkrain42.org>
parents:
28062
diff
changeset
|
352 g_list_foreach(list, (GFunc)gtk_tree_path_free, NULL); |
74ce58c7bc30
Further pounce dialog improvements. Refs #10037.
Paul Aurich <paul@darkrain42.org>
parents:
28062
diff
changeset
|
353 g_list_free(list); |
26186
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
354 |
28072
74ce58c7bc30
Further pounce dialog improvements. Refs #10037.
Paul Aurich <paul@darkrain42.org>
parents:
28062
diff
changeset
|
355 pounces = purple_pounces_get_all(); |
74ce58c7bc30
Further pounce dialog improvements. Refs #10037.
Paul Aurich <paul@darkrain42.org>
parents:
28062
diff
changeset
|
356 for (; pounces != NULL; pounces = pounces->next) { |
74ce58c7bc30
Further pounce dialog improvements. Refs #10037.
Paul Aurich <paul@darkrain42.org>
parents:
28062
diff
changeset
|
357 PurplePounce *pounce = pounces->data; |
26186
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
358 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:
24552
diff
changeset
|
359 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:
24552
diff
changeset
|
360 break; |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
361 } |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
362 } |
27255
357405dc8b2c
Remove trailing whitespace
Paul Aurich <paul@darkrain42.org>
parents:
27243
diff
changeset
|
363 |
28072
74ce58c7bc30
Further pounce dialog improvements. Refs #10037.
Paul Aurich <paul@darkrain42.org>
parents:
28062
diff
changeset
|
364 gtk_widget_set_sensitive(pounce_dialog->open_button, TRUE); |
26186
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
365 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:
24552
diff
changeset
|
366 } else { |
28072
74ce58c7bc30
Further pounce dialog improvements. Refs #10037.
Paul Aurich <paul@darkrain42.org>
parents:
28062
diff
changeset
|
367 gtk_widget_set_sensitive(pounce_dialog->open_button, TRUE); |
26186
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
368 gtk_widget_set_sensitive(pounce_dialog->edit_button, FALSE); |
28072
74ce58c7bc30
Further pounce dialog improvements. Refs #10037.
Paul Aurich <paul@darkrain42.org>
parents:
28062
diff
changeset
|
369 gtk_widget_set_sensitive(pounce_dialog->dismiss_button, TRUE); |
26186
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
370 } |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
371 |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
372 |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
373 } |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
374 |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
375 static void |
27256
c245c583a1a6
Remove a few layers of evil abstraction.
Paul Aurich <paul@darkrain42.org>
parents:
27255
diff
changeset
|
376 reset_mail_dialog(GtkDialog *unused) |
c245c583a1a6
Remove a few layers of evil abstraction.
Paul Aurich <paul@darkrain42.org>
parents:
27255
diff
changeset
|
377 { |
c245c583a1a6
Remove a few layers of evil abstraction.
Paul Aurich <paul@darkrain42.org>
parents:
27255
diff
changeset
|
378 if (mail_dialog->in_use) |
c245c583a1a6
Remove a few layers of evil abstraction.
Paul Aurich <paul@darkrain42.org>
parents:
27255
diff
changeset
|
379 return; |
c245c583a1a6
Remove a few layers of evil abstraction.
Paul Aurich <paul@darkrain42.org>
parents:
27255
diff
changeset
|
380 gtk_widget_destroy(mail_dialog->dialog); |
c245c583a1a6
Remove a few layers of evil abstraction.
Paul Aurich <paul@darkrain42.org>
parents:
27255
diff
changeset
|
381 g_free(mail_dialog); |
c245c583a1a6
Remove a few layers of evil abstraction.
Paul Aurich <paul@darkrain42.org>
parents:
27255
diff
changeset
|
382 mail_dialog = NULL; |
c245c583a1a6
Remove a few layers of evil abstraction.
Paul Aurich <paul@darkrain42.org>
parents:
27255
diff
changeset
|
383 } |
c245c583a1a6
Remove a few layers of evil abstraction.
Paul Aurich <paul@darkrain42.org>
parents:
27255
diff
changeset
|
384 |
c245c583a1a6
Remove a few layers of evil abstraction.
Paul Aurich <paul@darkrain42.org>
parents:
27255
diff
changeset
|
385 static void |
27262
975a29213f35
Use mail_dialog consistently, instead of switching from one line to the next. Various other cleanups, too.
Paul Aurich <paul@darkrain42.org>
parents:
27260
diff
changeset
|
386 email_response_cb(GtkDialog *unused, gint id, PidginNotifyDialog *unused2) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
387 { |
15820 | 388 PidginNotifyMailData *data = NULL; |
27262
975a29213f35
Use mail_dialog consistently, instead of switching from one line to the next. Various other cleanups, too.
Paul Aurich <paul@darkrain42.org>
parents:
27260
diff
changeset
|
389 GtkTreeModel *model = GTK_TREE_MODEL(mail_dialog->treemodel); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
390 GtkTreeIter iter; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
391 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
392 if (id == GTK_RESPONSE_YES) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
393 { |
27243
ecdc58da4cdd
Clear the notifications via a signal instead of pidgin_close_notify.
Paul Aurich <paul@darkrain42.org>
parents:
27236
diff
changeset
|
394 /* A single row activated. Remove that row. */ |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
395 GtkTreeSelection *selection; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
396 |
27262
975a29213f35
Use mail_dialog consistently, instead of switching from one line to the next. Various other cleanups, too.
Paul Aurich <paul@darkrain42.org>
parents:
27260
diff
changeset
|
397 selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(mail_dialog->treeview)); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
398 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
399 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
|
400 { |
27262
975a29213f35
Use mail_dialog consistently, instead of switching from one line to the next. Various other cleanups, too.
Paul Aurich <paul@darkrain42.org>
parents:
27260
diff
changeset
|
401 gtk_tree_model_get(model, &iter, PIDGIN_MAIL_DATA, &data, -1); |
15822 | 402 purple_notify_uri(NULL, data->url); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
403 |
27262
975a29213f35
Use mail_dialog consistently, instead of switching from one line to the next. Various other cleanups, too.
Paul Aurich <paul@darkrain42.org>
parents:
27260
diff
changeset
|
404 gtk_tree_store_remove(mail_dialog->treemodel, &iter); |
23997
128f1d7e12ff
Some cleanup and a little leak fix that I thought I committed a while ago.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
23996
diff
changeset
|
405 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:
23996
diff
changeset
|
406 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:
23996
diff
changeset
|
407 else |
128f1d7e12ff
Some cleanup and a little leak fix that I thought I committed a while ago.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
23996
diff
changeset
|
408 pidgin_close_notify(PURPLE_NOTIFY_EMAILS, data); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
409 |
27262
975a29213f35
Use mail_dialog consistently, instead of switching from one line to the next. Various other cleanups, too.
Paul Aurich <paul@darkrain42.org>
parents:
27260
diff
changeset
|
410 if (gtk_tree_model_get_iter_first(model, &iter)) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
411 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
412 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
413 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
414 return; |
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 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
417 { |
27243
ecdc58da4cdd
Clear the notifications via a signal instead of pidgin_close_notify.
Paul Aurich <paul@darkrain42.org>
parents:
27236
diff
changeset
|
418 /* Remove all the rows */ |
27262
975a29213f35
Use mail_dialog consistently, instead of switching from one line to the next. Various other cleanups, too.
Paul Aurich <paul@darkrain42.org>
parents:
27260
diff
changeset
|
419 while (gtk_tree_model_get_iter_first(model, &iter)) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
420 { |
27262
975a29213f35
Use mail_dialog consistently, instead of switching from one line to the next. Various other cleanups, too.
Paul Aurich <paul@darkrain42.org>
parents:
27260
diff
changeset
|
421 gtk_tree_model_get(model, &iter, PIDGIN_MAIL_DATA, &data, -1); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
422 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
423 if (id == GTK_RESPONSE_ACCEPT) |
15822 | 424 purple_notify_uri(NULL, data->url); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
425 |
27262
975a29213f35
Use mail_dialog consistently, instead of switching from one line to the next. Various other cleanups, too.
Paul Aurich <paul@darkrain42.org>
parents:
27260
diff
changeset
|
426 gtk_tree_store_remove(mail_dialog->treemodel, &iter); |
22851
66914f306712
More plumbing work.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22208
diff
changeset
|
427 if (data->purple_has_handle) |
66914f306712
More plumbing work.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22208
diff
changeset
|
428 purple_notify_close(PURPLE_NOTIFY_EMAILS, data); |
66914f306712
More plumbing work.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22208
diff
changeset
|
429 else |
66914f306712
More plumbing work.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22208
diff
changeset
|
430 pidgin_close_notify(PURPLE_NOTIFY_EMAILS, data); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
431 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
432 } |
27256
c245c583a1a6
Remove a few layers of evil abstraction.
Paul Aurich <paul@darkrain42.org>
parents:
27255
diff
changeset
|
433 |
c245c583a1a6
Remove a few layers of evil abstraction.
Paul Aurich <paul@darkrain42.org>
parents:
27255
diff
changeset
|
434 reset_mail_dialog(NULL); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
435 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
436 |
27262
975a29213f35
Use mail_dialog consistently, instead of switching from one line to the next. Various other cleanups, too.
Paul Aurich <paul@darkrain42.org>
parents:
27260
diff
changeset
|
437 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:
27260
diff
changeset
|
438 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:
27260
diff
changeset
|
439 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:
27260
diff
changeset
|
440 { |
975a29213f35
Use mail_dialog consistently, instead of switching from one line to the next. Various other cleanups, too.
Paul Aurich <paul@darkrain42.org>
parents:
27260
diff
changeset
|
441 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
|
442 } |
c5898e7d70fa
Open emails by doubleclicking the row.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18860
diff
changeset
|
443 |
21913
2a591a5b3322
Make some more event handlers return appropriate gboolean values. This turns
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21888
diff
changeset
|
444 static gboolean |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
445 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
|
446 { |
15822 | 447 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
|
448 return FALSE; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
449 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
450 |
21913
2a591a5b3322
Make some more event handlers return appropriate gboolean values. This turns
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21888
diff
changeset
|
451 static gboolean |
15820 | 452 searchresults_close_cb(PidginNotifySearchResultsData *data, GdkEvent *event, gpointer user_data) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
453 { |
15822 | 454 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
|
455 return FALSE; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
456 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
457 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
458 static void |
15820 | 459 searchresults_callback_wrapper_cb(GtkWidget *widget, PidginNotifySearchResultsButtonData *bd) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
460 { |
15820 | 461 PidginNotifySearchResultsData *data = bd->data; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
462 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
463 GtkTreeSelection *selection; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
464 GtkTreeModel *model; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
465 GtkTreeIter iter; |
15822 | 466 PurpleNotifySearchButton *button; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
467 GList *row = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
468 gchar *str; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
469 int i; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
470 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
471 g_return_if_fail(data != NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
472 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
473 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
|
474 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
475 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
|
476 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
477 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
|
478 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
|
479 row = g_list_append(row, str); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
480 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
481 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
482 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
483 button = bd->button; |
15822 | 484 button->callback(purple_account_get_connection(data->account), row, data->user_data); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
485 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
|
486 g_list_free(row); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
487 } |
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 static void * |
15822 | 490 pidgin_notify_message(PurpleNotifyMsgType type, const char *title, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
491 const char *primary, const char *secondary) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
492 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
493 GtkWidget *dialog; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
494 GtkWidget *hbox; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
495 GtkWidget *label; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
496 GtkWidget *img = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
497 char label_text[2048]; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
498 const char *icon_name = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
499 char *primary_esc, *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 switch (type) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
502 { |
15822 | 503 case PURPLE_NOTIFY_MSG_ERROR: |
15435 | 504 icon_name = PIDGIN_STOCK_DIALOG_ERROR; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
505 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
506 |
15822 | 507 case PURPLE_NOTIFY_MSG_WARNING: |
15435 | 508 icon_name = PIDGIN_STOCK_DIALOG_WARNING; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
509 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
510 |
15822 | 511 case PURPLE_NOTIFY_MSG_INFO: |
15435 | 512 icon_name = PIDGIN_STOCK_DIALOG_INFO; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
513 break; |
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 default: |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
516 icon_name = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
517 break; |
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 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
520 if (icon_name != NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
521 { |
15435 | 522 img = gtk_image_new_from_stock(icon_name, gtk_icon_size_from_name(PIDGIN_ICON_SIZE_TANGO_HUGE)); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
523 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
|
524 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
525 |
15820 | 526 dialog = gtk_dialog_new_with_buttons(title ? title : PIDGIN_ALERT_TITLE, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
527 NULL, 0, GTK_STOCK_CLOSE, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
528 GTK_RESPONSE_CLOSE, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
529 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
530 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
|
531 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
532 g_signal_connect(G_OBJECT(dialog), "response", |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
533 G_CALLBACK(message_response_cb), dialog); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
534 |
15820 | 535 gtk_container_set_border_width(GTK_CONTAINER(dialog), PIDGIN_HIG_BORDER); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
536 gtk_window_set_resizable(GTK_WINDOW(dialog), FALSE); |
32685
457443ca22e0
The function gtk_dialog_set_has_separator was removed in GTK+ 2.22.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32141
diff
changeset
|
537 #if !GTK_CHECK_VERSION(2,22,0) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
538 gtk_dialog_set_has_separator(GTK_DIALOG(dialog), FALSE); |
32685
457443ca22e0
The function gtk_dialog_set_has_separator was removed in GTK+ 2.22.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32141
diff
changeset
|
539 #endif |
15820 | 540 gtk_box_set_spacing(GTK_BOX(GTK_DIALOG(dialog)->vbox), PIDGIN_HIG_BORDER); |
541 gtk_container_set_border_width(GTK_CONTAINER(GTK_DIALOG(dialog)->vbox), PIDGIN_HIG_BOX_SPACE); | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
542 |
15820 | 543 hbox = gtk_hbox_new(FALSE, PIDGIN_HIG_BORDER); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
544 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
|
545 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
546 if (img != NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
547 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
|
548 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
549 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
|
550 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
|
551 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
|
552 "<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
|
553 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
|
554 (secondary ? secondary_esc : "")); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
555 g_free(primary_esc); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
556 g_free(secondary_esc); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
557 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
558 label = gtk_label_new(NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
559 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
560 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
|
561 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
|
562 gtk_label_set_selectable(GTK_LABEL(label), TRUE); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
563 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
|
564 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
|
565 |
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
|
566 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
|
567 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
568 gtk_widget_show_all(dialog); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
569 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
570 return dialog; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
571 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
572 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
573 static void |
27257
c7768f23f519
Remove the PidginMailDialog typedef.
Paul Aurich <paul@darkrain42.org>
parents:
27256
diff
changeset
|
574 selection_changed_cb(GtkTreeSelection *sel, PidginNotifyDialog *dialog) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
575 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
576 GtkTreeIter iter; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
577 GtkTreeModel *model; |
15820 | 578 PidginNotifyMailData *data; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
579 gboolean active = TRUE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
580 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
581 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
|
582 active = FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
583 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
584 { |
15819
c02a897a67c7
More Gaim to Pidgin changes
Sean Egan <seanegan@gmail.com>
parents:
15734
diff
changeset
|
585 gtk_tree_model_get(model, &iter, PIDGIN_MAIL_DATA, &data, -1); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
586 if (data->url == NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
587 active = FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
588 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
589 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
590 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
|
591 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
592 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
593 static void * |
15822 | 594 pidgin_notify_email(PurpleConnection *gc, const char *subject, const char *from, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
595 const char *to, const char *url) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
596 { |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15435
diff
changeset
|
597 return pidgin_notify_emails(gc, 1, (subject != NULL), |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
598 (subject == NULL ? NULL : &subject), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
599 (from == NULL ? NULL : &from), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
600 (to == NULL ? NULL : &to), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
601 (url == NULL ? NULL : &url)); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
602 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
603 |
15734
427ca6a0aa87
Fix the last change.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
15733
diff
changeset
|
604 static int |
427ca6a0aa87
Fix the last change.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
15733
diff
changeset
|
605 mail_window_focus_cb(GtkWidget *widget, GdkEventFocus *focus, gpointer null) |
427ca6a0aa87
Fix the last change.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
15733
diff
changeset
|
606 { |
427ca6a0aa87
Fix the last change.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
15733
diff
changeset
|
607 pidgin_set_urgent(GTK_WINDOW(widget), FALSE); |
427ca6a0aa87
Fix the last change.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
15733
diff
changeset
|
608 return 0; |
427ca6a0aa87
Fix the last change.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
15733
diff
changeset
|
609 } |
427ca6a0aa87
Fix the last change.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
15733
diff
changeset
|
610 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
611 /* 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
|
612 * count > 0 mean non-detailed. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
613 */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
614 static void * |
22867
502bac8b2b4c
Fix a double free caused by my previous leak fix not covering all possible
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22851
diff
changeset
|
615 pidgin_notify_add_mail(GtkTreeStore *treemodel, PurpleAccount *account, char *notification, const char *url, int count, gboolean clear, gboolean *new_data) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
616 { |
15820 | 617 PidginNotifyMailData *data = NULL; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
618 GtkTreeIter iter; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
619 GdkPixbuf *icon; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
620 gboolean new_n = TRUE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
621 |
20217
d4e250c3cd44
applied changes from 4bb1d6cbfe69a2e7782336a7e6e93e438a8bdbfc
Richard Laager <rlaager@wiktel.com>
parents:
19681
diff
changeset
|
622 if (count > 0 || clear) { |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
623 /* 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
|
624 if (gtk_tree_model_get_iter_first(GTK_TREE_MODEL(treemodel), &iter)) { |
20217
d4e250c3cd44
applied changes from 4bb1d6cbfe69a2e7782336a7e6e93e438a8bdbfc
Richard Laager <rlaager@wiktel.com>
parents:
19681
diff
changeset
|
625 gboolean advanced; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
626 do { |
20217
d4e250c3cd44
applied changes from 4bb1d6cbfe69a2e7782336a7e6e93e438a8bdbfc
Richard Laager <rlaager@wiktel.com>
parents:
19681
diff
changeset
|
627 advanced = FALSE; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
628 gtk_tree_model_get(GTK_TREE_MODEL(treemodel), &iter, |
15819
c02a897a67c7
More Gaim to Pidgin changes
Sean Egan <seanegan@gmail.com>
parents:
15734
diff
changeset
|
629 PIDGIN_MAIL_DATA, &data, -1); |
27236
8ecd6945a96a
Avoid a null deref when clearing mail notifications. Refs #9345.
Paul Aurich <paul@darkrain42.org>
parents:
27186
diff
changeset
|
630 if (data && data->account == account) { |
20217
d4e250c3cd44
applied changes from 4bb1d6cbfe69a2e7782336a7e6e93e438a8bdbfc
Richard Laager <rlaager@wiktel.com>
parents:
19681
diff
changeset
|
631 if (clear) { |
d4e250c3cd44
applied changes from 4bb1d6cbfe69a2e7782336a7e6e93e438a8bdbfc
Richard Laager <rlaager@wiktel.com>
parents:
19681
diff
changeset
|
632 advanced = gtk_tree_store_remove(treemodel, &iter); |
27260
8796eaaca38a
Fix the mail_dialog->total_count and use that to tell when the dialog is empty.
Paul Aurich <paul@darkrain42.org>
parents:
27258
diff
changeset
|
633 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:
27258
diff
changeset
|
634 |
27186
25db53cfc12c
Make sure uninitialized variable is not used. This might fix #9345,
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
27035
diff
changeset
|
635 if (data->purple_has_handle) |
25db53cfc12c
Make sure uninitialized variable is not used. This might fix #9345,
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
27035
diff
changeset
|
636 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:
27035
diff
changeset
|
637 else |
25db53cfc12c
Make sure uninitialized variable is not used. This might fix #9345,
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
27035
diff
changeset
|
638 pidgin_close_notify(PURPLE_NOTIFY_EMAILS, data); |
20217
d4e250c3cd44
applied changes from 4bb1d6cbfe69a2e7782336a7e6e93e438a8bdbfc
Richard Laager <rlaager@wiktel.com>
parents:
19681
diff
changeset
|
639 /* We're completely done if we've processed all entries */ |
d4e250c3cd44
applied changes from 4bb1d6cbfe69a2e7782336a7e6e93e438a8bdbfc
Richard Laager <rlaager@wiktel.com>
parents:
19681
diff
changeset
|
640 if (!advanced) |
d4e250c3cd44
applied changes from 4bb1d6cbfe69a2e7782336a7e6e93e438a8bdbfc
Richard Laager <rlaager@wiktel.com>
parents:
19681
diff
changeset
|
641 return NULL; |
d4e250c3cd44
applied changes from 4bb1d6cbfe69a2e7782336a7e6e93e438a8bdbfc
Richard Laager <rlaager@wiktel.com>
parents:
19681
diff
changeset
|
642 } else if (data->count > 0) { |
d4e250c3cd44
applied changes from 4bb1d6cbfe69a2e7782336a7e6e93e438a8bdbfc
Richard Laager <rlaager@wiktel.com>
parents:
19681
diff
changeset
|
643 new_n = FALSE; |
d4e250c3cd44
applied changes from 4bb1d6cbfe69a2e7782336a7e6e93e438a8bdbfc
Richard Laager <rlaager@wiktel.com>
parents:
19681
diff
changeset
|
644 g_free(data->url); |
d4e250c3cd44
applied changes from 4bb1d6cbfe69a2e7782336a7e6e93e438a8bdbfc
Richard Laager <rlaager@wiktel.com>
parents:
19681
diff
changeset
|
645 data->url = NULL; |
d4e250c3cd44
applied changes from 4bb1d6cbfe69a2e7782336a7e6e93e438a8bdbfc
Richard Laager <rlaager@wiktel.com>
parents:
19681
diff
changeset
|
646 mail_dialog->total_count -= data->count; |
d4e250c3cd44
applied changes from 4bb1d6cbfe69a2e7782336a7e6e93e438a8bdbfc
Richard Laager <rlaager@wiktel.com>
parents:
19681
diff
changeset
|
647 break; |
d4e250c3cd44
applied changes from 4bb1d6cbfe69a2e7782336a7e6e93e438a8bdbfc
Richard Laager <rlaager@wiktel.com>
parents:
19681
diff
changeset
|
648 } |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
649 } |
20217
d4e250c3cd44
applied changes from 4bb1d6cbfe69a2e7782336a7e6e93e438a8bdbfc
Richard Laager <rlaager@wiktel.com>
parents:
19681
diff
changeset
|
650 } while (advanced || gtk_tree_model_iter_next(GTK_TREE_MODEL(treemodel), &iter)); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
651 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
652 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
653 |
20253
6f4defb6f399
applied changes from c0104c111e903cfec5d0a95e0ae9dafb72f0dcbf
Richard Laager <rlaager@wiktel.com>
parents:
20251
diff
changeset
|
654 if (clear) |
6f4defb6f399
applied changes from c0104c111e903cfec5d0a95e0ae9dafb72f0dcbf
Richard Laager <rlaager@wiktel.com>
parents:
20251
diff
changeset
|
655 return NULL; |
6f4defb6f399
applied changes from c0104c111e903cfec5d0a95e0ae9dafb72f0dcbf
Richard Laager <rlaager@wiktel.com>
parents:
20251
diff
changeset
|
656 |
6f4defb6f399
applied changes from c0104c111e903cfec5d0a95e0ae9dafb72f0dcbf
Richard Laager <rlaager@wiktel.com>
parents:
20251
diff
changeset
|
657 icon = pidgin_create_prpl_icon(account, PIDGIN_PRPL_ICON_MEDIUM); |
6f4defb6f399
applied changes from c0104c111e903cfec5d0a95e0ae9dafb72f0dcbf
Richard Laager <rlaager@wiktel.com>
parents:
20251
diff
changeset
|
658 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
659 if (new_n) { |
15820 | 660 data = g_new0(PidginNotifyMailData, 1); |
22851
66914f306712
More plumbing work.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22208
diff
changeset
|
661 data->purple_has_handle = TRUE; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
662 gtk_tree_store_append(treemodel, &iter, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
663 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
664 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
665 if (url != NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
666 data->url = g_strdup(url); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
667 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
668 gtk_tree_store_set(treemodel, &iter, |
15819
c02a897a67c7
More Gaim to Pidgin changes
Sean Egan <seanegan@gmail.com>
parents:
15734
diff
changeset
|
669 PIDGIN_MAIL_ICON, icon, |
c02a897a67c7
More Gaim to Pidgin changes
Sean Egan <seanegan@gmail.com>
parents:
15734
diff
changeset
|
670 PIDGIN_MAIL_TEXT, notification, |
c02a897a67c7
More Gaim to Pidgin changes
Sean Egan <seanegan@gmail.com>
parents:
15734
diff
changeset
|
671 PIDGIN_MAIL_DATA, data, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
672 -1); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
673 data->account = account; |
27260
8796eaaca38a
Fix the mail_dialog->total_count and use that to tell when the dialog is empty.
Paul Aurich <paul@darkrain42.org>
parents:
27258
diff
changeset
|
674 /* 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:
27258
diff
changeset
|
675 data->count = count > 0 ? count : 1; |
22851
66914f306712
More plumbing work.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22208
diff
changeset
|
676 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
677 if (icon) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
678 g_object_unref(icon); |
22867
502bac8b2b4c
Fix a double free caused by my previous leak fix not covering all possible
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22851
diff
changeset
|
679 |
502bac8b2b4c
Fix a double free caused by my previous leak fix not covering all possible
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22851
diff
changeset
|
680 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:
22851
diff
changeset
|
681 *new_data = new_n; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
682 return data; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
683 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
684 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
685 static void * |
15822 | 686 pidgin_notify_emails(PurpleConnection *gc, size_t count, gboolean detailed, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
687 const char **subjects, const char **froms, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
688 const char **tos, const char **urls) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
689 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
690 char *notification; |
15822 | 691 PurpleAccount *account; |
22867
502bac8b2b4c
Fix a double free caused by my previous leak fix not covering all possible
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22851
diff
changeset
|
692 PidginNotifyMailData *data = NULL, *data2; |
27186
25db53cfc12c
Make sure uninitialized variable is not used. This might fix #9345,
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
27035
diff
changeset
|
693 gboolean new_data = FALSE; |
32412
eb8f424876a5
Select the first item in the mail-notification dialog. Also,
tim@retout.co.uk
parents:
32402
diff
changeset
|
694 GtkTreeSelection *sel; |
eb8f424876a5
Select the first item in the mail-notification dialog. Also,
tim@retout.co.uk
parents:
32402
diff
changeset
|
695 GtkTreeIter iter; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
696 |
20217
d4e250c3cd44
applied changes from 4bb1d6cbfe69a2e7782336a7e6e93e438a8bdbfc
Richard Laager <rlaager@wiktel.com>
parents:
19681
diff
changeset
|
697 /* 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:
19681
diff
changeset
|
698 if (count == 0 && mail_dialog == NULL) |
d4e250c3cd44
applied changes from 4bb1d6cbfe69a2e7782336a7e6e93e438a8bdbfc
Richard Laager <rlaager@wiktel.com>
parents:
19681
diff
changeset
|
699 return NULL; |
d4e250c3cd44
applied changes from 4bb1d6cbfe69a2e7782336a7e6e93e438a8bdbfc
Richard Laager <rlaager@wiktel.com>
parents:
19681
diff
changeset
|
700 |
15822 | 701 account = purple_connection_get_account(gc); |
27262
975a29213f35
Use mail_dialog consistently, instead of switching from one line to the next. Various other cleanups, too.
Paul Aurich <paul@darkrain42.org>
parents:
27260
diff
changeset
|
702 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:
27260
diff
changeset
|
703 mail_dialog = pidgin_create_notification_dialog(PIDGIN_NOTIFY_MAIL); |
20217
d4e250c3cd44
applied changes from 4bb1d6cbfe69a2e7782336a7e6e93e438a8bdbfc
Richard Laager <rlaager@wiktel.com>
parents:
19681
diff
changeset
|
704 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
705 mail_dialog->total_count += count; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
706 if (detailed) { |
27260
8796eaaca38a
Fix the mail_dialog->total_count and use that to tell when the dialog is empty.
Paul Aurich <paul@darkrain42.org>
parents:
27258
diff
changeset
|
707 for ( ; count; --count) { |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
708 char *to_text = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
709 char *from_text = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
710 char *subject_text = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
711 char *tmp; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
712 gboolean first = TRUE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
713 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
714 if (tos != NULL) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
715 tmp = g_markup_escape_text(*tos, -1); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
716 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
|
717 g_free(tmp); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
718 first = FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
719 tos++; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
720 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
721 if (froms != NULL) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
722 tmp = g_markup_escape_text(*froms, -1); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
723 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
|
724 g_free(tmp); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
725 first = FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
726 froms++; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
727 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
728 if (subjects != NULL) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
729 tmp = g_markup_escape_text(*subjects, -1); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
730 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
|
731 g_free(tmp); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
732 first = FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
733 subjects++; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
734 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
735 #define SAFE(x) ((x) ? (x) : "") |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
736 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
|
737 #undef SAFE |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
738 g_free(to_text); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
739 g_free(from_text); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
740 g_free(subject_text); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
741 |
22851
66914f306712
More plumbing work.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22208
diff
changeset
|
742 /* If we don't keep track of this, will leak "data" for each of the notifications except the last */ |
22867
502bac8b2b4c
Fix a double free caused by my previous leak fix not covering all possible
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22851
diff
changeset
|
743 data2 = pidgin_notify_add_mail(mail_dialog->treemodel, account, notification, urls ? *urls : NULL, 0, FALSE, &new_data); |
27186
25db53cfc12c
Make sure uninitialized variable is not used. This might fix #9345,
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
27035
diff
changeset
|
744 if (data2 && new_data) { |
22867
502bac8b2b4c
Fix a double free caused by my previous leak fix not covering all possible
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22851
diff
changeset
|
745 if (data) |
502bac8b2b4c
Fix a double free caused by my previous leak fix not covering all possible
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22851
diff
changeset
|
746 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:
22851
diff
changeset
|
747 data = data2; |
502bac8b2b4c
Fix a double free caused by my previous leak fix not covering all possible
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22851
diff
changeset
|
748 } |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
749 g_free(notification); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
750 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
751 if (urls != NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
752 urls++; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
753 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
754 } else { |
20217
d4e250c3cd44
applied changes from 4bb1d6cbfe69a2e7782336a7e6e93e438a8bdbfc
Richard Laager <rlaager@wiktel.com>
parents:
19681
diff
changeset
|
755 if (count > 0) { |
d4e250c3cd44
applied changes from 4bb1d6cbfe69a2e7782336a7e6e93e438a8bdbfc
Richard Laager <rlaager@wiktel.com>
parents:
19681
diff
changeset
|
756 notification = g_strdup_printf(ngettext("%s has %d new message.", |
d4e250c3cd44
applied changes from 4bb1d6cbfe69a2e7782336a7e6e93e438a8bdbfc
Richard Laager <rlaager@wiktel.com>
parents:
19681
diff
changeset
|
757 "%s has %d new messages.", |
d4e250c3cd44
applied changes from 4bb1d6cbfe69a2e7782336a7e6e93e438a8bdbfc
Richard Laager <rlaager@wiktel.com>
parents:
19681
diff
changeset
|
758 (int)count), |
d4e250c3cd44
applied changes from 4bb1d6cbfe69a2e7782336a7e6e93e438a8bdbfc
Richard Laager <rlaager@wiktel.com>
parents:
19681
diff
changeset
|
759 *tos, (int)count); |
22867
502bac8b2b4c
Fix a double free caused by my previous leak fix not covering all possible
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22851
diff
changeset
|
760 data2 = pidgin_notify_add_mail(mail_dialog->treemodel, account, notification, urls ? *urls : NULL, count, FALSE, &new_data); |
27186
25db53cfc12c
Make sure uninitialized variable is not used. This might fix #9345,
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
27035
diff
changeset
|
761 if (data2 && new_data) { |
22867
502bac8b2b4c
Fix a double free caused by my previous leak fix not covering all possible
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22851
diff
changeset
|
762 if (data) |
502bac8b2b4c
Fix a double free caused by my previous leak fix not covering all possible
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22851
diff
changeset
|
763 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:
22851
diff
changeset
|
764 data = data2; |
502bac8b2b4c
Fix a double free caused by my previous leak fix not covering all possible
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22851
diff
changeset
|
765 } |
20217
d4e250c3cd44
applied changes from 4bb1d6cbfe69a2e7782336a7e6e93e438a8bdbfc
Richard Laager <rlaager@wiktel.com>
parents:
19681
diff
changeset
|
766 g_free(notification); |
d4e250c3cd44
applied changes from 4bb1d6cbfe69a2e7782336a7e6e93e438a8bdbfc
Richard Laager <rlaager@wiktel.com>
parents:
19681
diff
changeset
|
767 } else { |
d4e250c3cd44
applied changes from 4bb1d6cbfe69a2e7782336a7e6e93e438a8bdbfc
Richard Laager <rlaager@wiktel.com>
parents:
19681
diff
changeset
|
768 /* Clear out all mails for the account */ |
22867
502bac8b2b4c
Fix a double free caused by my previous leak fix not covering all possible
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22851
diff
changeset
|
769 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:
19681
diff
changeset
|
770 |
27260
8796eaaca38a
Fix the mail_dialog->total_count and use that to tell when the dialog is empty.
Paul Aurich <paul@darkrain42.org>
parents:
27258
diff
changeset
|
771 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:
27258
diff
changeset
|
772 /* |
8796eaaca38a
Fix the mail_dialog->total_count and use that to tell when the dialog is empty.
Paul Aurich <paul@darkrain42.org>
parents:
27258
diff
changeset
|
773 * 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:
27258
diff
changeset
|
774 * 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:
27258
diff
changeset
|
775 */ |
20217
d4e250c3cd44
applied changes from 4bb1d6cbfe69a2e7782336a7e6e93e438a8bdbfc
Richard Laager <rlaager@wiktel.com>
parents:
19681
diff
changeset
|
776 pidgin_blist_set_headline(NULL, NULL, NULL, NULL, NULL); |
20253
6f4defb6f399
applied changes from c0104c111e903cfec5d0a95e0ae9dafb72f0dcbf
Richard Laager <rlaager@wiktel.com>
parents:
20251
diff
changeset
|
777 return NULL; |
20217
d4e250c3cd44
applied changes from 4bb1d6cbfe69a2e7782336a7e6e93e438a8bdbfc
Richard Laager <rlaager@wiktel.com>
parents:
19681
diff
changeset
|
778 } |
d4e250c3cd44
applied changes from 4bb1d6cbfe69a2e7782336a7e6e93e438a8bdbfc
Richard Laager <rlaager@wiktel.com>
parents:
19681
diff
changeset
|
779 } |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
780 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
781 |
32412
eb8f424876a5
Select the first item in the mail-notification dialog. Also,
tim@retout.co.uk
parents:
32402
diff
changeset
|
782 /* Select first item if nothing selected */ |
eb8f424876a5
Select the first item in the mail-notification dialog. Also,
tim@retout.co.uk
parents:
32402
diff
changeset
|
783 sel = gtk_tree_view_get_selection(GTK_TREE_VIEW(mail_dialog->treeview)); |
eb8f424876a5
Select the first item in the mail-notification dialog. Also,
tim@retout.co.uk
parents:
32402
diff
changeset
|
784 if ((gtk_tree_selection_count_selected_rows(sel) < 1) |
eb8f424876a5
Select the first item in the mail-notification dialog. Also,
tim@retout.co.uk
parents:
32402
diff
changeset
|
785 && gtk_tree_model_get_iter_first(GTK_TREE_MODEL(mail_dialog->treemodel), &iter)) { |
eb8f424876a5
Select the first item in the mail-notification dialog. Also,
tim@retout.co.uk
parents:
32402
diff
changeset
|
786 gtk_tree_selection_select_iter(sel, &iter); |
eb8f424876a5
Select the first item in the mail-notification dialog. Also,
tim@retout.co.uk
parents:
32402
diff
changeset
|
787 } |
eb8f424876a5
Select the first item in the mail-notification dialog. Also,
tim@retout.co.uk
parents:
32402
diff
changeset
|
788 |
32686
3538e783b98c
Fix all deprecated GTK_WIDGET_* macros.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32685
diff
changeset
|
789 #if GTK_CHECK_VERSION(2,18,0) |
3538e783b98c
Fix all deprecated GTK_WIDGET_* macros.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32685
diff
changeset
|
790 if (!gtk_widget_get_visible(mail_dialog->dialog)) { |
3538e783b98c
Fix all deprecated GTK_WIDGET_* macros.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32685
diff
changeset
|
791 #else |
27262
975a29213f35
Use mail_dialog consistently, instead of switching from one line to the next. Various other cleanups, too.
Paul Aurich <paul@darkrain42.org>
parents:
27260
diff
changeset
|
792 if (!GTK_WIDGET_VISIBLE(mail_dialog->dialog)) { |
32686
3538e783b98c
Fix all deprecated GTK_WIDGET_* macros.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32685
diff
changeset
|
793 #endif |
27262
975a29213f35
Use mail_dialog consistently, instead of switching from one line to the next. Various other cleanups, too.
Paul Aurich <paul@darkrain42.org>
parents:
27260
diff
changeset
|
794 GdkPixbuf *pixbuf = gtk_widget_render_icon(mail_dialog->dialog, PIDGIN_STOCK_DIALOG_MAIL, |
15435 | 795 gtk_icon_size_from_name(PIDGIN_ICON_SIZE_TANGO_EXTRA_SMALL), NULL); |
23180
e0bcb8cfda74
Use "email" and "Email" consistently. This is potentially controversial,
Richard Laager <rlaager@wiktel.com>
parents:
22867
diff
changeset
|
796 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:
22867
diff
changeset
|
797 "<b>%d new emails.</b>", |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
798 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
|
799 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
|
800 remove the notifications when replacing an |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
801 old notification. */ |
20217
d4e250c3cd44
applied changes from 4bb1d6cbfe69a2e7782336a7e6e93e438a8bdbfc
Richard Laager <rlaager@wiktel.com>
parents:
19681
diff
changeset
|
802 pidgin_blist_set_headline(label_text, |
27262
975a29213f35
Use mail_dialog consistently, instead of switching from one line to the next. Various other cleanups, too.
Paul Aurich <paul@darkrain42.org>
parents:
27260
diff
changeset
|
803 pixbuf, G_CALLBACK(gtk_widget_show_all), mail_dialog->dialog, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
804 (GDestroyNotify)reset_mail_dialog); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
805 mail_dialog->in_use = FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
806 g_free(label_text); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
807 if (pixbuf) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
808 g_object_unref(pixbuf); |
32686
3538e783b98c
Fix all deprecated GTK_WIDGET_* macros.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32685
diff
changeset
|
809 #if GTK_CHECK_VERSION(2,18,0) |
3538e783b98c
Fix all deprecated GTK_WIDGET_* macros.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32685
diff
changeset
|
810 } else if (!gtk_widget_has_focus(mail_dialog->dialog)) |
3538e783b98c
Fix all deprecated GTK_WIDGET_* macros.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32685
diff
changeset
|
811 #else |
27262
975a29213f35
Use mail_dialog consistently, instead of switching from one line to the next. Various other cleanups, too.
Paul Aurich <paul@darkrain42.org>
parents:
27260
diff
changeset
|
812 } else if (!GTK_WIDGET_HAS_FOCUS(mail_dialog->dialog)) |
32686
3538e783b98c
Fix all deprecated GTK_WIDGET_* macros.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32685
diff
changeset
|
813 #endif |
27262
975a29213f35
Use mail_dialog consistently, instead of switching from one line to the next. Various other cleanups, too.
Paul Aurich <paul@darkrain42.org>
parents:
27260
diff
changeset
|
814 pidgin_set_urgent(GTK_WINDOW(mail_dialog->dialog), TRUE); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
815 |
22851
66914f306712
More plumbing work.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22208
diff
changeset
|
816 return data; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
817 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
818 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
819 static gboolean |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
820 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
|
821 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
822 if (event->keyval == GDK_Escape) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
823 { |
15822 | 824 purple_notify_close(PURPLE_NOTIFY_FORMATTED, win); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
825 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
826 return TRUE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
827 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
828 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
829 return FALSE; |
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 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
832 static void * |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15435
diff
changeset
|
833 pidgin_notify_formatted(const char *title, const char *primary, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
834 const char *secondary, const char *text) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
835 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
836 GtkWidget *window; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
837 GtkWidget *vbox; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
838 GtkWidget *label; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
839 GtkWidget *button; |
32059 | 840 GtkWidget *web_view; |
32141
3b4c865dc2ce
Use pidgin_create_webview in the gtknotify code.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32133
diff
changeset
|
841 GtkWidget *frame; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
842 char label_text[2048]; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
843 char *linked_text, *primary_esc, *secondary_esc; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
844 |
19366
bd18c02bba9f
Use GtkDialog more often. Thanks nix_nix. Fixes #2618
Sean Egan <seanegan@gmail.com>
parents:
19316
diff
changeset
|
845 window = gtk_dialog_new(); |
bd18c02bba9f
Use GtkDialog more often. Thanks nix_nix. Fixes #2618
Sean Egan <seanegan@gmail.com>
parents:
19316
diff
changeset
|
846 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
|
847 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
|
848 gtk_window_set_resizable(GTK_WINDOW(window), TRUE); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
849 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
850 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
|
851 G_CALLBACK(formatted_close_cb), NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
852 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
853 /* Setup the main vbox */ |
19366
bd18c02bba9f
Use GtkDialog more often. Thanks nix_nix. Fixes #2618
Sean Egan <seanegan@gmail.com>
parents:
19316
diff
changeset
|
854 vbox = GTK_DIALOG(window)->vbox; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
855 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
856 /* Setup the descriptive label */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
857 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
|
858 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
|
859 g_snprintf(label_text, sizeof(label_text), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
860 "<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
|
861 primary_esc, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
862 (secondary ? "\n" : ""), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
863 (secondary ? secondary_esc : "")); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
864 g_free(primary_esc); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
865 g_free(secondary_esc); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
866 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
867 label = gtk_label_new(NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
868 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
869 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
|
870 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
|
871 gtk_label_set_selectable(GTK_LABEL(label), TRUE); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
872 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
|
873 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
|
874 gtk_widget_show(label); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
875 |
32059 | 876 /* Add the webview */ |
32141
3b4c865dc2ce
Use pidgin_create_webview in the gtknotify code.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32133
diff
changeset
|
877 frame = pidgin_create_webview(FALSE, &web_view, NULL, NULL); |
32059 | 878 gtk_widget_set_name(web_view, "pidgin_notify_webview"); |
879 gtk_widget_set_size_request(web_view, 300, 250); | |
32141
3b4c865dc2ce
Use pidgin_create_webview in the gtknotify code.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32133
diff
changeset
|
880 gtk_box_pack_start(GTK_BOX(vbox), frame, TRUE, TRUE, 0); |
3b4c865dc2ce
Use pidgin_create_webview in the gtknotify code.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32133
diff
changeset
|
881 gtk_widget_show(frame); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
882 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
883 /* Add the Close button. */ |
19366
bd18c02bba9f
Use GtkDialog more often. Thanks nix_nix. Fixes #2618
Sean Egan <seanegan@gmail.com>
parents:
19316
diff
changeset
|
884 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
|
885 gtk_widget_grab_focus(button); |
15373
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 g_signal_connect_swapped(G_OBJECT(button), "clicked", |
24437
9b61b1088dfb
Fix an assertion failure/unlikely crash when:
Mark Doliner <mark@kingant.net>
parents:
23997
diff
changeset
|
888 G_CALLBACK(formatted_close_cb), window); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
889 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
|
890 G_CALLBACK(formatted_input_cb), NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
891 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
892 /* Make sure URLs are clickable */ |
15822 | 893 linked_text = purple_markup_linkify(text); |
32808
b8cbd52e26b1
Remove _with_imgstore suffix on this function. There isn't a version
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32696
diff
changeset
|
894 gtk_webview_load_html_string(GTK_WEBVIEW(web_view), linked_text); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
895 g_free(linked_text); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
896 |
32059 | 897 g_object_set_data(G_OBJECT(window), "webview-widget", web_view); |
16977
563a42d98e3a
Fix ticket #387.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16673
diff
changeset
|
898 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
899 /* 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
|
900 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
|
901 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
902 gtk_widget_show(window); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
903 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
904 return window; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
905 } |
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 static void |
15822 | 908 pidgin_notify_searchresults_new_rows(PurpleConnection *gc, PurpleNotifySearchResults *results, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
909 void *data_) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
910 { |
15820 | 911 PidginNotifySearchResultsData *data = data_; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
912 GtkListStore *model = data->model; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
913 GtkTreeIter iter; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
914 GdkPixbuf *pixbuf; |
20100
a3f07fa68e90
Access search results directly instead of going through the API because
Mark Doliner <mark@kingant.net>
parents:
20074
diff
changeset
|
915 GList *row, *column; |
a3f07fa68e90
Access search results directly instead of going through the API because
Mark Doliner <mark@kingant.net>
parents:
20074
diff
changeset
|
916 guint n; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
917 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
918 gtk_list_store_clear(data->model); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
919 |
15822 | 920 pixbuf = pidgin_create_prpl_icon(purple_connection_get_account(gc), 0.5); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
921 |
20100
a3f07fa68e90
Access search results directly instead of going through the API because
Mark Doliner <mark@kingant.net>
parents:
20074
diff
changeset
|
922 for (row = results->rows; row != NULL; row = row->next) { |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
923 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
924 gtk_list_store_append(model, &iter); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
925 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
|
926 |
20100
a3f07fa68e90
Access search results directly instead of going through the API because
Mark Doliner <mark@kingant.net>
parents:
20074
diff
changeset
|
927 n = 1; |
a3f07fa68e90
Access search results directly instead of going through the API because
Mark Doliner <mark@kingant.net>
parents:
20074
diff
changeset
|
928 for (column = row->data; column != NULL; column = column->next) { |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
929 GValue v; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
930 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
931 v.g_type = 0; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
932 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
|
933 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
|
934 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
|
935 n++; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
936 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
937 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
938 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
939 if (pixbuf != NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
940 g_object_unref(pixbuf); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
941 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
942 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
943 static void * |
15822 | 944 pidgin_notify_searchresults(PurpleConnection *gc, const char *title, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
945 const char *primary, const char *secondary, |
15822 | 946 PurpleNotifySearchResults *results, gpointer user_data) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
947 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
948 GtkWidget *window; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
949 GtkWidget *treeview; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
950 GtkWidget *close_button; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
951 GType *col_types; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
952 GtkListStore *model; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
953 GtkCellRenderer *renderer; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
954 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
|
955 GList *columniter; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
956 guint i; |
24552
f10aba5592c6
The other day while struct hiding, I noticed a for loop that was checking
Richard Laager <rlaager@wiktel.com>
parents:
24437
diff
changeset
|
957 GList *l; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
958 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
959 GtkWidget *vbox; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
960 GtkWidget *label; |
15820 | 961 PidginNotifySearchResultsData *data; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
962 char *label_text; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
963 char *primary_esc, *secondary_esc; |
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 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
|
966 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
|
967 |
15820 | 968 data = g_malloc(sizeof(PidginNotifySearchResultsData)); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
969 data->user_data = user_data; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
970 data->results = results; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
971 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
972 /* Create the window */ |
19366
bd18c02bba9f
Use GtkDialog more often. Thanks nix_nix. Fixes #2618
Sean Egan <seanegan@gmail.com>
parents:
19316
diff
changeset
|
973 window = gtk_dialog_new(); |
bd18c02bba9f
Use GtkDialog more often. Thanks nix_nix. Fixes #2618
Sean Egan <seanegan@gmail.com>
parents:
19316
diff
changeset
|
974 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
|
975 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
|
976 gtk_window_set_resizable(GTK_WINDOW(window), TRUE); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
977 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
978 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
|
979 G_CALLBACK(searchresults_close_cb), data); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
980 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
981 /* Setup the main vbox */ |
19366
bd18c02bba9f
Use GtkDialog more often. Thanks nix_nix. Fixes #2618
Sean Egan <seanegan@gmail.com>
parents:
19316
diff
changeset
|
982 vbox = GTK_DIALOG(window)->vbox; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
983 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
984 /* Setup the descriptive label */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
985 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
|
986 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
|
987 label_text = g_strdup_printf( |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
988 "<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
|
989 (primary ? primary_esc : ""), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
990 (primary && secondary ? "\n" : ""), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
991 (secondary ? secondary_esc : "")); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
992 g_free(primary_esc); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
993 g_free(secondary_esc); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
994 label = gtk_label_new(NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
995 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
|
996 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
|
997 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
|
998 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
|
999 gtk_widget_show(label); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1000 g_free(label_text); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1001 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1002 /* +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
|
1003 col_num = g_list_length(results->columns) + 1; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1004 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1005 /* Setup the list model */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1006 col_types = g_new0(GType, col_num); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1007 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1008 /* There always is this first column. */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1009 col_types[0] = GDK_TYPE_PIXBUF; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1010 for (i = 1; i < col_num; i++) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1011 col_types[i] = G_TYPE_STRING; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1012 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1013 model = gtk_list_store_newv(col_num, col_types); |
22851
66914f306712
More plumbing work.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22208
diff
changeset
|
1014 g_free(col_types); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1015 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1016 /* Setup the treeview */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1017 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
|
1018 g_object_unref(G_OBJECT(model)); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1019 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
|
1020 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
|
1021 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
|
1022 GTK_SELECTION_SINGLE); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1023 gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(treeview), TRUE); |
31367
917c597beb97
Add pidgin_make_scrollable and use it. Cleans up a bunch of duplicate code. Net code loss of 180 lines. Fixes #13073.
Gabriel Schulhof <nix@go-nix.ca>
parents:
30569
diff
changeset
|
1024 gtk_box_pack_start(GTK_BOX(vbox), |
917c597beb97
Add pidgin_make_scrollable and use it. Cleans up a bunch of duplicate code. Net code loss of 180 lines. Fixes #13073.
Gabriel Schulhof <nix@go-nix.ca>
parents:
30569
diff
changeset
|
1025 pidgin_make_scrollable(treeview, GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS, GTK_SHADOW_IN, -1, -1), |
917c597beb97
Add pidgin_make_scrollable and use it. Cleans up a bunch of duplicate code. Net code loss of 180 lines. Fixes #13073.
Gabriel Schulhof <nix@go-nix.ca>
parents:
30569
diff
changeset
|
1026 TRUE, TRUE, 0); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1027 gtk_widget_show(treeview); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1028 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1029 renderer = gtk_cell_renderer_pixbuf_new(); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1030 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
|
1031 -1, "", renderer, "pixbuf", 0, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1032 |
20100
a3f07fa68e90
Access search results directly instead of going through the API because
Mark Doliner <mark@kingant.net>
parents:
20074
diff
changeset
|
1033 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
|
1034 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
|
1035 PurpleNotifySearchColumn *column = columniter->data; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1036 renderer = gtk_cell_renderer_text_new(); |
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 gtk_tree_view_insert_column_with_attributes(GTK_TREE_VIEW(treeview), -1, |
32319
8878ea011fa1
Hide struct PurpleNotifySearchColumn.
andrew.victor@mxit.com
parents:
32305
diff
changeset
|
1039 purple_notify_searchresult_column_get_title(column), renderer, "text", i, NULL); |
31845 | 1040 |
1041 if (!purple_notify_searchresult_column_is_visible(column)) | |
1042 gtk_tree_view_column_set_visible(gtk_tree_view_get_column(GTK_TREE_VIEW(treeview), i), FALSE); | |
1043 | |
20100
a3f07fa68e90
Access search results directly instead of going through the API because
Mark Doliner <mark@kingant.net>
parents:
20074
diff
changeset
|
1044 i++; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1045 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1046 |
24552
f10aba5592c6
The other day while struct hiding, I noticed a for loop that was checking
Richard Laager <rlaager@wiktel.com>
parents:
24437
diff
changeset
|
1047 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:
24437
diff
changeset
|
1048 PurpleNotifySearchButton *b = l->data; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1049 GtkWidget *button = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1050 switch (b->type) { |
15822 | 1051 case PURPLE_NOTIFY_BUTTON_LABELED: |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1052 if(b->label) { |
32402
5b1666b06b34
Ensure labelled buttons are shown for search results in Pidgin.
hyc@symas.com
parents:
32319
diff
changeset
|
1053 button = gtk_dialog_add_button(GTK_DIALOG(window), b->label, GTK_RESPONSE_NONE); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1054 } else { |
19654
941965d6fd88
Patch from QuLogic. Fixes #2903 ('Missing newlines in debug messages.')
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19366
diff
changeset
|
1055 purple_debug_warning("gtknotify", "Missing button label\n"); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1056 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1057 break; |
15822 | 1058 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
|
1059 button = gtk_dialog_add_button(GTK_DIALOG(window), GTK_STOCK_GO_FORWARD, GTK_RESPONSE_NONE); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1060 break; |
15822 | 1061 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
|
1062 button = gtk_dialog_add_button(GTK_DIALOG(window), GTK_STOCK_ADD, GTK_RESPONSE_NONE); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1063 break; |
15822 | 1064 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
|
1065 button = gtk_dialog_add_button(GTK_DIALOG(window), PIDGIN_STOCK_TOOLBAR_USER_INFO, GTK_RESPONSE_NONE); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1066 break; |
15822 | 1067 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
|
1068 button = gtk_dialog_add_button(GTK_DIALOG(window), PIDGIN_STOCK_TOOLBAR_MESSAGE_NEW, GTK_RESPONSE_NONE); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1069 break; |
15822 | 1070 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
|
1071 button = gtk_dialog_add_button(GTK_DIALOG(window), PIDGIN_STOCK_CHAT, GTK_RESPONSE_NONE); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1072 break; |
15822 | 1073 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
|
1074 button = gtk_dialog_add_button(GTK_DIALOG(window), PIDGIN_STOCK_INVITE, GTK_RESPONSE_NONE); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1075 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1076 default: |
15822 | 1077 purple_debug_warning("gtknotify", "Incorrect button type: %d\n", b->type); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1078 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1079 if (button != NULL) { |
15820 | 1080 PidginNotifySearchResultsButtonData *bd; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1081 |
15820 | 1082 bd = g_new0(PidginNotifySearchResultsButtonData, 1); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1083 bd->button = b; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1084 bd->data = data; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1085 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1086 g_signal_connect(G_OBJECT(button), "clicked", |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1087 G_CALLBACK(searchresults_callback_wrapper_cb), bd); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1088 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
|
1089 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1090 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1091 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1092 /* Add the Close button */ |
19366
bd18c02bba9f
Use GtkDialog more often. Thanks nix_nix. Fixes #2618
Sean Egan <seanegan@gmail.com>
parents:
19316
diff
changeset
|
1093 close_button = gtk_dialog_add_button(GTK_DIALOG(window), GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1094 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1095 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
|
1096 G_CALLBACK(searchresults_close_cb), data); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1097 |
32305
2ec94166be43
On the way to hiding the PurpleConnection struct.
andrew.victor@mxit.com
parents:
32141
diff
changeset
|
1098 data->account = purple_connection_get_account(gc); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1099 data->model = model; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1100 data->treeview = treeview; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1101 data->window = window; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1102 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1103 /* Insert rows. */ |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15435
diff
changeset
|
1104 pidgin_notify_searchresults_new_rows(gc, results, data); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1105 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1106 /* 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
|
1107 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
|
1108 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1109 gtk_widget_show(window); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1110 return data; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1111 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1112 |
16977
563a42d98e3a
Fix ticket #387.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16673
diff
changeset
|
1113 /** Xerox'ed from Finch! How the tables have turned!! ;) **/ |
563a42d98e3a
Fix ticket #387.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16673
diff
changeset
|
1114 /** User information. **/ |
563a42d98e3a
Fix ticket #387.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16673
diff
changeset
|
1115 static GHashTable *userinfo; |
563a42d98e3a
Fix ticket #387.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16673
diff
changeset
|
1116 |
563a42d98e3a
Fix ticket #387.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16673
diff
changeset
|
1117 static char * |
563a42d98e3a
Fix ticket #387.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16673
diff
changeset
|
1118 userinfo_hash(PurpleAccount *account, const char *who) |
563a42d98e3a
Fix ticket #387.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16673
diff
changeset
|
1119 { |
563a42d98e3a
Fix ticket #387.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16673
diff
changeset
|
1120 char key[256]; |
563a42d98e3a
Fix ticket #387.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16673
diff
changeset
|
1121 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:
16673
diff
changeset
|
1122 return g_utf8_strup(key, -1); |
563a42d98e3a
Fix ticket #387.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16673
diff
changeset
|
1123 } |
563a42d98e3a
Fix ticket #387.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16673
diff
changeset
|
1124 |
563a42d98e3a
Fix ticket #387.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16673
diff
changeset
|
1125 static void |
563a42d98e3a
Fix ticket #387.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16673
diff
changeset
|
1126 remove_userinfo(GtkWidget *widget, gpointer key) |
563a42d98e3a
Fix ticket #387.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16673
diff
changeset
|
1127 { |
17620
c1c533448097
sadrul's fix for the userinfo notify crash on disconnect that was caused by
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16977
diff
changeset
|
1128 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:
16977
diff
changeset
|
1129 |
c1c533448097
sadrul's fix for the userinfo notify crash on disconnect that was caused by
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16977
diff
changeset
|
1130 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:
16977
diff
changeset
|
1131 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:
16977
diff
changeset
|
1132 |
16977
563a42d98e3a
Fix ticket #387.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16673
diff
changeset
|
1133 g_hash_table_remove(userinfo, key); |
563a42d98e3a
Fix ticket #387.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16673
diff
changeset
|
1134 } |
563a42d98e3a
Fix ticket #387.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16673
diff
changeset
|
1135 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1136 static void * |
15822 | 1137 pidgin_notify_userinfo(PurpleConnection *gc, const char *who, |
1138 PurpleNotifyUserInfo *user_info) | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1139 { |
16977
563a42d98e3a
Fix ticket #387.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16673
diff
changeset
|
1140 char *info; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1141 void *ui_handle; |
16977
563a42d98e3a
Fix ticket #387.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16673
diff
changeset
|
1142 char *key = userinfo_hash(purple_connection_get_account(gc), who); |
17620
c1c533448097
sadrul's fix for the userinfo notify crash on disconnect that was caused by
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16977
diff
changeset
|
1143 PidginUserInfo *pinfo = NULL; |
16977
563a42d98e3a
Fix ticket #387.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16673
diff
changeset
|
1144 |
563a42d98e3a
Fix ticket #387.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16673
diff
changeset
|
1145 if (!userinfo) { |
17620
c1c533448097
sadrul's fix for the userinfo notify crash on disconnect that was caused by
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16977
diff
changeset
|
1146 userinfo = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, g_free); |
16977
563a42d98e3a
Fix ticket #387.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16673
diff
changeset
|
1147 } |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1148 |
15822 | 1149 info = purple_notify_user_info_get_text_with_newline(user_info, "<br />"); |
17620
c1c533448097
sadrul's fix for the userinfo notify crash on disconnect that was caused by
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16977
diff
changeset
|
1150 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:
16977
diff
changeset
|
1151 if (pinfo != NULL) { |
32059 | 1152 GtkWidget *webview = g_object_get_data(G_OBJECT(pinfo->window), "webview-widget"); |
16977
563a42d98e3a
Fix ticket #387.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16673
diff
changeset
|
1153 char *linked_text = purple_markup_linkify(info); |
32808
b8cbd52e26b1
Remove _with_imgstore suffix on this function. There isn't a version
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32696
diff
changeset
|
1154 gtk_webview_load_html_string(GTK_WEBVIEW(webview), linked_text); |
16977
563a42d98e3a
Fix ticket #387.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16673
diff
changeset
|
1155 g_free(linked_text); |
563a42d98e3a
Fix ticket #387.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16673
diff
changeset
|
1156 g_free(key); |
17620
c1c533448097
sadrul's fix for the userinfo notify crash on disconnect that was caused by
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16977
diff
changeset
|
1157 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:
16977
diff
changeset
|
1158 pinfo->count++; |
16977
563a42d98e3a
Fix ticket #387.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16673
diff
changeset
|
1159 } else { |
563a42d98e3a
Fix ticket #387.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16673
diff
changeset
|
1160 char *primary = g_strdup_printf(_("Info for %s"), who); |
563a42d98e3a
Fix ticket #387.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16673
diff
changeset
|
1161 ui_handle = pidgin_notify_formatted(_("Buddy Information"), primary, NULL, info); |
17620
c1c533448097
sadrul's fix for the userinfo notify crash on disconnect that was caused by
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16977
diff
changeset
|
1162 g_signal_handlers_disconnect_by_func(G_OBJECT(ui_handle), G_CALLBACK(formatted_close_cb), NULL); |
16977
563a42d98e3a
Fix ticket #387.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16673
diff
changeset
|
1163 g_signal_connect(G_OBJECT(ui_handle), "destroy", G_CALLBACK(remove_userinfo), key); |
563a42d98e3a
Fix ticket #387.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16673
diff
changeset
|
1164 g_free(primary); |
17620
c1c533448097
sadrul's fix for the userinfo notify crash on disconnect that was caused by
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16977
diff
changeset
|
1165 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:
16977
diff
changeset
|
1166 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:
16977
diff
changeset
|
1167 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:
16977
diff
changeset
|
1168 g_hash_table_insert(userinfo, key, pinfo); |
16977
563a42d98e3a
Fix ticket #387.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16673
diff
changeset
|
1169 } |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1170 g_free(info); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1171 return ui_handle; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1172 } |
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 static void |
15822 | 1175 pidgin_close_notify(PurpleNotifyType type, void *ui_handle) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1176 { |
15822 | 1177 if (type == PURPLE_NOTIFY_EMAIL || type == PURPLE_NOTIFY_EMAILS) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1178 { |
15820 | 1179 PidginNotifyMailData *data = (PidginNotifyMailData *)ui_handle; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1180 |
26186
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
1181 if (data) { |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
1182 g_free(data->url); |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
1183 g_free(data); |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
1184 } |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1185 } |
15822 | 1186 else if (type == PURPLE_NOTIFY_SEARCHRESULTS) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1187 { |
15820 | 1188 PidginNotifySearchResultsData *data = (PidginNotifySearchResultsData *)ui_handle; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1189 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1190 gtk_widget_destroy(data->window); |
15822 | 1191 purple_notify_searchresults_free(data->results); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1192 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1193 g_free(data); |
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 else if (ui_handle != NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1196 gtk_widget_destroy(GTK_WIDGET(ui_handle)); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1197 } |
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 #ifndef _WIN32 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1200 static gint |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1201 uri_command(const char *command, gboolean sync) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1202 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1203 gchar *tmp; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1204 GError *error = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1205 gint ret = 0; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1206 |
15822 | 1207 purple_debug_misc("gtknotify", "Executing %s\n", command); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1208 |
15822 | 1209 if (!purple_program_is_valid(command)) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1210 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1211 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
|
1212 command ? command : "(none)"); |
15822 | 1213 purple_notify_error(NULL, NULL, _("Unable to open URL"), tmp); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1214 g_free(tmp); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1215 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1216 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1217 else if (sync) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1218 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1219 gint status; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1220 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1221 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
|
1222 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1223 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
|
1224 command, error->message); |
15822 | 1225 purple_notify_error(NULL, NULL, _("Unable to open URL"), tmp); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1226 g_free(tmp); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1227 g_error_free(error); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1228 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1229 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1230 ret = status; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1231 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1232 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1233 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1234 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
|
1235 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1236 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
|
1237 command, error->message); |
15822 | 1238 purple_notify_error(NULL, NULL, _("Unable to open URL"), tmp); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1239 g_free(tmp); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1240 g_error_free(error); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1241 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1242 } |
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 return ret; |
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 #endif /* _WIN32 */ |
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 static void * |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15435
diff
changeset
|
1249 pidgin_notify_uri(const char *uri) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1250 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1251 #ifndef _WIN32 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1252 char *escaped = g_shell_quote(uri); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1253 char *command = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1254 char *remote_command = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1255 const char *web_browser; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1256 int place; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1257 |
16062
07554cc5d090
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <stu@nosnilmot.com>
parents:
15870
diff
changeset
|
1258 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:
15870
diff
changeset
|
1259 place = purple_prefs_get_int(PIDGIN_PREFS_ROOT "/browsers/place"); |
15373
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 /* if they are running gnome, use the gnome web browser */ |
15822 | 1262 if (purple_running_gnome() == TRUE) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1263 { |
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
|
1264 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
|
1265 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
|
1266 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
|
1267 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
|
1268 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
|
1269 g_free(tmp); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1270 } |
15822 | 1271 else if (purple_running_osx() == TRUE) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1272 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1273 command = g_strdup_printf("open %s", escaped); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1274 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1275 else if (!strcmp(web_browser, "epiphany") || |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1276 !strcmp(web_browser, "galeon")) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1277 { |
15506 | 1278 if (place == PIDGIN_BROWSER_NEW_WINDOW) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1279 command = g_strdup_printf("%s -w %s", web_browser, escaped); |
15506 | 1280 else if (place == PIDGIN_BROWSER_NEW_TAB) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1281 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
|
1282 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1283 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
|
1284 } |
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
|
1285 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
|
1286 { |
c77098cebf23
Use xdg-open instead of gnome-open, if possible. We might want to use
Stu Tomlinson <stu@nosnilmot.com>
parents:
22087
diff
changeset
|
1287 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
|
1288 } |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1289 else if (!strcmp(web_browser, "gnome-open")) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1290 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1291 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
|
1292 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1293 else if (!strcmp(web_browser, "kfmclient")) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1294 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1295 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
|
1296 /* |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1297 * 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
|
1298 * and/or current window? |
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 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1301 else if (!strcmp(web_browser, "mozilla") || |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1302 !strcmp(web_browser, "mozilla-firebird") || |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1303 !strcmp(web_browser, "firefox") || |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1304 !strcmp(web_browser, "seamonkey")) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1305 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1306 char *args = ""; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1307 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1308 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
|
1309 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1310 /* |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1311 * 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
|
1312 * 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
|
1313 * 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
|
1314 * 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
|
1315 * 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
|
1316 * 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
|
1317 * for now. |
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 if (!strcmp(web_browser, "firefox")) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1320 args = "-a firefox"; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1321 |
15506 | 1322 if (place == PIDGIN_BROWSER_NEW_WINDOW) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1323 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
|
1324 "openURL(%s,new-window)", |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1325 web_browser, args, escaped); |
15506 | 1326 else if (place == PIDGIN_BROWSER_NEW_TAB) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1327 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
|
1328 "openURL(%s,new-tab)", |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1329 web_browser, args, escaped); |
15506 | 1330 else if (place == PIDGIN_BROWSER_CURRENT) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1331 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
|
1332 "openURL(%s)", |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1333 web_browser, args, escaped); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1334 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1335 else if (!strcmp(web_browser, "netscape")) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1336 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1337 command = g_strdup_printf("netscape %s", escaped); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1338 |
15506 | 1339 if (place == PIDGIN_BROWSER_NEW_WINDOW) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1340 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1341 remote_command = g_strdup_printf("netscape -remote " |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1342 "openURL(%s,new-window)", |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1343 escaped); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1344 } |
15506 | 1345 else if (place == PIDGIN_BROWSER_CURRENT) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1346 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1347 remote_command = g_strdup_printf("netscape -remote " |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1348 "openURL(%s)", escaped); |
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 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1351 else if (!strcmp(web_browser, "opera")) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1352 { |
15506 | 1353 if (place == PIDGIN_BROWSER_NEW_WINDOW) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1354 command = g_strdup_printf("opera -newwindow %s", escaped); |
15506 | 1355 else if (place == PIDGIN_BROWSER_NEW_TAB) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1356 command = g_strdup_printf("opera -newpage %s", escaped); |
15506 | 1357 else if (place == PIDGIN_BROWSER_CURRENT) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1358 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1359 remote_command = g_strdup_printf("opera -remote " |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1360 "openURL(%s)", escaped); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1361 command = g_strdup_printf("opera %s", escaped); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1362 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1363 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1364 command = g_strdup_printf("opera %s", escaped); |
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 } |
30557
00455fe8c574
Add the new browsers here so they do useful stuff by default.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
29094
diff
changeset
|
1367 else if (!strcmp(web_browser, "google-chrome")) |
00455fe8c574
Add the new browsers here so they do useful stuff by default.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
29094
diff
changeset
|
1368 { |
00455fe8c574
Add the new browsers here so they do useful stuff by default.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
29094
diff
changeset
|
1369 /* Google Chrome doesn't have command-line arguments that control the |
00455fe8c574
Add the new browsers here so they do useful stuff by default.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
29094
diff
changeset
|
1370 * opening of links from external calls. This is controlled solely from |
00455fe8c574
Add the new browsers here so they do useful stuff by default.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
29094
diff
changeset
|
1371 * a preference within Google Chrome. */ |
00455fe8c574
Add the new browsers here so they do useful stuff by default.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
29094
diff
changeset
|
1372 command = g_strdup_printf("google-chrome %s", escaped); |
00455fe8c574
Add the new browsers here so they do useful stuff by default.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
29094
diff
changeset
|
1373 } |
00455fe8c574
Add the new browsers here so they do useful stuff by default.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
29094
diff
changeset
|
1374 else if (!strcmp(web_browser, "chrome")) |
00455fe8c574
Add the new browsers here so they do useful stuff by default.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
29094
diff
changeset
|
1375 { |
00455fe8c574
Add the new browsers here so they do useful stuff by default.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
29094
diff
changeset
|
1376 /* Chromium doesn't have command-line arguments that control the |
00455fe8c574
Add the new browsers here so they do useful stuff by default.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
29094
diff
changeset
|
1377 * opening of links from external calls. This is controlled solely from |
00455fe8c574
Add the new browsers here so they do useful stuff by default.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
29094
diff
changeset
|
1378 * a preference within Chromium. */ |
00455fe8c574
Add the new browsers here so they do useful stuff by default.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
29094
diff
changeset
|
1379 command = g_strdup_printf("chrome %s", escaped); |
00455fe8c574
Add the new browsers here so they do useful stuff by default.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
29094
diff
changeset
|
1380 } |
00455fe8c574
Add the new browsers here so they do useful stuff by default.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
29094
diff
changeset
|
1381 else if (!strcmp(web_browser, "chromium-browser")) |
00455fe8c574
Add the new browsers here so they do useful stuff by default.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
29094
diff
changeset
|
1382 { |
00455fe8c574
Add the new browsers here so they do useful stuff by default.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
29094
diff
changeset
|
1383 /* Chromium doesn't have command-line arguments that control the |
00455fe8c574
Add the new browsers here so they do useful stuff by default.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
29094
diff
changeset
|
1384 * opening of links from external calls. This is controlled solely from |
00455fe8c574
Add the new browsers here so they do useful stuff by default.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
29094
diff
changeset
|
1385 * a preference within Chromium. */ |
00455fe8c574
Add the new browsers here so they do useful stuff by default.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
29094
diff
changeset
|
1386 command = g_strdup_printf("chromium-browser %s", escaped); |
00455fe8c574
Add the new browsers here so they do useful stuff by default.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
29094
diff
changeset
|
1387 } |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1388 else if (!strcmp(web_browser, "custom")) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1389 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1390 const char *web_command; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1391 |
30569
70d8e2e71552
I thought I had done this in my last commit. Clearly I'm an idiot. This fixes
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
30558
diff
changeset
|
1392 web_command = purple_prefs_get_string(PIDGIN_PREFS_ROOT "/browsers/manual_command"); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1393 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1394 if (web_command == NULL || *web_command == '\0') |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1395 { |
15822 | 1396 purple_notify_error(NULL, NULL, _("Unable to open URL"), |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1397 _("The 'Manual' browser command has been " |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1398 "chosen, but no command has been set.")); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1399 return NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1400 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1401 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1402 if (strstr(web_command, "%s")) |
15822 | 1403 command = purple_strreplace(web_command, "%s", escaped); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1404 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1405 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1406 /* |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1407 * 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
|
1408 * 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
|
1409 */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1410 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
|
1411 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1412 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1413 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1414 g_free(escaped); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1415 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1416 if (remote_command != NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1417 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1418 /* try the remote command first */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1419 if (uri_command(remote_command, TRUE) != 0) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1420 uri_command(command, FALSE); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1421 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1422 g_free(remote_command); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1423 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1424 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1425 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1426 uri_command(command, FALSE); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1427 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1428 g_free(command); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1429 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1430 #else /* !_WIN32 */ |
15514
75ffc646647f
Win32 de-gaimification of pidgin
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15508
diff
changeset
|
1431 winpidgin_notify_uri(uri); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1432 #endif /* !_WIN32 */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1433 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1434 return NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1435 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1436 |
27256
c245c583a1a6
Remove a few layers of evil abstraction.
Paul Aurich <paul@darkrain42.org>
parents:
27255
diff
changeset
|
1437 void |
c245c583a1a6
Remove a few layers of evil abstraction.
Paul Aurich <paul@darkrain42.org>
parents:
27255
diff
changeset
|
1438 pidgin_notify_pounce_add(PurpleAccount *account, PurplePounce *pounce, |
c245c583a1a6
Remove a few layers of evil abstraction.
Paul Aurich <paul@darkrain42.org>
parents:
27255
diff
changeset
|
1439 const char *alias, const char *event, const char *message, const char *date) |
26186
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
1440 { |
27256
c245c583a1a6
Remove a few layers of evil abstraction.
Paul Aurich <paul@darkrain42.org>
parents:
27255
diff
changeset
|
1441 GdkPixbuf *icon; |
c245c583a1a6
Remove a few layers of evil abstraction.
Paul Aurich <paul@darkrain42.org>
parents:
27255
diff
changeset
|
1442 GtkTreeIter iter; |
c245c583a1a6
Remove a few layers of evil abstraction.
Paul Aurich <paul@darkrain42.org>
parents:
27255
diff
changeset
|
1443 PidginNotifyPounceData *pounce_data; |
28084
9affcab62522
pounce dialog: Try to always have a row selected. Fixes #10037.
Paul Aurich <paul@darkrain42.org>
parents:
28083
diff
changeset
|
1444 gboolean first = (pounce_dialog == NULL); |
27256
c245c583a1a6
Remove a few layers of evil abstraction.
Paul Aurich <paul@darkrain42.org>
parents:
27255
diff
changeset
|
1445 |
27262
975a29213f35
Use mail_dialog consistently, instead of switching from one line to the next. Various other cleanups, too.
Paul Aurich <paul@darkrain42.org>
parents:
27260
diff
changeset
|
1446 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:
27260
diff
changeset
|
1447 pounce_dialog = pidgin_create_notification_dialog(PIDGIN_NOTIFY_POUNCE); |
27256
c245c583a1a6
Remove a few layers of evil abstraction.
Paul Aurich <paul@darkrain42.org>
parents:
27255
diff
changeset
|
1448 |
c245c583a1a6
Remove a few layers of evil abstraction.
Paul Aurich <paul@darkrain42.org>
parents:
27255
diff
changeset
|
1449 icon = pidgin_create_prpl_icon(account, PIDGIN_PRPL_ICON_SMALL); |
c245c583a1a6
Remove a few layers of evil abstraction.
Paul Aurich <paul@darkrain42.org>
parents:
27255
diff
changeset
|
1450 |
c245c583a1a6
Remove a few layers of evil abstraction.
Paul Aurich <paul@darkrain42.org>
parents:
27255
diff
changeset
|
1451 pounce_data = g_new(PidginNotifyPounceData, 1); |
c245c583a1a6
Remove a few layers of evil abstraction.
Paul Aurich <paul@darkrain42.org>
parents:
27255
diff
changeset
|
1452 |
c245c583a1a6
Remove a few layers of evil abstraction.
Paul Aurich <paul@darkrain42.org>
parents:
27255
diff
changeset
|
1453 pounce_data->account = account; |
c245c583a1a6
Remove a few layers of evil abstraction.
Paul Aurich <paul@darkrain42.org>
parents:
27255
diff
changeset
|
1454 pounce_data->pounce = pounce; |
28072
74ce58c7bc30
Further pounce dialog improvements. Refs #10037.
Paul Aurich <paul@darkrain42.org>
parents:
28062
diff
changeset
|
1455 pounce_data->pouncee = g_strdup(purple_pounce_get_pouncee(pounce)); |
27256
c245c583a1a6
Remove a few layers of evil abstraction.
Paul Aurich <paul@darkrain42.org>
parents:
27255
diff
changeset
|
1456 |
c245c583a1a6
Remove a few layers of evil abstraction.
Paul Aurich <paul@darkrain42.org>
parents:
27255
diff
changeset
|
1457 gtk_tree_store_append(pounce_dialog->treemodel, &iter, NULL); |
c245c583a1a6
Remove a few layers of evil abstraction.
Paul Aurich <paul@darkrain42.org>
parents:
27255
diff
changeset
|
1458 |
c245c583a1a6
Remove a few layers of evil abstraction.
Paul Aurich <paul@darkrain42.org>
parents:
27255
diff
changeset
|
1459 gtk_tree_store_set(pounce_dialog->treemodel, &iter, |
c245c583a1a6
Remove a few layers of evil abstraction.
Paul Aurich <paul@darkrain42.org>
parents:
27255
diff
changeset
|
1460 PIDGIN_POUNCE_ICON, icon, |
c245c583a1a6
Remove a few layers of evil abstraction.
Paul Aurich <paul@darkrain42.org>
parents:
27255
diff
changeset
|
1461 PIDGIN_POUNCE_ALIAS, alias, |
c245c583a1a6
Remove a few layers of evil abstraction.
Paul Aurich <paul@darkrain42.org>
parents:
27255
diff
changeset
|
1462 PIDGIN_POUNCE_EVENT, event, |
c245c583a1a6
Remove a few layers of evil abstraction.
Paul Aurich <paul@darkrain42.org>
parents:
27255
diff
changeset
|
1463 PIDGIN_POUNCE_TEXT, (message != NULL)? message : _("No message"), |
c245c583a1a6
Remove a few layers of evil abstraction.
Paul Aurich <paul@darkrain42.org>
parents:
27255
diff
changeset
|
1464 PIDGIN_POUNCE_DATE, date, |
c245c583a1a6
Remove a few layers of evil abstraction.
Paul Aurich <paul@darkrain42.org>
parents:
27255
diff
changeset
|
1465 PIDGIN_POUNCE_DATA, pounce_data, |
c245c583a1a6
Remove a few layers of evil abstraction.
Paul Aurich <paul@darkrain42.org>
parents:
27255
diff
changeset
|
1466 -1); |
c245c583a1a6
Remove a few layers of evil abstraction.
Paul Aurich <paul@darkrain42.org>
parents:
27255
diff
changeset
|
1467 |
28084
9affcab62522
pounce dialog: Try to always have a row selected. Fixes #10037.
Paul Aurich <paul@darkrain42.org>
parents:
28083
diff
changeset
|
1468 if (first) { |
9affcab62522
pounce dialog: Try to always have a row selected. Fixes #10037.
Paul Aurich <paul@darkrain42.org>
parents:
28083
diff
changeset
|
1469 GtkTreeSelection *selection = |
9affcab62522
pounce dialog: Try to always have a row selected. Fixes #10037.
Paul Aurich <paul@darkrain42.org>
parents:
28083
diff
changeset
|
1470 gtk_tree_view_get_selection(GTK_TREE_VIEW(pounce_dialog->treeview)); |
9affcab62522
pounce dialog: Try to always have a row selected. Fixes #10037.
Paul Aurich <paul@darkrain42.org>
parents:
28083
diff
changeset
|
1471 gtk_tree_selection_select_iter(selection, &iter); |
9affcab62522
pounce dialog: Try to always have a row selected. Fixes #10037.
Paul Aurich <paul@darkrain42.org>
parents:
28083
diff
changeset
|
1472 } |
9affcab62522
pounce dialog: Try to always have a row selected. Fixes #10037.
Paul Aurich <paul@darkrain42.org>
parents:
28083
diff
changeset
|
1473 |
27256
c245c583a1a6
Remove a few layers of evil abstraction.
Paul Aurich <paul@darkrain42.org>
parents:
27255
diff
changeset
|
1474 if (icon) |
c245c583a1a6
Remove a few layers of evil abstraction.
Paul Aurich <paul@darkrain42.org>
parents:
27255
diff
changeset
|
1475 g_object_unref(icon); |
c245c583a1a6
Remove a few layers of evil abstraction.
Paul Aurich <paul@darkrain42.org>
parents:
27255
diff
changeset
|
1476 |
27262
975a29213f35
Use mail_dialog consistently, instead of switching from one line to the next. Various other cleanups, too.
Paul Aurich <paul@darkrain42.org>
parents:
27260
diff
changeset
|
1477 gtk_widget_show_all(pounce_dialog->dialog); |
27256
c245c583a1a6
Remove a few layers of evil abstraction.
Paul Aurich <paul@darkrain42.org>
parents:
27255
diff
changeset
|
1478 |
c245c583a1a6
Remove a few layers of evil abstraction.
Paul Aurich <paul@darkrain42.org>
parents:
27255
diff
changeset
|
1479 return; |
c245c583a1a6
Remove a few layers of evil abstraction.
Paul Aurich <paul@darkrain42.org>
parents:
27255
diff
changeset
|
1480 } |
c245c583a1a6
Remove a few layers of evil abstraction.
Paul Aurich <paul@darkrain42.org>
parents:
27255
diff
changeset
|
1481 |
c245c583a1a6
Remove a few layers of evil abstraction.
Paul Aurich <paul@darkrain42.org>
parents:
27255
diff
changeset
|
1482 static PidginNotifyDialog * |
27262
975a29213f35
Use mail_dialog consistently, instead of switching from one line to the next. Various other cleanups, too.
Paul Aurich <paul@darkrain42.org>
parents:
27260
diff
changeset
|
1483 pidgin_create_notification_dialog(PidginNotifyType type) |
27256
c245c583a1a6
Remove a few layers of evil abstraction.
Paul Aurich <paul@darkrain42.org>
parents:
27255
diff
changeset
|
1484 { |
c245c583a1a6
Remove a few layers of evil abstraction.
Paul Aurich <paul@darkrain42.org>
parents:
27255
diff
changeset
|
1485 GtkTreeStore *model = NULL; |
26186
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
1486 GtkWidget *dialog = NULL; |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
1487 GtkWidget *label = NULL; |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
1488 GtkCellRenderer *rend; |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
1489 GtkTreeViewColumn *column; |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
1490 GtkWidget *button = NULL; |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
1491 GtkWidget *vbox = NULL; |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
1492 GtkTreeSelection *sel; |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
1493 PidginNotifyDialog *spec_dialog = NULL; |
27255
357405dc8b2c
Remove trailing whitespace
Paul Aurich <paul@darkrain42.org>
parents:
27243
diff
changeset
|
1494 |
26186
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
1495 g_return_val_if_fail(type < PIDGIN_NOTIFY_TYPES, NULL); |
27255
357405dc8b2c
Remove trailing whitespace
Paul Aurich <paul@darkrain42.org>
parents:
27243
diff
changeset
|
1496 |
27256
c245c583a1a6
Remove a few layers of evil abstraction.
Paul Aurich <paul@darkrain42.org>
parents:
27255
diff
changeset
|
1497 if (type == PIDGIN_NOTIFY_MAIL) { |
27262
975a29213f35
Use mail_dialog consistently, instead of switching from one line to the next. Various other cleanups, too.
Paul Aurich <paul@darkrain42.org>
parents:
27260
diff
changeset
|
1498 g_return_val_if_fail(mail_dialog == NULL, mail_dialog); |
27256
c245c583a1a6
Remove a few layers of evil abstraction.
Paul Aurich <paul@darkrain42.org>
parents:
27255
diff
changeset
|
1499 |
c245c583a1a6
Remove a few layers of evil abstraction.
Paul Aurich <paul@darkrain42.org>
parents:
27255
diff
changeset
|
1500 model = gtk_tree_store_new(COLUMNS_PIDGIN_MAIL, |
c245c583a1a6
Remove a few layers of evil abstraction.
Paul Aurich <paul@darkrain42.org>
parents:
27255
diff
changeset
|
1501 GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_POINTER); |
c245c583a1a6
Remove a few layers of evil abstraction.
Paul Aurich <paul@darkrain42.org>
parents:
27255
diff
changeset
|
1502 |
c245c583a1a6
Remove a few layers of evil abstraction.
Paul Aurich <paul@darkrain42.org>
parents:
27255
diff
changeset
|
1503 } else if (type == PIDGIN_NOTIFY_POUNCE) { |
27262
975a29213f35
Use mail_dialog consistently, instead of switching from one line to the next. Various other cleanups, too.
Paul Aurich <paul@darkrain42.org>
parents:
27260
diff
changeset
|
1504 g_return_val_if_fail(pounce_dialog == NULL, pounce_dialog); |
27256
c245c583a1a6
Remove a few layers of evil abstraction.
Paul Aurich <paul@darkrain42.org>
parents:
27255
diff
changeset
|
1505 |
27262
975a29213f35
Use mail_dialog consistently, instead of switching from one line to the next. Various other cleanups, too.
Paul Aurich <paul@darkrain42.org>
parents:
27260
diff
changeset
|
1506 model = gtk_tree_store_new(COLUMNS_PIDGIN_POUNCE, |
27256
c245c583a1a6
Remove a few layers of evil abstraction.
Paul Aurich <paul@darkrain42.org>
parents:
27255
diff
changeset
|
1507 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:
27255
diff
changeset
|
1508 G_TYPE_STRING, G_TYPE_POINTER); |
c245c583a1a6
Remove a few layers of evil abstraction.
Paul Aurich <paul@darkrain42.org>
parents:
27255
diff
changeset
|
1509 } |
c245c583a1a6
Remove a few layers of evil abstraction.
Paul Aurich <paul@darkrain42.org>
parents:
27255
diff
changeset
|
1510 |
28083
aca6f567cc1f
Reorder the New Pounces/New Mail dialog buttons.
Paul Aurich <paul@darkrain42.org>
parents:
28072
diff
changeset
|
1511 dialog = gtk_dialog_new(); |
26186
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
1512 |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
1513 /* Setup the dialog */ |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
1514 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:
24552
diff
changeset
|
1515 gtk_container_set_border_width(GTK_CONTAINER(GTK_DIALOG(dialog)->vbox), PIDGIN_HIG_BOX_SPACE); |
32685
457443ca22e0
The function gtk_dialog_set_has_separator was removed in GTK+ 2.22.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32141
diff
changeset
|
1516 #if !GTK_CHECK_VERSION(2,22,0) |
26186
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
1517 gtk_dialog_set_has_separator(GTK_DIALOG(dialog), FALSE); |
32685
457443ca22e0
The function gtk_dialog_set_has_separator was removed in GTK+ 2.22.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32141
diff
changeset
|
1518 #endif |
26186
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
1519 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:
24552
diff
changeset
|
1520 |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
1521 /* Vertical box */ |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
1522 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:
24552
diff
changeset
|
1523 |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
1524 /* Golden ratio it up! */ |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
1525 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:
24552
diff
changeset
|
1526 |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
1527 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:
24552
diff
changeset
|
1528 spec_dialog->dialog = dialog; |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
1529 |
27256
c245c583a1a6
Remove a few layers of evil abstraction.
Paul Aurich <paul@darkrain42.org>
parents:
27255
diff
changeset
|
1530 spec_dialog->treemodel = model; |
c245c583a1a6
Remove a few layers of evil abstraction.
Paul Aurich <paul@darkrain42.org>
parents:
27255
diff
changeset
|
1531 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:
27255
diff
changeset
|
1532 g_object_unref(G_OBJECT(model)); |
27255
357405dc8b2c
Remove trailing whitespace
Paul Aurich <paul@darkrain42.org>
parents:
27243
diff
changeset
|
1533 |
26186
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
1534 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:
24552
diff
changeset
|
1535 |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
1536 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:
24552
diff
changeset
|
1537 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:
24552
diff
changeset
|
1538 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:
24552
diff
changeset
|
1539 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:
24552
diff
changeset
|
1540 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:
24552
diff
changeset
|
1541 |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
1542 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:
24552
diff
changeset
|
1543 _("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:
24552
diff
changeset
|
1544 |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
1545 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:
24552
diff
changeset
|
1546 PIDGIN_STOCK_OPEN_MAIL, GTK_RESPONSE_YES); |
27035
9c36a340fcaf
Setting `dialog->open_button = button` when `button` is not yet assigned
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26840
diff
changeset
|
1547 spec_dialog->open_button = button; |
26186
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
1548 |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
1549 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:
24552
diff
changeset
|
1550 |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
1551 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:
24552
diff
changeset
|
1552 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:
24552
diff
changeset
|
1553 pidgin_tree_view_search_equal_func, NULL, NULL); |
32412
eb8f424876a5
Select the first item in the mail-notification dialog. Also,
tim@retout.co.uk
parents:
32402
diff
changeset
|
1554 sel = gtk_tree_view_get_selection(GTK_TREE_VIEW(spec_dialog->treeview)); |
eb8f424876a5
Select the first item in the mail-notification dialog. Also,
tim@retout.co.uk
parents:
32402
diff
changeset
|
1555 gtk_tree_selection_set_mode(sel, GTK_SELECTION_BROWSE); |
26186
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
1556 |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
1557 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:
24552
diff
changeset
|
1558 G_CALLBACK(email_response_cb), spec_dialog); |
32412
eb8f424876a5
Select the first item in the mail-notification dialog. Also,
tim@retout.co.uk
parents:
32402
diff
changeset
|
1559 g_signal_connect(G_OBJECT(sel), "changed", |
eb8f424876a5
Select the first item in the mail-notification dialog. Also,
tim@retout.co.uk
parents:
32402
diff
changeset
|
1560 G_CALLBACK(selection_changed_cb), spec_dialog); |
26186
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
1561 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:
24552
diff
changeset
|
1562 |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
1563 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:
24552
diff
changeset
|
1564 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:
24552
diff
changeset
|
1565 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:
24552
diff
changeset
|
1566 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:
24552
diff
changeset
|
1567 |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
1568 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:
24552
diff
changeset
|
1569 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:
24552
diff
changeset
|
1570 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:
24552
diff
changeset
|
1571 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:
24552
diff
changeset
|
1572 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:
24552
diff
changeset
|
1573 |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
1574 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:
24552
diff
changeset
|
1575 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:
24552
diff
changeset
|
1576 |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
1577 } 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:
24552
diff
changeset
|
1578 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:
24552
diff
changeset
|
1579 |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
1580 button = gtk_dialog_add_button(GTK_DIALOG(dialog), |
28072
74ce58c7bc30
Further pounce dialog improvements. Refs #10037.
Paul Aurich <paul@darkrain42.org>
parents:
28062
diff
changeset
|
1581 _("IM"), GTK_RESPONSE_YES); |
74ce58c7bc30
Further pounce dialog improvements. Refs #10037.
Paul Aurich <paul@darkrain42.org>
parents:
28062
diff
changeset
|
1582 gtk_widget_set_sensitive(button, FALSE); |
74ce58c7bc30
Further pounce dialog improvements. Refs #10037.
Paul Aurich <paul@darkrain42.org>
parents:
28062
diff
changeset
|
1583 spec_dialog->open_button = button; |
28083
aca6f567cc1f
Reorder the New Pounces/New Mail dialog buttons.
Paul Aurich <paul@darkrain42.org>
parents:
28072
diff
changeset
|
1584 |
aca6f567cc1f
Reorder the New Pounces/New Mail dialog buttons.
Paul Aurich <paul@darkrain42.org>
parents:
28072
diff
changeset
|
1585 button = gtk_dialog_add_button(GTK_DIALOG(dialog), |
aca6f567cc1f
Reorder the New Pounces/New Mail dialog buttons.
Paul Aurich <paul@darkrain42.org>
parents:
28072
diff
changeset
|
1586 PIDGIN_STOCK_MODIFY, GTK_RESPONSE_APPLY); |
aca6f567cc1f
Reorder the New Pounces/New Mail dialog buttons.
Paul Aurich <paul@darkrain42.org>
parents:
28072
diff
changeset
|
1587 gtk_widget_set_sensitive(button, FALSE); |
aca6f567cc1f
Reorder the New Pounces/New Mail dialog buttons.
Paul Aurich <paul@darkrain42.org>
parents:
28072
diff
changeset
|
1588 spec_dialog->edit_button = button; |
aca6f567cc1f
Reorder the New Pounces/New Mail dialog buttons.
Paul Aurich <paul@darkrain42.org>
parents:
28072
diff
changeset
|
1589 |
31330
3eaf954631fa
Add a hint to translators on how to translate this string. Italian and
Mark Doliner <mark@kingant.net>
parents:
30569
diff
changeset
|
1590 /* Translators: Make sure you translate "Dismiss" differently than |
3eaf954631fa
Add a hint to translators on how to translate this string. Italian and
Mark Doliner <mark@kingant.net>
parents:
30569
diff
changeset
|
1591 "close"! This string is used in the "You have pounced" dialog |
3eaf954631fa
Add a hint to translators on how to translate this string. Italian and
Mark Doliner <mark@kingant.net>
parents:
30569
diff
changeset
|
1592 that appears when one of your Buddy Pounces is triggered. In |
3eaf954631fa
Add a hint to translators on how to translate this string. Italian and
Mark Doliner <mark@kingant.net>
parents:
30569
diff
changeset
|
1593 this context "Dismiss" means "I acknowledge that I've seen that |
3eaf954631fa
Add a hint to translators on how to translate this string. Italian and
Mark Doliner <mark@kingant.net>
parents:
30569
diff
changeset
|
1594 this pounce was triggered--remove it from this list." Translating |
3eaf954631fa
Add a hint to translators on how to translate this string. Italian and
Mark Doliner <mark@kingant.net>
parents:
30569
diff
changeset
|
1595 it as "Remove" is acceptable if you can't think of a more precise |
3eaf954631fa
Add a hint to translators on how to translate this string. Italian and
Mark Doliner <mark@kingant.net>
parents:
30569
diff
changeset
|
1596 word. */ |
3eaf954631fa
Add a hint to translators on how to translate this string. Italian and
Mark Doliner <mark@kingant.net>
parents:
30569
diff
changeset
|
1597 button = gtk_dialog_add_button(GTK_DIALOG(dialog), _("Dismiss"), |
3eaf954631fa
Add a hint to translators on how to translate this string. Italian and
Mark Doliner <mark@kingant.net>
parents:
30569
diff
changeset
|
1598 GTK_RESPONSE_NO); |
26186
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
1599 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:
24552
diff
changeset
|
1600 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:
24552
diff
changeset
|
1601 |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
1602 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:
24552
diff
changeset
|
1603 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:
24552
diff
changeset
|
1604 |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
1605 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:
24552
diff
changeset
|
1606 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:
24552
diff
changeset
|
1607 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:
24552
diff
changeset
|
1608 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:
24552
diff
changeset
|
1609 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:
24552
diff
changeset
|
1610 |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
1611 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:
24552
diff
changeset
|
1612 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:
24552
diff
changeset
|
1613 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:
24552
diff
changeset
|
1614 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:
24552
diff
changeset
|
1615 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:
24552
diff
changeset
|
1616 |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
1617 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:
24552
diff
changeset
|
1618 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:
24552
diff
changeset
|
1619 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:
24552
diff
changeset
|
1620 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:
24552
diff
changeset
|
1621 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:
24552
diff
changeset
|
1622 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:
24552
diff
changeset
|
1623 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:
24552
diff
changeset
|
1624 |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
1625 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:
24552
diff
changeset
|
1626 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:
24552
diff
changeset
|
1627 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:
24552
diff
changeset
|
1628 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:
24552
diff
changeset
|
1629 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:
24552
diff
changeset
|
1630 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:
24552
diff
changeset
|
1631 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:
24552
diff
changeset
|
1632 |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
1633 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:
24552
diff
changeset
|
1634 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:
24552
diff
changeset
|
1635 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:
24552
diff
changeset
|
1636 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:
24552
diff
changeset
|
1637 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:
24552
diff
changeset
|
1638 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:
24552
diff
changeset
|
1639 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:
24552
diff
changeset
|
1640 |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
1641 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:
24552
diff
changeset
|
1642 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:
24552
diff
changeset
|
1643 |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
1644 sel = gtk_tree_view_get_selection(GTK_TREE_VIEW(spec_dialog->treeview)); |
28072
74ce58c7bc30
Further pounce dialog improvements. Refs #10037.
Paul Aurich <paul@darkrain42.org>
parents:
28062
diff
changeset
|
1645 gtk_tree_selection_set_mode(sel, GTK_SELECTION_MULTIPLE); |
26186
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
1646 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:
24552
diff
changeset
|
1647 G_CALLBACK(pounce_row_selected_cb), NULL); |
28057
f6cdf5f72479
Add a row-activation event for the Pounces dialog to open a new conversation window.
salinasv@gmail.com
parents:
27262
diff
changeset
|
1648 g_signal_connect(G_OBJECT(spec_dialog->treeview), "row-activated", |
28072
74ce58c7bc30
Further pounce dialog improvements. Refs #10037.
Paul Aurich <paul@darkrain42.org>
parents:
28062
diff
changeset
|
1649 G_CALLBACK(pounce_response_open_ims), NULL); |
26186
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
1650 } |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
1651 |
28083
aca6f567cc1f
Reorder the New Pounces/New Mail dialog buttons.
Paul Aurich <paul@darkrain42.org>
parents:
28072
diff
changeset
|
1652 button = gtk_dialog_add_button(GTK_DIALOG(dialog), |
aca6f567cc1f
Reorder the New Pounces/New Mail dialog buttons.
Paul Aurich <paul@darkrain42.org>
parents:
28072
diff
changeset
|
1653 GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE); |
aca6f567cc1f
Reorder the New Pounces/New Mail dialog buttons.
Paul Aurich <paul@darkrain42.org>
parents:
28072
diff
changeset
|
1654 |
26186
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
1655 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:
24552
diff
changeset
|
1656 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:
24552
diff
changeset
|
1657 gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0); |
32133
8e1ec44ede75
Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32127
diff
changeset
|
1658 gtk_box_pack_start(GTK_BOX(vbox), |
31367
917c597beb97
Add pidgin_make_scrollable and use it. Cleans up a bunch of duplicate code. Net code loss of 180 lines. Fixes #13073.
Gabriel Schulhof <nix@go-nix.ca>
parents:
30569
diff
changeset
|
1659 pidgin_make_scrollable(spec_dialog->treeview, GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS, GTK_SHADOW_IN, -1, -1), |
917c597beb97
Add pidgin_make_scrollable and use it. Cleans up a bunch of duplicate code. Net code loss of 180 lines. Fixes #13073.
Gabriel Schulhof <nix@go-nix.ca>
parents:
30569
diff
changeset
|
1660 TRUE, TRUE, 2); |
26186
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
1661 |
27256
c245c583a1a6
Remove a few layers of evil abstraction.
Paul Aurich <paul@darkrain42.org>
parents:
27255
diff
changeset
|
1662 return spec_dialog; |
26186
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
1663 } |
3d997c09b94e
A patch from Jorge Villaseor which makes all pounces share a single window.
Kevin Stange <kevin@simguy.net>
parents:
24552
diff
changeset
|
1664 |
27243
ecdc58da4cdd
Clear the notifications via a signal instead of pidgin_close_notify.
Paul Aurich <paul@darkrain42.org>
parents:
27236
diff
changeset
|
1665 static void |
ecdc58da4cdd
Clear the notifications via a signal instead of pidgin_close_notify.
Paul Aurich <paul@darkrain42.org>
parents:
27236
diff
changeset
|
1666 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:
27236
diff
changeset
|
1667 { |
ecdc58da4cdd
Clear the notifications via a signal instead of pidgin_close_notify.
Paul Aurich <paul@darkrain42.org>
parents:
27236
diff
changeset
|
1668 /* 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:
27236
diff
changeset
|
1669 pidgin_notify_emails(gc, 0, FALSE, NULL, NULL, NULL, NULL); |
27258
fc920924cea3
Close the mail dialog at signoff if it's empty. Closes #9345.
Paul Aurich <paul@darkrain42.org>
parents:
27257
diff
changeset
|
1670 |
27260
8796eaaca38a
Fix the mail_dialog->total_count and use that to tell when the dialog is empty.
Paul Aurich <paul@darkrain42.org>
parents:
27258
diff
changeset
|
1671 if (mail_dialog != NULL && mail_dialog->total_count == 0) |
27258
fc920924cea3
Close the mail dialog at signoff if it's empty. Closes #9345.
Paul Aurich <paul@darkrain42.org>
parents:
27257
diff
changeset
|
1672 reset_mail_dialog(NULL); |
27243
ecdc58da4cdd
Clear the notifications via a signal instead of pidgin_close_notify.
Paul Aurich <paul@darkrain42.org>
parents:
27236
diff
changeset
|
1673 } |
ecdc58da4cdd
Clear the notifications via a signal instead of pidgin_close_notify.
Paul Aurich <paul@darkrain42.org>
parents:
27236
diff
changeset
|
1674 |
ecdc58da4cdd
Clear the notifications via a signal instead of pidgin_close_notify.
Paul Aurich <paul@darkrain42.org>
parents:
27236
diff
changeset
|
1675 static void* |
ecdc58da4cdd
Clear the notifications via a signal instead of pidgin_close_notify.
Paul Aurich <paul@darkrain42.org>
parents:
27236
diff
changeset
|
1676 pidgin_notify_get_handle(void) |
ecdc58da4cdd
Clear the notifications via a signal instead of pidgin_close_notify.
Paul Aurich <paul@darkrain42.org>
parents:
27236
diff
changeset
|
1677 { |
ecdc58da4cdd
Clear the notifications via a signal instead of pidgin_close_notify.
Paul Aurich <paul@darkrain42.org>
parents:
27236
diff
changeset
|
1678 static int handle; |
ecdc58da4cdd
Clear the notifications via a signal instead of pidgin_close_notify.
Paul Aurich <paul@darkrain42.org>
parents:
27236
diff
changeset
|
1679 return &handle; |
ecdc58da4cdd
Clear the notifications via a signal instead of pidgin_close_notify.
Paul Aurich <paul@darkrain42.org>
parents:
27236
diff
changeset
|
1680 } |
ecdc58da4cdd
Clear the notifications via a signal instead of pidgin_close_notify.
Paul Aurich <paul@darkrain42.org>
parents:
27236
diff
changeset
|
1681 |
ecdc58da4cdd
Clear the notifications via a signal instead of pidgin_close_notify.
Paul Aurich <paul@darkrain42.org>
parents:
27236
diff
changeset
|
1682 void pidgin_notify_init(void) |
ecdc58da4cdd
Clear the notifications via a signal instead of pidgin_close_notify.
Paul Aurich <paul@darkrain42.org>
parents:
27236
diff
changeset
|
1683 { |
ecdc58da4cdd
Clear the notifications via a signal instead of pidgin_close_notify.
Paul Aurich <paul@darkrain42.org>
parents:
27236
diff
changeset
|
1684 void *handle = pidgin_notify_get_handle(); |
ecdc58da4cdd
Clear the notifications via a signal instead of pidgin_close_notify.
Paul Aurich <paul@darkrain42.org>
parents:
27236
diff
changeset
|
1685 |
ecdc58da4cdd
Clear the notifications via a signal instead of pidgin_close_notify.
Paul Aurich <paul@darkrain42.org>
parents:
27236
diff
changeset
|
1686 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:
27236
diff
changeset
|
1687 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:
27236
diff
changeset
|
1688 } |
ecdc58da4cdd
Clear the notifications via a signal instead of pidgin_close_notify.
Paul Aurich <paul@darkrain42.org>
parents:
27236
diff
changeset
|
1689 |
ecdc58da4cdd
Clear the notifications via a signal instead of pidgin_close_notify.
Paul Aurich <paul@darkrain42.org>
parents:
27236
diff
changeset
|
1690 void pidgin_notify_uninit(void) |
ecdc58da4cdd
Clear the notifications via a signal instead of pidgin_close_notify.
Paul Aurich <paul@darkrain42.org>
parents:
27236
diff
changeset
|
1691 { |
ecdc58da4cdd
Clear the notifications via a signal instead of pidgin_close_notify.
Paul Aurich <paul@darkrain42.org>
parents:
27236
diff
changeset
|
1692 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:
27236
diff
changeset
|
1693 } |
ecdc58da4cdd
Clear the notifications via a signal instead of pidgin_close_notify.
Paul Aurich <paul@darkrain42.org>
parents:
27236
diff
changeset
|
1694 |
15822 | 1695 static PurpleNotifyUiOps ops = |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1696 { |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15435
diff
changeset
|
1697 pidgin_notify_message, |
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15435
diff
changeset
|
1698 pidgin_notify_email, |
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15435
diff
changeset
|
1699 pidgin_notify_emails, |
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15435
diff
changeset
|
1700 pidgin_notify_formatted, |
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15435
diff
changeset
|
1701 pidgin_notify_searchresults, |
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15435
diff
changeset
|
1702 pidgin_notify_searchresults_new_rows, |
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15435
diff
changeset
|
1703 pidgin_notify_userinfo, |
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15435
diff
changeset
|
1704 pidgin_notify_uri, |
16673
fbf111436896
Patch from John 'rekkanoryo' Bailey to add the padding struct members in pidgin
Gary Kramlich <grim@reaperworld.com>
parents:
16198
diff
changeset
|
1705 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
|
1706 NULL, |
fbf111436896
Patch from John 'rekkanoryo' Bailey to add the padding struct members in pidgin
Gary Kramlich <grim@reaperworld.com>
parents:
16198
diff
changeset
|
1707 NULL, |
fbf111436896
Patch from John 'rekkanoryo' Bailey to add the padding struct members in pidgin
Gary Kramlich <grim@reaperworld.com>
parents:
16198
diff
changeset
|
1708 NULL, |
fbf111436896
Patch from John 'rekkanoryo' Bailey to add the padding struct members in pidgin
Gary Kramlich <grim@reaperworld.com>
parents:
16198
diff
changeset
|
1709 NULL |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1710 }; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1711 |
15822 | 1712 PurpleNotifyUiOps * |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15435
diff
changeset
|
1713 pidgin_notify_get_ui_ops(void) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1714 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1715 return &ops; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1716 } |