Mercurial > pidgin.yaz
annotate pidgin/gtkblist.c @ 24610:9ffd54bf622a
fixes a printf crash on Windows, reported by InstantBird developer fqueze
author | Ka-Hing Cheung <khc@hxbc.us> |
---|---|
date | Sun, 07 Dec 2008 02:12:00 +0000 |
parents | f10aba5592c6 |
children | 125cac3e24ee fdd9fd5c2086 9bdd3ab8087f 25e2ab1fff1d a063901a5499 89b95d143116 |
rev | line source |
---|---|
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1 /* |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2 * @file gtkblist.c GTK+ BuddyList API |
16193
247e421c4fa6
Rename the Doxygen group from gtkui to pidgin.
Richard Laager <rlaager@wiktel.com>
parents:
16122
diff
changeset
|
3 * @ingroup pidgin |
20074
6bf32c9e15a7
remove gpl boilerplate from doxygen docs
Sean Egan <seanegan@gmail.com>
parents:
20059
diff
changeset
|
4 */ |
6bf32c9e15a7
remove gpl boilerplate from doxygen docs
Sean Egan <seanegan@gmail.com>
parents:
20059
diff
changeset
|
5 |
6bf32c9e15a7
remove gpl boilerplate from doxygen docs
Sean Egan <seanegan@gmail.com>
parents:
20059
diff
changeset
|
6 /* pidgin |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7 * |
15871
66dff3dfdea6
Re-sed the copyright notices so they don't all talk about Purple.
Richard Laager <rlaager@wiktel.com>
parents:
15823
diff
changeset
|
8 * Pidgin is the legal property of its developers, whose names are too numerous |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
9 * to list here. Please refer to the COPYRIGHT file distributed with this |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
10 * source distribution. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
11 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
12 * This program is free software; you can redistribute it and/or modify |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
13 * it under the terms of the GNU General Public License as published by |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
14 * the Free Software Foundation; either version 2 of the License, or |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
15 * (at your option) any later version. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
16 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
17 * This program is distributed in the hope that it will be useful, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
20 * GNU General Public License for more details. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
21 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
22 * You should have received a copy of the GNU General Public License |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
23 * along with this program; if not, write to the Free Software |
19680
44b4e8bd759b
The FSF changed its address a while ago; our files were out of date.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
19635
diff
changeset
|
24 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
25 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
26 */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
27 #include "internal.h" |
15514 | 28 #include "pidgin.h" |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
29 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
30 #include "account.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
31 #include "connection.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
32 #include "core.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 "notify.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
35 #include "prpl.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
36 #include "prefs.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
37 #include "plugin.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
38 #include "request.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
39 #include "signals.h" |
15822
84b0f9b23ede
According to etags, pidgin/ should be completely clean of references to 'gaim' as a client
Sean Egan <seanegan@gmail.com>
parents:
15821
diff
changeset
|
40 #include "pidginstock.h" |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
41 #include "util.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
42 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
43 #include "gtkaccount.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
44 #include "gtkblist.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
45 #include "gtkcellrendererexpander.h" |
19015
720c61141f4b
- Add a skeleton for the Pidgin Certificate Manager and include it in
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18435
diff
changeset
|
46 #include "gtkcertmgr.h" |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
47 #include "gtkconv.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
48 #include "gtkdebug.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
49 #include "gtkdialogs.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
50 #include "gtkft.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
51 #include "gtklog.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
52 #include "gtkmenutray.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
53 #include "gtkpounce.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
54 #include "gtkplugin.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
55 #include "gtkprefs.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
56 #include "gtkprivacy.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
57 #include "gtkroomlist.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
58 #include "gtkstatusbox.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
59 #include "gtkscrollbook.h" |
22874
02eda4bd2b22
Apply the custom smiley patches from #1187, from Jorge Villaseo (Masca) and
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22299
diff
changeset
|
60 #include "gtksmiley.h" |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
61 #include "gtkutils.h" |
21410
4ccc4ad0a8b0
Use PidginMiniDialog to display signed in elsewhere errors in the blist.
Will Thompson <will.thompson@collabora.co.uk>
parents:
21401
diff
changeset
|
62 #include "pidgin/minidialog.h" |
21877
6bf73aea6450
Some utility functions for showing tooltips. This is used by the buddylist,
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21781
diff
changeset
|
63 #include "pidgin/pidgintooltip.h" |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
64 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
65 #include <gdk/gdkkeysyms.h> |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
66 #include <gtk/gtk.h> |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
67 #include <gdk/gdk.h> |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
68 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
69 #define HEADLINE_CLOSE_SIZE 12 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
70 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
71 typedef struct |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
72 { |
15823 | 73 PurpleAccount *account; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
74 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
75 GtkWidget *window; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
76 GtkWidget *combo; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
77 GtkWidget *entry; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
78 GtkWidget *entry_for_alias; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
79 GtkWidget *account_box; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
80 |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
81 } PidginAddBuddyData; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
82 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
83 typedef struct |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
84 { |
15823 | 85 PurpleAccount *account; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
86 gchar *default_chat_name; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
87 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
88 GtkWidget *window; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
89 GtkWidget *account_menu; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
90 GtkWidget *alias_entry; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
91 GtkWidget *group_combo; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
92 GtkWidget *entries_box; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
93 GtkSizeGroup *sg; |
20084
de39f3855e8f
Add checkboxes for 'auto-join' and 'persistent' in the add-chat dialog. Closes #2248.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
20083
diff
changeset
|
94 GtkWidget *autojoin; |
de39f3855e8f
Add checkboxes for 'auto-join' and 'persistent' in the add-chat dialog. Closes #2248.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
20083
diff
changeset
|
95 GtkWidget *persistent; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
96 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
97 GList *entries; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
98 |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
99 } PidginAddChatData; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
100 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
101 typedef struct |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
102 { |
15823 | 103 PurpleAccount *account; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
104 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
105 GtkWidget *window; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
106 GtkWidget *account_menu; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
107 GtkWidget *entries_box; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
108 GtkSizeGroup *sg; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
109 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
110 GList *entries; |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
111 } PidginJoinChatData; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
112 |
21386
86b0dc1f60ae
Group all NAME_IN_USE errors together into one neat mini-dialog on the buddy
Will Thompson <will.thompson@collabora.co.uk>
parents:
21384
diff
changeset
|
113 typedef struct |
86b0dc1f60ae
Group all NAME_IN_USE errors together into one neat mini-dialog on the buddy
Will Thompson <will.thompson@collabora.co.uk>
parents:
21384
diff
changeset
|
114 { |
21497
e2e70f45307f
Remove account error dialogs from the scrollbook's notebook, not from the
Will Thompson <will.thompson@collabora.co.uk>
parents:
21458
diff
changeset
|
115 /** Used to hold error minidialogs. Gets packed |
e2e70f45307f
Remove account error dialogs from the scrollbook's notebook, not from the
Will Thompson <will.thompson@collabora.co.uk>
parents:
21458
diff
changeset
|
116 * inside PidginBuddyList.error_buttons |
21401
c1c7e28223f8
Display all connection errors in a scrollbook, which is packed inside
Will Thompson <will.thompson@collabora.co.uk>
parents:
21400
diff
changeset
|
117 */ |
21497
e2e70f45307f
Remove account error dialogs from the scrollbook's notebook, not from the
Will Thompson <will.thompson@collabora.co.uk>
parents:
21458
diff
changeset
|
118 PidginScrollBook *error_scrollbook; |
21401
c1c7e28223f8
Display all connection errors in a scrollbook, which is packed inside
Will Thompson <will.thompson@collabora.co.uk>
parents:
21400
diff
changeset
|
119 |
21386
86b0dc1f60ae
Group all NAME_IN_USE errors together into one neat mini-dialog on the buddy
Will Thompson <will.thompson@collabora.co.uk>
parents:
21384
diff
changeset
|
120 /** Pointer to the mini-dialog about having signed on elsewhere, if one |
21497
e2e70f45307f
Remove account error dialogs from the scrollbook's notebook, not from the
Will Thompson <will.thompson@collabora.co.uk>
parents:
21458
diff
changeset
|
121 * is showing; @c NULL otherwise. |
21386
86b0dc1f60ae
Group all NAME_IN_USE errors together into one neat mini-dialog on the buddy
Will Thompson <will.thompson@collabora.co.uk>
parents:
21384
diff
changeset
|
122 */ |
21410
4ccc4ad0a8b0
Use PidginMiniDialog to display signed in elsewhere errors in the blist.
Will Thompson <will.thompson@collabora.co.uk>
parents:
21401
diff
changeset
|
123 PidginMiniDialog *signed_on_elsewhere; |
21386
86b0dc1f60ae
Group all NAME_IN_USE errors together into one neat mini-dialog on the buddy
Will Thompson <will.thompson@collabora.co.uk>
parents:
21384
diff
changeset
|
124 } PidginBuddyListPrivate; |
86b0dc1f60ae
Group all NAME_IN_USE errors together into one neat mini-dialog on the buddy
Will Thompson <will.thompson@collabora.co.uk>
parents:
21384
diff
changeset
|
125 |
86b0dc1f60ae
Group all NAME_IN_USE errors together into one neat mini-dialog on the buddy
Will Thompson <will.thompson@collabora.co.uk>
parents:
21384
diff
changeset
|
126 #define PIDGIN_BUDDY_LIST_GET_PRIVATE(list) \ |
86b0dc1f60ae
Group all NAME_IN_USE errors together into one neat mini-dialog on the buddy
Will Thompson <will.thompson@collabora.co.uk>
parents:
21384
diff
changeset
|
127 ((PidginBuddyListPrivate *)((list)->priv)) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
128 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
129 static GtkWidget *accountmenu = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
130 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
131 static guint visibility_manager_count = 0; |
21041
094bbbe89d0d
Track the actual visibility for the buddy list (unobscured, partially and
Casey Harkins <charkins@pidgin.im>
parents:
21040
diff
changeset
|
132 static GdkVisibilityState gtk_blist_visibility = GDK_VISIBILITY_UNOBSCURED; |
22898
5d833ca5a265
Make pidgin_blist_toggle_visibility() hide the buddy list when it is
Casey Harkins <charkins@pidgin.im>
parents:
22789
diff
changeset
|
133 static gboolean gtk_blist_focused = FALSE; |
17851
452bd3baa9af
Do not update the blist TreeStore if a node is currently being edited. Then, when the node is finished editing, force a refresh. Fixes #397 in which aliasing gets rudely cut off anytime the buddy list changes
Sean Egan <seanegan@gmail.com>
parents:
17835
diff
changeset
|
134 static gboolean editing_blist = FALSE; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
135 |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
136 static GList *pidgin_blist_sort_methods = NULL; |
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
137 static struct pidgin_blist_sort_method *current_sort_method = NULL; |
15823 | 138 static void sort_method_none(PurpleBlistNode *node, PurpleBuddyList *blist, GtkTreeIter groupiter, GtkTreeIter *cur, GtkTreeIter *iter); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
139 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
140 /* The functions we use for sorting aren't available in gtk 2.0.x, and |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
141 * segfault in 2.2.0. 2.2.1 is known to work, so I'll require that */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
142 #if GTK_CHECK_VERSION(2,2,1) |
15823 | 143 static void sort_method_alphabetical(PurpleBlistNode *node, PurpleBuddyList *blist, GtkTreeIter groupiter, GtkTreeIter *cur, GtkTreeIter *iter); |
144 static void sort_method_status(PurpleBlistNode *node, PurpleBuddyList *blist, GtkTreeIter groupiter, GtkTreeIter *cur, GtkTreeIter *iter); | |
145 static void sort_method_log(PurpleBlistNode *node, PurpleBuddyList *blist, GtkTreeIter groupiter, GtkTreeIter *cur, GtkTreeIter *iter); | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
146 #endif |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
147 static PidginBuddyList *gtkblist = NULL; |
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
148 |
20028
a2b4eac83902
Part of #1332 to introduce pidgin_text_combo_box_new_entry and
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19680
diff
changeset
|
149 static GList *groups_tree(void); |
15823 | 150 static gboolean pidgin_blist_refresh_timer(PurpleBuddyList *list); |
19538
6575ec8e1a97
Do not try to update a buddy in the buddylist when there's no buddylist.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19509
diff
changeset
|
151 static void pidgin_blist_update_buddy(PurpleBuddyList *list, PurpleBlistNode *node, gboolean status_change); |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
152 static void pidgin_blist_selection_changed(GtkTreeSelection *selection, gpointer data); |
15823 | 153 static void pidgin_blist_update(PurpleBuddyList *list, PurpleBlistNode *node); |
154 static void pidgin_blist_update_group(PurpleBuddyList *list, PurpleBlistNode *node); | |
155 static void pidgin_blist_update_contact(PurpleBuddyList *list, PurpleBlistNode *node); | |
156 static char *pidgin_get_tooltip_text(PurpleBlistNode *node, gboolean full); | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
157 static const char *item_factory_translate_func (const char *path, gpointer func_data); |
15823 | 158 static gboolean get_iter_from_node(PurpleBlistNode *node, GtkTreeIter *iter); |
21877
6bf73aea6450
Some utility functions for showing tooltips. This is used by the buddylist,
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21781
diff
changeset
|
159 static gboolean buddy_is_displayable(PurpleBuddy *buddy); |
15823 | 160 static void redo_buddy_list(PurpleBuddyList *list, gboolean remove, gboolean rerender); |
161 static void pidgin_blist_collapse_contact_cb(GtkWidget *w, PurpleBlistNode *node); | |
162 static char *pidgin_get_group_title(PurpleBlistNode *gnode, gboolean expanded); | |
20043
4d278e98b5ac
Auto-personization. Closes #44
Sean Egan <seanegan@gmail.com>
parents:
20042
diff
changeset
|
163 static void pidgin_blist_expand_contact_cb(GtkWidget *w, PurpleBlistNode *node); |
22299
858ce8a1fc8c
Pull setting the urgent hint on the blist when it is unfocused into its own
Will Thompson <will.thompson@collabora.co.uk>
parents:
22298
diff
changeset
|
164 static void set_urgent(void); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
165 |
19894
0ac0e112a0fa
Add some stuff so that we don't have to traverse over a list to determine
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19611
diff
changeset
|
166 typedef enum { |
0ac0e112a0fa
Add some stuff so that we don't have to traverse over a list to determine
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19611
diff
changeset
|
167 PIDGIN_BLIST_NODE_HAS_PENDING_MESSAGE = 1 << 0, /* Whether there's pending message in a conversation */ |
0ac0e112a0fa
Add some stuff so that we don't have to traverse over a list to determine
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19611
diff
changeset
|
168 } PidginBlistNodeFlags; |
0ac0e112a0fa
Add some stuff so that we don't have to traverse over a list to determine
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19611
diff
changeset
|
169 |
0ac0e112a0fa
Add some stuff so that we don't have to traverse over a list to determine
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19611
diff
changeset
|
170 typedef struct _pidgin_blist_node { |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
171 GtkTreeRowReference *row; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
172 gboolean contact_expanded; |
23969
5045f2ce9cff
disapproval of revision 'f5ca7968e3f6be8f81d068232d389e0b1dab784b'
Kevin Stange <kevin@simguy.net>
parents:
23967
diff
changeset
|
173 gboolean recent_signonoff; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
174 gint recent_signonoff_timer; |
19894
0ac0e112a0fa
Add some stuff so that we don't have to traverse over a list to determine
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19611
diff
changeset
|
175 struct { |
0ac0e112a0fa
Add some stuff so that we don't have to traverse over a list to determine
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19611
diff
changeset
|
176 PurpleConversation *conv; |
0ac0e112a0fa
Add some stuff so that we don't have to traverse over a list to determine
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19611
diff
changeset
|
177 time_t last_message; /* timestamp for last displayed message */ |
0ac0e112a0fa
Add some stuff so that we don't have to traverse over a list to determine
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19611
diff
changeset
|
178 PidginBlistNodeFlags flags; |
0ac0e112a0fa
Add some stuff so that we don't have to traverse over a list to determine
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19611
diff
changeset
|
179 } conv; |
0ac0e112a0fa
Add some stuff so that we don't have to traverse over a list to determine
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19611
diff
changeset
|
180 } PidginBlistNode; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
181 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
182 static char dim_grey_string[8] = ""; |
22007
c38d72677c8a
Probe for -Wstrict-prototypes to get some more warnings. I then cleaned up
Richard Laager <rlaager@wiktel.com>
parents:
21960
diff
changeset
|
183 static char *dim_grey(void) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
184 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
185 if (!gtkblist) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
186 return "dim grey"; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
187 if (!dim_grey_string[0]) { |
18215
16bf31872b7a
Chat topics in status line of chat infopanes
Sean Egan <seanegan@gmail.com>
parents:
18212
diff
changeset
|
188 snprintf(dim_grey_string, sizeof(dim_grey_string), "%s", pidgin_get_dim_grey_string(gtkblist->treeview)); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
189 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
190 return dim_grey_string; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
191 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
192 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
193 /*************************************************** |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
194 * Callbacks * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
195 ***************************************************/ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
196 static gboolean gtk_blist_visibility_cb(GtkWidget *w, GdkEventVisibility *event, gpointer data) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
197 { |
21041
094bbbe89d0d
Track the actual visibility for the buddy list (unobscured, partially and
Casey Harkins <charkins@pidgin.im>
parents:
21040
diff
changeset
|
198 GdkVisibilityState old_state = gtk_blist_visibility; |
094bbbe89d0d
Track the actual visibility for the buddy list (unobscured, partially and
Casey Harkins <charkins@pidgin.im>
parents:
21040
diff
changeset
|
199 gtk_blist_visibility = event->state; |
094bbbe89d0d
Track the actual visibility for the buddy list (unobscured, partially and
Casey Harkins <charkins@pidgin.im>
parents:
21040
diff
changeset
|
200 |
094bbbe89d0d
Track the actual visibility for the buddy list (unobscured, partially and
Casey Harkins <charkins@pidgin.im>
parents:
21040
diff
changeset
|
201 if (gtk_blist_visibility == GDK_VISIBILITY_FULLY_OBSCURED && |
094bbbe89d0d
Track the actual visibility for the buddy list (unobscured, partially and
Casey Harkins <charkins@pidgin.im>
parents:
21040
diff
changeset
|
202 old_state != GDK_VISIBILITY_FULLY_OBSCURED) { |
094bbbe89d0d
Track the actual visibility for the buddy list (unobscured, partially and
Casey Harkins <charkins@pidgin.im>
parents:
21040
diff
changeset
|
203 |
094bbbe89d0d
Track the actual visibility for the buddy list (unobscured, partially and
Casey Harkins <charkins@pidgin.im>
parents:
21040
diff
changeset
|
204 /* no longer fully obscured */ |
094bbbe89d0d
Track the actual visibility for the buddy list (unobscured, partially and
Casey Harkins <charkins@pidgin.im>
parents:
21040
diff
changeset
|
205 pidgin_blist_refresh_timer(purple_get_blist()); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
206 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
207 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
208 /* continue to handle event normally */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
209 return FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
210 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
211 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
212 static gboolean gtk_blist_window_state_cb(GtkWidget *w, GdkEventWindowState *event, gpointer data) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
213 { |
18285
51ebbe199514
Work around bug in older gtk+ versions which does not set the changed_mask
Casey Harkins <charkins@pidgin.im>
parents:
18241
diff
changeset
|
214 #if GTK_CHECK_VERSION(2,2,0) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
215 if(event->changed_mask & GDK_WINDOW_STATE_WITHDRAWN) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
216 if(event->new_window_state & GDK_WINDOW_STATE_WITHDRAWN) |
16062
07554cc5d090
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <stu@nosnilmot.com>
parents:
16010
diff
changeset
|
217 purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/blist/list_visible", FALSE); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
218 else { |
16062
07554cc5d090
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <stu@nosnilmot.com>
parents:
16010
diff
changeset
|
219 purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/blist/list_visible", TRUE); |
15823 | 220 pidgin_blist_refresh_timer(purple_get_blist()); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
221 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
222 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
223 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
224 if(event->changed_mask & GDK_WINDOW_STATE_MAXIMIZED) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
225 if(event->new_window_state & GDK_WINDOW_STATE_MAXIMIZED) |
16062
07554cc5d090
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <stu@nosnilmot.com>
parents:
16010
diff
changeset
|
226 purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/blist/list_maximized", TRUE); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
227 else |
16062
07554cc5d090
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <stu@nosnilmot.com>
parents:
16010
diff
changeset
|
228 purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/blist/list_maximized", FALSE); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
229 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
230 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
231 /* Refresh gtkblist if un-iconifying */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
232 if (event->changed_mask & GDK_WINDOW_STATE_ICONIFIED){ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
233 if (!(event->new_window_state & GDK_WINDOW_STATE_ICONIFIED)) |
15823 | 234 pidgin_blist_refresh_timer(purple_get_blist()); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
235 } |
18285
51ebbe199514
Work around bug in older gtk+ versions which does not set the changed_mask
Casey Harkins <charkins@pidgin.im>
parents:
18241
diff
changeset
|
236 #else |
51ebbe199514
Work around bug in older gtk+ versions which does not set the changed_mask
Casey Harkins <charkins@pidgin.im>
parents:
18241
diff
changeset
|
237 /* At least gtk+ 2.0.6 does not properly set the change_mask when unsetting a |
51ebbe199514
Work around bug in older gtk+ versions which does not set the changed_mask
Casey Harkins <charkins@pidgin.im>
parents:
18241
diff
changeset
|
238 * GdkWindowState flag. To work around, the window state will be explicitly |
51ebbe199514
Work around bug in older gtk+ versions which does not set the changed_mask
Casey Harkins <charkins@pidgin.im>
parents:
18241
diff
changeset
|
239 * queried on these older versions of gtk+. See pidgin ticket #739. |
51ebbe199514
Work around bug in older gtk+ versions which does not set the changed_mask
Casey Harkins <charkins@pidgin.im>
parents:
18241
diff
changeset
|
240 */ |
51ebbe199514
Work around bug in older gtk+ versions which does not set the changed_mask
Casey Harkins <charkins@pidgin.im>
parents:
18241
diff
changeset
|
241 GdkWindowState new_window_state = gdk_window_get_state(G_OBJECT(gtkblist->window->window)); |
51ebbe199514
Work around bug in older gtk+ versions which does not set the changed_mask
Casey Harkins <charkins@pidgin.im>
parents:
18241
diff
changeset
|
242 |
51ebbe199514
Work around bug in older gtk+ versions which does not set the changed_mask
Casey Harkins <charkins@pidgin.im>
parents:
18241
diff
changeset
|
243 if(new_window_state & GDK_WINDOW_STATE_WITHDRAWN) { |
51ebbe199514
Work around bug in older gtk+ versions which does not set the changed_mask
Casey Harkins <charkins@pidgin.im>
parents:
18241
diff
changeset
|
244 purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/blist/list_visible", FALSE); |
51ebbe199514
Work around bug in older gtk+ versions which does not set the changed_mask
Casey Harkins <charkins@pidgin.im>
parents:
18241
diff
changeset
|
245 } else { |
51ebbe199514
Work around bug in older gtk+ versions which does not set the changed_mask
Casey Harkins <charkins@pidgin.im>
parents:
18241
diff
changeset
|
246 purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/blist/list_visible", TRUE); |
51ebbe199514
Work around bug in older gtk+ versions which does not set the changed_mask
Casey Harkins <charkins@pidgin.im>
parents:
18241
diff
changeset
|
247 pidgin_blist_refresh_timer(purple_get_blist()); |
51ebbe199514
Work around bug in older gtk+ versions which does not set the changed_mask
Casey Harkins <charkins@pidgin.im>
parents:
18241
diff
changeset
|
248 } |
51ebbe199514
Work around bug in older gtk+ versions which does not set the changed_mask
Casey Harkins <charkins@pidgin.im>
parents:
18241
diff
changeset
|
249 |
51ebbe199514
Work around bug in older gtk+ versions which does not set the changed_mask
Casey Harkins <charkins@pidgin.im>
parents:
18241
diff
changeset
|
250 if(new_window_state & GDK_WINDOW_STATE_MAXIMIZED) |
51ebbe199514
Work around bug in older gtk+ versions which does not set the changed_mask
Casey Harkins <charkins@pidgin.im>
parents:
18241
diff
changeset
|
251 purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/blist/list_maximized", TRUE); |
51ebbe199514
Work around bug in older gtk+ versions which does not set the changed_mask
Casey Harkins <charkins@pidgin.im>
parents:
18241
diff
changeset
|
252 else |
51ebbe199514
Work around bug in older gtk+ versions which does not set the changed_mask
Casey Harkins <charkins@pidgin.im>
parents:
18241
diff
changeset
|
253 purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/blist/list_maximized", FALSE); |
51ebbe199514
Work around bug in older gtk+ versions which does not set the changed_mask
Casey Harkins <charkins@pidgin.im>
parents:
18241
diff
changeset
|
254 |
51ebbe199514
Work around bug in older gtk+ versions which does not set the changed_mask
Casey Harkins <charkins@pidgin.im>
parents:
18241
diff
changeset
|
255 if (!(new_window_state & GDK_WINDOW_STATE_ICONIFIED)) |
51ebbe199514
Work around bug in older gtk+ versions which does not set the changed_mask
Casey Harkins <charkins@pidgin.im>
parents:
18241
diff
changeset
|
256 pidgin_blist_refresh_timer(purple_get_blist()); |
51ebbe199514
Work around bug in older gtk+ versions which does not set the changed_mask
Casey Harkins <charkins@pidgin.im>
parents:
18241
diff
changeset
|
257 #endif |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
258 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
259 return FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
260 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
261 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
262 static gboolean gtk_blist_delete_cb(GtkWidget *w, GdkEventAny *event, gpointer data) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
263 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
264 if(visibility_manager_count) |
15823 | 265 purple_blist_set_visible(FALSE); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
266 else |
15823 | 267 purple_core_quit(); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
268 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
269 /* we handle everything, event should not propogate further */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
270 return TRUE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
271 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
272 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
273 static gboolean gtk_blist_configure_cb(GtkWidget *w, GdkEventConfigure *event, gpointer data) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
274 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
275 /* unfortunately GdkEventConfigure ignores the window gravity, but * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
276 * the only way we have of setting the position doesn't. we have to * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
277 * call get_position because it does pay attention to the gravity. * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
278 * this is inefficient and I agree it sucks, but it's more likely * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
279 * to work correctly. - Robot101 */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
280 gint x, y; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
281 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
282 /* check for visibility because when we aren't visible, this will * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
283 * give us bogus (0,0) coordinates. - xOr */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
284 if (GTK_WIDGET_VISIBLE(w)) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
285 gtk_window_get_position(GTK_WINDOW(w), &x, &y); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
286 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
287 return FALSE; /* carry on normally */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
288 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
289 #ifdef _WIN32 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
290 /* Workaround for GTK+ bug # 169811 - "configure_event" is fired |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
291 * when the window is being maximized */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
292 if (gdk_window_get_state(w->window) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
293 & GDK_WINDOW_STATE_MAXIMIZED) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
294 return FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
295 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
296 #endif |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
297 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
298 /* don't save if nothing changed */ |
16062
07554cc5d090
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <stu@nosnilmot.com>
parents:
16010
diff
changeset
|
299 if (x == purple_prefs_get_int(PIDGIN_PREFS_ROOT "/blist/x") && |
07554cc5d090
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <stu@nosnilmot.com>
parents:
16010
diff
changeset
|
300 y == purple_prefs_get_int(PIDGIN_PREFS_ROOT "/blist/y") && |
07554cc5d090
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <stu@nosnilmot.com>
parents:
16010
diff
changeset
|
301 event->width == purple_prefs_get_int(PIDGIN_PREFS_ROOT "/blist/width") && |
07554cc5d090
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <stu@nosnilmot.com>
parents:
16010
diff
changeset
|
302 event->height == purple_prefs_get_int(PIDGIN_PREFS_ROOT "/blist/height")) { |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
303 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
304 return FALSE; /* carry on normally */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
305 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
306 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
307 /* don't save off-screen positioning */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
308 if (x + event->width < 0 || |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
309 y + event->height < 0 || |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
310 x > gdk_screen_width() || |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
311 y > gdk_screen_height()) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
312 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
313 return FALSE; /* carry on normally */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
314 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
315 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
316 /* ignore changes when maximized */ |
16062
07554cc5d090
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <stu@nosnilmot.com>
parents:
16010
diff
changeset
|
317 if(purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/blist/list_maximized")) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
318 return FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
319 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
320 /* store the position */ |
16062
07554cc5d090
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <stu@nosnilmot.com>
parents:
16010
diff
changeset
|
321 purple_prefs_set_int(PIDGIN_PREFS_ROOT "/blist/x", x); |
07554cc5d090
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <stu@nosnilmot.com>
parents:
16010
diff
changeset
|
322 purple_prefs_set_int(PIDGIN_PREFS_ROOT "/blist/y", y); |
07554cc5d090
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <stu@nosnilmot.com>
parents:
16010
diff
changeset
|
323 purple_prefs_set_int(PIDGIN_PREFS_ROOT "/blist/width", event->width); |
07554cc5d090
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <stu@nosnilmot.com>
parents:
16010
diff
changeset
|
324 purple_prefs_set_int(PIDGIN_PREFS_ROOT "/blist/height", event->height); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
325 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
326 /* continue to handle event normally */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
327 return FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
328 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
329 |
15823 | 330 static void gtk_blist_menu_info_cb(GtkWidget *w, PurpleBuddy *b) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
331 { |
17275
319bcb73eb4e
Use utility functions to get user info. Closes #964.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
17139
diff
changeset
|
332 pidgin_retrieve_user_info(b->account->gc, purple_buddy_get_name(b)); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
333 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
334 |
15823 | 335 static void gtk_blist_menu_im_cb(GtkWidget *w, PurpleBuddy *b) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
336 { |
16202
0973688f4b74
Word on the street is that we don't want things named pidginfoo_bar(), but
Richard Laager <rlaager@wiktel.com>
parents:
16198
diff
changeset
|
337 pidgin_dialogs_im_with_user(b->account, b->name); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
338 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
339 |
15823 | 340 static void gtk_blist_menu_send_file_cb(GtkWidget *w, PurpleBuddy *b) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
341 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
342 serv_send_file(b->account->gc, b->name, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
343 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
344 |
20045
507e109387fd
Move to menu in blist context menu. Used for more easily moving buddies between groups
Sean Egan <seanegan@gmail.com>
parents:
20043
diff
changeset
|
345 static void gtk_blist_menu_move_to_cb(GtkWidget *w, PurpleBlistNode *node) |
507e109387fd
Move to menu in blist context menu. Used for more easily moving buddies between groups
Sean Egan <seanegan@gmail.com>
parents:
20043
diff
changeset
|
346 { |
20099
ac6bf49cd5ba
Various warning fixes and a small leak fix.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20084
diff
changeset
|
347 PurpleGroup *group = g_object_get_data(G_OBJECT(w), "groupnode"); |
ac6bf49cd5ba
Various warning fixes and a small leak fix.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20084
diff
changeset
|
348 purple_blist_add_contact((PurpleContact *)node, group, NULL); |
20045
507e109387fd
Move to menu in blist context menu. Used for more easily moving buddies between groups
Sean Egan <seanegan@gmail.com>
parents:
20043
diff
changeset
|
349 |
507e109387fd
Move to menu in blist context menu. Used for more easily moving buddies between groups
Sean Egan <seanegan@gmail.com>
parents:
20043
diff
changeset
|
350 } |
507e109387fd
Move to menu in blist context menu. Used for more easily moving buddies between groups
Sean Egan <seanegan@gmail.com>
parents:
20043
diff
changeset
|
351 |
15823 | 352 static void gtk_blist_menu_autojoin_cb(GtkWidget *w, PurpleChat *chat) |
353 { | |
354 purple_blist_node_set_bool((PurpleBlistNode*)chat, "gtk-autojoin", | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
355 gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(w))); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
356 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
357 |
19900
ee5b3ac0d41d
"We are going to destroy the conversations immediately only if the 'close immediately'
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19899
diff
changeset
|
358 static void gtk_blist_menu_persistent_cb(GtkWidget *w, PurpleChat *chat) |
ee5b3ac0d41d
"We are going to destroy the conversations immediately only if the 'close immediately'
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19899
diff
changeset
|
359 { |
ee5b3ac0d41d
"We are going to destroy the conversations immediately only if the 'close immediately'
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19899
diff
changeset
|
360 purple_blist_node_set_bool((PurpleBlistNode*)chat, "gtk-persistent", |
ee5b3ac0d41d
"We are going to destroy the conversations immediately only if the 'close immediately'
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19899
diff
changeset
|
361 gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(w))); |
ee5b3ac0d41d
"We are going to destroy the conversations immediately only if the 'close immediately'
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19899
diff
changeset
|
362 } |
ee5b3ac0d41d
"We are going to destroy the conversations immediately only if the 'close immediately'
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19899
diff
changeset
|
363 |
19894
0ac0e112a0fa
Add some stuff so that we don't have to traverse over a list to determine
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19611
diff
changeset
|
364 static PurpleConversation * |
0ac0e112a0fa
Add some stuff so that we don't have to traverse over a list to determine
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19611
diff
changeset
|
365 find_conversation_with_buddy(PurpleBuddy *buddy) |
0ac0e112a0fa
Add some stuff so that we don't have to traverse over a list to determine
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19611
diff
changeset
|
366 { |
0ac0e112a0fa
Add some stuff so that we don't have to traverse over a list to determine
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19611
diff
changeset
|
367 PidginBlistNode *ui = buddy->node.ui_data; |
0ac0e112a0fa
Add some stuff so that we don't have to traverse over a list to determine
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19611
diff
changeset
|
368 if (ui) |
0ac0e112a0fa
Add some stuff so that we don't have to traverse over a list to determine
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19611
diff
changeset
|
369 return ui->conv.conv; |
0ac0e112a0fa
Add some stuff so that we don't have to traverse over a list to determine
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19611
diff
changeset
|
370 return purple_find_conversation_with_account(PURPLE_CONV_TYPE_IM, |
0ac0e112a0fa
Add some stuff so that we don't have to traverse over a list to determine
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19611
diff
changeset
|
371 purple_buddy_get_name(buddy), |
0ac0e112a0fa
Add some stuff so that we don't have to traverse over a list to determine
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19611
diff
changeset
|
372 purple_buddy_get_account(buddy)); |
0ac0e112a0fa
Add some stuff so that we don't have to traverse over a list to determine
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19611
diff
changeset
|
373 } |
0ac0e112a0fa
Add some stuff so that we don't have to traverse over a list to determine
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19611
diff
changeset
|
374 |
15823 | 375 static void gtk_blist_join_chat(PurpleChat *chat) |
376 { | |
377 PurpleConversation *conv; | |
18217
e3a4ed0febd2
fix double clicking joined chat by asking the prpl what the real name of
Ka-Hing Cheung <khc@hxbc.us>
parents:
18215
diff
changeset
|
378 PurplePluginProtocolInfo *prpl_info; |
e3a4ed0febd2
fix double clicking joined chat by asking the prpl what the real name of
Ka-Hing Cheung <khc@hxbc.us>
parents:
18215
diff
changeset
|
379 const char *name; |
e3a4ed0febd2
fix double clicking joined chat by asking the prpl what the real name of
Ka-Hing Cheung <khc@hxbc.us>
parents:
18215
diff
changeset
|
380 char *chat_name; |
e3a4ed0febd2
fix double clicking joined chat by asking the prpl what the real name of
Ka-Hing Cheung <khc@hxbc.us>
parents:
18215
diff
changeset
|
381 |
e3a4ed0febd2
fix double clicking joined chat by asking the prpl what the real name of
Ka-Hing Cheung <khc@hxbc.us>
parents:
18215
diff
changeset
|
382 prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(purple_find_prpl(purple_account_get_protocol_id(chat->account))); |
e3a4ed0febd2
fix double clicking joined chat by asking the prpl what the real name of
Ka-Hing Cheung <khc@hxbc.us>
parents:
18215
diff
changeset
|
383 |
e3a4ed0febd2
fix double clicking joined chat by asking the prpl what the real name of
Ka-Hing Cheung <khc@hxbc.us>
parents:
18215
diff
changeset
|
384 if (prpl_info && prpl_info->get_chat_name) |
e3a4ed0febd2
fix double clicking joined chat by asking the prpl what the real name of
Ka-Hing Cheung <khc@hxbc.us>
parents:
18215
diff
changeset
|
385 chat_name = prpl_info->get_chat_name(chat->components); |
e3a4ed0febd2
fix double clicking joined chat by asking the prpl what the real name of
Ka-Hing Cheung <khc@hxbc.us>
parents:
18215
diff
changeset
|
386 else |
e3a4ed0febd2
fix double clicking joined chat by asking the prpl what the real name of
Ka-Hing Cheung <khc@hxbc.us>
parents:
18215
diff
changeset
|
387 chat_name = NULL; |
e3a4ed0febd2
fix double clicking joined chat by asking the prpl what the real name of
Ka-Hing Cheung <khc@hxbc.us>
parents:
18215
diff
changeset
|
388 |
e3a4ed0febd2
fix double clicking joined chat by asking the prpl what the real name of
Ka-Hing Cheung <khc@hxbc.us>
parents:
18215
diff
changeset
|
389 if (chat_name) |
e3a4ed0febd2
fix double clicking joined chat by asking the prpl what the real name of
Ka-Hing Cheung <khc@hxbc.us>
parents:
18215
diff
changeset
|
390 name = chat_name; |
e3a4ed0febd2
fix double clicking joined chat by asking the prpl what the real name of
Ka-Hing Cheung <khc@hxbc.us>
parents:
18215
diff
changeset
|
391 else |
e3a4ed0febd2
fix double clicking joined chat by asking the prpl what the real name of
Ka-Hing Cheung <khc@hxbc.us>
parents:
18215
diff
changeset
|
392 name = purple_chat_get_name(chat); |
e3a4ed0febd2
fix double clicking joined chat by asking the prpl what the real name of
Ka-Hing Cheung <khc@hxbc.us>
parents:
18215
diff
changeset
|
393 |
e3a4ed0febd2
fix double clicking joined chat by asking the prpl what the real name of
Ka-Hing Cheung <khc@hxbc.us>
parents:
18215
diff
changeset
|
394 conv = purple_find_conversation_with_account(PURPLE_CONV_TYPE_CHAT, name, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
395 chat->account); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
396 |
19415
2128daf52d31
Reattach the gtk-ui to a conversation when the user wants to
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19363
diff
changeset
|
397 if (conv != NULL) { |
2128daf52d31
Reattach the gtk-ui to a conversation when the user wants to
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19363
diff
changeset
|
398 pidgin_conv_attach_to_conversation(conv); |
15823 | 399 purple_conversation_present(conv); |
19415
2128daf52d31
Reattach the gtk-ui to a conversation when the user wants to
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19363
diff
changeset
|
400 } |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
401 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
402 serv_join_chat(chat->account->gc, chat->components); |
18217
e3a4ed0febd2
fix double clicking joined chat by asking the prpl what the real name of
Ka-Hing Cheung <khc@hxbc.us>
parents:
18215
diff
changeset
|
403 g_free(chat_name); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
404 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
405 |
15823 | 406 static void gtk_blist_menu_join_cb(GtkWidget *w, PurpleChat *chat) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
407 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
408 gtk_blist_join_chat(chat); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
409 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
410 |
18208
669dc8404b56
Fix a compile warning with gtk < 2.6
Stu Tomlinson <stu@nosnilmot.com>
parents:
18206
diff
changeset
|
411 #if GTK_CHECK_VERSION(2,6,0) |
17851
452bd3baa9af
Do not update the blist TreeStore if a node is currently being edited. Then, when the node is finished editing, force a refresh. Fixes #397 in which aliasing gets rudely cut off anytime the buddy list changes
Sean Egan <seanegan@gmail.com>
parents:
17835
diff
changeset
|
412 static void gtk_blist_renderer_editing_cancelled_cb(GtkCellRenderer *renderer, PurpleBuddyList *list) |
452bd3baa9af
Do not update the blist TreeStore if a node is currently being edited. Then, when the node is finished editing, force a refresh. Fixes #397 in which aliasing gets rudely cut off anytime the buddy list changes
Sean Egan <seanegan@gmail.com>
parents:
17835
diff
changeset
|
413 { |
452bd3baa9af
Do not update the blist TreeStore if a node is currently being edited. Then, when the node is finished editing, force a refresh. Fixes #397 in which aliasing gets rudely cut off anytime the buddy list changes
Sean Egan <seanegan@gmail.com>
parents:
17835
diff
changeset
|
414 editing_blist = FALSE; |
21931
fa57a93219bf
Reset the 'editable' flag of the renderer after cancelling the edit. Fixes #4471.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21925
diff
changeset
|
415 g_object_set(G_OBJECT(renderer), "editable", FALSE, NULL); |
17851
452bd3baa9af
Do not update the blist TreeStore if a node is currently being edited. Then, when the node is finished editing, force a refresh. Fixes #397 in which aliasing gets rudely cut off anytime the buddy list changes
Sean Egan <seanegan@gmail.com>
parents:
17835
diff
changeset
|
416 pidgin_blist_refresh(list); |
452bd3baa9af
Do not update the blist TreeStore if a node is currently being edited. Then, when the node is finished editing, force a refresh. Fixes #397 in which aliasing gets rudely cut off anytime the buddy list changes
Sean Egan <seanegan@gmail.com>
parents:
17835
diff
changeset
|
417 } |
452bd3baa9af
Do not update the blist TreeStore if a node is currently being edited. Then, when the node is finished editing, force a refresh. Fixes #397 in which aliasing gets rudely cut off anytime the buddy list changes
Sean Egan <seanegan@gmail.com>
parents:
17835
diff
changeset
|
418 |
16275
9a4854d71234
Patch #205, from SuperMMX. Fix a bug related to using F2 to alias
Mark Doliner <mark@kingant.net>
parents:
16222
diff
changeset
|
419 static void gtk_blist_renderer_editing_started_cb(GtkCellRenderer *renderer, |
9a4854d71234
Patch #205, from SuperMMX. Fix a bug related to using F2 to alias
Mark Doliner <mark@kingant.net>
parents:
16222
diff
changeset
|
420 GtkCellEditable *editable, |
9a4854d71234
Patch #205, from SuperMMX. Fix a bug related to using F2 to alias
Mark Doliner <mark@kingant.net>
parents:
16222
diff
changeset
|
421 gchar *path_str, |
9a4854d71234
Patch #205, from SuperMMX. Fix a bug related to using F2 to alias
Mark Doliner <mark@kingant.net>
parents:
16222
diff
changeset
|
422 gpointer user_data) |
9a4854d71234
Patch #205, from SuperMMX. Fix a bug related to using F2 to alias
Mark Doliner <mark@kingant.net>
parents:
16222
diff
changeset
|
423 { |
9a4854d71234
Patch #205, from SuperMMX. Fix a bug related to using F2 to alias
Mark Doliner <mark@kingant.net>
parents:
16222
diff
changeset
|
424 GtkTreeIter iter; |
9a4854d71234
Patch #205, from SuperMMX. Fix a bug related to using F2 to alias
Mark Doliner <mark@kingant.net>
parents:
16222
diff
changeset
|
425 GtkTreePath *path = NULL; |
9a4854d71234
Patch #205, from SuperMMX. Fix a bug related to using F2 to alias
Mark Doliner <mark@kingant.net>
parents:
16222
diff
changeset
|
426 GValue val; |
9a4854d71234
Patch #205, from SuperMMX. Fix a bug related to using F2 to alias
Mark Doliner <mark@kingant.net>
parents:
16222
diff
changeset
|
427 PurpleBlistNode *node; |
9a4854d71234
Patch #205, from SuperMMX. Fix a bug related to using F2 to alias
Mark Doliner <mark@kingant.net>
parents:
16222
diff
changeset
|
428 const char *text = NULL; |
9a4854d71234
Patch #205, from SuperMMX. Fix a bug related to using F2 to alias
Mark Doliner <mark@kingant.net>
parents:
16222
diff
changeset
|
429 |
9a4854d71234
Patch #205, from SuperMMX. Fix a bug related to using F2 to alias
Mark Doliner <mark@kingant.net>
parents:
16222
diff
changeset
|
430 path = gtk_tree_path_new_from_string (path_str); |
9a4854d71234
Patch #205, from SuperMMX. Fix a bug related to using F2 to alias
Mark Doliner <mark@kingant.net>
parents:
16222
diff
changeset
|
431 gtk_tree_model_get_iter (GTK_TREE_MODEL(gtkblist->treemodel), &iter, path); |
9a4854d71234
Patch #205, from SuperMMX. Fix a bug related to using F2 to alias
Mark Doliner <mark@kingant.net>
parents:
16222
diff
changeset
|
432 gtk_tree_path_free (path); |
9a4854d71234
Patch #205, from SuperMMX. Fix a bug related to using F2 to alias
Mark Doliner <mark@kingant.net>
parents:
16222
diff
changeset
|
433 val.g_type = 0; |
9a4854d71234
Patch #205, from SuperMMX. Fix a bug related to using F2 to alias
Mark Doliner <mark@kingant.net>
parents:
16222
diff
changeset
|
434 gtk_tree_model_get_value (GTK_TREE_MODEL(gtkblist->treemodel), &iter, NODE_COLUMN, &val); |
9a4854d71234
Patch #205, from SuperMMX. Fix a bug related to using F2 to alias
Mark Doliner <mark@kingant.net>
parents:
16222
diff
changeset
|
435 node = g_value_get_pointer(&val); |
9a4854d71234
Patch #205, from SuperMMX. Fix a bug related to using F2 to alias
Mark Doliner <mark@kingant.net>
parents:
16222
diff
changeset
|
436 |
9a4854d71234
Patch #205, from SuperMMX. Fix a bug related to using F2 to alias
Mark Doliner <mark@kingant.net>
parents:
16222
diff
changeset
|
437 switch (node->type) { |
9a4854d71234
Patch #205, from SuperMMX. Fix a bug related to using F2 to alias
Mark Doliner <mark@kingant.net>
parents:
16222
diff
changeset
|
438 case PURPLE_BLIST_CONTACT_NODE: |
9a4854d71234
Patch #205, from SuperMMX. Fix a bug related to using F2 to alias
Mark Doliner <mark@kingant.net>
parents:
16222
diff
changeset
|
439 text = purple_contact_get_alias((PurpleContact *)node); |
9a4854d71234
Patch #205, from SuperMMX. Fix a bug related to using F2 to alias
Mark Doliner <mark@kingant.net>
parents:
16222
diff
changeset
|
440 break; |
9a4854d71234
Patch #205, from SuperMMX. Fix a bug related to using F2 to alias
Mark Doliner <mark@kingant.net>
parents:
16222
diff
changeset
|
441 case PURPLE_BLIST_BUDDY_NODE: |
9a4854d71234
Patch #205, from SuperMMX. Fix a bug related to using F2 to alias
Mark Doliner <mark@kingant.net>
parents:
16222
diff
changeset
|
442 text = purple_buddy_get_alias((PurpleBuddy *)node); |
9a4854d71234
Patch #205, from SuperMMX. Fix a bug related to using F2 to alias
Mark Doliner <mark@kingant.net>
parents:
16222
diff
changeset
|
443 break; |
9a4854d71234
Patch #205, from SuperMMX. Fix a bug related to using F2 to alias
Mark Doliner <mark@kingant.net>
parents:
16222
diff
changeset
|
444 case PURPLE_BLIST_GROUP_NODE: |
9a4854d71234
Patch #205, from SuperMMX. Fix a bug related to using F2 to alias
Mark Doliner <mark@kingant.net>
parents:
16222
diff
changeset
|
445 text = ((PurpleGroup *)node)->name; |
9a4854d71234
Patch #205, from SuperMMX. Fix a bug related to using F2 to alias
Mark Doliner <mark@kingant.net>
parents:
16222
diff
changeset
|
446 break; |
9a4854d71234
Patch #205, from SuperMMX. Fix a bug related to using F2 to alias
Mark Doliner <mark@kingant.net>
parents:
16222
diff
changeset
|
447 default: |
9a4854d71234
Patch #205, from SuperMMX. Fix a bug related to using F2 to alias
Mark Doliner <mark@kingant.net>
parents:
16222
diff
changeset
|
448 g_return_if_reached(); |
9a4854d71234
Patch #205, from SuperMMX. Fix a bug related to using F2 to alias
Mark Doliner <mark@kingant.net>
parents:
16222
diff
changeset
|
449 } |
9a4854d71234
Patch #205, from SuperMMX. Fix a bug related to using F2 to alias
Mark Doliner <mark@kingant.net>
parents:
16222
diff
changeset
|
450 |
9a4854d71234
Patch #205, from SuperMMX. Fix a bug related to using F2 to alias
Mark Doliner <mark@kingant.net>
parents:
16222
diff
changeset
|
451 if (GTK_IS_ENTRY (editable)) { |
9a4854d71234
Patch #205, from SuperMMX. Fix a bug related to using F2 to alias
Mark Doliner <mark@kingant.net>
parents:
16222
diff
changeset
|
452 GtkEntry *entry = GTK_ENTRY (editable); |
17046
0be41b604566
Patch #702, Info not reset on URL redirect
Sean Egan <seanegan@gmail.com>
parents:
17044
diff
changeset
|
453 gtk_entry_set_text(entry, text); |
0be41b604566
Patch #702, Info not reset on URL redirect
Sean Egan <seanegan@gmail.com>
parents:
17044
diff
changeset
|
454 } |
17851
452bd3baa9af
Do not update the blist TreeStore if a node is currently being edited. Then, when the node is finished editing, force a refresh. Fixes #397 in which aliasing gets rudely cut off anytime the buddy list changes
Sean Egan <seanegan@gmail.com>
parents:
17835
diff
changeset
|
455 editing_blist = TRUE; |
16275
9a4854d71234
Patch #205, from SuperMMX. Fix a bug related to using F2 to alias
Mark Doliner <mark@kingant.net>
parents:
16222
diff
changeset
|
456 } |
18208
669dc8404b56
Fix a compile warning with gtk < 2.6
Stu Tomlinson <stu@nosnilmot.com>
parents:
18206
diff
changeset
|
457 #endif |
16275
9a4854d71234
Patch #205, from SuperMMX. Fix a bug related to using F2 to alias
Mark Doliner <mark@kingant.net>
parents:
16222
diff
changeset
|
458 |
20043
4d278e98b5ac
Auto-personization. Closes #44
Sean Egan <seanegan@gmail.com>
parents:
20042
diff
changeset
|
459 static void |
4d278e98b5ac
Auto-personization. Closes #44
Sean Egan <seanegan@gmail.com>
parents:
20042
diff
changeset
|
460 gtk_blist_do_personize(GList *merges) |
4d278e98b5ac
Auto-personization. Closes #44
Sean Egan <seanegan@gmail.com>
parents:
20042
diff
changeset
|
461 { |
4d278e98b5ac
Auto-personization. Closes #44
Sean Egan <seanegan@gmail.com>
parents:
20042
diff
changeset
|
462 PurpleBlistNode *contact = NULL; |
4d278e98b5ac
Auto-personization. Closes #44
Sean Egan <seanegan@gmail.com>
parents:
20042
diff
changeset
|
463 int max = 0; |
4d278e98b5ac
Auto-personization. Closes #44
Sean Egan <seanegan@gmail.com>
parents:
20042
diff
changeset
|
464 GList *tmp; |
4d278e98b5ac
Auto-personization. Closes #44
Sean Egan <seanegan@gmail.com>
parents:
20042
diff
changeset
|
465 |
4d278e98b5ac
Auto-personization. Closes #44
Sean Egan <seanegan@gmail.com>
parents:
20042
diff
changeset
|
466 /* First, we find the contact to merge the rest of the buddies into. |
4d278e98b5ac
Auto-personization. Closes #44
Sean Egan <seanegan@gmail.com>
parents:
20042
diff
changeset
|
467 * This will be the contact with the most buddies in it; ties are broken |
4d278e98b5ac
Auto-personization. Closes #44
Sean Egan <seanegan@gmail.com>
parents:
20042
diff
changeset
|
468 * by which contact is higher in the list |
4d278e98b5ac
Auto-personization. Closes #44
Sean Egan <seanegan@gmail.com>
parents:
20042
diff
changeset
|
469 */ |
4d278e98b5ac
Auto-personization. Closes #44
Sean Egan <seanegan@gmail.com>
parents:
20042
diff
changeset
|
470 for (tmp = merges; tmp; tmp = tmp->next) { |
4d278e98b5ac
Auto-personization. Closes #44
Sean Egan <seanegan@gmail.com>
parents:
20042
diff
changeset
|
471 PurpleBlistNode *node = tmp->data; |
4d278e98b5ac
Auto-personization. Closes #44
Sean Egan <seanegan@gmail.com>
parents:
20042
diff
changeset
|
472 PurpleBlistNode *b; |
4d278e98b5ac
Auto-personization. Closes #44
Sean Egan <seanegan@gmail.com>
parents:
20042
diff
changeset
|
473 int i = 0; |
4d278e98b5ac
Auto-personization. Closes #44
Sean Egan <seanegan@gmail.com>
parents:
20042
diff
changeset
|
474 |
4d278e98b5ac
Auto-personization. Closes #44
Sean Egan <seanegan@gmail.com>
parents:
20042
diff
changeset
|
475 if (node->type == PURPLE_BLIST_BUDDY_NODE) |
4d278e98b5ac
Auto-personization. Closes #44
Sean Egan <seanegan@gmail.com>
parents:
20042
diff
changeset
|
476 node = node->parent; |
4d278e98b5ac
Auto-personization. Closes #44
Sean Egan <seanegan@gmail.com>
parents:
20042
diff
changeset
|
477 |
4d278e98b5ac
Auto-personization. Closes #44
Sean Egan <seanegan@gmail.com>
parents:
20042
diff
changeset
|
478 if (node->type != PURPLE_BLIST_CONTACT_NODE) |
4d278e98b5ac
Auto-personization. Closes #44
Sean Egan <seanegan@gmail.com>
parents:
20042
diff
changeset
|
479 continue; |
4d278e98b5ac
Auto-personization. Closes #44
Sean Egan <seanegan@gmail.com>
parents:
20042
diff
changeset
|
480 |
4d278e98b5ac
Auto-personization. Closes #44
Sean Egan <seanegan@gmail.com>
parents:
20042
diff
changeset
|
481 |
4d278e98b5ac
Auto-personization. Closes #44
Sean Egan <seanegan@gmail.com>
parents:
20042
diff
changeset
|
482 for (b = node->child; b; b = b->next) |
4d278e98b5ac
Auto-personization. Closes #44
Sean Egan <seanegan@gmail.com>
parents:
20042
diff
changeset
|
483 i++; |
4d278e98b5ac
Auto-personization. Closes #44
Sean Egan <seanegan@gmail.com>
parents:
20042
diff
changeset
|
484 if (i > max) { |
4d278e98b5ac
Auto-personization. Closes #44
Sean Egan <seanegan@gmail.com>
parents:
20042
diff
changeset
|
485 contact = node; |
4d278e98b5ac
Auto-personization. Closes #44
Sean Egan <seanegan@gmail.com>
parents:
20042
diff
changeset
|
486 max = i; |
4d278e98b5ac
Auto-personization. Closes #44
Sean Egan <seanegan@gmail.com>
parents:
20042
diff
changeset
|
487 } |
4d278e98b5ac
Auto-personization. Closes #44
Sean Egan <seanegan@gmail.com>
parents:
20042
diff
changeset
|
488 } |
4d278e98b5ac
Auto-personization. Closes #44
Sean Egan <seanegan@gmail.com>
parents:
20042
diff
changeset
|
489 |
4d278e98b5ac
Auto-personization. Closes #44
Sean Egan <seanegan@gmail.com>
parents:
20042
diff
changeset
|
490 if (contact == NULL) |
4d278e98b5ac
Auto-personization. Closes #44
Sean Egan <seanegan@gmail.com>
parents:
20042
diff
changeset
|
491 return; |
4d278e98b5ac
Auto-personization. Closes #44
Sean Egan <seanegan@gmail.com>
parents:
20042
diff
changeset
|
492 |
4d278e98b5ac
Auto-personization. Closes #44
Sean Egan <seanegan@gmail.com>
parents:
20042
diff
changeset
|
493 /* Merge all those buddies into this contact */ |
4d278e98b5ac
Auto-personization. Closes #44
Sean Egan <seanegan@gmail.com>
parents:
20042
diff
changeset
|
494 for (tmp = merges; tmp; tmp = tmp->next) { |
4d278e98b5ac
Auto-personization. Closes #44
Sean Egan <seanegan@gmail.com>
parents:
20042
diff
changeset
|
495 PurpleBlistNode *node = tmp->data; |
4d278e98b5ac
Auto-personization. Closes #44
Sean Egan <seanegan@gmail.com>
parents:
20042
diff
changeset
|
496 if (node->type == PURPLE_BLIST_BUDDY_NODE) |
4d278e98b5ac
Auto-personization. Closes #44
Sean Egan <seanegan@gmail.com>
parents:
20042
diff
changeset
|
497 node = node->parent; |
4d278e98b5ac
Auto-personization. Closes #44
Sean Egan <seanegan@gmail.com>
parents:
20042
diff
changeset
|
498 |
4d278e98b5ac
Auto-personization. Closes #44
Sean Egan <seanegan@gmail.com>
parents:
20042
diff
changeset
|
499 if (node == contact) |
4d278e98b5ac
Auto-personization. Closes #44
Sean Egan <seanegan@gmail.com>
parents:
20042
diff
changeset
|
500 continue; |
4d278e98b5ac
Auto-personization. Closes #44
Sean Egan <seanegan@gmail.com>
parents:
20042
diff
changeset
|
501 |
20099
ac6bf49cd5ba
Various warning fixes and a small leak fix.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20084
diff
changeset
|
502 purple_blist_merge_contact((PurpleContact *)node, contact); |
ac6bf49cd5ba
Various warning fixes and a small leak fix.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20084
diff
changeset
|
503 } |
ac6bf49cd5ba
Various warning fixes and a small leak fix.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20084
diff
changeset
|
504 |
20043
4d278e98b5ac
Auto-personization. Closes #44
Sean Egan <seanegan@gmail.com>
parents:
20042
diff
changeset
|
505 /* And show the expanded contact, so the people know what's going on */ |
4d278e98b5ac
Auto-personization. Closes #44
Sean Egan <seanegan@gmail.com>
parents:
20042
diff
changeset
|
506 pidgin_blist_expand_contact_cb(NULL, contact); |
4d278e98b5ac
Auto-personization. Closes #44
Sean Egan <seanegan@gmail.com>
parents:
20042
diff
changeset
|
507 g_list_free(merges); |
4d278e98b5ac
Auto-personization. Closes #44
Sean Egan <seanegan@gmail.com>
parents:
20042
diff
changeset
|
508 } |
4d278e98b5ac
Auto-personization. Closes #44
Sean Egan <seanegan@gmail.com>
parents:
20042
diff
changeset
|
509 |
4d278e98b5ac
Auto-personization. Closes #44
Sean Egan <seanegan@gmail.com>
parents:
20042
diff
changeset
|
510 static void |
4d278e98b5ac
Auto-personization. Closes #44
Sean Egan <seanegan@gmail.com>
parents:
20042
diff
changeset
|
511 gtk_blist_auto_personize(PurpleBlistNode *group, const char *alias) |
4d278e98b5ac
Auto-personization. Closes #44
Sean Egan <seanegan@gmail.com>
parents:
20042
diff
changeset
|
512 { |
4d278e98b5ac
Auto-personization. Closes #44
Sean Egan <seanegan@gmail.com>
parents:
20042
diff
changeset
|
513 PurpleBlistNode *contact; |
4d278e98b5ac
Auto-personization. Closes #44
Sean Egan <seanegan@gmail.com>
parents:
20042
diff
changeset
|
514 PurpleBlistNode *buddy; |
4d278e98b5ac
Auto-personization. Closes #44
Sean Egan <seanegan@gmail.com>
parents:
20042
diff
changeset
|
515 GList *merges = NULL; |
4d278e98b5ac
Auto-personization. Closes #44
Sean Egan <seanegan@gmail.com>
parents:
20042
diff
changeset
|
516 int i = 0; |
4d278e98b5ac
Auto-personization. Closes #44
Sean Egan <seanegan@gmail.com>
parents:
20042
diff
changeset
|
517 char *a = g_utf8_casefold(alias, -1); |
4d278e98b5ac
Auto-personization. Closes #44
Sean Egan <seanegan@gmail.com>
parents:
20042
diff
changeset
|
518 |
4d278e98b5ac
Auto-personization. Closes #44
Sean Egan <seanegan@gmail.com>
parents:
20042
diff
changeset
|
519 for (contact = group->child; contact; contact = contact->next) { |
4d278e98b5ac
Auto-personization. Closes #44
Sean Egan <seanegan@gmail.com>
parents:
20042
diff
changeset
|
520 char *node_alias; |
4d278e98b5ac
Auto-personization. Closes #44
Sean Egan <seanegan@gmail.com>
parents:
20042
diff
changeset
|
521 if (contact->type != PURPLE_BLIST_CONTACT_NODE) |
4d278e98b5ac
Auto-personization. Closes #44
Sean Egan <seanegan@gmail.com>
parents:
20042
diff
changeset
|
522 continue; |
20099
ac6bf49cd5ba
Various warning fixes and a small leak fix.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20084
diff
changeset
|
523 |
ac6bf49cd5ba
Various warning fixes and a small leak fix.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20084
diff
changeset
|
524 node_alias = g_utf8_casefold(purple_contact_get_alias((PurpleContact *)contact), -1); |
20043
4d278e98b5ac
Auto-personization. Closes #44
Sean Egan <seanegan@gmail.com>
parents:
20042
diff
changeset
|
525 if (node_alias && !g_utf8_collate(node_alias, a)) { |
4d278e98b5ac
Auto-personization. Closes #44
Sean Egan <seanegan@gmail.com>
parents:
20042
diff
changeset
|
526 merges = g_list_append(merges, contact); |
4d278e98b5ac
Auto-personization. Closes #44
Sean Egan <seanegan@gmail.com>
parents:
20042
diff
changeset
|
527 i++; |
4d278e98b5ac
Auto-personization. Closes #44
Sean Egan <seanegan@gmail.com>
parents:
20042
diff
changeset
|
528 g_free(node_alias); |
4d278e98b5ac
Auto-personization. Closes #44
Sean Egan <seanegan@gmail.com>
parents:
20042
diff
changeset
|
529 continue; |
4d278e98b5ac
Auto-personization. Closes #44
Sean Egan <seanegan@gmail.com>
parents:
20042
diff
changeset
|
530 } |
4d278e98b5ac
Auto-personization. Closes #44
Sean Egan <seanegan@gmail.com>
parents:
20042
diff
changeset
|
531 g_free(node_alias); |
4d278e98b5ac
Auto-personization. Closes #44
Sean Egan <seanegan@gmail.com>
parents:
20042
diff
changeset
|
532 |
4d278e98b5ac
Auto-personization. Closes #44
Sean Egan <seanegan@gmail.com>
parents:
20042
diff
changeset
|
533 for (buddy = contact->child; buddy; buddy = buddy->next) { |
4d278e98b5ac
Auto-personization. Closes #44
Sean Egan <seanegan@gmail.com>
parents:
20042
diff
changeset
|
534 if (buddy->type != PURPLE_BLIST_BUDDY_NODE) |
4d278e98b5ac
Auto-personization. Closes #44
Sean Egan <seanegan@gmail.com>
parents:
20042
diff
changeset
|
535 continue; |
20099
ac6bf49cd5ba
Various warning fixes and a small leak fix.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20084
diff
changeset
|
536 |
ac6bf49cd5ba
Various warning fixes and a small leak fix.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20084
diff
changeset
|
537 node_alias = g_utf8_casefold(purple_buddy_get_alias((PurpleBuddy *)buddy), -1); |
20043
4d278e98b5ac
Auto-personization. Closes #44
Sean Egan <seanegan@gmail.com>
parents:
20042
diff
changeset
|
538 if (node_alias && !g_utf8_collate(node_alias, a)) { |
4d278e98b5ac
Auto-personization. Closes #44
Sean Egan <seanegan@gmail.com>
parents:
20042
diff
changeset
|
539 merges = g_list_append(merges, buddy); |
4d278e98b5ac
Auto-personization. Closes #44
Sean Egan <seanegan@gmail.com>
parents:
20042
diff
changeset
|
540 i++; |
21932
f82c94a72f5f
Do not prompt for an already merged contact. Fixes #4285.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21931
diff
changeset
|
541 g_free(node_alias); |
f82c94a72f5f
Do not prompt for an already merged contact. Fixes #4285.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21931
diff
changeset
|
542 break; |
20043
4d278e98b5ac
Auto-personization. Closes #44
Sean Egan <seanegan@gmail.com>
parents:
20042
diff
changeset
|
543 } |
4d278e98b5ac
Auto-personization. Closes #44
Sean Egan <seanegan@gmail.com>
parents:
20042
diff
changeset
|
544 g_free(node_alias); |
4d278e98b5ac
Auto-personization. Closes #44
Sean Egan <seanegan@gmail.com>
parents:
20042
diff
changeset
|
545 } |
4d278e98b5ac
Auto-personization. Closes #44
Sean Egan <seanegan@gmail.com>
parents:
20042
diff
changeset
|
546 } |
4d278e98b5ac
Auto-personization. Closes #44
Sean Egan <seanegan@gmail.com>
parents:
20042
diff
changeset
|
547 g_free(a); |
21932
f82c94a72f5f
Do not prompt for an already merged contact. Fixes #4285.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21931
diff
changeset
|
548 |
20043
4d278e98b5ac
Auto-personization. Closes #44
Sean Egan <seanegan@gmail.com>
parents:
20042
diff
changeset
|
549 if (i > 1) |
20082
90b5255f0a30
In the auto-personize code:
Richard Laager <rlaager@wiktel.com>
parents:
20059
diff
changeset
|
550 { |
20158 | 551 char *msg = g_strdup_printf(ngettext("You have %d contact named %s. Would you like to merge them?", "You currently have %d contacts named %s. Would you like to merge them?", i), i, alias); |
21099
51cf02dbdb0e
disapproval of revision 'c484d979c4fda4433a9633ff8b69bd8a395c9479'
Richard Laager <rlaager@wiktel.com>
parents:
21095
diff
changeset
|
552 purple_request_action(NULL, NULL, msg, _("Merging these contacts will cause them to share a single entry on the buddy list and use a single conversation window. " |
20043
4d278e98b5ac
Auto-personization. Closes #44
Sean Egan <seanegan@gmail.com>
parents:
20042
diff
changeset
|
553 "You can separate them again by choosing 'Expand' from the contact's context menu"), 0, NULL, NULL, NULL, |
22479
f54a1f4f2963
I think "Yes" and "No" are better answers to "Would you like to merge these
Stu Tomlinson <stu@nosnilmot.com>
parents:
22473
diff
changeset
|
554 merges, 2, _("_Yes"), PURPLE_CALLBACK(gtk_blist_do_personize), _("_No"), PURPLE_CALLBACK(g_list_free)); |
20082
90b5255f0a30
In the auto-personize code:
Richard Laager <rlaager@wiktel.com>
parents:
20059
diff
changeset
|
555 g_free(msg); |
20099
ac6bf49cd5ba
Various warning fixes and a small leak fix.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20084
diff
changeset
|
556 } else |
ac6bf49cd5ba
Various warning fixes and a small leak fix.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20084
diff
changeset
|
557 g_list_free(merges); |
20043
4d278e98b5ac
Auto-personization. Closes #44
Sean Egan <seanegan@gmail.com>
parents:
20042
diff
changeset
|
558 } |
4d278e98b5ac
Auto-personization. Closes #44
Sean Egan <seanegan@gmail.com>
parents:
20042
diff
changeset
|
559 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
560 static void gtk_blist_renderer_edited_cb(GtkCellRendererText *text_rend, char *arg1, |
17851
452bd3baa9af
Do not update the blist TreeStore if a node is currently being edited. Then, when the node is finished editing, force a refresh. Fixes #397 in which aliasing gets rudely cut off anytime the buddy list changes
Sean Egan <seanegan@gmail.com>
parents:
17835
diff
changeset
|
561 char *arg2, PurpleBuddyList *list) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
562 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
563 GtkTreeIter iter; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
564 GtkTreePath *path; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
565 GValue val; |
15823 | 566 PurpleBlistNode *node; |
567 PurpleGroup *dest; | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
568 |
17851
452bd3baa9af
Do not update the blist TreeStore if a node is currently being edited. Then, when the node is finished editing, force a refresh. Fixes #397 in which aliasing gets rudely cut off anytime the buddy list changes
Sean Egan <seanegan@gmail.com>
parents:
17835
diff
changeset
|
569 editing_blist = FALSE; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
570 path = gtk_tree_path_new_from_string (arg1); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
571 gtk_tree_model_get_iter (GTK_TREE_MODEL(gtkblist->treemodel), &iter, path); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
572 gtk_tree_path_free (path); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
573 val.g_type = 0; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
574 gtk_tree_model_get_value (GTK_TREE_MODEL(gtkblist->treemodel), &iter, NODE_COLUMN, &val); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
575 node = g_value_get_pointer(&val); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
576 gtk_tree_view_set_enable_search (GTK_TREE_VIEW(gtkblist->treeview), TRUE); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
577 g_object_set(G_OBJECT(gtkblist->text_rend), "editable", FALSE, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
578 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
579 switch (node->type) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
580 { |
15823 | 581 case PURPLE_BLIST_CONTACT_NODE: |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
582 { |
15823 | 583 PurpleContact *contact = (PurpleContact *)node; |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
584 struct _pidgin_blist_node *gtknode = (struct _pidgin_blist_node *)node->ui_data; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
585 |
20043
4d278e98b5ac
Auto-personization. Closes #44
Sean Egan <seanegan@gmail.com>
parents:
20042
diff
changeset
|
586 if (contact->alias || gtknode->contact_expanded) { |
15823 | 587 purple_blist_alias_contact(contact, arg2); |
20043
4d278e98b5ac
Auto-personization. Closes #44
Sean Egan <seanegan@gmail.com>
parents:
20042
diff
changeset
|
588 gtk_blist_auto_personize(node->parent, arg2); |
4d278e98b5ac
Auto-personization. Closes #44
Sean Egan <seanegan@gmail.com>
parents:
20042
diff
changeset
|
589 } else { |
15823 | 590 PurpleBuddy *buddy = purple_contact_get_priority_buddy(contact); |
591 purple_blist_alias_buddy(buddy, arg2); | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
592 serv_alias_buddy(buddy); |
20043
4d278e98b5ac
Auto-personization. Closes #44
Sean Egan <seanegan@gmail.com>
parents:
20042
diff
changeset
|
593 gtk_blist_auto_personize(node->parent, arg2); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
594 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
595 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
596 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
597 |
15823 | 598 case PURPLE_BLIST_BUDDY_NODE: |
599 purple_blist_alias_buddy((PurpleBuddy*)node, arg2); | |
600 serv_alias_buddy((PurpleBuddy *)node); | |
20043
4d278e98b5ac
Auto-personization. Closes #44
Sean Egan <seanegan@gmail.com>
parents:
20042
diff
changeset
|
601 gtk_blist_auto_personize(node->parent->parent, arg2); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
602 break; |
15823 | 603 case PURPLE_BLIST_GROUP_NODE: |
604 dest = purple_find_group(arg2); | |
605 if (dest != NULL && strcmp(arg2, ((PurpleGroup*) node)->name)) { | |
16202
0973688f4b74
Word on the street is that we don't want things named pidginfoo_bar(), but
Richard Laager <rlaager@wiktel.com>
parents:
16198
diff
changeset
|
606 pidgin_dialogs_merge_groups((PurpleGroup*) node, arg2); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
607 } else |
15823 | 608 purple_blist_rename_group((PurpleGroup*)node, arg2); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
609 break; |
15823 | 610 case PURPLE_BLIST_CHAT_NODE: |
611 purple_blist_alias_chat((PurpleChat*)node, arg2); | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
612 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
613 default: |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
614 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
615 } |
17851
452bd3baa9af
Do not update the blist TreeStore if a node is currently being edited. Then, when the node is finished editing, force a refresh. Fixes #397 in which aliasing gets rudely cut off anytime the buddy list changes
Sean Egan <seanegan@gmail.com>
parents:
17835
diff
changeset
|
616 pidgin_blist_refresh(list); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
617 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
618 |
22760
cf88a302fa88
'Edit Settings' in the context menu for chats in the buddylist.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22695
diff
changeset
|
619 static void |
cf88a302fa88
'Edit Settings' in the context menu for chats in the buddylist.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22695
diff
changeset
|
620 chat_components_edit_ok(PurpleChat *chat, PurpleRequestFields *allfields) |
cf88a302fa88
'Edit Settings' in the context menu for chats in the buddylist.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22695
diff
changeset
|
621 { |
cf88a302fa88
'Edit Settings' in the context menu for chats in the buddylist.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22695
diff
changeset
|
622 GList *groups, *fields; |
cf88a302fa88
'Edit Settings' in the context menu for chats in the buddylist.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22695
diff
changeset
|
623 |
cf88a302fa88
'Edit Settings' in the context menu for chats in the buddylist.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22695
diff
changeset
|
624 for (groups = purple_request_fields_get_groups(allfields); groups; groups = groups->next) { |
cf88a302fa88
'Edit Settings' in the context menu for chats in the buddylist.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22695
diff
changeset
|
625 fields = purple_request_field_group_get_fields(groups->data); |
cf88a302fa88
'Edit Settings' in the context menu for chats in the buddylist.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22695
diff
changeset
|
626 for (; fields; fields = fields->next) { |
cf88a302fa88
'Edit Settings' in the context menu for chats in the buddylist.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22695
diff
changeset
|
627 PurpleRequestField *field = fields->data; |
cf88a302fa88
'Edit Settings' in the context menu for chats in the buddylist.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22695
diff
changeset
|
628 const char *id; |
cf88a302fa88
'Edit Settings' in the context menu for chats in the buddylist.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22695
diff
changeset
|
629 char *val; |
cf88a302fa88
'Edit Settings' in the context menu for chats in the buddylist.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22695
diff
changeset
|
630 |
cf88a302fa88
'Edit Settings' in the context menu for chats in the buddylist.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22695
diff
changeset
|
631 id = purple_request_field_get_id(field); |
cf88a302fa88
'Edit Settings' in the context menu for chats in the buddylist.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22695
diff
changeset
|
632 if (purple_request_field_get_type(field) == PURPLE_REQUEST_FIELD_INTEGER) |
cf88a302fa88
'Edit Settings' in the context menu for chats in the buddylist.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22695
diff
changeset
|
633 val = g_strdup_printf("%d", purple_request_field_int_get_value(field)); |
cf88a302fa88
'Edit Settings' in the context menu for chats in the buddylist.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22695
diff
changeset
|
634 else |
cf88a302fa88
'Edit Settings' in the context menu for chats in the buddylist.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22695
diff
changeset
|
635 val = g_strdup(purple_request_field_string_get_value(field)); |
cf88a302fa88
'Edit Settings' in the context menu for chats in the buddylist.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22695
diff
changeset
|
636 |
22762
dd8cdf1d8b19
Fine tune the edit-settings dialog (e.g., mark fields as masked or
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22760
diff
changeset
|
637 if (!val) { |
dd8cdf1d8b19
Fine tune the edit-settings dialog (e.g., mark fields as masked or
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22760
diff
changeset
|
638 g_hash_table_remove(purple_chat_get_components(chat), id); |
dd8cdf1d8b19
Fine tune the edit-settings dialog (e.g., mark fields as masked or
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22760
diff
changeset
|
639 } else { |
dd8cdf1d8b19
Fine tune the edit-settings dialog (e.g., mark fields as masked or
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22760
diff
changeset
|
640 g_hash_table_replace(purple_chat_get_components(chat), g_strdup(id), val); /* val should not be free'd */ |
dd8cdf1d8b19
Fine tune the edit-settings dialog (e.g., mark fields as masked or
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22760
diff
changeset
|
641 } |
22760
cf88a302fa88
'Edit Settings' in the context menu for chats in the buddylist.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22695
diff
changeset
|
642 } |
cf88a302fa88
'Edit Settings' in the context menu for chats in the buddylist.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22695
diff
changeset
|
643 } |
cf88a302fa88
'Edit Settings' in the context menu for chats in the buddylist.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22695
diff
changeset
|
644 } |
cf88a302fa88
'Edit Settings' in the context menu for chats in the buddylist.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22695
diff
changeset
|
645 |
cf88a302fa88
'Edit Settings' in the context menu for chats in the buddylist.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22695
diff
changeset
|
646 static void chat_components_edit(GtkWidget *w, PurpleBlistNode *node) |
cf88a302fa88
'Edit Settings' in the context menu for chats in the buddylist.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22695
diff
changeset
|
647 { |
cf88a302fa88
'Edit Settings' in the context menu for chats in the buddylist.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22695
diff
changeset
|
648 PurpleRequestFields *fields = purple_request_fields_new(); |
cf88a302fa88
'Edit Settings' in the context menu for chats in the buddylist.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22695
diff
changeset
|
649 PurpleRequestFieldGroup *group = purple_request_field_group_new(NULL); |
cf88a302fa88
'Edit Settings' in the context menu for chats in the buddylist.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22695
diff
changeset
|
650 PurpleRequestField *field; |
cf88a302fa88
'Edit Settings' in the context menu for chats in the buddylist.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22695
diff
changeset
|
651 GList *parts, *iter; |
cf88a302fa88
'Edit Settings' in the context menu for chats in the buddylist.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22695
diff
changeset
|
652 struct proto_chat_entry *pce; |
cf88a302fa88
'Edit Settings' in the context menu for chats in the buddylist.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22695
diff
changeset
|
653 PurpleConnection *gc; |
cf88a302fa88
'Edit Settings' in the context menu for chats in the buddylist.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22695
diff
changeset
|
654 PurpleChat *chat = (PurpleChat*)node; |
cf88a302fa88
'Edit Settings' in the context menu for chats in the buddylist.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22695
diff
changeset
|
655 |
cf88a302fa88
'Edit Settings' in the context menu for chats in the buddylist.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22695
diff
changeset
|
656 purple_request_fields_add_group(fields, group); |
cf88a302fa88
'Edit Settings' in the context menu for chats in the buddylist.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22695
diff
changeset
|
657 |
cf88a302fa88
'Edit Settings' in the context menu for chats in the buddylist.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22695
diff
changeset
|
658 gc = purple_account_get_connection(purple_chat_get_account(chat)); |
cf88a302fa88
'Edit Settings' in the context menu for chats in the buddylist.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22695
diff
changeset
|
659 parts = PURPLE_PLUGIN_PROTOCOL_INFO(purple_connection_get_prpl(gc))->chat_info(gc); |
cf88a302fa88
'Edit Settings' in the context menu for chats in the buddylist.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22695
diff
changeset
|
660 |
cf88a302fa88
'Edit Settings' in the context menu for chats in the buddylist.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22695
diff
changeset
|
661 for (iter = parts; iter; iter = iter->next) { |
cf88a302fa88
'Edit Settings' in the context menu for chats in the buddylist.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22695
diff
changeset
|
662 pce = iter->data; |
cf88a302fa88
'Edit Settings' in the context menu for chats in the buddylist.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22695
diff
changeset
|
663 if (pce->is_int) { |
cf88a302fa88
'Edit Settings' in the context menu for chats in the buddylist.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22695
diff
changeset
|
664 int val; |
cf88a302fa88
'Edit Settings' in the context menu for chats in the buddylist.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22695
diff
changeset
|
665 const char *str = g_hash_table_lookup(purple_chat_get_components(chat), pce->identifier); |
cf88a302fa88
'Edit Settings' in the context menu for chats in the buddylist.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22695
diff
changeset
|
666 if (!str || sscanf(str, "%d", &val) != 1) |
cf88a302fa88
'Edit Settings' in the context menu for chats in the buddylist.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22695
diff
changeset
|
667 val = pce->min; |
cf88a302fa88
'Edit Settings' in the context menu for chats in the buddylist.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22695
diff
changeset
|
668 field = purple_request_field_int_new(pce->identifier, pce->label, val); |
cf88a302fa88
'Edit Settings' in the context menu for chats in the buddylist.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22695
diff
changeset
|
669 } else { |
cf88a302fa88
'Edit Settings' in the context menu for chats in the buddylist.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22695
diff
changeset
|
670 field = purple_request_field_string_new(pce->identifier, pce->label, |
cf88a302fa88
'Edit Settings' in the context menu for chats in the buddylist.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22695
diff
changeset
|
671 g_hash_table_lookup(purple_chat_get_components(chat), pce->identifier), FALSE); |
22762
dd8cdf1d8b19
Fine tune the edit-settings dialog (e.g., mark fields as masked or
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22760
diff
changeset
|
672 if (pce->secret) |
dd8cdf1d8b19
Fine tune the edit-settings dialog (e.g., mark fields as masked or
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22760
diff
changeset
|
673 purple_request_field_string_set_masked(field, TRUE); |
22760
cf88a302fa88
'Edit Settings' in the context menu for chats in the buddylist.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22695
diff
changeset
|
674 } |
cf88a302fa88
'Edit Settings' in the context menu for chats in the buddylist.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22695
diff
changeset
|
675 |
22762
dd8cdf1d8b19
Fine tune the edit-settings dialog (e.g., mark fields as masked or
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22760
diff
changeset
|
676 if (pce->required) |
dd8cdf1d8b19
Fine tune the edit-settings dialog (e.g., mark fields as masked or
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22760
diff
changeset
|
677 purple_request_field_set_required(field, TRUE); |
dd8cdf1d8b19
Fine tune the edit-settings dialog (e.g., mark fields as masked or
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22760
diff
changeset
|
678 |
22760
cf88a302fa88
'Edit Settings' in the context menu for chats in the buddylist.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22695
diff
changeset
|
679 purple_request_field_group_add_field(group, field); |
cf88a302fa88
'Edit Settings' in the context menu for chats in the buddylist.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22695
diff
changeset
|
680 g_free(pce); |
cf88a302fa88
'Edit Settings' in the context menu for chats in the buddylist.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22695
diff
changeset
|
681 } |
cf88a302fa88
'Edit Settings' in the context menu for chats in the buddylist.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22695
diff
changeset
|
682 |
cf88a302fa88
'Edit Settings' in the context menu for chats in the buddylist.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22695
diff
changeset
|
683 g_list_free(parts); |
cf88a302fa88
'Edit Settings' in the context menu for chats in the buddylist.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22695
diff
changeset
|
684 |
22789
b4a0f4b32ba5
Tweak some strings in the Edit Chat dialog.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22770
diff
changeset
|
685 purple_request_fields(NULL, _("Edit Chat"), NULL, _("Please update the necessary fields."), |
b4a0f4b32ba5
Tweak some strings in the Edit Chat dialog.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22770
diff
changeset
|
686 fields, _("Save"), G_CALLBACK(chat_components_edit_ok), _("Cancel"), NULL, |
22760
cf88a302fa88
'Edit Settings' in the context menu for chats in the buddylist.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22695
diff
changeset
|
687 NULL, NULL, NULL, |
cf88a302fa88
'Edit Settings' in the context menu for chats in the buddylist.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22695
diff
changeset
|
688 chat); |
cf88a302fa88
'Edit Settings' in the context menu for chats in the buddylist.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22695
diff
changeset
|
689 } |
cf88a302fa88
'Edit Settings' in the context menu for chats in the buddylist.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22695
diff
changeset
|
690 |
15823 | 691 static void gtk_blist_menu_alias_cb(GtkWidget *w, PurpleBlistNode *node) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
692 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
693 GtkTreeIter iter; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
694 GtkTreePath *path; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
695 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
696 if (!(get_iter_from_node(node, &iter))) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
697 /* This is either a bug, or the buddy is in a collapsed contact */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
698 node = node->parent; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
699 if (!get_iter_from_node(node, &iter)) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
700 /* Now it's definitely a bug */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
701 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
702 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
703 |
21175
4ce3e1f998f6
Don't allow tooltips to interfere with editing blist entries. Fixes #3830.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21041
diff
changeset
|
704 pidgin_blist_tooltip_destroy(); |
4ce3e1f998f6
Don't allow tooltips to interfere with editing blist entries. Fixes #3830.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21041
diff
changeset
|
705 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
706 path = gtk_tree_model_get_path(GTK_TREE_MODEL(gtkblist->treemodel), &iter); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
707 g_object_set(G_OBJECT(gtkblist->text_rend), "editable", TRUE, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
708 gtk_tree_view_set_enable_search (GTK_TREE_VIEW(gtkblist->treeview), FALSE); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
709 gtk_widget_grab_focus(gtkblist->treeview); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
710 #if GTK_CHECK_VERSION(2,2,0) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
711 gtk_tree_view_set_cursor_on_cell(GTK_TREE_VIEW(gtkblist->treeview), path, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
712 gtkblist->text_column, gtkblist->text_rend, TRUE); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
713 #else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
714 gtk_tree_view_set_cursor(GTK_TREE_VIEW(gtkblist->treeview), path, gtkblist->text_column, TRUE); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
715 #endif |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
716 gtk_tree_path_free(path); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
717 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
718 |
15823 | 719 static void gtk_blist_menu_bp_cb(GtkWidget *w, PurpleBuddy *b) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
720 { |
21340
6c4de0d24eff
Reverted changes from ef7ac46f90a801547f7dfc4295927a956f90e869 to
Richard Laager <rlaager@wiktel.com>
parents:
21227
diff
changeset
|
721 pidgin_pounce_editor_show(b->account, b->name, NULL); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
722 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
723 |
15823 | 724 static void gtk_blist_menu_showlog_cb(GtkWidget *w, PurpleBlistNode *node) |
725 { | |
726 PurpleLogType type; | |
727 PurpleAccount *account; | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
728 char *name = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
729 |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
730 pidgin_set_cursor(gtkblist->window, GDK_WATCH); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
731 |
15823 | 732 if (PURPLE_BLIST_NODE_IS_BUDDY(node)) { |
733 PurpleBuddy *b = (PurpleBuddy*) node; | |
734 type = PURPLE_LOG_IM; | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
735 name = g_strdup(b->name); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
736 account = b->account; |
15823 | 737 } else if (PURPLE_BLIST_NODE_IS_CHAT(node)) { |
738 PurpleChat *c = (PurpleChat*) node; | |
739 PurplePluginProtocolInfo *prpl_info = NULL; | |
740 type = PURPLE_LOG_CHAT; | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
741 account = c->account; |
15823 | 742 prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(purple_find_prpl(purple_account_get_protocol_id(account))); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
743 if (prpl_info && prpl_info->get_chat_name) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
744 name = prpl_info->get_chat_name(c->components); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
745 } |
15823 | 746 } else if (PURPLE_BLIST_NODE_IS_CONTACT(node)) { |
21340
6c4de0d24eff
Reverted changes from ef7ac46f90a801547f7dfc4295927a956f90e869 to
Richard Laager <rlaager@wiktel.com>
parents:
21227
diff
changeset
|
747 pidgin_log_show_contact((PurpleContact *)node); |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
748 pidgin_clear_cursor(gtkblist->window); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
749 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
750 } else { |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
751 pidgin_clear_cursor(gtkblist->window); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
752 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
753 /* This callback should not have been registered for a node |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
754 * that doesn't match the type of one of the blocks above. */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
755 g_return_if_reached(); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
756 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
757 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
758 if (name && account) { |
21340
6c4de0d24eff
Reverted changes from ef7ac46f90a801547f7dfc4295927a956f90e869 to
Richard Laager <rlaager@wiktel.com>
parents:
21227
diff
changeset
|
759 pidgin_log_show(type, name, account); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
760 g_free(name); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
761 |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
762 pidgin_clear_cursor(gtkblist->window); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
763 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
764 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
765 |
20163
1971e13bb5f6
Merge the plugin pack's showoffline plugin's functionality to pidgin proper
Stu Tomlinson <stu@nosnilmot.com>
parents:
20161
diff
changeset
|
766 static void gtk_blist_menu_showoffline_cb(GtkWidget *w, PurpleBlistNode *node) |
1971e13bb5f6
Merge the plugin pack's showoffline plugin's functionality to pidgin proper
Stu Tomlinson <stu@nosnilmot.com>
parents:
20161
diff
changeset
|
767 { |
20164
7d9391b94b1c
Fix the whitespace/tab/space junk I just created
Stu Tomlinson <stu@nosnilmot.com>
parents:
20163
diff
changeset
|
768 if (PURPLE_BLIST_NODE_IS_BUDDY(node)) |
7d9391b94b1c
Fix the whitespace/tab/space junk I just created
Stu Tomlinson <stu@nosnilmot.com>
parents:
20163
diff
changeset
|
769 { |
7d9391b94b1c
Fix the whitespace/tab/space junk I just created
Stu Tomlinson <stu@nosnilmot.com>
parents:
20163
diff
changeset
|
770 purple_blist_node_set_bool(node, "show_offline", |
7d9391b94b1c
Fix the whitespace/tab/space junk I just created
Stu Tomlinson <stu@nosnilmot.com>
parents:
20163
diff
changeset
|
771 !purple_blist_node_get_bool(node, "show_offline")); |
22695
387071b0d4d4
Fix setting "show offline" for buddy list nodes so it takes immediate
Stu Tomlinson <stu@nosnilmot.com>
parents:
22662
diff
changeset
|
772 pidgin_blist_update(purple_get_blist(), node); |
20164
7d9391b94b1c
Fix the whitespace/tab/space junk I just created
Stu Tomlinson <stu@nosnilmot.com>
parents:
20163
diff
changeset
|
773 } |
7d9391b94b1c
Fix the whitespace/tab/space junk I just created
Stu Tomlinson <stu@nosnilmot.com>
parents:
20163
diff
changeset
|
774 else if (PURPLE_BLIST_NODE_IS_CONTACT(node)) |
7d9391b94b1c
Fix the whitespace/tab/space junk I just created
Stu Tomlinson <stu@nosnilmot.com>
parents:
20163
diff
changeset
|
775 { |
7d9391b94b1c
Fix the whitespace/tab/space junk I just created
Stu Tomlinson <stu@nosnilmot.com>
parents:
20163
diff
changeset
|
776 PurpleBlistNode *bnode; |
7d9391b94b1c
Fix the whitespace/tab/space junk I just created
Stu Tomlinson <stu@nosnilmot.com>
parents:
20163
diff
changeset
|
777 gboolean setting = !purple_blist_node_get_bool(node, "show_offline"); |
7d9391b94b1c
Fix the whitespace/tab/space junk I just created
Stu Tomlinson <stu@nosnilmot.com>
parents:
20163
diff
changeset
|
778 |
7d9391b94b1c
Fix the whitespace/tab/space junk I just created
Stu Tomlinson <stu@nosnilmot.com>
parents:
20163
diff
changeset
|
779 purple_blist_node_set_bool(node, "show_offline", setting); |
7d9391b94b1c
Fix the whitespace/tab/space junk I just created
Stu Tomlinson <stu@nosnilmot.com>
parents:
20163
diff
changeset
|
780 for (bnode = node->child; bnode != NULL; bnode = bnode->next) { |
7d9391b94b1c
Fix the whitespace/tab/space junk I just created
Stu Tomlinson <stu@nosnilmot.com>
parents:
20163
diff
changeset
|
781 purple_blist_node_set_bool(bnode, "show_offline", setting); |
22695
387071b0d4d4
Fix setting "show offline" for buddy list nodes so it takes immediate
Stu Tomlinson <stu@nosnilmot.com>
parents:
22662
diff
changeset
|
782 pidgin_blist_update(purple_get_blist(), bnode); |
20164
7d9391b94b1c
Fix the whitespace/tab/space junk I just created
Stu Tomlinson <stu@nosnilmot.com>
parents:
20163
diff
changeset
|
783 } |
22436
df336908dd15
Make "Show when offline" work on group nodes too, which sets the flag for
Stu Tomlinson <stu@nosnilmot.com>
parents:
22313
diff
changeset
|
784 } else if (PURPLE_BLIST_NODE_IS_GROUP(node)) { |
df336908dd15
Make "Show when offline" work on group nodes too, which sets the flag for
Stu Tomlinson <stu@nosnilmot.com>
parents:
22313
diff
changeset
|
785 PurpleBlistNode *cnode, *bnode; |
df336908dd15
Make "Show when offline" work on group nodes too, which sets the flag for
Stu Tomlinson <stu@nosnilmot.com>
parents:
22313
diff
changeset
|
786 gboolean setting = !purple_blist_node_get_bool(node, "show_offline"); |
df336908dd15
Make "Show when offline" work on group nodes too, which sets the flag for
Stu Tomlinson <stu@nosnilmot.com>
parents:
22313
diff
changeset
|
787 |
df336908dd15
Make "Show when offline" work on group nodes too, which sets the flag for
Stu Tomlinson <stu@nosnilmot.com>
parents:
22313
diff
changeset
|
788 purple_blist_node_set_bool(node, "show_offline", setting); |
df336908dd15
Make "Show when offline" work on group nodes too, which sets the flag for
Stu Tomlinson <stu@nosnilmot.com>
parents:
22313
diff
changeset
|
789 for (cnode = node->child; cnode != NULL; cnode = cnode->next) { |
df336908dd15
Make "Show when offline" work on group nodes too, which sets the flag for
Stu Tomlinson <stu@nosnilmot.com>
parents:
22313
diff
changeset
|
790 purple_blist_node_set_bool(cnode, "show_offline", setting); |
df336908dd15
Make "Show when offline" work on group nodes too, which sets the flag for
Stu Tomlinson <stu@nosnilmot.com>
parents:
22313
diff
changeset
|
791 for (bnode = cnode->child; bnode != NULL; bnode = bnode->next) { |
df336908dd15
Make "Show when offline" work on group nodes too, which sets the flag for
Stu Tomlinson <stu@nosnilmot.com>
parents:
22313
diff
changeset
|
792 purple_blist_node_set_bool(bnode, "show_offline", setting); |
22695
387071b0d4d4
Fix setting "show offline" for buddy list nodes so it takes immediate
Stu Tomlinson <stu@nosnilmot.com>
parents:
22662
diff
changeset
|
793 pidgin_blist_update(purple_get_blist(), bnode); |
22436
df336908dd15
Make "Show when offline" work on group nodes too, which sets the flag for
Stu Tomlinson <stu@nosnilmot.com>
parents:
22313
diff
changeset
|
794 } |
df336908dd15
Make "Show when offline" work on group nodes too, which sets the flag for
Stu Tomlinson <stu@nosnilmot.com>
parents:
22313
diff
changeset
|
795 } |
20164
7d9391b94b1c
Fix the whitespace/tab/space junk I just created
Stu Tomlinson <stu@nosnilmot.com>
parents:
20163
diff
changeset
|
796 } |
20163
1971e13bb5f6
Merge the plugin pack's showoffline plugin's functionality to pidgin proper
Stu Tomlinson <stu@nosnilmot.com>
parents:
20161
diff
changeset
|
797 } |
1971e13bb5f6
Merge the plugin pack's showoffline plugin's functionality to pidgin proper
Stu Tomlinson <stu@nosnilmot.com>
parents:
20161
diff
changeset
|
798 |
22007
c38d72677c8a
Probe for -Wstrict-prototypes to get some more warnings. I then cleaned up
Richard Laager <rlaager@wiktel.com>
parents:
21960
diff
changeset
|
799 static void gtk_blist_show_systemlog_cb(void) |
21340
6c4de0d24eff
Reverted changes from ef7ac46f90a801547f7dfc4295927a956f90e869 to
Richard Laager <rlaager@wiktel.com>
parents:
21227
diff
changeset
|
800 { |
6c4de0d24eff
Reverted changes from ef7ac46f90a801547f7dfc4295927a956f90e869 to
Richard Laager <rlaager@wiktel.com>
parents:
21227
diff
changeset
|
801 pidgin_syslog_show(); |
6c4de0d24eff
Reverted changes from ef7ac46f90a801547f7dfc4295927a956f90e869 to
Richard Laager <rlaager@wiktel.com>
parents:
21227
diff
changeset
|
802 } |
6c4de0d24eff
Reverted changes from ef7ac46f90a801547f7dfc4295927a956f90e869 to
Richard Laager <rlaager@wiktel.com>
parents:
21227
diff
changeset
|
803 |
22007
c38d72677c8a
Probe for -Wstrict-prototypes to get some more warnings. I then cleaned up
Richard Laager <rlaager@wiktel.com>
parents:
21960
diff
changeset
|
804 static void gtk_blist_show_onlinehelp_cb(void) |
17432
0bbc08d41234
disapproval of revision '1fd9445b933f2f5ff2724778f9d18e47282745cd'
Stu Tomlinson <stu@nosnilmot.com>
parents:
17431
diff
changeset
|
805 { |
17880
9e0aec946cd0
use pidgin.im/documentation as the help url (which redirects already)
Stu Tomlinson <stu@nosnilmot.com>
parents:
17879
diff
changeset
|
806 purple_notify_uri(NULL, PURPLE_WEBSITE "documentation"); |
17432
0bbc08d41234
disapproval of revision '1fd9445b933f2f5ff2724778f9d18e47282745cd'
Stu Tomlinson <stu@nosnilmot.com>
parents:
17431
diff
changeset
|
807 } |
0bbc08d41234
disapproval of revision '1fd9445b933f2f5ff2724778f9d18e47282745cd'
Stu Tomlinson <stu@nosnilmot.com>
parents:
17431
diff
changeset
|
808 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
809 static void |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
810 do_join_chat(PidginJoinChatData *data) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
811 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
812 if (data) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
813 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
814 GHashTable *components = |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
815 g_hash_table_new_full(g_str_hash, g_str_equal, g_free, g_free); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
816 GList *tmp; |
15823 | 817 PurpleChat *chat; |
15374
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 for (tmp = data->entries; tmp != NULL; tmp = tmp->next) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
820 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
821 if (g_object_get_data(tmp->data, "is_spin")) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
822 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
823 g_hash_table_replace(components, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
824 g_strdup(g_object_get_data(tmp->data, "identifier")), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
825 g_strdup_printf("%d", |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
826 gtk_spin_button_get_value_as_int(tmp->data))); |
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 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
829 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
830 g_hash_table_replace(components, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
831 g_strdup(g_object_get_data(tmp->data, "identifier")), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
832 g_strdup(gtk_entry_get_text(tmp->data))); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
833 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
834 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
835 |
15823 | 836 chat = purple_chat_new(data->account, NULL, components); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
837 gtk_blist_join_chat(chat); |
15823 | 838 purple_blist_remove_chat(chat); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
839 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
840 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
841 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
842 static void |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
843 do_joinchat(GtkWidget *dialog, int id, PidginJoinChatData *info) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
844 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
845 switch(id) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
846 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
847 case GTK_RESPONSE_OK: |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
848 do_join_chat(info); |
21675
ebe79cae6d83
Add 'Room List' buttons to Join Chat and Add Chat dialogs to ease access
Stu Tomlinson <stu@nosnilmot.com>
parents:
21662
diff
changeset
|
849 break; |
ebe79cae6d83
Add 'Room List' buttons to Join Chat and Add Chat dialogs to ease access
Stu Tomlinson <stu@nosnilmot.com>
parents:
21662
diff
changeset
|
850 |
ebe79cae6d83
Add 'Room List' buttons to Join Chat and Add Chat dialogs to ease access
Stu Tomlinson <stu@nosnilmot.com>
parents:
21662
diff
changeset
|
851 case 1: |
ebe79cae6d83
Add 'Room List' buttons to Join Chat and Add Chat dialogs to ease access
Stu Tomlinson <stu@nosnilmot.com>
parents:
21662
diff
changeset
|
852 pidgin_roomlist_dialog_show_with_account(info->account); |
ebe79cae6d83
Add 'Room List' buttons to Join Chat and Add Chat dialogs to ease access
Stu Tomlinson <stu@nosnilmot.com>
parents:
21662
diff
changeset
|
853 return; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
854 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
855 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
856 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
857 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
858 gtk_widget_destroy(GTK_WIDGET(dialog)); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
859 g_list_free(info->entries); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
860 g_free(info); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
861 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
862 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
863 /* |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
864 * Check the values of all the text entry boxes. If any required input |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
865 * strings are empty then don't allow the user to click on "OK." |
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 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
868 joinchat_set_sensitive_if_input_cb(GtkWidget *entry, gpointer user_data) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
869 { |
21675
ebe79cae6d83
Add 'Room List' buttons to Join Chat and Add Chat dialogs to ease access
Stu Tomlinson <stu@nosnilmot.com>
parents:
21662
diff
changeset
|
870 PurplePluginProtocolInfo *prpl_info; |
ebe79cae6d83
Add 'Room List' buttons to Join Chat and Add Chat dialogs to ease access
Stu Tomlinson <stu@nosnilmot.com>
parents:
21662
diff
changeset
|
871 PurpleConnection *gc; |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
872 PidginJoinChatData *data; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
873 GList *tmp; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
874 const char *text; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
875 gboolean required; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
876 gboolean sensitive = TRUE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
877 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
878 data = user_data; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
879 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
880 for (tmp = data->entries; tmp != NULL; tmp = tmp->next) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
881 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
882 if (!g_object_get_data(tmp->data, "is_spin")) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
883 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
884 required = GPOINTER_TO_INT(g_object_get_data(tmp->data, "required")); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
885 text = gtk_entry_get_text(tmp->data); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
886 if (required && (*text == '\0')) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
887 sensitive = FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
888 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
889 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
890 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
891 gtk_dialog_set_response_sensitive(GTK_DIALOG(data->window), GTK_RESPONSE_OK, sensitive); |
21675
ebe79cae6d83
Add 'Room List' buttons to Join Chat and Add Chat dialogs to ease access
Stu Tomlinson <stu@nosnilmot.com>
parents:
21662
diff
changeset
|
892 |
ebe79cae6d83
Add 'Room List' buttons to Join Chat and Add Chat dialogs to ease access
Stu Tomlinson <stu@nosnilmot.com>
parents:
21662
diff
changeset
|
893 gc = purple_account_get_connection(data->account); |
ebe79cae6d83
Add 'Room List' buttons to Join Chat and Add Chat dialogs to ease access
Stu Tomlinson <stu@nosnilmot.com>
parents:
21662
diff
changeset
|
894 prpl_info = (gc != NULL) ? PURPLE_PLUGIN_PROTOCOL_INFO(gc->prpl) : NULL; |
ebe79cae6d83
Add 'Room List' buttons to Join Chat and Add Chat dialogs to ease access
Stu Tomlinson <stu@nosnilmot.com>
parents:
21662
diff
changeset
|
895 sensitive = (prpl_info != NULL && prpl_info->roomlist_get_list != NULL); |
ebe79cae6d83
Add 'Room List' buttons to Join Chat and Add Chat dialogs to ease access
Stu Tomlinson <stu@nosnilmot.com>
parents:
21662
diff
changeset
|
896 |
ebe79cae6d83
Add 'Room List' buttons to Join Chat and Add Chat dialogs to ease access
Stu Tomlinson <stu@nosnilmot.com>
parents:
21662
diff
changeset
|
897 gtk_dialog_set_response_sensitive(GTK_DIALOG(data->window), 1, sensitive); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
898 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
899 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
900 static void |
15823 | 901 pidgin_blist_update_privacy_cb(PurpleBuddy *buddy) |
902 { | |
19538
6575ec8e1a97
Do not try to update a buddy in the buddylist when there's no buddylist.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19509
diff
changeset
|
903 if (buddy->node.ui_data == NULL || ((struct _pidgin_blist_node*)buddy->node.ui_data)->row == NULL) |
6575ec8e1a97
Do not try to update a buddy in the buddylist when there's no buddylist.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19509
diff
changeset
|
904 return; |
15823 | 905 pidgin_blist_update_buddy(purple_get_blist(), (PurpleBlistNode*)(buddy), TRUE); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
906 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
907 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
908 static void |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
909 rebuild_joinchat_entries(PidginJoinChatData *data) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
910 { |
15823 | 911 PurpleConnection *gc; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
912 GList *list = NULL, *tmp; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
913 GHashTable *defaults = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
914 struct proto_chat_entry *pce; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
915 gboolean focus = TRUE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
916 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
917 g_return_if_fail(data->account != NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
918 |
15823 | 919 gc = purple_account_get_connection(data->account); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
920 |
18646
05cab350d1fb
Fix memory leak by freeing the list returned by gtk_container_get_children.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
18435
diff
changeset
|
921 gtk_container_foreach(GTK_CONTAINER(data->entries_box), (GtkCallback)gtk_widget_destroy, NULL); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
922 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
923 g_list_free(data->entries); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
924 data->entries = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
925 |
15823 | 926 if (PURPLE_PLUGIN_PROTOCOL_INFO(gc->prpl)->chat_info != NULL) |
927 list = PURPLE_PLUGIN_PROTOCOL_INFO(gc->prpl)->chat_info(gc); | |
928 | |
929 if (PURPLE_PLUGIN_PROTOCOL_INFO(gc->prpl)->chat_info_defaults != NULL) | |
930 defaults = PURPLE_PLUGIN_PROTOCOL_INFO(gc->prpl)->chat_info_defaults(gc, NULL); | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
931 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
932 for (tmp = list; tmp; tmp = tmp->next) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
933 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
934 GtkWidget *input; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
935 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
936 pce = tmp->data; |
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 if (pce->is_int) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
939 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
940 GtkObject *adjust; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
941 adjust = gtk_adjustment_new(pce->min, pce->min, pce->max, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
942 1, 10, 10); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
943 input = gtk_spin_button_new(GTK_ADJUSTMENT(adjust), 1, 0); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
944 gtk_widget_set_size_request(input, 50, -1); |
21992
1690d040addd
Remove a lot of duplication from a lot of places. Closes #4558.
Gabriel Schulhof <nix@go-nix.ca>
parents:
21990
diff
changeset
|
945 pidgin_add_widget_to_vbox(GTK_BOX(data->entries_box), pce->label, data->sg, input, FALSE, NULL); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
946 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
947 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
948 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
949 char *value; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
950 input = gtk_entry_new(); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
951 gtk_entry_set_activates_default(GTK_ENTRY(input), TRUE); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
952 value = g_hash_table_lookup(defaults, pce->identifier); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
953 if (value != NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
954 gtk_entry_set_text(GTK_ENTRY(input), value); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
955 if (pce->secret) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
956 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
957 gtk_entry_set_visibility(GTK_ENTRY(input), FALSE); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
958 if (gtk_entry_get_invisible_char(GTK_ENTRY(input)) == '*') |
15821 | 959 gtk_entry_set_invisible_char(GTK_ENTRY(input), PIDGIN_INVISIBLE_CHAR); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
960 } |
21992
1690d040addd
Remove a lot of duplication from a lot of places. Closes #4558.
Gabriel Schulhof <nix@go-nix.ca>
parents:
21990
diff
changeset
|
961 pidgin_add_widget_to_vbox(GTK_BOX(data->entries_box), pce->label, data->sg, input, TRUE, NULL); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
962 g_signal_connect(G_OBJECT(input), "changed", |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
963 G_CALLBACK(joinchat_set_sensitive_if_input_cb), data); |
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 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
966 /* Do the following for any type of input widget */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
967 if (focus) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
968 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
969 gtk_widget_grab_focus(input); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
970 focus = FALSE; |
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 g_object_set_data(G_OBJECT(input), "identifier", (gpointer)pce->identifier); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
973 g_object_set_data(G_OBJECT(input), "is_spin", GINT_TO_POINTER(pce->is_int)); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
974 g_object_set_data(G_OBJECT(input), "required", GINT_TO_POINTER(pce->required)); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
975 data->entries = g_list_append(data->entries, input); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
976 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
977 g_free(pce); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
978 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
979 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
980 g_list_free(list); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
981 g_hash_table_destroy(defaults); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
982 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
983 /* Set whether the "OK" button should be clickable initially */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
984 joinchat_set_sensitive_if_input_cb(NULL, data); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
985 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
986 gtk_widget_show_all(data->entries_box); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
987 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
988 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
989 static void |
15823 | 990 joinchat_select_account_cb(GObject *w, PurpleAccount *account, |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
991 PidginJoinChatData *data) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
992 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
993 data->account = account; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
994 rebuild_joinchat_entries(data); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
995 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
996 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
997 static gboolean |
15823 | 998 chat_account_filter_func(PurpleAccount *account) |
999 { | |
1000 PurpleConnection *gc = purple_account_get_connection(account); | |
1001 PurplePluginProtocolInfo *prpl_info = NULL; | |
1002 | |
1003 prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(gc->prpl); | |
15374
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 return (prpl_info->chat_info != NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1006 } |
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 gboolean |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
1009 pidgin_blist_joinchat_is_showable() |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1010 { |
18063
926ccb104da0
disapproval of revision '1411afd7660760db59966c3a9f18e2adab8eb27e'
Richard Laager <rlaager@wiktel.com>
parents:
18058
diff
changeset
|
1011 GList *c; |
15823 | 1012 PurpleConnection *gc; |
1013 | |
1014 for (c = purple_connections_get_all(); c != NULL; c = c->next) { | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1015 gc = c->data; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1016 |
15823 | 1017 if (chat_account_filter_func(purple_connection_get_account(gc))) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1018 return TRUE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1019 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1020 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1021 return FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1022 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1023 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1024 void |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
1025 pidgin_blist_joinchat_show(void) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1026 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1027 GtkWidget *hbox, *vbox; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1028 GtkWidget *label; |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
1029 PidginBuddyList *gtkblist; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1030 GtkWidget *img = NULL; |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
1031 PidginJoinChatData *data = NULL; |
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
1032 |
15823 | 1033 gtkblist = PIDGIN_BLIST(purple_get_blist()); |
15436 | 1034 img = gtk_image_new_from_stock(PIDGIN_STOCK_DIALOG_QUESTION, |
1035 gtk_icon_size_from_name(PIDGIN_ICON_SIZE_TANGO_HUGE)); | |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
1036 data = g_new0(PidginJoinChatData, 1); |
15374
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 data->window = gtk_dialog_new_with_buttons(_("Join a Chat"), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1039 NULL, GTK_DIALOG_NO_SEPARATOR, |
21675
ebe79cae6d83
Add 'Room List' buttons to Join Chat and Add Chat dialogs to ease access
Stu Tomlinson <stu@nosnilmot.com>
parents:
21662
diff
changeset
|
1040 _("Room _List"), 1, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1041 GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, |
15509 | 1042 PIDGIN_STOCK_CHAT, GTK_RESPONSE_OK, NULL); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1043 gtk_dialog_set_default_response(GTK_DIALOG(data->window), GTK_RESPONSE_OK); |
15821 | 1044 gtk_container_set_border_width(GTK_CONTAINER(data->window), PIDGIN_HIG_BOX_SPACE); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1045 gtk_window_set_resizable(GTK_WINDOW(data->window), FALSE); |
15821 | 1046 gtk_box_set_spacing(GTK_BOX(GTK_DIALOG(data->window)->vbox), PIDGIN_HIG_BORDER); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1047 gtk_container_set_border_width( |
15821 | 1048 GTK_CONTAINER(GTK_DIALOG(data->window)->vbox), PIDGIN_HIG_BOX_SPACE); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1049 gtk_window_set_role(GTK_WINDOW(data->window), "join_chat"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1050 |
15821 | 1051 hbox = gtk_hbox_new(FALSE, PIDGIN_HIG_BORDER); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1052 gtk_container_add(GTK_CONTAINER(GTK_DIALOG(data->window)->vbox), hbox); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1053 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
|
1054 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
|
1055 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1056 vbox = gtk_vbox_new(FALSE, 5); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1057 gtk_container_set_border_width(GTK_CONTAINER(vbox), 0); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1058 gtk_container_add(GTK_CONTAINER(hbox), vbox); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1059 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1060 label = gtk_label_new(_("Please enter the appropriate information " |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1061 "about the chat you would like to join.\n")); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1062 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
|
1063 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
|
1064 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
|
1065 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1066 data->sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1067 |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
1068 data->account_menu = pidgin_account_option_menu_new(NULL, FALSE, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1069 G_CALLBACK(joinchat_select_account_cb), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1070 chat_account_filter_func, data); |
21992
1690d040addd
Remove a lot of duplication from a lot of places. Closes #4558.
Gabriel Schulhof <nix@go-nix.ca>
parents:
21990
diff
changeset
|
1071 |
1690d040addd
Remove a lot of duplication from a lot of places. Closes #4558.
Gabriel Schulhof <nix@go-nix.ca>
parents:
21990
diff
changeset
|
1072 pidgin_add_widget_to_vbox(GTK_BOX(vbox), _("_Account:"), data->sg, data->account_menu, TRUE, NULL); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1073 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1074 data->entries_box = gtk_vbox_new(FALSE, 5); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1075 gtk_container_add(GTK_CONTAINER(vbox), data->entries_box); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1076 gtk_container_set_border_width(GTK_CONTAINER(data->entries_box), 0); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1077 |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
1078 data->account = pidgin_account_option_menu_get_selected(data->account_menu); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1079 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1080 rebuild_joinchat_entries(data); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1081 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1082 g_signal_connect(G_OBJECT(data->window), "response", |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1083 G_CALLBACK(do_joinchat), data); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1084 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1085 g_object_unref(data->sg); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1086 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1087 gtk_widget_show_all(data->window); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1088 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1089 |
17139
17117b8cfbb7
Patch from SuperMMX to correctly update the expand state of contacts
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
17046
diff
changeset
|
1090 static void gtk_blist_row_expanded_cb(GtkTreeView *tv, GtkTreeIter *iter, GtkTreePath *path, gpointer user_data) |
17117b8cfbb7
Patch from SuperMMX to correctly update the expand state of contacts
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
17046
diff
changeset
|
1091 { |
15823 | 1092 PurpleBlistNode *node; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1093 GValue val; |
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 val.g_type = 0; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1096 gtk_tree_model_get_value(GTK_TREE_MODEL(gtkblist->treemodel), iter, NODE_COLUMN, &val); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1097 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1098 node = g_value_get_pointer(&val); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1099 |
15823 | 1100 if (PURPLE_BLIST_NODE_IS_GROUP(node)) { |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1101 char *title; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1102 |
15821 | 1103 title = pidgin_get_group_title(node, TRUE); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1104 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1105 gtk_tree_store_set(gtkblist->treemodel, iter, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1106 NAME_COLUMN, title, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1107 -1); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1108 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1109 g_free(title); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1110 |
15823 | 1111 purple_blist_node_set_bool(node, "collapsed", FALSE); |
22646
654f8386f4b3
Destroy the tooltip when a group in the buddylist is expanded or collapsed
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22594
diff
changeset
|
1112 pidgin_blist_tooltip_destroy(); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1113 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1114 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1115 |
17139
17117b8cfbb7
Patch from SuperMMX to correctly update the expand state of contacts
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
17046
diff
changeset
|
1116 static void gtk_blist_row_collapsed_cb(GtkTreeView *tv, GtkTreeIter *iter, GtkTreePath *path, gpointer user_data) |
17117b8cfbb7
Patch from SuperMMX to correctly update the expand state of contacts
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
17046
diff
changeset
|
1117 { |
15823 | 1118 PurpleBlistNode *node; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1119 GValue val; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1120 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1121 val.g_type = 0; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1122 gtk_tree_model_get_value(GTK_TREE_MODEL(gtkblist->treemodel), iter, NODE_COLUMN, &val); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1123 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1124 node = g_value_get_pointer(&val); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1125 |
15823 | 1126 if (PURPLE_BLIST_NODE_IS_GROUP(node)) { |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1127 char *title; |
17139
17117b8cfbb7
Patch from SuperMMX to correctly update the expand state of contacts
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
17046
diff
changeset
|
1128 struct _pidgin_blist_node *gtknode; |
17117b8cfbb7
Patch from SuperMMX to correctly update the expand state of contacts
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
17046
diff
changeset
|
1129 PurpleBlistNode *cnode; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1130 |
15821 | 1131 title = pidgin_get_group_title(node, FALSE); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1132 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1133 gtk_tree_store_set(gtkblist->treemodel, iter, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1134 NAME_COLUMN, title, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1135 -1); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1136 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1137 g_free(title); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1138 |
15823 | 1139 purple_blist_node_set_bool(node, "collapsed", TRUE); |
17139
17117b8cfbb7
Patch from SuperMMX to correctly update the expand state of contacts
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
17046
diff
changeset
|
1140 |
17117b8cfbb7
Patch from SuperMMX to correctly update the expand state of contacts
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
17046
diff
changeset
|
1141 for(cnode = node->child; cnode; cnode = cnode->next) { |
17117b8cfbb7
Patch from SuperMMX to correctly update the expand state of contacts
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
17046
diff
changeset
|
1142 if (PURPLE_BLIST_NODE_IS_CONTACT(cnode)) { |
17117b8cfbb7
Patch from SuperMMX to correctly update the expand state of contacts
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
17046
diff
changeset
|
1143 gtknode = cnode->ui_data; |
17117b8cfbb7
Patch from SuperMMX to correctly update the expand state of contacts
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
17046
diff
changeset
|
1144 if (!gtknode->contact_expanded) |
17117b8cfbb7
Patch from SuperMMX to correctly update the expand state of contacts
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
17046
diff
changeset
|
1145 continue; |
17117b8cfbb7
Patch from SuperMMX to correctly update the expand state of contacts
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
17046
diff
changeset
|
1146 gtknode->contact_expanded = FALSE; |
17117b8cfbb7
Patch from SuperMMX to correctly update the expand state of contacts
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
17046
diff
changeset
|
1147 pidgin_blist_update_contact(NULL, cnode); |
17117b8cfbb7
Patch from SuperMMX to correctly update the expand state of contacts
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
17046
diff
changeset
|
1148 } |
17117b8cfbb7
Patch from SuperMMX to correctly update the expand state of contacts
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
17046
diff
changeset
|
1149 } |
22646
654f8386f4b3
Destroy the tooltip when a group in the buddylist is expanded or collapsed
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22594
diff
changeset
|
1150 pidgin_blist_tooltip_destroy(); |
15823 | 1151 } else if(PURPLE_BLIST_NODE_IS_CONTACT(node)) { |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
1152 pidgin_blist_collapse_contact_cb(NULL, node); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1153 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1154 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1155 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1156 static void gtk_blist_row_activated_cb(GtkTreeView *tv, GtkTreePath *path, GtkTreeViewColumn *col, gpointer data) { |
15823 | 1157 PurpleBlistNode *node; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1158 GtkTreeIter iter; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1159 GValue val; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1160 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1161 gtk_tree_model_get_iter(GTK_TREE_MODEL(gtkblist->treemodel), &iter, path); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1162 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1163 val.g_type = 0; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1164 gtk_tree_model_get_value (GTK_TREE_MODEL(gtkblist->treemodel), &iter, NODE_COLUMN, &val); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1165 node = g_value_get_pointer(&val); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1166 |
15823 | 1167 if(PURPLE_BLIST_NODE_IS_CONTACT(node) || PURPLE_BLIST_NODE_IS_BUDDY(node)) { |
1168 PurpleBuddy *buddy; | |
1169 | |
1170 if(PURPLE_BLIST_NODE_IS_CONTACT(node)) | |
1171 buddy = purple_contact_get_priority_buddy((PurpleContact*)node); | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1172 else |
15823 | 1173 buddy = (PurpleBuddy*)node; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1174 |
16202
0973688f4b74
Word on the street is that we don't want things named pidginfoo_bar(), but
Richard Laager <rlaager@wiktel.com>
parents:
16198
diff
changeset
|
1175 pidgin_dialogs_im_with_user(buddy->account, buddy->name); |
15823 | 1176 } else if (PURPLE_BLIST_NODE_IS_CHAT(node)) { |
1177 gtk_blist_join_chat((PurpleChat *)node); | |
1178 } else if (PURPLE_BLIST_NODE_IS_GROUP(node)) { | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1179 /* if (gtk_tree_view_row_expanded(tv, path)) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1180 gtk_tree_view_collapse_row(tv, path); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1181 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1182 gtk_tree_view_expand_row(tv,path,FALSE);*/ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1183 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1184 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1185 |
22007
c38d72677c8a
Probe for -Wstrict-prototypes to get some more warnings. I then cleaned up
Richard Laager <rlaager@wiktel.com>
parents:
21960
diff
changeset
|
1186 static void pidgin_blist_add_chat_cb(void) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1187 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1188 GtkTreeSelection *sel = gtk_tree_view_get_selection(GTK_TREE_VIEW(gtkblist->treeview)); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1189 GtkTreeIter iter; |
15823 | 1190 PurpleBlistNode *node; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1191 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1192 if(gtk_tree_selection_get_selected(sel, NULL, &iter)){ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1193 gtk_tree_model_get(GTK_TREE_MODEL(gtkblist->treemodel), &iter, NODE_COLUMN, &node, -1); |
15823 | 1194 if (PURPLE_BLIST_NODE_IS_BUDDY(node)) |
1195 purple_blist_request_add_chat(NULL, (PurpleGroup*)node->parent->parent, NULL, NULL); | |
1196 if (PURPLE_BLIST_NODE_IS_CONTACT(node) || PURPLE_BLIST_NODE_IS_CHAT(node)) | |
1197 purple_blist_request_add_chat(NULL, (PurpleGroup*)node->parent, NULL, NULL); | |
1198 else if (PURPLE_BLIST_NODE_IS_GROUP(node)) | |
1199 purple_blist_request_add_chat(NULL, (PurpleGroup*)node, NULL, NULL); | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1200 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1201 else { |
15823 | 1202 purple_blist_request_add_chat(NULL, NULL, NULL, NULL); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1203 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1204 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1205 |
22007
c38d72677c8a
Probe for -Wstrict-prototypes to get some more warnings. I then cleaned up
Richard Laager <rlaager@wiktel.com>
parents:
21960
diff
changeset
|
1206 static void pidgin_blist_add_buddy_cb(void) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1207 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1208 GtkTreeSelection *sel = gtk_tree_view_get_selection(GTK_TREE_VIEW(gtkblist->treeview)); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1209 GtkTreeIter iter; |
15823 | 1210 PurpleBlistNode *node; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1211 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1212 if(gtk_tree_selection_get_selected(sel, NULL, &iter)){ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1213 gtk_tree_model_get(GTK_TREE_MODEL(gtkblist->treemodel), &iter, NODE_COLUMN, &node, -1); |
15823 | 1214 if (PURPLE_BLIST_NODE_IS_BUDDY(node)) { |
1215 purple_blist_request_add_buddy(NULL, NULL, ((PurpleGroup*)node->parent->parent)->name, | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1216 NULL); |
15823 | 1217 } else if (PURPLE_BLIST_NODE_IS_CONTACT(node) |
1218 || PURPLE_BLIST_NODE_IS_CHAT(node)) { | |
1219 purple_blist_request_add_buddy(NULL, NULL, ((PurpleGroup*)node->parent)->name, NULL); | |
1220 } else if (PURPLE_BLIST_NODE_IS_GROUP(node)) { | |
1221 purple_blist_request_add_buddy(NULL, NULL, ((PurpleGroup*)node)->name, NULL); | |
15374
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 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1224 else { |
15823 | 1225 purple_blist_request_add_buddy(NULL, NULL, NULL, NULL); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1226 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1227 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1228 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1229 static void |
15823 | 1230 pidgin_blist_remove_cb (GtkWidget *w, PurpleBlistNode *node) |
1231 { | |
1232 if (PURPLE_BLIST_NODE_IS_BUDDY(node)) { | |
16202
0973688f4b74
Word on the street is that we don't want things named pidginfoo_bar(), but
Richard Laager <rlaager@wiktel.com>
parents:
16198
diff
changeset
|
1233 pidgin_dialogs_remove_buddy((PurpleBuddy*)node); |
15823 | 1234 } else if (PURPLE_BLIST_NODE_IS_CHAT(node)) { |
16202
0973688f4b74
Word on the street is that we don't want things named pidginfoo_bar(), but
Richard Laager <rlaager@wiktel.com>
parents:
16198
diff
changeset
|
1235 pidgin_dialogs_remove_chat((PurpleChat*)node); |
15823 | 1236 } else if (PURPLE_BLIST_NODE_IS_GROUP(node)) { |
16202
0973688f4b74
Word on the street is that we don't want things named pidginfoo_bar(), but
Richard Laager <rlaager@wiktel.com>
parents:
16198
diff
changeset
|
1237 pidgin_dialogs_remove_group((PurpleGroup*)node); |
15823 | 1238 } else if (PURPLE_BLIST_NODE_IS_CONTACT(node)) { |
16202
0973688f4b74
Word on the street is that we don't want things named pidginfoo_bar(), but
Richard Laager <rlaager@wiktel.com>
parents:
16198
diff
changeset
|
1239 pidgin_dialogs_remove_contact((PurpleContact*)node); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1240 } |
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 struct _expand { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1244 GtkTreeView *treeview; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1245 GtkTreePath *path; |
15823 | 1246 PurpleBlistNode *node; |
15374
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 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1249 static gboolean |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1250 scroll_to_expanded_cell(gpointer data) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1251 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1252 struct _expand *ex = data; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1253 gtk_tree_view_scroll_to_cell(ex->treeview, ex->path, NULL, FALSE, 0, 0); |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
1254 pidgin_blist_update_contact(NULL, ex->node); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1255 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1256 gtk_tree_path_free(ex->path); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1257 g_free(ex); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1258 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1259 return FALSE; |
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 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1262 static void |
15823 | 1263 pidgin_blist_expand_contact_cb(GtkWidget *w, PurpleBlistNode *node) |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
1264 { |
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
1265 struct _pidgin_blist_node *gtknode; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1266 GtkTreeIter iter, parent; |
15823 | 1267 PurpleBlistNode *bnode; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1268 GtkTreePath *path; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1269 |
15823 | 1270 if(!PURPLE_BLIST_NODE_IS_CONTACT(node)) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1271 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1272 |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
1273 gtknode = (struct _pidgin_blist_node *)node->ui_data; |
15374
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 gtknode->contact_expanded = TRUE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1276 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1277 for(bnode = node->child; bnode; bnode = bnode->next) { |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
1278 pidgin_blist_update(NULL, bnode); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1279 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1280 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1281 /* This ensures that the bottom buddy is visible, i.e. not scrolled off the alignment */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1282 if (get_iter_from_node(node, &parent)) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1283 struct _expand *ex = g_new0(struct _expand, 1); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1284 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1285 gtk_tree_model_iter_nth_child(GTK_TREE_MODEL(gtkblist->treemodel), &iter, &parent, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1286 gtk_tree_model_iter_n_children(GTK_TREE_MODEL(gtkblist->treemodel), &parent) -1); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1287 path = gtk_tree_model_get_path(GTK_TREE_MODEL(gtkblist->treemodel), &iter); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1288 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1289 /* Let the treeview draw so it knows where to scroll */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1290 ex->treeview = GTK_TREE_VIEW(gtkblist->treeview); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1291 ex->path = path; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1292 ex->node = node->child; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1293 g_idle_add(scroll_to_expanded_cell, ex); |
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 } |
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 static void |
15823 | 1298 pidgin_blist_collapse_contact_cb(GtkWidget *w, PurpleBlistNode *node) |
1299 { | |
1300 PurpleBlistNode *bnode; | |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
1301 struct _pidgin_blist_node *gtknode; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1302 |
15823 | 1303 if(!PURPLE_BLIST_NODE_IS_CONTACT(node)) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1304 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1305 |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
1306 gtknode = (struct _pidgin_blist_node *)node->ui_data; |
15374
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 gtknode->contact_expanded = FALSE; |
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 for(bnode = node->child; bnode; bnode = bnode->next) { |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
1311 pidgin_blist_update(NULL, bnode); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1312 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1313 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1314 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1315 static void |
15823 | 1316 toggle_privacy(GtkWidget *widget, PurpleBlistNode *node) |
1317 { | |
1318 PurpleBuddy *buddy; | |
1319 PurpleAccount *account; | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1320 gboolean permitted; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1321 const char *name; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1322 |
15823 | 1323 if (!PURPLE_BLIST_NODE_IS_BUDDY(node)) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1324 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1325 |
15823 | 1326 buddy = (PurpleBuddy *)node; |
1327 account = purple_buddy_get_account(buddy); | |
1328 name = purple_buddy_get_name(buddy); | |
1329 | |
1330 permitted = purple_privacy_check(account, name); | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1331 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1332 /* XXX: Perhaps ask whether to restore the previous lists where appropirate? */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1333 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1334 if (permitted) |
15823 | 1335 purple_privacy_deny(account, name, FALSE, FALSE); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1336 else |
15823 | 1337 purple_privacy_allow(account, name, FALSE, FALSE); |
1338 | |
1339 pidgin_blist_update(purple_get_blist(), node); | |
1340 } | |
1341 | |
1342 void pidgin_append_blist_node_privacy_menu(GtkWidget *menu, PurpleBlistNode *node) | |
1343 { | |
1344 PurpleBuddy *buddy = (PurpleBuddy *)node; | |
1345 PurpleAccount *account; | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1346 gboolean permitted; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1347 |
15823 | 1348 account = purple_buddy_get_account(buddy); |
1349 permitted = purple_privacy_check(account, purple_buddy_get_name(buddy)); | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1350 |
15507 | 1351 pidgin_new_item_from_stock(menu, permitted ? _("_Block") : _("Un_block"), |
16007
d64602bb59d2
block and unblock have the right icons now
Nathan Walp <nwalp@pidgin.im>
parents:
15980
diff
changeset
|
1352 permitted ? PIDGIN_STOCK_TOOLBAR_BLOCK : PIDGIN_STOCK_TOOLBAR_UNBLOCK, G_CALLBACK(toggle_privacy), |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1353 node, 0 ,0, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1354 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1355 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1356 void |
15823 | 1357 pidgin_append_blist_node_proto_menu(GtkWidget *menu, PurpleConnection *gc, |
1358 PurpleBlistNode *node) | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1359 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1360 GList *l, *ll; |
15823 | 1361 PurplePluginProtocolInfo *prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(gc->prpl); |
15374
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 if(!prpl_info || !prpl_info->blist_node_menu) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1364 return; |
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 for(l = ll = prpl_info->blist_node_menu(node); l; l = l->next) { |
15823 | 1367 PurpleMenuAction *act = (PurpleMenuAction *) l->data; |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
1368 pidgin_append_menu_action(menu, act, node); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1369 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1370 g_list_free(ll); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1371 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1372 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1373 void |
15823 | 1374 pidgin_append_blist_node_extended_menu(GtkWidget *menu, PurpleBlistNode *node) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1375 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1376 GList *l, *ll; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1377 |
15823 | 1378 for(l = ll = purple_blist_node_get_extended_menu(node); l; l = l->next) { |
1379 PurpleMenuAction *act = (PurpleMenuAction *) l->data; | |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
1380 pidgin_append_menu_action(menu, act, node); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1381 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1382 g_list_free(ll); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1383 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1384 |
20045
507e109387fd
Move to menu in blist context menu. Used for more easily moving buddies between groups
Sean Egan <seanegan@gmail.com>
parents:
20043
diff
changeset
|
1385 |
507e109387fd
Move to menu in blist context menu. Used for more easily moving buddies between groups
Sean Egan <seanegan@gmail.com>
parents:
20043
diff
changeset
|
1386 |
507e109387fd
Move to menu in blist context menu. Used for more easily moving buddies between groups
Sean Egan <seanegan@gmail.com>
parents:
20043
diff
changeset
|
1387 static void |
507e109387fd
Move to menu in blist context menu. Used for more easily moving buddies between groups
Sean Egan <seanegan@gmail.com>
parents:
20043
diff
changeset
|
1388 pidgin_append_blist_node_move_to_menu(GtkWidget *menu, PurpleBlistNode *node) |
507e109387fd
Move to menu in blist context menu. Used for more easily moving buddies between groups
Sean Egan <seanegan@gmail.com>
parents:
20043
diff
changeset
|
1389 { |
507e109387fd
Move to menu in blist context menu. Used for more easily moving buddies between groups
Sean Egan <seanegan@gmail.com>
parents:
20043
diff
changeset
|
1390 GtkWidget *submenu; |
507e109387fd
Move to menu in blist context menu. Used for more easily moving buddies between groups
Sean Egan <seanegan@gmail.com>
parents:
20043
diff
changeset
|
1391 GtkWidget *menuitem; |
507e109387fd
Move to menu in blist context menu. Used for more easily moving buddies between groups
Sean Egan <seanegan@gmail.com>
parents:
20043
diff
changeset
|
1392 PurpleBlistNode *group; |
507e109387fd
Move to menu in blist context menu. Used for more easily moving buddies between groups
Sean Egan <seanegan@gmail.com>
parents:
20043
diff
changeset
|
1393 |
507e109387fd
Move to menu in blist context menu. Used for more easily moving buddies between groups
Sean Egan <seanegan@gmail.com>
parents:
20043
diff
changeset
|
1394 menuitem = gtk_menu_item_new_with_label(_("Move to")); |
507e109387fd
Move to menu in blist context menu. Used for more easily moving buddies between groups
Sean Egan <seanegan@gmail.com>
parents:
20043
diff
changeset
|
1395 gtk_menu_shell_append(GTK_MENU_SHELL(menu), menuitem); |
507e109387fd
Move to menu in blist context menu. Used for more easily moving buddies between groups
Sean Egan <seanegan@gmail.com>
parents:
20043
diff
changeset
|
1396 gtk_widget_show(menuitem); |
507e109387fd
Move to menu in blist context menu. Used for more easily moving buddies between groups
Sean Egan <seanegan@gmail.com>
parents:
20043
diff
changeset
|
1397 |
507e109387fd
Move to menu in blist context menu. Used for more easily moving buddies between groups
Sean Egan <seanegan@gmail.com>
parents:
20043
diff
changeset
|
1398 submenu = gtk_menu_new(); |
20099
ac6bf49cd5ba
Various warning fixes and a small leak fix.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20084
diff
changeset
|
1399 gtk_menu_item_set_submenu(GTK_MENU_ITEM(menuitem), submenu); |
20045
507e109387fd
Move to menu in blist context menu. Used for more easily moving buddies between groups
Sean Egan <seanegan@gmail.com>
parents:
20043
diff
changeset
|
1400 |
507e109387fd
Move to menu in blist context menu. Used for more easily moving buddies between groups
Sean Egan <seanegan@gmail.com>
parents:
20043
diff
changeset
|
1401 for (group = purple_blist_get_root(); group; group = group->next) { |
507e109387fd
Move to menu in blist context menu. Used for more easily moving buddies between groups
Sean Egan <seanegan@gmail.com>
parents:
20043
diff
changeset
|
1402 if (group->type != PURPLE_BLIST_GROUP_NODE) |
507e109387fd
Move to menu in blist context menu. Used for more easily moving buddies between groups
Sean Egan <seanegan@gmail.com>
parents:
20043
diff
changeset
|
1403 continue; |
507e109387fd
Move to menu in blist context menu. Used for more easily moving buddies between groups
Sean Egan <seanegan@gmail.com>
parents:
20043
diff
changeset
|
1404 if (group == node->parent) |
507e109387fd
Move to menu in blist context menu. Used for more easily moving buddies between groups
Sean Egan <seanegan@gmail.com>
parents:
20043
diff
changeset
|
1405 continue; |
20099
ac6bf49cd5ba
Various warning fixes and a small leak fix.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20084
diff
changeset
|
1406 menuitem = pidgin_new_item_from_stock(submenu, purple_group_get_name((PurpleGroup *)group), NULL, |
20045
507e109387fd
Move to menu in blist context menu. Used for more easily moving buddies between groups
Sean Egan <seanegan@gmail.com>
parents:
20043
diff
changeset
|
1407 G_CALLBACK(gtk_blist_menu_move_to_cb), node, 0, 0, NULL); |
507e109387fd
Move to menu in blist context menu. Used for more easily moving buddies between groups
Sean Egan <seanegan@gmail.com>
parents:
20043
diff
changeset
|
1408 g_object_set_data(G_OBJECT(menuitem), "groupnode", group); |
507e109387fd
Move to menu in blist context menu. Used for more easily moving buddies between groups
Sean Egan <seanegan@gmail.com>
parents:
20043
diff
changeset
|
1409 } |
507e109387fd
Move to menu in blist context menu. Used for more easily moving buddies between groups
Sean Egan <seanegan@gmail.com>
parents:
20043
diff
changeset
|
1410 gtk_widget_show_all(submenu); |
507e109387fd
Move to menu in blist context menu. Used for more easily moving buddies between groups
Sean Egan <seanegan@gmail.com>
parents:
20043
diff
changeset
|
1411 } |
507e109387fd
Move to menu in blist context menu. Used for more easily moving buddies between groups
Sean Egan <seanegan@gmail.com>
parents:
20043
diff
changeset
|
1412 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1413 void |
15823 | 1414 pidgin_blist_make_buddy_menu(GtkWidget *menu, PurpleBuddy *buddy, gboolean sub) { |
1415 PurplePluginProtocolInfo *prpl_info; | |
1416 PurpleContact *contact; | |
20163
1971e13bb5f6
Merge the plugin pack's showoffline plugin's functionality to pidgin proper
Stu Tomlinson <stu@nosnilmot.com>
parents:
20161
diff
changeset
|
1417 PurpleBlistNode *node; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1418 gboolean contact_expanded = FALSE; |
20163
1971e13bb5f6
Merge the plugin pack's showoffline plugin's functionality to pidgin proper
Stu Tomlinson <stu@nosnilmot.com>
parents:
20161
diff
changeset
|
1419 gboolean show_offline = FALSE; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1420 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1421 g_return_if_fail(menu); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1422 g_return_if_fail(buddy); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1423 |
15823 | 1424 prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(buddy->account->gc->prpl); |
1425 | |
20163
1971e13bb5f6
Merge the plugin pack's showoffline plugin's functionality to pidgin proper
Stu Tomlinson <stu@nosnilmot.com>
parents:
20161
diff
changeset
|
1426 node = (PurpleBlistNode*)buddy; |
1971e13bb5f6
Merge the plugin pack's showoffline plugin's functionality to pidgin proper
Stu Tomlinson <stu@nosnilmot.com>
parents:
20161
diff
changeset
|
1427 |
15823 | 1428 contact = purple_buddy_get_contact(buddy); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1429 if (contact) { |
15823 | 1430 contact_expanded = ((struct _pidgin_blist_node *)(((PurpleBlistNode*)contact)->ui_data))->contact_expanded; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1431 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1432 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1433 if (prpl_info && prpl_info->get_info) { |
15560
442128853bdb
toolbar/menu icons. reduce the imhtmltoolbar spacing. more gaimstock pruning
Sean Egan <seanegan@gmail.com>
parents:
15559
diff
changeset
|
1434 pidgin_new_item_from_stock(menu, _("Get _Info"), PIDGIN_STOCK_TOOLBAR_USER_INFO, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1435 G_CALLBACK(gtk_blist_menu_info_cb), buddy, 0, 0, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1436 } |
15560
442128853bdb
toolbar/menu icons. reduce the imhtmltoolbar spacing. more gaimstock pruning
Sean Egan <seanegan@gmail.com>
parents:
15559
diff
changeset
|
1437 pidgin_new_item_from_stock(menu, _("I_M"), PIDGIN_STOCK_TOOLBAR_MESSAGE_NEW, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1438 G_CALLBACK(gtk_blist_menu_im_cb), buddy, 0, 0, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1439 if (prpl_info && prpl_info->send_file) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1440 if (!prpl_info->can_receive_file || |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1441 prpl_info->can_receive_file(buddy->account->gc, buddy->name)) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1442 { |
20546
4195e0a93b1e
Ellipsize some menu actions that require further input. Fixes #1770
Sean Egan <seanegan@gmail.com>
parents:
20543
diff
changeset
|
1443 pidgin_new_item_from_stock(menu, _("_Send File..."), |
16839 | 1444 PIDGIN_STOCK_TOOLBAR_SEND_FILE, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1445 G_CALLBACK(gtk_blist_menu_send_file_cb), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1446 buddy, 0, 0, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1447 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1448 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1449 |
20546
4195e0a93b1e
Ellipsize some menu actions that require further input. Fixes #1770
Sean Egan <seanegan@gmail.com>
parents:
20543
diff
changeset
|
1450 pidgin_new_item_from_stock(menu, _("Add Buddy _Pounce..."), NULL, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1451 G_CALLBACK(gtk_blist_menu_bp_cb), buddy, 0, 0, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1452 |
20163
1971e13bb5f6
Merge the plugin pack's showoffline plugin's functionality to pidgin proper
Stu Tomlinson <stu@nosnilmot.com>
parents:
20161
diff
changeset
|
1453 if (node->parent && node->parent->child->next && |
18671 | 1454 !sub && !contact_expanded) { |
15560
442128853bdb
toolbar/menu icons. reduce the imhtmltoolbar spacing. more gaimstock pruning
Sean Egan <seanegan@gmail.com>
parents:
15559
diff
changeset
|
1455 pidgin_new_item_from_stock(menu, _("View _Log"), NULL, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1456 G_CALLBACK(gtk_blist_menu_showlog_cb), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1457 contact, 0, 0, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1458 } else if (!sub) { |
15559 | 1459 pidgin_new_item_from_stock(menu, _("View _Log"), NULL, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1460 G_CALLBACK(gtk_blist_menu_showlog_cb), buddy, 0, 0, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1461 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1462 |
20163
1971e13bb5f6
Merge the plugin pack's showoffline plugin's functionality to pidgin proper
Stu Tomlinson <stu@nosnilmot.com>
parents:
20161
diff
changeset
|
1463 if (!(purple_blist_node_get_flags(node) & PURPLE_BLIST_NODE_FLAG_NO_SAVE)) { |
1971e13bb5f6
Merge the plugin pack's showoffline plugin's functionality to pidgin proper
Stu Tomlinson <stu@nosnilmot.com>
parents:
20161
diff
changeset
|
1464 show_offline = purple_blist_node_get_bool(node, "show_offline"); |
1971e13bb5f6
Merge the plugin pack's showoffline plugin's functionality to pidgin proper
Stu Tomlinson <stu@nosnilmot.com>
parents:
20161
diff
changeset
|
1465 pidgin_new_item_from_stock(menu, show_offline ? _("Hide when offline") : _("Show when offline"), |
1971e13bb5f6
Merge the plugin pack's showoffline plugin's functionality to pidgin proper
Stu Tomlinson <stu@nosnilmot.com>
parents:
20161
diff
changeset
|
1466 NULL, G_CALLBACK(gtk_blist_menu_showoffline_cb), node, 0, 0, NULL); |
1971e13bb5f6
Merge the plugin pack's showoffline plugin's functionality to pidgin proper
Stu Tomlinson <stu@nosnilmot.com>
parents:
20161
diff
changeset
|
1467 } |
1971e13bb5f6
Merge the plugin pack's showoffline plugin's functionality to pidgin proper
Stu Tomlinson <stu@nosnilmot.com>
parents:
20161
diff
changeset
|
1468 |
1971e13bb5f6
Merge the plugin pack's showoffline plugin's functionality to pidgin proper
Stu Tomlinson <stu@nosnilmot.com>
parents:
20161
diff
changeset
|
1469 pidgin_append_blist_node_proto_menu(menu, buddy->account->gc, node); |
1971e13bb5f6
Merge the plugin pack's showoffline plugin's functionality to pidgin proper
Stu Tomlinson <stu@nosnilmot.com>
parents:
20161
diff
changeset
|
1470 pidgin_append_blist_node_extended_menu(menu, node); |
15823 | 1471 |
21752
9c2230fe2217
Fix a crash that occurs when creating the "Move To" menu for buddies that aren't on your list. Fixes #4217.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21751
diff
changeset
|
1472 if (!contact_expanded && contact != NULL) |
20099
ac6bf49cd5ba
Various warning fixes and a small leak fix.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20084
diff
changeset
|
1473 pidgin_append_blist_node_move_to_menu(menu, (PurpleBlistNode *)contact); |
20045
507e109387fd
Move to menu in blist context menu. Used for more easily moving buddies between groups
Sean Egan <seanegan@gmail.com>
parents:
20043
diff
changeset
|
1474 |
20163
1971e13bb5f6
Merge the plugin pack's showoffline plugin's functionality to pidgin proper
Stu Tomlinson <stu@nosnilmot.com>
parents:
20161
diff
changeset
|
1475 if (node->parent && node->parent->child->next && |
18671 | 1476 !sub && !contact_expanded) { |
15507 | 1477 pidgin_separator(menu); |
20163
1971e13bb5f6
Merge the plugin pack's showoffline plugin's functionality to pidgin proper
Stu Tomlinson <stu@nosnilmot.com>
parents:
20161
diff
changeset
|
1478 pidgin_append_blist_node_privacy_menu(menu, node); |
17693
fa5c24086481
Add the mnemonics I really meant to add before I got distracted by Add Chat
Stu Tomlinson <stu@nosnilmot.com>
parents:
17688
diff
changeset
|
1479 pidgin_new_item_from_stock(menu, _("_Alias..."), PIDGIN_STOCK_ALIAS, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1480 G_CALLBACK(gtk_blist_menu_alias_cb), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1481 contact, 0, 0, NULL); |
17693
fa5c24086481
Add the mnemonics I really meant to add before I got distracted by Add Chat
Stu Tomlinson <stu@nosnilmot.com>
parents:
17688
diff
changeset
|
1482 pidgin_new_item_from_stock(menu, _("_Remove"), GTK_STOCK_REMOVE, |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
1483 G_CALLBACK(pidgin_blist_remove_cb), |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1484 contact, 0, 0, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1485 } else if (!sub || contact_expanded) { |
15507 | 1486 pidgin_separator(menu); |
20163
1971e13bb5f6
Merge the plugin pack's showoffline plugin's functionality to pidgin proper
Stu Tomlinson <stu@nosnilmot.com>
parents:
20161
diff
changeset
|
1487 pidgin_append_blist_node_privacy_menu(menu, node); |
15509 | 1488 pidgin_new_item_from_stock(menu, _("_Alias..."), PIDGIN_STOCK_ALIAS, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1489 G_CALLBACK(gtk_blist_menu_alias_cb), buddy, 0, 0, NULL); |
15507 | 1490 pidgin_new_item_from_stock(menu, _("_Remove"), GTK_STOCK_REMOVE, |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
1491 G_CALLBACK(pidgin_blist_remove_cb), buddy, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1492 0, 0, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1493 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1494 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1495 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1496 static gboolean |
17275
319bcb73eb4e
Use utility functions to get user info. Closes #964.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
17139
diff
changeset
|
1497 gtk_blist_key_press_cb(GtkWidget *tv, GdkEventKey *event, gpointer data) |
319bcb73eb4e
Use utility functions to get user info. Closes #964.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
17139
diff
changeset
|
1498 { |
15823 | 1499 PurpleBlistNode *node; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1500 GValue val; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1501 GtkTreeIter iter; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1502 GtkTreeSelection *sel; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1503 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1504 sel = gtk_tree_view_get_selection(GTK_TREE_VIEW(tv)); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1505 if(!gtk_tree_selection_get_selected(sel, NULL, &iter)) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1506 return FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1507 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1508 val.g_type = 0; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1509 gtk_tree_model_get_value(GTK_TREE_MODEL(gtkblist->treemodel), &iter, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1510 NODE_COLUMN, &val); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1511 node = g_value_get_pointer(&val); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1512 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1513 if(event->state & GDK_CONTROL_MASK && |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1514 (event->keyval == 'o' || event->keyval == 'O')) { |
15823 | 1515 PurpleBuddy *buddy; |
1516 | |
1517 if(PURPLE_BLIST_NODE_IS_CONTACT(node)) { | |
1518 buddy = purple_contact_get_priority_buddy((PurpleContact*)node); | |
1519 } else if(PURPLE_BLIST_NODE_IS_BUDDY(node)) { | |
1520 buddy = (PurpleBuddy*)node; | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1521 } else { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1522 return FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1523 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1524 if(buddy) |
17275
319bcb73eb4e
Use utility functions to get user info. Closes #964.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
17139
diff
changeset
|
1525 pidgin_retrieve_user_info(buddy->account->gc, buddy->name); |
16220
68114539cdf7
Patch from SuperMMX, "I would like to be able to rename (alias)
Mark Doliner <mark@kingant.net>
parents:
16202
diff
changeset
|
1526 } else if (event->keyval == GDK_F2) { |
68114539cdf7
Patch from SuperMMX, "I would like to be able to rename (alias)
Mark Doliner <mark@kingant.net>
parents:
16202
diff
changeset
|
1527 gtk_blist_menu_alias_cb(tv, node); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1528 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1529 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1530 return FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1531 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1532 |
23158
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23131
diff
changeset
|
1533 static void |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23131
diff
changeset
|
1534 set_node_custom_icon_cb(const gchar *filename, gpointer data) |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23131
diff
changeset
|
1535 { |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23131
diff
changeset
|
1536 if (filename) { |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23131
diff
changeset
|
1537 PurpleBlistNode *node = (PurpleBlistNode*)data; |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23131
diff
changeset
|
1538 |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23131
diff
changeset
|
1539 purple_buddy_icons_node_set_custom_icon_from_file(node, |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23131
diff
changeset
|
1540 filename); |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23131
diff
changeset
|
1541 } |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23131
diff
changeset
|
1542 } |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23131
diff
changeset
|
1543 |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23131
diff
changeset
|
1544 static void |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23131
diff
changeset
|
1545 set_node_custom_icon(GtkWidget *w, PurpleBlistNode *node) |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23131
diff
changeset
|
1546 { |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23131
diff
changeset
|
1547 /* This doesn't keep track of the returned dialog (so that successive |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23131
diff
changeset
|
1548 * calls could be made to re-display that dialog). Do we want that? */ |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23131
diff
changeset
|
1549 GtkWidget *win = pidgin_buddy_icon_chooser_new(NULL, set_node_custom_icon_cb, node); |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23131
diff
changeset
|
1550 gtk_widget_show_all(win); |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23131
diff
changeset
|
1551 } |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23131
diff
changeset
|
1552 |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23131
diff
changeset
|
1553 static void |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23131
diff
changeset
|
1554 remove_node_custom_icon(GtkWidget *w, PurpleBlistNode *node) |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23131
diff
changeset
|
1555 { |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23131
diff
changeset
|
1556 purple_buddy_icons_node_set_custom_icon(node, NULL, 0); |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23131
diff
changeset
|
1557 } |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23131
diff
changeset
|
1558 |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23131
diff
changeset
|
1559 static void |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23131
diff
changeset
|
1560 add_buddy_icon_menu_items(GtkWidget *menu, PurpleBlistNode *node) |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23131
diff
changeset
|
1561 { |
23164
78dad8135c72
Disable the 'remove custom icon' item from the menu if a custom icon isn't set.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23161
diff
changeset
|
1562 GtkWidget *item; |
78dad8135c72
Disable the 'remove custom icon' item from the menu if a custom icon isn't set.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23161
diff
changeset
|
1563 |
23158
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23131
diff
changeset
|
1564 pidgin_new_item_from_stock(menu, _("Set Custom Icon"), NULL, |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23131
diff
changeset
|
1565 G_CALLBACK(set_node_custom_icon), node, 0, |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23131
diff
changeset
|
1566 0, NULL); |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23131
diff
changeset
|
1567 |
23164
78dad8135c72
Disable the 'remove custom icon' item from the menu if a custom icon isn't set.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23161
diff
changeset
|
1568 item = pidgin_new_item_from_stock(menu, _("Remove Custom Icon"), NULL, |
23158
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23131
diff
changeset
|
1569 G_CALLBACK(remove_node_custom_icon), node, |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23131
diff
changeset
|
1570 0, 0, NULL); |
23164
78dad8135c72
Disable the 'remove custom icon' item from the menu if a custom icon isn't set.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23161
diff
changeset
|
1571 if (!purple_buddy_icons_node_has_custom_icon(node)) |
78dad8135c72
Disable the 'remove custom icon' item from the menu if a custom icon isn't set.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23161
diff
changeset
|
1572 gtk_widget_set_sensitive(item, FALSE); |
23158
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23131
diff
changeset
|
1573 } |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23131
diff
changeset
|
1574 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1575 static GtkWidget * |
15823 | 1576 create_group_menu (PurpleBlistNode *node, PurpleGroup *g) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1577 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1578 GtkWidget *menu; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1579 GtkWidget *item; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1580 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1581 menu = gtk_menu_new(); |
20546
4195e0a93b1e
Ellipsize some menu actions that require further input. Fixes #1770
Sean Egan <seanegan@gmail.com>
parents:
20543
diff
changeset
|
1582 item = pidgin_new_item_from_stock(menu, _("Add _Buddy..."), GTK_STOCK_ADD, |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
1583 G_CALLBACK(pidgin_blist_add_buddy_cb), node, 0, 0, NULL); |
16777
1de66d5d1de8
if you're offline, and right-click on a group, you shouldn't be presented
Nathan Walp <nwalp@pidgin.im>
parents:
16760
diff
changeset
|
1584 gtk_widget_set_sensitive(item, purple_connections_get_all() != NULL); |
20546
4195e0a93b1e
Ellipsize some menu actions that require further input. Fixes #1770
Sean Egan <seanegan@gmail.com>
parents:
20543
diff
changeset
|
1585 item = pidgin_new_item_from_stock(menu, _("Add C_hat..."), GTK_STOCK_ADD, |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
1586 G_CALLBACK(pidgin_blist_add_chat_cb), node, 0, 0, NULL); |
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
1587 gtk_widget_set_sensitive(item, pidgin_blist_joinchat_is_showable()); |
15507 | 1588 pidgin_new_item_from_stock(menu, _("_Delete Group"), GTK_STOCK_REMOVE, |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
1589 G_CALLBACK(pidgin_blist_remove_cb), node, 0, 0, NULL); |
15507 | 1590 pidgin_new_item_from_stock(menu, _("_Rename"), NULL, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1591 G_CALLBACK(gtk_blist_menu_alias_cb), node, 0, 0, NULL); |
22436
df336908dd15
Make "Show when offline" work on group nodes too, which sets the flag for
Stu Tomlinson <stu@nosnilmot.com>
parents:
22313
diff
changeset
|
1592 if (!(purple_blist_node_get_flags(node) & PURPLE_BLIST_NODE_FLAG_NO_SAVE)) { |
df336908dd15
Make "Show when offline" work on group nodes too, which sets the flag for
Stu Tomlinson <stu@nosnilmot.com>
parents:
22313
diff
changeset
|
1593 gboolean show_offline = purple_blist_node_get_bool(node, "show_offline"); |
df336908dd15
Make "Show when offline" work on group nodes too, which sets the flag for
Stu Tomlinson <stu@nosnilmot.com>
parents:
22313
diff
changeset
|
1594 pidgin_new_item_from_stock(menu, show_offline ? _("Hide when offline") : _("Show when offline"), |
df336908dd15
Make "Show when offline" work on group nodes too, which sets the flag for
Stu Tomlinson <stu@nosnilmot.com>
parents:
22313
diff
changeset
|
1595 NULL, G_CALLBACK(gtk_blist_menu_showoffline_cb), node, 0, 0, NULL); |
df336908dd15
Make "Show when offline" work on group nodes too, which sets the flag for
Stu Tomlinson <stu@nosnilmot.com>
parents:
22313
diff
changeset
|
1596 } |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1597 |
23158
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23131
diff
changeset
|
1598 add_buddy_icon_menu_items(menu, node); |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23131
diff
changeset
|
1599 |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
1600 pidgin_append_blist_node_extended_menu(menu, node); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1601 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1602 return menu; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1603 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1604 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1605 static GtkWidget * |
18658
1987beefd494
Make the infopane context-menu look more like a buddylist context menu.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
18646
diff
changeset
|
1606 create_chat_menu(PurpleBlistNode *node, PurpleChat *c) |
1987beefd494
Make the infopane context-menu look more like a buddylist context menu.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
18646
diff
changeset
|
1607 { |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1608 GtkWidget *menu; |
19900
ee5b3ac0d41d
"We are going to destroy the conversations immediately only if the 'close immediately'
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19899
diff
changeset
|
1609 gboolean autojoin, persistent; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1610 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1611 menu = gtk_menu_new(); |
15823 | 1612 autojoin = (purple_blist_node_get_bool(node, "gtk-autojoin") || |
1613 (purple_blist_node_get_string(node, "gtk-autojoin") != NULL)); | |
19900
ee5b3ac0d41d
"We are going to destroy the conversations immediately only if the 'close immediately'
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19899
diff
changeset
|
1614 persistent = purple_blist_node_get_bool(node, "gtk-persistent"); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1615 |
15509 | 1616 pidgin_new_item_from_stock(menu, _("_Join"), PIDGIN_STOCK_CHAT, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1617 G_CALLBACK(gtk_blist_menu_join_cb), node, 0, 0, NULL); |
15507 | 1618 pidgin_new_check_item(menu, _("Auto-Join"), |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1619 G_CALLBACK(gtk_blist_menu_autojoin_cb), node, autojoin); |
19900
ee5b3ac0d41d
"We are going to destroy the conversations immediately only if the 'close immediately'
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19899
diff
changeset
|
1620 pidgin_new_check_item(menu, _("Persistent"), |
ee5b3ac0d41d
"We are going to destroy the conversations immediately only if the 'close immediately'
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19899
diff
changeset
|
1621 G_CALLBACK(gtk_blist_menu_persistent_cb), node, persistent); |
15560
442128853bdb
toolbar/menu icons. reduce the imhtmltoolbar spacing. more gaimstock pruning
Sean Egan <seanegan@gmail.com>
parents:
15559
diff
changeset
|
1622 pidgin_new_item_from_stock(menu, _("View _Log"), NULL, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1623 G_CALLBACK(gtk_blist_menu_showlog_cb), node, 0, 0, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1624 |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
1625 pidgin_append_blist_node_proto_menu(menu, c->account->gc, node); |
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
1626 pidgin_append_blist_node_extended_menu(menu, node); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1627 |
15507 | 1628 pidgin_separator(menu); |
1629 | |
22760
cf88a302fa88
'Edit Settings' in the context menu for chats in the buddylist.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22695
diff
changeset
|
1630 pidgin_new_item_from_stock(menu, _("_Edit Settings..."), NULL, |
cf88a302fa88
'Edit Settings' in the context menu for chats in the buddylist.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22695
diff
changeset
|
1631 G_CALLBACK(chat_components_edit), node, 0, 0, NULL); |
15509 | 1632 pidgin_new_item_from_stock(menu, _("_Alias..."), PIDGIN_STOCK_ALIAS, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1633 G_CALLBACK(gtk_blist_menu_alias_cb), node, 0, 0, NULL); |
15507 | 1634 pidgin_new_item_from_stock(menu, _("_Remove"), GTK_STOCK_REMOVE, |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
1635 G_CALLBACK(pidgin_blist_remove_cb), node, 0, 0, NULL); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1636 |
23158
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23131
diff
changeset
|
1637 add_buddy_icon_menu_items(menu, node); |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23131
diff
changeset
|
1638 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1639 return menu; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1640 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1641 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1642 static GtkWidget * |
15823 | 1643 create_contact_menu (PurpleBlistNode *node) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1644 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1645 GtkWidget *menu; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1646 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1647 menu = gtk_menu_new(); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1648 |
15560
442128853bdb
toolbar/menu icons. reduce the imhtmltoolbar spacing. more gaimstock pruning
Sean Egan <seanegan@gmail.com>
parents:
15559
diff
changeset
|
1649 pidgin_new_item_from_stock(menu, _("View _Log"), NULL, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1650 G_CALLBACK(gtk_blist_menu_showlog_cb), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1651 node, 0, 0, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1652 |
15507 | 1653 pidgin_separator(menu); |
1654 | |
15509 | 1655 pidgin_new_item_from_stock(menu, _("_Alias..."), PIDGIN_STOCK_ALIAS, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1656 G_CALLBACK(gtk_blist_menu_alias_cb), node, 0, 0, NULL); |
15507 | 1657 pidgin_new_item_from_stock(menu, _("_Remove"), GTK_STOCK_REMOVE, |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
1658 G_CALLBACK(pidgin_blist_remove_cb), node, 0, 0, NULL); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1659 |
23158
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23131
diff
changeset
|
1660 add_buddy_icon_menu_items(menu, node); |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23131
diff
changeset
|
1661 |
15507 | 1662 pidgin_separator(menu); |
1663 | |
1664 pidgin_new_item_from_stock(menu, _("_Collapse"), GTK_STOCK_ZOOM_OUT, | |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
1665 G_CALLBACK(pidgin_blist_collapse_contact_cb), |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1666 node, 0, 0, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1667 |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
1668 pidgin_append_blist_node_extended_menu(menu, node); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1669 return menu; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1670 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1671 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1672 static GtkWidget * |
18658
1987beefd494
Make the infopane context-menu look more like a buddylist context menu.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
18646
diff
changeset
|
1673 create_buddy_menu(PurpleBlistNode *node, PurpleBuddy *b) |
1987beefd494
Make the infopane context-menu look more like a buddylist context menu.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
18646
diff
changeset
|
1674 { |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
1675 struct _pidgin_blist_node *gtknode = (struct _pidgin_blist_node *)node->ui_data; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1676 GtkWidget *menu; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1677 GtkWidget *menuitem; |
16062
07554cc5d090
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <stu@nosnilmot.com>
parents:
16010
diff
changeset
|
1678 gboolean show_offline = purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/blist/show_offline_buddies"); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1679 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1680 menu = gtk_menu_new(); |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
1681 pidgin_blist_make_buddy_menu(menu, b, FALSE); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1682 |
15823 | 1683 if(PURPLE_BLIST_NODE_IS_CONTACT(node)) { |
15507 | 1684 pidgin_separator(menu); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1685 |
23166
28dae90906e1
Show the custom icon menu for a contact even if it's collapsed.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23164
diff
changeset
|
1686 add_buddy_icon_menu_items(menu, node); |
28dae90906e1
Show the custom icon menu for a contact even if it's collapsed.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23164
diff
changeset
|
1687 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1688 if(gtknode->contact_expanded) { |
15507 | 1689 pidgin_new_item_from_stock(menu, _("_Collapse"), |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1690 GTK_STOCK_ZOOM_OUT, |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
1691 G_CALLBACK(pidgin_blist_collapse_contact_cb), |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1692 node, 0, 0, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1693 } else { |
15507 | 1694 pidgin_new_item_from_stock(menu, _("_Expand"), |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1695 GTK_STOCK_ZOOM_IN, |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
1696 G_CALLBACK(pidgin_blist_expand_contact_cb), node, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1697 0, 0, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1698 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1699 if(node->child->next) { |
15823 | 1700 PurpleBlistNode *bnode; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1701 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1702 for(bnode = node->child; bnode; bnode = bnode->next) { |
15823 | 1703 PurpleBuddy *buddy = (PurpleBuddy*)bnode; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1704 GdkPixbuf *buf; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1705 GtkWidget *submenu; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1706 GtkWidget *image; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1707 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1708 if(buddy == b) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1709 continue; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1710 if(!buddy->account->gc) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1711 continue; |
15823 | 1712 if(!show_offline && !PURPLE_BUDDY_IS_ONLINE(buddy)) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1713 continue; |
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 menuitem = gtk_image_menu_item_new_with_label(buddy->name); |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
1716 buf = pidgin_create_prpl_icon(buddy->account,PIDGIN_PRPL_ICON_SMALL); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1717 image = gtk_image_new_from_pixbuf(buf); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1718 g_object_unref(G_OBJECT(buf)); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1719 gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(menuitem), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1720 image); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1721 gtk_widget_show(image); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1722 gtk_menu_shell_append(GTK_MENU_SHELL(menu), menuitem); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1723 gtk_widget_show(menuitem); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1724 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1725 submenu = gtk_menu_new(); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1726 gtk_menu_item_set_submenu(GTK_MENU_ITEM(menuitem), submenu); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1727 gtk_widget_show(submenu); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1728 |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
1729 pidgin_blist_make_buddy_menu(submenu, buddy, TRUE); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1730 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1731 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1732 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1733 return menu; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1734 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1735 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1736 static gboolean |
15823 | 1737 pidgin_blist_show_context_menu(PurpleBlistNode *node, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1738 GtkMenuPositionFunc func, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1739 GtkWidget *tv, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1740 guint button, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1741 guint32 time) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1742 { |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
1743 struct _pidgin_blist_node *gtknode; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1744 GtkWidget *menu = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1745 gboolean handled = FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1746 |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
1747 gtknode = (struct _pidgin_blist_node *)node->ui_data; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1748 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1749 /* Create a menu based on the thing we right-clicked on */ |
15823 | 1750 if (PURPLE_BLIST_NODE_IS_GROUP(node)) { |
1751 PurpleGroup *g = (PurpleGroup *)node; | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1752 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1753 menu = create_group_menu(node, g); |
15823 | 1754 } else if (PURPLE_BLIST_NODE_IS_CHAT(node)) { |
1755 PurpleChat *c = (PurpleChat *)node; | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1756 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1757 menu = create_chat_menu(node, c); |
15823 | 1758 } else if ((PURPLE_BLIST_NODE_IS_CONTACT(node)) && (gtknode->contact_expanded)) { |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1759 menu = create_contact_menu(node); |
15823 | 1760 } else if (PURPLE_BLIST_NODE_IS_CONTACT(node) || PURPLE_BLIST_NODE_IS_BUDDY(node)) { |
1761 PurpleBuddy *b; | |
1762 | |
1763 if (PURPLE_BLIST_NODE_IS_CONTACT(node)) | |
1764 b = purple_contact_get_priority_buddy((PurpleContact*)node); | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1765 else |
15823 | 1766 b = (PurpleBuddy *)node; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1767 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1768 menu = create_buddy_menu(node, b); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1769 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1770 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1771 #ifdef _WIN32 |
22976
8ac3ffa6841e
Patch from Arban57 to prevent tooltips conflicting with the context menu on
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22936
diff
changeset
|
1772 pidgin_blist_tooltip_destroy(); |
8ac3ffa6841e
Patch from Arban57 to prevent tooltips conflicting with the context menu on
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22936
diff
changeset
|
1773 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1774 /* Unhook the tooltip-timeout since we don't want a tooltip |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1775 * to appear and obscure the context menu we are about to show |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1776 This is a workaround for GTK+ bug 107320. */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1777 if (gtkblist->timeout) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1778 g_source_remove(gtkblist->timeout); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1779 gtkblist->timeout = 0; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1780 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1781 #endif |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1782 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1783 /* Now display the menu */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1784 if (menu != NULL) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1785 gtk_widget_show_all(menu); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1786 gtk_menu_popup(GTK_MENU(menu), NULL, NULL, func, tv, button, time); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1787 handled = TRUE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1788 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1789 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1790 return handled; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1791 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1792 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1793 static gboolean gtk_blist_button_press_cb(GtkWidget *tv, GdkEventButton *event, gpointer user_data) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1794 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1795 GtkTreePath *path; |
15823 | 1796 PurpleBlistNode *node; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1797 GValue val; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1798 GtkTreeIter iter; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1799 GtkTreeSelection *sel; |
15823 | 1800 PurplePlugin *prpl = NULL; |
1801 PurplePluginProtocolInfo *prpl_info = NULL; | |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
1802 struct _pidgin_blist_node *gtknode; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1803 gboolean handled = FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1804 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1805 /* Here we figure out which node was clicked */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1806 if (!gtk_tree_view_get_path_at_pos(GTK_TREE_VIEW(tv), event->x, event->y, &path, NULL, NULL, NULL)) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1807 return FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1808 gtk_tree_model_get_iter(GTK_TREE_MODEL(gtkblist->treemodel), &iter, path); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1809 val.g_type = 0; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1810 gtk_tree_model_get_value(GTK_TREE_MODEL(gtkblist->treemodel), &iter, NODE_COLUMN, &val); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1811 node = g_value_get_pointer(&val); |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
1812 gtknode = (struct _pidgin_blist_node *)node->ui_data; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1813 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1814 /* Right click draws a context menu */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1815 if ((event->button == 3) && (event->type == GDK_BUTTON_PRESS)) { |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
1816 handled = pidgin_blist_show_context_menu(node, NULL, tv, 3, event->time); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1817 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1818 /* CTRL+middle click expands or collapse a contact */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1819 } else if ((event->button == 2) && (event->type == GDK_BUTTON_PRESS) && |
15823 | 1820 (event->state & GDK_CONTROL_MASK) && (PURPLE_BLIST_NODE_IS_CONTACT(node))) { |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1821 if (gtknode->contact_expanded) |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
1822 pidgin_blist_collapse_contact_cb(NULL, node); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1823 else |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
1824 pidgin_blist_expand_contact_cb(NULL, node); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1825 handled = TRUE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1826 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1827 /* Double middle click gets info */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1828 } else if ((event->button == 2) && (event->type == GDK_2BUTTON_PRESS) && |
15823 | 1829 ((PURPLE_BLIST_NODE_IS_CONTACT(node)) || (PURPLE_BLIST_NODE_IS_BUDDY(node)))) { |
1830 PurpleBuddy *b; | |
1831 if(PURPLE_BLIST_NODE_IS_CONTACT(node)) | |
1832 b = purple_contact_get_priority_buddy((PurpleContact*)node); | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1833 else |
15823 | 1834 b = (PurpleBuddy *)node; |
1835 | |
1836 prpl = purple_find_prpl(purple_account_get_protocol_id(b->account)); | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1837 if (prpl != NULL) |
15823 | 1838 prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(prpl); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1839 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1840 if (prpl && prpl_info->get_info) |
17275
319bcb73eb4e
Use utility functions to get user info. Closes #964.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
17139
diff
changeset
|
1841 pidgin_retrieve_user_info(b->account->gc, b->name); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1842 handled = TRUE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1843 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1844 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1845 #if (1) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1846 /* |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1847 * This code only exists because GTK+ doesn't work. If we return |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1848 * FALSE here, as would be normal the event propoagates down and |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1849 * somehow gets interpreted as the start of a drag event. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1850 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1851 * Um, isn't it _normal_ to return TRUE here? Since the event |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1852 * was handled? --Mark |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1853 */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1854 if(handled) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1855 sel = gtk_tree_view_get_selection(GTK_TREE_VIEW(tv)); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1856 gtk_tree_selection_select_path(sel, path); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1857 gtk_tree_path_free(path); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1858 return TRUE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1859 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1860 #endif |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1861 gtk_tree_path_free(path); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1862 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1863 return FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1864 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1865 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1866 static gboolean |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
1867 pidgin_blist_popup_menu_cb(GtkWidget *tv, void *user_data) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1868 { |
15823 | 1869 PurpleBlistNode *node; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1870 GValue val; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1871 GtkTreeIter iter; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1872 GtkTreeSelection *sel; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1873 gboolean handled = FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1874 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1875 sel = gtk_tree_view_get_selection(GTK_TREE_VIEW(tv)); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1876 if (!gtk_tree_selection_get_selected(sel, NULL, &iter)) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1877 return FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1878 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1879 val.g_type = 0; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1880 gtk_tree_model_get_value(GTK_TREE_MODEL(gtkblist->treemodel), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1881 &iter, NODE_COLUMN, &val); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1882 node = g_value_get_pointer(&val); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1883 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1884 /* Shift+F10 draws a context menu */ |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
1885 handled = pidgin_blist_show_context_menu(node, pidgin_treeview_popup_menu_position_func, tv, 0, GDK_CURRENT_TIME); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1886 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1887 return handled; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1888 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1889 |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
1890 static void pidgin_blist_buddy_details_cb(gpointer data, guint action, GtkWidget *item) |
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
1891 { |
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
1892 pidgin_set_cursor(gtkblist->window, GDK_WATCH); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1893 |
16062
07554cc5d090
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <stu@nosnilmot.com>
parents:
16010
diff
changeset
|
1894 purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/blist/show_buddy_icons", |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1895 gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(item))); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1896 |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
1897 pidgin_clear_cursor(gtkblist->window); |
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
1898 } |
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
1899 |
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
1900 static void pidgin_blist_show_idle_time_cb(gpointer data, guint action, GtkWidget *item) |
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
1901 { |
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
1902 pidgin_set_cursor(gtkblist->window, GDK_WATCH); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1903 |
16062
07554cc5d090
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <stu@nosnilmot.com>
parents:
16010
diff
changeset
|
1904 purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/blist/show_idle_time", |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1905 gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(item))); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1906 |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
1907 pidgin_clear_cursor(gtkblist->window); |
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
1908 } |
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
1909 |
19474
74befdcd0454
Fixes #2146. Adds a Show Protocol Icon option and groups related Show menu items into a submenu. Patch from Justin Heiner
Sean Egan <seanegan@gmail.com>
parents:
19363
diff
changeset
|
1910 static void pidgin_blist_show_protocol_icons_cb(gpointer data, guint action, GtkWidget *item) |
74befdcd0454
Fixes #2146. Adds a Show Protocol Icon option and groups related Show menu items into a submenu. Patch from Justin Heiner
Sean Egan <seanegan@gmail.com>
parents:
19363
diff
changeset
|
1911 { |
74befdcd0454
Fixes #2146. Adds a Show Protocol Icon option and groups related Show menu items into a submenu. Patch from Justin Heiner
Sean Egan <seanegan@gmail.com>
parents:
19363
diff
changeset
|
1912 purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/blist/show_protocol_icons", |
74befdcd0454
Fixes #2146. Adds a Show Protocol Icon option and groups related Show menu items into a submenu. Patch from Justin Heiner
Sean Egan <seanegan@gmail.com>
parents:
19363
diff
changeset
|
1913 gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(item))); |
74befdcd0454
Fixes #2146. Adds a Show Protocol Icon option and groups related Show menu items into a submenu. Patch from Justin Heiner
Sean Egan <seanegan@gmail.com>
parents:
19363
diff
changeset
|
1914 } |
74befdcd0454
Fixes #2146. Adds a Show Protocol Icon option and groups related Show menu items into a submenu. Patch from Justin Heiner
Sean Egan <seanegan@gmail.com>
parents:
19363
diff
changeset
|
1915 |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
1916 static void pidgin_blist_show_empty_groups_cb(gpointer data, guint action, GtkWidget *item) |
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
1917 { |
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
1918 pidgin_set_cursor(gtkblist->window, GDK_WATCH); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1919 |
16062
07554cc5d090
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <stu@nosnilmot.com>
parents:
16010
diff
changeset
|
1920 purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/blist/show_empty_groups", |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1921 gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(item))); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1922 |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
1923 pidgin_clear_cursor(gtkblist->window); |
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
1924 } |
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
1925 |
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
1926 static void pidgin_blist_edit_mode_cb(gpointer callback_data, guint callback_action, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1927 GtkWidget *checkitem) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1928 { |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
1929 pidgin_set_cursor(gtkblist->window, GDK_WATCH); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1930 |
16062
07554cc5d090
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <stu@nosnilmot.com>
parents:
16010
diff
changeset
|
1931 purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/blist/show_offline_buddies", |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1932 gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(checkitem))); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1933 |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
1934 pidgin_clear_cursor(gtkblist->window); |
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
1935 } |
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
1936 |
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
1937 static void pidgin_blist_mute_sounds_cb(gpointer data, guint action, GtkWidget *item) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1938 { |
16062
07554cc5d090
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <stu@nosnilmot.com>
parents:
16010
diff
changeset
|
1939 purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/sound/mute", GTK_CHECK_MENU_ITEM(item)->active); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1940 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1941 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1942 static void |
15823 | 1943 pidgin_blist_mute_pref_cb(const char *name, PurplePrefType type, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1944 gconstpointer value, gpointer data) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1945 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1946 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(gtk_item_factory_get_item(gtkblist->ift, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1947 N_("/Tools/Mute Sounds"))), (gboolean)GPOINTER_TO_INT(value)); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1948 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1949 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1950 static void |
15823 | 1951 pidgin_blist_sound_method_pref_cb(const char *name, PurplePrefType type, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1952 gconstpointer value, gpointer data) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1953 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1954 gboolean sensitive = TRUE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1955 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1956 if(!strcmp(value, "none")) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1957 sensitive = FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1958 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1959 gtk_widget_set_sensitive(gtk_item_factory_get_widget(gtkblist->ift, N_("/Tools/Mute Sounds")), sensitive); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1960 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1961 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1962 static void |
15823 | 1963 add_buddies_from_vcard(const char *prpl_id, PurpleGroup *group, GList *list, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1964 const char *alias) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1965 { |
18063
926ccb104da0
disapproval of revision '1411afd7660760db59966c3a9f18e2adab8eb27e'
Richard Laager <rlaager@wiktel.com>
parents:
18058
diff
changeset
|
1966 GList *l; |
15823 | 1967 PurpleAccount *account = NULL; |
1968 PurpleConnection *gc; | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1969 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1970 if (list == NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1971 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1972 |
15823 | 1973 for (l = purple_connections_get_all(); l != NULL; l = l->next) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1974 { |
15823 | 1975 gc = (PurpleConnection *)l->data; |
1976 account = purple_connection_get_account(gc); | |
1977 | |
1978 if (!strcmp(purple_account_get_protocol_id(account), prpl_id)) | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1979 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1980 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1981 account = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1982 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1983 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1984 if (account != NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1985 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1986 for (l = list; l != NULL; l = l->next) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1987 { |
15823 | 1988 purple_blist_request_add_buddy(account, l->data, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1989 (group ? group->name : NULL), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1990 alias); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1991 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1992 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1993 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1994 g_list_foreach(list, (GFunc)g_free, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1995 g_list_free(list); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1996 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1997 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1998 static gboolean |
15823 | 1999 parse_vcard(const char *vcard, PurpleGroup *group) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2000 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2001 char *temp_vcard; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2002 char *s, *c; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2003 char *alias = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2004 GList *aims = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2005 GList *icqs = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2006 GList *yahoos = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2007 GList *msns = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2008 GList *jabbers = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2009 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2010 s = temp_vcard = g_strdup(vcard); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2011 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2012 while (*s != '\0' && strncmp(s, "END:vCard", strlen("END:vCard"))) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2013 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2014 char *field, *value; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2015 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2016 field = s; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2017 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2018 /* Grab the field */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2019 while (*s != '\r' && *s != '\n' && *s != '\0' && *s != ':') |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2020 s++; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2021 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2022 if (*s == '\r') s++; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2023 if (*s == '\n') |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2024 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2025 s++; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2026 continue; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2027 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2028 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2029 if (*s != '\0') *s++ = '\0'; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2030 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2031 if ((c = strchr(field, ';')) != NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2032 *c = '\0'; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2033 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2034 /* Proceed to the end of the line */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2035 value = s; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2036 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2037 while (*s != '\r' && *s != '\n' && *s != '\0') |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2038 s++; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2039 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2040 if (*s == '\r') *s++ = '\0'; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2041 if (*s == '\n') *s++ = '\0'; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2042 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2043 /* We only want to worry about a few fields here. */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2044 if (!strcmp(field, "FN")) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2045 alias = g_strdup(value); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2046 else if (!strcmp(field, "X-AIM") || !strcmp(field, "X-ICQ") || |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2047 !strcmp(field, "X-YAHOO") || !strcmp(field, "X-MSN") || |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2048 !strcmp(field, "X-JABBER")) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2049 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2050 char **values = g_strsplit(value, ":", 0); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2051 char **im; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2052 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2053 for (im = values; *im != NULL; im++) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2054 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2055 if (!strcmp(field, "X-AIM")) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2056 aims = g_list_append(aims, g_strdup(*im)); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2057 else if (!strcmp(field, "X-ICQ")) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2058 icqs = g_list_append(icqs, g_strdup(*im)); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2059 else if (!strcmp(field, "X-YAHOO")) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2060 yahoos = g_list_append(yahoos, g_strdup(*im)); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2061 else if (!strcmp(field, "X-MSN")) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2062 msns = g_list_append(msns, g_strdup(*im)); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2063 else if (!strcmp(field, "X-JABBER")) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2064 jabbers = g_list_append(jabbers, g_strdup(*im)); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2065 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2066 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2067 g_strfreev(values); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2068 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2069 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2070 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2071 g_free(temp_vcard); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2072 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2073 if (aims == NULL && icqs == NULL && yahoos == NULL && |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2074 msns == NULL && jabbers == NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2075 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2076 g_free(alias); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2077 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2078 return FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2079 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2080 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2081 add_buddies_from_vcard("prpl-oscar", group, aims, alias); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2082 add_buddies_from_vcard("prpl-oscar", group, icqs, alias); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2083 add_buddies_from_vcard("prpl-yahoo", group, yahoos, alias); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2084 add_buddies_from_vcard("prpl-msn", group, msns, alias); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2085 add_buddies_from_vcard("prpl-jabber", group, jabbers, alias); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2086 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2087 g_free(alias); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2088 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2089 return TRUE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2090 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2091 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2092 #ifdef _WIN32 |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
2093 static void pidgin_blist_drag_begin(GtkWidget *widget, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2094 GdkDragContext *drag_context, gpointer user_data) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2095 { |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
2096 pidgin_blist_tooltip_destroy(); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2097 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2098 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2099 /* Unhook the tooltip-timeout since we don't want a tooltip |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2100 * to appear and obscure the dragging operation. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2101 * This is a workaround for GTK+ bug 107320. */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2102 if (gtkblist->timeout) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2103 g_source_remove(gtkblist->timeout); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2104 gtkblist->timeout = 0; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2105 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2106 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2107 #endif |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2108 |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
2109 static void pidgin_blist_drag_data_get_cb(GtkWidget *widget, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2110 GdkDragContext *dc, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2111 GtkSelectionData *data, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2112 guint info, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2113 guint time, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2114 gpointer null) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2115 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2116 |
15823 | 2117 if (data->target == gdk_atom_intern("PURPLE_BLIST_NODE", FALSE)) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2118 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2119 GtkTreeRowReference *ref = g_object_get_data(G_OBJECT(dc), "gtk-tree-view-source-row"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2120 GtkTreePath *sourcerow = gtk_tree_row_reference_get_path(ref); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2121 GtkTreeIter iter; |
15823 | 2122 PurpleBlistNode *node = NULL; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2123 GValue val; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2124 if(!sourcerow) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2125 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2126 gtk_tree_model_get_iter(GTK_TREE_MODEL(gtkblist->treemodel), &iter, sourcerow); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2127 val.g_type = 0; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2128 gtk_tree_model_get_value (GTK_TREE_MODEL(gtkblist->treemodel), &iter, NODE_COLUMN, &val); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2129 node = g_value_get_pointer(&val); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2130 gtk_selection_data_set (data, |
15823 | 2131 gdk_atom_intern ("PURPLE_BLIST_NODE", FALSE), |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2132 8, /* bits */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2133 (void*)&node, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2134 sizeof (node)); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2135 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2136 gtk_tree_path_free(sourcerow); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2137 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2138 else if (data->target == gdk_atom_intern("application/x-im-contact", FALSE)) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2139 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2140 GtkTreeRowReference *ref; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2141 GtkTreePath *sourcerow; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2142 GtkTreeIter iter; |
15823 | 2143 PurpleBlistNode *node = NULL; |
2144 PurpleBuddy *buddy; | |
2145 PurpleConnection *gc; | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2146 GValue val; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2147 GString *str; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2148 const char *protocol; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2149 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2150 ref = g_object_get_data(G_OBJECT(dc), "gtk-tree-view-source-row"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2151 sourcerow = gtk_tree_row_reference_get_path(ref); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2152 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2153 if (!sourcerow) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2154 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2155 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2156 gtk_tree_model_get_iter(GTK_TREE_MODEL(gtkblist->treemodel), &iter, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2157 sourcerow); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2158 val.g_type = 0; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2159 gtk_tree_model_get_value(GTK_TREE_MODEL(gtkblist->treemodel), &iter, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2160 NODE_COLUMN, &val); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2161 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2162 node = g_value_get_pointer(&val); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2163 |
15823 | 2164 if (PURPLE_BLIST_NODE_IS_CONTACT(node)) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2165 { |
15823 | 2166 buddy = purple_contact_get_priority_buddy((PurpleContact *)node); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2167 } |
15823 | 2168 else if (!PURPLE_BLIST_NODE_IS_BUDDY(node)) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2169 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2170 gtk_tree_path_free(sourcerow); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2171 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2172 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2173 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2174 { |
15823 | 2175 buddy = (PurpleBuddy *)node; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2176 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2177 |
15823 | 2178 gc = purple_account_get_connection(buddy->account); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2179 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2180 if (gc == NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2181 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2182 gtk_tree_path_free(sourcerow); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2183 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2184 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2185 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2186 protocol = |
15823 | 2187 PURPLE_PLUGIN_PROTOCOL_INFO(gc->prpl)->list_icon(buddy->account, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2188 buddy); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2189 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2190 str = g_string_new(NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2191 g_string_printf(str, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2192 "MIME-Version: 1.0\r\n" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2193 "Content-Type: application/x-im-contact\r\n" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2194 "X-IM-Protocol: %s\r\n" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2195 "X-IM-Username: %s\r\n", |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2196 protocol, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2197 buddy->name); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2198 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2199 if (buddy->alias != NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2200 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2201 g_string_append_printf(str, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2202 "X-IM-Alias: %s\r\n", |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2203 buddy->alias); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2204 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2205 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2206 g_string_append(str, "\r\n"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2207 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2208 gtk_selection_data_set(data, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2209 gdk_atom_intern("application/x-im-contact", FALSE), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2210 8, /* bits */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2211 (const guchar *)str->str, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2212 strlen(str->str) + 1); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2213 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2214 g_string_free(str, TRUE); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2215 gtk_tree_path_free(sourcerow); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2216 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2217 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2218 |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
2219 static void pidgin_blist_drag_data_rcv_cb(GtkWidget *widget, GdkDragContext *dc, guint x, guint y, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2220 GtkSelectionData *sd, guint info, guint t) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2221 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2222 if (gtkblist->drag_timeout) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2223 g_source_remove(gtkblist->drag_timeout); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2224 gtkblist->drag_timeout = 0; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2225 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2226 |
15823 | 2227 if (sd->target == gdk_atom_intern("PURPLE_BLIST_NODE", FALSE) && sd->data) { |
2228 PurpleBlistNode *n = NULL; | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2229 GtkTreePath *path = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2230 GtkTreeViewDropPosition position; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2231 memcpy(&n, sd->data, sizeof(n)); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2232 if(gtk_tree_view_get_dest_row_at_pos(GTK_TREE_VIEW(widget), x, y, &path, &position)) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2233 /* if we're here, I think it means the drop is ok */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2234 GtkTreeIter iter; |
15823 | 2235 PurpleBlistNode *node; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2236 GValue val; |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
2237 struct _pidgin_blist_node *gtknode; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2238 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2239 gtk_tree_model_get_iter(GTK_TREE_MODEL(gtkblist->treemodel), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2240 &iter, path); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2241 val.g_type = 0; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2242 gtk_tree_model_get_value (GTK_TREE_MODEL(gtkblist->treemodel), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2243 &iter, NODE_COLUMN, &val); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2244 node = g_value_get_pointer(&val); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2245 gtknode = node->ui_data; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2246 |
15823 | 2247 if (PURPLE_BLIST_NODE_IS_CONTACT(n)) { |
2248 PurpleContact *c = (PurpleContact*)n; | |
2249 if (PURPLE_BLIST_NODE_IS_CONTACT(node) && gtknode->contact_expanded) { | |
2250 purple_blist_merge_contact(c, node); | |
2251 } else if (PURPLE_BLIST_NODE_IS_CONTACT(node) || | |
2252 PURPLE_BLIST_NODE_IS_CHAT(node)) { | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2253 switch(position) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2254 case GTK_TREE_VIEW_DROP_AFTER: |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2255 case GTK_TREE_VIEW_DROP_INTO_OR_AFTER: |
15823 | 2256 purple_blist_add_contact(c, (PurpleGroup*)node->parent, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2257 node); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2258 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2259 case GTK_TREE_VIEW_DROP_BEFORE: |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2260 case GTK_TREE_VIEW_DROP_INTO_OR_BEFORE: |
15823 | 2261 purple_blist_add_contact(c, (PurpleGroup*)node->parent, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2262 node->prev); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2263 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2264 } |
15823 | 2265 } else if(PURPLE_BLIST_NODE_IS_GROUP(node)) { |
2266 purple_blist_add_contact(c, (PurpleGroup*)node, NULL); | |
2267 } else if(PURPLE_BLIST_NODE_IS_BUDDY(node)) { | |
2268 purple_blist_merge_contact(c, node); | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2269 } |
15823 | 2270 } else if (PURPLE_BLIST_NODE_IS_BUDDY(n)) { |
2271 PurpleBuddy *b = (PurpleBuddy*)n; | |
2272 if (PURPLE_BLIST_NODE_IS_BUDDY(node)) { | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2273 switch(position) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2274 case GTK_TREE_VIEW_DROP_AFTER: |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2275 case GTK_TREE_VIEW_DROP_INTO_OR_AFTER: |
15823 | 2276 purple_blist_add_buddy(b, (PurpleContact*)node->parent, |
2277 (PurpleGroup*)node->parent->parent, node); | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2278 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2279 case GTK_TREE_VIEW_DROP_BEFORE: |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2280 case GTK_TREE_VIEW_DROP_INTO_OR_BEFORE: |
15823 | 2281 purple_blist_add_buddy(b, (PurpleContact*)node->parent, |
2282 (PurpleGroup*)node->parent->parent, | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2283 node->prev); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2284 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2285 } |
15823 | 2286 } else if(PURPLE_BLIST_NODE_IS_CHAT(node)) { |
2287 purple_blist_add_buddy(b, NULL, (PurpleGroup*)node->parent, | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2288 NULL); |
15823 | 2289 } else if (PURPLE_BLIST_NODE_IS_GROUP(node)) { |
2290 purple_blist_add_buddy(b, NULL, (PurpleGroup*)node, NULL); | |
2291 } else if (PURPLE_BLIST_NODE_IS_CONTACT(node)) { | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2292 if(gtknode->contact_expanded) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2293 switch(position) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2294 case GTK_TREE_VIEW_DROP_INTO_OR_AFTER: |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2295 case GTK_TREE_VIEW_DROP_AFTER: |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2296 case GTK_TREE_VIEW_DROP_INTO_OR_BEFORE: |
15823 | 2297 purple_blist_add_buddy(b, (PurpleContact*)node, |
2298 (PurpleGroup*)node->parent, NULL); | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2299 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2300 case GTK_TREE_VIEW_DROP_BEFORE: |
15823 | 2301 purple_blist_add_buddy(b, NULL, |
2302 (PurpleGroup*)node->parent, node->prev); | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2303 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2304 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2305 } else { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2306 switch(position) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2307 case GTK_TREE_VIEW_DROP_INTO_OR_AFTER: |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2308 case GTK_TREE_VIEW_DROP_AFTER: |
15823 | 2309 purple_blist_add_buddy(b, NULL, |
2310 (PurpleGroup*)node->parent, NULL); | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2311 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2312 case GTK_TREE_VIEW_DROP_INTO_OR_BEFORE: |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2313 case GTK_TREE_VIEW_DROP_BEFORE: |
15823 | 2314 purple_blist_add_buddy(b, NULL, |
2315 (PurpleGroup*)node->parent, node->prev); | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2316 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2317 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2318 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2319 } |
15823 | 2320 } else if (PURPLE_BLIST_NODE_IS_CHAT(n)) { |
2321 PurpleChat *chat = (PurpleChat *)n; | |
2322 if (PURPLE_BLIST_NODE_IS_BUDDY(node)) { | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2323 switch(position) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2324 case GTK_TREE_VIEW_DROP_AFTER: |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2325 case GTK_TREE_VIEW_DROP_INTO_OR_AFTER: |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2326 case GTK_TREE_VIEW_DROP_BEFORE: |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2327 case GTK_TREE_VIEW_DROP_INTO_OR_BEFORE: |
15823 | 2328 purple_blist_add_chat(chat, |
2329 (PurpleGroup*)node->parent->parent, | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2330 node->parent); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2331 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2332 } |
15823 | 2333 } else if(PURPLE_BLIST_NODE_IS_CONTACT(node) || |
2334 PURPLE_BLIST_NODE_IS_CHAT(node)) { | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2335 switch(position) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2336 case GTK_TREE_VIEW_DROP_AFTER: |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2337 case GTK_TREE_VIEW_DROP_INTO_OR_AFTER: |
15823 | 2338 purple_blist_add_chat(chat, (PurpleGroup*)node->parent, node); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2339 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2340 case GTK_TREE_VIEW_DROP_BEFORE: |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2341 case GTK_TREE_VIEW_DROP_INTO_OR_BEFORE: |
15823 | 2342 purple_blist_add_chat(chat, (PurpleGroup*)node->parent, node->prev); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2343 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2344 } |
15823 | 2345 } else if (PURPLE_BLIST_NODE_IS_GROUP(node)) { |
2346 purple_blist_add_chat(chat, (PurpleGroup*)node, NULL); | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2347 } |
15823 | 2348 } else if (PURPLE_BLIST_NODE_IS_GROUP(n)) { |
2349 PurpleGroup *g = (PurpleGroup*)n; | |
2350 if (PURPLE_BLIST_NODE_IS_GROUP(node)) { | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2351 switch (position) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2352 case GTK_TREE_VIEW_DROP_INTO_OR_AFTER: |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2353 case GTK_TREE_VIEW_DROP_AFTER: |
15823 | 2354 purple_blist_add_group(g, node); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2355 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2356 case GTK_TREE_VIEW_DROP_INTO_OR_BEFORE: |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2357 case GTK_TREE_VIEW_DROP_BEFORE: |
15823 | 2358 purple_blist_add_group(g, node->prev); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2359 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2360 } |
15823 | 2361 } else if(PURPLE_BLIST_NODE_IS_BUDDY(node)) { |
2362 purple_blist_add_group(g, node->parent->parent); | |
2363 } else if(PURPLE_BLIST_NODE_IS_CONTACT(node) || | |
2364 PURPLE_BLIST_NODE_IS_CHAT(node)) { | |
2365 purple_blist_add_group(g, node->parent); | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2366 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2367 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2368 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2369 gtk_tree_path_free(path); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2370 gtk_drag_finish(dc, TRUE, (dc->action == GDK_ACTION_MOVE), t); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2371 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2372 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2373 else if (sd->target == gdk_atom_intern("application/x-im-contact", |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2374 FALSE) && sd->data) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2375 { |
15823 | 2376 PurpleGroup *group = NULL; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2377 GtkTreePath *path = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2378 GtkTreeViewDropPosition position; |
15823 | 2379 PurpleAccount *account; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2380 char *protocol = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2381 char *username = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2382 char *alias = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2383 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2384 if (gtk_tree_view_get_dest_row_at_pos(GTK_TREE_VIEW(widget), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2385 x, y, &path, &position)) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2386 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2387 GtkTreeIter iter; |
15823 | 2388 PurpleBlistNode *node; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2389 GValue val; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2390 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2391 gtk_tree_model_get_iter(GTK_TREE_MODEL(gtkblist->treemodel), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2392 &iter, path); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2393 val.g_type = 0; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2394 gtk_tree_model_get_value (GTK_TREE_MODEL(gtkblist->treemodel), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2395 &iter, NODE_COLUMN, &val); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2396 node = g_value_get_pointer(&val); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2397 |
15823 | 2398 if (PURPLE_BLIST_NODE_IS_BUDDY(node)) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2399 { |
15823 | 2400 group = (PurpleGroup *)node->parent->parent; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2401 } |
15823 | 2402 else if (PURPLE_BLIST_NODE_IS_CHAT(node) || |
2403 PURPLE_BLIST_NODE_IS_CONTACT(node)) | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2404 { |
15823 | 2405 group = (PurpleGroup *)node->parent; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2406 } |
15823 | 2407 else if (PURPLE_BLIST_NODE_IS_GROUP(node)) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2408 { |
15823 | 2409 group = (PurpleGroup *)node; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2410 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2411 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2412 |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
2413 if (pidgin_parse_x_im_contact((const char *)sd->data, FALSE, &account, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2414 &protocol, &username, &alias)) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2415 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2416 if (account == NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2417 { |
15823 | 2418 purple_notify_error(NULL, NULL, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2419 _("You are not currently signed on with an account that " |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2420 "can add that buddy."), NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2421 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2422 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2423 { |
15823 | 2424 purple_blist_request_add_buddy(account, username, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2425 (group ? group->name : NULL), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2426 alias); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2427 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2428 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2429 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2430 g_free(username); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2431 g_free(protocol); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2432 g_free(alias); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2433 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2434 if (path != NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2435 gtk_tree_path_free(path); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2436 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2437 gtk_drag_finish(dc, TRUE, (dc->action == GDK_ACTION_MOVE), t); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2438 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2439 else if (sd->target == gdk_atom_intern("text/x-vcard", FALSE) && sd->data) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2440 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2441 gboolean result; |
15823 | 2442 PurpleGroup *group = NULL; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2443 GtkTreePath *path = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2444 GtkTreeViewDropPosition position; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2445 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2446 if (gtk_tree_view_get_dest_row_at_pos(GTK_TREE_VIEW(widget), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2447 x, y, &path, &position)) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2448 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2449 GtkTreeIter iter; |
15823 | 2450 PurpleBlistNode *node; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2451 GValue val; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2452 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2453 gtk_tree_model_get_iter(GTK_TREE_MODEL(gtkblist->treemodel), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2454 &iter, path); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2455 val.g_type = 0; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2456 gtk_tree_model_get_value (GTK_TREE_MODEL(gtkblist->treemodel), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2457 &iter, NODE_COLUMN, &val); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2458 node = g_value_get_pointer(&val); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2459 |
15823 | 2460 if (PURPLE_BLIST_NODE_IS_BUDDY(node)) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2461 { |
15823 | 2462 group = (PurpleGroup *)node->parent->parent; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2463 } |
15823 | 2464 else if (PURPLE_BLIST_NODE_IS_CHAT(node) || |
2465 PURPLE_BLIST_NODE_IS_CONTACT(node)) | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2466 { |
15823 | 2467 group = (PurpleGroup *)node->parent; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2468 } |
15823 | 2469 else if (PURPLE_BLIST_NODE_IS_GROUP(node)) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2470 { |
15823 | 2471 group = (PurpleGroup *)node; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2472 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2473 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2474 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2475 result = parse_vcard((const gchar *)sd->data, group); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2476 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2477 gtk_drag_finish(dc, result, (dc->action == GDK_ACTION_MOVE), t); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2478 } else if (sd->target == gdk_atom_intern("text/uri-list", FALSE) && sd->data) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2479 GtkTreePath *path = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2480 GtkTreeViewDropPosition position; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2481 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2482 if (gtk_tree_view_get_dest_row_at_pos(GTK_TREE_VIEW(widget), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2483 x, y, &path, &position)) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2484 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2485 GtkTreeIter iter; |
15823 | 2486 PurpleBlistNode *node; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2487 GValue val; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2488 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2489 gtk_tree_model_get_iter(GTK_TREE_MODEL(gtkblist->treemodel), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2490 &iter, path); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2491 val.g_type = 0; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2492 gtk_tree_model_get_value (GTK_TREE_MODEL(gtkblist->treemodel), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2493 &iter, NODE_COLUMN, &val); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2494 node = g_value_get_pointer(&val); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2495 |
15823 | 2496 if (PURPLE_BLIST_NODE_IS_BUDDY(node) || PURPLE_BLIST_NODE_IS_CONTACT(node)) { |
2497 PurpleBuddy *b = PURPLE_BLIST_NODE_IS_BUDDY(node) ? (PurpleBuddy*)node : purple_contact_get_priority_buddy((PurpleContact*)node); | |
15507 | 2498 pidgin_dnd_file_manage(sd, b->account, b->name); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2499 gtk_drag_finish(dc, TRUE, (dc->action == GDK_ACTION_MOVE), t); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2500 } else { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2501 gtk_drag_finish(dc, FALSE, FALSE, t); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2502 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2503 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2504 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2505 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2506 |
15491
88070d5f4c62
dim buddy icons on idle and offline. Still need to do status icons.
Sean Egan <seanegan@gmail.com>
parents:
15490
diff
changeset
|
2507 /* Altered from do_colorshift in gnome-panel */ |
88070d5f4c62
dim buddy icons on idle and offline. Still need to do status icons.
Sean Egan <seanegan@gmail.com>
parents:
15490
diff
changeset
|
2508 static void |
88070d5f4c62
dim buddy icons on idle and offline. Still need to do status icons.
Sean Egan <seanegan@gmail.com>
parents:
15490
diff
changeset
|
2509 do_alphashift (GdkPixbuf *dest, GdkPixbuf *src, int shift) |
88070d5f4c62
dim buddy icons on idle and offline. Still need to do status icons.
Sean Egan <seanegan@gmail.com>
parents:
15490
diff
changeset
|
2510 { |
88070d5f4c62
dim buddy icons on idle and offline. Still need to do status icons.
Sean Egan <seanegan@gmail.com>
parents:
15490
diff
changeset
|
2511 gint i, j; |
88070d5f4c62
dim buddy icons on idle and offline. Still need to do status icons.
Sean Egan <seanegan@gmail.com>
parents:
15490
diff
changeset
|
2512 gint width, height, has_alpha, srcrowstride, destrowstride; |
88070d5f4c62
dim buddy icons on idle and offline. Still need to do status icons.
Sean Egan <seanegan@gmail.com>
parents:
15490
diff
changeset
|
2513 guchar *target_pixels; |
88070d5f4c62
dim buddy icons on idle and offline. Still need to do status icons.
Sean Egan <seanegan@gmail.com>
parents:
15490
diff
changeset
|
2514 guchar *original_pixels; |
88070d5f4c62
dim buddy icons on idle and offline. Still need to do status icons.
Sean Egan <seanegan@gmail.com>
parents:
15490
diff
changeset
|
2515 guchar *pixsrc; |
88070d5f4c62
dim buddy icons on idle and offline. Still need to do status icons.
Sean Egan <seanegan@gmail.com>
parents:
15490
diff
changeset
|
2516 guchar *pixdest; |
88070d5f4c62
dim buddy icons on idle and offline. Still need to do status icons.
Sean Egan <seanegan@gmail.com>
parents:
15490
diff
changeset
|
2517 int val; |
88070d5f4c62
dim buddy icons on idle and offline. Still need to do status icons.
Sean Egan <seanegan@gmail.com>
parents:
15490
diff
changeset
|
2518 guchar a; |
88070d5f4c62
dim buddy icons on idle and offline. Still need to do status icons.
Sean Egan <seanegan@gmail.com>
parents:
15490
diff
changeset
|
2519 |
88070d5f4c62
dim buddy icons on idle and offline. Still need to do status icons.
Sean Egan <seanegan@gmail.com>
parents:
15490
diff
changeset
|
2520 has_alpha = gdk_pixbuf_get_has_alpha (src); |
88070d5f4c62
dim buddy icons on idle and offline. Still need to do status icons.
Sean Egan <seanegan@gmail.com>
parents:
15490
diff
changeset
|
2521 if (!has_alpha) |
88070d5f4c62
dim buddy icons on idle and offline. Still need to do status icons.
Sean Egan <seanegan@gmail.com>
parents:
15490
diff
changeset
|
2522 return; |
88070d5f4c62
dim buddy icons on idle and offline. Still need to do status icons.
Sean Egan <seanegan@gmail.com>
parents:
15490
diff
changeset
|
2523 |
88070d5f4c62
dim buddy icons on idle and offline. Still need to do status icons.
Sean Egan <seanegan@gmail.com>
parents:
15490
diff
changeset
|
2524 width = gdk_pixbuf_get_width (src); |
88070d5f4c62
dim buddy icons on idle and offline. Still need to do status icons.
Sean Egan <seanegan@gmail.com>
parents:
15490
diff
changeset
|
2525 height = gdk_pixbuf_get_height (src); |
88070d5f4c62
dim buddy icons on idle and offline. Still need to do status icons.
Sean Egan <seanegan@gmail.com>
parents:
15490
diff
changeset
|
2526 srcrowstride = gdk_pixbuf_get_rowstride (src); |
88070d5f4c62
dim buddy icons on idle and offline. Still need to do status icons.
Sean Egan <seanegan@gmail.com>
parents:
15490
diff
changeset
|
2527 destrowstride = gdk_pixbuf_get_rowstride (dest); |
88070d5f4c62
dim buddy icons on idle and offline. Still need to do status icons.
Sean Egan <seanegan@gmail.com>
parents:
15490
diff
changeset
|
2528 target_pixels = gdk_pixbuf_get_pixels (dest); |
88070d5f4c62
dim buddy icons on idle and offline. Still need to do status icons.
Sean Egan <seanegan@gmail.com>
parents:
15490
diff
changeset
|
2529 original_pixels = gdk_pixbuf_get_pixels (src); |
88070d5f4c62
dim buddy icons on idle and offline. Still need to do status icons.
Sean Egan <seanegan@gmail.com>
parents:
15490
diff
changeset
|
2530 |
88070d5f4c62
dim buddy icons on idle and offline. Still need to do status icons.
Sean Egan <seanegan@gmail.com>
parents:
15490
diff
changeset
|
2531 for (i = 0; i < height; i++) { |
88070d5f4c62
dim buddy icons on idle and offline. Still need to do status icons.
Sean Egan <seanegan@gmail.com>
parents:
15490
diff
changeset
|
2532 pixdest = target_pixels + i*destrowstride; |
88070d5f4c62
dim buddy icons on idle and offline. Still need to do status icons.
Sean Egan <seanegan@gmail.com>
parents:
15490
diff
changeset
|
2533 pixsrc = original_pixels + i*srcrowstride; |
88070d5f4c62
dim buddy icons on idle and offline. Still need to do status icons.
Sean Egan <seanegan@gmail.com>
parents:
15490
diff
changeset
|
2534 for (j = 0; j < width; j++) { |
88070d5f4c62
dim buddy icons on idle and offline. Still need to do status icons.
Sean Egan <seanegan@gmail.com>
parents:
15490
diff
changeset
|
2535 *(pixdest++) = *(pixsrc++); |
88070d5f4c62
dim buddy icons on idle and offline. Still need to do status icons.
Sean Egan <seanegan@gmail.com>
parents:
15490
diff
changeset
|
2536 *(pixdest++) = *(pixsrc++); |
88070d5f4c62
dim buddy icons on idle and offline. Still need to do status icons.
Sean Egan <seanegan@gmail.com>
parents:
15490
diff
changeset
|
2537 *(pixdest++) = *(pixsrc++); |
88070d5f4c62
dim buddy icons on idle and offline. Still need to do status icons.
Sean Egan <seanegan@gmail.com>
parents:
15490
diff
changeset
|
2538 a = *(pixsrc++); |
88070d5f4c62
dim buddy icons on idle and offline. Still need to do status icons.
Sean Egan <seanegan@gmail.com>
parents:
15490
diff
changeset
|
2539 val = a - shift; |
88070d5f4c62
dim buddy icons on idle and offline. Still need to do status icons.
Sean Egan <seanegan@gmail.com>
parents:
15490
diff
changeset
|
2540 *(pixdest++) = CLAMP(val, 0, 255); |
88070d5f4c62
dim buddy icons on idle and offline. Still need to do status icons.
Sean Egan <seanegan@gmail.com>
parents:
15490
diff
changeset
|
2541 } |
88070d5f4c62
dim buddy icons on idle and offline. Still need to do status icons.
Sean Egan <seanegan@gmail.com>
parents:
15490
diff
changeset
|
2542 } |
88070d5f4c62
dim buddy icons on idle and offline. Still need to do status icons.
Sean Egan <seanegan@gmail.com>
parents:
15490
diff
changeset
|
2543 } |
88070d5f4c62
dim buddy icons on idle and offline. Still need to do status icons.
Sean Egan <seanegan@gmail.com>
parents:
15490
diff
changeset
|
2544 |
88070d5f4c62
dim buddy icons on idle and offline. Still need to do status icons.
Sean Egan <seanegan@gmail.com>
parents:
15490
diff
changeset
|
2545 |
15823 | 2546 static GdkPixbuf *pidgin_blist_get_buddy_icon(PurpleBlistNode *node, |
23158
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23131
diff
changeset
|
2547 gboolean scaled, gboolean greyed) |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23131
diff
changeset
|
2548 { |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23131
diff
changeset
|
2549 gsize len; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2550 GdkPixbufLoader *loader; |
15823 | 2551 PurpleBuddy *buddy = NULL; |
23158
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23131
diff
changeset
|
2552 PurpleGroup *group = NULL; |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23131
diff
changeset
|
2553 const guchar *data = NULL; |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23131
diff
changeset
|
2554 GdkPixbuf *buf, *ret = NULL; |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23131
diff
changeset
|
2555 PurpleBuddyIcon *icon = NULL; |
15823 | 2556 PurpleAccount *account = NULL; |
23158
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23131
diff
changeset
|
2557 PurpleContact *contact = NULL; |
16375
391a79778f89
Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@wiktel.com>
parents:
16275
diff
changeset
|
2558 PurpleStoredImage *custom_img; |
23158
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23131
diff
changeset
|
2559 PurplePluginProtocolInfo *prpl_info = NULL; |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23131
diff
changeset
|
2560 gint orig_width, orig_height, scale_width, scale_height; |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23131
diff
changeset
|
2561 |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23131
diff
changeset
|
2562 if (PURPLE_BLIST_NODE_IS_CONTACT(node)) { |
15823 | 2563 buddy = purple_contact_get_priority_buddy((PurpleContact*)node); |
23158
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23131
diff
changeset
|
2564 contact = (PurpleContact*)node; |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23131
diff
changeset
|
2565 } else if (PURPLE_BLIST_NODE_IS_BUDDY(node)) { |
15823 | 2566 buddy = (PurpleBuddy*)node; |
23158
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23131
diff
changeset
|
2567 contact = purple_buddy_get_contact(buddy); |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23131
diff
changeset
|
2568 } else if (PURPLE_BLIST_NODE_IS_GROUP(node)) { |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23131
diff
changeset
|
2569 group = (PurpleGroup*)node; |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23131
diff
changeset
|
2570 } else if (PURPLE_BLIST_NODE_IS_CHAT(node)) { |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23131
diff
changeset
|
2571 /* We don't need to do anything here. We just need to not fall |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23131
diff
changeset
|
2572 * into the else block and return. */ |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2573 } else { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2574 return NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2575 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2576 |
23158
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23131
diff
changeset
|
2577 if (buddy) { |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23131
diff
changeset
|
2578 account = purple_buddy_get_account(buddy); |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23131
diff
changeset
|
2579 } |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23131
diff
changeset
|
2580 |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23131
diff
changeset
|
2581 if(account && account->gc) { |
15823 | 2582 prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(account->gc->prpl); |
23158
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23131
diff
changeset
|
2583 } |
15423
051a5c4f0917
this would use the protocol icons in place of the buddy icon for chats,
Nathan Walp <nwalp@pidgin.im>
parents:
15418
diff
changeset
|
2584 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2585 #if 0 |
16062
07554cc5d090
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <stu@nosnilmot.com>
parents:
16010
diff
changeset
|
2586 if (!purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/blist/show_buddy_icons")) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2587 return NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2588 #endif |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2589 |
23158
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23131
diff
changeset
|
2590 /* If we have a contact then this is either a contact or a buddy and |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23131
diff
changeset
|
2591 * we want to fetch the custom icon for the contact. If we don't have |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23131
diff
changeset
|
2592 * a contact then this is a group or some other type of node and we |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23131
diff
changeset
|
2593 * want to use that directly. */ |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23131
diff
changeset
|
2594 if (contact) { |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23131
diff
changeset
|
2595 custom_img = purple_buddy_icons_node_find_custom_icon((PurpleBlistNode*)contact); |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23131
diff
changeset
|
2596 } else { |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23131
diff
changeset
|
2597 custom_img = purple_buddy_icons_node_find_custom_icon(node); |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23131
diff
changeset
|
2598 } |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23131
diff
changeset
|
2599 |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23131
diff
changeset
|
2600 if (custom_img) { |
16375
391a79778f89
Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@wiktel.com>
parents:
16275
diff
changeset
|
2601 data = purple_imgstore_get_data(custom_img); |
391a79778f89
Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@wiktel.com>
parents:
16275
diff
changeset
|
2602 len = purple_imgstore_get_size(custom_img); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2603 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2604 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2605 if (data == NULL) { |
23158
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23131
diff
changeset
|
2606 if (buddy) { |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23131
diff
changeset
|
2607 /* Not sure I like this...*/ |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23131
diff
changeset
|
2608 if (!(icon = purple_buddy_icons_find(buddy->account, buddy->name))) |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23131
diff
changeset
|
2609 return NULL; |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23131
diff
changeset
|
2610 data = purple_buddy_icon_get_data(icon, &len); |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23131
diff
changeset
|
2611 } |
16564
26fb9b308cc1
This is Sadrul's icon-migrate.patch from ticket #314.
Richard Laager <rlaager@wiktel.com>
parents:
16483
diff
changeset
|
2612 |
26fb9b308cc1
This is Sadrul's icon-migrate.patch from ticket #314.
Richard Laager <rlaager@wiktel.com>
parents:
16483
diff
changeset
|
2613 if(data == NULL) |
26fb9b308cc1
This is Sadrul's icon-migrate.patch from ticket #314.
Richard Laager <rlaager@wiktel.com>
parents:
16483
diff
changeset
|
2614 return NULL; |
26fb9b308cc1
This is Sadrul's icon-migrate.patch from ticket #314.
Richard Laager <rlaager@wiktel.com>
parents:
16483
diff
changeset
|
2615 } |
15423
051a5c4f0917
this would use the protocol icons in place of the buddy icon for chats,
Nathan Walp <nwalp@pidgin.im>
parents:
15418
diff
changeset
|
2616 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2617 loader = gdk_pixbuf_loader_new(); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2618 gdk_pixbuf_loader_write(loader, data, len, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2619 gdk_pixbuf_loader_close(loader, NULL); |
16383
05033ae856b2
Fix the memory leaking and improper calls to ref_filename(). Also, remove some debugging code.
Richard Laager <rlaager@wiktel.com>
parents:
16381
diff
changeset
|
2620 |
05033ae856b2
Fix the memory leaking and improper calls to ref_filename(). Also, remove some debugging code.
Richard Laager <rlaager@wiktel.com>
parents:
16381
diff
changeset
|
2621 purple_imgstore_unref(custom_img); |
16828
56823a55581a
Rework purple_buddy_icons_find() to return a reference for the caller, which
Richard Laager <rlaager@wiktel.com>
parents:
16777
diff
changeset
|
2622 purple_buddy_icon_unref(icon); |
16383
05033ae856b2
Fix the memory leaking and improper calls to ref_filename(). Also, remove some debugging code.
Richard Laager <rlaager@wiktel.com>
parents:
16381
diff
changeset
|
2623 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2624 buf = gdk_pixbuf_loader_get_pixbuf(loader); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2625 if (buf) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2626 g_object_ref(G_OBJECT(buf)); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2627 g_object_unref(G_OBJECT(loader)); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2628 |
23158
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23131
diff
changeset
|
2629 if (!buf) { |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23131
diff
changeset
|
2630 return NULL; |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23131
diff
changeset
|
2631 } |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23131
diff
changeset
|
2632 |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23131
diff
changeset
|
2633 if (greyed) { |
23160
85f567c95af1
Buddy icons in the buddy list should not default to being marked idle. Thanks
Etan Reisner <pidgin@unreliablesource.net>
parents:
23158
diff
changeset
|
2634 gboolean offline = FALSE, idle = FALSE; |
23158
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23131
diff
changeset
|
2635 |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23131
diff
changeset
|
2636 if (buddy) { |
15823 | 2637 PurplePresence *presence = purple_buddy_get_presence(buddy); |
2638 if (!PURPLE_BUDDY_IS_ONLINE(buddy)) | |
23158
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23131
diff
changeset
|
2639 offline = TRUE; |
15823 | 2640 if (purple_presence_is_idle(presence)) |
23158
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23131
diff
changeset
|
2641 idle = TRUE; |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23131
diff
changeset
|
2642 } else if (group) { |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23131
diff
changeset
|
2643 if (purple_blist_get_group_online_count(group) == 0) |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23131
diff
changeset
|
2644 offline = TRUE; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2645 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2646 |
23158
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23131
diff
changeset
|
2647 if (offline) |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23131
diff
changeset
|
2648 gdk_pixbuf_saturate_and_pixelate(buf, buf, 0.0, FALSE); |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23131
diff
changeset
|
2649 |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23131
diff
changeset
|
2650 if (idle) |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23131
diff
changeset
|
2651 gdk_pixbuf_saturate_and_pixelate(buf, buf, 0.25, FALSE); |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23131
diff
changeset
|
2652 } |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23131
diff
changeset
|
2653 |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23131
diff
changeset
|
2654 /* I'd use the pidgin_buddy_icon_get_scale_size() thing, but it won't |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23131
diff
changeset
|
2655 * tell me the original size, which I need for scaling purposes. */ |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23131
diff
changeset
|
2656 scale_width = orig_width = gdk_pixbuf_get_width(buf); |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23131
diff
changeset
|
2657 scale_height = orig_height = gdk_pixbuf_get_height(buf); |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23131
diff
changeset
|
2658 |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23131
diff
changeset
|
2659 if (prpl_info && prpl_info->icon_spec.scale_rules & PURPLE_ICON_SCALE_DISPLAY) |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23131
diff
changeset
|
2660 purple_buddy_icon_get_scale_size(&prpl_info->icon_spec, &scale_width, &scale_height); |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23131
diff
changeset
|
2661 |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23131
diff
changeset
|
2662 if (scaled || scale_height > 200 || scale_width > 200) { |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23131
diff
changeset
|
2663 GdkPixbuf *tmpbuf; |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23131
diff
changeset
|
2664 float scale_size = scaled ? 32.0 : 200.0; |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23131
diff
changeset
|
2665 if(scale_height > scale_width) { |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23131
diff
changeset
|
2666 scale_width = scale_size * (double)scale_width / (double)scale_height; |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23131
diff
changeset
|
2667 scale_height = scale_size; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2668 } else { |
23158
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23131
diff
changeset
|
2669 scale_height = scale_size * (double)scale_height / (double)scale_width; |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23131
diff
changeset
|
2670 scale_width = scale_size; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2671 } |
23158
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23131
diff
changeset
|
2672 /* Scale & round before making square, so rectangular (but |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23131
diff
changeset
|
2673 * non-square) images get rounded corners too. */ |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23131
diff
changeset
|
2674 tmpbuf = gdk_pixbuf_new(GDK_COLORSPACE_RGB, TRUE, 8, scale_width, scale_height); |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23131
diff
changeset
|
2675 gdk_pixbuf_fill(tmpbuf, 0x00000000); |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23131
diff
changeset
|
2676 gdk_pixbuf_scale(buf, tmpbuf, 0, 0, scale_width, scale_height, 0, 0, (double)scale_width/(double)orig_width, (double)scale_height/(double)orig_height, GDK_INTERP_BILINEAR); |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23131
diff
changeset
|
2677 if (pidgin_gdk_pixbuf_is_opaque(tmpbuf)) |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23131
diff
changeset
|
2678 pidgin_gdk_pixbuf_make_round(tmpbuf); |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23131
diff
changeset
|
2679 ret = gdk_pixbuf_new(GDK_COLORSPACE_RGB, TRUE, 8, scale_size, scale_size); |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23131
diff
changeset
|
2680 gdk_pixbuf_fill(ret, 0x00000000); |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23131
diff
changeset
|
2681 gdk_pixbuf_copy_area(tmpbuf, 0, 0, scale_width, scale_height, ret, (scale_size-scale_width)/2, (scale_size-scale_height)/2); |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23131
diff
changeset
|
2682 g_object_unref(G_OBJECT(tmpbuf)); |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23131
diff
changeset
|
2683 } else { |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23131
diff
changeset
|
2684 ret = gdk_pixbuf_scale_simple(buf,scale_width,scale_height, GDK_INTERP_BILINEAR); |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23131
diff
changeset
|
2685 } |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23131
diff
changeset
|
2686 g_object_unref(G_OBJECT(buf)); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2687 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2688 return ret; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2689 } |
23158
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23131
diff
changeset
|
2690 |
15442 | 2691 /* # - Status Icon |
2692 * P - Protocol Icon | |
2693 * A - Buddy Icon | |
2694 * [ - SMALL_SPACE | |
2695 * = - LARGE_SPACE | |
2696 * +--- STATUS_SIZE +--- td->avatar_width | |
2697 * | +-- td->name_width | | |
2698 * +----+ +-------+ +---------+ | |
2699 * | | | | | | | |
2700 * +-------------------------------------------+ | |
2701 * | [ = [ |--- TOOLTIP_BORDER | |
2702 *name_height --+-| ######[BuddyName = PP [ AAAAAAAAAAA |--+ | |
2703 * | | ######[ = PP [ AAAAAAAAAAA | | | |
2704 * STATUS SIZE -| | ######[[[[[[[[[[[[[[[[[[[[[ AAAAAAAAAAA | | | |
2705 * +--+-| ######[Account: So-and-so [ AAAAAAAAAAA | |-- td->avatar_height | |
2706 * | | [Idle: 4h 15m [ AAAAAAAAAAA | | | |
2707 * height --+ | [Foo: Bar, Baz [ AAAAAAAAAAA | | | |
2708 * | | [Status: Awesome [ AAAAAAAAAAA |--+ | |
2709 * +----| [Stop: Hammer Time [ | | |
2710 * | [ [ |--- TOOLTIP_BORDER | |
2711 * +-------------------------------------------+ | |
2712 * | | | | | |
2713 * | +----------------+ | | |
2714 * | | | | |
2715 * | +-- td->width | | |
2716 * | | | |
2717 * +---- TOOLTIP_BORDER +---- TOOLTIP_BORDER | |
2718 * | |
15632
a830f9756f23
Some more pidgininfication
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15615
diff
changeset
|
2719 * |
15442 | 2720 */ |
21660
c29f2e3a3b99
Had this laying around. Weeks (months?) ago all the small listers and Hylke agreed that Small list looks better with conversation tab sized icons
Sean Egan <seanegan@gmail.com>
parents:
21659
diff
changeset
|
2721 #define STATUS_SIZE 16 |
15442 | 2722 #define TOOLTIP_BORDER 12 |
2723 #define SMALL_SPACE 6 | |
2724 #define LARGE_SPACE 12 | |
15632
a830f9756f23
Some more pidgininfication
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15615
diff
changeset
|
2725 #define PRPL_SIZE 16 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2726 struct tooltip_data { |
15448 | 2727 PangoLayout *layout; |
15442 | 2728 PangoLayout *name_layout; |
2729 GdkPixbuf *prpl_icon; | |
15448 | 2730 GdkPixbuf *status_icon; |
2731 GdkPixbuf *avatar; | |
2732 gboolean avatar_is_prpl_icon; | |
15442 | 2733 int avatar_width; |
15448 | 2734 int avatar_height; |
15442 | 2735 int name_height; |
2736 int name_width; | |
15448 | 2737 int width; |
2738 int height; | |
23000
d678dbea81a4
Reduce the enormous padding in the group tooltip. People will hopefully dislike it less now.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22976
diff
changeset
|
2739 int padding; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2740 }; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2741 |
21986
0eb3ea7e5784
Show prpl icons in the tooltip for groups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21985
diff
changeset
|
2742 static PangoLayout * create_pango_layout(const char *markup, int *width, int *height) |
0eb3ea7e5784
Show prpl icons in the tooltip for groups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21985
diff
changeset
|
2743 { |
0eb3ea7e5784
Show prpl icons in the tooltip for groups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21985
diff
changeset
|
2744 PangoLayout *layout; |
0eb3ea7e5784
Show prpl icons in the tooltip for groups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21985
diff
changeset
|
2745 int w, h; |
0eb3ea7e5784
Show prpl icons in the tooltip for groups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21985
diff
changeset
|
2746 |
0eb3ea7e5784
Show prpl icons in the tooltip for groups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21985
diff
changeset
|
2747 layout = gtk_widget_create_pango_layout(gtkblist->tipwindow, NULL); |
0eb3ea7e5784
Show prpl icons in the tooltip for groups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21985
diff
changeset
|
2748 pango_layout_set_markup(layout, markup, -1); |
0eb3ea7e5784
Show prpl icons in the tooltip for groups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21985
diff
changeset
|
2749 pango_layout_set_wrap(layout, PANGO_WRAP_WORD); |
0eb3ea7e5784
Show prpl icons in the tooltip for groups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21985
diff
changeset
|
2750 pango_layout_set_width(layout, 300000); |
0eb3ea7e5784
Show prpl icons in the tooltip for groups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21985
diff
changeset
|
2751 |
0eb3ea7e5784
Show prpl icons in the tooltip for groups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21985
diff
changeset
|
2752 pango_layout_get_size (layout, &w, &h); |
0eb3ea7e5784
Show prpl icons in the tooltip for groups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21985
diff
changeset
|
2753 if (width) |
0eb3ea7e5784
Show prpl icons in the tooltip for groups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21985
diff
changeset
|
2754 *width = PANGO_PIXELS(w); |
0eb3ea7e5784
Show prpl icons in the tooltip for groups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21985
diff
changeset
|
2755 if (height) |
0eb3ea7e5784
Show prpl icons in the tooltip for groups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21985
diff
changeset
|
2756 *height = PANGO_PIXELS(h); |
0eb3ea7e5784
Show prpl icons in the tooltip for groups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21985
diff
changeset
|
2757 return layout; |
0eb3ea7e5784
Show prpl icons in the tooltip for groups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21985
diff
changeset
|
2758 } |
0eb3ea7e5784
Show prpl icons in the tooltip for groups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21985
diff
changeset
|
2759 |
0eb3ea7e5784
Show prpl icons in the tooltip for groups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21985
diff
changeset
|
2760 static struct tooltip_data * create_tip_for_account(PurpleAccount *account) |
0eb3ea7e5784
Show prpl icons in the tooltip for groups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21985
diff
changeset
|
2761 { |
0eb3ea7e5784
Show prpl icons in the tooltip for groups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21985
diff
changeset
|
2762 struct tooltip_data *td = g_new0(struct tooltip_data, 1); |
0eb3ea7e5784
Show prpl icons in the tooltip for groups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21985
diff
changeset
|
2763 td->status_icon = pidgin_create_prpl_icon(account, PIDGIN_PRPL_ICON_SMALL); |
0eb3ea7e5784
Show prpl icons in the tooltip for groups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21985
diff
changeset
|
2764 /* Yes, status_icon, not prpl_icon */ |
0eb3ea7e5784
Show prpl icons in the tooltip for groups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21985
diff
changeset
|
2765 if (purple_account_is_disconnected(account)) |
0eb3ea7e5784
Show prpl icons in the tooltip for groups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21985
diff
changeset
|
2766 gdk_pixbuf_saturate_and_pixelate(td->status_icon, td->status_icon, 0.0, FALSE); |
0eb3ea7e5784
Show prpl icons in the tooltip for groups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21985
diff
changeset
|
2767 td->layout = create_pango_layout(purple_account_get_username(account), &td->width, &td->height); |
23000
d678dbea81a4
Reduce the enormous padding in the group tooltip. People will hopefully dislike it less now.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22976
diff
changeset
|
2768 td->padding = SMALL_SPACE; |
21986
0eb3ea7e5784
Show prpl icons in the tooltip for groups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21985
diff
changeset
|
2769 return td; |
0eb3ea7e5784
Show prpl icons in the tooltip for groups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21985
diff
changeset
|
2770 } |
0eb3ea7e5784
Show prpl icons in the tooltip for groups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21985
diff
changeset
|
2771 |
15823 | 2772 static struct tooltip_data * create_tip_for_node(PurpleBlistNode *node, gboolean full) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2773 { |
15448 | 2774 struct tooltip_data *td = g_new0(struct tooltip_data, 1); |
15823 | 2775 PurpleAccount *account = NULL; |
21925
2b6e6dd24a37
Add tooltips to groups in the buddy list. The tooltips show the current online
Etan Reisner <pidgin@unreliablesource.net>
parents:
21912
diff
changeset
|
2776 char *tmp = NULL, *node_name = NULL, *tooltip_text = NULL; |
2b6e6dd24a37
Add tooltips to groups in the buddy list. The tooltips show the current online
Etan Reisner <pidgin@unreliablesource.net>
parents:
21912
diff
changeset
|
2777 |
2b6e6dd24a37
Add tooltips to groups in the buddy list. The tooltips show the current online
Etan Reisner <pidgin@unreliablesource.net>
parents:
21912
diff
changeset
|
2778 if (PURPLE_BLIST_NODE_IS_BUDDY(node)) { |
15823 | 2779 account = ((PurpleBuddy*)(node))->account; |
21925
2b6e6dd24a37
Add tooltips to groups in the buddy list. The tooltips show the current online
Etan Reisner <pidgin@unreliablesource.net>
parents:
21912
diff
changeset
|
2780 } else if (PURPLE_BLIST_NODE_IS_CHAT(node)) { |
15823 | 2781 account = ((PurpleChat*)(node))->account; |
15448 | 2782 } |
2783 | |
23000
d678dbea81a4
Reduce the enormous padding in the group tooltip. People will hopefully dislike it less now.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22976
diff
changeset
|
2784 td->padding = TOOLTIP_BORDER; |
15508
94031a2b0aaa
gtkblist changes to pidgin
Sean Egan <seanegan@gmail.com>
parents:
15507
diff
changeset
|
2785 td->status_icon = pidgin_blist_get_status_icon(node, PIDGIN_STATUS_ICON_LARGE); |
16375
391a79778f89
Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@wiktel.com>
parents:
16275
diff
changeset
|
2786 td->avatar = pidgin_blist_get_buddy_icon(node, !full, FALSE); |
21925
2b6e6dd24a37
Add tooltips to groups in the buddy list. The tooltips show the current online
Etan Reisner <pidgin@unreliablesource.net>
parents:
21912
diff
changeset
|
2787 if (account != NULL) { |
2b6e6dd24a37
Add tooltips to groups in the buddy list. The tooltips show the current online
Etan Reisner <pidgin@unreliablesource.net>
parents:
21912
diff
changeset
|
2788 td->prpl_icon = pidgin_create_prpl_icon(account, PIDGIN_PRPL_ICON_SMALL); |
2b6e6dd24a37
Add tooltips to groups in the buddy list. The tooltips show the current online
Etan Reisner <pidgin@unreliablesource.net>
parents:
21912
diff
changeset
|
2789 } |
15821 | 2790 tooltip_text = pidgin_get_tooltip_text(node, full); |
21986
0eb3ea7e5784
Show prpl icons in the tooltip for groups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21985
diff
changeset
|
2791 if (tooltip_text && *tooltip_text) { |
0eb3ea7e5784
Show prpl icons in the tooltip for groups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21985
diff
changeset
|
2792 td->layout = create_pango_layout(tooltip_text, &td->width, &td->height); |
0eb3ea7e5784
Show prpl icons in the tooltip for groups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21985
diff
changeset
|
2793 } |
15442 | 2794 |
21925
2b6e6dd24a37
Add tooltips to groups in the buddy list. The tooltips show the current online
Etan Reisner <pidgin@unreliablesource.net>
parents:
21912
diff
changeset
|
2795 if (PURPLE_BLIST_NODE_IS_BUDDY(node)) { |
15823 | 2796 tmp = g_markup_escape_text(purple_buddy_get_name((PurpleBuddy*)node), -1); |
21925
2b6e6dd24a37
Add tooltips to groups in the buddy list. The tooltips show the current online
Etan Reisner <pidgin@unreliablesource.net>
parents:
21912
diff
changeset
|
2797 } else if (PURPLE_BLIST_NODE_IS_CHAT(node)) { |
15823 | 2798 tmp = g_markup_escape_text(purple_chat_get_name((PurpleChat*)node), -1); |
21925
2b6e6dd24a37
Add tooltips to groups in the buddy list. The tooltips show the current online
Etan Reisner <pidgin@unreliablesource.net>
parents:
21912
diff
changeset
|
2799 } else if (PURPLE_BLIST_NODE_IS_GROUP(node)) { |
2b6e6dd24a37
Add tooltips to groups in the buddy list. The tooltips show the current online
Etan Reisner <pidgin@unreliablesource.net>
parents:
21912
diff
changeset
|
2800 tmp = g_markup_escape_text(purple_group_get_name((PurpleGroup*)node), -1); |
2b6e6dd24a37
Add tooltips to groups in the buddy list. The tooltips show the current online
Etan Reisner <pidgin@unreliablesource.net>
parents:
21912
diff
changeset
|
2801 } else { |
2b6e6dd24a37
Add tooltips to groups in the buddy list. The tooltips show the current online
Etan Reisner <pidgin@unreliablesource.net>
parents:
21912
diff
changeset
|
2802 /* I don't believe this can happen currently, I think |
2b6e6dd24a37
Add tooltips to groups in the buddy list. The tooltips show the current online
Etan Reisner <pidgin@unreliablesource.net>
parents:
21912
diff
changeset
|
2803 * everything that calls this function checks for one of the |
2b6e6dd24a37
Add tooltips to groups in the buddy list. The tooltips show the current online
Etan Reisner <pidgin@unreliablesource.net>
parents:
21912
diff
changeset
|
2804 * above node types first. */ |
2b6e6dd24a37
Add tooltips to groups in the buddy list. The tooltips show the current online
Etan Reisner <pidgin@unreliablesource.net>
parents:
21912
diff
changeset
|
2805 tmp = g_strdup(_("Unknown node type")); |
2b6e6dd24a37
Add tooltips to groups in the buddy list. The tooltips show the current online
Etan Reisner <pidgin@unreliablesource.net>
parents:
21912
diff
changeset
|
2806 } |
22936
5a359f6666c2
Fix a NULL printf. Fixes #5387.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22789
diff
changeset
|
2807 node_name = g_strdup_printf("<span size='x-large' weight='bold'>%s</span>", |
5a359f6666c2
Fix a NULL printf. Fixes #5387.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22789
diff
changeset
|
2808 tmp ? tmp : ""); |
15921
6a5089fafd19
Fix a small tooltip-related memleak
Mark Doliner <mark@kingant.net>
parents:
15871
diff
changeset
|
2809 g_free(tmp); |
15442 | 2810 |
21986
0eb3ea7e5784
Show prpl icons in the tooltip for groups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21985
diff
changeset
|
2811 td->name_layout = create_pango_layout(node_name, &td->name_width, &td->name_height); |
0eb3ea7e5784
Show prpl icons in the tooltip for groups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21985
diff
changeset
|
2812 td->name_width += SMALL_SPACE + PRPL_SIZE; |
0eb3ea7e5784
Show prpl icons in the tooltip for groups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21985
diff
changeset
|
2813 td->name_height = MAX(td->name_height, PRPL_SIZE + SMALL_SPACE); |
15475 | 2814 #if 0 /* PRPL Icon as avatar */ |
15448 | 2815 if(!td->avatar && full) { |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
2816 td->avatar = pidgin_create_prpl_icon(account, PIDGIN_PRPL_ICON_LARGE); |
15442 | 2817 td->avatar_is_prpl_icon = TRUE; |
2818 } | |
15475 | 2819 #endif |
15708
c50358666110
Fix asserts when there is no buddy icon
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15632
diff
changeset
|
2820 |
c50358666110
Fix asserts when there is no buddy icon
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15632
diff
changeset
|
2821 if (td->avatar) { |
c50358666110
Fix asserts when there is no buddy icon
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15632
diff
changeset
|
2822 td->avatar_width = gdk_pixbuf_get_width(td->avatar); |
c50358666110
Fix asserts when there is no buddy icon
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15632
diff
changeset
|
2823 td->avatar_height = gdk_pixbuf_get_height(td->avatar); |
c50358666110
Fix asserts when there is no buddy icon
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15632
diff
changeset
|
2824 } |
15448 | 2825 |
15489
29e8e230d1b6
A small memory leak in the tooltip.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
15487
diff
changeset
|
2826 g_free(node_name); |
15448 | 2827 g_free(tooltip_text); |
2828 return td; | |
15397
a8ee645e7fb4
A lot of status icon changes:
Sean Egan <seanegan@gmail.com>
parents:
15374
diff
changeset
|
2829 } |
a8ee645e7fb4
A lot of status icon changes:
Sean Egan <seanegan@gmail.com>
parents:
15374
diff
changeset
|
2830 |
21885
f5d961556972
Refactor some of the tooltip drawing functions. And add some pretend docs.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21877
diff
changeset
|
2831 static gboolean |
f5d961556972
Refactor some of the tooltip drawing functions. And add some pretend docs.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21877
diff
changeset
|
2832 pidgin_blist_paint_tip(GtkWidget *widget, gpointer null) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2833 { |
15448 | 2834 GtkStyle *style; |
2835 int current_height, max_width; | |
15481
62a1ebd08b74
fix a weird tooltip rendering bug when the second buddy in a contact tooltip
Nathan Walp <nwalp@pidgin.im>
parents:
15480
diff
changeset
|
2836 int max_text_width; |
15487
5369a4999f1c
fix the display bug a bit smarter
Nathan Walp <nwalp@pidgin.im>
parents:
15486
diff
changeset
|
2837 int max_avatar_width; |
15448 | 2838 GList *l; |
15475 | 2839 int prpl_col = 0; |
21877
6bf73aea6450
Some utility functions for showing tooltips. This is used by the buddylist,
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21781
diff
changeset
|
2840 GtkTextDirection dir = gtk_widget_get_direction(widget); |
21985
035cfd9080a6
Get rid of some wasted empty space in the tooltips for chats and groups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21960
diff
changeset
|
2841 int status_size = 0; |
15632
a830f9756f23
Some more pidgininfication
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15615
diff
changeset
|
2842 |
15448 | 2843 if(gtkblist->tooltipdata == NULL) |
21877
6bf73aea6450
Some utility functions for showing tooltips. This is used by the buddylist,
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21781
diff
changeset
|
2844 return FALSE; |
15448 | 2845 |
2846 style = gtkblist->tipwindow->style; | |
2847 | |
15481
62a1ebd08b74
fix a weird tooltip rendering bug when the second buddy in a contact tooltip
Nathan Walp <nwalp@pidgin.im>
parents:
15480
diff
changeset
|
2848 max_text_width = 0; |
15487
5369a4999f1c
fix the display bug a bit smarter
Nathan Walp <nwalp@pidgin.im>
parents:
15486
diff
changeset
|
2849 max_avatar_width = 0; |
15486
e9a869472b40
really fix that tooltip display glitch
Nathan Walp <nwalp@pidgin.im>
parents:
15485
diff
changeset
|
2850 |
15448 | 2851 for(l = gtkblist->tooltipdata; l; l = l->next) |
2852 { | |
2853 struct tooltip_data *td = l->data; | |
15487
5369a4999f1c
fix the display bug a bit smarter
Nathan Walp <nwalp@pidgin.im>
parents:
15486
diff
changeset
|
2854 |
15481
62a1ebd08b74
fix a weird tooltip rendering bug when the second buddy in a contact tooltip
Nathan Walp <nwalp@pidgin.im>
parents:
15480
diff
changeset
|
2855 max_text_width = MAX(max_text_width, |
62a1ebd08b74
fix a weird tooltip rendering bug when the second buddy in a contact tooltip
Nathan Walp <nwalp@pidgin.im>
parents:
15480
diff
changeset
|
2856 MAX(td->width, td->name_width)); |
15487
5369a4999f1c
fix the display bug a bit smarter
Nathan Walp <nwalp@pidgin.im>
parents:
15486
diff
changeset
|
2857 max_avatar_width = MAX(max_avatar_width, td->avatar_width); |
21985
035cfd9080a6
Get rid of some wasted empty space in the tooltips for chats and groups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21960
diff
changeset
|
2858 if (td->status_icon) |
035cfd9080a6
Get rid of some wasted empty space in the tooltips for chats and groups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21960
diff
changeset
|
2859 status_size = STATUS_SIZE; |
035cfd9080a6
Get rid of some wasted empty space in the tooltips for chats and groups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21960
diff
changeset
|
2860 } |
035cfd9080a6
Get rid of some wasted empty space in the tooltips for chats and groups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21960
diff
changeset
|
2861 |
035cfd9080a6
Get rid of some wasted empty space in the tooltips for chats and groups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21960
diff
changeset
|
2862 max_width = TOOLTIP_BORDER + status_size + SMALL_SPACE + max_text_width + SMALL_SPACE + max_avatar_width + TOOLTIP_BORDER; |
15583 | 2863 if (dir == GTK_TEXT_DIR_RTL) |
2864 prpl_col = TOOLTIP_BORDER + max_avatar_width + SMALL_SPACE; | |
2865 else | |
21985
035cfd9080a6
Get rid of some wasted empty space in the tooltips for chats and groups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21960
diff
changeset
|
2866 prpl_col = TOOLTIP_BORDER + status_size + SMALL_SPACE + max_text_width - PRPL_SIZE; |
15448 | 2867 |
2868 current_height = 12; | |
2869 for(l = gtkblist->tooltipdata; l; l = l->next) | |
2870 { | |
2871 struct tooltip_data *td = l->data; | |
2872 | |
15507 | 2873 if (td->avatar && pidgin_gdk_pixbuf_is_opaque(td->avatar)) |
15586
1dfa6945e13f
Add some braces to eliminate a compiler warning about an ambiguous else.
Richard Laager <rlaager@wiktel.com>
parents:
15583
diff
changeset
|
2874 { |
15583 | 2875 if (dir == GTK_TEXT_DIR_RTL) |
2876 gtk_paint_flat_box(style, gtkblist->tipwindow->window, GTK_STATE_NORMAL, GTK_SHADOW_OUT, | |
2877 NULL, gtkblist->tipwindow, "tooltip", | |
2878 TOOLTIP_BORDER -1, current_height -1, td->avatar_width +2, td->avatar_height + 2); | |
2879 else | |
2880 gtk_paint_flat_box(style, gtkblist->tipwindow->window, GTK_STATE_NORMAL, GTK_SHADOW_OUT, | |
2881 NULL, gtkblist->tipwindow, "tooltip", | |
2882 max_width - (td->avatar_width+ TOOLTIP_BORDER)-1, | |
2883 current_height-1,td->avatar_width+2, td->avatar_height+2); | |
15586
1dfa6945e13f
Add some braces to eliminate a compiler warning about an ambiguous else.
Richard Laager <rlaager@wiktel.com>
parents:
15583
diff
changeset
|
2884 } |
15397
a8ee645e7fb4
A lot of status icon changes:
Sean Egan <seanegan@gmail.com>
parents:
15374
diff
changeset
|
2885 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2886 #if GTK_CHECK_VERSION(2,2,0) |
21925
2b6e6dd24a37
Add tooltips to groups in the buddy list. The tooltips show the current online
Etan Reisner <pidgin@unreliablesource.net>
parents:
21912
diff
changeset
|
2887 if (td->status_icon) { |
2b6e6dd24a37
Add tooltips to groups in the buddy list. The tooltips show the current online
Etan Reisner <pidgin@unreliablesource.net>
parents:
21912
diff
changeset
|
2888 if (dir == GTK_TEXT_DIR_RTL) |
2b6e6dd24a37
Add tooltips to groups in the buddy list. The tooltips show the current online
Etan Reisner <pidgin@unreliablesource.net>
parents:
21912
diff
changeset
|
2889 gdk_draw_pixbuf(GDK_DRAWABLE(gtkblist->tipwindow->window), NULL, td->status_icon, |
21985
035cfd9080a6
Get rid of some wasted empty space in the tooltips for chats and groups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21960
diff
changeset
|
2890 0, 0, max_width - TOOLTIP_BORDER - status_size, current_height, -1, -1, GDK_RGB_DITHER_NONE, 0, 0); |
21925
2b6e6dd24a37
Add tooltips to groups in the buddy list. The tooltips show the current online
Etan Reisner <pidgin@unreliablesource.net>
parents:
21912
diff
changeset
|
2891 else |
2b6e6dd24a37
Add tooltips to groups in the buddy list. The tooltips show the current online
Etan Reisner <pidgin@unreliablesource.net>
parents:
21912
diff
changeset
|
2892 gdk_draw_pixbuf(GDK_DRAWABLE(gtkblist->tipwindow->window), NULL, td->status_icon, |
2b6e6dd24a37
Add tooltips to groups in the buddy list. The tooltips show the current online
Etan Reisner <pidgin@unreliablesource.net>
parents:
21912
diff
changeset
|
2893 0, 0, TOOLTIP_BORDER, current_height, -1 , -1, GDK_RGB_DITHER_NONE, 0, 0); |
2b6e6dd24a37
Add tooltips to groups in the buddy list. The tooltips show the current online
Etan Reisner <pidgin@unreliablesource.net>
parents:
21912
diff
changeset
|
2894 } |
21945
3fc5862b834a
Use the new tooltip functions to draw the tooltips in the conversation window.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21933
diff
changeset
|
2895 |
21925
2b6e6dd24a37
Add tooltips to groups in the buddy list. The tooltips show the current online
Etan Reisner <pidgin@unreliablesource.net>
parents:
21912
diff
changeset
|
2896 if(td->avatar) { |
15583 | 2897 if (dir == GTK_TEXT_DIR_RTL) |
2898 gdk_draw_pixbuf(GDK_DRAWABLE(gtkblist->tipwindow->window), NULL, | |
2899 td->avatar, 0, 0, TOOLTIP_BORDER, current_height, -1, -1, GDK_RGB_DITHER_NONE, 0, 0); | |
2900 else | |
2901 gdk_draw_pixbuf(GDK_DRAWABLE(gtkblist->tipwindow->window), NULL, | |
2902 td->avatar, 0, 0, max_width - (td->avatar_width + TOOLTIP_BORDER), | |
2903 current_height, -1 , -1, GDK_RGB_DITHER_NONE, 0, 0); | |
15586
1dfa6945e13f
Add some braces to eliminate a compiler warning about an ambiguous else.
Richard Laager <rlaager@wiktel.com>
parents:
15583
diff
changeset
|
2904 } |
1dfa6945e13f
Add some braces to eliminate a compiler warning about an ambiguous else.
Richard Laager <rlaager@wiktel.com>
parents:
15583
diff
changeset
|
2905 |
21945
3fc5862b834a
Use the new tooltip functions to draw the tooltips in the conversation window.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21933
diff
changeset
|
2906 if (!td->avatar_is_prpl_icon && td->prpl_icon) |
15442 | 2907 gdk_draw_pixbuf(GDK_DRAWABLE(gtkblist->tipwindow->window), NULL, td->prpl_icon, |
15448 | 2908 0, 0, |
15475 | 2909 prpl_col, |
15442 | 2910 current_height + ((td->name_height / 2) - (PRPL_SIZE / 2)), |
15448 | 2911 -1 , -1, GDK_RGB_DITHER_NONE, 0, 0); |
2912 | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2913 #else |
21925
2b6e6dd24a37
Add tooltips to groups in the buddy list. The tooltips show the current online
Etan Reisner <pidgin@unreliablesource.net>
parents:
21912
diff
changeset
|
2914 if (td->status_icon) { |
2b6e6dd24a37
Add tooltips to groups in the buddy list. The tooltips show the current online
Etan Reisner <pidgin@unreliablesource.net>
parents:
21912
diff
changeset
|
2915 gdk_pixbuf_render_to_drawable(td->status_icon, GDK_DRAWABLE(gtkblist->tipwindow->window), NULL, 0, 0, 12, current_height, -1, -1, GDK_RGB_DITHER_NONE, 0, 0); |
2b6e6dd24a37
Add tooltips to groups in the buddy list. The tooltips show the current online
Etan Reisner <pidgin@unreliablesource.net>
parents:
21912
diff
changeset
|
2916 } |
15448 | 2917 if(td->avatar) |
2918 gdk_pixbuf_render_to_drawable(td->avatar, | |
2919 GDK_DRAWABLE(gtkblist->tipwindow->window), NULL, 0, 0, | |
15486
e9a869472b40
really fix that tooltip display glitch
Nathan Walp <nwalp@pidgin.im>
parents:
15485
diff
changeset
|
2920 max_width - (td->avatar_width + TOOLTIP_BORDER), |
15448 | 2921 current_height, -1, -1, GDK_RGB_DITHER_NONE, 0, 0); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2922 #endif |
21986
0eb3ea7e5784
Show prpl icons in the tooltip for groups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21985
diff
changeset
|
2923 if (td->name_layout) { |
0eb3ea7e5784
Show prpl icons in the tooltip for groups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21985
diff
changeset
|
2924 if (dir == GTK_TEXT_DIR_RTL) { |
0eb3ea7e5784
Show prpl icons in the tooltip for groups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21985
diff
changeset
|
2925 gtk_paint_layout(style, gtkblist->tipwindow->window, GTK_STATE_NORMAL, FALSE, |
0eb3ea7e5784
Show prpl icons in the tooltip for groups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21985
diff
changeset
|
2926 NULL, gtkblist->tipwindow, "tooltip", |
0eb3ea7e5784
Show prpl icons in the tooltip for groups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21985
diff
changeset
|
2927 max_width -(TOOLTIP_BORDER + status_size + SMALL_SPACE) - PANGO_PIXELS(300000), |
0eb3ea7e5784
Show prpl icons in the tooltip for groups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21985
diff
changeset
|
2928 current_height, td->name_layout); |
0eb3ea7e5784
Show prpl icons in the tooltip for groups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21985
diff
changeset
|
2929 } else { |
0eb3ea7e5784
Show prpl icons in the tooltip for groups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21985
diff
changeset
|
2930 gtk_paint_layout (style, gtkblist->tipwindow->window, GTK_STATE_NORMAL, FALSE, |
0eb3ea7e5784
Show prpl icons in the tooltip for groups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21985
diff
changeset
|
2931 NULL, gtkblist->tipwindow, "tooltip", |
0eb3ea7e5784
Show prpl icons in the tooltip for groups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21985
diff
changeset
|
2932 TOOLTIP_BORDER + status_size + SMALL_SPACE, current_height, td->name_layout); |
0eb3ea7e5784
Show prpl icons in the tooltip for groups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21985
diff
changeset
|
2933 } |
15583 | 2934 } |
21985
035cfd9080a6
Get rid of some wasted empty space in the tooltips for chats and groups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21960
diff
changeset
|
2935 |
035cfd9080a6
Get rid of some wasted empty space in the tooltips for chats and groups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21960
diff
changeset
|
2936 if (td->layout) { |
035cfd9080a6
Get rid of some wasted empty space in the tooltips for chats and groups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21960
diff
changeset
|
2937 if (dir != GTK_TEXT_DIR_RTL) { |
035cfd9080a6
Get rid of some wasted empty space in the tooltips for chats and groups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21960
diff
changeset
|
2938 gtk_paint_layout (style, gtkblist->tipwindow->window, GTK_STATE_NORMAL, FALSE, |
035cfd9080a6
Get rid of some wasted empty space in the tooltips for chats and groups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21960
diff
changeset
|
2939 NULL, gtkblist->tipwindow, "tooltip", |
035cfd9080a6
Get rid of some wasted empty space in the tooltips for chats and groups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21960
diff
changeset
|
2940 TOOLTIP_BORDER + status_size + SMALL_SPACE, current_height + td->name_height, td->layout); |
035cfd9080a6
Get rid of some wasted empty space in the tooltips for chats and groups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21960
diff
changeset
|
2941 } else { |
035cfd9080a6
Get rid of some wasted empty space in the tooltips for chats and groups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21960
diff
changeset
|
2942 gtk_paint_layout(style, gtkblist->tipwindow->window, GTK_STATE_NORMAL, FALSE, |
035cfd9080a6
Get rid of some wasted empty space in the tooltips for chats and groups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21960
diff
changeset
|
2943 NULL, gtkblist->tipwindow, "tooltip", |
035cfd9080a6
Get rid of some wasted empty space in the tooltips for chats and groups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21960
diff
changeset
|
2944 max_width - (TOOLTIP_BORDER + status_size + SMALL_SPACE) - PANGO_PIXELS(300000), |
035cfd9080a6
Get rid of some wasted empty space in the tooltips for chats and groups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21960
diff
changeset
|
2945 current_height + td->name_height, |
035cfd9080a6
Get rid of some wasted empty space in the tooltips for chats and groups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21960
diff
changeset
|
2946 td->layout); |
035cfd9080a6
Get rid of some wasted empty space in the tooltips for chats and groups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21960
diff
changeset
|
2947 } |
15583 | 2948 } |
15480
5551adcf8f97
fix overlapping in tooltips w/ large avatars
Nathan Walp <nwalp@pidgin.im>
parents:
15475
diff
changeset
|
2949 |
23000
d678dbea81a4
Reduce the enormous padding in the group tooltip. People will hopefully dislike it less now.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22976
diff
changeset
|
2950 current_height += MAX(td->name_height + td->height, td->avatar_height) + td->padding; |
15448 | 2951 } |
21877
6bf73aea6450
Some utility functions for showing tooltips. This is used by the buddylist,
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21781
diff
changeset
|
2952 return FALSE; |
6bf73aea6450
Some utility functions for showing tooltips. This is used by the buddylist,
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21781
diff
changeset
|
2953 } |
6bf73aea6450
Some utility functions for showing tooltips. This is used by the buddylist,
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21781
diff
changeset
|
2954 |
6bf73aea6450
Some utility functions for showing tooltips. This is used by the buddylist,
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21781
diff
changeset
|
2955 static void |
22007
c38d72677c8a
Probe for -Wstrict-prototypes to get some more warnings. I then cleaned up
Richard Laager <rlaager@wiktel.com>
parents:
21960
diff
changeset
|
2956 pidgin_blist_destroy_tooltip_data(void) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2957 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2958 while(gtkblist->tooltipdata) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2959 struct tooltip_data *td = gtkblist->tooltipdata->data; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2960 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2961 if(td->avatar) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2962 g_object_unref(td->avatar); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2963 if(td->status_icon) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2964 g_object_unref(td->status_icon); |
15442 | 2965 if(td->prpl_icon) |
2966 g_object_unref(td->prpl_icon); | |
21985
035cfd9080a6
Get rid of some wasted empty space in the tooltips for chats and groups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21960
diff
changeset
|
2967 if (td->layout) |
035cfd9080a6
Get rid of some wasted empty space in the tooltips for chats and groups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21960
diff
changeset
|
2968 g_object_unref(td->layout); |
21986
0eb3ea7e5784
Show prpl icons in the tooltip for groups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21985
diff
changeset
|
2969 if (td->name_layout) |
0eb3ea7e5784
Show prpl icons in the tooltip for groups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21985
diff
changeset
|
2970 g_object_unref(td->name_layout); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2971 g_free(td); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2972 gtkblist->tooltipdata = g_list_delete_link(gtkblist->tooltipdata, gtkblist->tooltipdata); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2973 } |
21877
6bf73aea6450
Some utility functions for showing tooltips. This is used by the buddylist,
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21781
diff
changeset
|
2974 } |
6bf73aea6450
Some utility functions for showing tooltips. This is used by the buddylist,
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21781
diff
changeset
|
2975 |
6bf73aea6450
Some utility functions for showing tooltips. This is used by the buddylist,
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21781
diff
changeset
|
2976 void pidgin_blist_tooltip_destroy() |
6bf73aea6450
Some utility functions for showing tooltips. This is used by the buddylist,
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21781
diff
changeset
|
2977 { |
6bf73aea6450
Some utility functions for showing tooltips. This is used by the buddylist,
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21781
diff
changeset
|
2978 pidgin_blist_destroy_tooltip_data(); |
6bf73aea6450
Some utility functions for showing tooltips. This is used by the buddylist,
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21781
diff
changeset
|
2979 pidgin_tooltip_destroy(); |
6bf73aea6450
Some utility functions for showing tooltips. This is used by the buddylist,
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21781
diff
changeset
|
2980 } |
6bf73aea6450
Some utility functions for showing tooltips. This is used by the buddylist,
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21781
diff
changeset
|
2981 |
24412
558523cebd10
A patch from db42 to fix right-to-left text in tooltips.
Richard Laager <rlaager@wiktel.com>
parents:
24357
diff
changeset
|
2982 static void |
558523cebd10
A patch from db42 to fix right-to-left text in tooltips.
Richard Laager <rlaager@wiktel.com>
parents:
24357
diff
changeset
|
2983 pidgin_blist_align_tooltip(struct tooltip_data *td, GtkWidget *widget) |
558523cebd10
A patch from db42 to fix right-to-left text in tooltips.
Richard Laager <rlaager@wiktel.com>
parents:
24357
diff
changeset
|
2984 { |
558523cebd10
A patch from db42 to fix right-to-left text in tooltips.
Richard Laager <rlaager@wiktel.com>
parents:
24357
diff
changeset
|
2985 GtkTextDirection dir = gtk_widget_get_direction(widget); |
558523cebd10
A patch from db42 to fix right-to-left text in tooltips.
Richard Laager <rlaager@wiktel.com>
parents:
24357
diff
changeset
|
2986 |
558523cebd10
A patch from db42 to fix right-to-left text in tooltips.
Richard Laager <rlaager@wiktel.com>
parents:
24357
diff
changeset
|
2987 if (dir == GTK_TEXT_DIR_RTL) |
558523cebd10
A patch from db42 to fix right-to-left text in tooltips.
Richard Laager <rlaager@wiktel.com>
parents:
24357
diff
changeset
|
2988 { |
558523cebd10
A patch from db42 to fix right-to-left text in tooltips.
Richard Laager <rlaager@wiktel.com>
parents:
24357
diff
changeset
|
2989 char* layout_name = purple_markup_strip_html(pango_layout_get_text(td->name_layout)); |
558523cebd10
A patch from db42 to fix right-to-left text in tooltips.
Richard Laager <rlaager@wiktel.com>
parents:
24357
diff
changeset
|
2990 PangoDirection dir = pango_find_base_dir(layout_name, -1); |
558523cebd10
A patch from db42 to fix right-to-left text in tooltips.
Richard Laager <rlaager@wiktel.com>
parents:
24357
diff
changeset
|
2991 if (dir == PANGO_DIRECTION_RTL || dir == PANGO_DIRECTION_NEUTRAL) |
558523cebd10
A patch from db42 to fix right-to-left text in tooltips.
Richard Laager <rlaager@wiktel.com>
parents:
24357
diff
changeset
|
2992 pango_layout_set_alignment(td->name_layout, PANGO_ALIGN_RIGHT); |
558523cebd10
A patch from db42 to fix right-to-left text in tooltips.
Richard Laager <rlaager@wiktel.com>
parents:
24357
diff
changeset
|
2993 g_free(layout_name); |
558523cebd10
A patch from db42 to fix right-to-left text in tooltips.
Richard Laager <rlaager@wiktel.com>
parents:
24357
diff
changeset
|
2994 pango_layout_set_alignment(td->layout, PANGO_ALIGN_RIGHT); |
558523cebd10
A patch from db42 to fix right-to-left text in tooltips.
Richard Laager <rlaager@wiktel.com>
parents:
24357
diff
changeset
|
2995 } |
558523cebd10
A patch from db42 to fix right-to-left text in tooltips.
Richard Laager <rlaager@wiktel.com>
parents:
24357
diff
changeset
|
2996 } |
558523cebd10
A patch from db42 to fix right-to-left text in tooltips.
Richard Laager <rlaager@wiktel.com>
parents:
24357
diff
changeset
|
2997 |
21877
6bf73aea6450
Some utility functions for showing tooltips. This is used by the buddylist,
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21781
diff
changeset
|
2998 static gboolean |
6bf73aea6450
Some utility functions for showing tooltips. This is used by the buddylist,
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21781
diff
changeset
|
2999 pidgin_blist_create_tooltip_for_node(GtkWidget *widget, gpointer data, int *w, int *h) |
6bf73aea6450
Some utility functions for showing tooltips. This is used by the buddylist,
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21781
diff
changeset
|
3000 { |
6bf73aea6450
Some utility functions for showing tooltips. This is used by the buddylist,
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21781
diff
changeset
|
3001 PurpleBlistNode *node = data; |
6bf73aea6450
Some utility functions for showing tooltips. This is used by the buddylist,
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21781
diff
changeset
|
3002 int width, height; |
21986
0eb3ea7e5784
Show prpl icons in the tooltip for groups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21985
diff
changeset
|
3003 GList *list; |
0eb3ea7e5784
Show prpl icons in the tooltip for groups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21985
diff
changeset
|
3004 int max_text_width = 0; |
0eb3ea7e5784
Show prpl icons in the tooltip for groups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21985
diff
changeset
|
3005 int max_avatar_width = 0; |
0eb3ea7e5784
Show prpl icons in the tooltip for groups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21985
diff
changeset
|
3006 int status_size = 0; |
21877
6bf73aea6450
Some utility functions for showing tooltips. This is used by the buddylist,
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21781
diff
changeset
|
3007 |
21945
3fc5862b834a
Use the new tooltip functions to draw the tooltips in the conversation window.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21933
diff
changeset
|
3008 if (gtkblist->tooltipdata) { |
3fc5862b834a
Use the new tooltip functions to draw the tooltips in the conversation window.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21933
diff
changeset
|
3009 gtkblist->tipwindow = NULL; |
3fc5862b834a
Use the new tooltip functions to draw the tooltips in the conversation window.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21933
diff
changeset
|
3010 pidgin_blist_destroy_tooltip_data(); |
3fc5862b834a
Use the new tooltip functions to draw the tooltips in the conversation window.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21933
diff
changeset
|
3011 } |
3fc5862b834a
Use the new tooltip functions to draw the tooltips in the conversation window.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21933
diff
changeset
|
3012 |
21877
6bf73aea6450
Some utility functions for showing tooltips. This is used by the buddylist,
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21781
diff
changeset
|
3013 gtkblist->tipwindow = widget; |
21986
0eb3ea7e5784
Show prpl icons in the tooltip for groups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21985
diff
changeset
|
3014 if (PURPLE_BLIST_NODE_IS_CHAT(node) || |
0eb3ea7e5784
Show prpl icons in the tooltip for groups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21985
diff
changeset
|
3015 PURPLE_BLIST_NODE_IS_BUDDY(node)) { |
0eb3ea7e5784
Show prpl icons in the tooltip for groups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21985
diff
changeset
|
3016 struct tooltip_data *td = create_tip_for_node(node, TRUE); |
24412
558523cebd10
A patch from db42 to fix right-to-left text in tooltips.
Richard Laager <rlaager@wiktel.com>
parents:
24357
diff
changeset
|
3017 pidgin_blist_align_tooltip(td, gtkblist->tipwindow); |
21986
0eb3ea7e5784
Show prpl icons in the tooltip for groups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21985
diff
changeset
|
3018 gtkblist->tooltipdata = g_list_append(gtkblist->tooltipdata, td); |
0eb3ea7e5784
Show prpl icons in the tooltip for groups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21985
diff
changeset
|
3019 } else if (PURPLE_BLIST_NODE_IS_GROUP(node)) { |
0eb3ea7e5784
Show prpl icons in the tooltip for groups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21985
diff
changeset
|
3020 PurpleGroup *group = (PurpleGroup*)node; |
0eb3ea7e5784
Show prpl icons in the tooltip for groups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21985
diff
changeset
|
3021 GSList *accounts; |
21877
6bf73aea6450
Some utility functions for showing tooltips. This is used by the buddylist,
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21781
diff
changeset
|
3022 struct tooltip_data *td = create_tip_for_node(node, TRUE); |
24412
558523cebd10
A patch from db42 to fix right-to-left text in tooltips.
Richard Laager <rlaager@wiktel.com>
parents:
24357
diff
changeset
|
3023 pidgin_blist_align_tooltip(td, gtkblist->tipwindow); |
21877
6bf73aea6450
Some utility functions for showing tooltips. This is used by the buddylist,
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21781
diff
changeset
|
3024 gtkblist->tooltipdata = g_list_append(gtkblist->tooltipdata, td); |
21986
0eb3ea7e5784
Show prpl icons in the tooltip for groups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21985
diff
changeset
|
3025 |
0eb3ea7e5784
Show prpl icons in the tooltip for groups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21985
diff
changeset
|
3026 /* Accounts with buddies in group */ |
0eb3ea7e5784
Show prpl icons in the tooltip for groups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21985
diff
changeset
|
3027 accounts = purple_group_get_accounts(group); |
0eb3ea7e5784
Show prpl icons in the tooltip for groups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21985
diff
changeset
|
3028 for (; accounts != NULL; |
0eb3ea7e5784
Show prpl icons in the tooltip for groups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21985
diff
changeset
|
3029 accounts = g_slist_delete_link(accounts, accounts)) { |
0eb3ea7e5784
Show prpl icons in the tooltip for groups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21985
diff
changeset
|
3030 PurpleAccount *account = accounts->data; |
0eb3ea7e5784
Show prpl icons in the tooltip for groups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21985
diff
changeset
|
3031 td = create_tip_for_account(account); |
0eb3ea7e5784
Show prpl icons in the tooltip for groups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21985
diff
changeset
|
3032 gtkblist->tooltipdata = g_list_append(gtkblist->tooltipdata, td); |
0eb3ea7e5784
Show prpl icons in the tooltip for groups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21985
diff
changeset
|
3033 } |
0eb3ea7e5784
Show prpl icons in the tooltip for groups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21985
diff
changeset
|
3034 } else if (PURPLE_BLIST_NODE_IS_CONTACT(node)) { |
21877
6bf73aea6450
Some utility functions for showing tooltips. This is used by the buddylist,
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21781
diff
changeset
|
3035 PurpleBlistNode *child; |
6bf73aea6450
Some utility functions for showing tooltips. This is used by the buddylist,
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21781
diff
changeset
|
3036 PurpleBuddy *b = purple_contact_get_priority_buddy((PurpleContact *)node); |
6bf73aea6450
Some utility functions for showing tooltips. This is used by the buddylist,
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21781
diff
changeset
|
3037 width = height = 0; |
6bf73aea6450
Some utility functions for showing tooltips. This is used by the buddylist,
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21781
diff
changeset
|
3038 |
6bf73aea6450
Some utility functions for showing tooltips. This is used by the buddylist,
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21781
diff
changeset
|
3039 for(child = node->child; child; child = child->next) |
6bf73aea6450
Some utility functions for showing tooltips. This is used by the buddylist,
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21781
diff
changeset
|
3040 { |
6bf73aea6450
Some utility functions for showing tooltips. This is used by the buddylist,
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21781
diff
changeset
|
3041 if(PURPLE_BLIST_NODE_IS_BUDDY(child) && buddy_is_displayable((PurpleBuddy*)child)) { |
6bf73aea6450
Some utility functions for showing tooltips. This is used by the buddylist,
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21781
diff
changeset
|
3042 struct tooltip_data *td = create_tip_for_node(child, (b == (PurpleBuddy*)child)); |
24412
558523cebd10
A patch from db42 to fix right-to-left text in tooltips.
Richard Laager <rlaager@wiktel.com>
parents:
24357
diff
changeset
|
3043 pidgin_blist_align_tooltip(td, gtkblist->tipwindow); |
21877
6bf73aea6450
Some utility functions for showing tooltips. This is used by the buddylist,
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21781
diff
changeset
|
3044 if (b == (PurpleBuddy *)child) { |
6bf73aea6450
Some utility functions for showing tooltips. This is used by the buddylist,
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21781
diff
changeset
|
3045 gtkblist->tooltipdata = g_list_prepend(gtkblist->tooltipdata, td); |
6bf73aea6450
Some utility functions for showing tooltips. This is used by the buddylist,
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21781
diff
changeset
|
3046 } else { |
6bf73aea6450
Some utility functions for showing tooltips. This is used by the buddylist,
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21781
diff
changeset
|
3047 gtkblist->tooltipdata = g_list_append(gtkblist->tooltipdata, td); |
6bf73aea6450
Some utility functions for showing tooltips. This is used by the buddylist,
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21781
diff
changeset
|
3048 } |
6bf73aea6450
Some utility functions for showing tooltips. This is used by the buddylist,
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21781
diff
changeset
|
3049 } |
6bf73aea6450
Some utility functions for showing tooltips. This is used by the buddylist,
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21781
diff
changeset
|
3050 } |
6bf73aea6450
Some utility functions for showing tooltips. This is used by the buddylist,
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21781
diff
changeset
|
3051 } else { |
6bf73aea6450
Some utility functions for showing tooltips. This is used by the buddylist,
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21781
diff
changeset
|
3052 return FALSE; |
6bf73aea6450
Some utility functions for showing tooltips. This is used by the buddylist,
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21781
diff
changeset
|
3053 } |
6bf73aea6450
Some utility functions for showing tooltips. This is used by the buddylist,
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21781
diff
changeset
|
3054 |
21986
0eb3ea7e5784
Show prpl icons in the tooltip for groups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21985
diff
changeset
|
3055 height = width = 0; |
0eb3ea7e5784
Show prpl icons in the tooltip for groups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21985
diff
changeset
|
3056 for (list = gtkblist->tooltipdata; list; list = list->next) { |
0eb3ea7e5784
Show prpl icons in the tooltip for groups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21985
diff
changeset
|
3057 struct tooltip_data *td = list->data; |
0eb3ea7e5784
Show prpl icons in the tooltip for groups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21985
diff
changeset
|
3058 max_text_width = MAX(max_text_width, MAX(td->width, td->name_width)); |
0eb3ea7e5784
Show prpl icons in the tooltip for groups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21985
diff
changeset
|
3059 max_avatar_width = MAX(max_avatar_width, td->avatar_width); |
23000
d678dbea81a4
Reduce the enormous padding in the group tooltip. People will hopefully dislike it less now.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22976
diff
changeset
|
3060 height += MAX(MAX(STATUS_SIZE, td->avatar_height), td->height + td->name_height) + td->padding; |
21986
0eb3ea7e5784
Show prpl icons in the tooltip for groups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21985
diff
changeset
|
3061 if (td->status_icon) |
0eb3ea7e5784
Show prpl icons in the tooltip for groups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21985
diff
changeset
|
3062 status_size = MAX(status_size, STATUS_SIZE); |
0eb3ea7e5784
Show prpl icons in the tooltip for groups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21985
diff
changeset
|
3063 } |
0eb3ea7e5784
Show prpl icons in the tooltip for groups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21985
diff
changeset
|
3064 height += TOOLTIP_BORDER; |
0eb3ea7e5784
Show prpl icons in the tooltip for groups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21985
diff
changeset
|
3065 width = TOOLTIP_BORDER + status_size + SMALL_SPACE + max_text_width + SMALL_SPACE + max_avatar_width + TOOLTIP_BORDER; |
0eb3ea7e5784
Show prpl icons in the tooltip for groups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21985
diff
changeset
|
3066 |
21877
6bf73aea6450
Some utility functions for showing tooltips. This is used by the buddylist,
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21781
diff
changeset
|
3067 if (w) |
6bf73aea6450
Some utility functions for showing tooltips. This is used by the buddylist,
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21781
diff
changeset
|
3068 *w = width; |
6bf73aea6450
Some utility functions for showing tooltips. This is used by the buddylist,
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21781
diff
changeset
|
3069 if (h) |
6bf73aea6450
Some utility functions for showing tooltips. This is used by the buddylist,
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21781
diff
changeset
|
3070 *h = height; |
6bf73aea6450
Some utility functions for showing tooltips. This is used by the buddylist,
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21781
diff
changeset
|
3071 |
6bf73aea6450
Some utility functions for showing tooltips. This is used by the buddylist,
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21781
diff
changeset
|
3072 return TRUE; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3073 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3074 |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
3075 static gboolean pidgin_blist_expand_timeout(GtkWidget *tv) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3076 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3077 GtkTreePath *path; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3078 GtkTreeIter iter; |
15823 | 3079 PurpleBlistNode *node; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3080 GValue val; |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
3081 struct _pidgin_blist_node *gtknode; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3082 |
19363
0d31b54d885a
Calculate what buddy we're pointing at from the middle of the cell rather than the age. Fixes #1422
Sean Egan <seanegan@gmail.com>
parents:
19234
diff
changeset
|
3083 if (!gtk_tree_view_get_path_at_pos(GTK_TREE_VIEW(tv), gtkblist->tip_rect.x, gtkblist->tip_rect.y + (gtkblist->tip_rect.height/2), |
0d31b54d885a
Calculate what buddy we're pointing at from the middle of the cell rather than the age. Fixes #1422
Sean Egan <seanegan@gmail.com>
parents:
19234
diff
changeset
|
3084 &path, NULL, NULL, NULL)) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3085 return FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3086 gtk_tree_model_get_iter(GTK_TREE_MODEL(gtkblist->treemodel), &iter, path); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3087 val.g_type = 0; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3088 gtk_tree_model_get_value (GTK_TREE_MODEL(gtkblist->treemodel), &iter, NODE_COLUMN, &val); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3089 node = g_value_get_pointer(&val); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3090 |
15823 | 3091 if(!PURPLE_BLIST_NODE_IS_CONTACT(node)) { |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3092 gtk_tree_path_free(path); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3093 return FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3094 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3095 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3096 gtknode = node->ui_data; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3097 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3098 if (!gtknode->contact_expanded) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3099 GtkTreeIter i; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3100 |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
3101 pidgin_blist_expand_contact_cb(NULL, node); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3102 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3103 gtk_tree_view_get_cell_area(GTK_TREE_VIEW(tv), path, NULL, >kblist->contact_rect); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3104 gdk_drawable_get_size(GDK_DRAWABLE(tv->window), &(gtkblist->contact_rect.width), NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3105 gtkblist->mouseover_contact = node; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3106 gtk_tree_path_down (path); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3107 while (gtk_tree_model_get_iter(GTK_TREE_MODEL(gtkblist->treemodel), &i, path)) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3108 GdkRectangle rect; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3109 gtk_tree_view_get_cell_area(GTK_TREE_VIEW(tv), path, NULL, &rect); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3110 gtkblist->contact_rect.height += rect.height; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3111 gtk_tree_path_next(path); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3112 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3113 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3114 gtk_tree_path_free(path); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3115 return FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3116 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3117 |
15823 | 3118 static gboolean buddy_is_displayable(PurpleBuddy *buddy) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3119 { |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
3120 struct _pidgin_blist_node *gtknode; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3121 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3122 if(!buddy) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3123 return FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3124 |
15823 | 3125 gtknode = ((PurpleBlistNode*)buddy)->ui_data; |
3126 | |
3127 return (purple_account_is_connected(buddy->account) && | |
3128 (purple_presence_is_online(buddy->presence) || | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3129 (gtknode && gtknode->recent_signonoff) || |
16062
07554cc5d090
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <stu@nosnilmot.com>
parents:
16010
diff
changeset
|
3130 purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/blist/show_offline_buddies") || |
15823 | 3131 purple_blist_node_get_bool((PurpleBlistNode*)buddy, "show_offline"))); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3132 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3133 |
18671 | 3134 void pidgin_blist_draw_tooltip(PurpleBlistNode *node, GtkWidget *widget) |
3135 { | |
21877
6bf73aea6450
Some utility functions for showing tooltips. This is used by the buddylist,
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21781
diff
changeset
|
3136 pidgin_tooltip_show(widget, node, pidgin_blist_create_tooltip_for_node, pidgin_blist_paint_tip); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3137 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3138 |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
3139 static gboolean pidgin_blist_drag_motion_cb(GtkWidget *tv, GdkDragContext *drag_context, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3140 gint x, gint y, guint time, gpointer user_data) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3141 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3142 GtkTreePath *path; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3143 int delay; |
17487
4b711c5c2db8
Only auto-expand buddies when the mouse is hovering over the middle third of the buddy. This prevents un-intended expanding of buddies when you're only trying to re-order. Fixes #608
Sean Egan <seanegan@gmail.com>
parents:
17433
diff
changeset
|
3144 GdkRectangle rect; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3145 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3146 /* |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3147 * When dragging a buddy into a contact, this is the delay before |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3148 * the contact auto-expands. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3149 */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3150 delay = 900; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3151 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3152 if (gtkblist->drag_timeout) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3153 if ((y > gtkblist->tip_rect.y) && ((y - gtkblist->tip_rect.height) < gtkblist->tip_rect.y)) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3154 return FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3155 /* We've left the cell. Remove the timeout and create a new one below */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3156 g_source_remove(gtkblist->drag_timeout); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3157 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3158 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3159 gtk_tree_view_get_path_at_pos(GTK_TREE_VIEW(tv), x, y, &path, NULL, NULL, NULL); |
17487
4b711c5c2db8
Only auto-expand buddies when the mouse is hovering over the middle third of the buddy. This prevents un-intended expanding of buddies when you're only trying to re-order. Fixes #608
Sean Egan <seanegan@gmail.com>
parents:
17433
diff
changeset
|
3160 gtk_tree_view_get_cell_area(GTK_TREE_VIEW(tv), path, NULL, &rect); |
4b711c5c2db8
Only auto-expand buddies when the mouse is hovering over the middle third of the buddy. This prevents un-intended expanding of buddies when you're only trying to re-order. Fixes #608
Sean Egan <seanegan@gmail.com>
parents:
17433
diff
changeset
|
3161 |
22313
42724bd41274
Plug some leaks caused by GtkTreePaths not being freed.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22299
diff
changeset
|
3162 if (path) |
42724bd41274
Plug some leaks caused by GtkTreePaths not being freed.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22299
diff
changeset
|
3163 gtk_tree_path_free(path); |
42724bd41274
Plug some leaks caused by GtkTreePaths not being freed.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22299
diff
changeset
|
3164 |
17487
4b711c5c2db8
Only auto-expand buddies when the mouse is hovering over the middle third of the buddy. This prevents un-intended expanding of buddies when you're only trying to re-order. Fixes #608
Sean Egan <seanegan@gmail.com>
parents:
17433
diff
changeset
|
3165 /* Only autoexpand when in the middle of the cell to avoid annoying un-intended expands */ |
4b711c5c2db8
Only auto-expand buddies when the mouse is hovering over the middle third of the buddy. This prevents un-intended expanding of buddies when you're only trying to re-order. Fixes #608
Sean Egan <seanegan@gmail.com>
parents:
17433
diff
changeset
|
3166 if (y < rect.y + (rect.height / 3) || |
4b711c5c2db8
Only auto-expand buddies when the mouse is hovering over the middle third of the buddy. This prevents un-intended expanding of buddies when you're only trying to re-order. Fixes #608
Sean Egan <seanegan@gmail.com>
parents:
17433
diff
changeset
|
3167 y > rect.y + (2 * (rect.height /3))) |
4b711c5c2db8
Only auto-expand buddies when the mouse is hovering over the middle third of the buddy. This prevents un-intended expanding of buddies when you're only trying to re-order. Fixes #608
Sean Egan <seanegan@gmail.com>
parents:
17433
diff
changeset
|
3168 return FALSE; |
4b711c5c2db8
Only auto-expand buddies when the mouse is hovering over the middle third of the buddy. This prevents un-intended expanding of buddies when you're only trying to re-order. Fixes #608
Sean Egan <seanegan@gmail.com>
parents:
17433
diff
changeset
|
3169 |
4b711c5c2db8
Only auto-expand buddies when the mouse is hovering over the middle third of the buddy. This prevents un-intended expanding of buddies when you're only trying to re-order. Fixes #608
Sean Egan <seanegan@gmail.com>
parents:
17433
diff
changeset
|
3170 rect.height = rect.height / 3; |
4b711c5c2db8
Only auto-expand buddies when the mouse is hovering over the middle third of the buddy. This prevents un-intended expanding of buddies when you're only trying to re-order. Fixes #608
Sean Egan <seanegan@gmail.com>
parents:
17433
diff
changeset
|
3171 rect.y += rect.height; |
4b711c5c2db8
Only auto-expand buddies when the mouse is hovering over the middle third of the buddy. This prevents un-intended expanding of buddies when you're only trying to re-order. Fixes #608
Sean Egan <seanegan@gmail.com>
parents:
17433
diff
changeset
|
3172 |
4b711c5c2db8
Only auto-expand buddies when the mouse is hovering over the middle third of the buddy. This prevents un-intended expanding of buddies when you're only trying to re-order. Fixes #608
Sean Egan <seanegan@gmail.com>
parents:
17433
diff
changeset
|
3173 gtkblist->tip_rect = rect; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3174 |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
3175 gtkblist->drag_timeout = g_timeout_add(delay, (GSourceFunc)pidgin_blist_expand_timeout, tv); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3176 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3177 if (gtkblist->mouseover_contact) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3178 if ((y < gtkblist->contact_rect.y) || ((y - gtkblist->contact_rect.height) > gtkblist->contact_rect.y)) { |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
3179 pidgin_blist_collapse_contact_cb(NULL, gtkblist->mouseover_contact); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3180 gtkblist->mouseover_contact = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3181 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3182 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3183 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3184 return FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3185 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3186 |
21877
6bf73aea6450
Some utility functions for showing tooltips. This is used by the buddylist,
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21781
diff
changeset
|
3187 static gboolean |
6bf73aea6450
Some utility functions for showing tooltips. This is used by the buddylist,
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21781
diff
changeset
|
3188 pidgin_blist_create_tooltip(GtkWidget *widget, GtkTreePath *path, |
6bf73aea6450
Some utility functions for showing tooltips. This is used by the buddylist,
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21781
diff
changeset
|
3189 gpointer null, int *w, int *h) |
6bf73aea6450
Some utility functions for showing tooltips. This is used by the buddylist,
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21781
diff
changeset
|
3190 { |
6bf73aea6450
Some utility functions for showing tooltips. This is used by the buddylist,
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21781
diff
changeset
|
3191 GtkTreeIter iter; |
6bf73aea6450
Some utility functions for showing tooltips. This is used by the buddylist,
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21781
diff
changeset
|
3192 PurpleBlistNode *node; |
6bf73aea6450
Some utility functions for showing tooltips. This is used by the buddylist,
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21781
diff
changeset
|
3193 GValue val; |
6bf73aea6450
Some utility functions for showing tooltips. This is used by the buddylist,
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21781
diff
changeset
|
3194 gboolean editable = FALSE; |
6bf73aea6450
Some utility functions for showing tooltips. This is used by the buddylist,
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21781
diff
changeset
|
3195 |
6bf73aea6450
Some utility functions for showing tooltips. This is used by the buddylist,
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21781
diff
changeset
|
3196 /* If we're editing a cell (e.g. alias editing), don't show the tooltip */ |
6bf73aea6450
Some utility functions for showing tooltips. This is used by the buddylist,
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21781
diff
changeset
|
3197 g_object_get(G_OBJECT(gtkblist->text_rend), "editable", &editable, NULL); |
6bf73aea6450
Some utility functions for showing tooltips. This is used by the buddylist,
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21781
diff
changeset
|
3198 if (editable) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3199 return FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3200 |
21877
6bf73aea6450
Some utility functions for showing tooltips. This is used by the buddylist,
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21781
diff
changeset
|
3201 if (gtkblist->tooltipdata) { |
6bf73aea6450
Some utility functions for showing tooltips. This is used by the buddylist,
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21781
diff
changeset
|
3202 gtkblist->tipwindow = NULL; |
6bf73aea6450
Some utility functions for showing tooltips. This is used by the buddylist,
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21781
diff
changeset
|
3203 pidgin_blist_destroy_tooltip_data(); |
6bf73aea6450
Some utility functions for showing tooltips. This is used by the buddylist,
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21781
diff
changeset
|
3204 } |
6bf73aea6450
Some utility functions for showing tooltips. This is used by the buddylist,
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21781
diff
changeset
|
3205 |
6bf73aea6450
Some utility functions for showing tooltips. This is used by the buddylist,
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21781
diff
changeset
|
3206 gtk_tree_model_get_iter(GTK_TREE_MODEL(gtkblist->treemodel), &iter, path); |
6bf73aea6450
Some utility functions for showing tooltips. This is used by the buddylist,
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21781
diff
changeset
|
3207 val.g_type = 0; |
6bf73aea6450
Some utility functions for showing tooltips. This is used by the buddylist,
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21781
diff
changeset
|
3208 gtk_tree_model_get_value (GTK_TREE_MODEL(gtkblist->treemodel), &iter, NODE_COLUMN, &val); |
6bf73aea6450
Some utility functions for showing tooltips. This is used by the buddylist,
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21781
diff
changeset
|
3209 node = g_value_get_pointer(&val); |
6bf73aea6450
Some utility functions for showing tooltips. This is used by the buddylist,
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21781
diff
changeset
|
3210 return pidgin_blist_create_tooltip_for_node(widget, node, w, h); |
6bf73aea6450
Some utility functions for showing tooltips. This is used by the buddylist,
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21781
diff
changeset
|
3211 } |
6bf73aea6450
Some utility functions for showing tooltips. This is used by the buddylist,
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21781
diff
changeset
|
3212 |
6bf73aea6450
Some utility functions for showing tooltips. This is used by the buddylist,
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21781
diff
changeset
|
3213 static gboolean pidgin_blist_motion_cb (GtkWidget *tv, GdkEventMotion *event, gpointer null) |
6bf73aea6450
Some utility functions for showing tooltips. This is used by the buddylist,
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21781
diff
changeset
|
3214 { |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3215 if (gtkblist->mouseover_contact) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3216 if ((event->y < gtkblist->contact_rect.y) || ((event->y - gtkblist->contact_rect.height) > gtkblist->contact_rect.y)) { |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
3217 pidgin_blist_collapse_contact_cb(NULL, gtkblist->mouseover_contact); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3218 gtkblist->mouseover_contact = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3219 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3220 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3221 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3222 return FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3223 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3224 |
21912
6765b2b65d30
The event handlers need to return a gboolean. Using void callbacks can lead to unpredictable behaviour.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21890
diff
changeset
|
3225 static gboolean pidgin_blist_leave_cb (GtkWidget *w, GdkEventCrossing *e, gpointer n) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3226 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3227 if (gtkblist->timeout) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3228 g_source_remove(gtkblist->timeout); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3229 gtkblist->timeout = 0; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3230 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3231 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3232 if (gtkblist->drag_timeout) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3233 g_source_remove(gtkblist->drag_timeout); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3234 gtkblist->drag_timeout = 0; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3235 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3236 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3237 if (gtkblist->mouseover_contact && |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3238 !((e->x > gtkblist->contact_rect.x) && (e->x < (gtkblist->contact_rect.x + gtkblist->contact_rect.width)) && |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3239 (e->y > gtkblist->contact_rect.y) && (e->y < (gtkblist->contact_rect.y + gtkblist->contact_rect.height)))) { |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
3240 pidgin_blist_collapse_contact_cb(NULL, gtkblist->mouseover_contact); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3241 gtkblist->mouseover_contact = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3242 } |
21912
6765b2b65d30
The event handlers need to return a gboolean. Using void callbacks can lead to unpredictable behaviour.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21890
diff
changeset
|
3243 return FALSE; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3244 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3245 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3246 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3247 toggle_debug(void) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3248 { |
16062
07554cc5d090
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <stu@nosnilmot.com>
parents:
16010
diff
changeset
|
3249 purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/debug/enabled", |
07554cc5d090
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <stu@nosnilmot.com>
parents:
16010
diff
changeset
|
3250 !purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/debug/enabled")); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3251 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3252 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3253 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3254 /*************************************************** |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3255 * Crap * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3256 ***************************************************/ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3257 static GtkItemFactoryEntry blist_menu[] = |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3258 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3259 /* Buddies menu */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3260 { N_("/_Buddies"), NULL, NULL, 0, "<Branch>", NULL }, |
16202
0973688f4b74
Word on the street is that we don't want things named pidginfoo_bar(), but
Richard Laager <rlaager@wiktel.com>
parents:
16198
diff
changeset
|
3261 { N_("/Buddies/New Instant _Message..."), "<CTL>M", pidgin_dialogs_im, 0, "<StockItem>", PIDGIN_STOCK_TOOLBAR_MESSAGE_NEW }, |
23183
373616d2e552
A simple patch from "bsd" to get the icon back for Buddies->Join a Chat.
Richard Laager <rlaager@wiktel.com>
parents:
23177
diff
changeset
|
3262 { N_("/Buddies/Join a _Chat..."), "<CTL>C", pidgin_blist_joinchat_show, 0, "<StockItem>", PIDGIN_STOCK_CHAT }, |
16202
0973688f4b74
Word on the street is that we don't want things named pidginfoo_bar(), but
Richard Laager <rlaager@wiktel.com>
parents:
16198
diff
changeset
|
3263 { N_("/Buddies/Get User _Info..."), "<CTL>I", pidgin_dialogs_info, 0, "<StockItem>", PIDGIN_STOCK_TOOLBAR_USER_INFO }, |
0973688f4b74
Word on the street is that we don't want things named pidginfoo_bar(), but
Richard Laager <rlaager@wiktel.com>
parents:
16198
diff
changeset
|
3264 { N_("/Buddies/View User _Log..."), "<CTL>L", pidgin_dialogs_log, 0, "<Item>", NULL }, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3265 { "/Buddies/sep1", NULL, NULL, 0, "<Separator>", NULL }, |
20795
93674777d32f
Add an accelerator for 'Buddies -> Show'. Fixes #3298.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
20793
diff
changeset
|
3266 { N_("/Buddies/Sh_ow"), NULL, NULL, 0, "<Branch>", NULL}, |
19608
0bf089a22f61
(2007-09-03 07:57:30) rlaager: In the buddy list, we now have a Show submenu with a bunch of Show X items under it. It seems to me that the Show on each item is redundant and should be removed. This would be consistent with the Sort Buddies menu, where the items finish the sentence fragment started by the submenu name.
Richard Laager <rlaager@wiktel.com>
parents:
19569
diff
changeset
|
3267 { N_("/Buddies/Show/_Offline Buddies"), NULL, pidgin_blist_edit_mode_cb, 1, "<CheckItem>", NULL }, |
0bf089a22f61
(2007-09-03 07:57:30) rlaager: In the buddy list, we now have a Show submenu with a bunch of Show X items under it. It seems to me that the Show on each item is redundant and should be removed. This would be consistent with the Sort Buddies menu, where the items finish the sentence fragment started by the submenu name.
Richard Laager <rlaager@wiktel.com>
parents:
19569
diff
changeset
|
3268 { N_("/Buddies/Show/_Empty Groups"), NULL, pidgin_blist_show_empty_groups_cb, 1, "<CheckItem>", NULL }, |
0bf089a22f61
(2007-09-03 07:57:30) rlaager: In the buddy list, we now have a Show submenu with a bunch of Show X items under it. It seems to me that the Show on each item is redundant and should be removed. This would be consistent with the Sort Buddies menu, where the items finish the sentence fragment started by the submenu name.
Richard Laager <rlaager@wiktel.com>
parents:
19569
diff
changeset
|
3269 { N_("/Buddies/Show/Buddy _Details"), NULL, pidgin_blist_buddy_details_cb, 1, "<CheckItem>", NULL }, |
0bf089a22f61
(2007-09-03 07:57:30) rlaager: In the buddy list, we now have a Show submenu with a bunch of Show X items under it. It seems to me that the Show on each item is redundant and should be removed. This would be consistent with the Sort Buddies menu, where the items finish the sentence fragment started by the submenu name.
Richard Laager <rlaager@wiktel.com>
parents:
19569
diff
changeset
|
3270 { N_("/Buddies/Show/Idle _Times"), NULL, pidgin_blist_show_idle_time_cb, 1, "<CheckItem>", NULL }, |
0bf089a22f61
(2007-09-03 07:57:30) rlaager: In the buddy list, we now have a Show submenu with a bunch of Show X items under it. It seems to me that the Show on each item is redundant and should be removed. This would be consistent with the Sort Buddies menu, where the items finish the sentence fragment started by the submenu name.
Richard Laager <rlaager@wiktel.com>
parents:
19569
diff
changeset
|
3271 { N_("/Buddies/Show/_Protocol Icons"), NULL, pidgin_blist_show_protocol_icons_cb, 1, "<CheckItem>", NULL }, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3272 { N_("/Buddies/_Sort Buddies"), NULL, NULL, 0, "<Branch>", NULL }, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3273 { "/Buddies/sep2", NULL, NULL, 0, "<Separator>", NULL }, |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
3274 { N_("/Buddies/_Add Buddy..."), "<CTL>B", pidgin_blist_add_buddy_cb, 0, "<StockItem>", GTK_STOCK_ADD }, |
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
3275 { N_("/Buddies/Add C_hat..."), NULL, pidgin_blist_add_chat_cb, 0, "<StockItem>", GTK_STOCK_ADD }, |
15823 | 3276 { N_("/Buddies/Add _Group..."), NULL, purple_blist_request_add_group, 0, "<StockItem>", GTK_STOCK_ADD }, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3277 { "/Buddies/sep3", NULL, NULL, 0, "<Separator>", NULL }, |
15823 | 3278 { N_("/Buddies/_Quit"), "<CTL>Q", purple_core_quit, 0, "<StockItem>", GTK_STOCK_QUIT }, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3279 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3280 /* Accounts menu */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3281 { N_("/_Accounts"), NULL, NULL, 0, "<Branch>", NULL }, |
23309
99b4470a763e
Change "Manage" to "Manage Accounts" in the Accounts menu.
Richard Laager <rlaager@wiktel.com>
parents:
23282
diff
changeset
|
3282 { N_("/Accounts/Manage Accounts"), "<CTL>A", pidgin_accounts_window_show, 0, "<Item>", NULL }, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3283 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3284 /* Tools */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3285 { N_("/_Tools"), NULL, NULL, 0, "<Branch>", NULL }, |
21560
665e04562de0
This merge has the effect of reverting the hinting code from trunk.
Richard Laager <rlaager@wiktel.com>
diff
changeset
|
3286 { N_("/Tools/Buddy _Pounces"), NULL, pidgin_pounces_manager_show, 1, "<Item>", NULL }, |
19015
720c61141f4b
- Add a skeleton for the Pidgin Certificate Manager and include it in
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18435
diff
changeset
|
3287 { N_("/Tools/_Certificates"), NULL, pidgin_certmgr_show, 0, "<Item>", NULL }, |
21560
665e04562de0
This merge has the effect of reverting the hinting code from trunk.
Richard Laager <rlaager@wiktel.com>
diff
changeset
|
3288 { N_("/Tools/Plu_gins"), "<CTL>U", pidgin_plugin_dialog_show, 2, "<StockItem>", PIDGIN_STOCK_TOOLBAR_PLUGINS }, |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
3289 { N_("/Tools/Pr_eferences"), "<CTL>P", pidgin_prefs_show, 0, "<StockItem>", GTK_STOCK_PREFERENCES }, |
15553
29a03d2d2395
Remove excess menu item icon clutter, especialy where our icons made no sense. The Redo icon for Buddy Pounces?! Come on.
Sean Egan <seanegan@gmail.com>
parents:
15545
diff
changeset
|
3290 { N_("/Tools/Pr_ivacy"), NULL, pidgin_privacy_dialog_show, 0, "<Item>", NULL }, |
23346
e96502c0262e
Moved "Enable Account" to the top with "Manage Accounts", and always put a
Ka-Hing Cheung <khc@hxbc.us>
parents:
23326
diff
changeset
|
3291 { N_("/Tools/Smile_y"), "<CTL>Y", pidgin_smiley_manager_show, 0, "<StockItem>", PIDGIN_STOCK_TOOLBAR_SMILEY }, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3292 { "/Tools/sep2", NULL, NULL, 0, "<Separator>", NULL }, |
23282
62b5d52c3d66
Update File Transfer icon and use new send fie icon. Fixes #2744.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
23183
diff
changeset
|
3293 { N_("/Tools/_File Transfers"), "<CTL>T", pidgin_xfer_dialog_show, 0, "<StockItem>", PIDGIN_STOCK_TOOLBAR_TRANSFER }, |
15553
29a03d2d2395
Remove excess menu item icon clutter, especialy where our icons made no sense. The Redo icon for Buddy Pounces?! Come on.
Sean Egan <seanegan@gmail.com>
parents:
15545
diff
changeset
|
3294 { N_("/Tools/R_oom List"), NULL, pidgin_roomlist_dialog_show, 0, "<Item>", NULL }, |
21560
665e04562de0
This merge has the effect of reverting the hinting code from trunk.
Richard Laager <rlaager@wiktel.com>
diff
changeset
|
3295 { N_("/Tools/System _Log"), NULL, gtk_blist_show_systemlog_cb, 3, "<Item>", NULL }, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3296 { "/Tools/sep3", NULL, NULL, 0, "<Separator>", NULL }, |
23965
0b41ff5ebd96
take out default mute key binding
Ka-Hing Cheung <khc@hxbc.us>
parents:
23925
diff
changeset
|
3297 { N_("/Tools/Mute _Sounds"), NULL, pidgin_blist_mute_sounds_cb, 0, "<CheckItem>", NULL }, |
17432
0bbc08d41234
disapproval of revision '1fd9445b933f2f5ff2724778f9d18e47282745cd'
Stu Tomlinson <stu@nosnilmot.com>
parents:
17431
diff
changeset
|
3298 /* Help */ |
0bbc08d41234
disapproval of revision '1fd9445b933f2f5ff2724778f9d18e47282745cd'
Stu Tomlinson <stu@nosnilmot.com>
parents:
17431
diff
changeset
|
3299 { N_("/_Help"), NULL, NULL, 0, "<Branch>", NULL }, |
0bbc08d41234
disapproval of revision '1fd9445b933f2f5ff2724778f9d18e47282745cd'
Stu Tomlinson <stu@nosnilmot.com>
parents:
17431
diff
changeset
|
3300 { N_("/Help/Online _Help"), "F1", gtk_blist_show_onlinehelp_cb, 0, "<StockItem>", GTK_STOCK_HELP }, |
0bbc08d41234
disapproval of revision '1fd9445b933f2f5ff2724778f9d18e47282745cd'
Stu Tomlinson <stu@nosnilmot.com>
parents:
17431
diff
changeset
|
3301 { N_("/Help/_Debug Window"), NULL, toggle_debug, 0, "<Item>", NULL }, |
20586
04590d9db8b7
Clear out the mail notifications for an account when we receive a notification of 0 emails.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20546
diff
changeset
|
3302 #if GTK_CHECK_VERSION(2,6,0) |
21560
665e04562de0
This merge has the effect of reverting the hinting code from trunk.
Richard Laager <rlaager@wiktel.com>
diff
changeset
|
3303 { N_("/Help/_About"), NULL, pidgin_dialogs_about, 4, "<StockItem>", GTK_STOCK_ABOUT }, |
18402
238086459dc4
propagate from branch 'im.pidgin.pidgin' (head 98416e917a1165a4df7eb5839840348ff4c17bf2)
Richard Laager <rlaager@wiktel.com>
diff
changeset
|
3304 #else |
21560
665e04562de0
This merge has the effect of reverting the hinting code from trunk.
Richard Laager <rlaager@wiktel.com>
diff
changeset
|
3305 { N_("/Help/_About"), NULL, pidgin_dialogs_about, 4, "<Item>", NULL }, |
18402
238086459dc4
propagate from branch 'im.pidgin.pidgin' (head 98416e917a1165a4df7eb5839840348ff4c17bf2)
Richard Laager <rlaager@wiktel.com>
diff
changeset
|
3306 #endif |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3307 }; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3308 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3309 /********************************************************* |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3310 * Private Utility functions * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3311 *********************************************************/ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3312 |
15823 | 3313 static char *pidgin_get_tooltip_text(PurpleBlistNode *node, gboolean full) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3314 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3315 GString *str = g_string_new(""); |
15823 | 3316 PurplePlugin *prpl; |
3317 PurplePluginProtocolInfo *prpl_info = NULL; | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3318 char *tmp; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3319 |
15823 | 3320 if (PURPLE_BLIST_NODE_IS_CHAT(node)) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3321 { |
15823 | 3322 PurpleChat *chat; |
24497
f10aba5592c6
The other day while struct hiding, I noticed a for loop that was checking
Richard Laager <rlaager@wiktel.com>
parents:
24412
diff
changeset
|
3323 GList *connections; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3324 GList *cur; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3325 struct proto_chat_entry *pce; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3326 char *name, *value; |
22437
8802eddbfedc
Fix Topic in chat node tooltips, and turn on using the transient chat node
Stu Tomlinson <stu@nosnilmot.com>
parents:
22436
diff
changeset
|
3327 PurpleConversation *conv; |
21771
3303c02a46f5
Show the topic of a chat, when available, in the tooltip.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21757
diff
changeset
|
3328 PidginBlistNode *bnode = node->ui_data; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3329 |
15823 | 3330 chat = (PurpleChat *)node; |
3331 prpl = purple_find_prpl(purple_account_get_protocol_id(chat->account)); | |
3332 prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(prpl); | |
3333 | |
24497
f10aba5592c6
The other day while struct hiding, I noticed a for loop that was checking
Richard Laager <rlaager@wiktel.com>
parents:
24412
diff
changeset
|
3334 connections = purple_connections_get_all(); |
f10aba5592c6
The other day while struct hiding, I noticed a for loop that was checking
Richard Laager <rlaager@wiktel.com>
parents:
24412
diff
changeset
|
3335 if (connections && connections->next) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3336 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3337 tmp = g_markup_escape_text(chat->account->username, -1); |
21986
0eb3ea7e5784
Show prpl icons in the tooltip for groups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21985
diff
changeset
|
3338 g_string_append_printf(str, _("<b>Account:</b> %s"), tmp); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3339 g_free(tmp); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3340 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3341 |
22437
8802eddbfedc
Fix Topic in chat node tooltips, and turn on using the transient chat node
Stu Tomlinson <stu@nosnilmot.com>
parents:
22436
diff
changeset
|
3342 if (bnode && bnode->conv.conv) { |
8802eddbfedc
Fix Topic in chat node tooltips, and turn on using the transient chat node
Stu Tomlinson <stu@nosnilmot.com>
parents:
22436
diff
changeset
|
3343 conv = bnode->conv.conv; |
8802eddbfedc
Fix Topic in chat node tooltips, and turn on using the transient chat node
Stu Tomlinson <stu@nosnilmot.com>
parents:
22436
diff
changeset
|
3344 } else { |
22450 | 3345 char *chat_name; |
22437
8802eddbfedc
Fix Topic in chat node tooltips, and turn on using the transient chat node
Stu Tomlinson <stu@nosnilmot.com>
parents:
22436
diff
changeset
|
3346 if (prpl_info && prpl_info->get_chat_name) |
8802eddbfedc
Fix Topic in chat node tooltips, and turn on using the transient chat node
Stu Tomlinson <stu@nosnilmot.com>
parents:
22436
diff
changeset
|
3347 chat_name = prpl_info->get_chat_name(chat->components); |
8802eddbfedc
Fix Topic in chat node tooltips, and turn on using the transient chat node
Stu Tomlinson <stu@nosnilmot.com>
parents:
22436
diff
changeset
|
3348 else |
22450 | 3349 chat_name = g_strdup(purple_chat_get_name(chat)); |
22437
8802eddbfedc
Fix Topic in chat node tooltips, and turn on using the transient chat node
Stu Tomlinson <stu@nosnilmot.com>
parents:
22436
diff
changeset
|
3350 |
8802eddbfedc
Fix Topic in chat node tooltips, and turn on using the transient chat node
Stu Tomlinson <stu@nosnilmot.com>
parents:
22436
diff
changeset
|
3351 conv = purple_find_conversation_with_account(PURPLE_CONV_TYPE_CHAT, chat_name, |
8802eddbfedc
Fix Topic in chat node tooltips, and turn on using the transient chat node
Stu Tomlinson <stu@nosnilmot.com>
parents:
22436
diff
changeset
|
3352 chat->account); |
22450 | 3353 g_free(chat_name); |
22437
8802eddbfedc
Fix Topic in chat node tooltips, and turn on using the transient chat node
Stu Tomlinson <stu@nosnilmot.com>
parents:
22436
diff
changeset
|
3354 } |
22594
3bf963b9c715
Add number of occupants to the tooltip for chats. Fixes #3346
Stu Tomlinson <stu@nosnilmot.com>
parents:
22510
diff
changeset
|
3355 |
3bf963b9c715
Add number of occupants to the tooltip for chats. Fixes #3346
Stu Tomlinson <stu@nosnilmot.com>
parents:
22510
diff
changeset
|
3356 if (conv && !purple_conv_chat_has_left(PURPLE_CONV_CHAT(conv))) { |
3bf963b9c715
Add number of occupants to the tooltip for chats. Fixes #3346
Stu Tomlinson <stu@nosnilmot.com>
parents:
22510
diff
changeset
|
3357 g_string_append_printf(str, _("\n<b>Occupants:</b> %d"), |
3bf963b9c715
Add number of occupants to the tooltip for chats. Fixes #3346
Stu Tomlinson <stu@nosnilmot.com>
parents:
22510
diff
changeset
|
3358 g_list_length(purple_conv_chat_get_users(PURPLE_CONV_CHAT(conv)))); |
3bf963b9c715
Add number of occupants to the tooltip for chats. Fixes #3346
Stu Tomlinson <stu@nosnilmot.com>
parents:
22510
diff
changeset
|
3359 |
3bf963b9c715
Add number of occupants to the tooltip for chats. Fixes #3346
Stu Tomlinson <stu@nosnilmot.com>
parents:
22510
diff
changeset
|
3360 if (prpl_info && (prpl_info->options & OPT_PROTO_CHAT_TOPIC)) { |
23177
4d8dced30fa2
Don't try to escape a NULL text. This gets rid of a runtime warning.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23166
diff
changeset
|
3361 const char *chattopic = purple_conv_chat_get_topic(PURPLE_CONV_CHAT(conv)); |
4d8dced30fa2
Don't try to escape a NULL text. This gets rid of a runtime warning.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23166
diff
changeset
|
3362 char *topic = chattopic ? g_markup_escape_text(chattopic, -1) : NULL; |
22594
3bf963b9c715
Add number of occupants to the tooltip for chats. Fixes #3346
Stu Tomlinson <stu@nosnilmot.com>
parents:
22510
diff
changeset
|
3363 g_string_append_printf(str, _("\n<b>Topic:</b> %s"), topic ? topic : _("(no topic set)")); |
3bf963b9c715
Add number of occupants to the tooltip for chats. Fixes #3346
Stu Tomlinson <stu@nosnilmot.com>
parents:
22510
diff
changeset
|
3364 g_free(topic); |
3bf963b9c715
Add number of occupants to the tooltip for chats. Fixes #3346
Stu Tomlinson <stu@nosnilmot.com>
parents:
22510
diff
changeset
|
3365 } |
21771
3303c02a46f5
Show the topic of a chat, when available, in the tooltip.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21757
diff
changeset
|
3366 } |
3303c02a46f5
Show the topic of a chat, when available, in the tooltip.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21757
diff
changeset
|
3367 |
24357 | 3368 if (prpl_info && prpl_info->chat_info != NULL) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3369 cur = prpl_info->chat_info(chat->account->gc); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3370 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3371 cur = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3372 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3373 while (cur != NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3374 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3375 pce = cur->data; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3376 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3377 if (!pce->secret && (!pce->required && |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3378 g_hash_table_lookup(chat->components, pce->identifier) == NULL)) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3379 { |
15823 | 3380 tmp = purple_text_strip_mnemonic(pce->label); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3381 name = g_markup_escape_text(tmp, -1); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3382 g_free(tmp); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3383 value = g_markup_escape_text(g_hash_table_lookup( |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3384 chat->components, pce->identifier), -1); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3385 g_string_append_printf(str, "\n<b>%s</b> %s", |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3386 name ? name : "", |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3387 value ? value : ""); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3388 g_free(name); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3389 g_free(value); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3390 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3391 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3392 g_free(pce); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3393 cur = g_list_remove(cur, pce); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3394 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3395 } |
15823 | 3396 else if (PURPLE_BLIST_NODE_IS_CONTACT(node) || PURPLE_BLIST_NODE_IS_BUDDY(node)) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3397 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3398 /* NOTE: THIS FUNCTION IS NO LONGER CALLED FOR CONTACTS. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3399 * It is only called by create_tip_for_node(), and create_tip_for_node() is never called for a contact. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3400 */ |
15823 | 3401 PurpleContact *c; |
3402 PurpleBuddy *b; | |
3403 PurplePresence *presence; | |
3404 PurpleNotifyUserInfo *user_info; | |
24497
f10aba5592c6
The other day while struct hiding, I noticed a for loop that was checking
Richard Laager <rlaager@wiktel.com>
parents:
24412
diff
changeset
|
3405 GList *connections; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3406 char *tmp; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3407 time_t idle_secs, signon; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3408 |
15823 | 3409 if (PURPLE_BLIST_NODE_IS_CONTACT(node)) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3410 { |
15823 | 3411 c = (PurpleContact *)node; |
3412 b = purple_contact_get_priority_buddy(c); | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3413 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3414 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3415 { |
15823 | 3416 b = (PurpleBuddy *)node; |
3417 c = purple_buddy_get_contact(b); | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3418 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3419 |
15823 | 3420 prpl = purple_find_prpl(purple_account_get_protocol_id(b->account)); |
3421 prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(prpl); | |
3422 | |
3423 presence = purple_buddy_get_presence(b); | |
3424 user_info = purple_notify_user_info_new(); | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3425 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3426 /* Account */ |
24497
f10aba5592c6
The other day while struct hiding, I noticed a for loop that was checking
Richard Laager <rlaager@wiktel.com>
parents:
24412
diff
changeset
|
3427 connections = purple_connections_get_all(); |
f10aba5592c6
The other day while struct hiding, I noticed a for loop that was checking
Richard Laager <rlaager@wiktel.com>
parents:
24412
diff
changeset
|
3428 if (full && connections && connections->next) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3429 { |
15823 | 3430 tmp = g_markup_escape_text(purple_account_get_username( |
3431 purple_buddy_get_account(b)), -1); | |
3432 purple_notify_user_info_add_pair(user_info, _("Account"), tmp); | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3433 g_free(tmp); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3434 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3435 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3436 /* Alias */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3437 /* If there's not a contact alias, the node is being displayed with |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3438 * this alias, so there's no point in showing it in the tooltip. */ |
21781
6a287408bc54
Make sure we are still in the chat, and the chat can have a topic, when showing the topic in the tooltip.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21772
diff
changeset
|
3439 if (full && c && b->alias != NULL && b->alias[0] != '\0' && |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3440 (c->alias != NULL && c->alias[0] != '\0') && |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3441 strcmp(c->alias, b->alias) != 0) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3442 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3443 tmp = g_markup_escape_text(b->alias, -1); |
15823 | 3444 purple_notify_user_info_add_pair(user_info, _("Buddy Alias"), tmp); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3445 g_free(tmp); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3446 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3447 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3448 /* Nickname/Server Alias */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3449 /* I'd like to only show this if there's a contact or buddy |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3450 * alias, but many people on MSN set long nicknames, which |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3451 * get ellipsized, so the only way to see the whole thing is |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3452 * to look at the tooltip. */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3453 if (full && b->server_alias != NULL && b->server_alias[0] != '\0') |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3454 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3455 tmp = g_markup_escape_text(b->server_alias, -1); |
15823 | 3456 purple_notify_user_info_add_pair(user_info, _("Nickname"), tmp); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3457 g_free(tmp); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3458 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3459 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3460 /* Logged In */ |
15823 | 3461 signon = purple_presence_get_login_time(presence); |
3462 if (full && PURPLE_BUDDY_IS_ONLINE(b) && signon > 0) | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3463 { |
18241
83ea1733979b
This is a less dumb way to make sure we don't wrap
Mark Doliner <mark@kingant.net>
parents:
18217
diff
changeset
|
3464 if (signon > time(NULL)) { |
17834
18b62b0fc253
Get outta my house. This adds a failsafe for the "Logged In"
Mark Doliner <mark@kingant.net>
parents:
17789
diff
changeset
|
3465 /* |
18241
83ea1733979b
This is a less dumb way to make sure we don't wrap
Mark Doliner <mark@kingant.net>
parents:
18217
diff
changeset
|
3466 * They signed on in the future?! Our local clock |
83ea1733979b
This is a less dumb way to make sure we don't wrap
Mark Doliner <mark@kingant.net>
parents:
18217
diff
changeset
|
3467 * must be wrong, show the actual date instead of |
83ea1733979b
This is a less dumb way to make sure we don't wrap
Mark Doliner <mark@kingant.net>
parents:
18217
diff
changeset
|
3468 * "4 days", etc. |
17834
18b62b0fc253
Get outta my house. This adds a failsafe for the "Logged In"
Mark Doliner <mark@kingant.net>
parents:
17789
diff
changeset
|
3469 */ |
18b62b0fc253
Get outta my house. This adds a failsafe for the "Logged In"
Mark Doliner <mark@kingant.net>
parents:
17789
diff
changeset
|
3470 tmp = g_strdup(purple_date_format_long(localtime(&signon))); |
18b62b0fc253
Get outta my house. This adds a failsafe for the "Logged In"
Mark Doliner <mark@kingant.net>
parents:
17789
diff
changeset
|
3471 } else |
18b62b0fc253
Get outta my house. This adds a failsafe for the "Logged In"
Mark Doliner <mark@kingant.net>
parents:
17789
diff
changeset
|
3472 tmp = purple_str_seconds_to_string(time(NULL) - signon); |
15823 | 3473 purple_notify_user_info_add_pair(user_info, _("Logged In"), tmp); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3474 g_free(tmp); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3475 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3476 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3477 /* Idle */ |
15823 | 3478 if (purple_presence_is_idle(presence)) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3479 { |
15823 | 3480 idle_secs = purple_presence_get_idle_time(presence); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3481 if (idle_secs > 0) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3482 { |
15823 | 3483 tmp = purple_str_seconds_to_string(time(NULL) - idle_secs); |
3484 purple_notify_user_info_add_pair(user_info, _("Idle"), tmp); | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3485 g_free(tmp); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3486 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3487 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3488 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3489 /* Last Seen */ |
21781
6a287408bc54
Make sure we are still in the chat, and the chat can have a topic, when showing the topic in the tooltip.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21772
diff
changeset
|
3490 if (full && c && !PURPLE_BUDDY_IS_ONLINE(b)) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3491 { |
15823 | 3492 struct _pidgin_blist_node *gtknode = ((PurpleBlistNode *)c)->ui_data; |
3493 PurpleBlistNode *bnode; | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3494 int lastseen = 0; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3495 |
21781
6a287408bc54
Make sure we are still in the chat, and the chat can have a topic, when showing the topic in the tooltip.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21772
diff
changeset
|
3496 if (gtknode && (!gtknode->contact_expanded || PURPLE_BLIST_NODE_IS_CONTACT(node))) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3497 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3498 /* We're either looking at a buddy for a collapsed contact or |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3499 * an expanded contact itself so we show the most recent |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3500 * (largest) last_seen time for any of the buddies under |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3501 * the contact. */ |
15823 | 3502 for (bnode = ((PurpleBlistNode *)c)->child ; bnode != NULL ; bnode = bnode->next) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3503 { |
15823 | 3504 int value = purple_blist_node_get_int(bnode, "last_seen"); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3505 if (value > lastseen) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3506 lastseen = value; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3507 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3508 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3509 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3510 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3511 /* We're dealing with a buddy under an expanded contact, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3512 * so we show the last_seen time for the buddy. */ |
15823 | 3513 lastseen = purple_blist_node_get_int(&b->node, "last_seen"); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3514 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3515 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3516 if (lastseen > 0) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3517 { |
15823 | 3518 tmp = purple_str_seconds_to_string(time(NULL) - lastseen); |
3519 purple_notify_user_info_add_pair(user_info, _("Last Seen"), tmp); | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3520 g_free(tmp); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3521 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3522 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3523 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3524 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3525 /* Offline? */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3526 /* FIXME: Why is this status special-cased by the core? -- rlaager */ |
15823 | 3527 if (!PURPLE_BUDDY_IS_ONLINE(b)) { |
3528 purple_notify_user_info_add_pair(user_info, _("Status"), _("Offline")); | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3529 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3530 |
19635
1481ea6bb805
Do not bother the prpl about a tooltip for a disconnected account.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19611
diff
changeset
|
3531 if (purple_account_is_connected(b->account) && |
1481ea6bb805
Do not bother the prpl about a tooltip for a disconnected account.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19611
diff
changeset
|
3532 prpl_info && prpl_info->tooltip_text) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3533 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3534 /* Additional text from the PRPL */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3535 prpl_info->tooltip_text(b, user_info, full); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3536 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3537 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3538 /* These are Easter Eggs. Patches to remove them will be rejected. */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3539 if (!g_ascii_strcasecmp(b->name, "robflynn")) |
15823 | 3540 purple_notify_user_info_add_pair(user_info, _("Description"), _("Spooky")); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3541 if (!g_ascii_strcasecmp(b->name, "seanegn")) |
15823 | 3542 purple_notify_user_info_add_pair(user_info, _("Status"), _("Awesome")); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3543 if (!g_ascii_strcasecmp(b->name, "chipx86")) |
15823 | 3544 purple_notify_user_info_add_pair(user_info, _("Status"), _("Rockin'")); |
3545 | |
3546 tmp = purple_notify_user_info_get_text_with_newline(user_info, "\n"); | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3547 g_string_append(str, tmp); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3548 g_free(tmp); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3549 |
15823 | 3550 purple_notify_user_info_destroy(user_info); |
21925
2b6e6dd24a37
Add tooltips to groups in the buddy list. The tooltips show the current online
Etan Reisner <pidgin@unreliablesource.net>
parents:
21912
diff
changeset
|
3551 } else if (PURPLE_BLIST_NODE_IS_GROUP(node)) { |
22507
2f7b42cc612c
Change up the Add Budy dialog a little bit, this hopefully makes it a bit
Etan Reisner <pidgin@unreliablesource.net>
parents:
22313
diff
changeset
|
3552 gint count; |
21925
2b6e6dd24a37
Add tooltips to groups in the buddy list. The tooltips show the current online
Etan Reisner <pidgin@unreliablesource.net>
parents:
21912
diff
changeset
|
3553 PurpleGroup *group = (PurpleGroup*)node; |
2b6e6dd24a37
Add tooltips to groups in the buddy list. The tooltips show the current online
Etan Reisner <pidgin@unreliablesource.net>
parents:
21912
diff
changeset
|
3554 PurpleNotifyUserInfo *user_info; |
2b6e6dd24a37
Add tooltips to groups in the buddy list. The tooltips show the current online
Etan Reisner <pidgin@unreliablesource.net>
parents:
21912
diff
changeset
|
3555 |
2b6e6dd24a37
Add tooltips to groups in the buddy list. The tooltips show the current online
Etan Reisner <pidgin@unreliablesource.net>
parents:
21912
diff
changeset
|
3556 user_info = purple_notify_user_info_new(); |
2b6e6dd24a37
Add tooltips to groups in the buddy list. The tooltips show the current online
Etan Reisner <pidgin@unreliablesource.net>
parents:
21912
diff
changeset
|
3557 |
22507
2f7b42cc612c
Change up the Add Budy dialog a little bit, this hopefully makes it a bit
Etan Reisner <pidgin@unreliablesource.net>
parents:
22313
diff
changeset
|
3558 count = purple_blist_get_group_online_count(group); |
2f7b42cc612c
Change up the Add Budy dialog a little bit, this hopefully makes it a bit
Etan Reisner <pidgin@unreliablesource.net>
parents:
22313
diff
changeset
|
3559 |
2f7b42cc612c
Change up the Add Budy dialog a little bit, this hopefully makes it a bit
Etan Reisner <pidgin@unreliablesource.net>
parents:
22313
diff
changeset
|
3560 if (count != 0) { |
2f7b42cc612c
Change up the Add Budy dialog a little bit, this hopefully makes it a bit
Etan Reisner <pidgin@unreliablesource.net>
parents:
22313
diff
changeset
|
3561 /* Online buddies in group */ |
2f7b42cc612c
Change up the Add Budy dialog a little bit, this hopefully makes it a bit
Etan Reisner <pidgin@unreliablesource.net>
parents:
22313
diff
changeset
|
3562 tmp = g_strdup_printf("%d", count); |
2f7b42cc612c
Change up the Add Budy dialog a little bit, this hopefully makes it a bit
Etan Reisner <pidgin@unreliablesource.net>
parents:
22313
diff
changeset
|
3563 purple_notify_user_info_add_pair(user_info, |
2f7b42cc612c
Change up the Add Budy dialog a little bit, this hopefully makes it a bit
Etan Reisner <pidgin@unreliablesource.net>
parents:
22313
diff
changeset
|
3564 _("Online Buddies"), |
2f7b42cc612c
Change up the Add Budy dialog a little bit, this hopefully makes it a bit
Etan Reisner <pidgin@unreliablesource.net>
parents:
22313
diff
changeset
|
3565 tmp); |
2f7b42cc612c
Change up the Add Budy dialog a little bit, this hopefully makes it a bit
Etan Reisner <pidgin@unreliablesource.net>
parents:
22313
diff
changeset
|
3566 g_free(tmp); |
2f7b42cc612c
Change up the Add Budy dialog a little bit, this hopefully makes it a bit
Etan Reisner <pidgin@unreliablesource.net>
parents:
22313
diff
changeset
|
3567 } |
2f7b42cc612c
Change up the Add Budy dialog a little bit, this hopefully makes it a bit
Etan Reisner <pidgin@unreliablesource.net>
parents:
22313
diff
changeset
|
3568 count = 0; |
2f7b42cc612c
Change up the Add Budy dialog a little bit, this hopefully makes it a bit
Etan Reisner <pidgin@unreliablesource.net>
parents:
22313
diff
changeset
|
3569 |
2f7b42cc612c
Change up the Add Budy dialog a little bit, this hopefully makes it a bit
Etan Reisner <pidgin@unreliablesource.net>
parents:
22313
diff
changeset
|
3570 count = purple_blist_get_group_size(group, FALSE); |
2f7b42cc612c
Change up the Add Budy dialog a little bit, this hopefully makes it a bit
Etan Reisner <pidgin@unreliablesource.net>
parents:
22313
diff
changeset
|
3571 if (count != 0) { |
2f7b42cc612c
Change up the Add Budy dialog a little bit, this hopefully makes it a bit
Etan Reisner <pidgin@unreliablesource.net>
parents:
22313
diff
changeset
|
3572 /* Total buddies (from online accounts) in group */ |
2f7b42cc612c
Change up the Add Budy dialog a little bit, this hopefully makes it a bit
Etan Reisner <pidgin@unreliablesource.net>
parents:
22313
diff
changeset
|
3573 tmp = g_strdup_printf("%d", count); |
2f7b42cc612c
Change up the Add Budy dialog a little bit, this hopefully makes it a bit
Etan Reisner <pidgin@unreliablesource.net>
parents:
22313
diff
changeset
|
3574 purple_notify_user_info_add_pair(user_info, |
2f7b42cc612c
Change up the Add Budy dialog a little bit, this hopefully makes it a bit
Etan Reisner <pidgin@unreliablesource.net>
parents:
22313
diff
changeset
|
3575 _("Total Buddies"), |
2f7b42cc612c
Change up the Add Budy dialog a little bit, this hopefully makes it a bit
Etan Reisner <pidgin@unreliablesource.net>
parents:
22313
diff
changeset
|
3576 tmp); |
2f7b42cc612c
Change up the Add Budy dialog a little bit, this hopefully makes it a bit
Etan Reisner <pidgin@unreliablesource.net>
parents:
22313
diff
changeset
|
3577 g_free(tmp); |
2f7b42cc612c
Change up the Add Budy dialog a little bit, this hopefully makes it a bit
Etan Reisner <pidgin@unreliablesource.net>
parents:
22313
diff
changeset
|
3578 } |
2f7b42cc612c
Change up the Add Budy dialog a little bit, this hopefully makes it a bit
Etan Reisner <pidgin@unreliablesource.net>
parents:
22313
diff
changeset
|
3579 count = 0; |
21925
2b6e6dd24a37
Add tooltips to groups in the buddy list. The tooltips show the current online
Etan Reisner <pidgin@unreliablesource.net>
parents:
21912
diff
changeset
|
3580 |
2b6e6dd24a37
Add tooltips to groups in the buddy list. The tooltips show the current online
Etan Reisner <pidgin@unreliablesource.net>
parents:
21912
diff
changeset
|
3581 tmp = purple_notify_user_info_get_text_with_newline(user_info, "\n"); |
2b6e6dd24a37
Add tooltips to groups in the buddy list. The tooltips show the current online
Etan Reisner <pidgin@unreliablesource.net>
parents:
21912
diff
changeset
|
3582 g_string_append(str, tmp); |
2b6e6dd24a37
Add tooltips to groups in the buddy list. The tooltips show the current online
Etan Reisner <pidgin@unreliablesource.net>
parents:
21912
diff
changeset
|
3583 g_free(tmp); |
2b6e6dd24a37
Add tooltips to groups in the buddy list. The tooltips show the current online
Etan Reisner <pidgin@unreliablesource.net>
parents:
21912
diff
changeset
|
3584 |
2b6e6dd24a37
Add tooltips to groups in the buddy list. The tooltips show the current online
Etan Reisner <pidgin@unreliablesource.net>
parents:
21912
diff
changeset
|
3585 purple_notify_user_info_destroy(user_info); |
2b6e6dd24a37
Add tooltips to groups in the buddy list. The tooltips show the current online
Etan Reisner <pidgin@unreliablesource.net>
parents:
21912
diff
changeset
|
3586 } |
2b6e6dd24a37
Add tooltips to groups in the buddy list. The tooltips show the current online
Etan Reisner <pidgin@unreliablesource.net>
parents:
21912
diff
changeset
|
3587 |
2b6e6dd24a37
Add tooltips to groups in the buddy list. The tooltips show the current online
Etan Reisner <pidgin@unreliablesource.net>
parents:
21912
diff
changeset
|
3588 purple_signal_emit(pidgin_blist_get_handle(), "drawing-tooltip", |
2b6e6dd24a37
Add tooltips to groups in the buddy list. The tooltips show the current online
Etan Reisner <pidgin@unreliablesource.net>
parents:
21912
diff
changeset
|
3589 node, str, full); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3590 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3591 return g_string_free(str, FALSE); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3592 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3593 |
21756
abd0cd2b712a
Add rudimentary caching for buddy list emblems. This avoids all the icons being duplicated in memory and constantly loaded. A more complete solution would be preferable, but I think this is better than nothing.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21752
diff
changeset
|
3594 static GHashTable *cached_emblems; |
abd0cd2b712a
Add rudimentary caching for buddy list emblems. This avoids all the icons being duplicated in memory and constantly loaded. A more complete solution would be preferable, but I think this is better than nothing.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21752
diff
changeset
|
3595 |
abd0cd2b712a
Add rudimentary caching for buddy list emblems. This avoids all the icons being duplicated in memory and constantly loaded. A more complete solution would be preferable, but I think this is better than nothing.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21752
diff
changeset
|
3596 static void _cleanup_cached_emblem(gpointer data, GObject *obj) { |
abd0cd2b712a
Add rudimentary caching for buddy list emblems. This avoids all the icons being duplicated in memory and constantly loaded. A more complete solution would be preferable, but I think this is better than nothing.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21752
diff
changeset
|
3597 g_hash_table_remove(cached_emblems, data); |
abd0cd2b712a
Add rudimentary caching for buddy list emblems. This avoids all the icons being duplicated in memory and constantly loaded. A more complete solution would be preferable, but I think this is better than nothing.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21752
diff
changeset
|
3598 } |
abd0cd2b712a
Add rudimentary caching for buddy list emblems. This avoids all the icons being duplicated in memory and constantly loaded. A more complete solution would be preferable, but I think this is better than nothing.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21752
diff
changeset
|
3599 |
abd0cd2b712a
Add rudimentary caching for buddy list emblems. This avoids all the icons being duplicated in memory and constantly loaded. A more complete solution would be preferable, but I think this is better than nothing.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21752
diff
changeset
|
3600 static GdkPixbuf * _pidgin_blist_get_cached_emblem(gchar *path) { |
abd0cd2b712a
Add rudimentary caching for buddy list emblems. This avoids all the icons being duplicated in memory and constantly loaded. A more complete solution would be preferable, but I think this is better than nothing.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21752
diff
changeset
|
3601 GdkPixbuf *pb = g_hash_table_lookup(cached_emblems, path); |
abd0cd2b712a
Add rudimentary caching for buddy list emblems. This avoids all the icons being duplicated in memory and constantly loaded. A more complete solution would be preferable, but I think this is better than nothing.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21752
diff
changeset
|
3602 |
abd0cd2b712a
Add rudimentary caching for buddy list emblems. This avoids all the icons being duplicated in memory and constantly loaded. A more complete solution would be preferable, but I think this is better than nothing.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21752
diff
changeset
|
3603 if (pb != NULL) { |
abd0cd2b712a
Add rudimentary caching for buddy list emblems. This avoids all the icons being duplicated in memory and constantly loaded. A more complete solution would be preferable, but I think this is better than nothing.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21752
diff
changeset
|
3604 /* The caller gets a reference */ |
abd0cd2b712a
Add rudimentary caching for buddy list emblems. This avoids all the icons being duplicated in memory and constantly loaded. A more complete solution would be preferable, but I think this is better than nothing.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21752
diff
changeset
|
3605 g_object_ref(pb); |
abd0cd2b712a
Add rudimentary caching for buddy list emblems. This avoids all the icons being duplicated in memory and constantly loaded. A more complete solution would be preferable, but I think this is better than nothing.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21752
diff
changeset
|
3606 g_free(path); |
abd0cd2b712a
Add rudimentary caching for buddy list emblems. This avoids all the icons being duplicated in memory and constantly loaded. A more complete solution would be preferable, but I think this is better than nothing.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21752
diff
changeset
|
3607 } else { |
abd0cd2b712a
Add rudimentary caching for buddy list emblems. This avoids all the icons being duplicated in memory and constantly loaded. A more complete solution would be preferable, but I think this is better than nothing.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21752
diff
changeset
|
3608 pb = gdk_pixbuf_new_from_file(path, NULL); |
abd0cd2b712a
Add rudimentary caching for buddy list emblems. This avoids all the icons being duplicated in memory and constantly loaded. A more complete solution would be preferable, but I think this is better than nothing.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21752
diff
changeset
|
3609 if (pb != NULL) { |
abd0cd2b712a
Add rudimentary caching for buddy list emblems. This avoids all the icons being duplicated in memory and constantly loaded. A more complete solution would be preferable, but I think this is better than nothing.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21752
diff
changeset
|
3610 /* We don't want to own a ref to the pixbuf, but we need to keep clean up. */ |
abd0cd2b712a
Add rudimentary caching for buddy list emblems. This avoids all the icons being duplicated in memory and constantly loaded. A more complete solution would be preferable, but I think this is better than nothing.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21752
diff
changeset
|
3611 /* I'm not sure if it would be better to just keep our ref and not let the emblem ever be destroyed */ |
abd0cd2b712a
Add rudimentary caching for buddy list emblems. This avoids all the icons being duplicated in memory and constantly loaded. A more complete solution would be preferable, but I think this is better than nothing.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21752
diff
changeset
|
3612 g_object_weak_ref(G_OBJECT(pb), _cleanup_cached_emblem, path); |
abd0cd2b712a
Add rudimentary caching for buddy list emblems. This avoids all the icons being duplicated in memory and constantly loaded. A more complete solution would be preferable, but I think this is better than nothing.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21752
diff
changeset
|
3613 g_hash_table_insert(cached_emblems, path, pb); |
abd0cd2b712a
Add rudimentary caching for buddy list emblems. This avoids all the icons being duplicated in memory and constantly loaded. A more complete solution would be preferable, but I think this is better than nothing.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21752
diff
changeset
|
3614 } else |
abd0cd2b712a
Add rudimentary caching for buddy list emblems. This avoids all the icons being duplicated in memory and constantly loaded. A more complete solution would be preferable, but I think this is better than nothing.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21752
diff
changeset
|
3615 g_free(path); |
abd0cd2b712a
Add rudimentary caching for buddy list emblems. This avoids all the icons being duplicated in memory and constantly loaded. A more complete solution would be preferable, but I think this is better than nothing.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21752
diff
changeset
|
3616 } |
abd0cd2b712a
Add rudimentary caching for buddy list emblems. This avoids all the icons being duplicated in memory and constantly loaded. A more complete solution would be preferable, but I think this is better than nothing.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21752
diff
changeset
|
3617 |
abd0cd2b712a
Add rudimentary caching for buddy list emblems. This avoids all the icons being duplicated in memory and constantly loaded. A more complete solution would be preferable, but I think this is better than nothing.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21752
diff
changeset
|
3618 return pb; |
abd0cd2b712a
Add rudimentary caching for buddy list emblems. This avoids all the icons being duplicated in memory and constantly loaded. A more complete solution would be preferable, but I think this is better than nothing.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21752
diff
changeset
|
3619 } |
abd0cd2b712a
Add rudimentary caching for buddy list emblems. This avoids all the icons being duplicated in memory and constantly loaded. A more complete solution would be preferable, but I think this is better than nothing.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21752
diff
changeset
|
3620 |
abd0cd2b712a
Add rudimentary caching for buddy list emblems. This avoids all the icons being duplicated in memory and constantly loaded. A more complete solution would be preferable, but I think this is better than nothing.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21752
diff
changeset
|
3621 |
15463 | 3622 GdkPixbuf * |
15823 | 3623 pidgin_blist_get_emblem(PurpleBlistNode *node) |
3624 { | |
3625 PurpleBuddy *buddy = NULL; | |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
3626 struct _pidgin_blist_node *gtknode = node->ui_data; |
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
3627 struct _pidgin_blist_node *gtkbuddynode = NULL; |
15823 | 3628 PurplePlugin *prpl; |
3629 PurplePluginProtocolInfo *prpl_info; | |
15463 | 3630 const char *name = NULL; |
3631 char *filename, *path; | |
15823 | 3632 PurplePresence *p; |
3633 | |
3634 if(PURPLE_BLIST_NODE_IS_CONTACT(node)) { | |
15463 | 3635 if(!gtknode->contact_expanded) { |
15823 | 3636 buddy = purple_contact_get_priority_buddy((PurpleContact*)node); |
3637 gtkbuddynode = ((PurpleBlistNode*)buddy)->ui_data; | |
15463 | 3638 } |
15823 | 3639 } else if(PURPLE_BLIST_NODE_IS_BUDDY(node)) { |
3640 buddy = (PurpleBuddy*)node; | |
15463 | 3641 gtkbuddynode = node->ui_data; |
18310
9b3c2ba1a5c3
Mobile icon trumps prpl icon in expanded buddies. Fixes #515
Sean Egan <seanegan@gmail.com>
parents:
18309
diff
changeset
|
3642 p = purple_buddy_get_presence(buddy); |
9b3c2ba1a5c3
Mobile icon trumps prpl icon in expanded buddies. Fixes #515
Sean Egan <seanegan@gmail.com>
parents:
18309
diff
changeset
|
3643 if (purple_presence_is_status_primitive_active(p, PURPLE_STATUS_MOBILE)) { |
21756
abd0cd2b712a
Add rudimentary caching for buddy list emblems. This avoids all the icons being duplicated in memory and constantly loaded. A more complete solution would be preferable, but I think this is better than nothing.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21752
diff
changeset
|
3644 path = g_build_filename(DATADIR, "pixmaps", "pidgin", "emblems", |
18310
9b3c2ba1a5c3
Mobile icon trumps prpl icon in expanded buddies. Fixes #515
Sean Egan <seanegan@gmail.com>
parents:
18309
diff
changeset
|
3645 "16", "mobile.png", NULL); |
21756
abd0cd2b712a
Add rudimentary caching for buddy list emblems. This avoids all the icons being duplicated in memory and constantly loaded. A more complete solution would be preferable, but I think this is better than nothing.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21752
diff
changeset
|
3646 return _pidgin_blist_get_cached_emblem(path); |
18310
9b3c2ba1a5c3
Mobile icon trumps prpl icon in expanded buddies. Fixes #515
Sean Egan <seanegan@gmail.com>
parents:
18309
diff
changeset
|
3647 } |
9b3c2ba1a5c3
Mobile icon trumps prpl icon in expanded buddies. Fixes #515
Sean Egan <seanegan@gmail.com>
parents:
18309
diff
changeset
|
3648 |
19474
74befdcd0454
Fixes #2146. Adds a Show Protocol Icon option and groups related Show menu items into a submenu. Patch from Justin Heiner
Sean Egan <seanegan@gmail.com>
parents:
19363
diff
changeset
|
3649 if (((struct _pidgin_blist_node*)(node->parent->ui_data))->contact_expanded) { |
74befdcd0454
Fixes #2146. Adds a Show Protocol Icon option and groups related Show menu items into a submenu. Patch from Justin Heiner
Sean Egan <seanegan@gmail.com>
parents:
19363
diff
changeset
|
3650 if (purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/blist/show_protocol_icons")) |
74befdcd0454
Fixes #2146. Adds a Show Protocol Icon option and groups related Show menu items into a submenu. Patch from Justin Heiner
Sean Egan <seanegan@gmail.com>
parents:
19363
diff
changeset
|
3651 return NULL; |
15823 | 3652 return pidgin_create_prpl_icon(((PurpleBuddy*)node)->account, PIDGIN_PRPL_ICON_SMALL); |
19474
74befdcd0454
Fixes #2146. Adds a Show Protocol Icon option and groups related Show menu items into a submenu. Patch from Justin Heiner
Sean Egan <seanegan@gmail.com>
parents:
19363
diff
changeset
|
3653 } |
15463 | 3654 } else { |
3655 return NULL; | |
3656 } | |
15632
a830f9756f23
Some more pidgininfication
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15615
diff
changeset
|
3657 |
21756
abd0cd2b712a
Add rudimentary caching for buddy list emblems. This avoids all the icons being duplicated in memory and constantly loaded. A more complete solution would be preferable, but I think this is better than nothing.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21752
diff
changeset
|
3658 g_return_val_if_fail(buddy != NULL, NULL); |
abd0cd2b712a
Add rudimentary caching for buddy list emblems. This avoids all the icons being duplicated in memory and constantly loaded. A more complete solution would be preferable, but I think this is better than nothing.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21752
diff
changeset
|
3659 |
15823 | 3660 if (!purple_privacy_check(buddy->account, purple_buddy_get_name(buddy))) { |
15500 | 3661 path = g_build_filename(DATADIR, "pixmaps", "pidgin", "emblems", "16", "blocked.png", NULL); |
21756
abd0cd2b712a
Add rudimentary caching for buddy list emblems. This avoids all the icons being duplicated in memory and constantly loaded. A more complete solution would be preferable, but I think this is better than nothing.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21752
diff
changeset
|
3662 return _pidgin_blist_get_cached_emblem(path); |
15524
84b3ab83df35
Use the status API to handle mobileness, and convert AIM to use it. This makes mobile buddies prioritze lower in Perons, and ensures the UI is notified of changes in mobileness. Other protocols to follow.
Sean Egan <seanegan@gmail.com>
parents:
15514
diff
changeset
|
3663 } |
15632
a830f9756f23
Some more pidgininfication
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15615
diff
changeset
|
3664 |
15823 | 3665 p = purple_buddy_get_presence(buddy); |
3666 if (purple_presence_is_status_primitive_active(p, PURPLE_STATUS_MOBILE)) { | |
15524
84b3ab83df35
Use the status API to handle mobileness, and convert AIM to use it. This makes mobile buddies prioritze lower in Perons, and ensures the UI is notified of changes in mobileness. Other protocols to follow.
Sean Egan <seanegan@gmail.com>
parents:
15514
diff
changeset
|
3667 path = g_build_filename(DATADIR, "pixmaps", "pidgin", "emblems", "16", "mobile.png", NULL); |
21756
abd0cd2b712a
Add rudimentary caching for buddy list emblems. This avoids all the icons being duplicated in memory and constantly loaded. A more complete solution would be preferable, but I think this is better than nothing.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21752
diff
changeset
|
3668 return _pidgin_blist_get_cached_emblem(path); |
15500 | 3669 } |
15463 | 3670 |
20570
5913725cbcd6
Use an independant status type for 'current media' stuff, instead of using
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
20546
diff
changeset
|
3671 if (purple_presence_is_status_primitive_active(p, PURPLE_STATUS_TUNE)) { |
20055
d97c43dbc1ca
Display a music emblem in the buddylist when appropriate.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
20050
diff
changeset
|
3672 path = g_build_filename(DATADIR, "pixmaps", "pidgin", "emblems", "16", "music.png", NULL); |
21756
abd0cd2b712a
Add rudimentary caching for buddy list emblems. This avoids all the icons being duplicated in memory and constantly loaded. A more complete solution would be preferable, but I think this is better than nothing.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21752
diff
changeset
|
3673 return _pidgin_blist_get_cached_emblem(path); |
20055
d97c43dbc1ca
Display a music emblem in the buddylist when appropriate.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
20050
diff
changeset
|
3674 } |
d97c43dbc1ca
Display a music emblem in the buddylist when appropriate.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
20050
diff
changeset
|
3675 |
15823 | 3676 prpl = purple_find_prpl(purple_account_get_protocol_id(buddy->account)); |
15463 | 3677 if (!prpl) |
3678 return NULL; | |
3679 | |
15823 | 3680 prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(prpl); |
15463 | 3681 if (prpl_info && prpl_info->list_emblem) |
3682 name = prpl_info->list_emblem(buddy); | |
3683 | |
3684 if (name == NULL) | |
3685 return NULL; | |
3686 | |
3687 filename = g_strdup_printf("%s.png", name); | |
3688 | |
3689 path = g_build_filename(DATADIR, "pixmaps", "pidgin", "emblems", "16", filename, NULL); | |
3690 g_free(filename); | |
21756
abd0cd2b712a
Add rudimentary caching for buddy list emblems. This avoids all the icons being duplicated in memory and constantly loaded. A more complete solution would be preferable, but I think this is better than nothing.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21752
diff
changeset
|
3691 |
abd0cd2b712a
Add rudimentary caching for buddy list emblems. This avoids all the icons being duplicated in memory and constantly loaded. A more complete solution would be preferable, but I think this is better than nothing.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21752
diff
changeset
|
3692 /* _pidgin_blist_get_cached_emblem() assumes ownership of path */ |
abd0cd2b712a
Add rudimentary caching for buddy list emblems. This avoids all the icons being duplicated in memory and constantly loaded. A more complete solution would be preferable, but I think this is better than nothing.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21752
diff
changeset
|
3693 return _pidgin_blist_get_cached_emblem(path); |
15463 | 3694 } |
3695 | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3696 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3697 GdkPixbuf * |
15823 | 3698 pidgin_blist_get_status_icon(PurpleBlistNode *node, PidginStatusIconSize size) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3699 { |
15397
a8ee645e7fb4
A lot of status icon changes:
Sean Egan <seanegan@gmail.com>
parents:
15374
diff
changeset
|
3700 GdkPixbuf *ret; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3701 const char *protoname = NULL; |
19540
712a448722b6
If a conversation doesn't have UI-data, consider it a hidden conversation.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19538
diff
changeset
|
3702 const char *icon = NULL; |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
3703 struct _pidgin_blist_node *gtknode = node->ui_data; |
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
3704 struct _pidgin_blist_node *gtkbuddynode = NULL; |
15823 | 3705 PurpleBuddy *buddy = NULL; |
3706 PurpleChat *chat = NULL; | |
21660
c29f2e3a3b99
Had this laying around. Weeks (months?) ago all the small listers and Hylke agreed that Small list looks better with conversation tab sized icons
Sean Egan <seanegan@gmail.com>
parents:
21659
diff
changeset
|
3707 GtkIconSize icon_size = gtk_icon_size_from_name((size == PIDGIN_STATUS_ICON_LARGE) ? PIDGIN_ICON_SIZE_TANGO_EXTRA_SMALL : |
c29f2e3a3b99
Had this laying around. Weeks (months?) ago all the small listers and Hylke agreed that Small list looks better with conversation tab sized icons
Sean Egan <seanegan@gmail.com>
parents:
21659
diff
changeset
|
3708 PIDGIN_ICON_SIZE_TANGO_MICROSCOPIC); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3709 |
15823 | 3710 if(PURPLE_BLIST_NODE_IS_CONTACT(node)) { |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3711 if(!gtknode->contact_expanded) { |
15823 | 3712 buddy = purple_contact_get_priority_buddy((PurpleContact*)node); |
17042
777cdaa3b904
This is what I actually intended to commit in 105009e066f1bcaefb0af3bd1e17b7860bf12a57. The rest of the mess being pushed is me trying to clean up my mess.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
17038
diff
changeset
|
3713 if (buddy != NULL) |
777cdaa3b904
This is what I actually intended to commit in 105009e066f1bcaefb0af3bd1e17b7860bf12a57. The rest of the mess being pushed is me trying to clean up my mess.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
17038
diff
changeset
|
3714 gtkbuddynode = ((PurpleBlistNode*)buddy)->ui_data; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3715 } |
15823 | 3716 } else if(PURPLE_BLIST_NODE_IS_BUDDY(node)) { |
3717 buddy = (PurpleBuddy*)node; | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3718 gtkbuddynode = node->ui_data; |
15823 | 3719 } else if(PURPLE_BLIST_NODE_IS_CHAT(node)) { |
3720 chat = (PurpleChat*)node; | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3721 } else { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3722 return NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3723 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3724 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3725 if(buddy || chat) { |
15823 | 3726 PurpleAccount *account; |
3727 PurplePlugin *prpl; | |
3728 PurplePluginProtocolInfo *prpl_info; | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3729 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3730 if(buddy) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3731 account = buddy->account; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3732 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3733 account = chat->account; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3734 |
15823 | 3735 prpl = purple_find_prpl(purple_account_get_protocol_id(account)); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3736 if(!prpl) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3737 return NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3738 |
15823 | 3739 prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(prpl); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3740 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3741 if(prpl_info && prpl_info->list_icon) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3742 protoname = prpl_info->list_icon(account, buddy); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3743 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3744 } |
15632
a830f9756f23
Some more pidgininfication
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15615
diff
changeset
|
3745 |
15397
a8ee645e7fb4
A lot of status icon changes:
Sean Egan <seanegan@gmail.com>
parents:
15374
diff
changeset
|
3746 if(buddy) { |
19894
0ac0e112a0fa
Add some stuff so that we don't have to traverse over a list to determine
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19611
diff
changeset
|
3747 PurpleConversation *conv = find_conversation_with_buddy(buddy); |
15823 | 3748 PurplePresence *p; |
19540
712a448722b6
If a conversation doesn't have UI-data, consider it a hidden conversation.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19538
diff
changeset
|
3749 gboolean trans; |
712a448722b6
If a conversation doesn't have UI-data, consider it a hidden conversation.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19538
diff
changeset
|
3750 |
15497
74efe677c8a5
Restore 'hidden convo' status icon in blist. Additionally, make the name text bold when you have a hidden convo
Sean Egan <seanegan@gmail.com>
parents:
15493
diff
changeset
|
3751 if(conv != NULL) { |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
3752 PidginConversation *gtkconv = PIDGIN_CONVERSATION(conv); |
19895
1fe1ac03e1fe
Show the 'new message' icon correctly.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19894
diff
changeset
|
3753 if (gtkconv == NULL && size == PIDGIN_STATUS_ICON_SMALL) { |
1fe1ac03e1fe
Show the 'new message' icon correctly.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19894
diff
changeset
|
3754 PidginBlistNode *ui = buddy->node.ui_data; |
1fe1ac03e1fe
Show the 'new message' icon correctly.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19894
diff
changeset
|
3755 if (ui == NULL || (ui->conv.flags & PIDGIN_BLIST_NODE_HAS_PENDING_MESSAGE)) |
1fe1ac03e1fe
Show the 'new message' icon correctly.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19894
diff
changeset
|
3756 return gtk_widget_render_icon (GTK_WIDGET(gtkblist->treeview), |
1fe1ac03e1fe
Show the 'new message' icon correctly.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19894
diff
changeset
|
3757 PIDGIN_STOCK_STATUS_MESSAGE, icon_size, "GtkTreeView"); |
15497
74efe677c8a5
Restore 'hidden convo' status icon in blist. Additionally, make the name text bold when you have a hidden convo
Sean Egan <seanegan@gmail.com>
parents:
15493
diff
changeset
|
3758 } |
74efe677c8a5
Restore 'hidden convo' status icon in blist. Additionally, make the name text bold when you have a hidden convo
Sean Egan <seanegan@gmail.com>
parents:
15493
diff
changeset
|
3759 } |
19540
712a448722b6
If a conversation doesn't have UI-data, consider it a hidden conversation.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19538
diff
changeset
|
3760 |
15823 | 3761 p = purple_buddy_get_presence(buddy); |
20138
a5f1483395d1
show transparent status icons for idle tooltips. Patch from #465
Sean Egan <seanegan@gmail.com>
parents:
20099
diff
changeset
|
3762 trans = purple_presence_is_idle(p); |
15823 | 3763 |
23969
5045f2ce9cff
disapproval of revision 'f5ca7968e3f6be8f81d068232d389e0b1dab784b'
Kevin Stange <kevin@simguy.net>
parents:
23967
diff
changeset
|
3764 if (PURPLE_BUDDY_IS_ONLINE(buddy) && gtkbuddynode && gtkbuddynode->recent_signonoff) |
19540
712a448722b6
If a conversation doesn't have UI-data, consider it a hidden conversation.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19538
diff
changeset
|
3765 icon = PIDGIN_STOCK_STATUS_LOGIN; |
15448 | 3766 else if (gtkbuddynode && gtkbuddynode->recent_signonoff) |
19540
712a448722b6
If a conversation doesn't have UI-data, consider it a hidden conversation.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19538
diff
changeset
|
3767 icon = PIDGIN_STOCK_STATUS_LOGOUT; |
23969
5045f2ce9cff
disapproval of revision 'f5ca7968e3f6be8f81d068232d389e0b1dab784b'
Kevin Stange <kevin@simguy.net>
parents:
23967
diff
changeset
|
3768 else if (purple_presence_is_status_primitive_active(p, PURPLE_STATUS_UNAVAILABLE)) |
19540
712a448722b6
If a conversation doesn't have UI-data, consider it a hidden conversation.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19538
diff
changeset
|
3769 if (trans) |
712a448722b6
If a conversation doesn't have UI-data, consider it a hidden conversation.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19538
diff
changeset
|
3770 icon = PIDGIN_STOCK_STATUS_BUSY_I; |
15493 | 3771 else |
19540
712a448722b6
If a conversation doesn't have UI-data, consider it a hidden conversation.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19538
diff
changeset
|
3772 icon = PIDGIN_STOCK_STATUS_BUSY; |
15823 | 3773 else if (purple_presence_is_status_primitive_active(p, PURPLE_STATUS_AWAY)) |
19540
712a448722b6
If a conversation doesn't have UI-data, consider it a hidden conversation.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19538
diff
changeset
|
3774 if (trans) |
712a448722b6
If a conversation doesn't have UI-data, consider it a hidden conversation.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19538
diff
changeset
|
3775 icon = PIDGIN_STOCK_STATUS_AWAY_I; |
15493 | 3776 else |
19540
712a448722b6
If a conversation doesn't have UI-data, consider it a hidden conversation.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19538
diff
changeset
|
3777 icon = PIDGIN_STOCK_STATUS_AWAY; |
15823 | 3778 else if (purple_presence_is_status_primitive_active(p, PURPLE_STATUS_EXTENDED_AWAY)) |
19540
712a448722b6
If a conversation doesn't have UI-data, consider it a hidden conversation.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19538
diff
changeset
|
3779 if (trans) |
712a448722b6
If a conversation doesn't have UI-data, consider it a hidden conversation.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19538
diff
changeset
|
3780 icon = PIDGIN_STOCK_STATUS_XA_I; |
15493 | 3781 else |
19540
712a448722b6
If a conversation doesn't have UI-data, consider it a hidden conversation.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19538
diff
changeset
|
3782 icon = PIDGIN_STOCK_STATUS_XA; |
15823 | 3783 else if (purple_presence_is_status_primitive_active(p, PURPLE_STATUS_OFFLINE)) |
19540
712a448722b6
If a conversation doesn't have UI-data, consider it a hidden conversation.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19538
diff
changeset
|
3784 icon = PIDGIN_STOCK_STATUS_OFFLINE; |
712a448722b6
If a conversation doesn't have UI-data, consider it a hidden conversation.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19538
diff
changeset
|
3785 else if (trans) |
712a448722b6
If a conversation doesn't have UI-data, consider it a hidden conversation.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19538
diff
changeset
|
3786 icon = PIDGIN_STOCK_STATUS_AVAILABLE_I; |
17488
45178b7e580d
Show the Invisible icon (the same one in the statusbox for buddies that are broadcasting an invisible status to you. This should fix #740, but I'm not positive
Sean Egan <seanegan@gmail.com>
parents:
17487
diff
changeset
|
3787 else if (purple_presence_is_status_primitive_active(p, PURPLE_STATUS_INVISIBLE)) |
19540
712a448722b6
If a conversation doesn't have UI-data, consider it a hidden conversation.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19538
diff
changeset
|
3788 icon = PIDGIN_STOCK_STATUS_INVISIBLE; |
15448 | 3789 else |
19540
712a448722b6
If a conversation doesn't have UI-data, consider it a hidden conversation.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19538
diff
changeset
|
3790 icon = PIDGIN_STOCK_STATUS_AVAILABLE; |
15448 | 3791 } else if (chat) { |
19540
712a448722b6
If a conversation doesn't have UI-data, consider it a hidden conversation.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19538
diff
changeset
|
3792 icon = PIDGIN_STOCK_STATUS_CHAT; |
15448 | 3793 } else { |
19540
712a448722b6
If a conversation doesn't have UI-data, consider it a hidden conversation.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19538
diff
changeset
|
3794 icon = PIDGIN_STOCK_STATUS_PERSON; |
712a448722b6
If a conversation doesn't have UI-data, consider it a hidden conversation.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19538
diff
changeset
|
3795 } |
712a448722b6
If a conversation doesn't have UI-data, consider it a hidden conversation.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19538
diff
changeset
|
3796 |
712a448722b6
If a conversation doesn't have UI-data, consider it a hidden conversation.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19538
diff
changeset
|
3797 ret = gtk_widget_render_icon (GTK_WIDGET(gtkblist->treeview), icon, |
712a448722b6
If a conversation doesn't have UI-data, consider it a hidden conversation.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19538
diff
changeset
|
3798 icon_size, "GtkTreeView"); |
15397
a8ee645e7fb4
A lot of status icon changes:
Sean Egan <seanegan@gmail.com>
parents:
15374
diff
changeset
|
3799 return ret; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3800 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3801 |
18211
84b577372b90
Show screenname instead of alias in conversation infopanes
Sean Egan <seanegan@gmail.com>
parents:
18208
diff
changeset
|
3802 gchar *pidgin_blist_get_name_markup(PurpleBuddy *b, gboolean selected, gboolean aliased) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3803 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3804 const char *name; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3805 char *esc, *text = NULL; |
15823 | 3806 PurplePlugin *prpl; |
3807 PurplePluginProtocolInfo *prpl_info = NULL; | |
3808 PurpleContact *contact; | |
3809 PurplePresence *presence; | |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
3810 struct _pidgin_blist_node *gtkcontactnode = NULL; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3811 char *idletime = NULL, *statustext = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3812 time_t t; |
19894
0ac0e112a0fa
Add some stuff so that we don't have to traverse over a list to determine
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19611
diff
changeset
|
3813 PurpleConversation *conv = find_conversation_with_buddy(b); |
15497
74efe677c8a5
Restore 'hidden convo' status icon in blist. Additionally, make the name text bold when you have a hidden convo
Sean Egan <seanegan@gmail.com>
parents:
15493
diff
changeset
|
3814 gboolean hidden_conv = FALSE; |
74efe677c8a5
Restore 'hidden convo' status icon in blist. Additionally, make the name text bold when you have a hidden convo
Sean Egan <seanegan@gmail.com>
parents:
15493
diff
changeset
|
3815 |
19894
0ac0e112a0fa
Add some stuff so that we don't have to traverse over a list to determine
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19611
diff
changeset
|
3816 if (conv != NULL) { |
0ac0e112a0fa
Add some stuff so that we don't have to traverse over a list to determine
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19611
diff
changeset
|
3817 PidginBlistNode *ui = b->node.ui_data; |
0ac0e112a0fa
Add some stuff so that we don't have to traverse over a list to determine
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19611
diff
changeset
|
3818 if (ui) { |
0ac0e112a0fa
Add some stuff so that we don't have to traverse over a list to determine
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19611
diff
changeset
|
3819 if (ui->conv.flags & PIDGIN_BLIST_NODE_HAS_PENDING_MESSAGE) |
0ac0e112a0fa
Add some stuff so that we don't have to traverse over a list to determine
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19611
diff
changeset
|
3820 hidden_conv = TRUE; |
0ac0e112a0fa
Add some stuff so that we don't have to traverse over a list to determine
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19611
diff
changeset
|
3821 } else { |
0ac0e112a0fa
Add some stuff so that we don't have to traverse over a list to determine
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19611
diff
changeset
|
3822 if (PIDGIN_CONVERSATION(conv) == NULL) |
0ac0e112a0fa
Add some stuff so that we don't have to traverse over a list to determine
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19611
diff
changeset
|
3823 hidden_conv = TRUE; |
15497
74efe677c8a5
Restore 'hidden convo' status icon in blist. Additionally, make the name text bold when you have a hidden convo
Sean Egan <seanegan@gmail.com>
parents:
15493
diff
changeset
|
3824 } |
74efe677c8a5
Restore 'hidden convo' status icon in blist. Additionally, make the name text bold when you have a hidden convo
Sean Egan <seanegan@gmail.com>
parents:
15493
diff
changeset
|
3825 } |
15632
a830f9756f23
Some more pidgininfication
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15615
diff
changeset
|
3826 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3827 /* XXX Good luck cleaning up this crap */ |
19234
aafa9b36344e
Double-click infopane to alias or change topic. Also, show alias instead of screenname in infopane
Sean Egan <seanegan@gmail.com>
parents:
19187
diff
changeset
|
3828 contact = (PurpleContact*)((PurpleBlistNode*)b)->parent; |
aafa9b36344e
Double-click infopane to alias or change topic. Also, show alias instead of screenname in infopane
Sean Egan <seanegan@gmail.com>
parents:
19187
diff
changeset
|
3829 if(contact) |
aafa9b36344e
Double-click infopane to alias or change topic. Also, show alias instead of screenname in infopane
Sean Egan <seanegan@gmail.com>
parents:
19187
diff
changeset
|
3830 gtkcontactnode = ((PurpleBlistNode*)contact)->ui_data; |
aafa9b36344e
Double-click infopane to alias or change topic. Also, show alias instead of screenname in infopane
Sean Egan <seanegan@gmail.com>
parents:
19187
diff
changeset
|
3831 |
aafa9b36344e
Double-click infopane to alias or change topic. Also, show alias instead of screenname in infopane
Sean Egan <seanegan@gmail.com>
parents:
19187
diff
changeset
|
3832 if(gtkcontactnode && !gtkcontactnode->contact_expanded && contact->alias) |
aafa9b36344e
Double-click infopane to alias or change topic. Also, show alias instead of screenname in infopane
Sean Egan <seanegan@gmail.com>
parents:
19187
diff
changeset
|
3833 name = contact->alias; |
aafa9b36344e
Double-click infopane to alias or change topic. Also, show alias instead of screenname in infopane
Sean Egan <seanegan@gmail.com>
parents:
19187
diff
changeset
|
3834 else |
aafa9b36344e
Double-click infopane to alias or change topic. Also, show alias instead of screenname in infopane
Sean Egan <seanegan@gmail.com>
parents:
19187
diff
changeset
|
3835 name = purple_buddy_get_alias(b); |
18211
84b577372b90
Show screenname instead of alias in conversation infopanes
Sean Egan <seanegan@gmail.com>
parents:
18208
diff
changeset
|
3836 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3837 esc = g_markup_escape_text(name, strlen(name)); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3838 |
15823 | 3839 presence = purple_buddy_get_presence(b); |
3840 | |
18762
a582b09109bc
show status messages in infopane even if not in buddy list. Fixes #2321
Sean Egan <seanegan@gmail.com>
parents:
18671
diff
changeset
|
3841 if (!purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/blist/show_buddy_icons") && aliased) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3842 { |
15823 | 3843 if (!selected && purple_presence_is_idle(presence)) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3844 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3845 text = g_strdup_printf("<span color='%s'>%s</span>", |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3846 dim_grey(), esc); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3847 g_free(esc); |
15497
74efe677c8a5
Restore 'hidden convo' status icon in blist. Additionally, make the name text bold when you have a hidden convo
Sean Egan <seanegan@gmail.com>
parents:
15493
diff
changeset
|
3848 if (hidden_conv) { |
74efe677c8a5
Restore 'hidden convo' status icon in blist. Additionally, make the name text bold when you have a hidden convo
Sean Egan <seanegan@gmail.com>
parents:
15493
diff
changeset
|
3849 char *tmp = text; |
74efe677c8a5
Restore 'hidden convo' status icon in blist. Additionally, make the name text bold when you have a hidden convo
Sean Egan <seanegan@gmail.com>
parents:
15493
diff
changeset
|
3850 text = g_strdup_printf("<b>%s</b>", text); |
74efe677c8a5
Restore 'hidden convo' status icon in blist. Additionally, make the name text bold when you have a hidden convo
Sean Egan <seanegan@gmail.com>
parents:
15493
diff
changeset
|
3851 g_free(tmp); |
74efe677c8a5
Restore 'hidden convo' status icon in blist. Additionally, make the name text bold when you have a hidden convo
Sean Egan <seanegan@gmail.com>
parents:
15493
diff
changeset
|
3852 } |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3853 return text; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3854 } |
22760
cf88a302fa88
'Edit Settings' in the context menu for chats in the buddylist.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22695
diff
changeset
|
3855 else if (hidden_conv) |
cf88a302fa88
'Edit Settings' in the context menu for chats in the buddylist.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22695
diff
changeset
|
3856 { |
cf88a302fa88
'Edit Settings' in the context menu for chats in the buddylist.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22695
diff
changeset
|
3857 char *tmp = esc; |
cf88a302fa88
'Edit Settings' in the context menu for chats in the buddylist.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22695
diff
changeset
|
3858 esc = g_strdup_printf("<b>%s</b>", esc); |
cf88a302fa88
'Edit Settings' in the context menu for chats in the buddylist.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22695
diff
changeset
|
3859 g_free(tmp); |
cf88a302fa88
'Edit Settings' in the context menu for chats in the buddylist.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22695
diff
changeset
|
3860 } |
cf88a302fa88
'Edit Settings' in the context menu for chats in the buddylist.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22695
diff
changeset
|
3861 return esc; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3862 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3863 |
15823 | 3864 prpl = purple_find_prpl(purple_account_get_protocol_id(b->account)); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3865 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3866 if (prpl != NULL) |
15823 | 3867 prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(prpl); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3868 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3869 if (prpl_info && prpl_info->status_text && b->account->gc) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3870 char *tmp = prpl_info->status_text(b); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3871 const char *end; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3872 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3873 if(tmp && !g_utf8_validate(tmp, -1, &end)) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3874 char *new = g_strndup(tmp, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3875 g_utf8_pointer_to_offset(tmp, end)); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3876 g_free(tmp); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3877 tmp = new; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3878 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3879 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3880 #if !GTK_CHECK_VERSION(2,6,0) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3881 if(tmp) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3882 char buf[32]; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3883 char *c = tmp; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3884 int length = 0, vis=0; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3885 gboolean inside = FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3886 g_strdelimit(tmp, "\n", ' '); |
15823 | 3887 purple_str_strip_char(tmp, '\r'); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3888 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3889 while(*c && vis < 20) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3890 if(*c == '&') |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3891 inside = TRUE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3892 else if(*c == ';') |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3893 inside = FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3894 if(!inside) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3895 vis++; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3896 c = g_utf8_next_char(c); /* this is fun */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3897 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3898 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3899 length = c - tmp; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3900 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3901 if(vis == 20) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3902 g_snprintf(buf, sizeof(buf), "%%.%ds...", length); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3903 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3904 g_snprintf(buf, sizeof(buf), "%%s "); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3905 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3906 statustext = g_strdup_printf(buf, tmp); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3907 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3908 g_free(tmp); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3909 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3910 #else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3911 if(tmp) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3912 g_strdelimit(tmp, "\n", ' '); |
15823 | 3913 purple_str_strip_char(tmp, '\r'); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3914 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3915 statustext = tmp; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3916 #endif |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3917 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3918 |
15823 | 3919 if(!purple_presence_is_online(presence) && !statustext) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3920 statustext = g_strdup(_("Offline")); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3921 else if (!statustext) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3922 text = g_strdup(esc); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3923 |
15823 | 3924 if (purple_presence_is_idle(presence)) { |
16062
07554cc5d090
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <stu@nosnilmot.com>
parents:
16010
diff
changeset
|
3925 if (purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/blist/show_idle_time")) { |
15823 | 3926 time_t idle_secs = purple_presence_get_idle_time(presence); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3927 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3928 if (idle_secs > 0) { |
18234
cbec54ecd9ab
Show idle times in the buddy list as days, hours, seconds. Patch from
Ka-Hing Cheung <khc@hxbc.us>
parents:
18217
diff
changeset
|
3929 int iday, ihrs, imin; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3930 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3931 time(&t); |
18234
cbec54ecd9ab
Show idle times in the buddy list as days, hours, seconds. Patch from
Ka-Hing Cheung <khc@hxbc.us>
parents:
18217
diff
changeset
|
3932 iday = (t - idle_secs) / (24 * 60 * 60); |
cbec54ecd9ab
Show idle times in the buddy list as days, hours, seconds. Patch from
Ka-Hing Cheung <khc@hxbc.us>
parents:
18217
diff
changeset
|
3933 ihrs = ((t - idle_secs) / 60 / 60) % 24; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3934 imin = ((t - idle_secs) / 60) % 60; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3935 |
18234
cbec54ecd9ab
Show idle times in the buddy list as days, hours, seconds. Patch from
Ka-Hing Cheung <khc@hxbc.us>
parents:
18217
diff
changeset
|
3936 if (iday) |
cbec54ecd9ab
Show idle times in the buddy list as days, hours, seconds. Patch from
Ka-Hing Cheung <khc@hxbc.us>
parents:
18217
diff
changeset
|
3937 idletime = g_strdup_printf(_("Idle %dd %dh %02dm"), iday, ihrs, imin); |
cbec54ecd9ab
Show idle times in the buddy list as days, hours, seconds. Patch from
Ka-Hing Cheung <khc@hxbc.us>
parents:
18217
diff
changeset
|
3938 else if (ihrs) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3939 idletime = g_strdup_printf(_("Idle %dh %02dm"), ihrs, imin); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3940 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3941 idletime = g_strdup_printf(_("Idle %dm"), imin); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3942 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3943 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3944 idletime = g_strdup(_("Idle")); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3945 |
20793
16d372f412e3
Fix a leak that occurs when getting the formatted buddy name under some conditions.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20685
diff
changeset
|
3946 if (!selected) { |
16d372f412e3
Fix a leak that occurs when getting the formatted buddy name under some conditions.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20685
diff
changeset
|
3947 g_free(text); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3948 text = g_strdup_printf("<span color='%s'>%s</span>\n" |
20793
16d372f412e3
Fix a leak that occurs when getting the formatted buddy name under some conditions.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20685
diff
changeset
|
3949 "<span color='%s' size='smaller'>%s%s%s</span>", |
16d372f412e3
Fix a leak that occurs when getting the formatted buddy name under some conditions.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20685
diff
changeset
|
3950 dim_grey(), esc, dim_grey(), |
16d372f412e3
Fix a leak that occurs when getting the formatted buddy name under some conditions.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20685
diff
changeset
|
3951 idletime != NULL ? idletime : "", |
16d372f412e3
Fix a leak that occurs when getting the formatted buddy name under some conditions.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20685
diff
changeset
|
3952 (idletime != NULL && statustext != NULL) ? " - " : "", |
16d372f412e3
Fix a leak that occurs when getting the formatted buddy name under some conditions.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20685
diff
changeset
|
3953 statustext != NULL ? statustext : ""); |
16d372f412e3
Fix a leak that occurs when getting the formatted buddy name under some conditions.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20685
diff
changeset
|
3954 } |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3955 } |
20793
16d372f412e3
Fix a leak that occurs when getting the formatted buddy name under some conditions.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20685
diff
changeset
|
3956 else if (!selected && !statustext) {/* We handle selected text later */ |
16d372f412e3
Fix a leak that occurs when getting the formatted buddy name under some conditions.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20685
diff
changeset
|
3957 g_free(text); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3958 text = g_strdup_printf("<span color='%s'>%s</span>", dim_grey(), esc); |
20793
16d372f412e3
Fix a leak that occurs when getting the formatted buddy name under some conditions.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20685
diff
changeset
|
3959 } else if (!selected && !text) { |
16d372f412e3
Fix a leak that occurs when getting the formatted buddy name under some conditions.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20685
diff
changeset
|
3960 g_free(text); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3961 text = g_strdup_printf("<span color='%s'>%s</span>\n" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3962 "<span color='%s' size='smaller'>%s</span>", |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3963 dim_grey(), esc, dim_grey(), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3964 statustext != NULL ? statustext : ""); |
20793
16d372f412e3
Fix a leak that occurs when getting the formatted buddy name under some conditions.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20685
diff
changeset
|
3965 } |
17429 | 3966 } else if (!PURPLE_BUDDY_IS_ONLINE(b)) { |
20793
16d372f412e3
Fix a leak that occurs when getting the formatted buddy name under some conditions.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20685
diff
changeset
|
3967 if (!selected && !statustext) {/* We handle selected text later */ |
16d372f412e3
Fix a leak that occurs when getting the formatted buddy name under some conditions.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20685
diff
changeset
|
3968 g_free(text); |
17429 | 3969 text = g_strdup_printf("<span color='%s'>%s</span>", dim_grey(), esc); |
20793
16d372f412e3
Fix a leak that occurs when getting the formatted buddy name under some conditions.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20685
diff
changeset
|
3970 } else if (!selected && !text) |
17429 | 3971 text = g_strdup_printf("<span color='%s'>%s</span>\n" |
3972 "<span color='%s' size='smaller'>%s</span>", | |
3973 dim_grey(), esc, dim_grey(), | |
3974 statustext != NULL ? statustext : ""); | |
3975 | |
3976 } | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3977 /* Not idle and not selected */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3978 else if (!selected && !text) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3979 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3980 text = g_strdup_printf("%s\n" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3981 "<span color='%s' size='smaller'>%s</span>", |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3982 esc, dim_grey(), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3983 statustext != NULL ? statustext : ""); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3984 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3985 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3986 /* It is selected. */ |
20793
16d372f412e3
Fix a leak that occurs when getting the formatted buddy name under some conditions.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20685
diff
changeset
|
3987 if ((selected && !text) || (selected && idletime)) { |
16d372f412e3
Fix a leak that occurs when getting the formatted buddy name under some conditions.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20685
diff
changeset
|
3988 g_free(text); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3989 text = g_strdup_printf("%s\n" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3990 "<span size='smaller'>%s%s%s</span>", |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3991 esc, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3992 idletime != NULL ? idletime : "", |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3993 (idletime != NULL && statustext != NULL) ? " - " : "", |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3994 statustext != NULL ? statustext : ""); |
20793
16d372f412e3
Fix a leak that occurs when getting the formatted buddy name under some conditions.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20685
diff
changeset
|
3995 } |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3996 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3997 g_free(idletime); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3998 g_free(statustext); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3999 g_free(esc); |
15632
a830f9756f23
Some more pidgininfication
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15615
diff
changeset
|
4000 |
15497
74efe677c8a5
Restore 'hidden convo' status icon in blist. Additionally, make the name text bold when you have a hidden convo
Sean Egan <seanegan@gmail.com>
parents:
15493
diff
changeset
|
4001 if (hidden_conv) { |
74efe677c8a5
Restore 'hidden convo' status icon in blist. Additionally, make the name text bold when you have a hidden convo
Sean Egan <seanegan@gmail.com>
parents:
15493
diff
changeset
|
4002 char *tmp = text; |
74efe677c8a5
Restore 'hidden convo' status icon in blist. Additionally, make the name text bold when you have a hidden convo
Sean Egan <seanegan@gmail.com>
parents:
15493
diff
changeset
|
4003 text = g_strdup_printf("<b>%s</b>", tmp); |
74efe677c8a5
Restore 'hidden convo' status icon in blist. Additionally, make the name text bold when you have a hidden convo
Sean Egan <seanegan@gmail.com>
parents:
15493
diff
changeset
|
4004 g_free(tmp); |
74efe677c8a5
Restore 'hidden convo' status icon in blist. Additionally, make the name text bold when you have a hidden convo
Sean Egan <seanegan@gmail.com>
parents:
15493
diff
changeset
|
4005 } |
15632
a830f9756f23
Some more pidgininfication
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15615
diff
changeset
|
4006 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4007 return text; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4008 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4009 |
22007
c38d72677c8a
Probe for -Wstrict-prototypes to get some more warnings. I then cleaned up
Richard Laager <rlaager@wiktel.com>
parents:
21960
diff
changeset
|
4010 static void pidgin_blist_restore_position(void) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4011 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4012 int blist_x, blist_y, blist_width, blist_height; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4013 |
16062
07554cc5d090
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <stu@nosnilmot.com>
parents:
16010
diff
changeset
|
4014 blist_width = purple_prefs_get_int(PIDGIN_PREFS_ROOT "/blist/width"); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4015 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4016 /* if the window exists, is hidden, we're saving positions, and the |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4017 * position is sane... */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4018 if (gtkblist && gtkblist->window && |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4019 !GTK_WIDGET_VISIBLE(gtkblist->window) && blist_width != 0) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4020 |
16062
07554cc5d090
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <stu@nosnilmot.com>
parents:
16010
diff
changeset
|
4021 blist_x = purple_prefs_get_int(PIDGIN_PREFS_ROOT "/blist/x"); |
07554cc5d090
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <stu@nosnilmot.com>
parents:
16010
diff
changeset
|
4022 blist_y = purple_prefs_get_int(PIDGIN_PREFS_ROOT "/blist/y"); |
07554cc5d090
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <stu@nosnilmot.com>
parents:
16010
diff
changeset
|
4023 blist_height = purple_prefs_get_int(PIDGIN_PREFS_ROOT "/blist/height"); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4024 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4025 /* ...check position is on screen... */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4026 if (blist_x >= gdk_screen_width()) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4027 blist_x = gdk_screen_width() - 100; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4028 else if (blist_x + blist_width < 0) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4029 blist_x = 100; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4030 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4031 if (blist_y >= gdk_screen_height()) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4032 blist_y = gdk_screen_height() - 100; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4033 else if (blist_y + blist_height < 0) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4034 blist_y = 100; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4035 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4036 /* ...and move it back. */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4037 gtk_window_move(GTK_WINDOW(gtkblist->window), blist_x, blist_y); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4038 gtk_window_resize(GTK_WINDOW(gtkblist->window), blist_width, blist_height); |
16062
07554cc5d090
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <stu@nosnilmot.com>
parents:
16010
diff
changeset
|
4039 if (purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/blist/list_maximized")) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4040 gtk_window_maximize(GTK_WINDOW(gtkblist->window)); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4041 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4042 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4043 |
15823 | 4044 static gboolean pidgin_blist_refresh_timer(PurpleBuddyList *list) |
4045 { | |
4046 PurpleBlistNode *gnode, *cnode; | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4047 |
21041
094bbbe89d0d
Track the actual visibility for the buddy list (unobscured, partially and
Casey Harkins <charkins@pidgin.im>
parents:
21040
diff
changeset
|
4048 if (gtk_blist_visibility == GDK_VISIBILITY_FULLY_OBSCURED |
094bbbe89d0d
Track the actual visibility for the buddy list (unobscured, partially and
Casey Harkins <charkins@pidgin.im>
parents:
21040
diff
changeset
|
4049 || !GTK_WIDGET_VISIBLE(gtkblist->window)) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4050 return TRUE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4051 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4052 for(gnode = list->root; gnode; gnode = gnode->next) { |
15823 | 4053 if(!PURPLE_BLIST_NODE_IS_GROUP(gnode)) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4054 continue; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4055 for(cnode = gnode->child; cnode; cnode = cnode->next) { |
15823 | 4056 if(PURPLE_BLIST_NODE_IS_CONTACT(cnode)) { |
4057 PurpleBuddy *buddy; | |
4058 | |
4059 buddy = purple_contact_get_priority_buddy((PurpleContact*)cnode); | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4060 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4061 if (buddy && |
15823 | 4062 purple_presence_is_idle(purple_buddy_get_presence(buddy))) |
4063 pidgin_blist_update_contact(list, (PurpleBlistNode*)buddy); | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4064 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4065 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4066 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4067 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4068 /* keep on going */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4069 return TRUE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4070 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4071 |
15823 | 4072 static void pidgin_blist_hide_node(PurpleBuddyList *list, PurpleBlistNode *node, gboolean update) |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
4073 { |
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
4074 struct _pidgin_blist_node *gtknode = (struct _pidgin_blist_node *)node->ui_data; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4075 GtkTreeIter iter; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4076 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4077 if (!gtknode || !gtknode->row || !gtkblist) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4078 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4079 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4080 if(gtkblist->selected_node == node) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4081 gtkblist->selected_node = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4082 if (get_iter_from_node(node, &iter)) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4083 gtk_tree_store_remove(gtkblist->treemodel, &iter); |
15823 | 4084 if(update && (PURPLE_BLIST_NODE_IS_CONTACT(node) || |
4085 PURPLE_BLIST_NODE_IS_BUDDY(node) || PURPLE_BLIST_NODE_IS_CHAT(node))) { | |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
4086 pidgin_blist_update(list, node->parent); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4087 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4088 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4089 gtk_tree_row_reference_free(gtknode->row); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4090 gtknode->row = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4091 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4092 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4093 static const char *require_connection[] = |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4094 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4095 N_("/Buddies/New Instant Message..."), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4096 N_("/Buddies/Join a Chat..."), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4097 N_("/Buddies/Get User Info..."), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4098 N_("/Buddies/Add Buddy..."), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4099 N_("/Buddies/Add Chat..."), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4100 N_("/Buddies/Add Group..."), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4101 }; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4102 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4103 static const int require_connection_size = sizeof(require_connection) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4104 / sizeof(*require_connection); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4105 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4106 /** |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4107 * Rebuild dynamic menus and make menu items sensitive/insensitive |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4108 * where appropriate. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4109 */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4110 static void |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
4111 update_menu_bar(PidginBuddyList *gtkblist) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4112 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4113 GtkWidget *widget; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4114 gboolean sensitive; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4115 int i; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4116 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4117 g_return_if_fail(gtkblist != NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4118 |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
4119 pidgin_blist_update_accounts_menu(); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4120 |
15823 | 4121 sensitive = (purple_connections_get_all() != NULL); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4122 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4123 for (i = 0; i < require_connection_size; i++) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4124 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4125 widget = gtk_item_factory_get_widget(gtkblist->ift, require_connection[i]); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4126 gtk_widget_set_sensitive(widget, sensitive); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4127 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4128 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4129 widget = gtk_item_factory_get_widget(gtkblist->ift, N_("/Buddies/Join a Chat...")); |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
4130 gtk_widget_set_sensitive(widget, pidgin_blist_joinchat_is_showable()); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4131 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4132 widget = gtk_item_factory_get_widget(gtkblist->ift, N_("/Buddies/Add Chat...")); |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
4133 gtk_widget_set_sensitive(widget, pidgin_blist_joinchat_is_showable()); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4134 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4135 widget = gtk_item_factory_get_widget(gtkblist->ift, N_("/Tools/Privacy")); |
21175
4ce3e1f998f6
Don't allow tooltips to interfere with editing blist entries. Fixes #3830.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21041
diff
changeset
|
4136 gtk_widget_set_sensitive(widget, sensitive); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4137 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4138 widget = gtk_item_factory_get_widget(gtkblist->ift, N_("/Tools/Room List")); |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
4139 gtk_widget_set_sensitive(widget, pidgin_roomlist_is_showable()); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4140 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4141 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4142 static void |
15823 | 4143 sign_on_off_cb(PurpleConnection *gc, PurpleBuddyList *blist) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4144 { |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
4145 PidginBuddyList *gtkblist = PIDGIN_BLIST(blist); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4146 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4147 update_menu_bar(gtkblist); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4148 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4149 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4150 static void |
15823 | 4151 plugin_changed_cb(PurplePlugin *p, gpointer *data) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4152 { |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
4153 pidgin_blist_update_plugin_actions(); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4154 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4155 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4156 static void |
22007
c38d72677c8a
Probe for -Wstrict-prototypes to get some more warnings. I then cleaned up
Richard Laager <rlaager@wiktel.com>
parents:
21960
diff
changeset
|
4157 unseen_conv_menu(void) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4158 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4159 static GtkWidget *menu = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4160 GList *convs = NULL; |
20960
f9d1e6b138a7
Make the docklet and buddy list menutray agree on unread messages. Both
Casey Harkins <charkins@pidgin.im>
parents:
20937
diff
changeset
|
4161 GList *chats, *ims; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4162 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4163 if (menu) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4164 gtk_widget_destroy(menu); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4165 menu = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4166 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4167 |
20960
f9d1e6b138a7
Make the docklet and buddy list menutray agree on unread messages. Both
Casey Harkins <charkins@pidgin.im>
parents:
20937
diff
changeset
|
4168 ims = pidgin_conversations_find_unseen_list(PURPLE_CONV_TYPE_IM, |
f9d1e6b138a7
Make the docklet and buddy list menutray agree on unread messages. Both
Casey Harkins <charkins@pidgin.im>
parents:
20937
diff
changeset
|
4169 PIDGIN_UNSEEN_TEXT, FALSE, 0); |
f9d1e6b138a7
Make the docklet and buddy list menutray agree on unread messages. Both
Casey Harkins <charkins@pidgin.im>
parents:
20937
diff
changeset
|
4170 |
f9d1e6b138a7
Make the docklet and buddy list menutray agree on unread messages. Both
Casey Harkins <charkins@pidgin.im>
parents:
20937
diff
changeset
|
4171 chats = pidgin_conversations_find_unseen_list(PURPLE_CONV_TYPE_CHAT, |
f9d1e6b138a7
Make the docklet and buddy list menutray agree on unread messages. Both
Casey Harkins <charkins@pidgin.im>
parents:
20937
diff
changeset
|
4172 PIDGIN_UNSEEN_NICK, FALSE, 0); |
f9d1e6b138a7
Make the docklet and buddy list menutray agree on unread messages. Both
Casey Harkins <charkins@pidgin.im>
parents:
20937
diff
changeset
|
4173 |
f9d1e6b138a7
Make the docklet and buddy list menutray agree on unread messages. Both
Casey Harkins <charkins@pidgin.im>
parents:
20937
diff
changeset
|
4174 if(ims && chats) |
f9d1e6b138a7
Make the docklet and buddy list menutray agree on unread messages. Both
Casey Harkins <charkins@pidgin.im>
parents:
20937
diff
changeset
|
4175 convs = g_list_concat(ims, chats); |
f9d1e6b138a7
Make the docklet and buddy list menutray agree on unread messages. Both
Casey Harkins <charkins@pidgin.im>
parents:
20937
diff
changeset
|
4176 else if(ims && !chats) |
f9d1e6b138a7
Make the docklet and buddy list menutray agree on unread messages. Both
Casey Harkins <charkins@pidgin.im>
parents:
20937
diff
changeset
|
4177 convs = ims; |
f9d1e6b138a7
Make the docklet and buddy list menutray agree on unread messages. Both
Casey Harkins <charkins@pidgin.im>
parents:
20937
diff
changeset
|
4178 else if(!ims && chats) |
f9d1e6b138a7
Make the docklet and buddy list menutray agree on unread messages. Both
Casey Harkins <charkins@pidgin.im>
parents:
20937
diff
changeset
|
4179 convs = chats; |
f9d1e6b138a7
Make the docklet and buddy list menutray agree on unread messages. Both
Casey Harkins <charkins@pidgin.im>
parents:
20937
diff
changeset
|
4180 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4181 if (!convs) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4182 /* no conversations added, don't show the menu */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4183 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4184 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4185 menu = gtk_menu_new(); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4186 |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
4187 pidgin_conversations_fill_menu(menu, convs); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4188 g_list_free(convs); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4189 gtk_widget_show_all(menu); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4190 gtk_menu_popup(GTK_MENU(menu), NULL, NULL, NULL, NULL, 3, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4191 gtk_get_current_event_time()); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4192 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4193 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4194 static gboolean |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4195 menutray_press_cb(GtkWidget *widget, GdkEventButton *event) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4196 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4197 GList *convs; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4198 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4199 switch (event->button) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4200 case 1: |
15823 | 4201 convs = pidgin_conversations_find_unseen_list(PURPLE_CONV_TYPE_IM, |
20960
f9d1e6b138a7
Make the docklet and buddy list menutray agree on unread messages. Both
Casey Harkins <charkins@pidgin.im>
parents:
20937
diff
changeset
|
4202 PIDGIN_UNSEEN_TEXT, FALSE, 1); |
f9d1e6b138a7
Make the docklet and buddy list menutray agree on unread messages. Both
Casey Harkins <charkins@pidgin.im>
parents:
20937
diff
changeset
|
4203 |
f9d1e6b138a7
Make the docklet and buddy list menutray agree on unread messages. Both
Casey Harkins <charkins@pidgin.im>
parents:
20937
diff
changeset
|
4204 if(!convs) |
f9d1e6b138a7
Make the docklet and buddy list menutray agree on unread messages. Both
Casey Harkins <charkins@pidgin.im>
parents:
20937
diff
changeset
|
4205 convs = pidgin_conversations_find_unseen_list(PURPLE_CONV_TYPE_CHAT, |
f9d1e6b138a7
Make the docklet and buddy list menutray agree on unread messages. Both
Casey Harkins <charkins@pidgin.im>
parents:
20937
diff
changeset
|
4206 PIDGIN_UNSEEN_NICK, FALSE, 1); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4207 if (convs) { |
20937
2cf9156f4b85
Make clicking on the menutray in the buddy list present the first pending
Casey Harkins <charkins@pidgin.im>
parents:
20872
diff
changeset
|
4208 pidgin_conv_present_conversation((PurpleConversation*)convs->data); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4209 g_list_free(convs); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4210 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4211 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4212 case 3: |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4213 unseen_conv_menu(); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4214 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4215 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4216 return TRUE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4217 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4218 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4219 static void |
15823 | 4220 conversation_updated_cb(PurpleConversation *conv, PurpleConvUpdateType type, |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
4221 PidginBuddyList *gtkblist) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4222 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4223 GList *convs = NULL; |
20960
f9d1e6b138a7
Make the docklet and buddy list menutray agree on unread messages. Both
Casey Harkins <charkins@pidgin.im>
parents:
20937
diff
changeset
|
4224 GList *ims, *chats; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4225 GList *l = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4226 |
15823 | 4227 if (type != PURPLE_CONV_UPDATE_UNSEEN) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4228 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4229 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4230 if(conv->account != NULL && conv->name != NULL) { |
15823 | 4231 PurpleBuddy *buddy = purple_find_buddy(conv->account, conv->name); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4232 if(buddy != NULL) |
15823 | 4233 pidgin_blist_update_buddy(NULL, (PurpleBlistNode *)buddy, TRUE); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4234 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4235 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4236 if (gtkblist->menutrayicon) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4237 gtk_widget_destroy(gtkblist->menutrayicon); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4238 gtkblist->menutrayicon = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4239 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4240 |
20960
f9d1e6b138a7
Make the docklet and buddy list menutray agree on unread messages. Both
Casey Harkins <charkins@pidgin.im>
parents:
20937
diff
changeset
|
4241 ims = pidgin_conversations_find_unseen_list(PURPLE_CONV_TYPE_IM, |
f9d1e6b138a7
Make the docklet and buddy list menutray agree on unread messages. Both
Casey Harkins <charkins@pidgin.im>
parents:
20937
diff
changeset
|
4242 PIDGIN_UNSEEN_TEXT, FALSE, 0); |
f9d1e6b138a7
Make the docklet and buddy list menutray agree on unread messages. Both
Casey Harkins <charkins@pidgin.im>
parents:
20937
diff
changeset
|
4243 |
f9d1e6b138a7
Make the docklet and buddy list menutray agree on unread messages. Both
Casey Harkins <charkins@pidgin.im>
parents:
20937
diff
changeset
|
4244 chats = pidgin_conversations_find_unseen_list(PURPLE_CONV_TYPE_CHAT, |
f9d1e6b138a7
Make the docklet and buddy list menutray agree on unread messages. Both
Casey Harkins <charkins@pidgin.im>
parents:
20937
diff
changeset
|
4245 PIDGIN_UNSEEN_NICK, FALSE, 0); |
f9d1e6b138a7
Make the docklet and buddy list menutray agree on unread messages. Both
Casey Harkins <charkins@pidgin.im>
parents:
20937
diff
changeset
|
4246 |
f9d1e6b138a7
Make the docklet and buddy list menutray agree on unread messages. Both
Casey Harkins <charkins@pidgin.im>
parents:
20937
diff
changeset
|
4247 if(ims && chats) |
f9d1e6b138a7
Make the docklet and buddy list menutray agree on unread messages. Both
Casey Harkins <charkins@pidgin.im>
parents:
20937
diff
changeset
|
4248 convs = g_list_concat(ims, chats); |
f9d1e6b138a7
Make the docklet and buddy list menutray agree on unread messages. Both
Casey Harkins <charkins@pidgin.im>
parents:
20937
diff
changeset
|
4249 else if(ims && !chats) |
f9d1e6b138a7
Make the docklet and buddy list menutray agree on unread messages. Both
Casey Harkins <charkins@pidgin.im>
parents:
20937
diff
changeset
|
4250 convs = ims; |
f9d1e6b138a7
Make the docklet and buddy list menutray agree on unread messages. Both
Casey Harkins <charkins@pidgin.im>
parents:
20937
diff
changeset
|
4251 else if(!ims && chats) |
f9d1e6b138a7
Make the docklet and buddy list menutray agree on unread messages. Both
Casey Harkins <charkins@pidgin.im>
parents:
20937
diff
changeset
|
4252 convs = chats; |
f9d1e6b138a7
Make the docklet and buddy list menutray agree on unread messages. Both
Casey Harkins <charkins@pidgin.im>
parents:
20937
diff
changeset
|
4253 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4254 if (convs) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4255 GtkWidget *img = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4256 GString *tooltip_text = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4257 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4258 tooltip_text = g_string_new(""); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4259 l = convs; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4260 while (l != NULL) { |
20960
f9d1e6b138a7
Make the docklet and buddy list menutray agree on unread messages. Both
Casey Harkins <charkins@pidgin.im>
parents:
20937
diff
changeset
|
4261 int count = 0; |
f9d1e6b138a7
Make the docklet and buddy list menutray agree on unread messages. Both
Casey Harkins <charkins@pidgin.im>
parents:
20937
diff
changeset
|
4262 PidginConversation *gtkconv = PIDGIN_CONVERSATION((PurpleConversation *)l->data); |
f9d1e6b138a7
Make the docklet and buddy list menutray agree on unread messages. Both
Casey Harkins <charkins@pidgin.im>
parents:
20937
diff
changeset
|
4263 |
f9d1e6b138a7
Make the docklet and buddy list menutray agree on unread messages. Both
Casey Harkins <charkins@pidgin.im>
parents:
20937
diff
changeset
|
4264 if(gtkconv) |
f9d1e6b138a7
Make the docklet and buddy list menutray agree on unread messages. Both
Casey Harkins <charkins@pidgin.im>
parents:
20937
diff
changeset
|
4265 count = gtkconv->unseen_count; |
f9d1e6b138a7
Make the docklet and buddy list menutray agree on unread messages. Both
Casey Harkins <charkins@pidgin.im>
parents:
20937
diff
changeset
|
4266 else if(purple_conversation_get_data(l->data, "unseen-count")) |
f9d1e6b138a7
Make the docklet and buddy list menutray agree on unread messages. Both
Casey Harkins <charkins@pidgin.im>
parents:
20937
diff
changeset
|
4267 count = GPOINTER_TO_INT(purple_conversation_get_data(l->data, "unseen-count")); |
f9d1e6b138a7
Make the docklet and buddy list menutray agree on unread messages. Both
Casey Harkins <charkins@pidgin.im>
parents:
20937
diff
changeset
|
4268 |
19899
25f4be036a16
Make changes in the buddylist menutray icon for hidden conversations to work
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19895
diff
changeset
|
4269 g_string_append_printf(tooltip_text, |
25f4be036a16
Make changes in the buddylist menutray icon for hidden conversations to work
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19895
diff
changeset
|
4270 ngettext("%d unread message from %s\n", "%d unread messages from %s\n", count), |
20980
2ba0963b5bdc
Use the conversation title for unread message tooltips. Fixes #3557.
Casey Harkins <charkins@pidgin.im>
parents:
20960
diff
changeset
|
4271 count, purple_conversation_get_title(l->data)); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4272 l = l->next; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4273 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4274 if(tooltip_text->len > 0) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4275 /* get rid of the last newline */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4276 g_string_truncate(tooltip_text, tooltip_text->len -1); |
15632
a830f9756f23
Some more pidgininfication
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15615
diff
changeset
|
4277 img = gtk_image_new_from_stock(PIDGIN_STOCK_TOOLBAR_PENDING, |
15560
442128853bdb
toolbar/menu icons. reduce the imhtmltoolbar spacing. more gaimstock pruning
Sean Egan <seanegan@gmail.com>
parents:
15559
diff
changeset
|
4278 gtk_icon_size_from_name(PIDGIN_ICON_SIZE_TANGO_EXTRA_SMALL)); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4279 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4280 gtkblist->menutrayicon = gtk_event_box_new(); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4281 gtk_container_add(GTK_CONTAINER(gtkblist->menutrayicon), img); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4282 gtk_widget_show(img); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4283 gtk_widget_show(gtkblist->menutrayicon); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4284 g_signal_connect(G_OBJECT(gtkblist->menutrayicon), "button-press-event", G_CALLBACK(menutray_press_cb), NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4285 |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
4286 pidgin_menu_tray_append(PIDGIN_MENU_TRAY(gtkblist->menutray), gtkblist->menutrayicon, tooltip_text->str); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4287 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4288 g_string_free(tooltip_text, TRUE); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4289 g_list_free(convs); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4290 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4291 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4292 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4293 static void |
15823 | 4294 conversation_deleting_cb(PurpleConversation *conv, PidginBuddyList *gtkblist) |
4295 { | |
4296 conversation_updated_cb(conv, PURPLE_CONV_UPDATE_UNSEEN, gtkblist); | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4297 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4298 |
19894
0ac0e112a0fa
Add some stuff so that we don't have to traverse over a list to determine
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19611
diff
changeset
|
4299 static void |
0ac0e112a0fa
Add some stuff so that we don't have to traverse over a list to determine
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19611
diff
changeset
|
4300 conversation_deleted_update_ui_cb(PurpleConversation *conv, struct _pidgin_blist_node *ui) |
0ac0e112a0fa
Add some stuff so that we don't have to traverse over a list to determine
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19611
diff
changeset
|
4301 { |
0ac0e112a0fa
Add some stuff so that we don't have to traverse over a list to determine
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19611
diff
changeset
|
4302 if (ui->conv.conv != conv) |
0ac0e112a0fa
Add some stuff so that we don't have to traverse over a list to determine
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19611
diff
changeset
|
4303 return; |
0ac0e112a0fa
Add some stuff so that we don't have to traverse over a list to determine
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19611
diff
changeset
|
4304 ui->conv.conv = NULL; |
0ac0e112a0fa
Add some stuff so that we don't have to traverse over a list to determine
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19611
diff
changeset
|
4305 ui->conv.flags = 0; |
0ac0e112a0fa
Add some stuff so that we don't have to traverse over a list to determine
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19611
diff
changeset
|
4306 ui->conv.last_message = 0; |
0ac0e112a0fa
Add some stuff so that we don't have to traverse over a list to determine
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19611
diff
changeset
|
4307 } |
0ac0e112a0fa
Add some stuff so that we don't have to traverse over a list to determine
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19611
diff
changeset
|
4308 |
0ac0e112a0fa
Add some stuff so that we don't have to traverse over a list to determine
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19611
diff
changeset
|
4309 static void |
0ac0e112a0fa
Add some stuff so that we don't have to traverse over a list to determine
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19611
diff
changeset
|
4310 written_msg_update_ui_cb(PurpleAccount *account, const char *who, const char *message, |
0ac0e112a0fa
Add some stuff so that we don't have to traverse over a list to determine
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19611
diff
changeset
|
4311 PurpleConversation *conv, PurpleMessageFlags flag, PurpleBlistNode *node) |
0ac0e112a0fa
Add some stuff so that we don't have to traverse over a list to determine
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19611
diff
changeset
|
4312 { |
0ac0e112a0fa
Add some stuff so that we don't have to traverse over a list to determine
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19611
diff
changeset
|
4313 PidginBlistNode *ui = node->ui_data; |
21772
21371ea85970
Fix boldifying the chat entries in the buddylist.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21771
diff
changeset
|
4314 if (ui->conv.conv != conv || !pidgin_conv_is_hidden(PIDGIN_CONVERSATION(conv)) || |
20050
20c336838629
Do not boldify the chat in the buddylist for unread system messages.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
20049
diff
changeset
|
4315 !(flag & (PURPLE_MESSAGE_SEND | PURPLE_MESSAGE_RECV))) |
19894
0ac0e112a0fa
Add some stuff so that we don't have to traverse over a list to determine
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19611
diff
changeset
|
4316 return; |
0ac0e112a0fa
Add some stuff so that we don't have to traverse over a list to determine
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19611
diff
changeset
|
4317 ui->conv.flags |= PIDGIN_BLIST_NODE_HAS_PENDING_MESSAGE; |
0ac0e112a0fa
Add some stuff so that we don't have to traverse over a list to determine
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19611
diff
changeset
|
4318 ui->conv.last_message = time(NULL); /* XXX: for lack of better data */ |
0ac0e112a0fa
Add some stuff so that we don't have to traverse over a list to determine
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19611
diff
changeset
|
4319 pidgin_blist_update(purple_get_blist(), node); |
0ac0e112a0fa
Add some stuff so that we don't have to traverse over a list to determine
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19611
diff
changeset
|
4320 } |
0ac0e112a0fa
Add some stuff so that we don't have to traverse over a list to determine
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19611
diff
changeset
|
4321 |
0ac0e112a0fa
Add some stuff so that we don't have to traverse over a list to determine
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19611
diff
changeset
|
4322 static void |
21772
21371ea85970
Fix boldifying the chat entries in the buddylist.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21771
diff
changeset
|
4323 displayed_msg_update_ui_cb(PidginConversation *gtkconv, PurpleBlistNode *node) |
19894
0ac0e112a0fa
Add some stuff so that we don't have to traverse over a list to determine
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19611
diff
changeset
|
4324 { |
0ac0e112a0fa
Add some stuff so that we don't have to traverse over a list to determine
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19611
diff
changeset
|
4325 PidginBlistNode *ui = node->ui_data; |
21772
21371ea85970
Fix boldifying the chat entries in the buddylist.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21771
diff
changeset
|
4326 if (ui->conv.conv != gtkconv->active_conv) |
19894
0ac0e112a0fa
Add some stuff so that we don't have to traverse over a list to determine
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19611
diff
changeset
|
4327 return; |
0ac0e112a0fa
Add some stuff so that we don't have to traverse over a list to determine
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19611
diff
changeset
|
4328 ui->conv.flags &= ~PIDGIN_BLIST_NODE_HAS_PENDING_MESSAGE; |
0ac0e112a0fa
Add some stuff so that we don't have to traverse over a list to determine
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19611
diff
changeset
|
4329 pidgin_blist_update(purple_get_blist(), node); |
0ac0e112a0fa
Add some stuff so that we don't have to traverse over a list to determine
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19611
diff
changeset
|
4330 } |
0ac0e112a0fa
Add some stuff so that we don't have to traverse over a list to determine
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19611
diff
changeset
|
4331 |
0ac0e112a0fa
Add some stuff so that we don't have to traverse over a list to determine
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19611
diff
changeset
|
4332 static void |
0ac0e112a0fa
Add some stuff so that we don't have to traverse over a list to determine
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19611
diff
changeset
|
4333 conversation_created_cb(PurpleConversation *conv, PidginBuddyList *gtkblist) |
0ac0e112a0fa
Add some stuff so that we don't have to traverse over a list to determine
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19611
diff
changeset
|
4334 { |
0ac0e112a0fa
Add some stuff so that we don't have to traverse over a list to determine
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19611
diff
changeset
|
4335 switch (conv->type) { |
0ac0e112a0fa
Add some stuff so that we don't have to traverse over a list to determine
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19611
diff
changeset
|
4336 case PURPLE_CONV_TYPE_IM: |
0ac0e112a0fa
Add some stuff so that we don't have to traverse over a list to determine
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19611
diff
changeset
|
4337 { |
0ac0e112a0fa
Add some stuff so that we don't have to traverse over a list to determine
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19611
diff
changeset
|
4338 GSList *buddies = purple_find_buddies(conv->account, conv->name); |
0ac0e112a0fa
Add some stuff so that we don't have to traverse over a list to determine
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19611
diff
changeset
|
4339 while (buddies) { |
0ac0e112a0fa
Add some stuff so that we don't have to traverse over a list to determine
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19611
diff
changeset
|
4340 PurpleBlistNode *buddy = buddies->data; |
0ac0e112a0fa
Add some stuff so that we don't have to traverse over a list to determine
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19611
diff
changeset
|
4341 struct _pidgin_blist_node *ui = buddy->ui_data; |
0ac0e112a0fa
Add some stuff so that we don't have to traverse over a list to determine
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19611
diff
changeset
|
4342 buddies = g_slist_delete_link(buddies, buddies); |
0ac0e112a0fa
Add some stuff so that we don't have to traverse over a list to determine
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19611
diff
changeset
|
4343 if (!ui) |
0ac0e112a0fa
Add some stuff so that we don't have to traverse over a list to determine
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19611
diff
changeset
|
4344 continue; |
0ac0e112a0fa
Add some stuff so that we don't have to traverse over a list to determine
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19611
diff
changeset
|
4345 ui->conv.conv = conv; |
0ac0e112a0fa
Add some stuff so that we don't have to traverse over a list to determine
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19611
diff
changeset
|
4346 ui->conv.flags = 0; |
0ac0e112a0fa
Add some stuff so that we don't have to traverse over a list to determine
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19611
diff
changeset
|
4347 ui->conv.last_message = 0; |
0ac0e112a0fa
Add some stuff so that we don't have to traverse over a list to determine
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19611
diff
changeset
|
4348 purple_signal_connect(purple_conversations_get_handle(), "deleting-conversation", |
0ac0e112a0fa
Add some stuff so that we don't have to traverse over a list to determine
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19611
diff
changeset
|
4349 ui, PURPLE_CALLBACK(conversation_deleted_update_ui_cb), ui); |
0ac0e112a0fa
Add some stuff so that we don't have to traverse over a list to determine
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19611
diff
changeset
|
4350 purple_signal_connect(purple_conversations_get_handle(), "wrote-im-msg", |
0ac0e112a0fa
Add some stuff so that we don't have to traverse over a list to determine
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19611
diff
changeset
|
4351 ui, PURPLE_CALLBACK(written_msg_update_ui_cb), buddy); |
21772
21371ea85970
Fix boldifying the chat entries in the buddylist.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21771
diff
changeset
|
4352 purple_signal_connect(pidgin_conversations_get_handle(), "conversation-displayed", |
19894
0ac0e112a0fa
Add some stuff so that we don't have to traverse over a list to determine
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19611
diff
changeset
|
4353 ui, PURPLE_CALLBACK(displayed_msg_update_ui_cb), buddy); |
0ac0e112a0fa
Add some stuff so that we don't have to traverse over a list to determine
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19611
diff
changeset
|
4354 } |
0ac0e112a0fa
Add some stuff so that we don't have to traverse over a list to determine
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19611
diff
changeset
|
4355 } |
21772
21371ea85970
Fix boldifying the chat entries in the buddylist.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21771
diff
changeset
|
4356 break; |
19894
0ac0e112a0fa
Add some stuff so that we don't have to traverse over a list to determine
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19611
diff
changeset
|
4357 case PURPLE_CONV_TYPE_CHAT: |
0ac0e112a0fa
Add some stuff so that we don't have to traverse over a list to determine
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19611
diff
changeset
|
4358 { |
0ac0e112a0fa
Add some stuff so that we don't have to traverse over a list to determine
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19611
diff
changeset
|
4359 PurpleChat *chat = purple_blist_find_chat(conv->account, conv->name); |
0ac0e112a0fa
Add some stuff so that we don't have to traverse over a list to determine
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19611
diff
changeset
|
4360 struct _pidgin_blist_node *ui; |
0ac0e112a0fa
Add some stuff so that we don't have to traverse over a list to determine
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19611
diff
changeset
|
4361 if (!chat) |
0ac0e112a0fa
Add some stuff so that we don't have to traverse over a list to determine
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19611
diff
changeset
|
4362 break; |
0ac0e112a0fa
Add some stuff so that we don't have to traverse over a list to determine
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19611
diff
changeset
|
4363 ui = chat->node.ui_data; |
0ac0e112a0fa
Add some stuff so that we don't have to traverse over a list to determine
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19611
diff
changeset
|
4364 if (!ui) |
0ac0e112a0fa
Add some stuff so that we don't have to traverse over a list to determine
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19611
diff
changeset
|
4365 break; |
0ac0e112a0fa
Add some stuff so that we don't have to traverse over a list to determine
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19611
diff
changeset
|
4366 ui->conv.conv = conv; |
0ac0e112a0fa
Add some stuff so that we don't have to traverse over a list to determine
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19611
diff
changeset
|
4367 ui->conv.flags = 0; |
0ac0e112a0fa
Add some stuff so that we don't have to traverse over a list to determine
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19611
diff
changeset
|
4368 ui->conv.last_message = 0; |
0ac0e112a0fa
Add some stuff so that we don't have to traverse over a list to determine
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19611
diff
changeset
|
4369 purple_signal_connect(purple_conversations_get_handle(), "deleting-conversation", |
0ac0e112a0fa
Add some stuff so that we don't have to traverse over a list to determine
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19611
diff
changeset
|
4370 ui, PURPLE_CALLBACK(conversation_deleted_update_ui_cb), ui); |
0ac0e112a0fa
Add some stuff so that we don't have to traverse over a list to determine
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19611
diff
changeset
|
4371 purple_signal_connect(purple_conversations_get_handle(), "wrote-chat-msg", |
0ac0e112a0fa
Add some stuff so that we don't have to traverse over a list to determine
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19611
diff
changeset
|
4372 ui, PURPLE_CALLBACK(written_msg_update_ui_cb), chat); |
21772
21371ea85970
Fix boldifying the chat entries in the buddylist.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21771
diff
changeset
|
4373 purple_signal_connect(pidgin_conversations_get_handle(), "conversation-displayed", |
19894
0ac0e112a0fa
Add some stuff so that we don't have to traverse over a list to determine
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19611
diff
changeset
|
4374 ui, PURPLE_CALLBACK(displayed_msg_update_ui_cb), chat); |
0ac0e112a0fa
Add some stuff so that we don't have to traverse over a list to determine
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19611
diff
changeset
|
4375 } |
21772
21371ea85970
Fix boldifying the chat entries in the buddylist.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21771
diff
changeset
|
4376 break; |
19894
0ac0e112a0fa
Add some stuff so that we don't have to traverse over a list to determine
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19611
diff
changeset
|
4377 default: |
0ac0e112a0fa
Add some stuff so that we don't have to traverse over a list to determine
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19611
diff
changeset
|
4378 break; |
0ac0e112a0fa
Add some stuff so that we don't have to traverse over a list to determine
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19611
diff
changeset
|
4379 } |
0ac0e112a0fa
Add some stuff so that we don't have to traverse over a list to determine
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19611
diff
changeset
|
4380 } |
0ac0e112a0fa
Add some stuff so that we don't have to traverse over a list to determine
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19611
diff
changeset
|
4381 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4382 /********************************************************************************** |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4383 * Public API Functions * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4384 **********************************************************************************/ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4385 |
15823 | 4386 static void pidgin_blist_new_list(PurpleBuddyList *blist) |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
4387 { |
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
4388 PidginBuddyList *gtkblist; |
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
4389 |
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
4390 gtkblist = g_new0(PidginBuddyList, 1); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4391 gtkblist->connection_errors = g_hash_table_new_full(g_direct_hash, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4392 g_direct_equal, NULL, g_free); |
22108
e21cdaffbcdb
Plug a small leak.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22087
diff
changeset
|
4393 gtkblist->priv = g_new0(PidginBuddyListPrivate, 1); |
21386
86b0dc1f60ae
Group all NAME_IN_USE errors together into one neat mini-dialog on the buddy
Will Thompson <will.thompson@collabora.co.uk>
parents:
21384
diff
changeset
|
4394 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4395 blist->ui_data = gtkblist; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4396 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4397 |
15823 | 4398 static void pidgin_blist_new_node(PurpleBlistNode *node) |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
4399 { |
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
4400 node->ui_data = g_new0(struct _pidgin_blist_node, 1); |
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
4401 } |
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
4402 |
15823 | 4403 gboolean pidgin_blist_node_is_contact_expanded(PurpleBlistNode *node) |
4404 { | |
17830
0e445e906cfd
Fix pidgin_blist_node_is_contact_expanded() to not crash on buddy list
Stu Tomlinson <stu@nosnilmot.com>
parents:
17789
diff
changeset
|
4405 if (PURPLE_BLIST_NODE_IS_BUDDY(node)) { |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4406 node = node->parent; |
17830
0e445e906cfd
Fix pidgin_blist_node_is_contact_expanded() to not crash on buddy list
Stu Tomlinson <stu@nosnilmot.com>
parents:
17789
diff
changeset
|
4407 if (node == NULL) |
0e445e906cfd
Fix pidgin_blist_node_is_contact_expanded() to not crash on buddy list
Stu Tomlinson <stu@nosnilmot.com>
parents:
17789
diff
changeset
|
4408 return FALSE; |
0e445e906cfd
Fix pidgin_blist_node_is_contact_expanded() to not crash on buddy list
Stu Tomlinson <stu@nosnilmot.com>
parents:
17789
diff
changeset
|
4409 } |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4410 |
15823 | 4411 g_return_val_if_fail(PURPLE_BLIST_NODE_IS_CONTACT(node), FALSE); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4412 |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
4413 return ((struct _pidgin_blist_node *)node->ui_data)->contact_expanded; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4414 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4415 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4416 enum { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4417 DRAG_BUDDY, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4418 DRAG_ROW, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4419 DRAG_VCARD, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4420 DRAG_TEXT, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4421 DRAG_URI, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4422 NUM_TARGETS |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4423 }; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4424 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4425 static const char * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4426 item_factory_translate_func (const char *path, gpointer func_data) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4427 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4428 return _((char *)path); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4429 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4430 |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
4431 void pidgin_blist_setup_sort_methods() |
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
4432 { |
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
4433 pidgin_blist_sort_method_reg("none", _("Manually"), sort_method_none); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4434 #if GTK_CHECK_VERSION(2,2,1) |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
4435 pidgin_blist_sort_method_reg("alphabetical", _("Alphabetically"), sort_method_alphabetical); |
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
4436 pidgin_blist_sort_method_reg("status", _("By status"), sort_method_status); |
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
4437 pidgin_blist_sort_method_reg("log_size", _("By log size"), sort_method_log); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4438 #endif |
16062
07554cc5d090
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <stu@nosnilmot.com>
parents:
16010
diff
changeset
|
4439 pidgin_blist_sort_method_set(purple_prefs_get_string(PIDGIN_PREFS_ROOT "/blist/sort_type")); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4440 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4441 |
22011
76e0463db3aa
Squash some compiler warnings, some from my -Wstrict-prototypes fixing.
Richard Laager <rlaager@wiktel.com>
parents:
22007
diff
changeset
|
4442 static void _prefs_change_redo_list(const char *name, PurplePrefType type, |
76e0463db3aa
Squash some compiler warnings, some from my -Wstrict-prototypes fixing.
Richard Laager <rlaager@wiktel.com>
parents:
22007
diff
changeset
|
4443 gconstpointer val, gpointer data) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4444 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4445 GtkTreeSelection *sel; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4446 GtkTreeIter iter; |
15823 | 4447 PurpleBlistNode *node = NULL; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4448 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4449 sel = gtk_tree_view_get_selection(GTK_TREE_VIEW(gtkblist->treeview)); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4450 if (gtk_tree_selection_get_selected(sel, NULL, &iter)) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4451 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4452 gtk_tree_model_get(GTK_TREE_MODEL(gtkblist->treemodel), &iter, NODE_COLUMN, &node, -1); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4453 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4454 |
15823 | 4455 redo_buddy_list(purple_get_blist(), FALSE, FALSE); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4456 #if GTK_CHECK_VERSION(2,6,0) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4457 gtk_tree_view_columns_autosize(GTK_TREE_VIEW(gtkblist->treeview)); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4458 #endif |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4459 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4460 if (node) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4461 { |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
4462 struct _pidgin_blist_node *gtknode; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4463 GtkTreePath *path; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4464 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4465 gtknode = node->ui_data; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4466 if (gtknode && gtknode->row) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4467 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4468 path = gtk_tree_row_reference_get_path(gtknode->row); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4469 gtk_tree_selection_select_path(sel, path); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4470 gtk_tree_view_scroll_to_cell(GTK_TREE_VIEW(gtkblist->treeview), path, NULL, FALSE, 0, 0); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4471 gtk_tree_path_free(path); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4472 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4473 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4474 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4475 |
15823 | 4476 static void _prefs_change_sort_method(const char *pref_name, PurplePrefType type, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4477 gconstpointer val, gpointer data) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4478 { |
16062
07554cc5d090
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <stu@nosnilmot.com>
parents:
16010
diff
changeset
|
4479 if(!strcmp(pref_name, PIDGIN_PREFS_ROOT "/blist/sort_type")) |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
4480 pidgin_blist_sort_method_set(val); |
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
4481 } |
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
4482 |
21583
21cbdaf265f6
This fixes the problem where all accounts are disabled due to connection
Stu Tomlinson <stu@nosnilmot.com>
parents:
21582
diff
changeset
|
4483 static gboolean pidgin_blist_select_notebook_page_cb(gpointer user_data) |
21cbdaf265f6
This fixes the problem where all accounts are disabled due to connection
Stu Tomlinson <stu@nosnilmot.com>
parents:
21582
diff
changeset
|
4484 { |
21cbdaf265f6
This fixes the problem where all accounts are disabled due to connection
Stu Tomlinson <stu@nosnilmot.com>
parents:
21582
diff
changeset
|
4485 PidginBuddyList *gtkblist = (PidginBuddyList *)user_data; |
21cbdaf265f6
This fixes the problem where all accounts are disabled due to connection
Stu Tomlinson <stu@nosnilmot.com>
parents:
21582
diff
changeset
|
4486 int errors = 0; |
21644
6018f0ba6aca
Patch from DB42 to add a little '' in a scrollbook. I edited the patch in
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21622
diff
changeset
|
4487 GList *list = NULL; |
21583
21cbdaf265f6
This fixes the problem where all accounts are disabled due to connection
Stu Tomlinson <stu@nosnilmot.com>
parents:
21582
diff
changeset
|
4488 PidginBuddyListPrivate *priv; |
21cbdaf265f6
This fixes the problem where all accounts are disabled due to connection
Stu Tomlinson <stu@nosnilmot.com>
parents:
21582
diff
changeset
|
4489 |
21cbdaf265f6
This fixes the problem where all accounts are disabled due to connection
Stu Tomlinson <stu@nosnilmot.com>
parents:
21582
diff
changeset
|
4490 priv = PIDGIN_BUDDY_LIST_GET_PRIVATE(gtkblist); |
21cbdaf265f6
This fixes the problem where all accounts are disabled due to connection
Stu Tomlinson <stu@nosnilmot.com>
parents:
21582
diff
changeset
|
4491 |
21cbdaf265f6
This fixes the problem where all accounts are disabled due to connection
Stu Tomlinson <stu@nosnilmot.com>
parents:
21582
diff
changeset
|
4492 /* this is far too ugly thanks to me not wanting to fix #3989 properly right now */ |
21cbdaf265f6
This fixes the problem where all accounts are disabled due to connection
Stu Tomlinson <stu@nosnilmot.com>
parents:
21582
diff
changeset
|
4493 if (priv->error_scrollbook != NULL) { |
21cbdaf265f6
This fixes the problem where all accounts are disabled due to connection
Stu Tomlinson <stu@nosnilmot.com>
parents:
21582
diff
changeset
|
4494 #if GTK_CHECK_VERSION(2,2,0) |
21cbdaf265f6
This fixes the problem where all accounts are disabled due to connection
Stu Tomlinson <stu@nosnilmot.com>
parents:
21582
diff
changeset
|
4495 errors = gtk_notebook_get_n_pages(GTK_NOTEBOOK(priv->error_scrollbook->notebook)); |
21cbdaf265f6
This fixes the problem where all accounts are disabled due to connection
Stu Tomlinson <stu@nosnilmot.com>
parents:
21582
diff
changeset
|
4496 #else |
21cbdaf265f6
This fixes the problem where all accounts are disabled due to connection
Stu Tomlinson <stu@nosnilmot.com>
parents:
21582
diff
changeset
|
4497 errors = g_list_length(GTK_NOTEBOOK(priv->error_scrollbook->notebook)->children); |
21cbdaf265f6
This fixes the problem where all accounts are disabled due to connection
Stu Tomlinson <stu@nosnilmot.com>
parents:
21582
diff
changeset
|
4498 #endif |
21cbdaf265f6
This fixes the problem where all accounts are disabled due to connection
Stu Tomlinson <stu@nosnilmot.com>
parents:
21582
diff
changeset
|
4499 } |
21644
6018f0ba6aca
Patch from DB42 to add a little '' in a scrollbook. I edited the patch in
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21622
diff
changeset
|
4500 if ((list = purple_accounts_get_all_active()) != NULL || errors) { |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4501 gtk_notebook_set_current_page(GTK_NOTEBOOK(gtkblist->notebook), 1); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4502 g_list_free(list); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4503 } else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4504 gtk_notebook_set_current_page(GTK_NOTEBOOK(gtkblist->notebook), 0); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4505 |
21583
21cbdaf265f6
This fixes the problem where all accounts are disabled due to connection
Stu Tomlinson <stu@nosnilmot.com>
parents:
21582
diff
changeset
|
4506 return FALSE; |
21cbdaf265f6
This fixes the problem where all accounts are disabled due to connection
Stu Tomlinson <stu@nosnilmot.com>
parents:
21582
diff
changeset
|
4507 } |
21cbdaf265f6
This fixes the problem where all accounts are disabled due to connection
Stu Tomlinson <stu@nosnilmot.com>
parents:
21582
diff
changeset
|
4508 |
21cbdaf265f6
This fixes the problem where all accounts are disabled due to connection
Stu Tomlinson <stu@nosnilmot.com>
parents:
21582
diff
changeset
|
4509 static void pidgin_blist_select_notebook_page(PidginBuddyList *gtkblist) |
21cbdaf265f6
This fixes the problem where all accounts are disabled due to connection
Stu Tomlinson <stu@nosnilmot.com>
parents:
21582
diff
changeset
|
4510 { |
21cbdaf265f6
This fixes the problem where all accounts are disabled due to connection
Stu Tomlinson <stu@nosnilmot.com>
parents:
21582
diff
changeset
|
4511 purple_timeout_add(0, pidgin_blist_select_notebook_page_cb, gtkblist); |
21cbdaf265f6
This fixes the problem where all accounts are disabled due to connection
Stu Tomlinson <stu@nosnilmot.com>
parents:
21582
diff
changeset
|
4512 } |
21cbdaf265f6
This fixes the problem where all accounts are disabled due to connection
Stu Tomlinson <stu@nosnilmot.com>
parents:
21582
diff
changeset
|
4513 |
21cbdaf265f6
This fixes the problem where all accounts are disabled due to connection
Stu Tomlinson <stu@nosnilmot.com>
parents:
21582
diff
changeset
|
4514 static void account_modified(PurpleAccount *account, PidginBuddyList *gtkblist) |
21cbdaf265f6
This fixes the problem where all accounts are disabled due to connection
Stu Tomlinson <stu@nosnilmot.com>
parents:
21582
diff
changeset
|
4515 { |
21cbdaf265f6
This fixes the problem where all accounts are disabled due to connection
Stu Tomlinson <stu@nosnilmot.com>
parents:
21582
diff
changeset
|
4516 if (!gtkblist) |
21cbdaf265f6
This fixes the problem where all accounts are disabled due to connection
Stu Tomlinson <stu@nosnilmot.com>
parents:
21582
diff
changeset
|
4517 return; |
21cbdaf265f6
This fixes the problem where all accounts are disabled due to connection
Stu Tomlinson <stu@nosnilmot.com>
parents:
21582
diff
changeset
|
4518 |
21cbdaf265f6
This fixes the problem where all accounts are disabled due to connection
Stu Tomlinson <stu@nosnilmot.com>
parents:
21582
diff
changeset
|
4519 pidgin_blist_select_notebook_page(gtkblist); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4520 update_menu_bar(gtkblist); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4521 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4522 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4523 static void |
15823 | 4524 account_status_changed(PurpleAccount *account, PurpleStatus *old, |
4525 PurpleStatus *new, PidginBuddyList *gtkblist) | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4526 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4527 if (!gtkblist) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4528 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4529 |
21583
21cbdaf265f6
This fixes the problem where all accounts are disabled due to connection
Stu Tomlinson <stu@nosnilmot.com>
parents:
21582
diff
changeset
|
4530 account_modified(account, gtkblist); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4531 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4532 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4533 static gboolean |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
4534 gtk_blist_window_key_press_cb(GtkWidget *w, GdkEventKey *event, PidginBuddyList *gtkblist) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4535 { |
17519
e83972691531
Fix #1284. "Pressing Ctrl+C while editing a buddy list alias shouldn't "Join a chat""
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
17275
diff
changeset
|
4536 GtkWidget *widget; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4537 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4538 if (!gtkblist) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4539 return FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4540 |
17519
e83972691531
Fix #1284. "Pressing Ctrl+C while editing a buddy list alias shouldn't "Join a chat""
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
17275
diff
changeset
|
4541 widget = gtk_window_get_focus(GTK_WINDOW(gtkblist->window)); |
e83972691531
Fix #1284. "Pressing Ctrl+C while editing a buddy list alias shouldn't "Join a chat""
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
17275
diff
changeset
|
4542 |
e83972691531
Fix #1284. "Pressing Ctrl+C while editing a buddy list alias shouldn't "Join a chat""
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
17275
diff
changeset
|
4543 if (GTK_IS_IMHTML(widget) || GTK_IS_ENTRY(widget)) { |
e83972691531
Fix #1284. "Pressing Ctrl+C while editing a buddy list alias shouldn't "Join a chat""
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
17275
diff
changeset
|
4544 if (gtk_bindings_activate(GTK_OBJECT(widget), event->keyval, event->state)) |
e83972691531
Fix #1284. "Pressing Ctrl+C while editing a buddy list alias shouldn't "Join a chat""
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
17275
diff
changeset
|
4545 return TRUE; |
e83972691531
Fix #1284. "Pressing Ctrl+C while editing a buddy list alias shouldn't "Join a chat""
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
17275
diff
changeset
|
4546 } |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4547 return FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4548 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4549 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4550 static gboolean |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4551 headline_hover_close(int x, int y) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4552 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4553 GtkWidget *w = gtkblist->headline_hbox; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4554 if (x <= w->allocation.width && x >= w->allocation.width - HEADLINE_CLOSE_SIZE && |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4555 y >= 0 && y <= HEADLINE_CLOSE_SIZE) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4556 return TRUE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4557 return FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4558 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4559 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4560 static gboolean |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
4561 headline_box_enter_cb(GtkWidget *widget, GdkEventCrossing *event, PidginBuddyList *gtkblist) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4562 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4563 gdk_window_set_cursor(widget->window, gtkblist->hand_cursor); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4564 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4565 if (gtkblist->headline_close) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4566 #if GTK_CHECK_VERSION(2,2,0) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4567 gdk_draw_pixbuf(widget->window, NULL, gtkblist->headline_close, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4568 #else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4569 gdk_pixbuf_render_to_drawable(gtkblist->headline_close, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4570 GDK_DRAWABLE(widget->window), NULL, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4571 #endif |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4572 0, 0, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4573 widget->allocation.width - 2 - HEADLINE_CLOSE_SIZE, 2, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4574 HEADLINE_CLOSE_SIZE, HEADLINE_CLOSE_SIZE, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4575 GDK_RGB_DITHER_NONE, 0, 0); |
21397
521df9b2698a
Work around a bug in vim's bracket matching, whereby it doesn't realise that
Will Thompson <will.thompson@collabora.co.uk>
parents:
21396
diff
changeset
|
4576 #if 0 |
521df9b2698a
Work around a bug in vim's bracket matching, whereby it doesn't realise that
Will Thompson <will.thompson@collabora.co.uk>
parents:
21396
diff
changeset
|
4577 /* The presence of one opening paren in each branch of |
521df9b2698a
Work around a bug in vim's bracket matching, whereby it doesn't realise that
Will Thompson <will.thompson@collabora.co.uk>
parents:
21396
diff
changeset
|
4578 * GTK_CHECK_VERSION confuses vim's bracket matching for the |
521df9b2698a
Work around a bug in vim's bracket matching, whereby it doesn't realise that
Will Thompson <will.thompson@collabora.co.uk>
parents:
21396
diff
changeset
|
4579 * rest of the file. |
521df9b2698a
Work around a bug in vim's bracket matching, whereby it doesn't realise that
Will Thompson <will.thompson@collabora.co.uk>
parents:
21396
diff
changeset
|
4580 */ |
521df9b2698a
Work around a bug in vim's bracket matching, whereby it doesn't realise that
Will Thompson <will.thompson@collabora.co.uk>
parents:
21396
diff
changeset
|
4581 ) |
521df9b2698a
Work around a bug in vim's bracket matching, whereby it doesn't realise that
Will Thompson <will.thompson@collabora.co.uk>
parents:
21396
diff
changeset
|
4582 #endif |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4583 gtk_paint_focus(widget->style, widget->window, GTK_STATE_PRELIGHT, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4584 NULL, widget, NULL, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4585 widget->allocation.width - HEADLINE_CLOSE_SIZE - 3, 1, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4586 HEADLINE_CLOSE_SIZE + 2, HEADLINE_CLOSE_SIZE + 2); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4587 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4588 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4589 return FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4590 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4591 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4592 #if 0 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4593 static gboolean |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
4594 headline_box_motion_cb(GtkWidget *widget, GdkEventMotion *event, PidginBuddyList *gtkblist) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4595 { |
15823 | 4596 purple_debug_fatal("motion", "%d %d\n", (int)event->x, (int)event->y); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4597 if (headline_hover_close((int)event->x, (int)event->y)) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4598 gtk_paint_focus(widget->style, widget->window, GTK_STATE_PRELIGHT, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4599 NULL, widget, NULL, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4600 widget->allocation.width - HEADLINE_CLOSE_SIZE - 3, 1, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4601 HEADLINE_CLOSE_SIZE + 2, HEADLINE_CLOSE_SIZE + 2); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4602 return FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4603 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4604 #endif |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4605 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4606 static gboolean |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
4607 headline_box_leave_cb(GtkWidget *widget, GdkEventCrossing *event, PidginBuddyList *gtkblist) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4608 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4609 gdk_window_set_cursor(widget->window, gtkblist->arrow_cursor); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4610 if (gtkblist->headline_close) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4611 GdkRectangle rect = {widget->allocation.width - 3 - HEADLINE_CLOSE_SIZE, 1, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4612 HEADLINE_CLOSE_SIZE + 2, HEADLINE_CLOSE_SIZE + 2}; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4613 gdk_window_invalidate_rect(widget->window, &rect, TRUE); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4614 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4615 return FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4616 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4617 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4618 static void |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
4619 reset_headline(PidginBuddyList *gtkblist) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4620 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4621 gtkblist->headline_callback = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4622 gtkblist->headline_data = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4623 gtkblist->headline_destroy = NULL; |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
4624 pidgin_set_urgent(GTK_WINDOW(gtkblist->window), FALSE); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4625 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4626 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4627 static gboolean |
22662
84dc71e67a72
Fix a null pointer deref (hopefully). I haven't been able to consistently
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22646
diff
changeset
|
4628 headline_click_callback(gpointer unused) |
84dc71e67a72
Fix a null pointer deref (hopefully). I haven't been able to consistently
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22646
diff
changeset
|
4629 { |
84dc71e67a72
Fix a null pointer deref (hopefully). I haven't been able to consistently
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22646
diff
changeset
|
4630 if (gtkblist->headline_callback) |
84dc71e67a72
Fix a null pointer deref (hopefully). I haven't been able to consistently
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22646
diff
changeset
|
4631 ((GSourceFunc) gtkblist->headline_callback)(gtkblist->headline_data); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4632 reset_headline(gtkblist); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4633 return FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4634 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4635 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4636 static gboolean |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
4637 headline_box_press_cb(GtkWidget *widget, GdkEventButton *event, PidginBuddyList *gtkblist) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4638 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4639 gtk_widget_hide(gtkblist->headline_hbox); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4640 if (gtkblist->headline_callback && !headline_hover_close((int)event->x, (int)event->y)) |
22662
84dc71e67a72
Fix a null pointer deref (hopefully). I haven't been able to consistently
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22646
diff
changeset
|
4641 g_idle_add(headline_click_callback, NULL); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4642 else { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4643 if (gtkblist->headline_destroy) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4644 gtkblist->headline_destroy(gtkblist->headline_data); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4645 reset_headline(gtkblist); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4646 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4647 return TRUE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4648 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4649 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4650 /***********************************/ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4651 /* Connection error handling stuff */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4652 /***********************************/ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4653 |
21386
86b0dc1f60ae
Group all NAME_IN_USE errors together into one neat mini-dialog on the buddy
Will Thompson <will.thompson@collabora.co.uk>
parents:
21384
diff
changeset
|
4654 #define OBJECT_DATA_KEY_ACCOUNT "account" |
22297
00c20312e289
Don't clear account errors during account-error-changed emission. I can't
Will Thompson <will.thompson@collabora.co.uk>
parents:
22113
diff
changeset
|
4655 #define DO_NOT_CLEAR_ERROR "do-not-clear-error" |
21386
86b0dc1f60ae
Group all NAME_IN_USE errors together into one neat mini-dialog on the buddy
Will Thompson <will.thompson@collabora.co.uk>
parents:
21384
diff
changeset
|
4656 |
86b0dc1f60ae
Group all NAME_IN_USE errors together into one neat mini-dialog on the buddy
Will Thompson <will.thompson@collabora.co.uk>
parents:
21384
diff
changeset
|
4657 static gboolean |
86b0dc1f60ae
Group all NAME_IN_USE errors together into one neat mini-dialog on the buddy
Will Thompson <will.thompson@collabora.co.uk>
parents:
21384
diff
changeset
|
4658 find_account_widget(GObject *widget, |
86b0dc1f60ae
Group all NAME_IN_USE errors together into one neat mini-dialog on the buddy
Will Thompson <will.thompson@collabora.co.uk>
parents:
21384
diff
changeset
|
4659 PurpleAccount *account) |
86b0dc1f60ae
Group all NAME_IN_USE errors together into one neat mini-dialog on the buddy
Will Thompson <will.thompson@collabora.co.uk>
parents:
21384
diff
changeset
|
4660 { |
86b0dc1f60ae
Group all NAME_IN_USE errors together into one neat mini-dialog on the buddy
Will Thompson <will.thompson@collabora.co.uk>
parents:
21384
diff
changeset
|
4661 if (g_object_get_data(widget, OBJECT_DATA_KEY_ACCOUNT) == account) |
86b0dc1f60ae
Group all NAME_IN_USE errors together into one neat mini-dialog on the buddy
Will Thompson <will.thompson@collabora.co.uk>
parents:
21384
diff
changeset
|
4662 return 0; /* found */ |
86b0dc1f60ae
Group all NAME_IN_USE errors together into one neat mini-dialog on the buddy
Will Thompson <will.thompson@collabora.co.uk>
parents:
21384
diff
changeset
|
4663 else |
86b0dc1f60ae
Group all NAME_IN_USE errors together into one neat mini-dialog on the buddy
Will Thompson <will.thompson@collabora.co.uk>
parents:
21384
diff
changeset
|
4664 return 1; |
86b0dc1f60ae
Group all NAME_IN_USE errors together into one neat mini-dialog on the buddy
Will Thompson <will.thompson@collabora.co.uk>
parents:
21384
diff
changeset
|
4665 } |
86b0dc1f60ae
Group all NAME_IN_USE errors together into one neat mini-dialog on the buddy
Will Thompson <will.thompson@collabora.co.uk>
parents:
21384
diff
changeset
|
4666 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4667 static void |
21386
86b0dc1f60ae
Group all NAME_IN_USE errors together into one neat mini-dialog on the buddy
Will Thompson <will.thompson@collabora.co.uk>
parents:
21384
diff
changeset
|
4668 pack_prpl_icon_start(GtkWidget *box, |
86b0dc1f60ae
Group all NAME_IN_USE errors together into one neat mini-dialog on the buddy
Will Thompson <will.thompson@collabora.co.uk>
parents:
21384
diff
changeset
|
4669 PurpleAccount *account) |
86b0dc1f60ae
Group all NAME_IN_USE errors together into one neat mini-dialog on the buddy
Will Thompson <will.thompson@collabora.co.uk>
parents:
21384
diff
changeset
|
4670 { |
86b0dc1f60ae
Group all NAME_IN_USE errors together into one neat mini-dialog on the buddy
Will Thompson <will.thompson@collabora.co.uk>
parents:
21384
diff
changeset
|
4671 GdkPixbuf *pixbuf; |
86b0dc1f60ae
Group all NAME_IN_USE errors together into one neat mini-dialog on the buddy
Will Thompson <will.thompson@collabora.co.uk>
parents:
21384
diff
changeset
|
4672 GtkWidget *image; |
86b0dc1f60ae
Group all NAME_IN_USE errors together into one neat mini-dialog on the buddy
Will Thompson <will.thompson@collabora.co.uk>
parents:
21384
diff
changeset
|
4673 |
86b0dc1f60ae
Group all NAME_IN_USE errors together into one neat mini-dialog on the buddy
Will Thompson <will.thompson@collabora.co.uk>
parents:
21384
diff
changeset
|
4674 pixbuf = pidgin_create_prpl_icon(account, PIDGIN_PRPL_ICON_SMALL); |
86b0dc1f60ae
Group all NAME_IN_USE errors together into one neat mini-dialog on the buddy
Will Thompson <will.thompson@collabora.co.uk>
parents:
21384
diff
changeset
|
4675 if (pixbuf != NULL) { |
86b0dc1f60ae
Group all NAME_IN_USE errors together into one neat mini-dialog on the buddy
Will Thompson <will.thompson@collabora.co.uk>
parents:
21384
diff
changeset
|
4676 image = gtk_image_new_from_pixbuf(pixbuf); |
86b0dc1f60ae
Group all NAME_IN_USE errors together into one neat mini-dialog on the buddy
Will Thompson <will.thompson@collabora.co.uk>
parents:
21384
diff
changeset
|
4677 g_object_unref(pixbuf); |
86b0dc1f60ae
Group all NAME_IN_USE errors together into one neat mini-dialog on the buddy
Will Thompson <will.thompson@collabora.co.uk>
parents:
21384
diff
changeset
|
4678 |
86b0dc1f60ae
Group all NAME_IN_USE errors together into one neat mini-dialog on the buddy
Will Thompson <will.thompson@collabora.co.uk>
parents:
21384
diff
changeset
|
4679 gtk_box_pack_start(GTK_BOX(box), image, FALSE, FALSE, 0); |
86b0dc1f60ae
Group all NAME_IN_USE errors together into one neat mini-dialog on the buddy
Will Thompson <will.thompson@collabora.co.uk>
parents:
21384
diff
changeset
|
4680 } |
86b0dc1f60ae
Group all NAME_IN_USE errors together into one neat mini-dialog on the buddy
Will Thompson <will.thompson@collabora.co.uk>
parents:
21384
diff
changeset
|
4681 } |
86b0dc1f60ae
Group all NAME_IN_USE errors together into one neat mini-dialog on the buddy
Will Thompson <will.thompson@collabora.co.uk>
parents:
21384
diff
changeset
|
4682 |
21401
c1c7e28223f8
Display all connection errors in a scrollbook, which is packed inside
Will Thompson <will.thompson@collabora.co.uk>
parents:
21400
diff
changeset
|
4683 static void |
c1c7e28223f8
Display all connection errors in a scrollbook, which is packed inside
Will Thompson <will.thompson@collabora.co.uk>
parents:
21400
diff
changeset
|
4684 add_error_dialog(PidginBuddyList *gtkblist, |
c1c7e28223f8
Display all connection errors in a scrollbook, which is packed inside
Will Thompson <will.thompson@collabora.co.uk>
parents:
21400
diff
changeset
|
4685 GtkWidget *dialog) |
c1c7e28223f8
Display all connection errors in a scrollbook, which is packed inside
Will Thompson <will.thompson@collabora.co.uk>
parents:
21400
diff
changeset
|
4686 { |
c1c7e28223f8
Display all connection errors in a scrollbook, which is packed inside
Will Thompson <will.thompson@collabora.co.uk>
parents:
21400
diff
changeset
|
4687 PidginBuddyListPrivate *priv = PIDGIN_BUDDY_LIST_GET_PRIVATE(gtkblist); |
c1c7e28223f8
Display all connection errors in a scrollbook, which is packed inside
Will Thompson <will.thompson@collabora.co.uk>
parents:
21400
diff
changeset
|
4688 gtk_container_add(GTK_CONTAINER(priv->error_scrollbook), dialog); |
c1c7e28223f8
Display all connection errors in a scrollbook, which is packed inside
Will Thompson <will.thompson@collabora.co.uk>
parents:
21400
diff
changeset
|
4689 } |
c1c7e28223f8
Display all connection errors in a scrollbook, which is packed inside
Will Thompson <will.thompson@collabora.co.uk>
parents:
21400
diff
changeset
|
4690 |
21410
4ccc4ad0a8b0
Use PidginMiniDialog to display signed in elsewhere errors in the blist.
Will Thompson <will.thompson@collabora.co.uk>
parents:
21401
diff
changeset
|
4691 static GtkWidget * |
4ccc4ad0a8b0
Use PidginMiniDialog to display signed in elsewhere errors in the blist.
Will Thompson <will.thompson@collabora.co.uk>
parents:
21401
diff
changeset
|
4692 find_child_widget_by_account(GtkContainer *container, |
4ccc4ad0a8b0
Use PidginMiniDialog to display signed in elsewhere errors in the blist.
Will Thompson <will.thompson@collabora.co.uk>
parents:
21401
diff
changeset
|
4693 PurpleAccount *account) |
21401
c1c7e28223f8
Display all connection errors in a scrollbook, which is packed inside
Will Thompson <will.thompson@collabora.co.uk>
parents:
21400
diff
changeset
|
4694 { |
c1c7e28223f8
Display all connection errors in a scrollbook, which is packed inside
Will Thompson <will.thompson@collabora.co.uk>
parents:
21400
diff
changeset
|
4695 GList *l = NULL; |
21618
85fc97ffe538
Workarounds to fix some issues with the minidialog and scrollbook.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21583
diff
changeset
|
4696 GList *children = NULL; |
21410
4ccc4ad0a8b0
Use PidginMiniDialog to display signed in elsewhere errors in the blist.
Will Thompson <will.thompson@collabora.co.uk>
parents:
21401
diff
changeset
|
4697 GtkWidget *ret = NULL; |
21618
85fc97ffe538
Workarounds to fix some issues with the minidialog and scrollbook.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21583
diff
changeset
|
4698 /* XXX: Workaround for the currently incomplete implementation of PidginScrollBook */ |
85fc97ffe538
Workarounds to fix some issues with the minidialog and scrollbook.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21583
diff
changeset
|
4699 if (PIDGIN_IS_SCROLL_BOOK(container)) |
21622
1c139f0493b9
Squish a compile warning
Stu Tomlinson <stu@nosnilmot.com>
parents:
21618
diff
changeset
|
4700 container = GTK_CONTAINER(PIDGIN_SCROLL_BOOK(container)->notebook); |
21618
85fc97ffe538
Workarounds to fix some issues with the minidialog and scrollbook.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21583
diff
changeset
|
4701 children = gtk_container_get_children(container); |
21401
c1c7e28223f8
Display all connection errors in a scrollbook, which is packed inside
Will Thompson <will.thompson@collabora.co.uk>
parents:
21400
diff
changeset
|
4702 l = g_list_find_custom(children, account, (GCompareFunc) find_account_widget); |
21410
4ccc4ad0a8b0
Use PidginMiniDialog to display signed in elsewhere errors in the blist.
Will Thompson <will.thompson@collabora.co.uk>
parents:
21401
diff
changeset
|
4703 if (l) |
4ccc4ad0a8b0
Use PidginMiniDialog to display signed in elsewhere errors in the blist.
Will Thompson <will.thompson@collabora.co.uk>
parents:
21401
diff
changeset
|
4704 ret = GTK_WIDGET(l->data); |
21401
c1c7e28223f8
Display all connection errors in a scrollbook, which is packed inside
Will Thompson <will.thompson@collabora.co.uk>
parents:
21400
diff
changeset
|
4705 g_list_free(children); |
21410
4ccc4ad0a8b0
Use PidginMiniDialog to display signed in elsewhere errors in the blist.
Will Thompson <will.thompson@collabora.co.uk>
parents:
21401
diff
changeset
|
4706 return ret; |
4ccc4ad0a8b0
Use PidginMiniDialog to display signed in elsewhere errors in the blist.
Will Thompson <will.thompson@collabora.co.uk>
parents:
21401
diff
changeset
|
4707 } |
4ccc4ad0a8b0
Use PidginMiniDialog to display signed in elsewhere errors in the blist.
Will Thompson <will.thompson@collabora.co.uk>
parents:
21401
diff
changeset
|
4708 |
4ccc4ad0a8b0
Use PidginMiniDialog to display signed in elsewhere errors in the blist.
Will Thompson <will.thompson@collabora.co.uk>
parents:
21401
diff
changeset
|
4709 static void |
4ccc4ad0a8b0
Use PidginMiniDialog to display signed in elsewhere errors in the blist.
Will Thompson <will.thompson@collabora.co.uk>
parents:
21401
diff
changeset
|
4710 remove_child_widget_by_account(GtkContainer *container, |
4ccc4ad0a8b0
Use PidginMiniDialog to display signed in elsewhere errors in the blist.
Will Thompson <will.thompson@collabora.co.uk>
parents:
21401
diff
changeset
|
4711 PurpleAccount *account) |
4ccc4ad0a8b0
Use PidginMiniDialog to display signed in elsewhere errors in the blist.
Will Thompson <will.thompson@collabora.co.uk>
parents:
21401
diff
changeset
|
4712 { |
4ccc4ad0a8b0
Use PidginMiniDialog to display signed in elsewhere errors in the blist.
Will Thompson <will.thompson@collabora.co.uk>
parents:
21401
diff
changeset
|
4713 GtkWidget *widget = find_child_widget_by_account(container, account); |
21583
21cbdaf265f6
This fixes the problem where all accounts are disabled due to connection
Stu Tomlinson <stu@nosnilmot.com>
parents:
21582
diff
changeset
|
4714 if(widget) { |
22297
00c20312e289
Don't clear account errors during account-error-changed emission. I can't
Will Thompson <will.thompson@collabora.co.uk>
parents:
22113
diff
changeset
|
4715 /* Since we are destroying the widget in response to a change in |
00c20312e289
Don't clear account errors during account-error-changed emission. I can't
Will Thompson <will.thompson@collabora.co.uk>
parents:
22113
diff
changeset
|
4716 * error, we should not clear the error. |
00c20312e289
Don't clear account errors during account-error-changed emission. I can't
Will Thompson <will.thompson@collabora.co.uk>
parents:
22113
diff
changeset
|
4717 */ |
00c20312e289
Don't clear account errors during account-error-changed emission. I can't
Will Thompson <will.thompson@collabora.co.uk>
parents:
22113
diff
changeset
|
4718 g_object_set_data(G_OBJECT(widget), DO_NOT_CLEAR_ERROR, |
00c20312e289
Don't clear account errors during account-error-changed emission. I can't
Will Thompson <will.thompson@collabora.co.uk>
parents:
22113
diff
changeset
|
4719 GINT_TO_POINTER(TRUE)); |
21410
4ccc4ad0a8b0
Use PidginMiniDialog to display signed in elsewhere errors in the blist.
Will Thompson <will.thompson@collabora.co.uk>
parents:
21401
diff
changeset
|
4720 gtk_widget_destroy(widget); |
21583
21cbdaf265f6
This fixes the problem where all accounts are disabled due to connection
Stu Tomlinson <stu@nosnilmot.com>
parents:
21582
diff
changeset
|
4721 } |
21401
c1c7e28223f8
Display all connection errors in a scrollbook, which is packed inside
Will Thompson <will.thompson@collabora.co.uk>
parents:
21400
diff
changeset
|
4722 } |
c1c7e28223f8
Display all connection errors in a scrollbook, which is packed inside
Will Thompson <will.thompson@collabora.co.uk>
parents:
21400
diff
changeset
|
4723 |
21386
86b0dc1f60ae
Group all NAME_IN_USE errors together into one neat mini-dialog on the buddy
Will Thompson <will.thompson@collabora.co.uk>
parents:
21384
diff
changeset
|
4724 /* Generic error buttons */ |
86b0dc1f60ae
Group all NAME_IN_USE errors together into one neat mini-dialog on the buddy
Will Thompson <will.thompson@collabora.co.uk>
parents:
21384
diff
changeset
|
4725 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4726 static void |
21398
0a7cccd6d081
Use minidialogs rather than horrifying buttons with red text to notify the user
Will Thompson <will.thompson@collabora.co.uk>
parents:
21397
diff
changeset
|
4727 generic_error_modify_cb(PurpleAccount *account) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4728 { |
21583
21cbdaf265f6
This fixes the problem where all accounts are disabled due to connection
Stu Tomlinson <stu@nosnilmot.com>
parents:
21582
diff
changeset
|
4729 purple_account_clear_current_error(account); |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
4730 pidgin_account_dialog_show(PIDGIN_MODIFY_ACCOUNT_DIALOG, account); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4731 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4732 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4733 static void |
21398
0a7cccd6d081
Use minidialogs rather than horrifying buttons with red text to notify the user
Will Thompson <will.thompson@collabora.co.uk>
parents:
21397
diff
changeset
|
4734 generic_error_enable_cb(PurpleAccount *account) |
15823 | 4735 { |
21583
21cbdaf265f6
This fixes the problem where all accounts are disabled due to connection
Stu Tomlinson <stu@nosnilmot.com>
parents:
21582
diff
changeset
|
4736 purple_account_clear_current_error(account); |
15823 | 4737 purple_account_set_enabled(account, purple_core_get_ui(), TRUE); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4738 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4739 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4740 static void |
21398
0a7cccd6d081
Use minidialogs rather than horrifying buttons with red text to notify the user
Will Thompson <will.thompson@collabora.co.uk>
parents:
21397
diff
changeset
|
4741 generic_error_destroy_cb(GtkObject *dialog, |
0a7cccd6d081
Use minidialogs rather than horrifying buttons with red text to notify the user
Will Thompson <will.thompson@collabora.co.uk>
parents:
21397
diff
changeset
|
4742 PurpleAccount *account) |
0a7cccd6d081
Use minidialogs rather than horrifying buttons with red text to notify the user
Will Thompson <will.thompson@collabora.co.uk>
parents:
21397
diff
changeset
|
4743 { |
0a7cccd6d081
Use minidialogs rather than horrifying buttons with red text to notify the user
Will Thompson <will.thompson@collabora.co.uk>
parents:
21397
diff
changeset
|
4744 g_hash_table_remove(gtkblist->connection_errors, account); |
22297
00c20312e289
Don't clear account errors during account-error-changed emission. I can't
Will Thompson <will.thompson@collabora.co.uk>
parents:
22113
diff
changeset
|
4745 /* If the error dialog is being destroyed in response to the |
00c20312e289
Don't clear account errors during account-error-changed emission. I can't
Will Thompson <will.thompson@collabora.co.uk>
parents:
22113
diff
changeset
|
4746 * account-error-changed signal, we don't want to clear the current |
00c20312e289
Don't clear account errors during account-error-changed emission. I can't
Will Thompson <will.thompson@collabora.co.uk>
parents:
22113
diff
changeset
|
4747 * error. |
00c20312e289
Don't clear account errors during account-error-changed emission. I can't
Will Thompson <will.thompson@collabora.co.uk>
parents:
22113
diff
changeset
|
4748 */ |
00c20312e289
Don't clear account errors during account-error-changed emission. I can't
Will Thompson <will.thompson@collabora.co.uk>
parents:
22113
diff
changeset
|
4749 if (g_object_get_data(G_OBJECT(dialog), DO_NOT_CLEAR_ERROR) == NULL) |
00c20312e289
Don't clear account errors during account-error-changed emission. I can't
Will Thompson <will.thompson@collabora.co.uk>
parents:
22113
diff
changeset
|
4750 purple_account_clear_current_error(account); |
21380
a62b60a5745d
* When an account error changes, just recreate its button rather than every
Will Thompson <will.thompson@collabora.co.uk>
parents:
21378
diff
changeset
|
4751 } |
a62b60a5745d
* When an account error changes, just recreate its button rather than every
Will Thompson <will.thompson@collabora.co.uk>
parents:
21378
diff
changeset
|
4752 |
21458
11101e8c5793
Add a clickable link to the SSL FAQ to errors about accounts which need SSL
Will Thompson <will.thompson@collabora.co.uk>
parents:
21429
diff
changeset
|
4753 #define SSL_FAQ_URI "http://d.pidgin.im/wiki/FAQssl" |
11101e8c5793
Add a clickable link to the SSL FAQ to errors about accounts which need SSL
Will Thompson <will.thompson@collabora.co.uk>
parents:
21429
diff
changeset
|
4754 |
11101e8c5793
Add a clickable link to the SSL FAQ to errors about accounts which need SSL
Will Thompson <will.thompson@collabora.co.uk>
parents:
21429
diff
changeset
|
4755 static void |
11101e8c5793
Add a clickable link to the SSL FAQ to errors about accounts which need SSL
Will Thompson <will.thompson@collabora.co.uk>
parents:
21429
diff
changeset
|
4756 ssl_faq_clicked_cb(GtkButton *button, |
11101e8c5793
Add a clickable link to the SSL FAQ to errors about accounts which need SSL
Will Thompson <will.thompson@collabora.co.uk>
parents:
21429
diff
changeset
|
4757 PurpleAccount *account) |
11101e8c5793
Add a clickable link to the SSL FAQ to errors about accounts which need SSL
Will Thompson <will.thompson@collabora.co.uk>
parents:
21429
diff
changeset
|
4758 { |
11101e8c5793
Add a clickable link to the SSL FAQ to errors about accounts which need SSL
Will Thompson <will.thompson@collabora.co.uk>
parents:
21429
diff
changeset
|
4759 purple_notify_uri(NULL, SSL_FAQ_URI); |
11101e8c5793
Add a clickable link to the SSL FAQ to errors about accounts which need SSL
Will Thompson <will.thompson@collabora.co.uk>
parents:
21429
diff
changeset
|
4760 } |
11101e8c5793
Add a clickable link to the SSL FAQ to errors about accounts which need SSL
Will Thompson <will.thompson@collabora.co.uk>
parents:
21429
diff
changeset
|
4761 |
21380
a62b60a5745d
* When an account error changes, just recreate its button rather than every
Will Thompson <will.thompson@collabora.co.uk>
parents:
21378
diff
changeset
|
4762 static void |
21398
0a7cccd6d081
Use minidialogs rather than horrifying buttons with red text to notify the user
Will Thompson <will.thompson@collabora.co.uk>
parents:
21397
diff
changeset
|
4763 add_generic_error_dialog(PurpleAccount *account, |
0a7cccd6d081
Use minidialogs rather than horrifying buttons with red text to notify the user
Will Thompson <will.thompson@collabora.co.uk>
parents:
21397
diff
changeset
|
4764 const PurpleConnectionErrorInfo *err) |
0a7cccd6d081
Use minidialogs rather than horrifying buttons with red text to notify the user
Will Thompson <will.thompson@collabora.co.uk>
parents:
21397
diff
changeset
|
4765 { |
0a7cccd6d081
Use minidialogs rather than horrifying buttons with red text to notify the user
Will Thompson <will.thompson@collabora.co.uk>
parents:
21397
diff
changeset
|
4766 GtkWidget *mini_dialog; |
0a7cccd6d081
Use minidialogs rather than horrifying buttons with red text to notify the user
Will Thompson <will.thompson@collabora.co.uk>
parents:
21397
diff
changeset
|
4767 const char *username = purple_account_get_username(account); |
0a7cccd6d081
Use minidialogs rather than horrifying buttons with red text to notify the user
Will Thompson <will.thompson@collabora.co.uk>
parents:
21397
diff
changeset
|
4768 gboolean enabled = |
0a7cccd6d081
Use minidialogs rather than horrifying buttons with red text to notify the user
Will Thompson <will.thompson@collabora.co.uk>
parents:
21397
diff
changeset
|
4769 purple_account_get_enabled(account, purple_core_get_ui()); |
21413
ccceac5e1976
Say that an account has been disabled if it has been in the title of a generic
Will Thompson <will.thompson@collabora.co.uk>
parents:
21411
diff
changeset
|
4770 char *primary; |
21644
6018f0ba6aca
Patch from DB42 to add a little '' in a scrollbook. I edited the patch in
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21622
diff
changeset
|
4771 |
21413
ccceac5e1976
Say that an account has been disabled if it has been in the title of a generic
Will Thompson <will.thompson@collabora.co.uk>
parents:
21411
diff
changeset
|
4772 if (enabled) |
ccceac5e1976
Say that an account has been disabled if it has been in the title of a generic
Will Thompson <will.thompson@collabora.co.uk>
parents:
21411
diff
changeset
|
4773 primary = g_strdup_printf(_("%s disconnected"), username); |
ccceac5e1976
Say that an account has been disabled if it has been in the title of a generic
Will Thompson <will.thompson@collabora.co.uk>
parents:
21411
diff
changeset
|
4774 else |
ccceac5e1976
Say that an account has been disabled if it has been in the title of a generic
Will Thompson <will.thompson@collabora.co.uk>
parents:
21411
diff
changeset
|
4775 primary = g_strdup_printf(_("%s disabled"), username); |
21398
0a7cccd6d081
Use minidialogs rather than horrifying buttons with red text to notify the user
Will Thompson <will.thompson@collabora.co.uk>
parents:
21397
diff
changeset
|
4776 |
21429
3f87c15d8438
Use the error icon rather than the disconnect icon in connection error
Will Thompson <will.thompson@collabora.co.uk>
parents:
21420
diff
changeset
|
4777 mini_dialog = pidgin_make_mini_dialog(NULL, PIDGIN_STOCK_DIALOG_ERROR, |
21398
0a7cccd6d081
Use minidialogs rather than horrifying buttons with red text to notify the user
Will Thompson <will.thompson@collabora.co.uk>
parents:
21397
diff
changeset
|
4778 primary, err->description, account, |
0a7cccd6d081
Use minidialogs rather than horrifying buttons with red text to notify the user
Will Thompson <will.thompson@collabora.co.uk>
parents:
21397
diff
changeset
|
4779 (enabled ? _("Reconnect") : _("Re-enable")), |
0a7cccd6d081
Use minidialogs rather than horrifying buttons with red text to notify the user
Will Thompson <will.thompson@collabora.co.uk>
parents:
21397
diff
changeset
|
4780 (enabled ? PURPLE_CALLBACK(purple_account_connect) |
0a7cccd6d081
Use minidialogs rather than horrifying buttons with red text to notify the user
Will Thompson <will.thompson@collabora.co.uk>
parents:
21397
diff
changeset
|
4781 : PURPLE_CALLBACK(generic_error_enable_cb)), |
0a7cccd6d081
Use minidialogs rather than horrifying buttons with red text to notify the user
Will Thompson <will.thompson@collabora.co.uk>
parents:
21397
diff
changeset
|
4782 _("Modify Account"), PURPLE_CALLBACK(generic_error_modify_cb), |
0a7cccd6d081
Use minidialogs rather than horrifying buttons with red text to notify the user
Will Thompson <will.thompson@collabora.co.uk>
parents:
21397
diff
changeset
|
4783 NULL); |
0a7cccd6d081
Use minidialogs rather than horrifying buttons with red text to notify the user
Will Thompson <will.thompson@collabora.co.uk>
parents:
21397
diff
changeset
|
4784 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4785 g_free(primary); |
21398
0a7cccd6d081
Use minidialogs rather than horrifying buttons with red text to notify the user
Will Thompson <will.thompson@collabora.co.uk>
parents:
21397
diff
changeset
|
4786 |
0a7cccd6d081
Use minidialogs rather than horrifying buttons with red text to notify the user
Will Thompson <will.thompson@collabora.co.uk>
parents:
21397
diff
changeset
|
4787 g_object_set_data(G_OBJECT(mini_dialog), OBJECT_DATA_KEY_ACCOUNT, |
0a7cccd6d081
Use minidialogs rather than horrifying buttons with red text to notify the user
Will Thompson <will.thompson@collabora.co.uk>
parents:
21397
diff
changeset
|
4788 account); |
0a7cccd6d081
Use minidialogs rather than horrifying buttons with red text to notify the user
Will Thompson <will.thompson@collabora.co.uk>
parents:
21397
diff
changeset
|
4789 |
21458
11101e8c5793
Add a clickable link to the SSL FAQ to errors about accounts which need SSL
Will Thompson <will.thompson@collabora.co.uk>
parents:
21429
diff
changeset
|
4790 if(err->type == PURPLE_CONNECTION_ERROR_NO_SSL_SUPPORT) { |
11101e8c5793
Add a clickable link to the SSL FAQ to errors about accounts which need SSL
Will Thompson <will.thompson@collabora.co.uk>
parents:
21429
diff
changeset
|
4791 GtkWidget *faq_button = gtk_button_new(); |
11101e8c5793
Add a clickable link to the SSL FAQ to errors about accounts which need SSL
Will Thompson <will.thompson@collabora.co.uk>
parents:
21429
diff
changeset
|
4792 GtkWidget *faq_label = gtk_label_new(NULL); |
11101e8c5793
Add a clickable link to the SSL FAQ to errors about accounts which need SSL
Will Thompson <will.thompson@collabora.co.uk>
parents:
21429
diff
changeset
|
4793 gtk_label_set_markup(GTK_LABEL(faq_label), |
11101e8c5793
Add a clickable link to the SSL FAQ to errors about accounts which need SSL
Will Thompson <will.thompson@collabora.co.uk>
parents:
21429
diff
changeset
|
4794 "<span underline=\"single\" foreground=\"blue\"" |
11101e8c5793
Add a clickable link to the SSL FAQ to errors about accounts which need SSL
Will Thompson <will.thompson@collabora.co.uk>
parents:
21429
diff
changeset
|
4795 " size=\"smaller\">" SSL_FAQ_URI "</span>"); |
11101e8c5793
Add a clickable link to the SSL FAQ to errors about accounts which need SSL
Will Thompson <will.thompson@collabora.co.uk>
parents:
21429
diff
changeset
|
4796 #if GTK_CHECK_VERSION(2,6,0) |
11101e8c5793
Add a clickable link to the SSL FAQ to errors about accounts which need SSL
Will Thompson <will.thompson@collabora.co.uk>
parents:
21429
diff
changeset
|
4797 g_object_set(G_OBJECT(faq_label), "ellipsize", |
11101e8c5793
Add a clickable link to the SSL FAQ to errors about accounts which need SSL
Will Thompson <will.thompson@collabora.co.uk>
parents:
21429
diff
changeset
|
4798 PANGO_ELLIPSIZE_MIDDLE, NULL); |
11101e8c5793
Add a clickable link to the SSL FAQ to errors about accounts which need SSL
Will Thompson <will.thompson@collabora.co.uk>
parents:
21429
diff
changeset
|
4799 #endif |
11101e8c5793
Add a clickable link to the SSL FAQ to errors about accounts which need SSL
Will Thompson <will.thompson@collabora.co.uk>
parents:
21429
diff
changeset
|
4800 gtk_container_add(GTK_CONTAINER(faq_button), faq_label); |
11101e8c5793
Add a clickable link to the SSL FAQ to errors about accounts which need SSL
Will Thompson <will.thompson@collabora.co.uk>
parents:
21429
diff
changeset
|
4801 gtk_button_set_relief(GTK_BUTTON(faq_button), GTK_RELIEF_NONE); |
11101e8c5793
Add a clickable link to the SSL FAQ to errors about accounts which need SSL
Will Thompson <will.thompson@collabora.co.uk>
parents:
21429
diff
changeset
|
4802 |
11101e8c5793
Add a clickable link to the SSL FAQ to errors about accounts which need SSL
Will Thompson <will.thompson@collabora.co.uk>
parents:
21429
diff
changeset
|
4803 g_signal_connect(faq_button, "clicked", |
11101e8c5793
Add a clickable link to the SSL FAQ to errors about accounts which need SSL
Will Thompson <will.thompson@collabora.co.uk>
parents:
21429
diff
changeset
|
4804 (GCallback)ssl_faq_clicked_cb, account); |
11101e8c5793
Add a clickable link to the SSL FAQ to errors about accounts which need SSL
Will Thompson <will.thompson@collabora.co.uk>
parents:
21429
diff
changeset
|
4805 |
11101e8c5793
Add a clickable link to the SSL FAQ to errors about accounts which need SSL
Will Thompson <will.thompson@collabora.co.uk>
parents:
21429
diff
changeset
|
4806 gtk_box_pack_start(PIDGIN_MINI_DIALOG(mini_dialog)->contents, |
11101e8c5793
Add a clickable link to the SSL FAQ to errors about accounts which need SSL
Will Thompson <will.thompson@collabora.co.uk>
parents:
21429
diff
changeset
|
4807 faq_button, FALSE, FALSE, 0); |
11101e8c5793
Add a clickable link to the SSL FAQ to errors about accounts which need SSL
Will Thompson <will.thompson@collabora.co.uk>
parents:
21429
diff
changeset
|
4808 } |
11101e8c5793
Add a clickable link to the SSL FAQ to errors about accounts which need SSL
Will Thompson <will.thompson@collabora.co.uk>
parents:
21429
diff
changeset
|
4809 |
21398
0a7cccd6d081
Use minidialogs rather than horrifying buttons with red text to notify the user
Will Thompson <will.thompson@collabora.co.uk>
parents:
21397
diff
changeset
|
4810 g_signal_connect_after(mini_dialog, "destroy", |
0a7cccd6d081
Use minidialogs rather than horrifying buttons with red text to notify the user
Will Thompson <will.thompson@collabora.co.uk>
parents:
21397
diff
changeset
|
4811 (GCallback)generic_error_destroy_cb, |
0a7cccd6d081
Use minidialogs rather than horrifying buttons with red text to notify the user
Will Thompson <will.thompson@collabora.co.uk>
parents:
21397
diff
changeset
|
4812 account); |
0a7cccd6d081
Use minidialogs rather than horrifying buttons with red text to notify the user
Will Thompson <will.thompson@collabora.co.uk>
parents:
21397
diff
changeset
|
4813 |
21411
b089fd1ad059
Hide the description label of the PidginMiniDialog used for signed on elsewhere
Will Thompson <will.thompson@collabora.co.uk>
parents:
21410
diff
changeset
|
4814 add_error_dialog(gtkblist, mini_dialog); |
21380
a62b60a5745d
* When an account error changes, just recreate its button rather than every
Will Thompson <will.thompson@collabora.co.uk>
parents:
21378
diff
changeset
|
4815 } |
a62b60a5745d
* When an account error changes, just recreate its button rather than every
Will Thompson <will.thompson@collabora.co.uk>
parents:
21378
diff
changeset
|
4816 |
21373
cbf197042bad
Add the old error to the account-error-changed signal.
Will Thompson <will.thompson@collabora.co.uk>
parents:
21369
diff
changeset
|
4817 static void |
21398
0a7cccd6d081
Use minidialogs rather than horrifying buttons with red text to notify the user
Will Thompson <will.thompson@collabora.co.uk>
parents:
21397
diff
changeset
|
4818 remove_generic_error_dialog(PurpleAccount *account) |
0a7cccd6d081
Use minidialogs rather than horrifying buttons with red text to notify the user
Will Thompson <will.thompson@collabora.co.uk>
parents:
21397
diff
changeset
|
4819 { |
21401
c1c7e28223f8
Display all connection errors in a scrollbook, which is packed inside
Will Thompson <will.thompson@collabora.co.uk>
parents:
21400
diff
changeset
|
4820 PidginBuddyListPrivate *priv = PIDGIN_BUDDY_LIST_GET_PRIVATE(gtkblist); |
21497
e2e70f45307f
Remove account error dialogs from the scrollbook's notebook, not from the
Will Thompson <will.thompson@collabora.co.uk>
parents:
21458
diff
changeset
|
4821 remove_child_widget_by_account( |
21583
21cbdaf265f6
This fixes the problem where all accounts are disabled due to connection
Stu Tomlinson <stu@nosnilmot.com>
parents:
21582
diff
changeset
|
4822 GTK_CONTAINER(priv->error_scrollbook), account); |
21384
5c26dc790c71
Break creating and removing generic error boxes by account into their own
Will Thompson <will.thompson@collabora.co.uk>
parents:
21382
diff
changeset
|
4823 } |
5c26dc790c71
Break creating and removing generic error boxes by account into their own
Will Thompson <will.thompson@collabora.co.uk>
parents:
21382
diff
changeset
|
4824 |
21386
86b0dc1f60ae
Group all NAME_IN_USE errors together into one neat mini-dialog on the buddy
Will Thompson <will.thompson@collabora.co.uk>
parents:
21384
diff
changeset
|
4825 |
22298
7c5734075af3
Rework update_account_error_state to reuse existing mini-dialogs if they exist,
Will Thompson <will.thompson@collabora.co.uk>
parents:
22297
diff
changeset
|
4826 static void |
7c5734075af3
Rework update_account_error_state to reuse existing mini-dialogs if they exist,
Will Thompson <will.thompson@collabora.co.uk>
parents:
22297
diff
changeset
|
4827 update_generic_error_message(PurpleAccount *account, |
7c5734075af3
Rework update_account_error_state to reuse existing mini-dialogs if they exist,
Will Thompson <will.thompson@collabora.co.uk>
parents:
22297
diff
changeset
|
4828 const char *description) |
7c5734075af3
Rework update_account_error_state to reuse existing mini-dialogs if they exist,
Will Thompson <will.thompson@collabora.co.uk>
parents:
22297
diff
changeset
|
4829 { |
7c5734075af3
Rework update_account_error_state to reuse existing mini-dialogs if they exist,
Will Thompson <will.thompson@collabora.co.uk>
parents:
22297
diff
changeset
|
4830 PidginBuddyListPrivate *priv = PIDGIN_BUDDY_LIST_GET_PRIVATE(gtkblist); |
7c5734075af3
Rework update_account_error_state to reuse existing mini-dialogs if they exist,
Will Thompson <will.thompson@collabora.co.uk>
parents:
22297
diff
changeset
|
4831 GtkWidget *mini_dialog = find_child_widget_by_account( |
7c5734075af3
Rework update_account_error_state to reuse existing mini-dialogs if they exist,
Will Thompson <will.thompson@collabora.co.uk>
parents:
22297
diff
changeset
|
4832 GTK_CONTAINER(priv->error_scrollbook), account); |
7c5734075af3
Rework update_account_error_state to reuse existing mini-dialogs if they exist,
Will Thompson <will.thompson@collabora.co.uk>
parents:
22297
diff
changeset
|
4833 pidgin_mini_dialog_set_description(PIDGIN_MINI_DIALOG(mini_dialog), |
7c5734075af3
Rework update_account_error_state to reuse existing mini-dialogs if they exist,
Will Thompson <will.thompson@collabora.co.uk>
parents:
22297
diff
changeset
|
4834 description); |
7c5734075af3
Rework update_account_error_state to reuse existing mini-dialogs if they exist,
Will Thompson <will.thompson@collabora.co.uk>
parents:
22297
diff
changeset
|
4835 } |
7c5734075af3
Rework update_account_error_state to reuse existing mini-dialogs if they exist,
Will Thompson <will.thompson@collabora.co.uk>
parents:
22297
diff
changeset
|
4836 |
7c5734075af3
Rework update_account_error_state to reuse existing mini-dialogs if they exist,
Will Thompson <will.thompson@collabora.co.uk>
parents:
22297
diff
changeset
|
4837 |
21386
86b0dc1f60ae
Group all NAME_IN_USE errors together into one neat mini-dialog on the buddy
Will Thompson <will.thompson@collabora.co.uk>
parents:
21384
diff
changeset
|
4838 /* Notifications about accounts which were disconnected with |
86b0dc1f60ae
Group all NAME_IN_USE errors together into one neat mini-dialog on the buddy
Will Thompson <will.thompson@collabora.co.uk>
parents:
21384
diff
changeset
|
4839 * PURPLE_CONNECTION_ERROR_NAME_IN_USE |
86b0dc1f60ae
Group all NAME_IN_USE errors together into one neat mini-dialog on the buddy
Will Thompson <will.thompson@collabora.co.uk>
parents:
21384
diff
changeset
|
4840 */ |
86b0dc1f60ae
Group all NAME_IN_USE errors together into one neat mini-dialog on the buddy
Will Thompson <will.thompson@collabora.co.uk>
parents:
21384
diff
changeset
|
4841 |
21410
4ccc4ad0a8b0
Use PidginMiniDialog to display signed in elsewhere errors in the blist.
Will Thompson <will.thompson@collabora.co.uk>
parents:
21401
diff
changeset
|
4842 typedef void (*AccountFunction)(PurpleAccount *); |
4ccc4ad0a8b0
Use PidginMiniDialog to display signed in elsewhere errors in the blist.
Will Thompson <will.thompson@collabora.co.uk>
parents:
21401
diff
changeset
|
4843 |
21386
86b0dc1f60ae
Group all NAME_IN_USE errors together into one neat mini-dialog on the buddy
Will Thompson <will.thompson@collabora.co.uk>
parents:
21384
diff
changeset
|
4844 static void |
21410
4ccc4ad0a8b0
Use PidginMiniDialog to display signed in elsewhere errors in the blist.
Will Thompson <will.thompson@collabora.co.uk>
parents:
21401
diff
changeset
|
4845 elsewhere_foreach_account(PidginMiniDialog *mini_dialog, |
4ccc4ad0a8b0
Use PidginMiniDialog to display signed in elsewhere errors in the blist.
Will Thompson <will.thompson@collabora.co.uk>
parents:
21401
diff
changeset
|
4846 AccountFunction f) |
4ccc4ad0a8b0
Use PidginMiniDialog to display signed in elsewhere errors in the blist.
Will Thompson <will.thompson@collabora.co.uk>
parents:
21401
diff
changeset
|
4847 { |
4ccc4ad0a8b0
Use PidginMiniDialog to display signed in elsewhere errors in the blist.
Will Thompson <will.thompson@collabora.co.uk>
parents:
21401
diff
changeset
|
4848 PurpleAccount *account; |
4ccc4ad0a8b0
Use PidginMiniDialog to display signed in elsewhere errors in the blist.
Will Thompson <will.thompson@collabora.co.uk>
parents:
21401
diff
changeset
|
4849 GList *labels = gtk_container_get_children( |
4ccc4ad0a8b0
Use PidginMiniDialog to display signed in elsewhere errors in the blist.
Will Thompson <will.thompson@collabora.co.uk>
parents:
21401
diff
changeset
|
4850 GTK_CONTAINER(mini_dialog->contents)); |
4ccc4ad0a8b0
Use PidginMiniDialog to display signed in elsewhere errors in the blist.
Will Thompson <will.thompson@collabora.co.uk>
parents:
21401
diff
changeset
|
4851 GList *l; |
4ccc4ad0a8b0
Use PidginMiniDialog to display signed in elsewhere errors in the blist.
Will Thompson <will.thompson@collabora.co.uk>
parents:
21401
diff
changeset
|
4852 |
4ccc4ad0a8b0
Use PidginMiniDialog to display signed in elsewhere errors in the blist.
Will Thompson <will.thompson@collabora.co.uk>
parents:
21401
diff
changeset
|
4853 for (l = labels; l; l = l->next) { |
4ccc4ad0a8b0
Use PidginMiniDialog to display signed in elsewhere errors in the blist.
Will Thompson <will.thompson@collabora.co.uk>
parents:
21401
diff
changeset
|
4854 account = g_object_get_data(G_OBJECT(l->data), OBJECT_DATA_KEY_ACCOUNT); |
4ccc4ad0a8b0
Use PidginMiniDialog to display signed in elsewhere errors in the blist.
Will Thompson <will.thompson@collabora.co.uk>
parents:
21401
diff
changeset
|
4855 if (account) |
4ccc4ad0a8b0
Use PidginMiniDialog to display signed in elsewhere errors in the blist.
Will Thompson <will.thompson@collabora.co.uk>
parents:
21401
diff
changeset
|
4856 f(account); |
4ccc4ad0a8b0
Use PidginMiniDialog to display signed in elsewhere errors in the blist.
Will Thompson <will.thompson@collabora.co.uk>
parents:
21401
diff
changeset
|
4857 else |
4ccc4ad0a8b0
Use PidginMiniDialog to display signed in elsewhere errors in the blist.
Will Thompson <will.thompson@collabora.co.uk>
parents:
21401
diff
changeset
|
4858 purple_debug_warning("gtkblist", "mini_dialog's child " |
4ccc4ad0a8b0
Use PidginMiniDialog to display signed in elsewhere errors in the blist.
Will Thompson <will.thompson@collabora.co.uk>
parents:
21401
diff
changeset
|
4859 "didn't have an account stored in it!"); |
4ccc4ad0a8b0
Use PidginMiniDialog to display signed in elsewhere errors in the blist.
Will Thompson <will.thompson@collabora.co.uk>
parents:
21401
diff
changeset
|
4860 } |
4ccc4ad0a8b0
Use PidginMiniDialog to display signed in elsewhere errors in the blist.
Will Thompson <will.thompson@collabora.co.uk>
parents:
21401
diff
changeset
|
4861 g_list_free(labels); |
21386
86b0dc1f60ae
Group all NAME_IN_USE errors together into one neat mini-dialog on the buddy
Will Thompson <will.thompson@collabora.co.uk>
parents:
21384
diff
changeset
|
4862 } |
86b0dc1f60ae
Group all NAME_IN_USE errors together into one neat mini-dialog on the buddy
Will Thompson <will.thompson@collabora.co.uk>
parents:
21384
diff
changeset
|
4863 |
86b0dc1f60ae
Group all NAME_IN_USE errors together into one neat mini-dialog on the buddy
Will Thompson <will.thompson@collabora.co.uk>
parents:
21384
diff
changeset
|
4864 static void |
21410
4ccc4ad0a8b0
Use PidginMiniDialog to display signed in elsewhere errors in the blist.
Will Thompson <will.thompson@collabora.co.uk>
parents:
21401
diff
changeset
|
4865 enable_account(PurpleAccount *account) |
15823 | 4866 { |
4867 purple_account_set_enabled(account, purple_core_get_ui(), TRUE); | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4868 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4869 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4870 static void |
21410
4ccc4ad0a8b0
Use PidginMiniDialog to display signed in elsewhere errors in the blist.
Will Thompson <will.thompson@collabora.co.uk>
parents:
21401
diff
changeset
|
4871 reconnect_elsewhere_accounts(PidginMiniDialog *mini_dialog, |
4ccc4ad0a8b0
Use PidginMiniDialog to display signed in elsewhere errors in the blist.
Will Thompson <will.thompson@collabora.co.uk>
parents:
21401
diff
changeset
|
4872 GtkButton *button, |
4ccc4ad0a8b0
Use PidginMiniDialog to display signed in elsewhere errors in the blist.
Will Thompson <will.thompson@collabora.co.uk>
parents:
21401
diff
changeset
|
4873 gpointer unused) |
4ccc4ad0a8b0
Use PidginMiniDialog to display signed in elsewhere errors in the blist.
Will Thompson <will.thompson@collabora.co.uk>
parents:
21401
diff
changeset
|
4874 { |
4ccc4ad0a8b0
Use PidginMiniDialog to display signed in elsewhere errors in the blist.
Will Thompson <will.thompson@collabora.co.uk>
parents:
21401
diff
changeset
|
4875 elsewhere_foreach_account(mini_dialog, enable_account); |
4ccc4ad0a8b0
Use PidginMiniDialog to display signed in elsewhere errors in the blist.
Will Thompson <will.thompson@collabora.co.uk>
parents:
21401
diff
changeset
|
4876 } |
4ccc4ad0a8b0
Use PidginMiniDialog to display signed in elsewhere errors in the blist.
Will Thompson <will.thompson@collabora.co.uk>
parents:
21401
diff
changeset
|
4877 |
4ccc4ad0a8b0
Use PidginMiniDialog to display signed in elsewhere errors in the blist.
Will Thompson <will.thompson@collabora.co.uk>
parents:
21401
diff
changeset
|
4878 static void |
21845
45d1e229fadd
Dismissing the signed on elsewhere minidialog should clear all the errors;
Will Thompson <will.thompson@collabora.co.uk>
parents:
21781
diff
changeset
|
4879 clear_elsewhere_errors(PidginMiniDialog *mini_dialog, |
45d1e229fadd
Dismissing the signed on elsewhere minidialog should clear all the errors;
Will Thompson <will.thompson@collabora.co.uk>
parents:
21781
diff
changeset
|
4880 gpointer unused) |
45d1e229fadd
Dismissing the signed on elsewhere minidialog should clear all the errors;
Will Thompson <will.thompson@collabora.co.uk>
parents:
21781
diff
changeset
|
4881 { |
45d1e229fadd
Dismissing the signed on elsewhere minidialog should clear all the errors;
Will Thompson <will.thompson@collabora.co.uk>
parents:
21781
diff
changeset
|
4882 elsewhere_foreach_account(mini_dialog, purple_account_clear_current_error); |
45d1e229fadd
Dismissing the signed on elsewhere minidialog should clear all the errors;
Will Thompson <will.thompson@collabora.co.uk>
parents:
21781
diff
changeset
|
4883 } |
45d1e229fadd
Dismissing the signed on elsewhere minidialog should clear all the errors;
Will Thompson <will.thompson@collabora.co.uk>
parents:
21781
diff
changeset
|
4884 |
45d1e229fadd
Dismissing the signed on elsewhere minidialog should clear all the errors;
Will Thompson <will.thompson@collabora.co.uk>
parents:
21781
diff
changeset
|
4885 static void |
21410
4ccc4ad0a8b0
Use PidginMiniDialog to display signed in elsewhere errors in the blist.
Will Thompson <will.thompson@collabora.co.uk>
parents:
21401
diff
changeset
|
4886 ensure_signed_on_elsewhere_minidialog(PidginBuddyList *gtkblist) |
21386
86b0dc1f60ae
Group all NAME_IN_USE errors together into one neat mini-dialog on the buddy
Will Thompson <will.thompson@collabora.co.uk>
parents:
21384
diff
changeset
|
4887 { |
86b0dc1f60ae
Group all NAME_IN_USE errors together into one neat mini-dialog on the buddy
Will Thompson <will.thompson@collabora.co.uk>
parents:
21384
diff
changeset
|
4888 PidginBuddyListPrivate *priv = PIDGIN_BUDDY_LIST_GET_PRIVATE(gtkblist); |
21410
4ccc4ad0a8b0
Use PidginMiniDialog to display signed in elsewhere errors in the blist.
Will Thompson <will.thompson@collabora.co.uk>
parents:
21401
diff
changeset
|
4889 PidginMiniDialog *mini_dialog; |
4ccc4ad0a8b0
Use PidginMiniDialog to display signed in elsewhere errors in the blist.
Will Thompson <will.thompson@collabora.co.uk>
parents:
21401
diff
changeset
|
4890 |
4ccc4ad0a8b0
Use PidginMiniDialog to display signed in elsewhere errors in the blist.
Will Thompson <will.thompson@collabora.co.uk>
parents:
21401
diff
changeset
|
4891 if(priv->signed_on_elsewhere) |
21386
86b0dc1f60ae
Group all NAME_IN_USE errors together into one neat mini-dialog on the buddy
Will Thompson <will.thompson@collabora.co.uk>
parents:
21384
diff
changeset
|
4892 return; |
21618
85fc97ffe538
Workarounds to fix some issues with the minidialog and scrollbook.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21583
diff
changeset
|
4893 |
21410
4ccc4ad0a8b0
Use PidginMiniDialog to display signed in elsewhere errors in the blist.
Will Thompson <will.thompson@collabora.co.uk>
parents:
21401
diff
changeset
|
4894 mini_dialog = priv->signed_on_elsewhere = |
21662
231a425c3930
Having a long sentence as a title is a bit overly-bold, and I really want this dialog to say 'Welcome back'
Sean Egan <seanegan@gmail.com>
parents:
21660
diff
changeset
|
4895 pidgin_mini_dialog_new(_("Welcome back!"), NULL, PIDGIN_STOCK_DISCONNECT); |
21410
4ccc4ad0a8b0
Use PidginMiniDialog to display signed in elsewhere errors in the blist.
Will Thompson <will.thompson@collabora.co.uk>
parents:
21401
diff
changeset
|
4896 |
4ccc4ad0a8b0
Use PidginMiniDialog to display signed in elsewhere errors in the blist.
Will Thompson <will.thompson@collabora.co.uk>
parents:
21401
diff
changeset
|
4897 pidgin_mini_dialog_add_button(mini_dialog, _("Re-enable"), |
4ccc4ad0a8b0
Use PidginMiniDialog to display signed in elsewhere errors in the blist.
Will Thompson <will.thompson@collabora.co.uk>
parents:
21401
diff
changeset
|
4898 reconnect_elsewhere_accounts, NULL); |
4ccc4ad0a8b0
Use PidginMiniDialog to display signed in elsewhere errors in the blist.
Will Thompson <will.thompson@collabora.co.uk>
parents:
21401
diff
changeset
|
4899 |
21845
45d1e229fadd
Dismissing the signed on elsewhere minidialog should clear all the errors;
Will Thompson <will.thompson@collabora.co.uk>
parents:
21781
diff
changeset
|
4900 /* Make dismissing the dialog clear the errors. The "destroy" signal |
45d1e229fadd
Dismissing the signed on elsewhere minidialog should clear all the errors;
Will Thompson <will.thompson@collabora.co.uk>
parents:
21781
diff
changeset
|
4901 * does not appear to fire at quit, which is fortunate! |
45d1e229fadd
Dismissing the signed on elsewhere minidialog should clear all the errors;
Will Thompson <will.thompson@collabora.co.uk>
parents:
21781
diff
changeset
|
4902 */ |
45d1e229fadd
Dismissing the signed on elsewhere minidialog should clear all the errors;
Will Thompson <will.thompson@collabora.co.uk>
parents:
21781
diff
changeset
|
4903 g_signal_connect(G_OBJECT(mini_dialog), "destroy", |
45d1e229fadd
Dismissing the signed on elsewhere minidialog should clear all the errors;
Will Thompson <will.thompson@collabora.co.uk>
parents:
21781
diff
changeset
|
4904 (GCallback) clear_elsewhere_errors, NULL); |
45d1e229fadd
Dismissing the signed on elsewhere minidialog should clear all the errors;
Will Thompson <will.thompson@collabora.co.uk>
parents:
21781
diff
changeset
|
4905 |
21410
4ccc4ad0a8b0
Use PidginMiniDialog to display signed in elsewhere errors in the blist.
Will Thompson <will.thompson@collabora.co.uk>
parents:
21401
diff
changeset
|
4906 add_error_dialog(gtkblist, GTK_WIDGET(mini_dialog)); |
21411
b089fd1ad059
Hide the description label of the PidginMiniDialog used for signed on elsewhere
Will Thompson <will.thompson@collabora.co.uk>
parents:
21410
diff
changeset
|
4907 |
b089fd1ad059
Hide the description label of the PidginMiniDialog used for signed on elsewhere
Will Thompson <will.thompson@collabora.co.uk>
parents:
21410
diff
changeset
|
4908 /* Set priv->signed_on_elsewhere to NULL when the dialog is destroyed */ |
21410
4ccc4ad0a8b0
Use PidginMiniDialog to display signed in elsewhere errors in the blist.
Will Thompson <will.thompson@collabora.co.uk>
parents:
21401
diff
changeset
|
4909 g_signal_connect(G_OBJECT(mini_dialog), "destroy", |
4ccc4ad0a8b0
Use PidginMiniDialog to display signed in elsewhere errors in the blist.
Will Thompson <will.thompson@collabora.co.uk>
parents:
21401
diff
changeset
|
4910 (GCallback) gtk_widget_destroyed, &(priv->signed_on_elsewhere)); |
21386
86b0dc1f60ae
Group all NAME_IN_USE errors together into one neat mini-dialog on the buddy
Will Thompson <will.thompson@collabora.co.uk>
parents:
21384
diff
changeset
|
4911 } |
86b0dc1f60ae
Group all NAME_IN_USE errors together into one neat mini-dialog on the buddy
Will Thompson <will.thompson@collabora.co.uk>
parents:
21384
diff
changeset
|
4912 |
86b0dc1f60ae
Group all NAME_IN_USE errors together into one neat mini-dialog on the buddy
Will Thompson <will.thompson@collabora.co.uk>
parents:
21384
diff
changeset
|
4913 static void |
86b0dc1f60ae
Group all NAME_IN_USE errors together into one neat mini-dialog on the buddy
Will Thompson <will.thompson@collabora.co.uk>
parents:
21384
diff
changeset
|
4914 update_signed_on_elsewhere_minidialog_title(void) |
86b0dc1f60ae
Group all NAME_IN_USE errors together into one neat mini-dialog on the buddy
Will Thompson <will.thompson@collabora.co.uk>
parents:
21384
diff
changeset
|
4915 { |
86b0dc1f60ae
Group all NAME_IN_USE errors together into one neat mini-dialog on the buddy
Will Thompson <will.thompson@collabora.co.uk>
parents:
21384
diff
changeset
|
4916 PidginBuddyListPrivate *priv = PIDGIN_BUDDY_LIST_GET_PRIVATE(gtkblist); |
21410
4ccc4ad0a8b0
Use PidginMiniDialog to display signed in elsewhere errors in the blist.
Will Thompson <will.thompson@collabora.co.uk>
parents:
21401
diff
changeset
|
4917 PidginMiniDialog *mini_dialog = priv->signed_on_elsewhere; |
4ccc4ad0a8b0
Use PidginMiniDialog to display signed in elsewhere errors in the blist.
Will Thompson <will.thompson@collabora.co.uk>
parents:
21401
diff
changeset
|
4918 guint accounts; |
4ccc4ad0a8b0
Use PidginMiniDialog to display signed in elsewhere errors in the blist.
Will Thompson <will.thompson@collabora.co.uk>
parents:
21401
diff
changeset
|
4919 char *title; |
4ccc4ad0a8b0
Use PidginMiniDialog to display signed in elsewhere errors in the blist.
Will Thompson <will.thompson@collabora.co.uk>
parents:
21401
diff
changeset
|
4920 |
4ccc4ad0a8b0
Use PidginMiniDialog to display signed in elsewhere errors in the blist.
Will Thompson <will.thompson@collabora.co.uk>
parents:
21401
diff
changeset
|
4921 if (mini_dialog == NULL) |
21386
86b0dc1f60ae
Group all NAME_IN_USE errors together into one neat mini-dialog on the buddy
Will Thompson <will.thompson@collabora.co.uk>
parents:
21384
diff
changeset
|
4922 return; |
21410
4ccc4ad0a8b0
Use PidginMiniDialog to display signed in elsewhere errors in the blist.
Will Thompson <will.thompson@collabora.co.uk>
parents:
21401
diff
changeset
|
4923 |
4ccc4ad0a8b0
Use PidginMiniDialog to display signed in elsewhere errors in the blist.
Will Thompson <will.thompson@collabora.co.uk>
parents:
21401
diff
changeset
|
4924 accounts = pidgin_mini_dialog_get_num_children(mini_dialog); |
21618
85fc97ffe538
Workarounds to fix some issues with the minidialog and scrollbook.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21583
diff
changeset
|
4925 if (accounts == 0) { |
85fc97ffe538
Workarounds to fix some issues with the minidialog and scrollbook.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21583
diff
changeset
|
4926 gtk_widget_destroy(GTK_WIDGET(mini_dialog)); |
85fc97ffe538
Workarounds to fix some issues with the minidialog and scrollbook.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21583
diff
changeset
|
4927 return; |
85fc97ffe538
Workarounds to fix some issues with the minidialog and scrollbook.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21583
diff
changeset
|
4928 } |
21386
86b0dc1f60ae
Group all NAME_IN_USE errors together into one neat mini-dialog on the buddy
Will Thompson <will.thompson@collabora.co.uk>
parents:
21384
diff
changeset
|
4929 |
86b0dc1f60ae
Group all NAME_IN_USE errors together into one neat mini-dialog on the buddy
Will Thompson <will.thompson@collabora.co.uk>
parents:
21384
diff
changeset
|
4930 title = g_strdup_printf( |
21662
231a425c3930
Having a long sentence as a title is a bit overly-bold, and I really want this dialog to say 'Welcome back'
Sean Egan <seanegan@gmail.com>
parents:
21660
diff
changeset
|
4931 ngettext("%d account was disabled because you signed on from another location:", |
231a425c3930
Having a long sentence as a title is a bit overly-bold, and I really want this dialog to say 'Welcome back'
Sean Egan <seanegan@gmail.com>
parents:
21660
diff
changeset
|
4932 "%d accounts were disabled because you signed on from another location:", |
21410
4ccc4ad0a8b0
Use PidginMiniDialog to display signed in elsewhere errors in the blist.
Will Thompson <will.thompson@collabora.co.uk>
parents:
21401
diff
changeset
|
4933 accounts), |
4ccc4ad0a8b0
Use PidginMiniDialog to display signed in elsewhere errors in the blist.
Will Thompson <will.thompson@collabora.co.uk>
parents:
21401
diff
changeset
|
4934 accounts); |
21662
231a425c3930
Having a long sentence as a title is a bit overly-bold, and I really want this dialog to say 'Welcome back'
Sean Egan <seanegan@gmail.com>
parents:
21660
diff
changeset
|
4935 pidgin_mini_dialog_set_description(mini_dialog, title); |
21386
86b0dc1f60ae
Group all NAME_IN_USE errors together into one neat mini-dialog on the buddy
Will Thompson <will.thompson@collabora.co.uk>
parents:
21384
diff
changeset
|
4936 g_free(title); |
86b0dc1f60ae
Group all NAME_IN_USE errors together into one neat mini-dialog on the buddy
Will Thompson <will.thompson@collabora.co.uk>
parents:
21384
diff
changeset
|
4937 } |
86b0dc1f60ae
Group all NAME_IN_USE errors together into one neat mini-dialog on the buddy
Will Thompson <will.thompson@collabora.co.uk>
parents:
21384
diff
changeset
|
4938 |
86b0dc1f60ae
Group all NAME_IN_USE errors together into one neat mini-dialog on the buddy
Will Thompson <will.thompson@collabora.co.uk>
parents:
21384
diff
changeset
|
4939 static GtkWidget * |
86b0dc1f60ae
Group all NAME_IN_USE errors together into one neat mini-dialog on the buddy
Will Thompson <will.thompson@collabora.co.uk>
parents:
21384
diff
changeset
|
4940 create_account_label(PurpleAccount *account) |
86b0dc1f60ae
Group all NAME_IN_USE errors together into one neat mini-dialog on the buddy
Will Thompson <will.thompson@collabora.co.uk>
parents:
21384
diff
changeset
|
4941 { |
86b0dc1f60ae
Group all NAME_IN_USE errors together into one neat mini-dialog on the buddy
Will Thompson <will.thompson@collabora.co.uk>
parents:
21384
diff
changeset
|
4942 GtkWidget *hbox, *label; |
86b0dc1f60ae
Group all NAME_IN_USE errors together into one neat mini-dialog on the buddy
Will Thompson <will.thompson@collabora.co.uk>
parents:
21384
diff
changeset
|
4943 const char *username = purple_account_get_username(account); |
86b0dc1f60ae
Group all NAME_IN_USE errors together into one neat mini-dialog on the buddy
Will Thompson <will.thompson@collabora.co.uk>
parents:
21384
diff
changeset
|
4944 char *markup; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4945 |
17044
c28f4593f723
Pack connection error buttons the same way the statusbox is. Fixes #120
Sean Egan <seanegan@gmail.com>
parents:
17042
diff
changeset
|
4946 hbox = gtk_hbox_new(FALSE, 6); |
21386
86b0dc1f60ae
Group all NAME_IN_USE errors together into one neat mini-dialog on the buddy
Will Thompson <will.thompson@collabora.co.uk>
parents:
21384
diff
changeset
|
4947 g_object_set_data(G_OBJECT(hbox), OBJECT_DATA_KEY_ACCOUNT, account); |
86b0dc1f60ae
Group all NAME_IN_USE errors together into one neat mini-dialog on the buddy
Will Thompson <will.thompson@collabora.co.uk>
parents:
21384
diff
changeset
|
4948 |
86b0dc1f60ae
Group all NAME_IN_USE errors together into one neat mini-dialog on the buddy
Will Thompson <will.thompson@collabora.co.uk>
parents:
21384
diff
changeset
|
4949 pack_prpl_icon_start(hbox, account); |
86b0dc1f60ae
Group all NAME_IN_USE errors together into one neat mini-dialog on the buddy
Will Thompson <will.thompson@collabora.co.uk>
parents:
21384
diff
changeset
|
4950 |
86b0dc1f60ae
Group all NAME_IN_USE errors together into one neat mini-dialog on the buddy
Will Thompson <will.thompson@collabora.co.uk>
parents:
21384
diff
changeset
|
4951 label = gtk_label_new(NULL); |
86b0dc1f60ae
Group all NAME_IN_USE errors together into one neat mini-dialog on the buddy
Will Thompson <will.thompson@collabora.co.uk>
parents:
21384
diff
changeset
|
4952 markup = g_strdup_printf("<span size=\"smaller\">%s</span>", username); |
86b0dc1f60ae
Group all NAME_IN_USE errors together into one neat mini-dialog on the buddy
Will Thompson <will.thompson@collabora.co.uk>
parents:
21384
diff
changeset
|
4953 gtk_label_set_markup(GTK_LABEL(label), markup); |
86b0dc1f60ae
Group all NAME_IN_USE errors together into one neat mini-dialog on the buddy
Will Thompson <will.thompson@collabora.co.uk>
parents:
21384
diff
changeset
|
4954 g_free(markup); |
86b0dc1f60ae
Group all NAME_IN_USE errors together into one neat mini-dialog on the buddy
Will Thompson <will.thompson@collabora.co.uk>
parents:
21384
diff
changeset
|
4955 gtk_misc_set_alignment(GTK_MISC(label), 0, 0); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4956 #if GTK_CHECK_VERSION(2,6,0) |
21396
78f8a19785b1
Add a tooltip to each account's label in the signed on elsewhere minidialog,
Will Thompson <will.thompson@collabora.co.uk>
parents:
21395
diff
changeset
|
4957 g_object_set(G_OBJECT(label), "ellipsize", PANGO_ELLIPSIZE_END, NULL); |
78f8a19785b1
Add a tooltip to each account's label in the signed on elsewhere minidialog,
Will Thompson <will.thompson@collabora.co.uk>
parents:
21395
diff
changeset
|
4958 #endif |
78f8a19785b1
Add a tooltip to each account's label in the signed on elsewhere minidialog,
Will Thompson <will.thompson@collabora.co.uk>
parents:
21395
diff
changeset
|
4959 #if GTK_CHECK_VERSION(2,12,0) |
78f8a19785b1
Add a tooltip to each account's label in the signed on elsewhere minidialog,
Will Thompson <will.thompson@collabora.co.uk>
parents:
21395
diff
changeset
|
4960 { /* avoid unused variable warnings on pre-2.12 Gtk */ |
78f8a19785b1
Add a tooltip to each account's label in the signed on elsewhere minidialog,
Will Thompson <will.thompson@collabora.co.uk>
parents:
21395
diff
changeset
|
4961 char *description = |
78f8a19785b1
Add a tooltip to each account's label in the signed on elsewhere minidialog,
Will Thompson <will.thompson@collabora.co.uk>
parents:
21395
diff
changeset
|
4962 purple_account_get_current_error(account)->description; |
78f8a19785b1
Add a tooltip to each account's label in the signed on elsewhere minidialog,
Will Thompson <will.thompson@collabora.co.uk>
parents:
21395
diff
changeset
|
4963 if (description != NULL && *description != '\0') |
78f8a19785b1
Add a tooltip to each account's label in the signed on elsewhere minidialog,
Will Thompson <will.thompson@collabora.co.uk>
parents:
21395
diff
changeset
|
4964 gtk_widget_set_tooltip_text(label, description); |
78f8a19785b1
Add a tooltip to each account's label in the signed on elsewhere minidialog,
Will Thompson <will.thompson@collabora.co.uk>
parents:
21395
diff
changeset
|
4965 } |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4966 #endif |
17044
c28f4593f723
Pack connection error buttons the same way the statusbox is. Fixes #120
Sean Egan <seanegan@gmail.com>
parents:
17042
diff
changeset
|
4967 gtk_box_pack_start(GTK_BOX(hbox), label, TRUE, TRUE, 0); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4968 |
21386
86b0dc1f60ae
Group all NAME_IN_USE errors together into one neat mini-dialog on the buddy
Will Thompson <will.thompson@collabora.co.uk>
parents:
21384
diff
changeset
|
4969 return hbox; |
86b0dc1f60ae
Group all NAME_IN_USE errors together into one neat mini-dialog on the buddy
Will Thompson <will.thompson@collabora.co.uk>
parents:
21384
diff
changeset
|
4970 } |
86b0dc1f60ae
Group all NAME_IN_USE errors together into one neat mini-dialog on the buddy
Will Thompson <will.thompson@collabora.co.uk>
parents:
21384
diff
changeset
|
4971 |
86b0dc1f60ae
Group all NAME_IN_USE errors together into one neat mini-dialog on the buddy
Will Thompson <will.thompson@collabora.co.uk>
parents:
21384
diff
changeset
|
4972 static void |
86b0dc1f60ae
Group all NAME_IN_USE errors together into one neat mini-dialog on the buddy
Will Thompson <will.thompson@collabora.co.uk>
parents:
21384
diff
changeset
|
4973 add_to_signed_on_elsewhere(PurpleAccount *account) |
86b0dc1f60ae
Group all NAME_IN_USE errors together into one neat mini-dialog on the buddy
Will Thompson <will.thompson@collabora.co.uk>
parents:
21384
diff
changeset
|
4974 { |
86b0dc1f60ae
Group all NAME_IN_USE errors together into one neat mini-dialog on the buddy
Will Thompson <will.thompson@collabora.co.uk>
parents:
21384
diff
changeset
|
4975 PidginBuddyListPrivate *priv = PIDGIN_BUDDY_LIST_GET_PRIVATE(gtkblist); |
21410
4ccc4ad0a8b0
Use PidginMiniDialog to display signed in elsewhere errors in the blist.
Will Thompson <will.thompson@collabora.co.uk>
parents:
21401
diff
changeset
|
4976 PidginMiniDialog *mini_dialog; |
21386
86b0dc1f60ae
Group all NAME_IN_USE errors together into one neat mini-dialog on the buddy
Will Thompson <will.thompson@collabora.co.uk>
parents:
21384
diff
changeset
|
4977 GtkWidget *account_label; |
21410
4ccc4ad0a8b0
Use PidginMiniDialog to display signed in elsewhere errors in the blist.
Will Thompson <will.thompson@collabora.co.uk>
parents:
21401
diff
changeset
|
4978 |
4ccc4ad0a8b0
Use PidginMiniDialog to display signed in elsewhere errors in the blist.
Will Thompson <will.thompson@collabora.co.uk>
parents:
21401
diff
changeset
|
4979 ensure_signed_on_elsewhere_minidialog(gtkblist); |
4ccc4ad0a8b0
Use PidginMiniDialog to display signed in elsewhere errors in the blist.
Will Thompson <will.thompson@collabora.co.uk>
parents:
21401
diff
changeset
|
4980 mini_dialog = priv->signed_on_elsewhere; |
4ccc4ad0a8b0
Use PidginMiniDialog to display signed in elsewhere errors in the blist.
Will Thompson <will.thompson@collabora.co.uk>
parents:
21401
diff
changeset
|
4981 |
4ccc4ad0a8b0
Use PidginMiniDialog to display signed in elsewhere errors in the blist.
Will Thompson <will.thompson@collabora.co.uk>
parents:
21401
diff
changeset
|
4982 if(find_child_widget_by_account(GTK_CONTAINER(mini_dialog->contents), account)) |
21386
86b0dc1f60ae
Group all NAME_IN_USE errors together into one neat mini-dialog on the buddy
Will Thompson <will.thompson@collabora.co.uk>
parents:
21384
diff
changeset
|
4983 return; |
86b0dc1f60ae
Group all NAME_IN_USE errors together into one neat mini-dialog on the buddy
Will Thompson <will.thompson@collabora.co.uk>
parents:
21384
diff
changeset
|
4984 |
21410
4ccc4ad0a8b0
Use PidginMiniDialog to display signed in elsewhere errors in the blist.
Will Thompson <will.thompson@collabora.co.uk>
parents:
21401
diff
changeset
|
4985 account_label = create_account_label(account); |
4ccc4ad0a8b0
Use PidginMiniDialog to display signed in elsewhere errors in the blist.
Will Thompson <will.thompson@collabora.co.uk>
parents:
21401
diff
changeset
|
4986 gtk_box_pack_start(mini_dialog->contents, account_label, FALSE, FALSE, 0); |
4ccc4ad0a8b0
Use PidginMiniDialog to display signed in elsewhere errors in the blist.
Will Thompson <will.thompson@collabora.co.uk>
parents:
21401
diff
changeset
|
4987 gtk_widget_show_all(account_label); |
21386
86b0dc1f60ae
Group all NAME_IN_USE errors together into one neat mini-dialog on the buddy
Will Thompson <will.thompson@collabora.co.uk>
parents:
21384
diff
changeset
|
4988 |
86b0dc1f60ae
Group all NAME_IN_USE errors together into one neat mini-dialog on the buddy
Will Thompson <will.thompson@collabora.co.uk>
parents:
21384
diff
changeset
|
4989 update_signed_on_elsewhere_minidialog_title(); |
86b0dc1f60ae
Group all NAME_IN_USE errors together into one neat mini-dialog on the buddy
Will Thompson <will.thompson@collabora.co.uk>
parents:
21384
diff
changeset
|
4990 } |
86b0dc1f60ae
Group all NAME_IN_USE errors together into one neat mini-dialog on the buddy
Will Thompson <will.thompson@collabora.co.uk>
parents:
21384
diff
changeset
|
4991 |
86b0dc1f60ae
Group all NAME_IN_USE errors together into one neat mini-dialog on the buddy
Will Thompson <will.thompson@collabora.co.uk>
parents:
21384
diff
changeset
|
4992 static void |
86b0dc1f60ae
Group all NAME_IN_USE errors together into one neat mini-dialog on the buddy
Will Thompson <will.thompson@collabora.co.uk>
parents:
21384
diff
changeset
|
4993 remove_from_signed_on_elsewhere(PurpleAccount *account) |
86b0dc1f60ae
Group all NAME_IN_USE errors together into one neat mini-dialog on the buddy
Will Thompson <will.thompson@collabora.co.uk>
parents:
21384
diff
changeset
|
4994 { |
86b0dc1f60ae
Group all NAME_IN_USE errors together into one neat mini-dialog on the buddy
Will Thompson <will.thompson@collabora.co.uk>
parents:
21384
diff
changeset
|
4995 PidginBuddyListPrivate *priv = PIDGIN_BUDDY_LIST_GET_PRIVATE(gtkblist); |
21410
4ccc4ad0a8b0
Use PidginMiniDialog to display signed in elsewhere errors in the blist.
Will Thompson <will.thompson@collabora.co.uk>
parents:
21401
diff
changeset
|
4996 PidginMiniDialog *mini_dialog = priv->signed_on_elsewhere; |
4ccc4ad0a8b0
Use PidginMiniDialog to display signed in elsewhere errors in the blist.
Will Thompson <will.thompson@collabora.co.uk>
parents:
21401
diff
changeset
|
4997 if(mini_dialog == NULL) |
21386
86b0dc1f60ae
Group all NAME_IN_USE errors together into one neat mini-dialog on the buddy
Will Thompson <will.thompson@collabora.co.uk>
parents:
21384
diff
changeset
|
4998 return; |
86b0dc1f60ae
Group all NAME_IN_USE errors together into one neat mini-dialog on the buddy
Will Thompson <will.thompson@collabora.co.uk>
parents:
21384
diff
changeset
|
4999 |
21410
4ccc4ad0a8b0
Use PidginMiniDialog to display signed in elsewhere errors in the blist.
Will Thompson <will.thompson@collabora.co.uk>
parents:
21401
diff
changeset
|
5000 remove_child_widget_by_account(GTK_CONTAINER(mini_dialog->contents), account); |
21386
86b0dc1f60ae
Group all NAME_IN_USE errors together into one neat mini-dialog on the buddy
Will Thompson <will.thompson@collabora.co.uk>
parents:
21384
diff
changeset
|
5001 |
86b0dc1f60ae
Group all NAME_IN_USE errors together into one neat mini-dialog on the buddy
Will Thompson <will.thompson@collabora.co.uk>
parents:
21384
diff
changeset
|
5002 update_signed_on_elsewhere_minidialog_title(); |
86b0dc1f60ae
Group all NAME_IN_USE errors together into one neat mini-dialog on the buddy
Will Thompson <will.thompson@collabora.co.uk>
parents:
21384
diff
changeset
|
5003 } |
86b0dc1f60ae
Group all NAME_IN_USE errors together into one neat mini-dialog on the buddy
Will Thompson <will.thompson@collabora.co.uk>
parents:
21384
diff
changeset
|
5004 |
21395
04b1742c8206
Restore error notifications on the buddy list after a restart. Make the Ignore
Will Thompson <will.thompson@collabora.co.uk>
parents:
21387
diff
changeset
|
5005 |
22298
7c5734075af3
Rework update_account_error_state to reuse existing mini-dialogs if they exist,
Will Thompson <will.thompson@collabora.co.uk>
parents:
22297
diff
changeset
|
5006 static void |
7c5734075af3
Rework update_account_error_state to reuse existing mini-dialogs if they exist,
Will Thompson <will.thompson@collabora.co.uk>
parents:
22297
diff
changeset
|
5007 update_signed_on_elsewhere_tooltip(PurpleAccount *account, |
7c5734075af3
Rework update_account_error_state to reuse existing mini-dialogs if they exist,
Will Thompson <will.thompson@collabora.co.uk>
parents:
22297
diff
changeset
|
5008 const char *description) |
7c5734075af3
Rework update_account_error_state to reuse existing mini-dialogs if they exist,
Will Thompson <will.thompson@collabora.co.uk>
parents:
22297
diff
changeset
|
5009 { |
7c5734075af3
Rework update_account_error_state to reuse existing mini-dialogs if they exist,
Will Thompson <will.thompson@collabora.co.uk>
parents:
22297
diff
changeset
|
5010 #if GTK_CHECK_VERSION(2,12,0) |
7c5734075af3
Rework update_account_error_state to reuse existing mini-dialogs if they exist,
Will Thompson <will.thompson@collabora.co.uk>
parents:
22297
diff
changeset
|
5011 PidginBuddyListPrivate *priv = PIDGIN_BUDDY_LIST_GET_PRIVATE(gtkblist); |
7c5734075af3
Rework update_account_error_state to reuse existing mini-dialogs if they exist,
Will Thompson <will.thompson@collabora.co.uk>
parents:
22297
diff
changeset
|
5012 GtkContainer *c = GTK_CONTAINER(priv->signed_on_elsewhere->contents); |
7c5734075af3
Rework update_account_error_state to reuse existing mini-dialogs if they exist,
Will Thompson <will.thompson@collabora.co.uk>
parents:
22297
diff
changeset
|
5013 GtkWidget *label = find_child_widget_by_account(c, account); |
7c5734075af3
Rework update_account_error_state to reuse existing mini-dialogs if they exist,
Will Thompson <will.thompson@collabora.co.uk>
parents:
22297
diff
changeset
|
5014 gtk_widget_set_tooltip_text(label, description); |
7c5734075af3
Rework update_account_error_state to reuse existing mini-dialogs if they exist,
Will Thompson <will.thompson@collabora.co.uk>
parents:
22297
diff
changeset
|
5015 #endif |
7c5734075af3
Rework update_account_error_state to reuse existing mini-dialogs if they exist,
Will Thompson <will.thompson@collabora.co.uk>
parents:
22297
diff
changeset
|
5016 } |
7c5734075af3
Rework update_account_error_state to reuse existing mini-dialogs if they exist,
Will Thompson <will.thompson@collabora.co.uk>
parents:
22297
diff
changeset
|
5017 |
7c5734075af3
Rework update_account_error_state to reuse existing mini-dialogs if they exist,
Will Thompson <will.thompson@collabora.co.uk>
parents:
22297
diff
changeset
|
5018 |
21386
86b0dc1f60ae
Group all NAME_IN_USE errors together into one neat mini-dialog on the buddy
Will Thompson <will.thompson@collabora.co.uk>
parents:
21384
diff
changeset
|
5019 /* Call appropriate error notification code based on error types */ |
21384
5c26dc790c71
Break creating and removing generic error boxes by account into their own
Will Thompson <will.thompson@collabora.co.uk>
parents:
21382
diff
changeset
|
5020 static void |
21373
cbf197042bad
Add the old error to the account-error-changed signal.
Will Thompson <will.thompson@collabora.co.uk>
parents:
21369
diff
changeset
|
5021 update_account_error_state(PurpleAccount *account, |
21378
c1033e943d2a
The two PurpleConnectionErrorInfo parameters are meant to be const.
Will Thompson <will.thompson@collabora.co.uk>
parents:
21377
diff
changeset
|
5022 const PurpleConnectionErrorInfo *old, |
c1033e943d2a
The two PurpleConnectionErrorInfo parameters are meant to be const.
Will Thompson <will.thompson@collabora.co.uk>
parents:
21377
diff
changeset
|
5023 const PurpleConnectionErrorInfo *new, |
21373
cbf197042bad
Add the old error to the account-error-changed signal.
Will Thompson <will.thompson@collabora.co.uk>
parents:
21369
diff
changeset
|
5024 PidginBuddyList *gtkblist) |
cbf197042bad
Add the old error to the account-error-changed signal.
Will Thompson <will.thompson@collabora.co.uk>
parents:
21369
diff
changeset
|
5025 { |
22298
7c5734075af3
Rework update_account_error_state to reuse existing mini-dialogs if they exist,
Will Thompson <will.thompson@collabora.co.uk>
parents:
22297
diff
changeset
|
5026 gboolean descriptions_differ; |
7c5734075af3
Rework update_account_error_state to reuse existing mini-dialogs if they exist,
Will Thompson <will.thompson@collabora.co.uk>
parents:
22297
diff
changeset
|
5027 const char *desc; |
7c5734075af3
Rework update_account_error_state to reuse existing mini-dialogs if they exist,
Will Thompson <will.thompson@collabora.co.uk>
parents:
22297
diff
changeset
|
5028 |
7c5734075af3
Rework update_account_error_state to reuse existing mini-dialogs if they exist,
Will Thompson <will.thompson@collabora.co.uk>
parents:
22297
diff
changeset
|
5029 if (old == NULL && new == NULL) |
7c5734075af3
Rework update_account_error_state to reuse existing mini-dialogs if they exist,
Will Thompson <will.thompson@collabora.co.uk>
parents:
22297
diff
changeset
|
5030 return; |
7c5734075af3
Rework update_account_error_state to reuse existing mini-dialogs if they exist,
Will Thompson <will.thompson@collabora.co.uk>
parents:
22297
diff
changeset
|
5031 |
21380
a62b60a5745d
* When an account error changes, just recreate its button rather than every
Will Thompson <will.thompson@collabora.co.uk>
parents:
21378
diff
changeset
|
5032 /* For backwards compatibility: */ |
21373
cbf197042bad
Add the old error to the account-error-changed signal.
Will Thompson <will.thompson@collabora.co.uk>
parents:
21369
diff
changeset
|
5033 if (new) |
cbf197042bad
Add the old error to the account-error-changed signal.
Will Thompson <will.thompson@collabora.co.uk>
parents:
21369
diff
changeset
|
5034 pidgin_blist_update_account_error_state(account, new->description); |
21369
318b3f5d1516
Call pidgin_blist_update_account_error_state in response to
Will Thompson <will.thompson@collabora.co.uk>
parents:
21368
diff
changeset
|
5035 else |
318b3f5d1516
Call pidgin_blist_update_account_error_state in response to
Will Thompson <will.thompson@collabora.co.uk>
parents:
21368
diff
changeset
|
5036 pidgin_blist_update_account_error_state(account, NULL); |
21380
a62b60a5745d
* When an account error changes, just recreate its button rather than every
Will Thompson <will.thompson@collabora.co.uk>
parents:
21378
diff
changeset
|
5037 |
22298
7c5734075af3
Rework update_account_error_state to reuse existing mini-dialogs if they exist,
Will Thompson <will.thompson@collabora.co.uk>
parents:
22297
diff
changeset
|
5038 if (new != NULL) |
7c5734075af3
Rework update_account_error_state to reuse existing mini-dialogs if they exist,
Will Thompson <will.thompson@collabora.co.uk>
parents:
22297
diff
changeset
|
5039 pidgin_blist_select_notebook_page(gtkblist); |
7c5734075af3
Rework update_account_error_state to reuse existing mini-dialogs if they exist,
Will Thompson <will.thompson@collabora.co.uk>
parents:
22297
diff
changeset
|
5040 |
7c5734075af3
Rework update_account_error_state to reuse existing mini-dialogs if they exist,
Will Thompson <will.thompson@collabora.co.uk>
parents:
22297
diff
changeset
|
5041 if (old != NULL && new == NULL) { |
21386
86b0dc1f60ae
Group all NAME_IN_USE errors together into one neat mini-dialog on the buddy
Will Thompson <will.thompson@collabora.co.uk>
parents:
21384
diff
changeset
|
5042 if(old->type == PURPLE_CONNECTION_ERROR_NAME_IN_USE) |
86b0dc1f60ae
Group all NAME_IN_USE errors together into one neat mini-dialog on the buddy
Will Thompson <will.thompson@collabora.co.uk>
parents:
21384
diff
changeset
|
5043 remove_from_signed_on_elsewhere(account); |
86b0dc1f60ae
Group all NAME_IN_USE errors together into one neat mini-dialog on the buddy
Will Thompson <will.thompson@collabora.co.uk>
parents:
21384
diff
changeset
|
5044 else |
21398
0a7cccd6d081
Use minidialogs rather than horrifying buttons with red text to notify the user
Will Thompson <will.thompson@collabora.co.uk>
parents:
21397
diff
changeset
|
5045 remove_generic_error_dialog(account); |
22298
7c5734075af3
Rework update_account_error_state to reuse existing mini-dialogs if they exist,
Will Thompson <will.thompson@collabora.co.uk>
parents:
22297
diff
changeset
|
5046 return; |
7c5734075af3
Rework update_account_error_state to reuse existing mini-dialogs if they exist,
Will Thompson <will.thompson@collabora.co.uk>
parents:
22297
diff
changeset
|
5047 } |
7c5734075af3
Rework update_account_error_state to reuse existing mini-dialogs if they exist,
Will Thompson <will.thompson@collabora.co.uk>
parents:
22297
diff
changeset
|
5048 |
7c5734075af3
Rework update_account_error_state to reuse existing mini-dialogs if they exist,
Will Thompson <will.thompson@collabora.co.uk>
parents:
22297
diff
changeset
|
5049 if (old == NULL && new != NULL) { |
21386
86b0dc1f60ae
Group all NAME_IN_USE errors together into one neat mini-dialog on the buddy
Will Thompson <will.thompson@collabora.co.uk>
parents:
21384
diff
changeset
|
5050 if(new->type == PURPLE_CONNECTION_ERROR_NAME_IN_USE) |
86b0dc1f60ae
Group all NAME_IN_USE errors together into one neat mini-dialog on the buddy
Will Thompson <will.thompson@collabora.co.uk>
parents:
21384
diff
changeset
|
5051 add_to_signed_on_elsewhere(account); |
86b0dc1f60ae
Group all NAME_IN_USE errors together into one neat mini-dialog on the buddy
Will Thompson <will.thompson@collabora.co.uk>
parents:
21384
diff
changeset
|
5052 else |
21398
0a7cccd6d081
Use minidialogs rather than horrifying buttons with red text to notify the user
Will Thompson <will.thompson@collabora.co.uk>
parents:
21397
diff
changeset
|
5053 add_generic_error_dialog(account, new); |
22298
7c5734075af3
Rework update_account_error_state to reuse existing mini-dialogs if they exist,
Will Thompson <will.thompson@collabora.co.uk>
parents:
22297
diff
changeset
|
5054 return; |
7c5734075af3
Rework update_account_error_state to reuse existing mini-dialogs if they exist,
Will Thompson <will.thompson@collabora.co.uk>
parents:
22297
diff
changeset
|
5055 } |
7c5734075af3
Rework update_account_error_state to reuse existing mini-dialogs if they exist,
Will Thompson <will.thompson@collabora.co.uk>
parents:
22297
diff
changeset
|
5056 |
7c5734075af3
Rework update_account_error_state to reuse existing mini-dialogs if they exist,
Will Thompson <will.thompson@collabora.co.uk>
parents:
22297
diff
changeset
|
5057 /* else, new and old are both non-NULL */ |
7c5734075af3
Rework update_account_error_state to reuse existing mini-dialogs if they exist,
Will Thompson <will.thompson@collabora.co.uk>
parents:
22297
diff
changeset
|
5058 |
7c5734075af3
Rework update_account_error_state to reuse existing mini-dialogs if they exist,
Will Thompson <will.thompson@collabora.co.uk>
parents:
22297
diff
changeset
|
5059 descriptions_differ = strcmp(old->description, new->description); |
7c5734075af3
Rework update_account_error_state to reuse existing mini-dialogs if they exist,
Will Thompson <will.thompson@collabora.co.uk>
parents:
22297
diff
changeset
|
5060 desc = new->description; |
7c5734075af3
Rework update_account_error_state to reuse existing mini-dialogs if they exist,
Will Thompson <will.thompson@collabora.co.uk>
parents:
22297
diff
changeset
|
5061 |
7c5734075af3
Rework update_account_error_state to reuse existing mini-dialogs if they exist,
Will Thompson <will.thompson@collabora.co.uk>
parents:
22297
diff
changeset
|
5062 switch (new->type) { |
7c5734075af3
Rework update_account_error_state to reuse existing mini-dialogs if they exist,
Will Thompson <will.thompson@collabora.co.uk>
parents:
22297
diff
changeset
|
5063 case PURPLE_CONNECTION_ERROR_NAME_IN_USE: |
7c5734075af3
Rework update_account_error_state to reuse existing mini-dialogs if they exist,
Will Thompson <will.thompson@collabora.co.uk>
parents:
22297
diff
changeset
|
5064 if (old->type == PURPLE_CONNECTION_ERROR_NAME_IN_USE |
7c5734075af3
Rework update_account_error_state to reuse existing mini-dialogs if they exist,
Will Thompson <will.thompson@collabora.co.uk>
parents:
22297
diff
changeset
|
5065 && descriptions_differ) { |
7c5734075af3
Rework update_account_error_state to reuse existing mini-dialogs if they exist,
Will Thompson <will.thompson@collabora.co.uk>
parents:
22297
diff
changeset
|
5066 update_signed_on_elsewhere_tooltip(account, desc); |
7c5734075af3
Rework update_account_error_state to reuse existing mini-dialogs if they exist,
Will Thompson <will.thompson@collabora.co.uk>
parents:
22297
diff
changeset
|
5067 } else { |
7c5734075af3
Rework update_account_error_state to reuse existing mini-dialogs if they exist,
Will Thompson <will.thompson@collabora.co.uk>
parents:
22297
diff
changeset
|
5068 remove_generic_error_dialog(account); |
7c5734075af3
Rework update_account_error_state to reuse existing mini-dialogs if they exist,
Will Thompson <will.thompson@collabora.co.uk>
parents:
22297
diff
changeset
|
5069 add_to_signed_on_elsewhere(account); |
7c5734075af3
Rework update_account_error_state to reuse existing mini-dialogs if they exist,
Will Thompson <will.thompson@collabora.co.uk>
parents:
22297
diff
changeset
|
5070 } |
7c5734075af3
Rework update_account_error_state to reuse existing mini-dialogs if they exist,
Will Thompson <will.thompson@collabora.co.uk>
parents:
22297
diff
changeset
|
5071 break; |
7c5734075af3
Rework update_account_error_state to reuse existing mini-dialogs if they exist,
Will Thompson <will.thompson@collabora.co.uk>
parents:
22297
diff
changeset
|
5072 default: |
7c5734075af3
Rework update_account_error_state to reuse existing mini-dialogs if they exist,
Will Thompson <will.thompson@collabora.co.uk>
parents:
22297
diff
changeset
|
5073 if (old->type == PURPLE_CONNECTION_ERROR_NAME_IN_USE) { |
7c5734075af3
Rework update_account_error_state to reuse existing mini-dialogs if they exist,
Will Thompson <will.thompson@collabora.co.uk>
parents:
22297
diff
changeset
|
5074 remove_from_signed_on_elsewhere(account); |
7c5734075af3
Rework update_account_error_state to reuse existing mini-dialogs if they exist,
Will Thompson <will.thompson@collabora.co.uk>
parents:
22297
diff
changeset
|
5075 add_generic_error_dialog(account, new); |
7c5734075af3
Rework update_account_error_state to reuse existing mini-dialogs if they exist,
Will Thompson <will.thompson@collabora.co.uk>
parents:
22297
diff
changeset
|
5076 } else if (descriptions_differ) { |
7c5734075af3
Rework update_account_error_state to reuse existing mini-dialogs if they exist,
Will Thompson <will.thompson@collabora.co.uk>
parents:
22297
diff
changeset
|
5077 update_generic_error_message(account, desc); |
7c5734075af3
Rework update_account_error_state to reuse existing mini-dialogs if they exist,
Will Thompson <will.thompson@collabora.co.uk>
parents:
22297
diff
changeset
|
5078 } |
7c5734075af3
Rework update_account_error_state to reuse existing mini-dialogs if they exist,
Will Thompson <will.thompson@collabora.co.uk>
parents:
22297
diff
changeset
|
5079 break; |
21380
a62b60a5745d
* When an account error changes, just recreate its button rather than every
Will Thompson <will.thompson@collabora.co.uk>
parents:
21378
diff
changeset
|
5080 } |
21369
318b3f5d1516
Call pidgin_blist_update_account_error_state in response to
Will Thompson <will.thompson@collabora.co.uk>
parents:
21368
diff
changeset
|
5081 } |
318b3f5d1516
Call pidgin_blist_update_account_error_state in response to
Will Thompson <will.thompson@collabora.co.uk>
parents:
21368
diff
changeset
|
5082 |
21395
04b1742c8206
Restore error notifications on the buddy list after a restart. Make the Ignore
Will Thompson <will.thompson@collabora.co.uk>
parents:
21387
diff
changeset
|
5083 /* In case accounts are loaded before the blist (which they currently are), |
04b1742c8206
Restore error notifications on the buddy list after a restart. Make the Ignore
Will Thompson <will.thompson@collabora.co.uk>
parents:
21387
diff
changeset
|
5084 * let's call update_account_error_state ourselves on every account's current |
04b1742c8206
Restore error notifications on the buddy list after a restart. Make the Ignore
Will Thompson <will.thompson@collabora.co.uk>
parents:
21387
diff
changeset
|
5085 * state when the blist starts. |
04b1742c8206
Restore error notifications on the buddy list after a restart. Make the Ignore
Will Thompson <will.thompson@collabora.co.uk>
parents:
21387
diff
changeset
|
5086 */ |
04b1742c8206
Restore error notifications on the buddy list after a restart. Make the Ignore
Will Thompson <will.thompson@collabora.co.uk>
parents:
21387
diff
changeset
|
5087 static void |
04b1742c8206
Restore error notifications on the buddy list after a restart. Make the Ignore
Will Thompson <will.thompson@collabora.co.uk>
parents:
21387
diff
changeset
|
5088 show_initial_account_errors(PidginBuddyList *gtkblist) |
04b1742c8206
Restore error notifications on the buddy list after a restart. Make the Ignore
Will Thompson <will.thompson@collabora.co.uk>
parents:
21387
diff
changeset
|
5089 { |
04b1742c8206
Restore error notifications on the buddy list after a restart. Make the Ignore
Will Thompson <will.thompson@collabora.co.uk>
parents:
21387
diff
changeset
|
5090 GList *l = purple_accounts_get_all(); |
04b1742c8206
Restore error notifications on the buddy list after a restart. Make the Ignore
Will Thompson <will.thompson@collabora.co.uk>
parents:
21387
diff
changeset
|
5091 PurpleAccount *account; |
04b1742c8206
Restore error notifications on the buddy list after a restart. Make the Ignore
Will Thompson <will.thompson@collabora.co.uk>
parents:
21387
diff
changeset
|
5092 const PurpleConnectionErrorInfo *err; |
04b1742c8206
Restore error notifications on the buddy list after a restart. Make the Ignore
Will Thompson <will.thompson@collabora.co.uk>
parents:
21387
diff
changeset
|
5093 |
04b1742c8206
Restore error notifications on the buddy list after a restart. Make the Ignore
Will Thompson <will.thompson@collabora.co.uk>
parents:
21387
diff
changeset
|
5094 for (; l; l = l->next) |
04b1742c8206
Restore error notifications on the buddy list after a restart. Make the Ignore
Will Thompson <will.thompson@collabora.co.uk>
parents:
21387
diff
changeset
|
5095 { |
04b1742c8206
Restore error notifications on the buddy list after a restart. Make the Ignore
Will Thompson <will.thompson@collabora.co.uk>
parents:
21387
diff
changeset
|
5096 account = l->data; |
04b1742c8206
Restore error notifications on the buddy list after a restart. Make the Ignore
Will Thompson <will.thompson@collabora.co.uk>
parents:
21387
diff
changeset
|
5097 err = purple_account_get_current_error(account); |
04b1742c8206
Restore error notifications on the buddy list after a restart. Make the Ignore
Will Thompson <will.thompson@collabora.co.uk>
parents:
21387
diff
changeset
|
5098 |
04b1742c8206
Restore error notifications on the buddy list after a restart. Make the Ignore
Will Thompson <will.thompson@collabora.co.uk>
parents:
21387
diff
changeset
|
5099 update_account_error_state(account, NULL, err, gtkblist); |
04b1742c8206
Restore error notifications on the buddy list after a restart. Make the Ignore
Will Thompson <will.thompson@collabora.co.uk>
parents:
21387
diff
changeset
|
5100 } |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5101 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5102 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5103 void |
15823 | 5104 pidgin_blist_update_account_error_state(PurpleAccount *account, const char *text) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5105 { |
21380
a62b60a5745d
* When an account error changes, just recreate its button rather than every
Will Thompson <will.thompson@collabora.co.uk>
parents:
21378
diff
changeset
|
5106 /* connection_errors isn't actually used anywhere; it's just kept in |
a62b60a5745d
* When an account error changes, just recreate its button rather than every
Will Thompson <will.thompson@collabora.co.uk>
parents:
21378
diff
changeset
|
5107 * sync with reality in case a plugin uses it. |
a62b60a5745d
* When an account error changes, just recreate its button rather than every
Will Thompson <will.thompson@collabora.co.uk>
parents:
21378
diff
changeset
|
5108 */ |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5109 if (text == NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5110 g_hash_table_remove(gtkblist->connection_errors, account); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5111 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5112 g_hash_table_insert(gtkblist->connection_errors, account, g_strdup(text)); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5113 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5114 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5115 static gboolean |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5116 paint_headline_hbox (GtkWidget *widget, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5117 GdkEventExpose *event, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5118 gpointer user_data) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5119 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5120 gtk_paint_flat_box (widget->style, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5121 widget->window, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5122 GTK_STATE_NORMAL, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5123 GTK_SHADOW_OUT, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5124 NULL, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5125 widget, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5126 "tooltip", |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5127 widget->allocation.x + 1, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5128 widget->allocation.y + 1, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5129 widget->allocation.width - 2, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5130 widget->allocation.height - 2); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5131 return FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5132 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5133 |
15558
0324f69112f9
Make group background colors update when the theme changes.
Sean Egan <seanegan@gmail.com>
parents:
15553
diff
changeset
|
5134 /* This assumes there are not things like groupless buddies or multi-leveled groups. |
0324f69112f9
Make group background colors update when the theme changes.
Sean Egan <seanegan@gmail.com>
parents:
15553
diff
changeset
|
5135 * I'm sure other things in this code assumes that also. |
0324f69112f9
Make group background colors update when the theme changes.
Sean Egan <seanegan@gmail.com>
parents:
15553
diff
changeset
|
5136 */ |
0324f69112f9
Make group background colors update when the theme changes.
Sean Egan <seanegan@gmail.com>
parents:
15553
diff
changeset
|
5137 static void |
0324f69112f9
Make group background colors update when the theme changes.
Sean Egan <seanegan@gmail.com>
parents:
15553
diff
changeset
|
5138 treeview_style_set (GtkWidget *widget, |
0324f69112f9
Make group background colors update when the theme changes.
Sean Egan <seanegan@gmail.com>
parents:
15553
diff
changeset
|
5139 GtkStyle *prev_style, |
0324f69112f9
Make group background colors update when the theme changes.
Sean Egan <seanegan@gmail.com>
parents:
15553
diff
changeset
|
5140 gpointer data) |
0324f69112f9
Make group background colors update when the theme changes.
Sean Egan <seanegan@gmail.com>
parents:
15553
diff
changeset
|
5141 { |
15823 | 5142 PurpleBuddyList *list = data; |
5143 PurpleBlistNode *node = list->root; | |
15558
0324f69112f9
Make group background colors update when the theme changes.
Sean Egan <seanegan@gmail.com>
parents:
15553
diff
changeset
|
5144 while (node) { |
0324f69112f9
Make group background colors update when the theme changes.
Sean Egan <seanegan@gmail.com>
parents:
15553
diff
changeset
|
5145 pidgin_blist_update_group(list, node); |
0324f69112f9
Make group background colors update when the theme changes.
Sean Egan <seanegan@gmail.com>
parents:
15553
diff
changeset
|
5146 node = node->next; |
0324f69112f9
Make group background colors update when the theme changes.
Sean Egan <seanegan@gmail.com>
parents:
15553
diff
changeset
|
5147 } |
0324f69112f9
Make group background colors update when the theme changes.
Sean Egan <seanegan@gmail.com>
parents:
15553
diff
changeset
|
5148 } |
0324f69112f9
Make group background colors update when the theme changes.
Sean Egan <seanegan@gmail.com>
parents:
15553
diff
changeset
|
5149 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5150 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5151 headline_style_set (GtkWidget *widget, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5152 GtkStyle *prev_style) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5153 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5154 GtkTooltips *tooltips; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5155 GtkStyle *style; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5156 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5157 if (gtkblist->changing_style) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5158 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5159 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5160 tooltips = gtk_tooltips_new (); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5161 #if GLIB_CHECK_VERSION(2,10,0) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5162 g_object_ref_sink (tooltips); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5163 #else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5164 g_object_ref(tooltips); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5165 gtk_object_sink(GTK_OBJECT(tooltips)); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5166 #endif |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5167 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5168 gtk_tooltips_force_window (tooltips); |
21956
d1f282dbbda1
Patch from Ignacio Casal Quinteiro (nacho) to fix style issues with the headline in the buddylist. Closes #4351.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21945
diff
changeset
|
5169 #if GTK_CHECK_VERSION(2, 12, 0) |
d1f282dbbda1
Patch from Ignacio Casal Quinteiro (nacho) to fix style issues with the headline in the buddylist. Closes #4351.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21945
diff
changeset
|
5170 gtk_widget_set_name (tooltips->tip_window, "gtk-tooltips"); |
d1f282dbbda1
Patch from Ignacio Casal Quinteiro (nacho) to fix style issues with the headline in the buddylist. Closes #4351.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21945
diff
changeset
|
5171 #endif |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5172 gtk_widget_ensure_style (tooltips->tip_window); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5173 style = gtk_widget_get_style (tooltips->tip_window); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5174 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5175 gtkblist->changing_style = TRUE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5176 gtk_widget_set_style (gtkblist->headline_hbox, style); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5177 gtkblist->changing_style = FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5178 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5179 g_object_unref (tooltips); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5180 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5181 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5182 /******************************************/ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5183 /* End of connection error handling stuff */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5184 /******************************************/ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5185 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5186 static int |
22898
5d833ca5a265
Make pidgin_blist_toggle_visibility() hide the buddy list when it is
Casey Harkins <charkins@pidgin.im>
parents:
22789
diff
changeset
|
5187 blist_focus_cb(GtkWidget *widget, GdkEventFocus *event, PidginBuddyList *gtkblist) |
5d833ca5a265
Make pidgin_blist_toggle_visibility() hide the buddy list when it is
Casey Harkins <charkins@pidgin.im>
parents:
22789
diff
changeset
|
5188 { |
5d833ca5a265
Make pidgin_blist_toggle_visibility() hide the buddy list when it is
Casey Harkins <charkins@pidgin.im>
parents:
22789
diff
changeset
|
5189 if(event->in) { |
5d833ca5a265
Make pidgin_blist_toggle_visibility() hide the buddy list when it is
Casey Harkins <charkins@pidgin.im>
parents:
22789
diff
changeset
|
5190 gtk_blist_focused = TRUE; |
5d833ca5a265
Make pidgin_blist_toggle_visibility() hide the buddy list when it is
Casey Harkins <charkins@pidgin.im>
parents:
22789
diff
changeset
|
5191 pidgin_set_urgent(GTK_WINDOW(gtkblist->window), FALSE); |
5d833ca5a265
Make pidgin_blist_toggle_visibility() hide the buddy list when it is
Casey Harkins <charkins@pidgin.im>
parents:
22789
diff
changeset
|
5192 } else { |
5d833ca5a265
Make pidgin_blist_toggle_visibility() hide the buddy list when it is
Casey Harkins <charkins@pidgin.im>
parents:
22789
diff
changeset
|
5193 gtk_blist_focused = FALSE; |
5d833ca5a265
Make pidgin_blist_toggle_visibility() hide the buddy list when it is
Casey Harkins <charkins@pidgin.im>
parents:
22789
diff
changeset
|
5194 } |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5195 return 0; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5196 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5197 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5198 #if 0 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5199 static GtkWidget * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5200 kiosk_page() |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5201 { |
15821 | 5202 GtkWidget *ret = gtk_vbox_new(FALSE, PIDGIN_HIG_BOX_SPACE); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5203 GtkWidget *label; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5204 GtkWidget *entry; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5205 GtkWidget *bbox; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5206 GtkWidget *button; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5207 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5208 label = gtk_label_new(NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5209 gtk_box_pack_start(GTK_BOX(ret), label, TRUE, TRUE, 0); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5210 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5211 label = gtk_label_new(NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5212 gtk_label_set_markup(GTK_LABEL(label), _("<b>Username:</b>")); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5213 gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5214 gtk_box_pack_start(GTK_BOX(ret), label, FALSE, FALSE, 0); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5215 entry = gtk_entry_new(); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5216 gtk_box_pack_start(GTK_BOX(ret), entry, FALSE, FALSE, 0); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5217 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5218 label = gtk_label_new(NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5219 gtk_label_set_markup(GTK_LABEL(label), _("<b>Password:</b>")); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5220 gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5221 gtk_box_pack_start(GTK_BOX(ret), label, FALSE, FALSE, 0); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5222 entry = gtk_entry_new(); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5223 gtk_entry_set_visibility(GTK_ENTRY(entry), FALSE); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5224 gtk_box_pack_start(GTK_BOX(ret), entry, FALSE, FALSE, 0); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5225 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5226 label = gtk_label_new(" "); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5227 gtk_box_pack_start(GTK_BOX(ret), label, FALSE, FALSE, 0); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5228 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5229 bbox = gtk_hbutton_box_new(); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5230 button = gtk_button_new_with_mnemonic(_("_Login")); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5231 gtk_box_pack_start(GTK_BOX(ret), bbox, FALSE, FALSE, 0); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5232 gtk_container_add(GTK_CONTAINER(bbox), button); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5233 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5234 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5235 label = gtk_label_new(NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5236 gtk_box_pack_start(GTK_BOX(ret), label, TRUE, TRUE, 0); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5237 |
15821 | 5238 gtk_container_set_border_width(GTK_CONTAINER(ret), PIDGIN_HIG_BORDER); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5239 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5240 gtk_widget_show_all(ret); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5241 return ret; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5242 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5243 #endif |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5244 |
15823 | 5245 static void pidgin_blist_show(PurpleBuddyList *list) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5246 { |
21401
c1c7e28223f8
Display all connection errors in a scrollbook, which is packed inside
Will Thompson <will.thompson@collabora.co.uk>
parents:
21400
diff
changeset
|
5247 PidginBuddyListPrivate *priv; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5248 void *handle; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5249 GtkCellRenderer *rend; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5250 GtkTreeViewColumn *column; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5251 GtkWidget *menu; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5252 GtkWidget *ebox; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5253 GtkWidget *sw; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5254 GtkWidget *sep; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5255 GtkWidget *label; |
16010
eae8e127e4fb
make things cleaner for translators
Nathan Walp <nwalp@pidgin.im>
parents:
16007
diff
changeset
|
5256 char *pretty, *tmp; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5257 GtkAccelGroup *accel_group; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5258 GtkTreeSelection *selection; |
15823 | 5259 GtkTargetEntry dte[] = {{"PURPLE_BLIST_NODE", GTK_TARGET_SAME_APP, DRAG_ROW}, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5260 {"application/x-im-contact", 0, DRAG_BUDDY}, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5261 {"text/x-vcard", 0, DRAG_VCARD }, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5262 {"text/uri-list", 0, DRAG_URI}, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5263 {"text/plain", 0, DRAG_TEXT}}; |
15823 | 5264 GtkTargetEntry ste[] = {{"PURPLE_BLIST_NODE", GTK_TARGET_SAME_APP, DRAG_ROW}, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5265 {"application/x-im-contact", 0, DRAG_BUDDY}, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5266 {"text/x-vcard", 0, DRAG_VCARD }}; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5267 if (gtkblist && gtkblist->window) { |
16062
07554cc5d090
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <stu@nosnilmot.com>
parents:
16010
diff
changeset
|
5268 purple_blist_set_visible(purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/blist/list_visible")); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5269 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5270 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5271 |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
5272 gtkblist = PIDGIN_BLIST(list); |
21401
c1c7e28223f8
Display all connection errors in a scrollbook, which is packed inside
Will Thompson <will.thompson@collabora.co.uk>
parents:
21400
diff
changeset
|
5273 priv = PIDGIN_BUDDY_LIST_GET_PRIVATE(gtkblist); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5274 |
15448 | 5275 gtkblist->empty_avatar = gdk_pixbuf_new(GDK_COLORSPACE_RGB, TRUE, 8, 32, 32); |
5276 gdk_pixbuf_fill(gtkblist->empty_avatar, 0x00000000); | |
15397
a8ee645e7fb4
A lot of status icon changes:
Sean Egan <seanegan@gmail.com>
parents:
15374
diff
changeset
|
5277 |
17166 | 5278 gtkblist->window = pidgin_create_window(_("Buddy List"), 0, "buddy_list", TRUE); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5279 g_signal_connect(G_OBJECT(gtkblist->window), "focus-in-event", |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5280 G_CALLBACK(blist_focus_cb), gtkblist); |
22898
5d833ca5a265
Make pidgin_blist_toggle_visibility() hide the buddy list when it is
Casey Harkins <charkins@pidgin.im>
parents:
22789
diff
changeset
|
5281 g_signal_connect(G_OBJECT(gtkblist->window), "focus-out-event", |
5d833ca5a265
Make pidgin_blist_toggle_visibility() hide the buddy list when it is
Casey Harkins <charkins@pidgin.im>
parents:
22789
diff
changeset
|
5282 G_CALLBACK(blist_focus_cb), gtkblist); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5283 GTK_WINDOW(gtkblist->window)->allow_shrink = TRUE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5284 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5285 gtkblist->main_vbox = gtk_vbox_new(FALSE, 0); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5286 gtk_widget_show(gtkblist->main_vbox); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5287 gtk_container_add(GTK_CONTAINER(gtkblist->window), gtkblist->main_vbox); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5288 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5289 g_signal_connect(G_OBJECT(gtkblist->window), "delete_event", G_CALLBACK(gtk_blist_delete_cb), NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5290 g_signal_connect(G_OBJECT(gtkblist->window), "configure_event", G_CALLBACK(gtk_blist_configure_cb), NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5291 g_signal_connect(G_OBJECT(gtkblist->window), "visibility_notify_event", G_CALLBACK(gtk_blist_visibility_cb), NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5292 g_signal_connect(G_OBJECT(gtkblist->window), "window_state_event", G_CALLBACK(gtk_blist_window_state_cb), NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5293 g_signal_connect(G_OBJECT(gtkblist->window), "key_press_event", G_CALLBACK(gtk_blist_window_key_press_cb), gtkblist); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5294 gtk_widget_add_events(gtkblist->window, GDK_VISIBILITY_NOTIFY_MASK); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5295 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5296 /******************************* Menu bar *************************************/ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5297 accel_group = gtk_accel_group_new(); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5298 gtk_window_add_accel_group(GTK_WINDOW (gtkblist->window), accel_group); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5299 g_object_unref(accel_group); |
15823 | 5300 gtkblist->ift = gtk_item_factory_new(GTK_TYPE_MENU_BAR, "<PurpleMain>", accel_group); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5301 gtk_item_factory_set_translate_func(gtkblist->ift, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5302 (GtkTranslateFunc)item_factory_translate_func, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5303 NULL, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5304 gtk_item_factory_create_items(gtkblist->ift, sizeof(blist_menu) / sizeof(*blist_menu), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5305 blist_menu, NULL); |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
5306 pidgin_load_accels(); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5307 g_signal_connect(G_OBJECT(accel_group), "accel-changed", |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
5308 G_CALLBACK(pidgin_save_accels_cb), NULL); |
15823 | 5309 menu = gtk_item_factory_get_widget(gtkblist->ift, "<PurpleMain>"); |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
5310 gtkblist->menutray = pidgin_menu_tray_new(); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5311 gtk_menu_shell_append(GTK_MENU_SHELL(menu), gtkblist->menutray); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5312 gtk_widget_show(gtkblist->menutray); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5313 gtk_widget_show(menu); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5314 gtk_box_pack_start(GTK_BOX(gtkblist->main_vbox), menu, FALSE, FALSE, 0); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5315 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5316 accountmenu = gtk_item_factory_get_widget(gtkblist->ift, N_("/Accounts")); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5317 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5318 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5319 /****************************** Notebook *************************************/ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5320 gtkblist->notebook = gtk_notebook_new(); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5321 gtk_notebook_set_show_tabs(GTK_NOTEBOOK(gtkblist->notebook), FALSE); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5322 gtk_notebook_set_show_border(GTK_NOTEBOOK(gtkblist->notebook), FALSE); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5323 gtk_box_pack_start(GTK_BOX(gtkblist->main_vbox), gtkblist->notebook, TRUE, TRUE, 0); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5324 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5325 #if 0 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5326 gtk_notebook_append_page(GTK_NOTEBOOK(gtkblist->notebook), kiosk_page(), NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5327 #endif |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5328 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5329 /* Translators: Please maintain the use of -> and <- to refer to menu heirarchy */ |
16010
eae8e127e4fb
make things cleaner for translators
Nathan Walp <nwalp@pidgin.im>
parents:
16007
diff
changeset
|
5330 tmp = g_strdup_printf(_("<span weight='bold' size='larger'>Welcome to %s!</span>\n\n" |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5331 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5332 "You have no accounts enabled. Enable your IM accounts from the " |
23312
a3759c05cc5b
Bring back the unintentionally hidden 'Manage Accounts' dialog. Thanks to
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23309
diff
changeset
|
5333 "<b>Accounts</b> window at <b>Accounts->Manage Accounts</b>. Once you " |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5334 "enable accounts, you'll be able to sign on, set your status, " |
16010
eae8e127e4fb
make things cleaner for translators
Nathan Walp <nwalp@pidgin.im>
parents:
16007
diff
changeset
|
5335 "and talk to your friends."), PIDGIN_NAME); |
eae8e127e4fb
make things cleaner for translators
Nathan Walp <nwalp@pidgin.im>
parents:
16007
diff
changeset
|
5336 pretty = pidgin_make_pretty_arrows(tmp); |
eae8e127e4fb
make things cleaner for translators
Nathan Walp <nwalp@pidgin.im>
parents:
16007
diff
changeset
|
5337 g_free(tmp); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5338 label = gtk_label_new(NULL); |
16062
07554cc5d090
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <stu@nosnilmot.com>
parents:
16010
diff
changeset
|
5339 gtk_widget_set_size_request(label, purple_prefs_get_int(PIDGIN_PREFS_ROOT "/blist/width") - 12, -1); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5340 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
|
5341 gtk_misc_set_alignment(GTK_MISC(label), 0.5, 0.2); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5342 gtk_label_set_markup(GTK_LABEL(label), pretty); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5343 g_free(pretty); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5344 gtk_notebook_append_page(GTK_NOTEBOOK(gtkblist->notebook),label, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5345 gtkblist->vbox = gtk_vbox_new(FALSE, 0); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5346 gtk_notebook_append_page(GTK_NOTEBOOK(gtkblist->notebook), gtkblist->vbox, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5347 gtk_widget_show_all(gtkblist->notebook); |
21583
21cbdaf265f6
This fixes the problem where all accounts are disabled due to connection
Stu Tomlinson <stu@nosnilmot.com>
parents:
21582
diff
changeset
|
5348 pidgin_blist_select_notebook_page(gtkblist); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5349 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5350 ebox = gtk_event_box_new(); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5351 gtk_box_pack_start(GTK_BOX(gtkblist->vbox), ebox, FALSE, FALSE, 0); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5352 gtkblist->headline_hbox = gtk_hbox_new(FALSE, 3); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5353 gtk_container_set_border_width(GTK_CONTAINER(gtkblist->headline_hbox), 6); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5354 gtk_container_add(GTK_CONTAINER(ebox), gtkblist->headline_hbox); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5355 gtkblist->headline_image = gtk_image_new_from_pixbuf(NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5356 gtk_misc_set_alignment(GTK_MISC(gtkblist->headline_image), 0.0, 0); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5357 gtkblist->headline_label = gtk_label_new(NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5358 gtk_widget_set_size_request(gtkblist->headline_label, |
16062
07554cc5d090
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <stu@nosnilmot.com>
parents:
16010
diff
changeset
|
5359 purple_prefs_get_int(PIDGIN_PREFS_ROOT "/blist/width")-25,-1); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5360 gtk_label_set_line_wrap(GTK_LABEL(gtkblist->headline_label), TRUE); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5361 gtk_box_pack_start(GTK_BOX(gtkblist->headline_hbox), gtkblist->headline_image, FALSE, FALSE, 0); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5362 gtk_box_pack_start(GTK_BOX(gtkblist->headline_hbox), gtkblist->headline_label, TRUE, TRUE, 0); |
21960
780266b8f15d
nacho points out that we need to connect to 'style-set' on a widget that uses the default style, because the signal is not emitted for widgets that uses custom styles. This is part of his earlier patch. References #4351.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21956
diff
changeset
|
5363 g_signal_connect(gtkblist->headline_label, /* connecting on headline_hbox doesn't work, because |
780266b8f15d
nacho points out that we need to connect to 'style-set' on a widget that uses the default style, because the signal is not emitted for widgets that uses custom styles. This is part of his earlier patch. References #4351.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21956
diff
changeset
|
5364 the signal is not emitted when theme is changed */ |
780266b8f15d
nacho points out that we need to connect to 'style-set' on a widget that uses the default style, because the signal is not emitted for widgets that uses custom styles. This is part of his earlier patch. References #4351.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21956
diff
changeset
|
5365 "style-set", |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5366 G_CALLBACK(headline_style_set), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5367 NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5368 g_signal_connect (gtkblist->headline_hbox, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5369 "expose_event", |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5370 G_CALLBACK (paint_headline_hbox), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5371 NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5372 gtk_widget_set_name(gtkblist->headline_hbox, "gtk-tooltips"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5373 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5374 gtkblist->headline_close = gtk_widget_render_icon(ebox, GTK_STOCK_CLOSE, -1, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5375 if (gtkblist->headline_close) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5376 GdkPixbuf *scale = gdk_pixbuf_scale_simple(gtkblist->headline_close, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5377 HEADLINE_CLOSE_SIZE, HEADLINE_CLOSE_SIZE, GDK_INTERP_BILINEAR); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5378 gdk_pixbuf_unref(gtkblist->headline_close); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5379 gtkblist->headline_close = scale; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5380 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5381 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5382 gtkblist->hand_cursor = gdk_cursor_new (GDK_HAND2); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5383 gtkblist->arrow_cursor = gdk_cursor_new (GDK_LEFT_PTR); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5384 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5385 g_signal_connect(G_OBJECT(ebox), "enter-notify-event", G_CALLBACK(headline_box_enter_cb), gtkblist); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5386 g_signal_connect(G_OBJECT(ebox), "leave-notify-event", G_CALLBACK(headline_box_leave_cb), gtkblist); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5387 g_signal_connect(G_OBJECT(ebox), "button-press-event", G_CALLBACK(headline_box_press_cb), gtkblist); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5388 #if 0 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5389 /* I couldn't get this to work. The idea was to draw the focus-border only |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5390 * when hovering over the close image. So for now, the focus-border is |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5391 * always there. -- sad */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5392 gtk_widget_set_events(ebox, gtk_widget_get_events(ebox) | GDK_POINTER_MOTION_HINT_MASK); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5393 g_signal_connect(G_OBJECT(ebox), "motion-notify-event", G_CALLBACK(headline_box_motion_cb), gtkblist); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5394 #endif |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5395 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5396 /****************************** GtkTreeView **********************************/ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5397 sw = gtk_scrolled_window_new(NULL,NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5398 gtk_widget_show(sw); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5399 gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW(sw), GTK_SHADOW_NONE); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5400 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5401 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5402 gtkblist->treemodel = gtk_tree_store_new(BLIST_COLUMNS, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5403 GDK_TYPE_PIXBUF, /* Status icon */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5404 G_TYPE_BOOLEAN, /* Status icon visible */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5405 G_TYPE_STRING, /* Name */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5406 G_TYPE_STRING, /* Idle */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5407 G_TYPE_BOOLEAN, /* Idle visible */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5408 GDK_TYPE_PIXBUF, /* Buddy icon */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5409 G_TYPE_BOOLEAN, /* Buddy icon visible */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5410 G_TYPE_POINTER, /* Node */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5411 GDK_TYPE_COLOR, /* bgcolor */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5412 G_TYPE_BOOLEAN, /* Group expander */ |
16121
6167ee79ecd0
Set the disable maximize button hint on the blist. I couldn't find a window manager that supports this, but I bet win32 does.
Sean Egan <seanegan@gmail.com>
parents:
16102
diff
changeset
|
5413 G_TYPE_BOOLEAN, /* Group expander visible */ |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5414 G_TYPE_BOOLEAN, /* Contact expander */ |
15463 | 5415 G_TYPE_BOOLEAN, /* Contact expander visible */ |
5416 GDK_TYPE_PIXBUF, /* Emblem */ | |
19474
74befdcd0454
Fixes #2146. Adds a Show Protocol Icon option and groups related Show menu items into a submenu. Patch from Justin Heiner
Sean Egan <seanegan@gmail.com>
parents:
19363
diff
changeset
|
5417 G_TYPE_BOOLEAN, /* Emblem visible */ |
74befdcd0454
Fixes #2146. Adds a Show Protocol Icon option and groups related Show menu items into a submenu. Patch from Justin Heiner
Sean Egan <seanegan@gmail.com>
parents:
19363
diff
changeset
|
5418 GDK_TYPE_PIXBUF, /* Protocol icon */ |
74befdcd0454
Fixes #2146. Adds a Show Protocol Icon option and groups related Show menu items into a submenu. Patch from Justin Heiner
Sean Egan <seanegan@gmail.com>
parents:
19363
diff
changeset
|
5419 G_TYPE_BOOLEAN /* Protocol visible */ |
74befdcd0454
Fixes #2146. Adds a Show Protocol Icon option and groups related Show menu items into a submenu. Patch from Justin Heiner
Sean Egan <seanegan@gmail.com>
parents:
19363
diff
changeset
|
5420 ); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5421 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5422 gtkblist->treeview = gtk_tree_view_new_with_model(GTK_TREE_MODEL(gtkblist->treemodel)); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5423 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5424 gtk_widget_show(gtkblist->treeview); |
16198
88a93f78b489
I don't like the pidginfoo_bar widget names that resulted from the sed.
Richard Laager <rlaager@wiktel.com>
parents:
16193
diff
changeset
|
5425 gtk_widget_set_name(gtkblist->treeview, "pidgin_blist_treeview"); |
15558
0324f69112f9
Make group background colors update when the theme changes.
Sean Egan <seanegan@gmail.com>
parents:
15553
diff
changeset
|
5426 |
0324f69112f9
Make group background colors update when the theme changes.
Sean Egan <seanegan@gmail.com>
parents:
15553
diff
changeset
|
5427 g_signal_connect(gtkblist->treeview, |
0324f69112f9
Make group background colors update when the theme changes.
Sean Egan <seanegan@gmail.com>
parents:
15553
diff
changeset
|
5428 "style-set", |
0324f69112f9
Make group background colors update when the theme changes.
Sean Egan <seanegan@gmail.com>
parents:
15553
diff
changeset
|
5429 G_CALLBACK(treeview_style_set), list); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5430 /* Set up selection stuff */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5431 selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(gtkblist->treeview)); |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
5432 g_signal_connect(G_OBJECT(selection), "changed", G_CALLBACK(pidgin_blist_selection_changed), NULL); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5433 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5434 /* Set up dnd */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5435 gtk_tree_view_enable_model_drag_source(GTK_TREE_VIEW(gtkblist->treeview), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5436 GDK_BUTTON1_MASK, ste, 3, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5437 GDK_ACTION_COPY); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5438 gtk_tree_view_enable_model_drag_dest(GTK_TREE_VIEW(gtkblist->treeview), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5439 dte, 5, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5440 GDK_ACTION_COPY | GDK_ACTION_MOVE); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5441 |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
5442 g_signal_connect(G_OBJECT(gtkblist->treeview), "drag-data-received", G_CALLBACK(pidgin_blist_drag_data_rcv_cb), NULL); |
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
5443 g_signal_connect(G_OBJECT(gtkblist->treeview), "drag-data-get", G_CALLBACK(pidgin_blist_drag_data_get_cb), NULL); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5444 #ifdef _WIN32 |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
5445 g_signal_connect(G_OBJECT(gtkblist->treeview), "drag-begin", G_CALLBACK(pidgin_blist_drag_begin), NULL); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5446 #endif |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
5447 g_signal_connect(G_OBJECT(gtkblist->treeview), "drag-motion", G_CALLBACK(pidgin_blist_drag_motion_cb), NULL); |
21877
6bf73aea6450
Some utility functions for showing tooltips. This is used by the buddylist,
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21781
diff
changeset
|
5448 g_signal_connect(G_OBJECT(gtkblist->treeview), "motion-notify-event", G_CALLBACK(pidgin_blist_motion_cb), NULL); |
6bf73aea6450
Some utility functions for showing tooltips. This is used by the buddylist,
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21781
diff
changeset
|
5449 g_signal_connect(G_OBJECT(gtkblist->treeview), "leave-notify-event", G_CALLBACK(pidgin_blist_leave_cb), NULL); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5450 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5451 /* Tooltips */ |
21877
6bf73aea6450
Some utility functions for showing tooltips. This is used by the buddylist,
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21781
diff
changeset
|
5452 pidgin_tooltip_setup_for_treeview(gtkblist->treeview, NULL, |
6bf73aea6450
Some utility functions for showing tooltips. This is used by the buddylist,
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21781
diff
changeset
|
5453 pidgin_blist_create_tooltip, |
6bf73aea6450
Some utility functions for showing tooltips. This is used by the buddylist,
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21781
diff
changeset
|
5454 pidgin_blist_paint_tip); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5455 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5456 gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(gtkblist->treeview), FALSE); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5457 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5458 column = gtk_tree_view_column_new(); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5459 gtk_tree_view_append_column(GTK_TREE_VIEW(gtkblist->treeview), column); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5460 gtk_tree_view_column_set_visible(column, FALSE); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5461 gtk_tree_view_set_expander_column(GTK_TREE_VIEW(gtkblist->treeview), column); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5462 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5463 gtkblist->text_column = column = gtk_tree_view_column_new (); |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
5464 rend = pidgin_cell_renderer_expander_new(); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5465 gtk_tree_view_column_pack_start(column, rend, FALSE); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5466 gtk_tree_view_column_set_attributes(column, rend, |
16121
6167ee79ecd0
Set the disable maximize button hint on the blist. I couldn't find a window manager that supports this, but I bet win32 does.
Sean Egan <seanegan@gmail.com>
parents:
16102
diff
changeset
|
5467 "visible", GROUP_EXPANDER_VISIBLE_COLUMN, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5468 "expander-visible", GROUP_EXPANDER_COLUMN, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5469 #if GTK_CHECK_VERSION(2,6,0) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5470 "sensitive", GROUP_EXPANDER_COLUMN, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5471 "cell-background-gdk", BGCOLOR_COLUMN, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5472 #endif |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5473 NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5474 |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
5475 rend = pidgin_cell_renderer_expander_new(); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5476 gtk_tree_view_column_pack_start(column, rend, FALSE); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5477 gtk_tree_view_column_set_attributes(column, rend, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5478 "expander-visible", CONTACT_EXPANDER_COLUMN, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5479 #if GTK_CHECK_VERSION(2,6,0) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5480 "sensitive", CONTACT_EXPANDER_COLUMN, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5481 "cell-background-gdk", BGCOLOR_COLUMN, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5482 #endif |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5483 "visible", CONTACT_EXPANDER_VISIBLE_COLUMN, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5484 NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5485 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5486 rend = gtk_cell_renderer_pixbuf_new(); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5487 gtk_tree_view_column_pack_start(column, rend, FALSE); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5488 gtk_tree_view_column_set_attributes(column, rend, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5489 "pixbuf", STATUS_ICON_COLUMN, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5490 "visible", STATUS_ICON_VISIBLE_COLUMN, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5491 #if GTK_CHECK_VERSION(2,6,0) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5492 "cell-background-gdk", BGCOLOR_COLUMN, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5493 #endif |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5494 NULL); |
16121
6167ee79ecd0
Set the disable maximize button hint on the blist. I couldn't find a window manager that supports this, but I bet win32 does.
Sean Egan <seanegan@gmail.com>
parents:
16102
diff
changeset
|
5495 g_object_set(rend, "xalign", 0.0, "xpad", 6, "ypad", 0, NULL); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5496 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5497 gtkblist->text_rend = rend = gtk_cell_renderer_text_new(); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5498 gtk_tree_view_column_pack_start (column, rend, TRUE); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5499 gtk_tree_view_column_set_attributes(column, rend, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5500 #if GTK_CHECK_VERSION(2,6,0) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5501 "cell-background-gdk", BGCOLOR_COLUMN, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5502 #endif |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5503 "markup", NAME_COLUMN, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5504 NULL); |
18206
66bcb7ff60d8
editing-started & editing-canceled signals are in gtk 2.6 and above only
Stu Tomlinson <stu@nosnilmot.com>
parents:
18181
diff
changeset
|
5505 #if GTK_CHECK_VERSION(2,6,0) |
16275
9a4854d71234
Patch #205, from SuperMMX. Fix a bug related to using F2 to alias
Mark Doliner <mark@kingant.net>
parents:
16222
diff
changeset
|
5506 g_signal_connect(G_OBJECT(rend), "editing-started", G_CALLBACK(gtk_blist_renderer_editing_started_cb), NULL); |
17851
452bd3baa9af
Do not update the blist TreeStore if a node is currently being edited. Then, when the node is finished editing, force a refresh. Fixes #397 in which aliasing gets rudely cut off anytime the buddy list changes
Sean Egan <seanegan@gmail.com>
parents:
17835
diff
changeset
|
5507 g_signal_connect(G_OBJECT(rend), "editing-canceled", G_CALLBACK(gtk_blist_renderer_editing_cancelled_cb), list); |
18206
66bcb7ff60d8
editing-started & editing-canceled signals are in gtk 2.6 and above only
Stu Tomlinson <stu@nosnilmot.com>
parents:
18181
diff
changeset
|
5508 #endif |
17851
452bd3baa9af
Do not update the blist TreeStore if a node is currently being edited. Then, when the node is finished editing, force a refresh. Fixes #397 in which aliasing gets rudely cut off anytime the buddy list changes
Sean Egan <seanegan@gmail.com>
parents:
17835
diff
changeset
|
5509 g_signal_connect(G_OBJECT(rend), "edited", G_CALLBACK(gtk_blist_renderer_edited_cb), list); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5510 g_object_set(rend, "ypad", 0, "yalign", 0.5, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5511 #if GTK_CHECK_VERSION(2,6,0) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5512 g_object_set(rend, "ellipsize", PANGO_ELLIPSIZE_END, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5513 #endif |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5514 gtk_tree_view_append_column(GTK_TREE_VIEW(gtkblist->treeview), column); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5515 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5516 rend = gtk_cell_renderer_text_new(); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5517 g_object_set(rend, "xalign", 1.0, "ypad", 0, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5518 gtk_tree_view_column_pack_start(column, rend, FALSE); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5519 gtk_tree_view_column_set_attributes(column, rend, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5520 "markup", IDLE_COLUMN, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5521 "visible", IDLE_VISIBLE_COLUMN, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5522 #if GTK_CHECK_VERSION(2,6,0) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5523 "cell-background-gdk", BGCOLOR_COLUMN, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5524 #endif |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5525 NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5526 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5527 rend = gtk_cell_renderer_pixbuf_new(); |
16092
2d9045592ed3
Add some padding between the emblem and the buddy icon
Sean Egan <seanegan@gmail.com>
parents:
16091
diff
changeset
|
5528 g_object_set(rend, "xalign", 1.0, "yalign", 0.5, "ypad", 0, "xpad", 3, NULL); |
15463 | 5529 gtk_tree_view_column_pack_start(column, rend, FALSE); |
5530 gtk_tree_view_column_set_attributes(column, rend, "pixbuf", EMBLEM_COLUMN, | |
5531 #if GTK_CHECK_VERSION(2,6,0) | |
5532 "cell-background-gdk", BGCOLOR_COLUMN, | |
5533 #endif | |
5534 "visible", EMBLEM_VISIBLE_COLUMN, NULL); | |
5535 | |
5536 rend = gtk_cell_renderer_pixbuf_new(); | |
20586
04590d9db8b7
Clear out the mail notifications for an account when we receive a notification of 0 emails.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20546
diff
changeset
|
5537 gtk_tree_view_column_pack_start(column, rend, FALSE); |
19474
74befdcd0454
Fixes #2146. Adds a Show Protocol Icon option and groups related Show menu items into a submenu. Patch from Justin Heiner
Sean Egan <seanegan@gmail.com>
parents:
19363
diff
changeset
|
5538 gtk_tree_view_column_set_attributes(column, rend, |
74befdcd0454
Fixes #2146. Adds a Show Protocol Icon option and groups related Show menu items into a submenu. Patch from Justin Heiner
Sean Egan <seanegan@gmail.com>
parents:
19363
diff
changeset
|
5539 "pixbuf", PROTOCOL_ICON_COLUMN, |
74befdcd0454
Fixes #2146. Adds a Show Protocol Icon option and groups related Show menu items into a submenu. Patch from Justin Heiner
Sean Egan <seanegan@gmail.com>
parents:
19363
diff
changeset
|
5540 "visible", PROTOCOL_ICON_VISIBLE_COLUMN, |
74befdcd0454
Fixes #2146. Adds a Show Protocol Icon option and groups related Show menu items into a submenu. Patch from Justin Heiner
Sean Egan <seanegan@gmail.com>
parents:
19363
diff
changeset
|
5541 #if GTK_CHECK_VERSION(2,6,0) |
74befdcd0454
Fixes #2146. Adds a Show Protocol Icon option and groups related Show menu items into a submenu. Patch from Justin Heiner
Sean Egan <seanegan@gmail.com>
parents:
19363
diff
changeset
|
5542 "cell-background-gdk", BGCOLOR_COLUMN, |
74befdcd0454
Fixes #2146. Adds a Show Protocol Icon option and groups related Show menu items into a submenu. Patch from Justin Heiner
Sean Egan <seanegan@gmail.com>
parents:
19363
diff
changeset
|
5543 #endif |
74befdcd0454
Fixes #2146. Adds a Show Protocol Icon option and groups related Show menu items into a submenu. Patch from Justin Heiner
Sean Egan <seanegan@gmail.com>
parents:
19363
diff
changeset
|
5544 NULL); |
74befdcd0454
Fixes #2146. Adds a Show Protocol Icon option and groups related Show menu items into a submenu. Patch from Justin Heiner
Sean Egan <seanegan@gmail.com>
parents:
19363
diff
changeset
|
5545 g_object_set(rend, "xalign", 0.0, "xpad", 3, "ypad", 0, NULL); |
74befdcd0454
Fixes #2146. Adds a Show Protocol Icon option and groups related Show menu items into a submenu. Patch from Justin Heiner
Sean Egan <seanegan@gmail.com>
parents:
19363
diff
changeset
|
5546 |
74befdcd0454
Fixes #2146. Adds a Show Protocol Icon option and groups related Show menu items into a submenu. Patch from Justin Heiner
Sean Egan <seanegan@gmail.com>
parents:
19363
diff
changeset
|
5547 rend = gtk_cell_renderer_pixbuf_new(); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5548 g_object_set(rend, "xalign", 1.0, "ypad", 0, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5549 gtk_tree_view_column_pack_start(column, rend, FALSE); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5550 gtk_tree_view_column_set_attributes(column, rend, "pixbuf", BUDDY_ICON_COLUMN, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5551 #if GTK_CHECK_VERSION(2,6,0) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5552 "cell-background-gdk", BGCOLOR_COLUMN, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5553 #endif |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5554 "visible", BUDDY_ICON_VISIBLE_COLUMN, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5555 NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5556 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5557 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5558 g_signal_connect(G_OBJECT(gtkblist->treeview), "row-activated", G_CALLBACK(gtk_blist_row_activated_cb), NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5559 g_signal_connect(G_OBJECT(gtkblist->treeview), "row-expanded", G_CALLBACK(gtk_blist_row_expanded_cb), NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5560 g_signal_connect(G_OBJECT(gtkblist->treeview), "row-collapsed", G_CALLBACK(gtk_blist_row_collapsed_cb), NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5561 g_signal_connect(G_OBJECT(gtkblist->treeview), "button-press-event", G_CALLBACK(gtk_blist_button_press_cb), NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5562 g_signal_connect(G_OBJECT(gtkblist->treeview), "key-press-event", G_CALLBACK(gtk_blist_key_press_cb), NULL); |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
5563 g_signal_connect(G_OBJECT(gtkblist->treeview), "popup-menu", G_CALLBACK(pidgin_blist_popup_menu_cb), NULL); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5564 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5565 /* Enable CTRL+F searching */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5566 gtk_tree_view_set_search_column(GTK_TREE_VIEW(gtkblist->treeview), NAME_COLUMN); |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
5567 gtk_tree_view_set_search_equal_func(GTK_TREE_VIEW(gtkblist->treeview), pidgin_tree_view_search_equal_func, NULL, NULL); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5568 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5569 gtk_box_pack_start(GTK_BOX(gtkblist->vbox), sw, TRUE, TRUE, 0); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5570 gtk_container_add(GTK_CONTAINER(sw), gtkblist->treeview); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5571 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5572 sep = gtk_hseparator_new(); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5573 gtk_box_pack_start(GTK_BOX(gtkblist->vbox), sep, FALSE, FALSE, 0); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5574 |
15514 | 5575 gtkblist->scrollbook = pidgin_scroll_book_new(); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5576 gtk_box_pack_start(GTK_BOX(gtkblist->vbox), gtkblist->scrollbook, FALSE, FALSE, 0); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5577 |
21401
c1c7e28223f8
Display all connection errors in a scrollbook, which is packed inside
Will Thompson <will.thompson@collabora.co.uk>
parents:
21400
diff
changeset
|
5578 /* Create an vbox which holds the scrollbook which is actually used to |
c1c7e28223f8
Display all connection errors in a scrollbook, which is packed inside
Will Thompson <will.thompson@collabora.co.uk>
parents:
21400
diff
changeset
|
5579 * display connection errors. The vbox needs to still exist for |
c1c7e28223f8
Display all connection errors in a scrollbook, which is packed inside
Will Thompson <will.thompson@collabora.co.uk>
parents:
21400
diff
changeset
|
5580 * backwards compatibility. |
c1c7e28223f8
Display all connection errors in a scrollbook, which is packed inside
Will Thompson <will.thompson@collabora.co.uk>
parents:
21400
diff
changeset
|
5581 */ |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5582 gtkblist->error_buttons = gtk_vbox_new(FALSE, 0); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5583 gtk_box_pack_start(GTK_BOX(gtkblist->vbox), gtkblist->error_buttons, FALSE, FALSE, 0); |
21401
c1c7e28223f8
Display all connection errors in a scrollbook, which is packed inside
Will Thompson <will.thompson@collabora.co.uk>
parents:
21400
diff
changeset
|
5584 gtk_container_set_border_width(GTK_CONTAINER(gtkblist->error_buttons), 0); |
c1c7e28223f8
Display all connection errors in a scrollbook, which is packed inside
Will Thompson <will.thompson@collabora.co.uk>
parents:
21400
diff
changeset
|
5585 |
21497
e2e70f45307f
Remove account error dialogs from the scrollbook's notebook, not from the
Will Thompson <will.thompson@collabora.co.uk>
parents:
21458
diff
changeset
|
5586 priv->error_scrollbook = PIDGIN_SCROLL_BOOK(pidgin_scroll_book_new()); |
21401
c1c7e28223f8
Display all connection errors in a scrollbook, which is packed inside
Will Thompson <will.thompson@collabora.co.uk>
parents:
21400
diff
changeset
|
5587 gtk_box_pack_start(GTK_BOX(gtkblist->error_buttons), |
21497
e2e70f45307f
Remove account error dialogs from the scrollbook's notebook, not from the
Will Thompson <will.thompson@collabora.co.uk>
parents:
21458
diff
changeset
|
5588 GTK_WIDGET(priv->error_scrollbook), FALSE, FALSE, 0); |
21401
c1c7e28223f8
Display all connection errors in a scrollbook, which is packed inside
Will Thompson <will.thompson@collabora.co.uk>
parents:
21400
diff
changeset
|
5589 |
c1c7e28223f8
Display all connection errors in a scrollbook, which is packed inside
Will Thompson <will.thompson@collabora.co.uk>
parents:
21400
diff
changeset
|
5590 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5591 /* Add the statusbox */ |
15514 | 5592 gtkblist->statusbox = pidgin_status_box_new(); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5593 gtk_box_pack_start(GTK_BOX(gtkblist->vbox), gtkblist->statusbox, FALSE, TRUE, 0); |
16198
88a93f78b489
I don't like the pidginfoo_bar widget names that resulted from the sed.
Richard Laager <rlaager@wiktel.com>
parents:
16193
diff
changeset
|
5594 gtk_widget_set_name(gtkblist->statusbox, "pidgin_blist_statusbox"); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5595 gtk_container_set_border_width(GTK_CONTAINER(gtkblist->statusbox), 3); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5596 gtk_widget_show(gtkblist->statusbox); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5597 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5598 /* set the Show Offline Buddies option. must be done |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5599 * after the treeview or faceprint gets mad. -Robot101 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5600 */ |
19611 | 5601 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(gtk_item_factory_get_item (gtkblist->ift, N_("/Buddies/Show/Offline Buddies"))), |
16062
07554cc5d090
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <stu@nosnilmot.com>
parents:
16010
diff
changeset
|
5602 purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/blist/show_offline_buddies")); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5603 |
19611 | 5604 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(gtk_item_factory_get_item (gtkblist->ift, N_("/Buddies/Show/Empty Groups"))), |
16062
07554cc5d090
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <stu@nosnilmot.com>
parents:
16010
diff
changeset
|
5605 purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/blist/show_empty_groups")); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5606 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5607 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(gtk_item_factory_get_item (gtkblist->ift, N_("/Tools/Mute Sounds"))), |
16062
07554cc5d090
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <stu@nosnilmot.com>
parents:
16010
diff
changeset
|
5608 purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/sound/mute")); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5609 |
19611 | 5610 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(gtk_item_factory_get_item (gtkblist->ift, N_("/Buddies/Show/Buddy Details"))), |
16062
07554cc5d090
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <stu@nosnilmot.com>
parents:
16010
diff
changeset
|
5611 purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/blist/show_buddy_icons")); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5612 |
19611 | 5613 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(gtk_item_factory_get_item (gtkblist->ift, N_("/Buddies/Show/Idle Times"))), |
16062
07554cc5d090
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <stu@nosnilmot.com>
parents:
16010
diff
changeset
|
5614 purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/blist/show_idle_time")); |
07554cc5d090
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <stu@nosnilmot.com>
parents:
16010
diff
changeset
|
5615 |
19611 | 5616 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(gtk_item_factory_get_item (gtkblist->ift, N_("/Buddies/Show/Protocol Icons"))), |
19474
74befdcd0454
Fixes #2146. Adds a Show Protocol Icon option and groups related Show menu items into a submenu. Patch from Justin Heiner
Sean Egan <seanegan@gmail.com>
parents:
19363
diff
changeset
|
5617 purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/blist/show_protocol_icons")); |
74befdcd0454
Fixes #2146. Adds a Show Protocol Icon option and groups related Show menu items into a submenu. Patch from Justin Heiner
Sean Egan <seanegan@gmail.com>
parents:
19363
diff
changeset
|
5618 |
16062
07554cc5d090
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <stu@nosnilmot.com>
parents:
16010
diff
changeset
|
5619 if(!strcmp(purple_prefs_get_string(PIDGIN_PREFS_ROOT "/sound/method"), "none")) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5620 gtk_widget_set_sensitive(gtk_item_factory_get_widget(gtkblist->ift, N_("/Tools/Mute Sounds")), FALSE); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5621 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5622 /* Update some dynamic things */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5623 update_menu_bar(gtkblist); |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
5624 pidgin_blist_update_plugin_actions(); |
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
5625 pidgin_blist_update_sort_methods(); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5626 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5627 /* OK... let's show this bad boy. */ |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
5628 pidgin_blist_refresh(list); |
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
5629 pidgin_blist_restore_position(); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5630 gtk_widget_show_all(GTK_WIDGET(gtkblist->vbox)); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5631 gtk_widget_realize(GTK_WIDGET(gtkblist->window)); |
16062
07554cc5d090
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <stu@nosnilmot.com>
parents:
16010
diff
changeset
|
5632 purple_blist_set_visible(purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/blist/list_visible")); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5633 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5634 /* start the refresh timer */ |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
5635 gtkblist->refresh_timer = g_timeout_add(30000, (GSourceFunc)pidgin_blist_refresh_timer, list); |
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
5636 |
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
5637 handle = pidgin_blist_get_handle(); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5638 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5639 /* things that affect how buddies are displayed */ |
16062
07554cc5d090
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <stu@nosnilmot.com>
parents:
16010
diff
changeset
|
5640 purple_prefs_connect_callback(handle, PIDGIN_PREFS_ROOT "/blist/show_buddy_icons", |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5641 _prefs_change_redo_list, NULL); |
16062
07554cc5d090
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <stu@nosnilmot.com>
parents:
16010
diff
changeset
|
5642 purple_prefs_connect_callback(handle, PIDGIN_PREFS_ROOT "/blist/show_idle_time", |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5643 _prefs_change_redo_list, NULL); |
16062
07554cc5d090
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <stu@nosnilmot.com>
parents:
16010
diff
changeset
|
5644 purple_prefs_connect_callback(handle, PIDGIN_PREFS_ROOT "/blist/show_empty_groups", |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5645 _prefs_change_redo_list, NULL); |
16062
07554cc5d090
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <stu@nosnilmot.com>
parents:
16010
diff
changeset
|
5646 purple_prefs_connect_callback(handle, PIDGIN_PREFS_ROOT "/blist/show_offline_buddies", |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5647 _prefs_change_redo_list, NULL); |
19474
74befdcd0454
Fixes #2146. Adds a Show Protocol Icon option and groups related Show menu items into a submenu. Patch from Justin Heiner
Sean Egan <seanegan@gmail.com>
parents:
19363
diff
changeset
|
5648 purple_prefs_connect_callback(handle, PIDGIN_PREFS_ROOT "/blist/show_protocol_icons", |
74befdcd0454
Fixes #2146. Adds a Show Protocol Icon option and groups related Show menu items into a submenu. Patch from Justin Heiner
Sean Egan <seanegan@gmail.com>
parents:
19363
diff
changeset
|
5649 _prefs_change_redo_list, NULL); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5650 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5651 /* sorting */ |
16062
07554cc5d090
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <stu@nosnilmot.com>
parents:
16010
diff
changeset
|
5652 purple_prefs_connect_callback(handle, PIDGIN_PREFS_ROOT "/blist/sort_type", |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5653 _prefs_change_sort_method, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5654 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5655 /* menus */ |
16062
07554cc5d090
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <stu@nosnilmot.com>
parents:
16010
diff
changeset
|
5656 purple_prefs_connect_callback(handle, PIDGIN_PREFS_ROOT "/sound/mute", |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
5657 pidgin_blist_mute_pref_cb, NULL); |
16062
07554cc5d090
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <stu@nosnilmot.com>
parents:
16010
diff
changeset
|
5658 purple_prefs_connect_callback(handle, PIDGIN_PREFS_ROOT "/sound/method", |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
5659 pidgin_blist_sound_method_pref_cb, NULL); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5660 |
15823 | 5661 /* Setup some purple signal handlers. */ |
21368
089fc89b6996
Remove repeated calls to purple_*_get_handle().
Will Thompson <will.thompson@collabora.co.uk>
parents:
21244
diff
changeset
|
5662 |
089fc89b6996
Remove repeated calls to purple_*_get_handle().
Will Thompson <will.thompson@collabora.co.uk>
parents:
21244
diff
changeset
|
5663 handle = purple_accounts_get_handle(); |
089fc89b6996
Remove repeated calls to purple_*_get_handle().
Will Thompson <will.thompson@collabora.co.uk>
parents:
21244
diff
changeset
|
5664 purple_signal_connect(handle, "account-enabled", gtkblist, |
089fc89b6996
Remove repeated calls to purple_*_get_handle().
Will Thompson <will.thompson@collabora.co.uk>
parents:
21244
diff
changeset
|
5665 PURPLE_CALLBACK(account_modified), gtkblist); |
089fc89b6996
Remove repeated calls to purple_*_get_handle().
Will Thompson <will.thompson@collabora.co.uk>
parents:
21244
diff
changeset
|
5666 purple_signal_connect(handle, "account-disabled", gtkblist, |
089fc89b6996
Remove repeated calls to purple_*_get_handle().
Will Thompson <will.thompson@collabora.co.uk>
parents:
21244
diff
changeset
|
5667 PURPLE_CALLBACK(account_modified), gtkblist); |
089fc89b6996
Remove repeated calls to purple_*_get_handle().
Will Thompson <will.thompson@collabora.co.uk>
parents:
21244
diff
changeset
|
5668 purple_signal_connect(handle, "account-removed", gtkblist, |
089fc89b6996
Remove repeated calls to purple_*_get_handle().
Will Thompson <will.thompson@collabora.co.uk>
parents:
21244
diff
changeset
|
5669 PURPLE_CALLBACK(account_modified), gtkblist); |
089fc89b6996
Remove repeated calls to purple_*_get_handle().
Will Thompson <will.thompson@collabora.co.uk>
parents:
21244
diff
changeset
|
5670 purple_signal_connect(handle, "account-status-changed", gtkblist, |
089fc89b6996
Remove repeated calls to purple_*_get_handle().
Will Thompson <will.thompson@collabora.co.uk>
parents:
21244
diff
changeset
|
5671 PURPLE_CALLBACK(account_status_changed), |
089fc89b6996
Remove repeated calls to purple_*_get_handle().
Will Thompson <will.thompson@collabora.co.uk>
parents:
21244
diff
changeset
|
5672 gtkblist); |
21369
318b3f5d1516
Call pidgin_blist_update_account_error_state in response to
Will Thompson <will.thompson@collabora.co.uk>
parents:
21368
diff
changeset
|
5673 purple_signal_connect(handle, "account-error-changed", gtkblist, |
21373
cbf197042bad
Add the old error to the account-error-changed signal.
Will Thompson <will.thompson@collabora.co.uk>
parents:
21369
diff
changeset
|
5674 PURPLE_CALLBACK(update_account_error_state), |
21369
318b3f5d1516
Call pidgin_blist_update_account_error_state in response to
Will Thompson <will.thompson@collabora.co.uk>
parents:
21368
diff
changeset
|
5675 gtkblist); |
21368
089fc89b6996
Remove repeated calls to purple_*_get_handle().
Will Thompson <will.thompson@collabora.co.uk>
parents:
21244
diff
changeset
|
5676 |
089fc89b6996
Remove repeated calls to purple_*_get_handle().
Will Thompson <will.thompson@collabora.co.uk>
parents:
21244
diff
changeset
|
5677 handle = pidgin_account_get_handle(); |
089fc89b6996
Remove repeated calls to purple_*_get_handle().
Will Thompson <will.thompson@collabora.co.uk>
parents:
21244
diff
changeset
|
5678 purple_signal_connect(handle, "account-modified", gtkblist, |
089fc89b6996
Remove repeated calls to purple_*_get_handle().
Will Thompson <will.thompson@collabora.co.uk>
parents:
21244
diff
changeset
|
5679 PURPLE_CALLBACK(account_modified), gtkblist); |
089fc89b6996
Remove repeated calls to purple_*_get_handle().
Will Thompson <will.thompson@collabora.co.uk>
parents:
21244
diff
changeset
|
5680 |
089fc89b6996
Remove repeated calls to purple_*_get_handle().
Will Thompson <will.thompson@collabora.co.uk>
parents:
21244
diff
changeset
|
5681 handle = purple_connections_get_handle(); |
089fc89b6996
Remove repeated calls to purple_*_get_handle().
Will Thompson <will.thompson@collabora.co.uk>
parents:
21244
diff
changeset
|
5682 purple_signal_connect(handle, "signed-on", gtkblist, |
089fc89b6996
Remove repeated calls to purple_*_get_handle().
Will Thompson <will.thompson@collabora.co.uk>
parents:
21244
diff
changeset
|
5683 PURPLE_CALLBACK(sign_on_off_cb), list); |
089fc89b6996
Remove repeated calls to purple_*_get_handle().
Will Thompson <will.thompson@collabora.co.uk>
parents:
21244
diff
changeset
|
5684 purple_signal_connect(handle, "signed-off", gtkblist, |
089fc89b6996
Remove repeated calls to purple_*_get_handle().
Will Thompson <will.thompson@collabora.co.uk>
parents:
21244
diff
changeset
|
5685 PURPLE_CALLBACK(sign_on_off_cb), list); |
089fc89b6996
Remove repeated calls to purple_*_get_handle().
Will Thompson <will.thompson@collabora.co.uk>
parents:
21244
diff
changeset
|
5686 |
089fc89b6996
Remove repeated calls to purple_*_get_handle().
Will Thompson <will.thompson@collabora.co.uk>
parents:
21244
diff
changeset
|
5687 handle = purple_plugins_get_handle(); |
089fc89b6996
Remove repeated calls to purple_*_get_handle().
Will Thompson <will.thompson@collabora.co.uk>
parents:
21244
diff
changeset
|
5688 purple_signal_connect(handle, "plugin-load", gtkblist, |
089fc89b6996
Remove repeated calls to purple_*_get_handle().
Will Thompson <will.thompson@collabora.co.uk>
parents:
21244
diff
changeset
|
5689 PURPLE_CALLBACK(plugin_changed_cb), NULL); |
089fc89b6996
Remove repeated calls to purple_*_get_handle().
Will Thompson <will.thompson@collabora.co.uk>
parents:
21244
diff
changeset
|
5690 purple_signal_connect(handle, "plugin-unload", gtkblist, |
089fc89b6996
Remove repeated calls to purple_*_get_handle().
Will Thompson <will.thompson@collabora.co.uk>
parents:
21244
diff
changeset
|
5691 PURPLE_CALLBACK(plugin_changed_cb), NULL); |
089fc89b6996
Remove repeated calls to purple_*_get_handle().
Will Thompson <will.thompson@collabora.co.uk>
parents:
21244
diff
changeset
|
5692 |
089fc89b6996
Remove repeated calls to purple_*_get_handle().
Will Thompson <will.thompson@collabora.co.uk>
parents:
21244
diff
changeset
|
5693 handle = purple_conversations_get_handle(); |
089fc89b6996
Remove repeated calls to purple_*_get_handle().
Will Thompson <will.thompson@collabora.co.uk>
parents:
21244
diff
changeset
|
5694 purple_signal_connect(handle, "conversation-updated", gtkblist, |
089fc89b6996
Remove repeated calls to purple_*_get_handle().
Will Thompson <will.thompson@collabora.co.uk>
parents:
21244
diff
changeset
|
5695 PURPLE_CALLBACK(conversation_updated_cb), |
089fc89b6996
Remove repeated calls to purple_*_get_handle().
Will Thompson <will.thompson@collabora.co.uk>
parents:
21244
diff
changeset
|
5696 gtkblist); |
089fc89b6996
Remove repeated calls to purple_*_get_handle().
Will Thompson <will.thompson@collabora.co.uk>
parents:
21244
diff
changeset
|
5697 purple_signal_connect(handle, "deleting-conversation", gtkblist, |
089fc89b6996
Remove repeated calls to purple_*_get_handle().
Will Thompson <will.thompson@collabora.co.uk>
parents:
21244
diff
changeset
|
5698 PURPLE_CALLBACK(conversation_deleting_cb), |
089fc89b6996
Remove repeated calls to purple_*_get_handle().
Will Thompson <will.thompson@collabora.co.uk>
parents:
21244
diff
changeset
|
5699 gtkblist); |
089fc89b6996
Remove repeated calls to purple_*_get_handle().
Will Thompson <will.thompson@collabora.co.uk>
parents:
21244
diff
changeset
|
5700 purple_signal_connect(handle, "conversation-created", gtkblist, |
089fc89b6996
Remove repeated calls to purple_*_get_handle().
Will Thompson <will.thompson@collabora.co.uk>
parents:
21244
diff
changeset
|
5701 PURPLE_CALLBACK(conversation_created_cb), |
089fc89b6996
Remove repeated calls to purple_*_get_handle().
Will Thompson <will.thompson@collabora.co.uk>
parents:
21244
diff
changeset
|
5702 gtkblist); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5703 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5704 gtk_widget_hide(gtkblist->headline_hbox); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5705 |
21395
04b1742c8206
Restore error notifications on the buddy list after a restart. Make the Ignore
Will Thompson <will.thompson@collabora.co.uk>
parents:
21387
diff
changeset
|
5706 show_initial_account_errors(gtkblist); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5707 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5708 /* emit our created signal */ |
21368
089fc89b6996
Remove repeated calls to purple_*_get_handle().
Will Thompson <will.thompson@collabora.co.uk>
parents:
21244
diff
changeset
|
5709 handle = pidgin_blist_get_handle(); |
15823 | 5710 purple_signal_emit(handle, "gtkblist-created", list); |
5711 } | |
5712 | |
5713 static void redo_buddy_list(PurpleBuddyList *list, gboolean remove, gboolean rerender) | |
5714 { | |
5715 PurpleBlistNode *node; | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5716 |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
5717 gtkblist = PIDGIN_BLIST(list); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5718 if(!gtkblist || !gtkblist->treeview) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5719 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5720 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5721 node = list->root; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5722 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5723 while (node) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5724 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5725 /* This is only needed when we're reverting to a non-GTK+ sorted |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5726 * status. We shouldn't need to remove otherwise. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5727 */ |
15823 | 5728 if (remove && !PURPLE_BLIST_NODE_IS_GROUP(node)) |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
5729 pidgin_blist_hide_node(list, node, FALSE); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5730 |
15823 | 5731 if (PURPLE_BLIST_NODE_IS_BUDDY(node)) |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
5732 pidgin_blist_update_buddy(list, node, rerender); |
15823 | 5733 else if (PURPLE_BLIST_NODE_IS_CHAT(node)) |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
5734 pidgin_blist_update(list, node); |
15823 | 5735 else if (PURPLE_BLIST_NODE_IS_GROUP(node)) |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
5736 pidgin_blist_update(list, node); |
15823 | 5737 node = purple_blist_node_next(node, FALSE); |
5738 } | |
5739 | |
5740 } | |
5741 | |
5742 void pidgin_blist_refresh(PurpleBuddyList *list) | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5743 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5744 redo_buddy_list(list, FALSE, TRUE); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5745 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5746 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5747 void |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
5748 pidgin_blist_update_refresh_timeout() |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5749 { |
15823 | 5750 PurpleBuddyList *blist; |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
5751 PidginBuddyList *gtkblist; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5752 |
15823 | 5753 blist = purple_get_blist(); |
5754 gtkblist = PIDGIN_BLIST(purple_get_blist()); | |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
5755 |
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
5756 gtkblist->refresh_timer = g_timeout_add(30000,(GSourceFunc)pidgin_blist_refresh_timer, blist); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5757 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5758 |
15823 | 5759 static gboolean get_iter_from_node(PurpleBlistNode *node, GtkTreeIter *iter) { |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
5760 struct _pidgin_blist_node *gtknode = (struct _pidgin_blist_node *)node->ui_data; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5761 GtkTreePath *path; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5762 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5763 if (!gtknode) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5764 return FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5765 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5766 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5767 if (!gtkblist) { |
15823 | 5768 purple_debug_error("gtkblist", "get_iter_from_node was called, but we don't seem to have a blist\n"); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5769 return FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5770 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5771 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5772 if (!gtknode->row) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5773 return FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5774 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5775 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5776 if ((path = gtk_tree_row_reference_get_path(gtknode->row)) == NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5777 return FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5778 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5779 if (!gtk_tree_model_get_iter(GTK_TREE_MODEL(gtkblist->treemodel), iter, path)) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5780 gtk_tree_path_free(path); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5781 return FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5782 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5783 gtk_tree_path_free(path); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5784 return TRUE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5785 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5786 |
15823 | 5787 static void pidgin_blist_remove(PurpleBuddyList *list, PurpleBlistNode *node) |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
5788 { |
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
5789 struct _pidgin_blist_node *gtknode = node->ui_data; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5790 |
15823 | 5791 purple_request_close_with_handle(node); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5792 |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
5793 pidgin_blist_hide_node(list, node, TRUE); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5794 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5795 if(node->parent) |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
5796 pidgin_blist_update(list, node->parent); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5797 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5798 /* There's something I don't understand here - Ethan */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5799 /* Ethan said that back in 2003, but this g_free has been left commented |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5800 * out ever since. I can't find any reason at all why this is bad and |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5801 * valgrind found several reasons why it's good. If this causes problems |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5802 * comment it out again. Stu */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5803 /* Of course it still causes problems - this breaks dragging buddies into |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5804 * contacts, the dragged buddy mysteriously 'disappears'. Stu. */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5805 /* I think it's fixed now. Stu. */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5806 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5807 if(gtknode) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5808 if(gtknode->recent_signonoff_timer > 0) |
15823 | 5809 purple_timeout_remove(gtknode->recent_signonoff_timer); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5810 |
19894
0ac0e112a0fa
Add some stuff so that we don't have to traverse over a list to determine
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19611
diff
changeset
|
5811 purple_signals_disconnect_by_handle(node->ui_data); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5812 g_free(node->ui_data); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5813 node->ui_data = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5814 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5815 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5816 |
15823 | 5817 static gboolean do_selection_changed(PurpleBlistNode *new_selection) |
5818 { | |
5819 PurpleBlistNode *old_selection = NULL; | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5820 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5821 /* test for gtkblist because crazy timeout means we can be called after the blist is gone */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5822 if (gtkblist && new_selection != gtkblist->selected_node) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5823 old_selection = gtkblist->selected_node; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5824 gtkblist->selected_node = new_selection; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5825 if(new_selection) |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
5826 pidgin_blist_update(NULL, new_selection); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5827 if(old_selection) |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
5828 pidgin_blist_update(NULL, old_selection); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5829 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5830 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5831 return FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5832 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5833 |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
5834 static void pidgin_blist_selection_changed(GtkTreeSelection *selection, gpointer data) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5835 { |
15823 | 5836 PurpleBlistNode *new_selection = NULL; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5837 GtkTreeIter iter; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5838 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5839 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
|
5840 gtk_tree_model_get(GTK_TREE_MODEL(gtkblist->treemodel), &iter, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5841 NODE_COLUMN, &new_selection, -1); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5842 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5843 |
17674
0e4a789cd027
We use a timeout in our blist selection changed callback to prevent buddy
Stu Tomlinson <stu@nosnilmot.com>
parents:
17488
diff
changeset
|
5844 /* we set this up as a timeout, otherwise the blist flickers ... |
0e4a789cd027
We use a timeout in our blist selection changed callback to prevent buddy
Stu Tomlinson <stu@nosnilmot.com>
parents:
17488
diff
changeset
|
5845 * but we don't do it for groups, because it causes total bizarness - |
0e4a789cd027
We use a timeout in our blist selection changed callback to prevent buddy
Stu Tomlinson <stu@nosnilmot.com>
parents:
17488
diff
changeset
|
5846 * the previously selected buddy node might rendered at half height. |
0e4a789cd027
We use a timeout in our blist selection changed callback to prevent buddy
Stu Tomlinson <stu@nosnilmot.com>
parents:
17488
diff
changeset
|
5847 */ |
0e4a789cd027
We use a timeout in our blist selection changed callback to prevent buddy
Stu Tomlinson <stu@nosnilmot.com>
parents:
17488
diff
changeset
|
5848 if ((new_selection != NULL) && PURPLE_BLIST_NODE_IS_GROUP(new_selection)) { |
0e4a789cd027
We use a timeout in our blist selection changed callback to prevent buddy
Stu Tomlinson <stu@nosnilmot.com>
parents:
17488
diff
changeset
|
5849 do_selection_changed(new_selection); |
0e4a789cd027
We use a timeout in our blist selection changed callback to prevent buddy
Stu Tomlinson <stu@nosnilmot.com>
parents:
17488
diff
changeset
|
5850 } else { |
0e4a789cd027
We use a timeout in our blist selection changed callback to prevent buddy
Stu Tomlinson <stu@nosnilmot.com>
parents:
17488
diff
changeset
|
5851 g_timeout_add(0, (GSourceFunc)do_selection_changed, new_selection); |
0e4a789cd027
We use a timeout in our blist selection changed callback to prevent buddy
Stu Tomlinson <stu@nosnilmot.com>
parents:
17488
diff
changeset
|
5852 } |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5853 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5854 |
15823 | 5855 static gboolean insert_node(PurpleBuddyList *list, PurpleBlistNode *node, GtkTreeIter *iter) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5856 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5857 GtkTreeIter parent_iter, cur, *curptr = NULL; |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
5858 struct _pidgin_blist_node *gtknode = node->ui_data; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5859 GtkTreePath *newpath; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5860 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5861 if(!iter) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5862 return FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5863 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5864 if(node->parent && !get_iter_from_node(node->parent, &parent_iter)) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5865 return FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5866 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5867 if(get_iter_from_node(node, &cur)) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5868 curptr = &cur; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5869 |
15823 | 5870 if(PURPLE_BLIST_NODE_IS_CONTACT(node) || PURPLE_BLIST_NODE_IS_CHAT(node)) { |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5871 current_sort_method->func(node, list, parent_iter, curptr, iter); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5872 } else { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5873 sort_method_none(node, list, parent_iter, curptr, iter); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5874 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5875 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5876 if(gtknode != NULL) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5877 gtk_tree_row_reference_free(gtknode->row); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5878 } else { |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
5879 pidgin_blist_new_node(node); |
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
5880 gtknode = (struct _pidgin_blist_node *)node->ui_data; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5881 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5882 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5883 newpath = gtk_tree_model_get_path(GTK_TREE_MODEL(gtkblist->treemodel), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5884 iter); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5885 gtknode->row = |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5886 gtk_tree_row_reference_new(GTK_TREE_MODEL(gtkblist->treemodel), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5887 newpath); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5888 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5889 gtk_tree_path_free(newpath); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5890 |
17851
452bd3baa9af
Do not update the blist TreeStore if a node is currently being edited. Then, when the node is finished editing, force a refresh. Fixes #397 in which aliasing gets rudely cut off anytime the buddy list changes
Sean Egan <seanegan@gmail.com>
parents:
17835
diff
changeset
|
5891 if (!editing_blist) |
452bd3baa9af
Do not update the blist TreeStore if a node is currently being edited. Then, when the node is finished editing, force a refresh. Fixes #397 in which aliasing gets rudely cut off anytime the buddy list changes
Sean Egan <seanegan@gmail.com>
parents:
17835
diff
changeset
|
5892 gtk_tree_store_set(gtkblist->treemodel, iter, |
452bd3baa9af
Do not update the blist TreeStore if a node is currently being edited. Then, when the node is finished editing, force a refresh. Fixes #397 in which aliasing gets rudely cut off anytime the buddy list changes
Sean Egan <seanegan@gmail.com>
parents:
17835
diff
changeset
|
5893 NODE_COLUMN, node, |
452bd3baa9af
Do not update the blist TreeStore if a node is currently being edited. Then, when the node is finished editing, force a refresh. Fixes #397 in which aliasing gets rudely cut off anytime the buddy list changes
Sean Egan <seanegan@gmail.com>
parents:
17835
diff
changeset
|
5894 -1); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5895 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5896 if(node->parent) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5897 GtkTreePath *expand = NULL; |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
5898 struct _pidgin_blist_node *gtkparentnode = node->parent->ui_data; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5899 |
15823 | 5900 if(PURPLE_BLIST_NODE_IS_GROUP(node->parent)) { |
5901 if(!purple_blist_node_get_bool(node->parent, "collapsed")) | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5902 expand = gtk_tree_model_get_path(GTK_TREE_MODEL(gtkblist->treemodel), &parent_iter); |
15823 | 5903 } else if(PURPLE_BLIST_NODE_IS_CONTACT(node->parent) && |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5904 gtkparentnode->contact_expanded) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5905 expand = gtk_tree_model_get_path(GTK_TREE_MODEL(gtkblist->treemodel), &parent_iter); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5906 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5907 if(expand) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5908 gtk_tree_view_expand_row(GTK_TREE_VIEW(gtkblist->treeview), expand, FALSE); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5909 gtk_tree_path_free(expand); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5910 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5911 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5912 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5913 return TRUE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5914 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5915 |
21582
b00659aa0acf
Fix showing groups that contain offline buddies that have the "Show when
Stu Tomlinson <stu@nosnilmot.com>
parents:
21560
diff
changeset
|
5916 static gboolean pidgin_blist_group_has_show_offline_buddy(PurpleGroup *group) |
b00659aa0acf
Fix showing groups that contain offline buddies that have the "Show when
Stu Tomlinson <stu@nosnilmot.com>
parents:
21560
diff
changeset
|
5917 { |
b00659aa0acf
Fix showing groups that contain offline buddies that have the "Show when
Stu Tomlinson <stu@nosnilmot.com>
parents:
21560
diff
changeset
|
5918 PurpleBlistNode *gnode, *cnode, *bnode; |
b00659aa0acf
Fix showing groups that contain offline buddies that have the "Show when
Stu Tomlinson <stu@nosnilmot.com>
parents:
21560
diff
changeset
|
5919 |
b00659aa0acf
Fix showing groups that contain offline buddies that have the "Show when
Stu Tomlinson <stu@nosnilmot.com>
parents:
21560
diff
changeset
|
5920 gnode = (PurpleBlistNode *)group; |
b00659aa0acf
Fix showing groups that contain offline buddies that have the "Show when
Stu Tomlinson <stu@nosnilmot.com>
parents:
21560
diff
changeset
|
5921 for(cnode = gnode->child; cnode; cnode = cnode->next) { |
b00659aa0acf
Fix showing groups that contain offline buddies that have the "Show when
Stu Tomlinson <stu@nosnilmot.com>
parents:
21560
diff
changeset
|
5922 if(PURPLE_BLIST_NODE_IS_CONTACT(cnode)) { |
b00659aa0acf
Fix showing groups that contain offline buddies that have the "Show when
Stu Tomlinson <stu@nosnilmot.com>
parents:
21560
diff
changeset
|
5923 for(bnode = cnode->child; bnode; bnode = bnode->next) { |
b00659aa0acf
Fix showing groups that contain offline buddies that have the "Show when
Stu Tomlinson <stu@nosnilmot.com>
parents:
21560
diff
changeset
|
5924 PurpleBuddy *buddy = (PurpleBuddy *)bnode; |
b00659aa0acf
Fix showing groups that contain offline buddies that have the "Show when
Stu Tomlinson <stu@nosnilmot.com>
parents:
21560
diff
changeset
|
5925 if (purple_account_is_connected(buddy->account) && |
b00659aa0acf
Fix showing groups that contain offline buddies that have the "Show when
Stu Tomlinson <stu@nosnilmot.com>
parents:
21560
diff
changeset
|
5926 purple_blist_node_get_bool(bnode, "show_offline")) |
b00659aa0acf
Fix showing groups that contain offline buddies that have the "Show when
Stu Tomlinson <stu@nosnilmot.com>
parents:
21560
diff
changeset
|
5927 return TRUE; |
b00659aa0acf
Fix showing groups that contain offline buddies that have the "Show when
Stu Tomlinson <stu@nosnilmot.com>
parents:
21560
diff
changeset
|
5928 } |
b00659aa0acf
Fix showing groups that contain offline buddies that have the "Show when
Stu Tomlinson <stu@nosnilmot.com>
parents:
21560
diff
changeset
|
5929 } |
b00659aa0acf
Fix showing groups that contain offline buddies that have the "Show when
Stu Tomlinson <stu@nosnilmot.com>
parents:
21560
diff
changeset
|
5930 } |
b00659aa0acf
Fix showing groups that contain offline buddies that have the "Show when
Stu Tomlinson <stu@nosnilmot.com>
parents:
21560
diff
changeset
|
5931 return FALSE; |
b00659aa0acf
Fix showing groups that contain offline buddies that have the "Show when
Stu Tomlinson <stu@nosnilmot.com>
parents:
21560
diff
changeset
|
5932 } |
b00659aa0acf
Fix showing groups that contain offline buddies that have the "Show when
Stu Tomlinson <stu@nosnilmot.com>
parents:
21560
diff
changeset
|
5933 |
23158
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23131
diff
changeset
|
5934 /* This version of pidgin_blist_update_group can take the original buddy or a |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23131
diff
changeset
|
5935 * group, but has much better algorithmic performance with a pre-known buddy. |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23131
diff
changeset
|
5936 */ |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23131
diff
changeset
|
5937 static void pidgin_blist_update_group(PurpleBuddyList *list, |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23131
diff
changeset
|
5938 PurpleBlistNode *node) |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23131
diff
changeset
|
5939 { |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23131
diff
changeset
|
5940 gint count; |
15823 | 5941 PurpleGroup *group; |
23158
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23131
diff
changeset
|
5942 PurpleBlistNode* gnode; |
21582
b00659aa0acf
Fix showing groups that contain offline buddies that have the "Show when
Stu Tomlinson <stu@nosnilmot.com>
parents:
21560
diff
changeset
|
5943 gboolean show = FALSE, show_offline = FALSE; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5944 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5945 g_return_if_fail(node != NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5946 |
17851
452bd3baa9af
Do not update the blist TreeStore if a node is currently being edited. Then, when the node is finished editing, force a refresh. Fixes #397 in which aliasing gets rudely cut off anytime the buddy list changes
Sean Egan <seanegan@gmail.com>
parents:
17835
diff
changeset
|
5947 if (editing_blist) |
452bd3baa9af
Do not update the blist TreeStore if a node is currently being edited. Then, when the node is finished editing, force a refresh. Fixes #397 in which aliasing gets rudely cut off anytime the buddy list changes
Sean Egan <seanegan@gmail.com>
parents:
17835
diff
changeset
|
5948 return; |
452bd3baa9af
Do not update the blist TreeStore if a node is currently being edited. Then, when the node is finished editing, force a refresh. Fixes #397 in which aliasing gets rudely cut off anytime the buddy list changes
Sean Egan <seanegan@gmail.com>
parents:
17835
diff
changeset
|
5949 |
15823 | 5950 if (PURPLE_BLIST_NODE_IS_GROUP(node)) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5951 gnode = node; |
15823 | 5952 else if (PURPLE_BLIST_NODE_IS_BUDDY(node)) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5953 gnode = node->parent->parent; |
15823 | 5954 else if (PURPLE_BLIST_NODE_IS_CONTACT(node) || PURPLE_BLIST_NODE_IS_CHAT(node)) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5955 gnode = node->parent; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5956 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5957 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5958 |
15823 | 5959 group = (PurpleGroup*)gnode; |
5960 | |
21582
b00659aa0acf
Fix showing groups that contain offline buddies that have the "Show when
Stu Tomlinson <stu@nosnilmot.com>
parents:
21560
diff
changeset
|
5961 show_offline = purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/blist/show_offline_buddies"); |
b00659aa0acf
Fix showing groups that contain offline buddies that have the "Show when
Stu Tomlinson <stu@nosnilmot.com>
parents:
21560
diff
changeset
|
5962 |
b00659aa0acf
Fix showing groups that contain offline buddies that have the "Show when
Stu Tomlinson <stu@nosnilmot.com>
parents:
21560
diff
changeset
|
5963 if(show_offline) |
15823 | 5964 count = purple_blist_get_group_size(group, FALSE); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5965 else |
15823 | 5966 count = purple_blist_get_group_online_count(group); |
5967 | |
16062
07554cc5d090
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <stu@nosnilmot.com>
parents:
16010
diff
changeset
|
5968 if (count > 0 || purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/blist/show_empty_groups")) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5969 show = TRUE; |
21582
b00659aa0acf
Fix showing groups that contain offline buddies that have the "Show when
Stu Tomlinson <stu@nosnilmot.com>
parents:
21560
diff
changeset
|
5970 else if (PURPLE_BLIST_NODE_IS_BUDDY(node)) { /* Or chat? */ |
15823 | 5971 if (buddy_is_displayable((PurpleBuddy*)node)) |
21582
b00659aa0acf
Fix showing groups that contain offline buddies that have the "Show when
Stu Tomlinson <stu@nosnilmot.com>
parents:
21560
diff
changeset
|
5972 show = TRUE; |
b00659aa0acf
Fix showing groups that contain offline buddies that have the "Show when
Stu Tomlinson <stu@nosnilmot.com>
parents:
21560
diff
changeset
|
5973 } else if (!show_offline && PURPLE_BLIST_NODE_IS_GROUP(node)) { |
b00659aa0acf
Fix showing groups that contain offline buddies that have the "Show when
Stu Tomlinson <stu@nosnilmot.com>
parents:
21560
diff
changeset
|
5974 show = pidgin_blist_group_has_show_offline_buddy(group); |
b00659aa0acf
Fix showing groups that contain offline buddies that have the "Show when
Stu Tomlinson <stu@nosnilmot.com>
parents:
21560
diff
changeset
|
5975 } |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5976 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5977 if (show) { |
23158
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23131
diff
changeset
|
5978 gchar *title; |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23131
diff
changeset
|
5979 gboolean biglist; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5980 GtkTreeIter iter; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5981 GtkTreePath *path; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5982 gboolean expanded; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5983 GdkColor bgcolor; |
23158
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23131
diff
changeset
|
5984 GdkPixbuf *avatar = NULL; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5985 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5986 if(!insert_node(list, gnode, &iter)) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5987 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5988 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5989 bgcolor = gtkblist->treeview->style->bg[GTK_STATE_ACTIVE]; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5990 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5991 path = gtk_tree_model_get_path(GTK_TREE_MODEL(gtkblist->treemodel), &iter); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5992 expanded = gtk_tree_view_row_expanded(GTK_TREE_VIEW(gtkblist->treeview), path); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5993 gtk_tree_path_free(path); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5994 |
15821 | 5995 title = pidgin_get_group_title(gnode, expanded); |
23158
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23131
diff
changeset
|
5996 biglist = purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/blist/show_buddy_icons"); |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23131
diff
changeset
|
5997 |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23131
diff
changeset
|
5998 if (biglist) { |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23131
diff
changeset
|
5999 avatar = pidgin_blist_get_buddy_icon(gnode, TRUE, TRUE); |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23131
diff
changeset
|
6000 } |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6001 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6002 gtk_tree_store_set(gtkblist->treemodel, &iter, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6003 STATUS_ICON_VISIBLE_COLUMN, FALSE, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6004 STATUS_ICON_COLUMN, NULL, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6005 NAME_COLUMN, title, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6006 NODE_COLUMN, gnode, |
23158
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23131
diff
changeset
|
6007 /* BGCOLOR_COLUMN, &bgcolor, */ |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6008 GROUP_EXPANDER_COLUMN, TRUE, |
16121
6167ee79ecd0
Set the disable maximize button hint on the blist. I couldn't find a window manager that supports this, but I bet win32 does.
Sean Egan <seanegan@gmail.com>
parents:
16102
diff
changeset
|
6009 GROUP_EXPANDER_VISIBLE_COLUMN, TRUE, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6010 CONTACT_EXPANDER_VISIBLE_COLUMN, FALSE, |
23158
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23131
diff
changeset
|
6011 BUDDY_ICON_COLUMN, avatar, |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23131
diff
changeset
|
6012 BUDDY_ICON_VISIBLE_COLUMN, biglist, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6013 IDLE_VISIBLE_COLUMN, FALSE, |
15463 | 6014 EMBLEM_VISIBLE_COLUMN, FALSE, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6015 -1); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6016 g_free(title); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6017 } else { |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
6018 pidgin_blist_hide_node(list, gnode, TRUE); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6019 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6020 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6021 |
15823 | 6022 static char *pidgin_get_group_title(PurpleBlistNode *gnode, gboolean expanded) |
6023 { | |
6024 PurpleGroup *group; | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6025 gboolean selected; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6026 char group_count[12] = ""; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6027 char *mark, *esc; |
18309
c50e960e7086
Patch from SuperMMX to correct group colors. Fixes #1640
Sean Egan <seanegan@gmail.com>
parents:
18285
diff
changeset
|
6028 PurpleBlistNode *selected_node = NULL; |
c50e960e7086
Patch from SuperMMX to correct group colors. Fixes #1640
Sean Egan <seanegan@gmail.com>
parents:
18285
diff
changeset
|
6029 GtkTreeIter iter; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6030 |
15823 | 6031 group = (PurpleGroup*)gnode; |
20586
04590d9db8b7
Clear out the mail notifications for an account when we receive a notification of 0 emails.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20546
diff
changeset
|
6032 |
18309
c50e960e7086
Patch from SuperMMX to correct group colors. Fixes #1640
Sean Egan <seanegan@gmail.com>
parents:
18285
diff
changeset
|
6033 if (gtk_tree_selection_get_selected(gtk_tree_view_get_selection(GTK_TREE_VIEW(gtkblist->treeview)), NULL, &iter)) { |
c50e960e7086
Patch from SuperMMX to correct group colors. Fixes #1640
Sean Egan <seanegan@gmail.com>
parents:
18285
diff
changeset
|
6034 gtk_tree_model_get(GTK_TREE_MODEL(gtkblist->treemodel), &iter, |
c50e960e7086
Patch from SuperMMX to correct group colors. Fixes #1640
Sean Egan <seanegan@gmail.com>
parents:
18285
diff
changeset
|
6035 NODE_COLUMN, &selected_node, -1); |
c50e960e7086
Patch from SuperMMX to correct group colors. Fixes #1640
Sean Egan <seanegan@gmail.com>
parents:
18285
diff
changeset
|
6036 } |
c50e960e7086
Patch from SuperMMX to correct group colors. Fixes #1640
Sean Egan <seanegan@gmail.com>
parents:
18285
diff
changeset
|
6037 selected = (gnode == selected_node); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6038 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6039 if (!expanded) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6040 g_snprintf(group_count, sizeof(group_count), " (%d/%d)", |
15823 | 6041 purple_blist_get_group_online_count(group), |
6042 purple_blist_get_group_size(group, FALSE)); | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6043 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6044 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6045 esc = g_markup_escape_text(group->name, -1); |
21757
92ae7b2c95ed
Don't set the color for the group node text, now that we're not setting its background
Sean Egan <seanegan@gmail.com>
parents:
21756
diff
changeset
|
6046 mark = g_strdup_printf("<span weight='bold'>%s</span>%s", esc ? esc : "", group_count); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6047 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6048 g_free(esc); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6049 return mark; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6050 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6051 |
15823 | 6052 static void buddy_node(PurpleBuddy *buddy, GtkTreeIter *iter, PurpleBlistNode *node) |
6053 { | |
6054 PurplePresence *presence; | |
20872
71d0989b7c25
Prevent leakage of the prpl icon pixbuf because of an extra ref (it's bad enough that they aren't shared).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20841
diff
changeset
|
6055 GdkPixbuf *status, *avatar, *emblem, *prpl_icon; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6056 char *mark; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6057 char *idle = NULL; |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
6058 gboolean expanded = ((struct _pidgin_blist_node *)(node->parent->ui_data))->contact_expanded; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6059 gboolean selected = (gtkblist->selected_node == node); |
16062
07554cc5d090
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <stu@nosnilmot.com>
parents:
16010
diff
changeset
|
6060 gboolean biglist = purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/blist/show_buddy_icons"); |
15823 | 6061 presence = purple_buddy_get_presence(buddy); |
6062 | |
17851
452bd3baa9af
Do not update the blist TreeStore if a node is currently being edited. Then, when the node is finished editing, force a refresh. Fixes #397 in which aliasing gets rudely cut off anytime the buddy list changes
Sean Egan <seanegan@gmail.com>
parents:
17835
diff
changeset
|
6063 if (editing_blist) |
452bd3baa9af
Do not update the blist TreeStore if a node is currently being edited. Then, when the node is finished editing, force a refresh. Fixes #397 in which aliasing gets rudely cut off anytime the buddy list changes
Sean Egan <seanegan@gmail.com>
parents:
17835
diff
changeset
|
6064 return; |
20872
71d0989b7c25
Prevent leakage of the prpl icon pixbuf because of an extra ref (it's bad enough that they aren't shared).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20841
diff
changeset
|
6065 |
15823 | 6066 status = pidgin_blist_get_status_icon((PurpleBlistNode*)buddy, |
21660
c29f2e3a3b99
Had this laying around. Weeks (months?) ago all the small listers and Hylke agreed that Small list looks better with conversation tab sized icons
Sean Egan <seanegan@gmail.com>
parents:
21659
diff
changeset
|
6067 biglist ? PIDGIN_STATUS_ICON_LARGE : PIDGIN_STATUS_ICON_SMALL); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6068 |
16905
aa87ecd650d2
Speed up blist manipulations, by Scott Wolchok (EvilSporkMan)
Ethan Blanton <elb@pidgin.im>
parents:
16858
diff
changeset
|
6069 /* Speed it up if we don't want buddy icons. */ |
aa87ecd650d2
Speed up blist manipulations, by Scott Wolchok (EvilSporkMan)
Ethan Blanton <elb@pidgin.im>
parents:
16858
diff
changeset
|
6070 if(biglist) |
aa87ecd650d2
Speed up blist manipulations, by Scott Wolchok (EvilSporkMan)
Ethan Blanton <elb@pidgin.im>
parents:
16858
diff
changeset
|
6071 avatar = pidgin_blist_get_buddy_icon((PurpleBlistNode *)buddy, TRUE, TRUE); |
aa87ecd650d2
Speed up blist manipulations, by Scott Wolchok (EvilSporkMan)
Ethan Blanton <elb@pidgin.im>
parents:
16858
diff
changeset
|
6072 else |
aa87ecd650d2
Speed up blist manipulations, by Scott Wolchok (EvilSporkMan)
Ethan Blanton <elb@pidgin.im>
parents:
16858
diff
changeset
|
6073 avatar = NULL; |
aa87ecd650d2
Speed up blist manipulations, by Scott Wolchok (EvilSporkMan)
Ethan Blanton <elb@pidgin.im>
parents:
16858
diff
changeset
|
6074 |
15397
a8ee645e7fb4
A lot of status icon changes:
Sean Egan <seanegan@gmail.com>
parents:
15374
diff
changeset
|
6075 if (!avatar) { |
a8ee645e7fb4
A lot of status icon changes:
Sean Egan <seanegan@gmail.com>
parents:
15374
diff
changeset
|
6076 g_object_ref(G_OBJECT(gtkblist->empty_avatar)); |
a8ee645e7fb4
A lot of status icon changes:
Sean Egan <seanegan@gmail.com>
parents:
15374
diff
changeset
|
6077 avatar = gtkblist->empty_avatar; |
15823 | 6078 } else if ((!PURPLE_BUDDY_IS_ONLINE(buddy) || purple_presence_is_idle(presence))) { |
15491
88070d5f4c62
dim buddy icons on idle and offline. Still need to do status icons.
Sean Egan <seanegan@gmail.com>
parents:
15490
diff
changeset
|
6079 do_alphashift(avatar, avatar, 77); |
88070d5f4c62
dim buddy icons on idle and offline. Still need to do status icons.
Sean Egan <seanegan@gmail.com>
parents:
15490
diff
changeset
|
6080 } |
88070d5f4c62
dim buddy icons on idle and offline. Still need to do status icons.
Sean Egan <seanegan@gmail.com>
parents:
15490
diff
changeset
|
6081 |
15823 | 6082 emblem = pidgin_blist_get_emblem((PurpleBlistNode*) buddy); |
18211
84b577372b90
Show screenname instead of alias in conversation infopanes
Sean Egan <seanegan@gmail.com>
parents:
18208
diff
changeset
|
6083 mark = pidgin_blist_get_name_markup(buddy, selected, TRUE); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6084 |
16062
07554cc5d090
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <stu@nosnilmot.com>
parents:
16010
diff
changeset
|
6085 if (purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/blist/show_idle_time") && |
15823 | 6086 purple_presence_is_idle(presence) && |
16062
07554cc5d090
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <stu@nosnilmot.com>
parents:
16010
diff
changeset
|
6087 !purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/blist/show_buddy_icons")) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6088 { |
15823 | 6089 time_t idle_secs = purple_presence_get_idle_time(presence); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6090 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6091 if (idle_secs > 0) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6092 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6093 time_t t; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6094 int ihrs, imin; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6095 time(&t); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6096 ihrs = (t - idle_secs) / 3600; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6097 imin = ((t - idle_secs) / 60) % 60; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6098 idle = g_strdup_printf("%d:%02d", ihrs, imin); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6099 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6100 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6101 |
15823 | 6102 if (purple_presence_is_idle(presence)) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6103 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6104 if (idle && !selected) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6105 char *i2 = g_strdup_printf("<span color='%s'>%s</span>", |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6106 dim_grey(), idle); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6107 g_free(idle); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6108 idle = i2; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6109 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6110 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6111 |
20872
71d0989b7c25
Prevent leakage of the prpl icon pixbuf because of an extra ref (it's bad enough that they aren't shared).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20841
diff
changeset
|
6112 prpl_icon = pidgin_create_prpl_icon(buddy->account, PIDGIN_PRPL_ICON_SMALL); |
71d0989b7c25
Prevent leakage of the prpl icon pixbuf because of an extra ref (it's bad enough that they aren't shared).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20841
diff
changeset
|
6113 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6114 gtk_tree_store_set(gtkblist->treemodel, iter, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6115 STATUS_ICON_COLUMN, status, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6116 STATUS_ICON_VISIBLE_COLUMN, TRUE, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6117 NAME_COLUMN, mark, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6118 IDLE_COLUMN, idle, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6119 IDLE_VISIBLE_COLUMN, !biglist && idle, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6120 BUDDY_ICON_COLUMN, avatar, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6121 BUDDY_ICON_VISIBLE_COLUMN, biglist, |
15463 | 6122 EMBLEM_COLUMN, emblem, |
20834
6b9e5bbab0fe
We need to unref the pixmaps after adding them to a list store.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20795
diff
changeset
|
6123 EMBLEM_VISIBLE_COLUMN, (emblem != NULL), |
20872
71d0989b7c25
Prevent leakage of the prpl icon pixbuf because of an extra ref (it's bad enough that they aren't shared).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20841
diff
changeset
|
6124 PROTOCOL_ICON_COLUMN, prpl_icon, |
19474
74befdcd0454
Fixes #2146. Adds a Show Protocol Icon option and groups related Show menu items into a submenu. Patch from Justin Heiner
Sean Egan <seanegan@gmail.com>
parents:
19363
diff
changeset
|
6125 PROTOCOL_ICON_VISIBLE_COLUMN, purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/blist/show_protocol_icons"), |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6126 BGCOLOR_COLUMN, NULL, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6127 CONTACT_EXPANDER_COLUMN, NULL, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6128 CONTACT_EXPANDER_VISIBLE_COLUMN, expanded, |
16121
6167ee79ecd0
Set the disable maximize button hint on the blist. I couldn't find a window manager that supports this, but I bet win32 does.
Sean Egan <seanegan@gmail.com>
parents:
16102
diff
changeset
|
6129 GROUP_EXPANDER_VISIBLE_COLUMN, FALSE, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6130 -1); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6131 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6132 g_free(mark); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6133 g_free(idle); |
20834
6b9e5bbab0fe
We need to unref the pixmaps after adding them to a list store.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20795
diff
changeset
|
6134 if(emblem) |
6b9e5bbab0fe
We need to unref the pixmaps after adding them to a list store.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20795
diff
changeset
|
6135 g_object_unref(emblem); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6136 if(status) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6137 g_object_unref(status); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6138 if(avatar) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6139 g_object_unref(avatar); |
20872
71d0989b7c25
Prevent leakage of the prpl icon pixbuf because of an extra ref (it's bad enough that they aren't shared).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20841
diff
changeset
|
6140 if(prpl_icon) |
71d0989b7c25
Prevent leakage of the prpl icon pixbuf because of an extra ref (it's bad enough that they aren't shared).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20841
diff
changeset
|
6141 g_object_unref(prpl_icon); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6142 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6143 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6144 /* This is a variation on the original gtk_blist_update_contact. Here we |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6145 can know in advance which buddy has changed so we can just update that */ |
15823 | 6146 static void pidgin_blist_update_contact(PurpleBuddyList *list, PurpleBlistNode *node) |
6147 { | |
6148 PurpleBlistNode *cnode; | |
6149 PurpleContact *contact; | |
6150 PurpleBuddy *buddy; | |
21660
c29f2e3a3b99
Had this laying around. Weeks (months?) ago all the small listers and Hylke agreed that Small list looks better with conversation tab sized icons
Sean Egan <seanegan@gmail.com>
parents:
21659
diff
changeset
|
6151 gboolean biglist = purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/blist/show_buddy_icons"); |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
6152 struct _pidgin_blist_node *gtknode; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6153 |
17851
452bd3baa9af
Do not update the blist TreeStore if a node is currently being edited. Then, when the node is finished editing, force a refresh. Fixes #397 in which aliasing gets rudely cut off anytime the buddy list changes
Sean Egan <seanegan@gmail.com>
parents:
17835
diff
changeset
|
6154 if (editing_blist) |
452bd3baa9af
Do not update the blist TreeStore if a node is currently being edited. Then, when the node is finished editing, force a refresh. Fixes #397 in which aliasing gets rudely cut off anytime the buddy list changes
Sean Egan <seanegan@gmail.com>
parents:
17835
diff
changeset
|
6155 return; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6156 |
15823 | 6157 if (PURPLE_BLIST_NODE_IS_BUDDY(node)) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6158 cnode = node->parent; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6159 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6160 cnode = node; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6161 |
15823 | 6162 g_return_if_fail(PURPLE_BLIST_NODE_IS_CONTACT(cnode)); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6163 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6164 /* First things first, update the group */ |
15823 | 6165 if (PURPLE_BLIST_NODE_IS_BUDDY(node)) |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
6166 pidgin_blist_update_group(list, node); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6167 else |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
6168 pidgin_blist_update_group(list, cnode->parent); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6169 |
15823 | 6170 contact = (PurpleContact*)cnode; |
6171 buddy = purple_contact_get_priority_buddy(contact); | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6172 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6173 if (buddy_is_displayable(buddy)) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6174 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6175 GtkTreeIter iter; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6176 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6177 if(!insert_node(list, cnode, &iter)) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6178 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6179 |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
6180 gtknode = (struct _pidgin_blist_node *)cnode->ui_data; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6181 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6182 if(gtknode->contact_expanded) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6183 GdkPixbuf *status; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6184 char *mark; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6185 |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
6186 status = pidgin_blist_get_status_icon(cnode, |
21660
c29f2e3a3b99
Had this laying around. Weeks (months?) ago all the small listers and Hylke agreed that Small list looks better with conversation tab sized icons
Sean Egan <seanegan@gmail.com>
parents:
21659
diff
changeset
|
6187 biglist? PIDGIN_STATUS_ICON_LARGE : PIDGIN_STATUS_ICON_SMALL); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6188 |
15823 | 6189 mark = g_markup_escape_text(purple_contact_get_alias(contact), -1); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6190 gtk_tree_store_set(gtkblist->treemodel, &iter, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6191 STATUS_ICON_COLUMN, status, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6192 STATUS_ICON_VISIBLE_COLUMN, TRUE, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6193 NAME_COLUMN, mark, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6194 IDLE_COLUMN, NULL, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6195 IDLE_VISIBLE_COLUMN, FALSE, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6196 BGCOLOR_COLUMN, NULL, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6197 BUDDY_ICON_COLUMN, NULL, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6198 CONTACT_EXPANDER_COLUMN, TRUE, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6199 CONTACT_EXPANDER_VISIBLE_COLUMN, TRUE, |
23969
5045f2ce9cff
disapproval of revision 'f5ca7968e3f6be8f81d068232d389e0b1dab784b'
Kevin Stange <kevin@simguy.net>
parents:
23967
diff
changeset
|
6200 GROUP_EXPANDER_VISIBLE_COLUMN, FALSE, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6201 -1); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6202 g_free(mark); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6203 if(status) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6204 g_object_unref(status); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6205 } else { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6206 buddy_node(buddy, &iter, cnode); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6207 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6208 } else { |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
6209 pidgin_blist_hide_node(list, cnode, TRUE); |
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
6210 } |
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
6211 } |
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
6212 |
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
6213 |
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
6214 |
19538
6575ec8e1a97
Do not try to update a buddy in the buddylist when there's no buddylist.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19509
diff
changeset
|
6215 static void pidgin_blist_update_buddy(PurpleBuddyList *list, PurpleBlistNode *node, gboolean status_change) |
15823 | 6216 { |
6217 PurpleBuddy *buddy; | |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
6218 struct _pidgin_blist_node *gtkparentnode; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6219 |
15823 | 6220 g_return_if_fail(PURPLE_BLIST_NODE_IS_BUDDY(node)); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6221 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6222 if (node->parent == NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6223 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6224 |
15823 | 6225 buddy = (PurpleBuddy*)node; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6226 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6227 /* First things first, update the contact */ |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
6228 pidgin_blist_update_contact(list, node); |
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
6229 |
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
6230 gtkparentnode = (struct _pidgin_blist_node *)node->parent->ui_data; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6231 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6232 if (gtkparentnode->contact_expanded && buddy_is_displayable(buddy)) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6233 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6234 GtkTreeIter iter; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6235 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6236 if (!insert_node(list, node, &iter)) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6237 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6238 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6239 buddy_node(buddy, &iter, node); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6240 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6241 } else { |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
6242 pidgin_blist_hide_node(list, node, TRUE); |
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
6243 } |
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
6244 |
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
6245 } |
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
6246 |
15823 | 6247 static void pidgin_blist_update_chat(PurpleBuddyList *list, PurpleBlistNode *node) |
6248 { | |
6249 PurpleChat *chat; | |
6250 | |
6251 g_return_if_fail(PURPLE_BLIST_NODE_IS_CHAT(node)); | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6252 |
17851
452bd3baa9af
Do not update the blist TreeStore if a node is currently being edited. Then, when the node is finished editing, force a refresh. Fixes #397 in which aliasing gets rudely cut off anytime the buddy list changes
Sean Egan <seanegan@gmail.com>
parents:
17835
diff
changeset
|
6253 if (editing_blist) |
452bd3baa9af
Do not update the blist TreeStore if a node is currently being edited. Then, when the node is finished editing, force a refresh. Fixes #397 in which aliasing gets rudely cut off anytime the buddy list changes
Sean Egan <seanegan@gmail.com>
parents:
17835
diff
changeset
|
6254 return; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6255 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6256 /* First things first, update the group */ |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
6257 pidgin_blist_update_group(list, node->parent); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6258 |
15823 | 6259 chat = (PurpleChat*)node; |
6260 | |
6261 if(purple_account_is_connected(chat->account)) { | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6262 GtkTreeIter iter; |
20872
71d0989b7c25
Prevent leakage of the prpl icon pixbuf because of an extra ref (it's bad enough that they aren't shared).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20841
diff
changeset
|
6263 GdkPixbuf *status, *avatar, *emblem, *prpl_icon; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6264 char *mark; |
16905
aa87ecd650d2
Speed up blist manipulations, by Scott Wolchok (EvilSporkMan)
Ethan Blanton <elb@pidgin.im>
parents:
16858
diff
changeset
|
6265 gboolean showicons = purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/blist/show_buddy_icons"); |
21660
c29f2e3a3b99
Had this laying around. Weeks (months?) ago all the small listers and Hylke agreed that Small list looks better with conversation tab sized icons
Sean Egan <seanegan@gmail.com>
parents:
21659
diff
changeset
|
6266 gboolean biglist = purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/blist/show_buddy_icons"); |
19894
0ac0e112a0fa
Add some stuff so that we don't have to traverse over a list to determine
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19611
diff
changeset
|
6267 PidginBlistNode *ui; |
0ac0e112a0fa
Add some stuff so that we don't have to traverse over a list to determine
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19611
diff
changeset
|
6268 PurpleConversation *conv; |
0ac0e112a0fa
Add some stuff so that we don't have to traverse over a list to determine
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19611
diff
changeset
|
6269 gboolean hidden; |
0ac0e112a0fa
Add some stuff so that we don't have to traverse over a list to determine
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19611
diff
changeset
|
6270 |
0ac0e112a0fa
Add some stuff so that we don't have to traverse over a list to determine
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19611
diff
changeset
|
6271 if (!insert_node(list, node, &iter)) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6272 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6273 |
19894
0ac0e112a0fa
Add some stuff so that we don't have to traverse over a list to determine
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19611
diff
changeset
|
6274 ui = node->ui_data; |
0ac0e112a0fa
Add some stuff so that we don't have to traverse over a list to determine
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19611
diff
changeset
|
6275 conv = ui->conv.conv; |
21772
21371ea85970
Fix boldifying the chat entries in the buddylist.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21771
diff
changeset
|
6276 hidden = (conv && (ui->conv.flags & PIDGIN_BLIST_NODE_HAS_PENDING_MESSAGE) && |
21371ea85970
Fix boldifying the chat entries in the buddylist.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21771
diff
changeset
|
6277 pidgin_conv_is_hidden(PIDGIN_CONVERSATION(conv))); |
19894
0ac0e112a0fa
Add some stuff so that we don't have to traverse over a list to determine
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19611
diff
changeset
|
6278 |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
6279 status = pidgin_blist_get_status_icon(node, |
21660
c29f2e3a3b99
Had this laying around. Weeks (months?) ago all the small listers and Hylke agreed that Small list looks better with conversation tab sized icons
Sean Egan <seanegan@gmail.com>
parents:
21659
diff
changeset
|
6280 biglist ? PIDGIN_STATUS_ICON_LARGE : PIDGIN_STATUS_ICON_SMALL); |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
6281 emblem = pidgin_blist_get_emblem(node); |
16905
aa87ecd650d2
Speed up blist manipulations, by Scott Wolchok (EvilSporkMan)
Ethan Blanton <elb@pidgin.im>
parents:
16858
diff
changeset
|
6282 |
aa87ecd650d2
Speed up blist manipulations, by Scott Wolchok (EvilSporkMan)
Ethan Blanton <elb@pidgin.im>
parents:
16858
diff
changeset
|
6283 /* Speed it up if we don't want buddy icons. */ |
aa87ecd650d2
Speed up blist manipulations, by Scott Wolchok (EvilSporkMan)
Ethan Blanton <elb@pidgin.im>
parents:
16858
diff
changeset
|
6284 if(showicons) |
aa87ecd650d2
Speed up blist manipulations, by Scott Wolchok (EvilSporkMan)
Ethan Blanton <elb@pidgin.im>
parents:
16858
diff
changeset
|
6285 avatar = pidgin_blist_get_buddy_icon(node, TRUE, FALSE); |
aa87ecd650d2
Speed up blist manipulations, by Scott Wolchok (EvilSporkMan)
Ethan Blanton <elb@pidgin.im>
parents:
16858
diff
changeset
|
6286 else |
aa87ecd650d2
Speed up blist manipulations, by Scott Wolchok (EvilSporkMan)
Ethan Blanton <elb@pidgin.im>
parents:
16858
diff
changeset
|
6287 avatar = NULL; |
15423
051a5c4f0917
this would use the protocol icons in place of the buddy icon for chats,
Nathan Walp <nwalp@pidgin.im>
parents:
15418
diff
changeset
|
6288 |
15823 | 6289 mark = g_markup_escape_text(purple_chat_get_name(chat), -1); |
19558
f902cd0dc925
Boldify the hidden chats in the buddylist.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19540
diff
changeset
|
6290 if (hidden) { |
f902cd0dc925
Boldify the hidden chats in the buddylist.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19540
diff
changeset
|
6291 char *bold = g_strdup_printf("<b>%s</b>", mark); |
f902cd0dc925
Boldify the hidden chats in the buddylist.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19540
diff
changeset
|
6292 g_free(mark); |
f902cd0dc925
Boldify the hidden chats in the buddylist.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19540
diff
changeset
|
6293 mark = bold; |
f902cd0dc925
Boldify the hidden chats in the buddylist.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19540
diff
changeset
|
6294 } |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6295 |
20872
71d0989b7c25
Prevent leakage of the prpl icon pixbuf because of an extra ref (it's bad enough that they aren't shared).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20841
diff
changeset
|
6296 prpl_icon = pidgin_create_prpl_icon(chat->account, PIDGIN_PRPL_ICON_SMALL); |
71d0989b7c25
Prevent leakage of the prpl icon pixbuf because of an extra ref (it's bad enough that they aren't shared).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20841
diff
changeset
|
6297 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6298 gtk_tree_store_set(gtkblist->treemodel, &iter, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6299 STATUS_ICON_COLUMN, status, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6300 STATUS_ICON_VISIBLE_COLUMN, TRUE, |
15423
051a5c4f0917
this would use the protocol icons in place of the buddy icon for chats,
Nathan Walp <nwalp@pidgin.im>
parents:
15418
diff
changeset
|
6301 BUDDY_ICON_COLUMN, avatar ? avatar : gtkblist->empty_avatar, |
23158
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23131
diff
changeset
|
6302 BUDDY_ICON_VISIBLE_COLUMN, showicons, |
19558
f902cd0dc925
Boldify the hidden chats in the buddylist.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19540
diff
changeset
|
6303 EMBLEM_COLUMN, emblem, |
15463 | 6304 EMBLEM_VISIBLE_COLUMN, emblem != NULL, |
20872
71d0989b7c25
Prevent leakage of the prpl icon pixbuf because of an extra ref (it's bad enough that they aren't shared).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20841
diff
changeset
|
6305 PROTOCOL_ICON_COLUMN, prpl_icon, |
19474
74befdcd0454
Fixes #2146. Adds a Show Protocol Icon option and groups related Show menu items into a submenu. Patch from Justin Heiner
Sean Egan <seanegan@gmail.com>
parents:
19363
diff
changeset
|
6306 PROTOCOL_ICON_VISIBLE_COLUMN, purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/blist/show_protocol_icons"), |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6307 NAME_COLUMN, mark, |
16121
6167ee79ecd0
Set the disable maximize button hint on the blist. I couldn't find a window manager that supports this, but I bet win32 does.
Sean Egan <seanegan@gmail.com>
parents:
16102
diff
changeset
|
6308 GROUP_EXPANDER_VISIBLE_COLUMN, FALSE, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6309 -1); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6310 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6311 g_free(mark); |
20834
6b9e5bbab0fe
We need to unref the pixmaps after adding them to a list store.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20795
diff
changeset
|
6312 if(emblem) |
6b9e5bbab0fe
We need to unref the pixmaps after adding them to a list store.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20795
diff
changeset
|
6313 g_object_unref(emblem); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6314 if(status) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6315 g_object_unref(status); |
15423
051a5c4f0917
this would use the protocol icons in place of the buddy icon for chats,
Nathan Walp <nwalp@pidgin.im>
parents:
15418
diff
changeset
|
6316 if(avatar) |
051a5c4f0917
this would use the protocol icons in place of the buddy icon for chats,
Nathan Walp <nwalp@pidgin.im>
parents:
15418
diff
changeset
|
6317 g_object_unref(avatar); |
20872
71d0989b7c25
Prevent leakage of the prpl icon pixbuf because of an extra ref (it's bad enough that they aren't shared).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20841
diff
changeset
|
6318 if(prpl_icon) |
71d0989b7c25
Prevent leakage of the prpl icon pixbuf because of an extra ref (it's bad enough that they aren't shared).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20841
diff
changeset
|
6319 g_object_unref(prpl_icon); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6320 } else { |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
6321 pidgin_blist_hide_node(list, node, TRUE); |
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
6322 } |
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
6323 } |
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
6324 |
15823 | 6325 static void pidgin_blist_update(PurpleBuddyList *list, PurpleBlistNode *node) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6326 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6327 if (list) |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
6328 gtkblist = PIDGIN_BLIST(list); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6329 if(!gtkblist || !gtkblist->treeview || !node) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6330 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6331 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6332 if (node->ui_data == NULL) |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
6333 pidgin_blist_new_node(node); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6334 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6335 switch(node->type) { |
15823 | 6336 case PURPLE_BLIST_GROUP_NODE: |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
6337 pidgin_blist_update_group(list, node); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6338 break; |
15823 | 6339 case PURPLE_BLIST_CONTACT_NODE: |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
6340 pidgin_blist_update_contact(list, node); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6341 break; |
15823 | 6342 case PURPLE_BLIST_BUDDY_NODE: |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
6343 pidgin_blist_update_buddy(list, node, TRUE); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6344 break; |
15823 | 6345 case PURPLE_BLIST_CHAT_NODE: |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
6346 pidgin_blist_update_chat(list, node); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6347 break; |
15823 | 6348 case PURPLE_BLIST_OTHER_NODE: |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6349 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6350 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6351 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6352 #if !GTK_CHECK_VERSION(2,6,0) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6353 gtk_tree_view_columns_autosize(GTK_TREE_VIEW(gtkblist->treeview)); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6354 #endif |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6355 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6356 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6357 |
15823 | 6358 static void pidgin_blist_destroy(PurpleBuddyList *list) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6359 { |
21386
86b0dc1f60ae
Group all NAME_IN_USE errors together into one neat mini-dialog on the buddy
Will Thompson <will.thompson@collabora.co.uk>
parents:
21384
diff
changeset
|
6360 PidginBuddyListPrivate *priv; |
86b0dc1f60ae
Group all NAME_IN_USE errors together into one neat mini-dialog on the buddy
Will Thompson <will.thompson@collabora.co.uk>
parents:
21384
diff
changeset
|
6361 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6362 if (!gtkblist) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6363 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6364 |
15823 | 6365 purple_signals_disconnect_by_handle(gtkblist); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6366 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6367 if (gtkblist->headline_close) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6368 gdk_pixbuf_unref(gtkblist->headline_close); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6369 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6370 gtk_widget_destroy(gtkblist->window); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6371 |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
6372 pidgin_blist_tooltip_destroy(); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6373 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6374 if (gtkblist->refresh_timer) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6375 g_source_remove(gtkblist->refresh_timer); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6376 if (gtkblist->timeout) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6377 g_source_remove(gtkblist->timeout); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6378 if (gtkblist->drag_timeout) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6379 g_source_remove(gtkblist->drag_timeout); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6380 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6381 g_hash_table_destroy(gtkblist->connection_errors); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6382 gtkblist->refresh_timer = 0; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6383 gtkblist->timeout = 0; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6384 gtkblist->drag_timeout = 0; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6385 gtkblist->window = gtkblist->vbox = gtkblist->treeview = NULL; |
22087
d943df776c09
It turns out the tree-models need to be unref'ed.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22086
diff
changeset
|
6386 g_object_unref(G_OBJECT(gtkblist->treemodel)); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6387 gtkblist->treemodel = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6388 g_object_unref(G_OBJECT(gtkblist->ift)); |
15397
a8ee645e7fb4
A lot of status icon changes:
Sean Egan <seanegan@gmail.com>
parents:
15374
diff
changeset
|
6389 g_object_unref(G_OBJECT(gtkblist->empty_avatar)); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6390 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6391 gdk_cursor_unref(gtkblist->hand_cursor); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6392 gdk_cursor_unref(gtkblist->arrow_cursor); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6393 gtkblist->hand_cursor = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6394 gtkblist->arrow_cursor = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6395 |
21386
86b0dc1f60ae
Group all NAME_IN_USE errors together into one neat mini-dialog on the buddy
Will Thompson <will.thompson@collabora.co.uk>
parents:
21384
diff
changeset
|
6396 priv = PIDGIN_BUDDY_LIST_GET_PRIVATE(gtkblist); |
86b0dc1f60ae
Group all NAME_IN_USE errors together into one neat mini-dialog on the buddy
Will Thompson <will.thompson@collabora.co.uk>
parents:
21384
diff
changeset
|
6397 g_free(priv); |
86b0dc1f60ae
Group all NAME_IN_USE errors together into one neat mini-dialog on the buddy
Will Thompson <will.thompson@collabora.co.uk>
parents:
21384
diff
changeset
|
6398 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6399 g_free(gtkblist); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6400 accountmenu = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6401 gtkblist = NULL; |
15823 | 6402 purple_prefs_disconnect_by_handle(pidgin_blist_get_handle()); |
6403 } | |
6404 | |
6405 static void pidgin_blist_set_visible(PurpleBuddyList *list, gboolean show) | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6406 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6407 if (!(gtkblist && gtkblist->window)) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6408 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6409 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6410 if (show) { |
15510 | 6411 if(!PIDGIN_WINDOW_ICONIFIED(gtkblist->window) && !GTK_WIDGET_VISIBLE(gtkblist->window)) |
15823 | 6412 purple_signal_emit(pidgin_blist_get_handle(), "gtkblist-unhiding", gtkblist); |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
6413 pidgin_blist_restore_position(); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6414 gtk_window_present(GTK_WINDOW(gtkblist->window)); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6415 } else { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6416 if(visibility_manager_count) { |
15823 | 6417 purple_signal_emit(pidgin_blist_get_handle(), "gtkblist-hiding", gtkblist); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6418 gtk_widget_hide(gtkblist->window); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6419 } else { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6420 if (!GTK_WIDGET_VISIBLE(gtkblist->window)) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6421 gtk_widget_show(gtkblist->window); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6422 gtk_window_iconify(GTK_WINDOW(gtkblist->window)); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6423 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6424 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6425 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6426 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6427 static GList * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6428 groups_tree(void) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6429 { |
20028
a2b4eac83902
Part of #1332 to introduce pidgin_text_combo_box_new_entry and
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19680
diff
changeset
|
6430 static GList *list = NULL; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6431 char *tmp2; |
15823 | 6432 PurpleGroup *g; |
6433 PurpleBlistNode *gnode; | |
6434 | |
20028
a2b4eac83902
Part of #1332 to introduce pidgin_text_combo_box_new_entry and
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19680
diff
changeset
|
6435 g_list_free(list); |
a2b4eac83902
Part of #1332 to introduce pidgin_text_combo_box_new_entry and
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19680
diff
changeset
|
6436 list = NULL; |
a2b4eac83902
Part of #1332 to introduce pidgin_text_combo_box_new_entry and
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19680
diff
changeset
|
6437 |
15823 | 6438 if (purple_get_blist()->root == NULL) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6439 { |
20028
a2b4eac83902
Part of #1332 to introduce pidgin_text_combo_box_new_entry and
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19680
diff
changeset
|
6440 list = g_list_append(list, (gpointer)_("Buddies")); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6441 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6442 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6443 { |
15823 | 6444 for (gnode = purple_get_blist()->root; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6445 gnode != NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6446 gnode = gnode->next) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6447 { |
15823 | 6448 if (PURPLE_BLIST_NODE_IS_GROUP(gnode)) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6449 { |
15823 | 6450 g = (PurpleGroup *)gnode; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6451 tmp2 = g->name; |
20028
a2b4eac83902
Part of #1332 to introduce pidgin_text_combo_box_new_entry and
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19680
diff
changeset
|
6452 list = g_list_append(list, tmp2); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6453 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6454 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6455 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6456 |
20028
a2b4eac83902
Part of #1332 to introduce pidgin_text_combo_box_new_entry and
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19680
diff
changeset
|
6457 return list; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6458 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6459 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6460 static void |
15823 | 6461 add_buddy_select_account_cb(GObject *w, PurpleAccount *account, |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
6462 PidginAddBuddyData *data) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6463 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6464 /* Save our account */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6465 data->account = account; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6466 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6467 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6468 static void |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
6469 destroy_add_buddy_dialog_cb(GtkWidget *win, PidginAddBuddyData *data) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6470 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6471 g_free(data); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6472 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6473 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6474 static void |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
6475 add_buddy_cb(GtkWidget *w, int resp, PidginAddBuddyData *data) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6476 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6477 const char *grp, *who, *whoalias; |
15823 | 6478 PurpleGroup *g; |
6479 PurpleBuddy *b; | |
6480 PurpleConversation *c; | |
6481 PurpleBuddyIcon *icon; | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6482 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6483 if (resp == GTK_RESPONSE_OK) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6484 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6485 who = gtk_entry_get_text(GTK_ENTRY(data->entry)); |
20028
a2b4eac83902
Part of #1332 to introduce pidgin_text_combo_box_new_entry and
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19680
diff
changeset
|
6486 grp = pidgin_text_combo_box_entry_get_text(data->combo); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6487 whoalias = gtk_entry_get_text(GTK_ENTRY(data->entry_for_alias)); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6488 if (*whoalias == '\0') |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6489 whoalias = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6490 |
20161
0077c1f21f3d
Patch from db42. Fixes #3191
Sean Egan <seanegan@gmail.com>
parents:
20158
diff
changeset
|
6491 g = NULL; |
0077c1f21f3d
Patch from db42. Fixes #3191
Sean Egan <seanegan@gmail.com>
parents:
20158
diff
changeset
|
6492 if ((grp != NULL) && (*grp != '\0') && ((g = purple_find_group(grp)) == NULL)) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6493 { |
15823 | 6494 g = purple_group_new(grp); |
6495 purple_blist_add_group(g, NULL); | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6496 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6497 |
15823 | 6498 b = purple_buddy_new(data->account, who, whoalias); |
6499 purple_blist_add_buddy(b, NULL, g, NULL); | |
6500 purple_account_add_buddy(data->account, b); | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6501 |
23326
aec041e8f3e0
Make the Add Buddy dialog cause the auto-personize prompt where appropriate.
Kevin Stange <kevin@simguy.net>
parents:
23312
diff
changeset
|
6502 /* Offer to merge people with the same alias. */ |
23925
fd0e8c6ffa4b
Path from Toby Schaffer to fix a null ptr deref when adding a buddy. Fixes #6821.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
23395
diff
changeset
|
6503 if (whoalias != NULL && g != NULL) |
23347 | 6504 gtk_blist_auto_personize((PurpleBlistNode *)g, whoalias); |
23326
aec041e8f3e0
Make the Add Buddy dialog cause the auto-personize prompt where appropriate.
Kevin Stange <kevin@simguy.net>
parents:
23312
diff
changeset
|
6505 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6506 /* |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6507 * XXX |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6508 * It really seems like it would be better if the call to |
15823 | 6509 * purple_account_add_buddy() and purple_conversation_update() were done in |
6510 * blist.c, possibly in the purple_blist_add_buddy() function. Maybe | |
6511 * purple_account_add_buddy() should be renamed to | |
6512 * purple_blist_add_new_buddy() or something, and have it call | |
6513 * purple_blist_add_buddy() after it creates it. --Mark | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6514 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6515 * No that's not good. blist.c should only deal with adding nodes to the |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6516 * local list. We need a new, non-gtk file that calls both |
15823 | 6517 * purple_account_add_buddy and purple_blist_add_buddy(). |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6518 * Or something. --Mark |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6519 */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6520 |
15823 | 6521 c = purple_find_conversation_with_account(PURPLE_CONV_TYPE_IM, who, data->account); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6522 if (c != NULL) { |
15823 | 6523 icon = purple_conv_im_get_icon(PURPLE_CONV_IM(c)); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6524 if (icon != NULL) |
15823 | 6525 purple_buddy_icon_update(icon); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6526 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6527 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6528 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6529 gtk_widget_destroy(data->window); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6530 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6531 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6532 static void |
15823 | 6533 pidgin_blist_request_add_buddy(PurpleAccount *account, const char *username, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6534 const char *group, const char *alias) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6535 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6536 GtkWidget *table; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6537 GtkWidget *label; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6538 GtkWidget *hbox; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6539 GtkWidget *vbox; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6540 GtkWidget *img; |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
6541 PidginBuddyList *gtkblist; |
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
6542 PidginAddBuddyData *data = g_new0(PidginAddBuddyData, 1); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6543 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6544 data->account = |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6545 (account != NULL |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6546 ? account |
15823 | 6547 : purple_connection_get_account(purple_connections_get_all()->data)); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6548 |
15436 | 6549 img = gtk_image_new_from_stock(PIDGIN_STOCK_DIALOG_QUESTION, |
6550 gtk_icon_size_from_name(PIDGIN_ICON_SIZE_TANGO_HUGE)); | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6551 |
15823 | 6552 gtkblist = PIDGIN_BLIST(purple_get_blist()); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6553 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6554 data->window = gtk_dialog_new_with_buttons(_("Add Buddy"), |
21235
fba1f6c3df0b
Converted string literal UI hints to #define-ed constants and fixed two cast-warnings in gtkblist.c
Gabriel Schulhof <nix@go-nix.ca>
parents:
21232
diff
changeset
|
6555 gtkblist ? GTK_WINDOW(gtkblist->window) : NULL, GTK_DIALOG_NO_SEPARATOR, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6556 GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6557 GTK_STOCK_ADD, GTK_RESPONSE_OK, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6558 NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6559 |
21090
8e9d40defbc0
Need to explicitly call gtk_window_set_transient_for, even on a GtkDialog
Gabriel Schulhof <nix@go-nix.ca>
parents:
21089
diff
changeset
|
6560 if (gtkblist) |
8e9d40defbc0
Need to explicitly call gtk_window_set_transient_for, even on a GtkDialog
Gabriel Schulhof <nix@go-nix.ca>
parents:
21089
diff
changeset
|
6561 gtk_window_set_transient_for(GTK_WINDOW(data->window), GTK_WINDOW(gtkblist->window)); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6562 gtk_dialog_set_default_response(GTK_DIALOG(data->window), GTK_RESPONSE_OK); |
15821 | 6563 gtk_container_set_border_width(GTK_CONTAINER(data->window), PIDGIN_HIG_BOX_SPACE); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6564 gtk_window_set_resizable(GTK_WINDOW(data->window), FALSE); |
15821 | 6565 gtk_box_set_spacing(GTK_BOX(GTK_DIALOG(data->window)->vbox), PIDGIN_HIG_BORDER); |
6566 gtk_container_set_border_width(GTK_CONTAINER(GTK_DIALOG(data->window)->vbox), PIDGIN_HIG_BOX_SPACE); | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6567 gtk_window_set_role(GTK_WINDOW(data->window), "add_buddy"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6568 gtk_window_set_type_hint(GTK_WINDOW(data->window), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6569 GDK_WINDOW_TYPE_HINT_DIALOG); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6570 |
15821 | 6571 hbox = gtk_hbox_new(FALSE, PIDGIN_HIG_BORDER); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6572 gtk_container_add(GTK_CONTAINER(GTK_DIALOG(data->window)->vbox), hbox); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6573 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
|
6574 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
|
6575 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6576 vbox = gtk_vbox_new(FALSE, 0); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6577 gtk_container_add(GTK_CONTAINER(hbox), vbox); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6578 |
22507
2f7b42cc612c
Change up the Add Budy dialog a little bit, this hopefully makes it a bit
Etan Reisner <pidgin@unreliablesource.net>
parents:
22313
diff
changeset
|
6579 g_signal_connect(G_OBJECT(data->window), "destroy", |
2f7b42cc612c
Change up the Add Budy dialog a little bit, this hopefully makes it a bit
Etan Reisner <pidgin@unreliablesource.net>
parents:
22313
diff
changeset
|
6580 G_CALLBACK(destroy_add_buddy_dialog_cb), data); |
2f7b42cc612c
Change up the Add Budy dialog a little bit, this hopefully makes it a bit
Etan Reisner <pidgin@unreliablesource.net>
parents:
22313
diff
changeset
|
6581 |
2f7b42cc612c
Change up the Add Budy dialog a little bit, this hopefully makes it a bit
Etan Reisner <pidgin@unreliablesource.net>
parents:
22313
diff
changeset
|
6582 label = gtk_label_new(_("Add a buddy.\n")); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6583 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
|
6584 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
|
6585 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6586 table = gtk_table_new(4, 2, FALSE); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6587 gtk_table_set_row_spacings(GTK_TABLE(table), 5); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6588 gtk_table_set_col_spacings(GTK_TABLE(table), 5); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6589 gtk_container_set_border_width(GTK_CONTAINER(table), 0); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6590 gtk_box_pack_start(GTK_BOX(vbox), table, FALSE, FALSE, 0); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6591 |
17688
486daeb90aa9
Add mnemonics to labels in Add Buddy and Add Chat dialogs, and put Account
Stu Tomlinson <stu@nosnilmot.com>
parents:
17674
diff
changeset
|
6592 data->account_box = pidgin_account_option_menu_new(account, FALSE, |
486daeb90aa9
Add mnemonics to labels in Add Buddy and Add Chat dialogs, and put Account
Stu Tomlinson <stu@nosnilmot.com>
parents:
17674
diff
changeset
|
6593 G_CALLBACK(add_buddy_select_account_cb), NULL, data); |
486daeb90aa9
Add mnemonics to labels in Add Buddy and Add Chat dialogs, and put Account
Stu Tomlinson <stu@nosnilmot.com>
parents:
17674
diff
changeset
|
6594 |
22507
2f7b42cc612c
Change up the Add Budy dialog a little bit, this hopefully makes it a bit
Etan Reisner <pidgin@unreliablesource.net>
parents:
22313
diff
changeset
|
6595 gtk_table_attach_defaults(GTK_TABLE(table), data->account_box, 0, 2, 0, 1); |
2f7b42cc612c
Change up the Add Budy dialog a little bit, this hopefully makes it a bit
Etan Reisner <pidgin@unreliablesource.net>
parents:
22313
diff
changeset
|
6596 |
22770
cc8903c59d6b
Change the string "screen name" to "username" everywhere. I think most
Mark Doliner <mark@kingant.net>
parents:
22762
diff
changeset
|
6597 label = gtk_label_new_with_mnemonic(_("Buddy's _username:")); |
17688
486daeb90aa9
Add mnemonics to labels in Add Buddy and Add Chat dialogs, and put Account
Stu Tomlinson <stu@nosnilmot.com>
parents:
17674
diff
changeset
|
6598 gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); |
486daeb90aa9
Add mnemonics to labels in Add Buddy and Add Chat dialogs, and put Account
Stu Tomlinson <stu@nosnilmot.com>
parents:
17674
diff
changeset
|
6599 gtk_table_attach_defaults(GTK_TABLE(table), label, 0, 1, 1, 2); |
486daeb90aa9
Add mnemonics to labels in Add Buddy and Add Chat dialogs, and put Account
Stu Tomlinson <stu@nosnilmot.com>
parents:
17674
diff
changeset
|
6600 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6601 data->entry = gtk_entry_new(); |
17688
486daeb90aa9
Add mnemonics to labels in Add Buddy and Add Chat dialogs, and put Account
Stu Tomlinson <stu@nosnilmot.com>
parents:
17674
diff
changeset
|
6602 gtk_table_attach_defaults(GTK_TABLE(table), data->entry, 1, 2, 1, 2); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6603 gtk_widget_grab_focus(data->entry); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6604 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6605 if (username != NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6606 gtk_entry_set_text(GTK_ENTRY(data->entry), username); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6607 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6608 gtk_dialog_set_response_sensitive(GTK_DIALOG(data->window), |
22507
2f7b42cc612c
Change up the Add Budy dialog a little bit, this hopefully makes it a bit
Etan Reisner <pidgin@unreliablesource.net>
parents:
22313
diff
changeset
|
6609 GTK_RESPONSE_OK, FALSE); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6610 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6611 gtk_entry_set_activates_default (GTK_ENTRY(data->entry), TRUE); |
17688
486daeb90aa9
Add mnemonics to labels in Add Buddy and Add Chat dialogs, and put Account
Stu Tomlinson <stu@nosnilmot.com>
parents:
17674
diff
changeset
|
6612 gtk_label_set_mnemonic_widget(GTK_LABEL(label), data->entry); |
15507 | 6613 pidgin_set_accessible_label (data->entry, label); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6614 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6615 g_signal_connect(G_OBJECT(data->entry), "changed", |
22507
2f7b42cc612c
Change up the Add Budy dialog a little bit, this hopefully makes it a bit
Etan Reisner <pidgin@unreliablesource.net>
parents:
22313
diff
changeset
|
6616 G_CALLBACK(pidgin_set_sensitive_if_input), |
2f7b42cc612c
Change up the Add Budy dialog a little bit, this hopefully makes it a bit
Etan Reisner <pidgin@unreliablesource.net>
parents:
22313
diff
changeset
|
6617 data->window); |
2f7b42cc612c
Change up the Add Budy dialog a little bit, this hopefully makes it a bit
Etan Reisner <pidgin@unreliablesource.net>
parents:
22313
diff
changeset
|
6618 |
2f7b42cc612c
Change up the Add Budy dialog a little bit, this hopefully makes it a bit
Etan Reisner <pidgin@unreliablesource.net>
parents:
22313
diff
changeset
|
6619 label = gtk_label_new_with_mnemonic(_("(Optional) A_lias:")); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6620 gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); |
17688
486daeb90aa9
Add mnemonics to labels in Add Buddy and Add Chat dialogs, and put Account
Stu Tomlinson <stu@nosnilmot.com>
parents:
17674
diff
changeset
|
6621 gtk_table_attach_defaults(GTK_TABLE(table), label, 0, 1, 2, 3); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6622 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6623 data->entry_for_alias = gtk_entry_new(); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6624 gtk_table_attach_defaults(GTK_TABLE(table), |
22507
2f7b42cc612c
Change up the Add Budy dialog a little bit, this hopefully makes it a bit
Etan Reisner <pidgin@unreliablesource.net>
parents:
22313
diff
changeset
|
6625 data->entry_for_alias, 1, 2, 2, 3); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6626 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6627 if (alias != NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6628 gtk_entry_set_text(GTK_ENTRY(data->entry_for_alias), alias); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6629 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6630 if (username != NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6631 gtk_widget_grab_focus(GTK_WIDGET(data->entry_for_alias)); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6632 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6633 gtk_entry_set_activates_default (GTK_ENTRY(data->entry_for_alias), TRUE); |
17688
486daeb90aa9
Add mnemonics to labels in Add Buddy and Add Chat dialogs, and put Account
Stu Tomlinson <stu@nosnilmot.com>
parents:
17674
diff
changeset
|
6634 gtk_label_set_mnemonic_widget(GTK_LABEL(label), data->entry_for_alias); |
15507 | 6635 pidgin_set_accessible_label (data->entry_for_alias, label); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6636 |
22507
2f7b42cc612c
Change up the Add Budy dialog a little bit, this hopefully makes it a bit
Etan Reisner <pidgin@unreliablesource.net>
parents:
22313
diff
changeset
|
6637 label = gtk_label_new_with_mnemonic(_("Add buddy to _group:")); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6638 gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); |
17688
486daeb90aa9
Add mnemonics to labels in Add Buddy and Add Chat dialogs, and put Account
Stu Tomlinson <stu@nosnilmot.com>
parents:
17674
diff
changeset
|
6639 gtk_table_attach_defaults(GTK_TABLE(table), label, 0, 1, 3, 4); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6640 |
20028
a2b4eac83902
Part of #1332 to introduce pidgin_text_combo_box_new_entry and
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19680
diff
changeset
|
6641 data->combo = pidgin_text_combo_box_entry_new(group, groups_tree()); |
17688
486daeb90aa9
Add mnemonics to labels in Add Buddy and Add Chat dialogs, and put Account
Stu Tomlinson <stu@nosnilmot.com>
parents:
17674
diff
changeset
|
6642 gtk_table_attach_defaults(GTK_TABLE(table), data->combo, 1, 2, 3, 4); |
20028
a2b4eac83902
Part of #1332 to introduce pidgin_text_combo_box_new_entry and
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19680
diff
changeset
|
6643 gtk_label_set_mnemonic_widget(GTK_LABEL(label), GTK_BIN(data->combo)->child); |
15507 | 6644 pidgin_set_accessible_label (data->combo, label); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6645 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6646 g_signal_connect(G_OBJECT(data->window), "response", |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6647 G_CALLBACK(add_buddy_cb), data); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6648 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6649 gtk_widget_show_all(data->window); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6650 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6651 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6652 static void |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
6653 add_chat_cb(GtkWidget *w, PidginAddChatData *data) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6654 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6655 GHashTable *components; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6656 GList *tmp; |
15823 | 6657 PurpleChat *chat; |
6658 PurpleGroup *group; | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6659 const char *group_name; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6660 const char *value; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6661 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6662 components = g_hash_table_new_full(g_str_hash, g_str_equal, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6663 g_free, g_free); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6664 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6665 for (tmp = data->entries; tmp; tmp = tmp->next) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6666 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6667 if (g_object_get_data(tmp->data, "is_spin")) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6668 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6669 g_hash_table_replace(components, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6670 g_strdup(g_object_get_data(tmp->data, "identifier")), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6671 g_strdup_printf("%d", |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6672 gtk_spin_button_get_value_as_int(tmp->data))); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6673 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6674 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6675 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6676 value = gtk_entry_get_text(tmp->data); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6677 if (*value != '\0') |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6678 g_hash_table_replace(components, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6679 g_strdup(g_object_get_data(tmp->data, "identifier")), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6680 g_strdup(value)); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6681 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6682 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6683 |
15823 | 6684 chat = purple_chat_new(data->account, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6685 gtk_entry_get_text(GTK_ENTRY(data->alias_entry)), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6686 components); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6687 |
20028
a2b4eac83902
Part of #1332 to introduce pidgin_text_combo_box_new_entry and
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19680
diff
changeset
|
6688 group_name = pidgin_text_combo_box_entry_get_text(data->group_combo); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6689 |
20161
0077c1f21f3d
Patch from db42. Fixes #3191
Sean Egan <seanegan@gmail.com>
parents:
20158
diff
changeset
|
6690 group = NULL; |
0077c1f21f3d
Patch from db42. Fixes #3191
Sean Egan <seanegan@gmail.com>
parents:
20158
diff
changeset
|
6691 if ((group_name != NULL) && (*group_name != '\0') && ((group = purple_find_group(group_name)) == NULL)) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6692 { |
15823 | 6693 group = purple_group_new(group_name); |
6694 purple_blist_add_group(group, NULL); | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6695 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6696 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6697 if (chat != NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6698 { |
15823 | 6699 purple_blist_add_chat(chat, group, NULL); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6700 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6701 |
20084
de39f3855e8f
Add checkboxes for 'auto-join' and 'persistent' in the add-chat dialog. Closes #2248.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
20083
diff
changeset
|
6702 if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(data->autojoin))) |
de39f3855e8f
Add checkboxes for 'auto-join' and 'persistent' in the add-chat dialog. Closes #2248.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
20083
diff
changeset
|
6703 purple_blist_node_set_bool((PurpleBlistNode*)chat, "gtk-autojoin", TRUE); |
de39f3855e8f
Add checkboxes for 'auto-join' and 'persistent' in the add-chat dialog. Closes #2248.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
20083
diff
changeset
|
6704 |
de39f3855e8f
Add checkboxes for 'auto-join' and 'persistent' in the add-chat dialog. Closes #2248.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
20083
diff
changeset
|
6705 if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(data->persistent))) |
de39f3855e8f
Add checkboxes for 'auto-join' and 'persistent' in the add-chat dialog. Closes #2248.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
20083
diff
changeset
|
6706 purple_blist_node_set_bool((PurpleBlistNode*)chat, "gtk-persistent", TRUE); |
de39f3855e8f
Add checkboxes for 'auto-join' and 'persistent' in the add-chat dialog. Closes #2248.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
20083
diff
changeset
|
6707 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6708 gtk_widget_destroy(data->window); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6709 g_free(data->default_chat_name); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6710 g_list_free(data->entries); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6711 g_free(data); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6712 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6713 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6714 static void |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
6715 add_chat_resp_cb(GtkWidget *w, int resp, PidginAddChatData *data) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6716 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6717 if (resp == GTK_RESPONSE_OK) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6718 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6719 add_chat_cb(NULL, data); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6720 } |
21675
ebe79cae6d83
Add 'Room List' buttons to Join Chat and Add Chat dialogs to ease access
Stu Tomlinson <stu@nosnilmot.com>
parents:
21662
diff
changeset
|
6721 else if (resp == 1) |
ebe79cae6d83
Add 'Room List' buttons to Join Chat and Add Chat dialogs to ease access
Stu Tomlinson <stu@nosnilmot.com>
parents:
21662
diff
changeset
|
6722 { |
ebe79cae6d83
Add 'Room List' buttons to Join Chat and Add Chat dialogs to ease access
Stu Tomlinson <stu@nosnilmot.com>
parents:
21662
diff
changeset
|
6723 pidgin_roomlist_dialog_show_with_account(data->account); |
ebe79cae6d83
Add 'Room List' buttons to Join Chat and Add Chat dialogs to ease access
Stu Tomlinson <stu@nosnilmot.com>
parents:
21662
diff
changeset
|
6724 } |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6725 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6726 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6727 gtk_widget_destroy(data->window); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6728 g_free(data->default_chat_name); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6729 g_list_free(data->entries); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6730 g_free(data); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6731 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6732 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6733 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6734 /* |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6735 * Check the values of all the text entry boxes. If any required input |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6736 * strings are empty then don't allow the user to click on "OK." |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6737 */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6738 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6739 addchat_set_sensitive_if_input_cb(GtkWidget *entry, gpointer user_data) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6740 { |
21675
ebe79cae6d83
Add 'Room List' buttons to Join Chat and Add Chat dialogs to ease access
Stu Tomlinson <stu@nosnilmot.com>
parents:
21662
diff
changeset
|
6741 PurplePluginProtocolInfo *prpl_info; |
ebe79cae6d83
Add 'Room List' buttons to Join Chat and Add Chat dialogs to ease access
Stu Tomlinson <stu@nosnilmot.com>
parents:
21662
diff
changeset
|
6742 PurpleConnection *gc; |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
6743 PidginAddChatData *data; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6744 GList *tmp; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6745 const char *text; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6746 gboolean required; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6747 gboolean sensitive = TRUE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6748 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6749 data = user_data; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6750 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6751 for (tmp = data->entries; tmp != NULL; tmp = tmp->next) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6752 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6753 if (!g_object_get_data(tmp->data, "is_spin")) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6754 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6755 required = GPOINTER_TO_INT(g_object_get_data(tmp->data, "required")); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6756 text = gtk_entry_get_text(tmp->data); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6757 if (required && (*text == '\0')) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6758 sensitive = FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6759 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6760 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6761 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6762 gtk_dialog_set_response_sensitive(GTK_DIALOG(data->window), GTK_RESPONSE_OK, sensitive); |
21675
ebe79cae6d83
Add 'Room List' buttons to Join Chat and Add Chat dialogs to ease access
Stu Tomlinson <stu@nosnilmot.com>
parents:
21662
diff
changeset
|
6763 |
ebe79cae6d83
Add 'Room List' buttons to Join Chat and Add Chat dialogs to ease access
Stu Tomlinson <stu@nosnilmot.com>
parents:
21662
diff
changeset
|
6764 gc = purple_account_get_connection(data->account); |
ebe79cae6d83
Add 'Room List' buttons to Join Chat and Add Chat dialogs to ease access
Stu Tomlinson <stu@nosnilmot.com>
parents:
21662
diff
changeset
|
6765 prpl_info = (gc != NULL) ? PURPLE_PLUGIN_PROTOCOL_INFO(gc->prpl) : NULL; |
ebe79cae6d83
Add 'Room List' buttons to Join Chat and Add Chat dialogs to ease access
Stu Tomlinson <stu@nosnilmot.com>
parents:
21662
diff
changeset
|
6766 sensitive = (prpl_info != NULL && prpl_info->roomlist_get_list != NULL); |
ebe79cae6d83
Add 'Room List' buttons to Join Chat and Add Chat dialogs to ease access
Stu Tomlinson <stu@nosnilmot.com>
parents:
21662
diff
changeset
|
6767 |
ebe79cae6d83
Add 'Room List' buttons to Join Chat and Add Chat dialogs to ease access
Stu Tomlinson <stu@nosnilmot.com>
parents:
21662
diff
changeset
|
6768 gtk_dialog_set_response_sensitive(GTK_DIALOG(data->window), 1, sensitive); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6769 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6770 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6771 static void |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
6772 rebuild_addchat_entries(PidginAddChatData *data) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6773 { |
15823 | 6774 PurpleConnection *gc; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6775 GList *list = NULL, *tmp; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6776 GHashTable *defaults = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6777 struct proto_chat_entry *pce; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6778 gboolean focus = TRUE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6779 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6780 g_return_if_fail(data->account != NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6781 |
15823 | 6782 gc = purple_account_get_connection(data->account); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6783 |
18646
05cab350d1fb
Fix memory leak by freeing the list returned by gtk_container_get_children.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
18435
diff
changeset
|
6784 gtk_container_foreach(GTK_CONTAINER(data->entries_box), (GtkCallback)gtk_widget_destroy, NULL); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6785 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6786 g_list_free(data->entries); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6787 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6788 data->entries = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6789 |
15823 | 6790 if (PURPLE_PLUGIN_PROTOCOL_INFO(gc->prpl)->chat_info != NULL) |
6791 list = PURPLE_PLUGIN_PROTOCOL_INFO(gc->prpl)->chat_info(gc); | |
6792 | |
6793 if (PURPLE_PLUGIN_PROTOCOL_INFO(gc->prpl)->chat_info_defaults != NULL) | |
6794 defaults = PURPLE_PLUGIN_PROTOCOL_INFO(gc->prpl)->chat_info_defaults(gc, data->default_chat_name); | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6795 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6796 for (tmp = list; tmp; tmp = tmp->next) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6797 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6798 GtkWidget *input; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6799 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6800 pce = tmp->data; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6801 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6802 if (pce->is_int) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6803 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6804 GtkObject *adjust; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6805 adjust = gtk_adjustment_new(pce->min, pce->min, pce->max, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6806 1, 10, 10); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6807 input = gtk_spin_button_new(GTK_ADJUSTMENT(adjust), 1, 0); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6808 gtk_widget_set_size_request(input, 50, -1); |
21992
1690d040addd
Remove a lot of duplication from a lot of places. Closes #4558.
Gabriel Schulhof <nix@go-nix.ca>
parents:
21990
diff
changeset
|
6809 pidgin_add_widget_to_vbox(GTK_BOX(data->entries_box), pce->label, data->sg, input, FALSE, NULL); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6810 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6811 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6812 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6813 char *value; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6814 input = gtk_entry_new(); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6815 gtk_entry_set_activates_default(GTK_ENTRY(input), TRUE); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6816 value = g_hash_table_lookup(defaults, pce->identifier); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6817 if (value != NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6818 gtk_entry_set_text(GTK_ENTRY(input), value); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6819 if (pce->secret) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6820 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6821 gtk_entry_set_visibility(GTK_ENTRY(input), FALSE); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6822 if (gtk_entry_get_invisible_char(GTK_ENTRY(input)) == '*') |
15821 | 6823 gtk_entry_set_invisible_char(GTK_ENTRY(input), PIDGIN_INVISIBLE_CHAR); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6824 } |
21992
1690d040addd
Remove a lot of duplication from a lot of places. Closes #4558.
Gabriel Schulhof <nix@go-nix.ca>
parents:
21990
diff
changeset
|
6825 pidgin_add_widget_to_vbox(GTK_BOX(data->entries_box), pce->label, data->sg, input, TRUE, NULL); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6826 g_signal_connect(G_OBJECT(input), "changed", |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6827 G_CALLBACK(addchat_set_sensitive_if_input_cb), data); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6828 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6829 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6830 /* Do the following for any type of input widget */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6831 if (focus) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6832 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6833 gtk_widget_grab_focus(input); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6834 focus = FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6835 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6836 g_object_set_data(G_OBJECT(input), "identifier", (gpointer)pce->identifier); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6837 g_object_set_data(G_OBJECT(input), "is_spin", GINT_TO_POINTER(pce->is_int)); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6838 g_object_set_data(G_OBJECT(input), "required", GINT_TO_POINTER(pce->required)); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6839 data->entries = g_list_append(data->entries, input); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6840 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6841 g_free(pce); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6842 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6843 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6844 g_list_free(list); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6845 g_hash_table_destroy(defaults); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6846 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6847 /* Set whether the "OK" button should be clickable initially */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6848 addchat_set_sensitive_if_input_cb(NULL, data); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6849 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6850 gtk_widget_show_all(data->entries_box); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6851 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6852 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6853 static void |
15823 | 6854 addchat_select_account_cb(GObject *w, PurpleAccount *account, |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
6855 PidginAddChatData *data) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6856 { |
15823 | 6857 if (strcmp(purple_account_get_protocol_id(data->account), |
6858 purple_account_get_protocol_id(account)) == 0) | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6859 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6860 data->account = account; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6861 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6862 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6863 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6864 data->account = account; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6865 rebuild_addchat_entries(data); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6866 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6867 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6868 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6869 static void |
15823 | 6870 pidgin_blist_request_add_chat(PurpleAccount *account, PurpleGroup *group, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6871 const char *alias, const char *name) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6872 { |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
6873 PidginAddChatData *data; |
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
6874 PidginBuddyList *gtkblist; |
18063
926ccb104da0
disapproval of revision '1411afd7660760db59966c3a9f18e2adab8eb27e'
Richard Laager <rlaager@wiktel.com>
parents:
18058
diff
changeset
|
6875 GList *l; |
15823 | 6876 PurpleConnection *gc; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6877 GtkWidget *label; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6878 GtkWidget *hbox; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6879 GtkWidget *vbox; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6880 GtkWidget *img; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6881 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6882 if (account != NULL) { |
15823 | 6883 gc = purple_account_get_connection(account); |
6884 | |
6885 if (PURPLE_PLUGIN_PROTOCOL_INFO(gc->prpl)->join_chat == NULL) { | |
6886 purple_notify_error(gc, NULL, _("This protocol does not support chat rooms."), NULL); | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6887 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6888 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6889 } else { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6890 /* Find an account with chat capabilities */ |
15823 | 6891 for (l = purple_connections_get_all(); l != NULL; l = l->next) { |
6892 gc = (PurpleConnection *)l->data; | |
6893 | |
6894 if (PURPLE_PLUGIN_PROTOCOL_INFO(gc->prpl)->join_chat != NULL) { | |
6895 account = purple_connection_get_account(gc); | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6896 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6897 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6898 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6899 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6900 if (account == NULL) { |
15823 | 6901 purple_notify_error(NULL, NULL, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6902 _("You are not currently signed on with any " |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6903 "protocols that have the ability to chat."), NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6904 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6905 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6906 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6907 |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
6908 data = g_new0(PidginAddChatData, 1); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6909 data->account = account; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6910 data->default_chat_name = g_strdup(name); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6911 |
15436 | 6912 img = gtk_image_new_from_stock(PIDGIN_STOCK_DIALOG_QUESTION, |
6913 gtk_icon_size_from_name(PIDGIN_ICON_SIZE_TANGO_HUGE)); | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6914 |
15823 | 6915 gtkblist = PIDGIN_BLIST(purple_get_blist()); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6916 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6917 data->sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6918 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6919 data->window = gtk_dialog_new_with_buttons(_("Add Chat"), |
21235
fba1f6c3df0b
Converted string literal UI hints to #define-ed constants and fixed two cast-warnings in gtkblist.c
Gabriel Schulhof <nix@go-nix.ca>
parents:
21232
diff
changeset
|
6920 gtkblist ? GTK_WINDOW(gtkblist->window) : NULL, GTK_DIALOG_NO_SEPARATOR, |
21675
ebe79cae6d83
Add 'Room List' buttons to Join Chat and Add Chat dialogs to ease access
Stu Tomlinson <stu@nosnilmot.com>
parents:
21662
diff
changeset
|
6921 _("Room _List"), 1, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6922 GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6923 GTK_STOCK_ADD, GTK_RESPONSE_OK, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6924 NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6925 |
21090
8e9d40defbc0
Need to explicitly call gtk_window_set_transient_for, even on a GtkDialog
Gabriel Schulhof <nix@go-nix.ca>
parents:
21089
diff
changeset
|
6926 if (gtkblist) |
8e9d40defbc0
Need to explicitly call gtk_window_set_transient_for, even on a GtkDialog
Gabriel Schulhof <nix@go-nix.ca>
parents:
21089
diff
changeset
|
6927 gtk_window_set_transient_for(GTK_WINDOW(data->window), GTK_WINDOW(gtkblist->window)); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6928 gtk_dialog_set_default_response(GTK_DIALOG(data->window), GTK_RESPONSE_OK); |
15821 | 6929 gtk_container_set_border_width(GTK_CONTAINER(data->window), PIDGIN_HIG_BOX_SPACE); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6930 gtk_window_set_resizable(GTK_WINDOW(data->window), FALSE); |
15821 | 6931 gtk_box_set_spacing(GTK_BOX(GTK_DIALOG(data->window)->vbox), PIDGIN_HIG_BORDER); |
6932 gtk_container_set_border_width(GTK_CONTAINER(GTK_DIALOG(data->window)->vbox), PIDGIN_HIG_BOX_SPACE); | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6933 gtk_window_set_role(GTK_WINDOW(data->window), "add_chat"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6934 gtk_window_set_type_hint(GTK_WINDOW(data->window), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6935 GDK_WINDOW_TYPE_HINT_DIALOG); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6936 |
15821 | 6937 hbox = gtk_hbox_new(FALSE, PIDGIN_HIG_BORDER); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6938 gtk_container_add(GTK_CONTAINER(GTK_DIALOG(data->window)->vbox), hbox); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6939 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
|
6940 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
|
6941 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6942 vbox = gtk_vbox_new(FALSE, 5); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6943 gtk_container_add(GTK_CONTAINER(hbox), vbox); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6944 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6945 label = gtk_label_new( |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6946 _("Please enter an alias, and the appropriate information " |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6947 "about the chat you would like to add to your buddy list.\n")); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6948 gtk_widget_set_size_request(label, 400, -1); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6949 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
|
6950 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
|
6951 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
|
6952 |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
6953 data->account_menu = pidgin_account_option_menu_new(account, FALSE, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6954 G_CALLBACK(addchat_select_account_cb), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6955 chat_account_filter_func, data); |
21992
1690d040addd
Remove a lot of duplication from a lot of places. Closes #4558.
Gabriel Schulhof <nix@go-nix.ca>
parents:
21990
diff
changeset
|
6956 pidgin_add_widget_to_vbox(GTK_BOX(vbox), _("_Account:"), data->sg, data->account_menu, TRUE, NULL); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6957 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6958 data->entries_box = gtk_vbox_new(FALSE, 5); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6959 gtk_container_set_border_width(GTK_CONTAINER(data->entries_box), 0); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6960 gtk_box_pack_start(GTK_BOX(vbox), data->entries_box, TRUE, TRUE, 0); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6961 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6962 rebuild_addchat_entries(data); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6963 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6964 data->alias_entry = gtk_entry_new(); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6965 if (alias != NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6966 gtk_entry_set_text(GTK_ENTRY(data->alias_entry), alias); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6967 gtk_entry_set_activates_default(GTK_ENTRY(data->alias_entry), TRUE); |
21992
1690d040addd
Remove a lot of duplication from a lot of places. Closes #4558.
Gabriel Schulhof <nix@go-nix.ca>
parents:
21990
diff
changeset
|
6968 |
1690d040addd
Remove a lot of duplication from a lot of places. Closes #4558.
Gabriel Schulhof <nix@go-nix.ca>
parents:
21990
diff
changeset
|
6969 pidgin_add_widget_to_vbox(GTK_BOX(vbox), _("A_lias:"), data->sg, data->alias_entry, TRUE, NULL); |
17418
202f4df12cf4
Closes #348 'Conversation -> Add (for Chats) should move focus to the alias field.'
Sean Egan <seanegan@gmail.com>
parents:
17139
diff
changeset
|
6970 if (name != NULL) |
202f4df12cf4
Closes #348 'Conversation -> Add (for Chats) should move focus to the alias field.'
Sean Egan <seanegan@gmail.com>
parents:
17139
diff
changeset
|
6971 gtk_widget_grab_focus(data->alias_entry); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6972 |
20028
a2b4eac83902
Part of #1332 to introduce pidgin_text_combo_box_new_entry and
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19680
diff
changeset
|
6973 data->group_combo = pidgin_text_combo_box_entry_new(group ? group->name : NULL, groups_tree()); |
21992
1690d040addd
Remove a lot of duplication from a lot of places. Closes #4558.
Gabriel Schulhof <nix@go-nix.ca>
parents:
21990
diff
changeset
|
6974 pidgin_add_widget_to_vbox(GTK_BOX(vbox), _("_Group:"), data->sg, data->group_combo, TRUE, NULL); |
20084
de39f3855e8f
Add checkboxes for 'auto-join' and 'persistent' in the add-chat dialog. Closes #2248.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
20083
diff
changeset
|
6975 |
21675
ebe79cae6d83
Add 'Room List' buttons to Join Chat and Add Chat dialogs to ease access
Stu Tomlinson <stu@nosnilmot.com>
parents:
21662
diff
changeset
|
6976 data->autojoin = gtk_check_button_new_with_mnemonic(_("Auto_join when account becomes online.")); |
24302
d9a50381a20c
A little clearer description for an option.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24282
diff
changeset
|
6977 data->persistent = gtk_check_button_new_with_mnemonic(_("_Remain in chat after window is closed.")); |
20084
de39f3855e8f
Add checkboxes for 'auto-join' and 'persistent' in the add-chat dialog. Closes #2248.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
20083
diff
changeset
|
6978 gtk_box_pack_start(GTK_BOX(vbox), data->autojoin, FALSE, FALSE, 0); |
de39f3855e8f
Add checkboxes for 'auto-join' and 'persistent' in the add-chat dialog. Closes #2248.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
20083
diff
changeset
|
6979 gtk_box_pack_start(GTK_BOX(vbox), data->persistent, FALSE, FALSE, 0); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6980 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6981 g_signal_connect(G_OBJECT(data->window), "response", |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6982 G_CALLBACK(add_chat_resp_cb), data); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6983 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6984 gtk_widget_show_all(data->window); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6985 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6986 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6987 static void |
15823 | 6988 add_group_cb(PurpleConnection *gc, const char *group_name) |
6989 { | |
6990 PurpleGroup *group; | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6991 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6992 if ((group_name == NULL) || (*group_name == '\0')) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6993 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6994 |
15823 | 6995 group = purple_group_new(group_name); |
6996 purple_blist_add_group(group, NULL); | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6997 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6998 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6999 static void |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
7000 pidgin_blist_request_add_group(void) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7001 { |
21099
51cf02dbdb0e
disapproval of revision 'c484d979c4fda4433a9633ff8b69bd8a395c9479'
Richard Laager <rlaager@wiktel.com>
parents:
21095
diff
changeset
|
7002 purple_request_input(NULL, _("Add Group"), NULL, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7003 _("Please enter the name of the group to be added."), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7004 NULL, FALSE, FALSE, NULL, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7005 _("Add"), G_CALLBACK(add_group_cb), |
16442
08db93bbd798
Added account, who, and conversation parameters to the request API calls, and updated all code to match. I can't compile the Perl module, so I'd appreciate it if someone who knows it would verify that this doesn't break Perl.
Evan Schoenberg <evan.s@dreskin.net>
parents:
16275
diff
changeset
|
7006 _("Cancel"), NULL, |
08db93bbd798
Added account, who, and conversation parameters to the request API calls, and updated all code to match. I can't compile the Perl module, so I'd appreciate it if someone who knows it would verify that this doesn't break Perl.
Evan Schoenberg <evan.s@dreskin.net>
parents:
16275
diff
changeset
|
7007 NULL, NULL, NULL, |
21099
51cf02dbdb0e
disapproval of revision 'c484d979c4fda4433a9633ff8b69bd8a395c9479'
Richard Laager <rlaager@wiktel.com>
parents:
21095
diff
changeset
|
7008 NULL); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7009 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7010 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7011 void |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
7012 pidgin_blist_toggle_visibility() |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7013 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7014 if (gtkblist && gtkblist->window) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7015 if (GTK_WIDGET_VISIBLE(gtkblist->window)) { |
22898
5d833ca5a265
Make pidgin_blist_toggle_visibility() hide the buddy list when it is
Casey Harkins <charkins@pidgin.im>
parents:
22789
diff
changeset
|
7016 /* make the buddy list visible if it is iconified or if it is |
5d833ca5a265
Make pidgin_blist_toggle_visibility() hide the buddy list when it is
Casey Harkins <charkins@pidgin.im>
parents:
22789
diff
changeset
|
7017 * obscured and not currently focused (the focus part ensures |
5d833ca5a265
Make pidgin_blist_toggle_visibility() hide the buddy list when it is
Casey Harkins <charkins@pidgin.im>
parents:
22789
diff
changeset
|
7018 * that we do something reasonable if the buddy list is obscured |
5d833ca5a265
Make pidgin_blist_toggle_visibility() hide the buddy list when it is
Casey Harkins <charkins@pidgin.im>
parents:
22789
diff
changeset
|
7019 * by a window set to always be on top), otherwise hide the |
5d833ca5a265
Make pidgin_blist_toggle_visibility() hide the buddy list when it is
Casey Harkins <charkins@pidgin.im>
parents:
22789
diff
changeset
|
7020 * buddy list |
5d833ca5a265
Make pidgin_blist_toggle_visibility() hide the buddy list when it is
Casey Harkins <charkins@pidgin.im>
parents:
22789
diff
changeset
|
7021 */ |
21041
094bbbe89d0d
Track the actual visibility for the buddy list (unobscured, partially and
Casey Harkins <charkins@pidgin.im>
parents:
21040
diff
changeset
|
7022 purple_blist_set_visible(PIDGIN_WINDOW_ICONIFIED(gtkblist->window) || |
22898
5d833ca5a265
Make pidgin_blist_toggle_visibility() hide the buddy list when it is
Casey Harkins <charkins@pidgin.im>
parents:
22789
diff
changeset
|
7023 ((gtk_blist_visibility != GDK_VISIBILITY_UNOBSCURED) && |
5d833ca5a265
Make pidgin_blist_toggle_visibility() hide the buddy list when it is
Casey Harkins <charkins@pidgin.im>
parents:
22789
diff
changeset
|
7024 !gtk_blist_focused)); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7025 } else { |
15823 | 7026 purple_blist_set_visible(TRUE); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7027 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7028 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7029 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7030 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7031 void |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
7032 pidgin_blist_visibility_manager_add() |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7033 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7034 visibility_manager_count++; |
15823 | 7035 purple_debug_info("gtkblist", "added visibility manager: %d\n", visibility_manager_count); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7036 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7037 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7038 void |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
7039 pidgin_blist_visibility_manager_remove() |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7040 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7041 if (visibility_manager_count) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7042 visibility_manager_count--; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7043 if (!visibility_manager_count) |
15823 | 7044 purple_blist_set_visible(TRUE); |
7045 purple_debug_info("gtkblist", "removed visibility manager: %d\n", visibility_manager_count); | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7046 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7047 |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
7048 void pidgin_blist_add_alert(GtkWidget *widget) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7049 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7050 gtk_container_add(GTK_CONTAINER(gtkblist->scrollbook), widget); |
22299
858ce8a1fc8c
Pull setting the urgent hint on the blist when it is unfocused into its own
Will Thompson <will.thompson@collabora.co.uk>
parents:
22298
diff
changeset
|
7051 set_urgent(); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7052 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7053 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7054 void |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
7055 pidgin_blist_set_headline(const char *text, GdkPixbuf *pixbuf, GCallback callback, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7056 gpointer user_data, GDestroyNotify destroy) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7057 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7058 /* Destroy any existing headline first */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7059 if (gtkblist->headline_destroy) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7060 gtkblist->headline_destroy(gtkblist->headline_data); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7061 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7062 gtk_label_set_markup(GTK_LABEL(gtkblist->headline_label), text); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7063 gtk_image_set_from_pixbuf(GTK_IMAGE(gtkblist->headline_image), pixbuf); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7064 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7065 gtkblist->headline_callback = callback; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7066 gtkblist->headline_data = user_data; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7067 gtkblist->headline_destroy = destroy; |
20586
04590d9db8b7
Clear out the mail notifications for an account when we receive a notification of 0 emails.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20546
diff
changeset
|
7068 if (text != NULL || pixbuf != NULL) { |
22299
858ce8a1fc8c
Pull setting the urgent hint on the blist when it is unfocused into its own
Will Thompson <will.thompson@collabora.co.uk>
parents:
22298
diff
changeset
|
7069 set_urgent(); |
20586
04590d9db8b7
Clear out the mail notifications for an account when we receive a notification of 0 emails.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20546
diff
changeset
|
7070 gtk_widget_show_all(gtkblist->headline_hbox); |
04590d9db8b7
Clear out the mail notifications for an account when we receive a notification of 0 emails.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20546
diff
changeset
|
7071 } else { |
04590d9db8b7
Clear out the mail notifications for an account when we receive a notification of 0 emails.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20546
diff
changeset
|
7072 gtk_widget_hide(gtkblist->headline_hbox); |
04590d9db8b7
Clear out the mail notifications for an account when we receive a notification of 0 emails.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20546
diff
changeset
|
7073 } |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7074 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7075 |
22299
858ce8a1fc8c
Pull setting the urgent hint on the blist when it is unfocused into its own
Will Thompson <will.thompson@collabora.co.uk>
parents:
22298
diff
changeset
|
7076 |
858ce8a1fc8c
Pull setting the urgent hint on the blist when it is unfocused into its own
Will Thompson <will.thompson@collabora.co.uk>
parents:
22298
diff
changeset
|
7077 static void |
858ce8a1fc8c
Pull setting the urgent hint on the blist when it is unfocused into its own
Will Thompson <will.thompson@collabora.co.uk>
parents:
22298
diff
changeset
|
7078 set_urgent(void) |
858ce8a1fc8c
Pull setting the urgent hint on the blist when it is unfocused into its own
Will Thompson <will.thompson@collabora.co.uk>
parents:
22298
diff
changeset
|
7079 { |
858ce8a1fc8c
Pull setting the urgent hint on the blist when it is unfocused into its own
Will Thompson <will.thompson@collabora.co.uk>
parents:
22298
diff
changeset
|
7080 if (!GTK_WIDGET_HAS_FOCUS(gtkblist->window)) |
858ce8a1fc8c
Pull setting the urgent hint on the blist when it is unfocused into its own
Will Thompson <will.thompson@collabora.co.uk>
parents:
22298
diff
changeset
|
7081 pidgin_set_urgent(GTK_WINDOW(gtkblist->window), TRUE); |
858ce8a1fc8c
Pull setting the urgent hint on the blist when it is unfocused into its own
Will Thompson <will.thompson@collabora.co.uk>
parents:
22298
diff
changeset
|
7082 } |
858ce8a1fc8c
Pull setting the urgent hint on the blist when it is unfocused into its own
Will Thompson <will.thompson@collabora.co.uk>
parents:
22298
diff
changeset
|
7083 |
15823 | 7084 static PurpleBlistUiOps blist_ui_ops = |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7085 { |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
7086 pidgin_blist_new_list, |
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
7087 pidgin_blist_new_node, |
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
7088 pidgin_blist_show, |
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
7089 pidgin_blist_update, |
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
7090 pidgin_blist_remove, |
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
7091 pidgin_blist_destroy, |
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
7092 pidgin_blist_set_visible, |
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
7093 pidgin_blist_request_add_buddy, |
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
7094 pidgin_blist_request_add_chat, |
16681
fbf111436896
Patch from John 'rekkanoryo' Bailey to add the padding struct members in pidgin
Gary Kramlich <grim@reaperworld.com>
parents:
16564
diff
changeset
|
7095 pidgin_blist_request_add_group, |
fbf111436896
Patch from John 'rekkanoryo' Bailey to add the padding struct members in pidgin
Gary Kramlich <grim@reaperworld.com>
parents:
16564
diff
changeset
|
7096 NULL, |
fbf111436896
Patch from John 'rekkanoryo' Bailey to add the padding struct members in pidgin
Gary Kramlich <grim@reaperworld.com>
parents:
16564
diff
changeset
|
7097 NULL, |
fbf111436896
Patch from John 'rekkanoryo' Bailey to add the padding struct members in pidgin
Gary Kramlich <grim@reaperworld.com>
parents:
16564
diff
changeset
|
7098 NULL, |
fbf111436896
Patch from John 'rekkanoryo' Bailey to add the padding struct members in pidgin
Gary Kramlich <grim@reaperworld.com>
parents:
16564
diff
changeset
|
7099 NULL |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7100 }; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7101 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7102 |
15823 | 7103 PurpleBlistUiOps * |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
7104 pidgin_blist_get_ui_ops(void) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7105 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7106 return &blist_ui_ops; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7107 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7108 |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
7109 PidginBuddyList *pidgin_blist_get_default_gtk_blist() |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7110 { |
15448 | 7111 return gtkblist; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7112 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7113 |
15823 | 7114 static void account_signon_cb(PurpleConnection *gc, gpointer z) |
7115 { | |
7116 PurpleAccount *account = purple_connection_get_account(gc); | |
7117 PurpleBlistNode *gnode, *cnode; | |
7118 for(gnode = purple_get_blist()->root; gnode; gnode = gnode->next) | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7119 { |
15823 | 7120 if(!PURPLE_BLIST_NODE_IS_GROUP(gnode)) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7121 continue; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7122 for(cnode = gnode->child; cnode; cnode = cnode->next) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7123 { |
15823 | 7124 PurpleChat *chat; |
7125 | |
7126 if(!PURPLE_BLIST_NODE_IS_CHAT(cnode)) | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7127 continue; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7128 |
15823 | 7129 chat = (PurpleChat *)cnode; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7130 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7131 if(chat->account != account) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7132 continue; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7133 |
15823 | 7134 if(purple_blist_node_get_bool((PurpleBlistNode*)chat, "gtk-autojoin") || |
7135 (purple_blist_node_get_string((PurpleBlistNode*)chat, | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7136 "gtk-autojoin") != NULL)) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7137 serv_join_chat(gc, chat->components); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7138 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7139 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7140 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7141 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7142 void * |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
7143 pidgin_blist_get_handle() { |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7144 static int handle; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7145 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7146 return &handle; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7147 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7148 |
15823 | 7149 static gboolean buddy_signonoff_timeout_cb(PurpleBuddy *buddy) |
7150 { | |
7151 struct _pidgin_blist_node *gtknode = ((PurpleBlistNode*)buddy)->ui_data; | |
23969
5045f2ce9cff
disapproval of revision 'f5ca7968e3f6be8f81d068232d389e0b1dab784b'
Kevin Stange <kevin@simguy.net>
parents:
23967
diff
changeset
|
7152 |
5045f2ce9cff
disapproval of revision 'f5ca7968e3f6be8f81d068232d389e0b1dab784b'
Kevin Stange <kevin@simguy.net>
parents:
23967
diff
changeset
|
7153 gtknode->recent_signonoff = FALSE; |
5045f2ce9cff
disapproval of revision 'f5ca7968e3f6be8f81d068232d389e0b1dab784b'
Kevin Stange <kevin@simguy.net>
parents:
23967
diff
changeset
|
7154 gtknode->recent_signonoff_timer = 0; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7155 |
15823 | 7156 pidgin_blist_update(NULL, (PurpleBlistNode*)buddy); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7157 |
23969
5045f2ce9cff
disapproval of revision 'f5ca7968e3f6be8f81d068232d389e0b1dab784b'
Kevin Stange <kevin@simguy.net>
parents:
23967
diff
changeset
|
7158 return FALSE; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7159 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7160 |
15823 | 7161 static void buddy_signonoff_cb(PurpleBuddy *buddy) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7162 { |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
7163 struct _pidgin_blist_node *gtknode; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7164 |
15823 | 7165 if(!((PurpleBlistNode*)buddy)->ui_data) { |
7166 pidgin_blist_new_node((PurpleBlistNode*)buddy); | |
7167 } | |
7168 | |
7169 gtknode = ((PurpleBlistNode*)buddy)->ui_data; | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7170 |
23969
5045f2ce9cff
disapproval of revision 'f5ca7968e3f6be8f81d068232d389e0b1dab784b'
Kevin Stange <kevin@simguy.net>
parents:
23967
diff
changeset
|
7171 gtknode->recent_signonoff = TRUE; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7172 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7173 if(gtknode->recent_signonoff_timer > 0) |
15823 | 7174 purple_timeout_remove(gtknode->recent_signonoff_timer); |
23969
5045f2ce9cff
disapproval of revision 'f5ca7968e3f6be8f81d068232d389e0b1dab784b'
Kevin Stange <kevin@simguy.net>
parents:
23967
diff
changeset
|
7175 gtknode->recent_signonoff_timer = purple_timeout_add(10000, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7176 (GSourceFunc)buddy_signonoff_timeout_cb, buddy); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7177 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7178 |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
7179 void pidgin_blist_init(void) |
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
7180 { |
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
7181 void *gtk_blist_handle = pidgin_blist_get_handle(); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7182 |
21756
abd0cd2b712a
Add rudimentary caching for buddy list emblems. This avoids all the icons being duplicated in memory and constantly loaded. A more complete solution would be preferable, but I think this is better than nothing.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21752
diff
changeset
|
7183 cached_emblems = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, NULL); |
abd0cd2b712a
Add rudimentary caching for buddy list emblems. This avoids all the icons being duplicated in memory and constantly loaded. A more complete solution would be preferable, but I think this is better than nothing.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21752
diff
changeset
|
7184 |
15823 | 7185 purple_signal_connect(purple_connections_get_handle(), "signed-on", |
7186 gtk_blist_handle, PURPLE_CALLBACK(account_signon_cb), | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7187 NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7188 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7189 /* Initialize prefs */ |
16062
07554cc5d090
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <stu@nosnilmot.com>
parents:
16010
diff
changeset
|
7190 purple_prefs_add_none(PIDGIN_PREFS_ROOT "/blist"); |
07554cc5d090
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <stu@nosnilmot.com>
parents:
16010
diff
changeset
|
7191 purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/blist/show_buddy_icons", TRUE); |
07554cc5d090
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <stu@nosnilmot.com>
parents:
16010
diff
changeset
|
7192 purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/blist/show_empty_groups", FALSE); |
07554cc5d090
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <stu@nosnilmot.com>
parents:
16010
diff
changeset
|
7193 purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/blist/show_idle_time", TRUE); |
07554cc5d090
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <stu@nosnilmot.com>
parents:
16010
diff
changeset
|
7194 purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/blist/show_offline_buddies", FALSE); |
19474
74befdcd0454
Fixes #2146. Adds a Show Protocol Icon option and groups related Show menu items into a submenu. Patch from Justin Heiner
Sean Egan <seanegan@gmail.com>
parents:
19363
diff
changeset
|
7195 purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/blist/show_protocol_icons", FALSE); |
16102
f3559f8d2fc1
For a first time user, don't show the buddy list telling him to go to Accounts>Add/Edit, because Accounts->Add/Edit is already open with its own instructions. Show only one window with instructions and then present the Buddy List when you create your first account.
Sean Egan <seanegan@gmail.com>
parents:
16100
diff
changeset
|
7196 purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/blist/list_visible", FALSE); |
16062
07554cc5d090
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <stu@nosnilmot.com>
parents:
16010
diff
changeset
|
7197 purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/blist/list_maximized", FALSE); |
07554cc5d090
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <stu@nosnilmot.com>
parents:
16010
diff
changeset
|
7198 purple_prefs_add_string(PIDGIN_PREFS_ROOT "/blist/sort_type", "alphabetical"); |
07554cc5d090
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <stu@nosnilmot.com>
parents:
16010
diff
changeset
|
7199 purple_prefs_add_int(PIDGIN_PREFS_ROOT "/blist/x", 0); |
07554cc5d090
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <stu@nosnilmot.com>
parents:
16010
diff
changeset
|
7200 purple_prefs_add_int(PIDGIN_PREFS_ROOT "/blist/y", 0); |
07554cc5d090
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <stu@nosnilmot.com>
parents:
16010
diff
changeset
|
7201 purple_prefs_add_int(PIDGIN_PREFS_ROOT "/blist/width", 250); /* Golden ratio, baby */ |
07554cc5d090
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <stu@nosnilmot.com>
parents:
16010
diff
changeset
|
7202 purple_prefs_add_int(PIDGIN_PREFS_ROOT "/blist/height", 405); /* Golden ratio, baby */ |
24282
d38d854cd0bf
Use GtkSetting to obtain the tooltip preferences instead of our own hidden
Richard Laager <rlaager@wiktel.com>
parents:
24134
diff
changeset
|
7203 #if !GTK_CHECK_VERSION(2,14,0) |
d38d854cd0bf
Use GtkSetting to obtain the tooltip preferences instead of our own hidden
Richard Laager <rlaager@wiktel.com>
parents:
24134
diff
changeset
|
7204 /* This pref is used in pidgintooltip.c. */ |
16062
07554cc5d090
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <stu@nosnilmot.com>
parents:
16010
diff
changeset
|
7205 purple_prefs_add_int(PIDGIN_PREFS_ROOT "/blist/tooltip_delay", 500); |
24282
d38d854cd0bf
Use GtkSetting to obtain the tooltip preferences instead of our own hidden
Richard Laager <rlaager@wiktel.com>
parents:
24134
diff
changeset
|
7206 #endif |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7207 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7208 /* Register our signals */ |
15823 | 7209 purple_signal_register(gtk_blist_handle, "gtkblist-hiding", |
7210 purple_marshal_VOID__POINTER, NULL, 1, | |
7211 purple_value_new(PURPLE_TYPE_SUBTYPE, | |
7212 PURPLE_SUBTYPE_BLIST)); | |
7213 | |
7214 purple_signal_register(gtk_blist_handle, "gtkblist-unhiding", | |
7215 purple_marshal_VOID__POINTER, NULL, 1, | |
7216 purple_value_new(PURPLE_TYPE_SUBTYPE, | |
7217 PURPLE_SUBTYPE_BLIST)); | |
7218 | |
7219 purple_signal_register(gtk_blist_handle, "gtkblist-created", | |
7220 purple_marshal_VOID__POINTER, NULL, 1, | |
7221 purple_value_new(PURPLE_TYPE_SUBTYPE, | |
7222 PURPLE_SUBTYPE_BLIST)); | |
7223 | |
7224 purple_signal_register(gtk_blist_handle, "drawing-tooltip", | |
7225 purple_marshal_VOID__POINTER_POINTER_UINT, NULL, 3, | |
7226 purple_value_new(PURPLE_TYPE_SUBTYPE, | |
7227 PURPLE_SUBTYPE_BLIST_NODE), | |
7228 purple_value_new_outgoing(PURPLE_TYPE_BOXED, "GString *"), | |
7229 purple_value_new(PURPLE_TYPE_BOOLEAN)); | |
7230 | |
7231 | |
7232 purple_signal_connect(purple_blist_get_handle(), "buddy-signed-on", gtk_blist_handle, PURPLE_CALLBACK(buddy_signonoff_cb), NULL); | |
7233 purple_signal_connect(purple_blist_get_handle(), "buddy-signed-off", gtk_blist_handle, PURPLE_CALLBACK(buddy_signonoff_cb), NULL); | |
7234 purple_signal_connect(purple_blist_get_handle(), "buddy-privacy-changed", gtk_blist_handle, PURPLE_CALLBACK(pidgin_blist_update_privacy_cb), NULL); | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7235 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7236 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7237 void |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
7238 pidgin_blist_uninit(void) { |
21756
abd0cd2b712a
Add rudimentary caching for buddy list emblems. This avoids all the icons being duplicated in memory and constantly loaded. A more complete solution would be preferable, but I think this is better than nothing.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21752
diff
changeset
|
7239 g_hash_table_destroy(cached_emblems); |
abd0cd2b712a
Add rudimentary caching for buddy list emblems. This avoids all the icons being duplicated in memory and constantly loaded. A more complete solution would be preferable, but I think this is better than nothing.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21752
diff
changeset
|
7240 |
15823 | 7241 purple_signals_unregister_by_instance(pidgin_blist_get_handle()); |
7242 purple_signals_disconnect_by_handle(pidgin_blist_get_handle()); | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7243 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7244 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7245 /********************************************************************* |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7246 * Buddy List sorting functions * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7247 *********************************************************************/ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7248 |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
7249 GList *pidgin_blist_get_sort_methods() |
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
7250 { |
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
7251 return pidgin_blist_sort_methods; |
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
7252 } |
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
7253 |
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
7254 void pidgin_blist_sort_method_reg(const char *id, const char *name, pidgin_blist_sort_function func) |
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
7255 { |
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
7256 struct pidgin_blist_sort_method *method = g_new0(struct pidgin_blist_sort_method, 1); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7257 method->id = g_strdup(id); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7258 method->name = g_strdup(name); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7259 method->func = func; |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
7260 pidgin_blist_sort_methods = g_list_append(pidgin_blist_sort_methods, method); |
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
7261 pidgin_blist_update_sort_methods(); |
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
7262 } |
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
7263 |
21990
d309d662a32c
Fix an infinite loop. Fixes #4486.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21986
diff
changeset
|
7264 void pidgin_blist_sort_method_unreg(const char *id) |
d309d662a32c
Fix an infinite loop. Fixes #4486.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21986
diff
changeset
|
7265 { |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
7266 GList *l = pidgin_blist_sort_methods; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7267 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7268 while(l) { |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
7269 struct pidgin_blist_sort_method *method = l->data; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7270 if(!strcmp(method->id, id)) { |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
7271 pidgin_blist_sort_methods = g_list_delete_link(pidgin_blist_sort_methods, l); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7272 g_free(method->id); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7273 g_free(method->name); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7274 g_free(method); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7275 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7276 } |
21990
d309d662a32c
Fix an infinite loop. Fixes #4486.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21986
diff
changeset
|
7277 l = l->next; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7278 } |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
7279 pidgin_blist_update_sort_methods(); |
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
7280 } |
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
7281 |
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
7282 void pidgin_blist_sort_method_set(const char *id){ |
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
7283 GList *l = pidgin_blist_sort_methods; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7284 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7285 if(!id) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7286 id = "none"; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7287 |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
7288 while (l && strcmp(((struct pidgin_blist_sort_method*)l->data)->id, id)) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7289 l = l->next; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7290 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7291 if (l) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7292 current_sort_method = l->data; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7293 } else if (!current_sort_method) { |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
7294 pidgin_blist_sort_method_set("none"); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7295 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7296 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7297 if (!strcmp(id, "none")) { |
15823 | 7298 redo_buddy_list(purple_get_blist(), TRUE, FALSE); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7299 } else { |
15823 | 7300 redo_buddy_list(purple_get_blist(), FALSE, FALSE); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7301 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7302 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7303 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7304 /****************************************** |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7305 ** Sort Methods |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7306 ******************************************/ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7307 |
15823 | 7308 static void sort_method_none(PurpleBlistNode *node, PurpleBuddyList *blist, GtkTreeIter parent_iter, GtkTreeIter *cur, GtkTreeIter *iter) |
7309 { | |
7310 PurpleBlistNode *sibling = node->prev; | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7311 GtkTreeIter sibling_iter; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7312 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7313 if (cur != NULL) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7314 *iter = *cur; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7315 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7316 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7317 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7318 while (sibling && !get_iter_from_node(sibling, &sibling_iter)) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7319 sibling = sibling->prev; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7320 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7321 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7322 gtk_tree_store_insert_after(gtkblist->treemodel, iter, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7323 node->parent ? &parent_iter : NULL, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7324 sibling ? &sibling_iter : NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7325 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7326 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7327 #if GTK_CHECK_VERSION(2,2,1) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7328 |
15823 | 7329 static void sort_method_alphabetical(PurpleBlistNode *node, PurpleBuddyList *blist, GtkTreeIter groupiter, GtkTreeIter *cur, GtkTreeIter *iter) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7330 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7331 GtkTreeIter more_z; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7332 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7333 const char *my_name; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7334 |
15823 | 7335 if(PURPLE_BLIST_NODE_IS_CONTACT(node)) { |
7336 my_name = purple_contact_get_alias((PurpleContact*)node); | |
7337 } else if(PURPLE_BLIST_NODE_IS_CHAT(node)) { | |
7338 my_name = purple_chat_get_name((PurpleChat*)node); | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7339 } else { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7340 sort_method_none(node, blist, groupiter, cur, iter); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7341 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7342 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7343 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7344 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7345 if (!gtk_tree_model_iter_children(GTK_TREE_MODEL(gtkblist->treemodel), &more_z, &groupiter)) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7346 gtk_tree_store_insert(gtkblist->treemodel, iter, &groupiter, 0); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7347 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7348 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7349 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7350 do { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7351 GValue val; |
15823 | 7352 PurpleBlistNode *n; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7353 const char *this_name; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7354 int cmp; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7355 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7356 val.g_type = 0; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7357 gtk_tree_model_get_value (GTK_TREE_MODEL(gtkblist->treemodel), &more_z, NODE_COLUMN, &val); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7358 n = g_value_get_pointer(&val); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7359 |
15823 | 7360 if(PURPLE_BLIST_NODE_IS_CONTACT(n)) { |
7361 this_name = purple_contact_get_alias((PurpleContact*)n); | |
7362 } else if(PURPLE_BLIST_NODE_IS_CHAT(n)) { | |
7363 this_name = purple_chat_get_name((PurpleChat*)n); | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7364 } else { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7365 this_name = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7366 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7367 |
15823 | 7368 cmp = purple_utf8_strcasecmp(my_name, this_name); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7369 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7370 if(this_name && (cmp < 0 || (cmp == 0 && node < n))) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7371 if(cur) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7372 gtk_tree_store_move_before(gtkblist->treemodel, cur, &more_z); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7373 *iter = *cur; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7374 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7375 } else { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7376 gtk_tree_store_insert_before(gtkblist->treemodel, iter, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7377 &groupiter, &more_z); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7378 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7379 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7380 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7381 g_value_unset(&val); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7382 } while (gtk_tree_model_iter_next (GTK_TREE_MODEL(gtkblist->treemodel), &more_z)); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7383 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7384 if(cur) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7385 gtk_tree_store_move_before(gtkblist->treemodel, cur, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7386 *iter = *cur; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7387 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7388 } else { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7389 gtk_tree_store_append(gtkblist->treemodel, iter, &groupiter); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7390 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7391 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7392 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7393 |
15823 | 7394 static void sort_method_status(PurpleBlistNode *node, PurpleBuddyList *blist, GtkTreeIter groupiter, GtkTreeIter *cur, GtkTreeIter *iter) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7395 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7396 GtkTreeIter more_z; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7397 |
15823 | 7398 PurpleBuddy *my_buddy, *this_buddy; |
7399 | |
7400 if(PURPLE_BLIST_NODE_IS_CONTACT(node)) { | |
7401 my_buddy = purple_contact_get_priority_buddy((PurpleContact*)node); | |
7402 } else if(PURPLE_BLIST_NODE_IS_CHAT(node)) { | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7403 if (cur != NULL) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7404 *iter = *cur; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7405 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7406 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7407 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7408 gtk_tree_store_append(gtkblist->treemodel, iter, &groupiter); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7409 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7410 } else { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7411 sort_method_none(node, blist, groupiter, cur, iter); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7412 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7413 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7414 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7415 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7416 if (!gtk_tree_model_iter_children(GTK_TREE_MODEL(gtkblist->treemodel), &more_z, &groupiter)) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7417 gtk_tree_store_insert(gtkblist->treemodel, iter, &groupiter, 0); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7418 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7419 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7420 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7421 do { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7422 GValue val; |
15823 | 7423 PurpleBlistNode *n; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7424 gint name_cmp; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7425 gint presence_cmp; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7426 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7427 val.g_type = 0; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7428 gtk_tree_model_get_value (GTK_TREE_MODEL(gtkblist->treemodel), &more_z, NODE_COLUMN, &val); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7429 n = g_value_get_pointer(&val); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7430 |
15823 | 7431 if(PURPLE_BLIST_NODE_IS_CONTACT(n)) { |
7432 this_buddy = purple_contact_get_priority_buddy((PurpleContact*)n); | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7433 } else { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7434 this_buddy = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7435 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7436 |
15823 | 7437 name_cmp = purple_utf8_strcasecmp( |
7438 purple_contact_get_alias(purple_buddy_get_contact(my_buddy)), | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7439 (this_buddy |
15823 | 7440 ? purple_contact_get_alias(purple_buddy_get_contact(this_buddy)) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7441 : NULL)); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7442 |
15823 | 7443 presence_cmp = purple_presence_compare( |
7444 purple_buddy_get_presence(my_buddy), | |
7445 this_buddy ? purple_buddy_get_presence(this_buddy) : NULL); | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7446 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7447 if (this_buddy == NULL || |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7448 (presence_cmp < 0 || |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7449 (presence_cmp == 0 && |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7450 (name_cmp < 0 || (name_cmp == 0 && node < n))))) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7451 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7452 if (cur != NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7453 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7454 gtk_tree_store_move_before(gtkblist->treemodel, cur, &more_z); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7455 *iter = *cur; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7456 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7457 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7458 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7459 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7460 gtk_tree_store_insert_before(gtkblist->treemodel, iter, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7461 &groupiter, &more_z); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7462 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7463 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7464 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7465 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7466 g_value_unset(&val); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7467 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7468 while (gtk_tree_model_iter_next(GTK_TREE_MODEL(gtkblist->treemodel), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7469 &more_z)); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7470 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7471 if (cur) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7472 gtk_tree_store_move_before(gtkblist->treemodel, cur, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7473 *iter = *cur; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7474 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7475 } else { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7476 gtk_tree_store_append(gtkblist->treemodel, iter, &groupiter); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7477 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7478 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7479 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7480 |
15823 | 7481 static void sort_method_log(PurpleBlistNode *node, PurpleBuddyList *blist, GtkTreeIter groupiter, GtkTreeIter *cur, GtkTreeIter *iter) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7482 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7483 GtkTreeIter more_z; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7484 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7485 int log_size = 0, this_log_size = 0; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7486 const char *buddy_name, *this_buddy_name; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7487 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7488 if(cur && (gtk_tree_model_iter_n_children(GTK_TREE_MODEL(gtkblist->treemodel), &groupiter) == 1)) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7489 *iter = *cur; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7490 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7491 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7492 |
15823 | 7493 if(PURPLE_BLIST_NODE_IS_CONTACT(node)) { |
7494 PurpleBlistNode *n; | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7495 for (n = node->child; n; n = n->next) |
15823 | 7496 log_size += purple_log_get_total_size(PURPLE_LOG_IM, ((PurpleBuddy*)(n))->name, ((PurpleBuddy*)(n))->account); |
7497 buddy_name = purple_contact_get_alias((PurpleContact*)node); | |
7498 } else if(PURPLE_BLIST_NODE_IS_CHAT(node)) { | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7499 /* we don't have a reliable way of getting the log filename |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7500 * from the chat info in the blist, yet */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7501 if (cur != NULL) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7502 *iter = *cur; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7503 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7504 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7505 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7506 gtk_tree_store_append(gtkblist->treemodel, iter, &groupiter); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7507 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7508 } else { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7509 sort_method_none(node, blist, groupiter, cur, iter); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7510 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7511 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7512 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7513 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7514 if (!gtk_tree_model_iter_children(GTK_TREE_MODEL(gtkblist->treemodel), &more_z, &groupiter)) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7515 gtk_tree_store_insert(gtkblist->treemodel, iter, &groupiter, 0); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7516 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7517 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7518 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7519 do { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7520 GValue val; |
15823 | 7521 PurpleBlistNode *n; |
7522 PurpleBlistNode *n2; | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7523 int cmp; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7524 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7525 val.g_type = 0; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7526 gtk_tree_model_get_value (GTK_TREE_MODEL(gtkblist->treemodel), &more_z, NODE_COLUMN, &val); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7527 n = g_value_get_pointer(&val); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7528 this_log_size = 0; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7529 |
15823 | 7530 if(PURPLE_BLIST_NODE_IS_CONTACT(n)) { |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7531 for (n2 = n->child; n2; n2 = n2->next) |
15823 | 7532 this_log_size += purple_log_get_total_size(PURPLE_LOG_IM, ((PurpleBuddy*)(n2))->name, ((PurpleBuddy*)(n2))->account); |
7533 this_buddy_name = purple_contact_get_alias((PurpleContact*)n); | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7534 } else { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7535 this_buddy_name = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7536 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7537 |
15823 | 7538 cmp = purple_utf8_strcasecmp(buddy_name, this_buddy_name); |
7539 | |
7540 if (!PURPLE_BLIST_NODE_IS_CONTACT(n) || log_size > this_log_size || | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7541 ((log_size == this_log_size) && |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7542 (cmp < 0 || (cmp == 0 && node < n)))) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7543 if (cur != NULL) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7544 gtk_tree_store_move_before(gtkblist->treemodel, cur, &more_z); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7545 *iter = *cur; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7546 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7547 } else { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7548 gtk_tree_store_insert_before(gtkblist->treemodel, iter, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7549 &groupiter, &more_z); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7550 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7551 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7552 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7553 g_value_unset(&val); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7554 } while (gtk_tree_model_iter_next (GTK_TREE_MODEL(gtkblist->treemodel), &more_z)); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7555 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7556 if (cur != NULL) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7557 gtk_tree_store_move_before(gtkblist->treemodel, cur, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7558 *iter = *cur; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7559 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7560 } else { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7561 gtk_tree_store_append(gtkblist->treemodel, iter, &groupiter); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7562 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7563 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7564 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7565 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7566 #endif |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7567 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7568 static void |
15823 | 7569 plugin_act(GtkObject *obj, PurplePluginAction *pam) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7570 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7571 if (pam && pam->callback) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7572 pam->callback(pam); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7573 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7574 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7575 static void |
15980
f61113b26032
sf patch #1689182, from Will Thompson
Mark Doliner <mark@kingant.net>
parents:
15921
diff
changeset
|
7576 build_plugin_actions(GtkWidget *menu, PurplePlugin *plugin, |
f61113b26032
sf patch #1689182, from Will Thompson
Mark Doliner <mark@kingant.net>
parents:
15921
diff
changeset
|
7577 gpointer context) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7578 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7579 GtkWidget *menuitem; |
15823 | 7580 PurplePluginAction *action = NULL; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7581 GList *actions, *l; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7582 |
15980
f61113b26032
sf patch #1689182, from Will Thompson
Mark Doliner <mark@kingant.net>
parents:
15921
diff
changeset
|
7583 actions = PURPLE_PLUGIN_ACTIONS(plugin, context); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7584 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7585 for (l = actions; l != NULL; l = l->next) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7586 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7587 if (l->data) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7588 { |
15823 | 7589 action = (PurplePluginAction *) l->data; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7590 action->plugin = plugin; |
15980
f61113b26032
sf patch #1689182, from Will Thompson
Mark Doliner <mark@kingant.net>
parents:
15921
diff
changeset
|
7591 action->context = context; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7592 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7593 menuitem = gtk_menu_item_new_with_label(action->label); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7594 gtk_menu_shell_append(GTK_MENU_SHELL(menu), menuitem); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7595 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7596 g_signal_connect(G_OBJECT(menuitem), "activate", |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7597 G_CALLBACK(plugin_act), action); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7598 g_object_set_data_full(G_OBJECT(menuitem), "plugin_action", |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7599 action, |
15823 | 7600 (GDestroyNotify)purple_plugin_action_free); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7601 gtk_widget_show(menuitem); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7602 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7603 else |
15507 | 7604 pidgin_separator(menu); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7605 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7606 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7607 g_list_free(actions); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7608 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7609 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7610 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7611 modify_account_cb(GtkWidget *widget, gpointer data) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7612 { |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
7613 pidgin_account_dialog_show(PIDGIN_MODIFY_ACCOUNT_DIALOG, data); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7614 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7615 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7616 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7617 enable_account_cb(GtkCheckMenuItem *widget, gpointer data) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7618 { |
15823 | 7619 PurpleAccount *account = data; |
7620 const PurpleSavedStatus *saved_status; | |
7621 | |
7622 saved_status = purple_savedstatus_get_current(); | |
7623 purple_savedstatus_activate_for_account(saved_status, account); | |
7624 | |
7625 purple_account_set_enabled(account, PIDGIN_UI, TRUE); | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7626 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7627 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7628 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7629 disable_account_cb(GtkCheckMenuItem *widget, gpointer data) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7630 { |
15823 | 7631 PurpleAccount *account = data; |
7632 | |
7633 purple_account_set_enabled(account, PIDGIN_UI, FALSE); | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7634 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7635 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7636 void |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
7637 pidgin_blist_update_accounts_menu(void) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7638 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7639 GtkWidget *menuitem = NULL, *submenu = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7640 GtkAccelGroup *accel_group = NULL; |
18063
926ccb104da0
disapproval of revision '1411afd7660760db59966c3a9f18e2adab8eb27e'
Richard Laager <rlaager@wiktel.com>
parents:
18058
diff
changeset
|
7641 GList *l = NULL, *accounts = NULL; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7642 gboolean disabled_accounts = FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7643 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7644 if (accountmenu == NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7645 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7646 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7647 /* Clear the old Accounts menu */ |
18646
05cab350d1fb
Fix memory leak by freeing the list returned by gtk_container_get_children.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
18435
diff
changeset
|
7648 for (l = gtk_container_get_children(GTK_CONTAINER(accountmenu)); l; l = g_list_delete_link(l, l)) { |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7649 menuitem = l->data; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7650 |
23312
a3759c05cc5b
Bring back the unintentionally hidden 'Manage Accounts' dialog. Thanks to
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23309
diff
changeset
|
7651 if (menuitem != gtk_item_factory_get_widget(gtkblist->ift, N_("/Accounts/Manage Accounts"))) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7652 gtk_widget_destroy(menuitem); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7653 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7654 |
23969
5045f2ce9cff
disapproval of revision 'f5ca7968e3f6be8f81d068232d389e0b1dab784b'
Kevin Stange <kevin@simguy.net>
parents:
23967
diff
changeset
|
7655 for (accounts = purple_accounts_get_all(); accounts; accounts = accounts->next) { |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7656 char *buf = NULL; |
23346
e96502c0262e
Moved "Enable Account" to the top with "Manage Accounts", and always put a
Ka-Hing Cheung <khc@hxbc.us>
parents:
23326
diff
changeset
|
7657 GtkWidget *image = NULL; |
e96502c0262e
Moved "Enable Account" to the top with "Manage Accounts", and always put a
Ka-Hing Cheung <khc@hxbc.us>
parents:
23326
diff
changeset
|
7658 PurpleAccount *account = NULL; |
e96502c0262e
Moved "Enable Account" to the top with "Manage Accounts", and always put a
Ka-Hing Cheung <khc@hxbc.us>
parents:
23326
diff
changeset
|
7659 GdkPixbuf *pixbuf = NULL; |
e96502c0262e
Moved "Enable Account" to the top with "Manage Accounts", and always put a
Ka-Hing Cheung <khc@hxbc.us>
parents:
23326
diff
changeset
|
7660 |
e96502c0262e
Moved "Enable Account" to the top with "Manage Accounts", and always put a
Ka-Hing Cheung <khc@hxbc.us>
parents:
23326
diff
changeset
|
7661 account = accounts->data; |
e96502c0262e
Moved "Enable Account" to the top with "Manage Accounts", and always put a
Ka-Hing Cheung <khc@hxbc.us>
parents:
23326
diff
changeset
|
7662 |
e96502c0262e
Moved "Enable Account" to the top with "Manage Accounts", and always put a
Ka-Hing Cheung <khc@hxbc.us>
parents:
23326
diff
changeset
|
7663 if(!purple_account_get_enabled(account, PIDGIN_UI)) { |
e96502c0262e
Moved "Enable Account" to the top with "Manage Accounts", and always put a
Ka-Hing Cheung <khc@hxbc.us>
parents:
23326
diff
changeset
|
7664 if (!disabled_accounts) { |
e96502c0262e
Moved "Enable Account" to the top with "Manage Accounts", and always put a
Ka-Hing Cheung <khc@hxbc.us>
parents:
23326
diff
changeset
|
7665 menuitem = gtk_menu_item_new_with_label(_("Enable Account")); |
e96502c0262e
Moved "Enable Account" to the top with "Manage Accounts", and always put a
Ka-Hing Cheung <khc@hxbc.us>
parents:
23326
diff
changeset
|
7666 gtk_menu_shell_append(GTK_MENU_SHELL(accountmenu), menuitem); |
e96502c0262e
Moved "Enable Account" to the top with "Manage Accounts", and always put a
Ka-Hing Cheung <khc@hxbc.us>
parents:
23326
diff
changeset
|
7667 gtk_widget_show(menuitem); |
e96502c0262e
Moved "Enable Account" to the top with "Manage Accounts", and always put a
Ka-Hing Cheung <khc@hxbc.us>
parents:
23326
diff
changeset
|
7668 |
e96502c0262e
Moved "Enable Account" to the top with "Manage Accounts", and always put a
Ka-Hing Cheung <khc@hxbc.us>
parents:
23326
diff
changeset
|
7669 submenu = gtk_menu_new(); |
e96502c0262e
Moved "Enable Account" to the top with "Manage Accounts", and always put a
Ka-Hing Cheung <khc@hxbc.us>
parents:
23326
diff
changeset
|
7670 gtk_menu_set_accel_group(GTK_MENU(submenu), accel_group); |
e96502c0262e
Moved "Enable Account" to the top with "Manage Accounts", and always put a
Ka-Hing Cheung <khc@hxbc.us>
parents:
23326
diff
changeset
|
7671 gtk_menu_set_accel_path(GTK_MENU(submenu), N_("<PurpleMain>/Accounts/Enable Account")); |
e96502c0262e
Moved "Enable Account" to the top with "Manage Accounts", and always put a
Ka-Hing Cheung <khc@hxbc.us>
parents:
23326
diff
changeset
|
7672 gtk_menu_item_set_submenu(GTK_MENU_ITEM(menuitem), submenu); |
e96502c0262e
Moved "Enable Account" to the top with "Manage Accounts", and always put a
Ka-Hing Cheung <khc@hxbc.us>
parents:
23326
diff
changeset
|
7673 gtk_widget_show(submenu); |
e96502c0262e
Moved "Enable Account" to the top with "Manage Accounts", and always put a
Ka-Hing Cheung <khc@hxbc.us>
parents:
23326
diff
changeset
|
7674 |
e96502c0262e
Moved "Enable Account" to the top with "Manage Accounts", and always put a
Ka-Hing Cheung <khc@hxbc.us>
parents:
23326
diff
changeset
|
7675 disabled_accounts = TRUE; |
e96502c0262e
Moved "Enable Account" to the top with "Manage Accounts", and always put a
Ka-Hing Cheung <khc@hxbc.us>
parents:
23326
diff
changeset
|
7676 } |
e96502c0262e
Moved "Enable Account" to the top with "Manage Accounts", and always put a
Ka-Hing Cheung <khc@hxbc.us>
parents:
23326
diff
changeset
|
7677 |
e96502c0262e
Moved "Enable Account" to the top with "Manage Accounts", and always put a
Ka-Hing Cheung <khc@hxbc.us>
parents:
23326
diff
changeset
|
7678 buf = g_strconcat(purple_account_get_username(account), " (", |
e96502c0262e
Moved "Enable Account" to the top with "Manage Accounts", and always put a
Ka-Hing Cheung <khc@hxbc.us>
parents:
23326
diff
changeset
|
7679 purple_account_get_protocol_name(account), ")", NULL); |
e96502c0262e
Moved "Enable Account" to the top with "Manage Accounts", and always put a
Ka-Hing Cheung <khc@hxbc.us>
parents:
23326
diff
changeset
|
7680 menuitem = gtk_image_menu_item_new_with_label(buf); |
e96502c0262e
Moved "Enable Account" to the top with "Manage Accounts", and always put a
Ka-Hing Cheung <khc@hxbc.us>
parents:
23326
diff
changeset
|
7681 g_free(buf); |
e96502c0262e
Moved "Enable Account" to the top with "Manage Accounts", and always put a
Ka-Hing Cheung <khc@hxbc.us>
parents:
23326
diff
changeset
|
7682 pixbuf = pidgin_create_prpl_icon(account, PIDGIN_PRPL_ICON_SMALL); |
e96502c0262e
Moved "Enable Account" to the top with "Manage Accounts", and always put a
Ka-Hing Cheung <khc@hxbc.us>
parents:
23326
diff
changeset
|
7683 if (pixbuf != NULL) |
e96502c0262e
Moved "Enable Account" to the top with "Manage Accounts", and always put a
Ka-Hing Cheung <khc@hxbc.us>
parents:
23326
diff
changeset
|
7684 { |
e96502c0262e
Moved "Enable Account" to the top with "Manage Accounts", and always put a
Ka-Hing Cheung <khc@hxbc.us>
parents:
23326
diff
changeset
|
7685 if (!purple_account_is_connected(account)) |
e96502c0262e
Moved "Enable Account" to the top with "Manage Accounts", and always put a
Ka-Hing Cheung <khc@hxbc.us>
parents:
23326
diff
changeset
|
7686 gdk_pixbuf_saturate_and_pixelate(pixbuf, pixbuf, 0.0, FALSE); |
e96502c0262e
Moved "Enable Account" to the top with "Manage Accounts", and always put a
Ka-Hing Cheung <khc@hxbc.us>
parents:
23326
diff
changeset
|
7687 image = gtk_image_new_from_pixbuf(pixbuf); |
e96502c0262e
Moved "Enable Account" to the top with "Manage Accounts", and always put a
Ka-Hing Cheung <khc@hxbc.us>
parents:
23326
diff
changeset
|
7688 g_object_unref(G_OBJECT(pixbuf)); |
e96502c0262e
Moved "Enable Account" to the top with "Manage Accounts", and always put a
Ka-Hing Cheung <khc@hxbc.us>
parents:
23326
diff
changeset
|
7689 gtk_widget_show(image); |
e96502c0262e
Moved "Enable Account" to the top with "Manage Accounts", and always put a
Ka-Hing Cheung <khc@hxbc.us>
parents:
23326
diff
changeset
|
7690 gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(menuitem), image); |
e96502c0262e
Moved "Enable Account" to the top with "Manage Accounts", and always put a
Ka-Hing Cheung <khc@hxbc.us>
parents:
23326
diff
changeset
|
7691 } |
e96502c0262e
Moved "Enable Account" to the top with "Manage Accounts", and always put a
Ka-Hing Cheung <khc@hxbc.us>
parents:
23326
diff
changeset
|
7692 g_signal_connect(G_OBJECT(menuitem), "activate", |
e96502c0262e
Moved "Enable Account" to the top with "Manage Accounts", and always put a
Ka-Hing Cheung <khc@hxbc.us>
parents:
23326
diff
changeset
|
7693 G_CALLBACK(enable_account_cb), account); |
e96502c0262e
Moved "Enable Account" to the top with "Manage Accounts", and always put a
Ka-Hing Cheung <khc@hxbc.us>
parents:
23326
diff
changeset
|
7694 gtk_menu_shell_append(GTK_MENU_SHELL(submenu), menuitem); |
e96502c0262e
Moved "Enable Account" to the top with "Manage Accounts", and always put a
Ka-Hing Cheung <khc@hxbc.us>
parents:
23326
diff
changeset
|
7695 gtk_widget_show(menuitem); |
e96502c0262e
Moved "Enable Account" to the top with "Manage Accounts", and always put a
Ka-Hing Cheung <khc@hxbc.us>
parents:
23326
diff
changeset
|
7696 } |
e96502c0262e
Moved "Enable Account" to the top with "Manage Accounts", and always put a
Ka-Hing Cheung <khc@hxbc.us>
parents:
23326
diff
changeset
|
7697 } |
e96502c0262e
Moved "Enable Account" to the top with "Manage Accounts", and always put a
Ka-Hing Cheung <khc@hxbc.us>
parents:
23326
diff
changeset
|
7698 |
e96502c0262e
Moved "Enable Account" to the top with "Manage Accounts", and always put a
Ka-Hing Cheung <khc@hxbc.us>
parents:
23326
diff
changeset
|
7699 pidgin_separator(accountmenu); |
e96502c0262e
Moved "Enable Account" to the top with "Manage Accounts", and always put a
Ka-Hing Cheung <khc@hxbc.us>
parents:
23326
diff
changeset
|
7700 |
e96502c0262e
Moved "Enable Account" to the top with "Manage Accounts", and always put a
Ka-Hing Cheung <khc@hxbc.us>
parents:
23326
diff
changeset
|
7701 for (accounts = purple_accounts_get_all(); accounts; accounts = accounts->next) { |
e96502c0262e
Moved "Enable Account" to the top with "Manage Accounts", and always put a
Ka-Hing Cheung <khc@hxbc.us>
parents:
23326
diff
changeset
|
7702 char *buf = NULL; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7703 char *accel_path_buf = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7704 GtkWidget *image = NULL; |
15823 | 7705 PurpleConnection *gc = NULL; |
7706 PurpleAccount *account = NULL; | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7707 GdkPixbuf *pixbuf = NULL; |
15980
f61113b26032
sf patch #1689182, from Will Thompson
Mark Doliner <mark@kingant.net>
parents:
15921
diff
changeset
|
7708 PurplePlugin *plugin = NULL; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7709 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7710 account = accounts->data; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7711 accel_group = gtk_menu_get_accel_group(GTK_MENU(accountmenu)); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7712 |
15823 | 7713 if(purple_account_get_enabled(account, PIDGIN_UI)) { |
7714 buf = g_strconcat(purple_account_get_username(account), " (", | |
7715 purple_account_get_protocol_name(account), ")", NULL); | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7716 menuitem = gtk_image_menu_item_new_with_label(buf); |
15823 | 7717 accel_path_buf = g_strconcat(N_("<PurpleMain>/Accounts/"), buf, NULL); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7718 g_free(buf); |
15738
20225df32b7e
Change some old, busted status icon stuff to use the new hotness
Sean Egan <seanegan@gmail.com>
parents:
15708
diff
changeset
|
7719 pixbuf = pidgin_create_prpl_icon(account, PIDGIN_PRPL_ICON_SMALL); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7720 if (pixbuf != NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7721 { |
15823 | 7722 if (!purple_account_is_connected(account)) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7723 gdk_pixbuf_saturate_and_pixelate(pixbuf, pixbuf, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7724 0.0, FALSE); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7725 image = gtk_image_new_from_pixbuf(pixbuf); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7726 g_object_unref(G_OBJECT(pixbuf)); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7727 gtk_widget_show(image); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7728 gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(menuitem), image); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7729 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7730 gtk_menu_shell_append(GTK_MENU_SHELL(accountmenu), menuitem); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7731 gtk_widget_show(menuitem); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7732 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7733 submenu = gtk_menu_new(); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7734 gtk_menu_set_accel_group(GTK_MENU(submenu), accel_group); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7735 gtk_menu_set_accel_path(GTK_MENU(submenu), accel_path_buf); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7736 g_free(accel_path_buf); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7737 gtk_menu_item_set_submenu(GTK_MENU_ITEM(menuitem), submenu); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7738 gtk_widget_show(submenu); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7739 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7740 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7741 menuitem = gtk_menu_item_new_with_mnemonic(_("_Edit Account")); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7742 g_signal_connect(G_OBJECT(menuitem), "activate", |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7743 G_CALLBACK(modify_account_cb), account); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7744 gtk_menu_shell_append(GTK_MENU_SHELL(submenu), menuitem); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7745 gtk_widget_show(menuitem); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7746 |
15507 | 7747 pidgin_separator(submenu); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7748 |
15823 | 7749 gc = purple_account_get_connection(account); |
15980
f61113b26032
sf patch #1689182, from Will Thompson
Mark Doliner <mark@kingant.net>
parents:
15921
diff
changeset
|
7750 plugin = gc && PURPLE_CONNECTION_IS_CONNECTED(gc) ? gc->prpl : NULL; |
f61113b26032
sf patch #1689182, from Will Thompson
Mark Doliner <mark@kingant.net>
parents:
15921
diff
changeset
|
7751 if (plugin && PURPLE_PLUGIN_HAS_ACTIONS(plugin)) { |
f61113b26032
sf patch #1689182, from Will Thompson
Mark Doliner <mark@kingant.net>
parents:
15921
diff
changeset
|
7752 build_plugin_actions(submenu, plugin, gc); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7753 } else { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7754 menuitem = gtk_menu_item_new_with_label(_("No actions available")); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7755 gtk_menu_shell_append(GTK_MENU_SHELL(submenu), menuitem); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7756 gtk_widget_set_sensitive(menuitem, FALSE); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7757 gtk_widget_show(menuitem); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7758 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7759 |
15507 | 7760 pidgin_separator(submenu); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7761 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7762 menuitem = gtk_menu_item_new_with_mnemonic(_("_Disable")); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7763 g_signal_connect(G_OBJECT(menuitem), "activate", |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7764 G_CALLBACK(disable_account_cb), account); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7765 gtk_menu_shell_append(GTK_MENU_SHELL(submenu), menuitem); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7766 gtk_widget_show(menuitem); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7767 } else { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7768 disabled_accounts = TRUE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7769 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7770 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7771 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7772 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7773 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7774 static GList *plugin_submenus = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7775 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7776 void |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
7777 pidgin_blist_update_plugin_actions(void) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7778 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7779 GtkWidget *menuitem, *submenu; |
15823 | 7780 PurplePlugin *plugin = NULL; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7781 GList *l; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7782 GtkAccelGroup *accel_group; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7783 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7784 GtkWidget *pluginmenu = gtk_item_factory_get_widget(gtkblist->ift, N_("/Tools")); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7785 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7786 g_return_if_fail(pluginmenu != NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7787 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7788 /* Remove old plugin action submenus from the Tools menu */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7789 for (l = plugin_submenus; l; l = l->next) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7790 gtk_widget_destroy(GTK_WIDGET(l->data)); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7791 g_list_free(plugin_submenus); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7792 plugin_submenus = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7793 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7794 accel_group = gtk_menu_get_accel_group(GTK_MENU(pluginmenu)); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7795 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7796 /* Add a submenu for each plugin with custom actions */ |
15823 | 7797 for (l = purple_plugins_get_loaded(); l; l = l->next) { |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7798 char *path; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7799 |
15823 | 7800 plugin = (PurplePlugin *) l->data; |
7801 | |
7802 if (PURPLE_IS_PROTOCOL_PLUGIN(plugin)) | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7803 continue; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7804 |
15823 | 7805 if (!PURPLE_PLUGIN_HAS_ACTIONS(plugin)) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7806 continue; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7807 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7808 menuitem = gtk_image_menu_item_new_with_label(_(plugin->info->name)); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7809 gtk_menu_shell_append(GTK_MENU_SHELL(pluginmenu), menuitem); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7810 gtk_widget_show(menuitem); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7811 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7812 plugin_submenus = g_list_append(plugin_submenus, menuitem); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7813 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7814 submenu = gtk_menu_new(); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7815 gtk_menu_item_set_submenu(GTK_MENU_ITEM(menuitem), submenu); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7816 gtk_widget_show(submenu); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7817 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7818 gtk_menu_set_accel_group(GTK_MENU(submenu), accel_group); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7819 path = g_strdup_printf("%s/Tools/%s", gtkblist->ift->path, plugin->info->name); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7820 gtk_menu_set_accel_path(GTK_MENU(submenu), path); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7821 g_free(path); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7822 |
15980
f61113b26032
sf patch #1689182, from Will Thompson
Mark Doliner <mark@kingant.net>
parents:
15921
diff
changeset
|
7823 build_plugin_actions(submenu, plugin, NULL); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7824 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7825 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7826 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7827 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7828 sortmethod_act(GtkCheckMenuItem *checkmenuitem, char *id) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7829 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7830 if (gtk_check_menu_item_get_active(checkmenuitem)) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7831 { |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
7832 pidgin_set_cursor(gtkblist->window, GDK_WATCH); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7833 /* This is redundant. I think. */ |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
7834 /* pidgin_blist_sort_method_set(id); */ |
16062
07554cc5d090
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <stu@nosnilmot.com>
parents:
16010
diff
changeset
|
7835 purple_prefs_set_string(PIDGIN_PREFS_ROOT "/blist/sort_type", id); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7836 |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
7837 pidgin_clear_cursor(gtkblist->window); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7838 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7839 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7840 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7841 void |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
7842 pidgin_blist_update_sort_methods(void) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7843 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7844 GtkWidget *menuitem = NULL, *activeitem = NULL; |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
7845 PidginBlistSortMethod *method = NULL; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7846 GList *l; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7847 GSList *sl = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7848 GtkWidget *sortmenu; |
16062
07554cc5d090
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <stu@nosnilmot.com>
parents:
16010
diff
changeset
|
7849 const char *m = purple_prefs_get_string(PIDGIN_PREFS_ROOT "/blist/sort_type"); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7850 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7851 if ((gtkblist == NULL) || (gtkblist->ift == NULL)) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7852 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7853 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7854 sortmenu = gtk_item_factory_get_widget(gtkblist->ift, N_("/Buddies/Sort Buddies")); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7855 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7856 if (sortmenu == NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7857 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7858 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7859 /* Clear the old menu */ |
18646
05cab350d1fb
Fix memory leak by freeing the list returned by gtk_container_get_children.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
18435
diff
changeset
|
7860 for (l = gtk_container_get_children(GTK_CONTAINER(sortmenu)); l; l = g_list_delete_link(l, l)) { |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7861 menuitem = l->data; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7862 gtk_widget_destroy(GTK_WIDGET(menuitem)); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7863 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7864 |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
7865 for (l = pidgin_blist_sort_methods; l; l = l->next) { |
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15500
diff
changeset
|
7866 method = (PidginBlistSortMethod *) l->data; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7867 menuitem = gtk_radio_menu_item_new_with_label(sl, _(method->name)); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7868 if (!strcmp(m, method->id)) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7869 activeitem = menuitem; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7870 sl = gtk_radio_menu_item_get_group(GTK_RADIO_MENU_ITEM(menuitem)); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7871 gtk_menu_shell_append(GTK_MENU_SHELL(sortmenu), menuitem); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7872 g_signal_connect(G_OBJECT(menuitem), "toggled", |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7873 G_CALLBACK(sortmethod_act), method->id); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7874 gtk_widget_show(menuitem); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7875 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7876 if (activeitem) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7877 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(activeitem), TRUE); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7878 } |
18004
d40fd7106ebf
merge of '1c5a391126b5b506a29f0b9e34160d239cb783c6'
Sadrul Habib Chowdhury <imadil@gmail.com>
diff
changeset
|
7879 |