Mercurial > pidgin
annotate pidgin/gtkblist.c @ 32714:d86fa4e61631
These lines would never be true, due to the outer check.
author | Elliott Sales de Andrade <qulogic@pidgin.im> |
---|---|
date | Fri, 06 Jan 2012 06:46:54 +0000 |
parents | a1d6ec1d3547 |
children | 4ae0c82b158d |
rev | line source |
---|---|
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1 /* |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2 * @file 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 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7 * |
15870
66dff3dfdea6
Re-sed the copyright notices so they don't all talk about Purple.
Richard Laager <rlaager@wiktel.com>
parents:
15822
diff
changeset
|
8 * Pidgin is the legal property of its developers, whose names are too numerous |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
9 * to list here. Please refer to the COPYRIGHT file distributed with this |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
10 * source distribution. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
11 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
12 * This program is free software; you can redistribute it and/or modify |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
13 * it under the terms of the GNU General Public License as published by |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
14 * the Free Software Foundation; either version 2 of the License, or |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
15 * (at your option) any later version. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
16 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
17 * This program is distributed in the hope that it will be useful, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
20 * GNU General Public License for more details. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
21 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
22 * You should have received a copy of the GNU General Public License |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
23 * along with this program; if not, write to the Free Software |
19681
44b4e8bd759b
The FSF changed its address a while ago; our files were out of date.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
19636
diff
changeset
|
24 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
25 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
26 */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
27 #include "internal.h" |
15513 | 28 #include "pidgin.h" |
15373
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" |
15821
84b0f9b23ede
According to etags, pidgin/ should be completely clean of references to 'gaim' as a client
Sean Egan <seanegan@gmail.com>
parents:
15820
diff
changeset
|
40 #include "pidginstock.h" |
25099
1242a922a4bc
start of blist themes (themes have no effect on display)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23393
diff
changeset
|
41 #include "theme-loader.h" |
1242a922a4bc
start of blist themes (themes have no effect on display)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23393
diff
changeset
|
42 #include "theme-manager.h" |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
43 #include "util.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
44 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
45 #include "gtkaccount.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
46 #include "gtkblist.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
47 #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
|
48 #include "gtkcertmgr.h" |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
49 #include "gtkconv.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
50 #include "gtkdebug.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
51 #include "gtkdialogs.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
52 #include "gtkft.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
53 #include "gtklog.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
54 #include "gtkmenutray.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
55 #include "gtkpounce.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
56 #include "gtkplugin.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
57 #include "gtkprefs.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
58 #include "gtkprivacy.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
59 #include "gtkroomlist.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
60 #include "gtkstatusbox.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
61 #include "gtkscrollbook.h" |
22311
02eda4bd2b22
Apply the custom smiley patches from #1187, from Jorge Villaseo (Masca) and
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22299
diff
changeset
|
62 #include "gtksmiley.h" |
25920
c0e3b62f8098
* Alphabetize files in a few Makefile.am files
Mark Doliner <mark@kingant.net>
parents:
25919
diff
changeset
|
63 #include "gtkblist-theme.h" |
25777
7ddaa405936e
renamed gtkblist-loader.[ch] to gtblist-theme-loader.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
25776
diff
changeset
|
64 #include "gtkblist-theme-loader.h" |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
65 #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
|
66 #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
|
67 #include "pidgin/pidgintooltip.h" |
15373
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 #include <gdk/gdkkeysyms.h> |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
70 #include <gtk/gtk.h> |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
71 #include <gdk/gdk.h> |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
72 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
73 typedef struct |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
74 { |
15822 | 75 PurpleAccount *account; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
76 GtkWidget *window; |
26884
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
77 GtkBox *vbox; |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
78 GtkWidget *account_menu; |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
79 GtkSizeGroup *sg; |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
80 } PidginBlistRequestData; |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
81 |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
82 typedef struct |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
83 { |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
84 PidginBlistRequestData rq_data; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
85 GtkWidget *combo; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
86 GtkWidget *entry; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
87 GtkWidget *entry_for_alias; |
31402
c0a122c22475
Show invite message entry in the Add Buddy dialog.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31374
diff
changeset
|
88 GtkWidget *entry_for_invite; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
89 |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
90 } PidginAddBuddyData; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
91 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
92 typedef struct |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
93 { |
26884
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
94 PidginBlistRequestData rq_data; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
95 gchar *default_chat_name; |
26884
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
96 GList *entries; |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
97 } PidginChatData; |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
98 |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
99 typedef struct |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
100 { |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
101 PidginChatData chat_data; |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
102 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
103 GtkWidget *alias_entry; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
104 GtkWidget *group_combo; |
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
|
105 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
|
106 GtkWidget *persistent; |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
107 } PidginAddChatData; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
108 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
109 typedef struct |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
110 { |
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
|
111 /** 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
|
112 * 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
|
113 */ |
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
|
114 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
|
115 |
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
|
116 /** 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
|
117 * 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
|
118 */ |
21410
4ccc4ad0a8b0
Use PidginMiniDialog to display signed in elsewhere errors in the blist.
Will Thompson <will.thompson@collabora.co.uk>
parents:
21401
diff
changeset
|
119 PidginMiniDialog *signed_on_elsewhere; |
25099
1242a922a4bc
start of blist themes (themes have no effect on display)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23393
diff
changeset
|
120 |
25102
4aeef8c3cce3
restructured much of the loader and themes for the buddy list, along with a basic trial of group background
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25100
diff
changeset
|
121 PidginBlistTheme *current_theme; |
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 } 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
|
123 |
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 #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
|
125 ((PidginBuddyListPrivate *)((list)->priv)) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
126 |
32686
3538e783b98c
Fix all deprecated GTK_WIDGET_* macros.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32684
diff
changeset
|
127 #if !GTK_CHECK_VERSION(2,18,0) |
3538e783b98c
Fix all deprecated GTK_WIDGET_* macros.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32684
diff
changeset
|
128 #define gtk_widget_get_visible(x) GTK_WIDGET_VISIBLE(x) |
3538e783b98c
Fix all deprecated GTK_WIDGET_* macros.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32684
diff
changeset
|
129 #define gtk_widget_has_focus(x) GTK_WIDGET_HAS_FOCUS(x) |
3538e783b98c
Fix all deprecated GTK_WIDGET_* macros.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32684
diff
changeset
|
130 #endif |
3538e783b98c
Fix all deprecated GTK_WIDGET_* macros.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32684
diff
changeset
|
131 |
32583
2bc917bbd07e
Move some UI manager stuff out of the blist structure and into the source
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32582
diff
changeset
|
132 static guint accounts_merge_id; |
2bc917bbd07e
Move some UI manager stuff out of the blist structure and into the source
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32582
diff
changeset
|
133 static GtkActionGroup *accounts_action_group = NULL; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
134 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
135 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
|
136 static GdkVisibilityState gtk_blist_visibility = GDK_VISIBILITY_UNOBSCURED; |
22850
5d833ca5a265
Make pidgin_blist_toggle_visibility() hide the buddy list when it is
Casey Harkins <charkins@pidgin.im>
parents:
22813
diff
changeset
|
137 static gboolean gtk_blist_focused = FALSE; |
17613
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:
17597
diff
changeset
|
138 static gboolean editing_blist = FALSE; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
139 |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
140 static GList *pidgin_blist_sort_methods = NULL; |
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
141 static struct pidgin_blist_sort_method *current_sort_method = NULL; |
15822 | 142 static void sort_method_none(PurpleBlistNode *node, PurpleBuddyList *blist, GtkTreeIter groupiter, GtkTreeIter *cur, GtkTreeIter *iter); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
143 |
15822 | 144 static void sort_method_alphabetical(PurpleBlistNode *node, PurpleBuddyList *blist, GtkTreeIter groupiter, GtkTreeIter *cur, GtkTreeIter *iter); |
145 static void sort_method_status(PurpleBlistNode *node, PurpleBuddyList *blist, GtkTreeIter groupiter, GtkTreeIter *cur, GtkTreeIter *iter); | |
25919
52b2e7260340
A patch from Chris Connett to change the log size sorting method to weight
Richard Laager <rlaager@wiktel.com>
parents:
25912
diff
changeset
|
146 static void sort_method_log_activity(PurpleBlistNode *node, PurpleBuddyList *blist, GtkTreeIter groupiter, GtkTreeIter *cur, GtkTreeIter *iter); |
32583
2bc917bbd07e
Move some UI manager stuff out of the blist structure and into the source
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32582
diff
changeset
|
147 static guint sort_merge_id; |
2bc917bbd07e
Move some UI manager stuff out of the blist structure and into the source
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32582
diff
changeset
|
148 static GtkActionGroup *sort_action_group = NULL; |
2bc917bbd07e
Move some UI manager stuff out of the blist structure and into the source
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32582
diff
changeset
|
149 |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
150 static PidginBuddyList *gtkblist = NULL; |
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
151 |
20028
a2b4eac83902
Part of #1332 to introduce pidgin_text_combo_box_new_entry and
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19681
diff
changeset
|
152 static GList *groups_tree(void); |
15822 | 153 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
|
154 static void pidgin_blist_update_buddy(PurpleBuddyList *list, PurpleBlistNode *node, gboolean status_change); |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
155 static void pidgin_blist_selection_changed(GtkTreeSelection *selection, gpointer data); |
15822 | 156 static void pidgin_blist_update(PurpleBuddyList *list, PurpleBlistNode *node); |
157 static void pidgin_blist_update_group(PurpleBuddyList *list, PurpleBlistNode *node); | |
158 static void pidgin_blist_update_contact(PurpleBuddyList *list, PurpleBlistNode *node); | |
159 static char *pidgin_get_tooltip_text(PurpleBlistNode *node, gboolean full); | |
160 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
|
161 static gboolean buddy_is_displayable(PurpleBuddy *buddy); |
15822 | 162 static void redo_buddy_list(PurpleBuddyList *list, gboolean remove, gboolean rerender); |
163 static void pidgin_blist_collapse_contact_cb(GtkWidget *w, PurpleBlistNode *node); | |
164 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
|
165 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
|
166 static void set_urgent(void); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
167 |
19939
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 typedef enum { |
25898
dc2584ebaa1a
Adding the patch to extend the blist theme to allow coloring of chat nodes with unread messages mentioning your nick.
Paul Aurich <paul@darkrain42.org>
parents:
25896
diff
changeset
|
169 PIDGIN_BLIST_NODE_HAS_PENDING_MESSAGE = 1 << 0, /* Whether there's pending message in a conversation */ |
dc2584ebaa1a
Adding the patch to extend the blist theme to allow coloring of chat nodes with unread messages mentioning your nick.
Paul Aurich <paul@darkrain42.org>
parents:
25896
diff
changeset
|
170 PIDGIN_BLIST_CHAT_HAS_PENDING_MESSAGE_WITH_NICK = 1 << 1, /* Whether there's a pending message in a chat that mentions our nick */ |
19939
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
|
171 } 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
|
172 |
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
|
173 typedef struct _pidgin_blist_node { |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
174 GtkTreeRowReference *row; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
175 gboolean contact_expanded; |
24039
5045f2ce9cff
disapproval of revision 'f5ca7968e3f6be8f81d068232d389e0b1dab784b'
Kevin Stange <kevin@simguy.net>
parents:
24037
diff
changeset
|
176 gboolean recent_signonoff; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
177 gint recent_signonoff_timer; |
19939
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 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
|
179 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
|
180 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
|
181 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
|
182 } 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
|
183 } PidginBlistNode; |
15373
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 /*************************************************** |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
186 * Callbacks * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
187 ***************************************************/ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
188 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
|
189 { |
21041
094bbbe89d0d
Track the actual visibility for the buddy list (unobscured, partially and
Casey Harkins <charkins@pidgin.im>
parents:
21040
diff
changeset
|
190 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
|
191 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
|
192 |
094bbbe89d0d
Track the actual visibility for the buddy list (unobscured, partially and
Casey Harkins <charkins@pidgin.im>
parents:
21040
diff
changeset
|
193 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
|
194 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
|
195 |
094bbbe89d0d
Track the actual visibility for the buddy list (unobscured, partially and
Casey Harkins <charkins@pidgin.im>
parents:
21040
diff
changeset
|
196 /* 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
|
197 pidgin_blist_refresh_timer(purple_get_blist()); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
198 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
199 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
200 /* continue to handle event normally */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
201 return FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
202 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
203 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
204 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
|
205 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
206 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
|
207 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
|
208 purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/blist/list_visible", FALSE); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
209 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
|
210 purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/blist/list_visible", TRUE); |
15822 | 211 pidgin_blist_refresh_timer(purple_get_blist()); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
212 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
213 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
214 |
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_MAXIMIZED) { |
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_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
|
217 purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/blist/list_maximized", TRUE); |
15373
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_maximized", FALSE); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
220 } |
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 /* Refresh gtkblist if un-iconifying */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
223 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
|
224 if (!(event->new_window_state & GDK_WINDOW_STATE_ICONIFIED)) |
15822 | 225 pidgin_blist_refresh_timer(purple_get_blist()); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
226 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
227 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
228 return FALSE; |
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 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
|
232 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
233 if(visibility_manager_count) |
15822 | 234 purple_blist_set_visible(FALSE); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
235 else |
15822 | 236 purple_core_quit(); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
237 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
238 /* 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
|
239 return TRUE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
240 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
241 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
242 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
|
243 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
244 /* unfortunately GdkEventConfigure ignores the window gravity, but * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
245 * 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
|
246 * 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
|
247 * 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
|
248 * to work correctly. - Robot101 */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
249 gint x, y; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
250 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
251 /* 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
|
252 * give us bogus (0,0) coordinates. - xOr */ |
32686
3538e783b98c
Fix all deprecated GTK_WIDGET_* macros.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32684
diff
changeset
|
253 if (gtk_widget_get_visible(w)) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
254 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
|
255 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
256 return FALSE; /* carry on normally */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
257 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
258 #ifdef _WIN32 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
259 /* 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
|
260 * when the window is being maximized */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
261 if (gdk_window_get_state(w->window) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
262 & GDK_WINDOW_STATE_MAXIMIZED) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
263 return FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
264 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
265 #endif |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
266 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
267 /* 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
|
268 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
|
269 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
|
270 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
|
271 event->height == purple_prefs_get_int(PIDGIN_PREFS_ROOT "/blist/height")) { |
15373
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 return FALSE; /* carry on normally */ |
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 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
276 /* don't save off-screen positioning */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
277 if (x + event->width < 0 || |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
278 y + event->height < 0 || |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
279 x > gdk_screen_width() || |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
280 y > gdk_screen_height()) { |
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 return FALSE; /* carry on normally */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
283 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
284 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
285 /* 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
|
286 if(purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/blist/list_maximized")) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
287 return FALSE; |
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 /* 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
|
290 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
|
291 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
|
292 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
|
293 purple_prefs_set_int(PIDGIN_PREFS_ROOT "/blist/height", event->height); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
294 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
295 /* continue to handle event normally */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
296 return FALSE; |
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 |
15822 | 299 static void gtk_blist_menu_info_cb(GtkWidget *w, PurpleBuddy *b) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
300 { |
25822
12e258fb6f3c
Got about a third of the gtkblist.c direct struct usage, much more to go obviously, but i must sleep...
Gary Kramlich <grim@reaperworld.com>
parents:
25820
diff
changeset
|
301 PurpleAccount *account = purple_buddy_get_account(b); |
12e258fb6f3c
Got about a third of the gtkblist.c direct struct usage, much more to go obviously, but i must sleep...
Gary Kramlich <grim@reaperworld.com>
parents:
25820
diff
changeset
|
302 |
12e258fb6f3c
Got about a third of the gtkblist.c direct struct usage, much more to go obviously, but i must sleep...
Gary Kramlich <grim@reaperworld.com>
parents:
25820
diff
changeset
|
303 pidgin_retrieve_user_info(purple_account_get_connection(account), |
12e258fb6f3c
Got about a third of the gtkblist.c direct struct usage, much more to go obviously, but i must sleep...
Gary Kramlich <grim@reaperworld.com>
parents:
25820
diff
changeset
|
304 purple_buddy_get_name(b)); |
15373
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 |
15822 | 307 static void gtk_blist_menu_im_cb(GtkWidget *w, PurpleBuddy *b) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
308 { |
25822
12e258fb6f3c
Got about a third of the gtkblist.c direct struct usage, much more to go obviously, but i must sleep...
Gary Kramlich <grim@reaperworld.com>
parents:
25820
diff
changeset
|
309 pidgin_dialogs_im_with_user(purple_buddy_get_account(b), |
12e258fb6f3c
Got about a third of the gtkblist.c direct struct usage, much more to go obviously, but i must sleep...
Gary Kramlich <grim@reaperworld.com>
parents:
25820
diff
changeset
|
310 purple_buddy_get_name(b)); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
311 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
312 |
24959
e5da7110bec9
Added menu items to buddy list context menu to start voice and video sessions
Marcus Lundblad <ml@update.uu.se>
parents:
24359
diff
changeset
|
313 #ifdef USE_VV |
e5da7110bec9
Added menu items to buddy list context menu to start voice and video sessions
Marcus Lundblad <ml@update.uu.se>
parents:
24359
diff
changeset
|
314 static void gtk_blist_menu_audio_call_cb(GtkWidget *w, PurpleBuddy *b) |
e5da7110bec9
Added menu items to buddy list context menu to start voice and video sessions
Marcus Lundblad <ml@update.uu.se>
parents:
24359
diff
changeset
|
315 { |
26040
5d9a97a23d6e
Remove some of the deprecated API.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26028
diff
changeset
|
316 purple_prpl_initiate_media(purple_buddy_get_account(b), |
24959
e5da7110bec9
Added menu items to buddy list context menu to start voice and video sessions
Marcus Lundblad <ml@update.uu.se>
parents:
24359
diff
changeset
|
317 purple_buddy_get_name(b), PURPLE_MEDIA_AUDIO); |
e5da7110bec9
Added menu items to buddy list context menu to start voice and video sessions
Marcus Lundblad <ml@update.uu.se>
parents:
24359
diff
changeset
|
318 } |
e5da7110bec9
Added menu items to buddy list context menu to start voice and video sessions
Marcus Lundblad <ml@update.uu.se>
parents:
24359
diff
changeset
|
319 |
e5da7110bec9
Added menu items to buddy list context menu to start voice and video sessions
Marcus Lundblad <ml@update.uu.se>
parents:
24359
diff
changeset
|
320 static void gtk_blist_menu_video_call_cb(GtkWidget *w, PurpleBuddy *b) |
e5da7110bec9
Added menu items to buddy list context menu to start voice and video sessions
Marcus Lundblad <ml@update.uu.se>
parents:
24359
diff
changeset
|
321 { |
e5da7110bec9
Added menu items to buddy list context menu to start voice and video sessions
Marcus Lundblad <ml@update.uu.se>
parents:
24359
diff
changeset
|
322 /* if the buddy supports both audio and video, start a combined call, |
e5da7110bec9
Added menu items to buddy list context menu to start voice and video sessions
Marcus Lundblad <ml@update.uu.se>
parents:
24359
diff
changeset
|
323 otherwise start a pure video session */ |
26108
d6e23439b77c
Change purple_prpl_can_do_media to purple_prpl_get_media_caps.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26068
diff
changeset
|
324 if (purple_prpl_get_media_caps(purple_buddy_get_account(b), |
d6e23439b77c
Change purple_prpl_can_do_media to purple_prpl_get_media_caps.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26068
diff
changeset
|
325 purple_buddy_get_name(b)) & |
d6e23439b77c
Change purple_prpl_can_do_media to purple_prpl_get_media_caps.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26068
diff
changeset
|
326 PURPLE_MEDIA_CAPS_AUDIO_VIDEO) { |
26040
5d9a97a23d6e
Remove some of the deprecated API.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26028
diff
changeset
|
327 purple_prpl_initiate_media(purple_buddy_get_account(b), |
24959
e5da7110bec9
Added menu items to buddy list context menu to start voice and video sessions
Marcus Lundblad <ml@update.uu.se>
parents:
24359
diff
changeset
|
328 purple_buddy_get_name(b), PURPLE_MEDIA_AUDIO | PURPLE_MEDIA_VIDEO); |
e5da7110bec9
Added menu items to buddy list context menu to start voice and video sessions
Marcus Lundblad <ml@update.uu.se>
parents:
24359
diff
changeset
|
329 } else { |
26040
5d9a97a23d6e
Remove some of the deprecated API.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26028
diff
changeset
|
330 purple_prpl_initiate_media(purple_buddy_get_account(b), |
24959
e5da7110bec9
Added menu items to buddy list context menu to start voice and video sessions
Marcus Lundblad <ml@update.uu.se>
parents:
24359
diff
changeset
|
331 purple_buddy_get_name(b), PURPLE_MEDIA_VIDEO); |
e5da7110bec9
Added menu items to buddy list context menu to start voice and video sessions
Marcus Lundblad <ml@update.uu.se>
parents:
24359
diff
changeset
|
332 } |
e5da7110bec9
Added menu items to buddy list context menu to start voice and video sessions
Marcus Lundblad <ml@update.uu.se>
parents:
24359
diff
changeset
|
333 } |
e5da7110bec9
Added menu items to buddy list context menu to start voice and video sessions
Marcus Lundblad <ml@update.uu.se>
parents:
24359
diff
changeset
|
334 |
e5da7110bec9
Added menu items to buddy list context menu to start voice and video sessions
Marcus Lundblad <ml@update.uu.se>
parents:
24359
diff
changeset
|
335 #endif |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
336 |
15822 | 337 static void gtk_blist_menu_send_file_cb(GtkWidget *w, PurpleBuddy *b) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
338 { |
25822
12e258fb6f3c
Got about a third of the gtkblist.c direct struct usage, much more to go obviously, but i must sleep...
Gary Kramlich <grim@reaperworld.com>
parents:
25820
diff
changeset
|
339 PurpleAccount *account = purple_buddy_get_account(b); |
12e258fb6f3c
Got about a third of the gtkblist.c direct struct usage, much more to go obviously, but i must sleep...
Gary Kramlich <grim@reaperworld.com>
parents:
25820
diff
changeset
|
340 |
12e258fb6f3c
Got about a third of the gtkblist.c direct struct usage, much more to go obviously, but i must sleep...
Gary Kramlich <grim@reaperworld.com>
parents:
25820
diff
changeset
|
341 serv_send_file(purple_account_get_connection(account), |
12e258fb6f3c
Got about a third of the gtkblist.c direct struct usage, much more to go obviously, but i must sleep...
Gary Kramlich <grim@reaperworld.com>
parents:
25820
diff
changeset
|
342 purple_buddy_get_name(b), NULL); |
15373
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 |
15822 | 352 static void gtk_blist_menu_autojoin_cb(GtkWidget *w, PurpleChat *chat) |
353 { | |
32350
cd46874707b1
Pidgin: Use the purple_blist_node_ accessor functions.
andrew.victor@mxit.com
parents:
32347
diff
changeset
|
354 purple_blist_node_set_bool(PURPLE_BLIST_NODE(chat), "gtk-autojoin", |
15373
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 |
19945
ee5b3ac0d41d
"We are going to destroy the conversations immediately only if the 'close immediately'
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19944
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:
19944
diff
changeset
|
359 { |
32350
cd46874707b1
Pidgin: Use the purple_blist_node_ accessor functions.
andrew.victor@mxit.com
parents:
32347
diff
changeset
|
360 purple_blist_node_set_bool(PURPLE_BLIST_NODE(chat), "gtk-persistent", |
19945
ee5b3ac0d41d
"We are going to destroy the conversations immediately only if the 'close immediately'
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19944
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:
19944
diff
changeset
|
362 } |
ee5b3ac0d41d
"We are going to destroy the conversations immediately only if the 'close immediately'
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19944
diff
changeset
|
363 |
19939
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 { |
25822
12e258fb6f3c
Got about a third of the gtkblist.c direct struct usage, much more to go obviously, but i must sleep...
Gary Kramlich <grim@reaperworld.com>
parents:
25820
diff
changeset
|
367 PidginBlistNode *ui = purple_blist_node_get_ui_data(PURPLE_BLIST_NODE(buddy)); |
19939
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 |
15822 | 375 static void gtk_blist_join_chat(PurpleChat *chat) |
376 { | |
25822
12e258fb6f3c
Got about a third of the gtkblist.c direct struct usage, much more to go obviously, but i must sleep...
Gary Kramlich <grim@reaperworld.com>
parents:
25820
diff
changeset
|
377 PurpleAccount *account; |
15822 | 378 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
|
379 PurplePluginProtocolInfo *prpl_info; |
25822
12e258fb6f3c
Got about a third of the gtkblist.c direct struct usage, much more to go obviously, but i must sleep...
Gary Kramlich <grim@reaperworld.com>
parents:
25820
diff
changeset
|
380 GHashTable *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
|
381 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
|
382 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
|
383 |
25822
12e258fb6f3c
Got about a third of the gtkblist.c direct struct usage, much more to go obviously, but i must sleep...
Gary Kramlich <grim@reaperworld.com>
parents:
25820
diff
changeset
|
384 account = purple_chat_get_account(chat); |
12e258fb6f3c
Got about a third of the gtkblist.c direct struct usage, much more to go obviously, but i must sleep...
Gary Kramlich <grim@reaperworld.com>
parents:
25820
diff
changeset
|
385 prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(purple_find_prpl(purple_account_get_protocol_id(account))); |
12e258fb6f3c
Got about a third of the gtkblist.c direct struct usage, much more to go obviously, but i must sleep...
Gary Kramlich <grim@reaperworld.com>
parents:
25820
diff
changeset
|
386 |
12e258fb6f3c
Got about a third of the gtkblist.c direct struct usage, much more to go obviously, but i must sleep...
Gary Kramlich <grim@reaperworld.com>
parents:
25820
diff
changeset
|
387 components = purple_chat_get_components(chat); |
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
|
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 (prpl_info && prpl_info->get_chat_name) |
25822
12e258fb6f3c
Got about a third of the gtkblist.c direct struct usage, much more to go obviously, but i must sleep...
Gary Kramlich <grim@reaperworld.com>
parents:
25820
diff
changeset
|
390 chat_name = prpl_info->get_chat_name(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
|
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 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
|
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 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
|
395 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
|
396 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
|
397 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
|
398 |
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
|
399 conv = purple_find_conversation_with_account(PURPLE_CONV_TYPE_CHAT, name, |
25822
12e258fb6f3c
Got about a third of the gtkblist.c direct struct usage, much more to go obviously, but i must sleep...
Gary Kramlich <grim@reaperworld.com>
parents:
25820
diff
changeset
|
400 account); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
401 |
19415
2128daf52d31
Reattach the gtk-ui to a conversation when the user wants to
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19363
diff
changeset
|
402 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
|
403 pidgin_conv_attach_to_conversation(conv); |
15822 | 404 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
|
405 } |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
406 |
25822
12e258fb6f3c
Got about a third of the gtkblist.c direct struct usage, much more to go obviously, but i must sleep...
Gary Kramlich <grim@reaperworld.com>
parents:
25820
diff
changeset
|
407 serv_join_chat(purple_account_get_connection(account), 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
|
408 g_free(chat_name); |
15373
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 |
15822 | 411 static void gtk_blist_menu_join_cb(GtkWidget *w, PurpleChat *chat) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
412 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
413 gtk_blist_join_chat(chat); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
414 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
415 |
17613
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:
17597
diff
changeset
|
416 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:
17597
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:
17597
diff
changeset
|
418 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
|
419 g_object_set(G_OBJECT(renderer), "editable", FALSE, NULL); |
17613
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:
17597
diff
changeset
|
420 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:
17597
diff
changeset
|
421 } |
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:
17597
diff
changeset
|
422 |
16275
9a4854d71234
Patch #205, from SuperMMX. Fix a bug related to using F2 to alias
Mark Doliner <mark@kingant.net>
parents:
16222
diff
changeset
|
423 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
|
424 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
|
425 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
|
426 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
|
427 { |
9a4854d71234
Patch #205, from SuperMMX. Fix a bug related to using F2 to alias
Mark Doliner <mark@kingant.net>
parents:
16222
diff
changeset
|
428 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
|
429 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
|
430 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
|
431 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
|
432 |
9a4854d71234
Patch #205, from SuperMMX. Fix a bug related to using F2 to alias
Mark Doliner <mark@kingant.net>
parents:
16222
diff
changeset
|
433 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
|
434 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
|
435 gtk_tree_path_free (path); |
31096
b76def85cc04
gtkblist: Fix a few memory leaks. Refs #13162.
morshed.nader@gmail.com
parents:
31086
diff
changeset
|
436 gtk_tree_model_get(GTK_TREE_MODEL(gtkblist->treemodel), &iter, NODE_COLUMN, &node, -1); |
16275
9a4854d71234
Patch #205, from SuperMMX. Fix a bug related to using F2 to alias
Mark Doliner <mark@kingant.net>
parents:
16222
diff
changeset
|
437 |
25822
12e258fb6f3c
Got about a third of the gtkblist.c direct struct usage, much more to go obviously, but i must sleep...
Gary Kramlich <grim@reaperworld.com>
parents:
25820
diff
changeset
|
438 switch (purple_blist_node_get_type(node)) { |
16275
9a4854d71234
Patch #205, from SuperMMX. Fix a bug related to using F2 to alias
Mark Doliner <mark@kingant.net>
parents:
16222
diff
changeset
|
439 case PURPLE_BLIST_CONTACT_NODE: |
25822
12e258fb6f3c
Got about a third of the gtkblist.c direct struct usage, much more to go obviously, but i must sleep...
Gary Kramlich <grim@reaperworld.com>
parents:
25820
diff
changeset
|
440 text = purple_contact_get_alias(PURPLE_CONTACT(node)); |
16275
9a4854d71234
Patch #205, from SuperMMX. Fix a bug related to using F2 to alias
Mark Doliner <mark@kingant.net>
parents:
16222
diff
changeset
|
441 break; |
9a4854d71234
Patch #205, from SuperMMX. Fix a bug related to using F2 to alias
Mark Doliner <mark@kingant.net>
parents:
16222
diff
changeset
|
442 case PURPLE_BLIST_BUDDY_NODE: |
25822
12e258fb6f3c
Got about a third of the gtkblist.c direct struct usage, much more to go obviously, but i must sleep...
Gary Kramlich <grim@reaperworld.com>
parents:
25820
diff
changeset
|
443 text = purple_buddy_get_alias(PURPLE_BUDDY(node)); |
16275
9a4854d71234
Patch #205, from SuperMMX. Fix a bug related to using F2 to alias
Mark Doliner <mark@kingant.net>
parents:
16222
diff
changeset
|
444 break; |
9a4854d71234
Patch #205, from SuperMMX. Fix a bug related to using F2 to alias
Mark Doliner <mark@kingant.net>
parents:
16222
diff
changeset
|
445 case PURPLE_BLIST_GROUP_NODE: |
25822
12e258fb6f3c
Got about a third of the gtkblist.c direct struct usage, much more to go obviously, but i must sleep...
Gary Kramlich <grim@reaperworld.com>
parents:
25820
diff
changeset
|
446 text = purple_group_get_name(PURPLE_GROUP(node)); |
16275
9a4854d71234
Patch #205, from SuperMMX. Fix a bug related to using F2 to alias
Mark Doliner <mark@kingant.net>
parents:
16222
diff
changeset
|
447 break; |
28921
2930170ca3c0
We allow aliasing chats. So don't show an error message when we try to.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
28434
diff
changeset
|
448 case PURPLE_BLIST_CHAT_NODE: |
2930170ca3c0
We allow aliasing chats. So don't show an error message when we try to.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
28434
diff
changeset
|
449 text = purple_chat_get_name(PURPLE_CHAT(node)); |
2930170ca3c0
We allow aliasing chats. So don't show an error message when we try to.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
28434
diff
changeset
|
450 break; |
16275
9a4854d71234
Patch #205, from SuperMMX. Fix a bug related to using F2 to alias
Mark Doliner <mark@kingant.net>
parents:
16222
diff
changeset
|
451 default: |
9a4854d71234
Patch #205, from SuperMMX. Fix a bug related to using F2 to alias
Mark Doliner <mark@kingant.net>
parents:
16222
diff
changeset
|
452 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
|
453 } |
9a4854d71234
Patch #205, from SuperMMX. Fix a bug related to using F2 to alias
Mark Doliner <mark@kingant.net>
parents:
16222
diff
changeset
|
454 |
9a4854d71234
Patch #205, from SuperMMX. Fix a bug related to using F2 to alias
Mark Doliner <mark@kingant.net>
parents:
16222
diff
changeset
|
455 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
|
456 GtkEntry *entry = GTK_ENTRY (editable); |
17035
0be41b604566
Patch #702, Info not reset on URL redirect
Sean Egan <seanegan@gmail.com>
parents:
17033
diff
changeset
|
457 gtk_entry_set_text(entry, text); |
0be41b604566
Patch #702, Info not reset on URL redirect
Sean Egan <seanegan@gmail.com>
parents:
17033
diff
changeset
|
458 } |
17613
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:
17597
diff
changeset
|
459 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
|
460 } |
9a4854d71234
Patch #205, from SuperMMX. Fix a bug related to using F2 to alias
Mark Doliner <mark@kingant.net>
parents:
16222
diff
changeset
|
461 |
20043
4d278e98b5ac
Auto-personization. Closes #44
Sean Egan <seanegan@gmail.com>
parents:
20042
diff
changeset
|
462 static void |
4d278e98b5ac
Auto-personization. Closes #44
Sean Egan <seanegan@gmail.com>
parents:
20042
diff
changeset
|
463 gtk_blist_do_personize(GList *merges) |
4d278e98b5ac
Auto-personization. Closes #44
Sean Egan <seanegan@gmail.com>
parents:
20042
diff
changeset
|
464 { |
4d278e98b5ac
Auto-personization. Closes #44
Sean Egan <seanegan@gmail.com>
parents:
20042
diff
changeset
|
465 PurpleBlistNode *contact = NULL; |
4d278e98b5ac
Auto-personization. Closes #44
Sean Egan <seanegan@gmail.com>
parents:
20042
diff
changeset
|
466 int max = 0; |
4d278e98b5ac
Auto-personization. Closes #44
Sean Egan <seanegan@gmail.com>
parents:
20042
diff
changeset
|
467 GList *tmp; |
4d278e98b5ac
Auto-personization. Closes #44
Sean Egan <seanegan@gmail.com>
parents:
20042
diff
changeset
|
468 |
4d278e98b5ac
Auto-personization. Closes #44
Sean Egan <seanegan@gmail.com>
parents:
20042
diff
changeset
|
469 /* 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
|
470 * 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
|
471 * by which contact is higher in the list |
4d278e98b5ac
Auto-personization. Closes #44
Sean Egan <seanegan@gmail.com>
parents:
20042
diff
changeset
|
472 */ |
4d278e98b5ac
Auto-personization. Closes #44
Sean Egan <seanegan@gmail.com>
parents:
20042
diff
changeset
|
473 for (tmp = merges; tmp; tmp = tmp->next) { |
4d278e98b5ac
Auto-personization. Closes #44
Sean Egan <seanegan@gmail.com>
parents:
20042
diff
changeset
|
474 PurpleBlistNode *node = tmp->data; |
4d278e98b5ac
Auto-personization. Closes #44
Sean Egan <seanegan@gmail.com>
parents:
20042
diff
changeset
|
475 PurpleBlistNode *b; |
25822
12e258fb6f3c
Got about a third of the gtkblist.c direct struct usage, much more to go obviously, but i must sleep...
Gary Kramlich <grim@reaperworld.com>
parents:
25820
diff
changeset
|
476 PurpleBlistNodeType type; |
20043
4d278e98b5ac
Auto-personization. Closes #44
Sean Egan <seanegan@gmail.com>
parents:
20042
diff
changeset
|
477 int i = 0; |
4d278e98b5ac
Auto-personization. Closes #44
Sean Egan <seanegan@gmail.com>
parents:
20042
diff
changeset
|
478 |
25822
12e258fb6f3c
Got about a third of the gtkblist.c direct struct usage, much more to go obviously, but i must sleep...
Gary Kramlich <grim@reaperworld.com>
parents:
25820
diff
changeset
|
479 type = purple_blist_node_get_type(node); |
12e258fb6f3c
Got about a third of the gtkblist.c direct struct usage, much more to go obviously, but i must sleep...
Gary Kramlich <grim@reaperworld.com>
parents:
25820
diff
changeset
|
480 |
28097
572073acf8e7
I think this was the optimization they wanted when this first broke.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28092
diff
changeset
|
481 if (type == PURPLE_BLIST_BUDDY_NODE) { |
25822
12e258fb6f3c
Got about a third of the gtkblist.c direct struct usage, much more to go obviously, but i must sleep...
Gary Kramlich <grim@reaperworld.com>
parents:
25820
diff
changeset
|
482 node = purple_blist_node_get_parent(node); |
28097
572073acf8e7
I think this was the optimization they wanted when this first broke.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28092
diff
changeset
|
483 type = purple_blist_node_get_type(node); |
572073acf8e7
I think this was the optimization they wanted when this first broke.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28092
diff
changeset
|
484 } |
572073acf8e7
I think this was the optimization they wanted when this first broke.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28092
diff
changeset
|
485 |
572073acf8e7
I think this was the optimization they wanted when this first broke.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28092
diff
changeset
|
486 if (type != PURPLE_BLIST_CONTACT_NODE) |
20043
4d278e98b5ac
Auto-personization. Closes #44
Sean Egan <seanegan@gmail.com>
parents:
20042
diff
changeset
|
487 continue; |
25822
12e258fb6f3c
Got about a third of the gtkblist.c direct struct usage, much more to go obviously, but i must sleep...
Gary Kramlich <grim@reaperworld.com>
parents:
25820
diff
changeset
|
488 |
12e258fb6f3c
Got about a third of the gtkblist.c direct struct usage, much more to go obviously, but i must sleep...
Gary Kramlich <grim@reaperworld.com>
parents:
25820
diff
changeset
|
489 for (b = purple_blist_node_get_first_child(node); |
12e258fb6f3c
Got about a third of the gtkblist.c direct struct usage, much more to go obviously, but i must sleep...
Gary Kramlich <grim@reaperworld.com>
parents:
25820
diff
changeset
|
490 b; |
12e258fb6f3c
Got about a third of the gtkblist.c direct struct usage, much more to go obviously, but i must sleep...
Gary Kramlich <grim@reaperworld.com>
parents:
25820
diff
changeset
|
491 b = purple_blist_node_get_sibling_next(b)) |
12e258fb6f3c
Got about a third of the gtkblist.c direct struct usage, much more to go obviously, but i must sleep...
Gary Kramlich <grim@reaperworld.com>
parents:
25820
diff
changeset
|
492 { |
20043
4d278e98b5ac
Auto-personization. Closes #44
Sean Egan <seanegan@gmail.com>
parents:
20042
diff
changeset
|
493 i++; |
25822
12e258fb6f3c
Got about a third of the gtkblist.c direct struct usage, much more to go obviously, but i must sleep...
Gary Kramlich <grim@reaperworld.com>
parents:
25820
diff
changeset
|
494 } |
12e258fb6f3c
Got about a third of the gtkblist.c direct struct usage, much more to go obviously, but i must sleep...
Gary Kramlich <grim@reaperworld.com>
parents:
25820
diff
changeset
|
495 |
20043
4d278e98b5ac
Auto-personization. Closes #44
Sean Egan <seanegan@gmail.com>
parents:
20042
diff
changeset
|
496 if (i > max) { |
4d278e98b5ac
Auto-personization. Closes #44
Sean Egan <seanegan@gmail.com>
parents:
20042
diff
changeset
|
497 contact = node; |
4d278e98b5ac
Auto-personization. Closes #44
Sean Egan <seanegan@gmail.com>
parents:
20042
diff
changeset
|
498 max = i; |
4d278e98b5ac
Auto-personization. Closes #44
Sean Egan <seanegan@gmail.com>
parents:
20042
diff
changeset
|
499 } |
4d278e98b5ac
Auto-personization. Closes #44
Sean Egan <seanegan@gmail.com>
parents:
20042
diff
changeset
|
500 } |
4d278e98b5ac
Auto-personization. Closes #44
Sean Egan <seanegan@gmail.com>
parents:
20042
diff
changeset
|
501 |
4d278e98b5ac
Auto-personization. Closes #44
Sean Egan <seanegan@gmail.com>
parents:
20042
diff
changeset
|
502 if (contact == NULL) |
4d278e98b5ac
Auto-personization. Closes #44
Sean Egan <seanegan@gmail.com>
parents:
20042
diff
changeset
|
503 return; |
4d278e98b5ac
Auto-personization. Closes #44
Sean Egan <seanegan@gmail.com>
parents:
20042
diff
changeset
|
504 |
4d278e98b5ac
Auto-personization. Closes #44
Sean Egan <seanegan@gmail.com>
parents:
20042
diff
changeset
|
505 /* Merge all those buddies into this contact */ |
4d278e98b5ac
Auto-personization. Closes #44
Sean Egan <seanegan@gmail.com>
parents:
20042
diff
changeset
|
506 for (tmp = merges; tmp; tmp = tmp->next) { |
4d278e98b5ac
Auto-personization. Closes #44
Sean Egan <seanegan@gmail.com>
parents:
20042
diff
changeset
|
507 PurpleBlistNode *node = tmp->data; |
25822
12e258fb6f3c
Got about a third of the gtkblist.c direct struct usage, much more to go obviously, but i must sleep...
Gary Kramlich <grim@reaperworld.com>
parents:
25820
diff
changeset
|
508 if (purple_blist_node_get_type(node) == PURPLE_BLIST_BUDDY_NODE) |
12e258fb6f3c
Got about a third of the gtkblist.c direct struct usage, much more to go obviously, but i must sleep...
Gary Kramlich <grim@reaperworld.com>
parents:
25820
diff
changeset
|
509 node = purple_blist_node_get_parent(node); |
20043
4d278e98b5ac
Auto-personization. Closes #44
Sean Egan <seanegan@gmail.com>
parents:
20042
diff
changeset
|
510 |
4d278e98b5ac
Auto-personization. Closes #44
Sean Egan <seanegan@gmail.com>
parents:
20042
diff
changeset
|
511 if (node == contact) |
4d278e98b5ac
Auto-personization. Closes #44
Sean Egan <seanegan@gmail.com>
parents:
20042
diff
changeset
|
512 continue; |
4d278e98b5ac
Auto-personization. Closes #44
Sean Egan <seanegan@gmail.com>
parents:
20042
diff
changeset
|
513 |
20099
ac6bf49cd5ba
Various warning fixes and a small leak fix.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20084
diff
changeset
|
514 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
|
515 } |
ac6bf49cd5ba
Various warning fixes and a small leak fix.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20084
diff
changeset
|
516 |
20043
4d278e98b5ac
Auto-personization. Closes #44
Sean Egan <seanegan@gmail.com>
parents:
20042
diff
changeset
|
517 /* 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
|
518 pidgin_blist_expand_contact_cb(NULL, contact); |
4d278e98b5ac
Auto-personization. Closes #44
Sean Egan <seanegan@gmail.com>
parents:
20042
diff
changeset
|
519 g_list_free(merges); |
4d278e98b5ac
Auto-personization. Closes #44
Sean Egan <seanegan@gmail.com>
parents:
20042
diff
changeset
|
520 } |
4d278e98b5ac
Auto-personization. Closes #44
Sean Egan <seanegan@gmail.com>
parents:
20042
diff
changeset
|
521 |
4d278e98b5ac
Auto-personization. Closes #44
Sean Egan <seanegan@gmail.com>
parents:
20042
diff
changeset
|
522 static void |
4d278e98b5ac
Auto-personization. Closes #44
Sean Egan <seanegan@gmail.com>
parents:
20042
diff
changeset
|
523 gtk_blist_auto_personize(PurpleBlistNode *group, const char *alias) |
4d278e98b5ac
Auto-personization. Closes #44
Sean Egan <seanegan@gmail.com>
parents:
20042
diff
changeset
|
524 { |
4d278e98b5ac
Auto-personization. Closes #44
Sean Egan <seanegan@gmail.com>
parents:
20042
diff
changeset
|
525 PurpleBlistNode *contact; |
4d278e98b5ac
Auto-personization. Closes #44
Sean Egan <seanegan@gmail.com>
parents:
20042
diff
changeset
|
526 PurpleBlistNode *buddy; |
4d278e98b5ac
Auto-personization. Closes #44
Sean Egan <seanegan@gmail.com>
parents:
20042
diff
changeset
|
527 GList *merges = NULL; |
4d278e98b5ac
Auto-personization. Closes #44
Sean Egan <seanegan@gmail.com>
parents:
20042
diff
changeset
|
528 int i = 0; |
4d278e98b5ac
Auto-personization. Closes #44
Sean Egan <seanegan@gmail.com>
parents:
20042
diff
changeset
|
529 char *a = g_utf8_casefold(alias, -1); |
4d278e98b5ac
Auto-personization. Closes #44
Sean Egan <seanegan@gmail.com>
parents:
20042
diff
changeset
|
530 |
25820
43aeab2bb50e
A totally untested struct hiding fix.
Richard Laager <rlaager@wiktel.com>
parents:
25805
diff
changeset
|
531 for (contact = purple_blist_node_get_first_child(group); |
43aeab2bb50e
A totally untested struct hiding fix.
Richard Laager <rlaager@wiktel.com>
parents:
25805
diff
changeset
|
532 contact != NULL; |
43aeab2bb50e
A totally untested struct hiding fix.
Richard Laager <rlaager@wiktel.com>
parents:
25805
diff
changeset
|
533 contact = purple_blist_node_get_sibling_next(contact)) { |
20043
4d278e98b5ac
Auto-personization. Closes #44
Sean Egan <seanegan@gmail.com>
parents:
20042
diff
changeset
|
534 char *node_alias; |
25820
43aeab2bb50e
A totally untested struct hiding fix.
Richard Laager <rlaager@wiktel.com>
parents:
25805
diff
changeset
|
535 if (purple_blist_node_get_type(contact) != PURPLE_BLIST_CONTACT_NODE) |
20043
4d278e98b5ac
Auto-personization. Closes #44
Sean Egan <seanegan@gmail.com>
parents:
20042
diff
changeset
|
536 continue; |
20099
ac6bf49cd5ba
Various warning fixes and a small leak fix.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20084
diff
changeset
|
537 |
ac6bf49cd5ba
Various warning fixes and a small leak fix.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20084
diff
changeset
|
538 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
|
539 if (node_alias && !g_utf8_collate(node_alias, a)) { |
4d278e98b5ac
Auto-personization. Closes #44
Sean Egan <seanegan@gmail.com>
parents:
20042
diff
changeset
|
540 merges = g_list_append(merges, contact); |
4d278e98b5ac
Auto-personization. Closes #44
Sean Egan <seanegan@gmail.com>
parents:
20042
diff
changeset
|
541 i++; |
4d278e98b5ac
Auto-personization. Closes #44
Sean Egan <seanegan@gmail.com>
parents:
20042
diff
changeset
|
542 g_free(node_alias); |
4d278e98b5ac
Auto-personization. Closes #44
Sean Egan <seanegan@gmail.com>
parents:
20042
diff
changeset
|
543 continue; |
4d278e98b5ac
Auto-personization. Closes #44
Sean Egan <seanegan@gmail.com>
parents:
20042
diff
changeset
|
544 } |
4d278e98b5ac
Auto-personization. Closes #44
Sean Egan <seanegan@gmail.com>
parents:
20042
diff
changeset
|
545 g_free(node_alias); |
4d278e98b5ac
Auto-personization. Closes #44
Sean Egan <seanegan@gmail.com>
parents:
20042
diff
changeset
|
546 |
25822
12e258fb6f3c
Got about a third of the gtkblist.c direct struct usage, much more to go obviously, but i must sleep...
Gary Kramlich <grim@reaperworld.com>
parents:
25820
diff
changeset
|
547 for (buddy = purple_blist_node_get_first_child(contact); |
12e258fb6f3c
Got about a third of the gtkblist.c direct struct usage, much more to go obviously, but i must sleep...
Gary Kramlich <grim@reaperworld.com>
parents:
25820
diff
changeset
|
548 buddy; |
12e258fb6f3c
Got about a third of the gtkblist.c direct struct usage, much more to go obviously, but i must sleep...
Gary Kramlich <grim@reaperworld.com>
parents:
25820
diff
changeset
|
549 buddy = purple_blist_node_get_sibling_next(buddy)) |
12e258fb6f3c
Got about a third of the gtkblist.c direct struct usage, much more to go obviously, but i must sleep...
Gary Kramlich <grim@reaperworld.com>
parents:
25820
diff
changeset
|
550 { |
12e258fb6f3c
Got about a third of the gtkblist.c direct struct usage, much more to go obviously, but i must sleep...
Gary Kramlich <grim@reaperworld.com>
parents:
25820
diff
changeset
|
551 if (purple_blist_node_get_type(buddy) != PURPLE_BLIST_BUDDY_NODE) |
20043
4d278e98b5ac
Auto-personization. Closes #44
Sean Egan <seanegan@gmail.com>
parents:
20042
diff
changeset
|
552 continue; |
20099
ac6bf49cd5ba
Various warning fixes and a small leak fix.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20084
diff
changeset
|
553 |
25822
12e258fb6f3c
Got about a third of the gtkblist.c direct struct usage, much more to go obviously, but i must sleep...
Gary Kramlich <grim@reaperworld.com>
parents:
25820
diff
changeset
|
554 node_alias = g_utf8_casefold(purple_buddy_get_alias(PURPLE_BUDDY(buddy)), -1); |
20043
4d278e98b5ac
Auto-personization. Closes #44
Sean Egan <seanegan@gmail.com>
parents:
20042
diff
changeset
|
555 if (node_alias && !g_utf8_collate(node_alias, a)) { |
4d278e98b5ac
Auto-personization. Closes #44
Sean Egan <seanegan@gmail.com>
parents:
20042
diff
changeset
|
556 merges = g_list_append(merges, buddy); |
4d278e98b5ac
Auto-personization. Closes #44
Sean Egan <seanegan@gmail.com>
parents:
20042
diff
changeset
|
557 i++; |
21932
f82c94a72f5f
Do not prompt for an already merged contact. Fixes #4285.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21931
diff
changeset
|
558 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
|
559 break; |
20043
4d278e98b5ac
Auto-personization. Closes #44
Sean Egan <seanegan@gmail.com>
parents:
20042
diff
changeset
|
560 } |
4d278e98b5ac
Auto-personization. Closes #44
Sean Egan <seanegan@gmail.com>
parents:
20042
diff
changeset
|
561 g_free(node_alias); |
4d278e98b5ac
Auto-personization. Closes #44
Sean Egan <seanegan@gmail.com>
parents:
20042
diff
changeset
|
562 } |
4d278e98b5ac
Auto-personization. Closes #44
Sean Egan <seanegan@gmail.com>
parents:
20042
diff
changeset
|
563 } |
4d278e98b5ac
Auto-personization. Closes #44
Sean Egan <seanegan@gmail.com>
parents:
20042
diff
changeset
|
564 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
|
565 |
20043
4d278e98b5ac
Auto-personization. Closes #44
Sean Egan <seanegan@gmail.com>
parents:
20042
diff
changeset
|
566 if (i > 1) |
20082
90b5255f0a30
In the auto-personize code:
Richard Laager <rlaager@wiktel.com>
parents:
20059
diff
changeset
|
567 { |
20158 | 568 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
|
569 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
|
570 "You can separate them again by choosing 'Expand' from the contact's context menu"), 0, NULL, NULL, NULL, |
22490
f54a1f4f2963
I think "Yes" and "No" are better answers to "Would you like to merge these
Stu Tomlinson <stu@nosnilmot.com>
parents:
22484
diff
changeset
|
571 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
|
572 g_free(msg); |
20099
ac6bf49cd5ba
Various warning fixes and a small leak fix.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20084
diff
changeset
|
573 } else |
ac6bf49cd5ba
Various warning fixes and a small leak fix.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20084
diff
changeset
|
574 g_list_free(merges); |
20043
4d278e98b5ac
Auto-personization. Closes #44
Sean Egan <seanegan@gmail.com>
parents:
20042
diff
changeset
|
575 } |
4d278e98b5ac
Auto-personization. Closes #44
Sean Egan <seanegan@gmail.com>
parents:
20042
diff
changeset
|
576 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
577 static void gtk_blist_renderer_edited_cb(GtkCellRendererText *text_rend, char *arg1, |
17613
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:
17597
diff
changeset
|
578 char *arg2, PurpleBuddyList *list) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
579 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
580 GtkTreeIter iter; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
581 GtkTreePath *path; |
15822 | 582 PurpleBlistNode *node; |
583 PurpleGroup *dest; | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
584 |
17613
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:
17597
diff
changeset
|
585 editing_blist = FALSE; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
586 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
|
587 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
|
588 gtk_tree_path_free (path); |
31096
b76def85cc04
gtkblist: Fix a few memory leaks. Refs #13162.
morshed.nader@gmail.com
parents:
31086
diff
changeset
|
589 gtk_tree_model_get(GTK_TREE_MODEL(gtkblist->treemodel), &iter, NODE_COLUMN, &node, -1); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
590 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
|
591 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
|
592 |
25822
12e258fb6f3c
Got about a third of the gtkblist.c direct struct usage, much more to go obviously, but i must sleep...
Gary Kramlich <grim@reaperworld.com>
parents:
25820
diff
changeset
|
593 switch (purple_blist_node_get_type(node)) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
594 { |
15822 | 595 case PURPLE_BLIST_CONTACT_NODE: |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
596 { |
25822
12e258fb6f3c
Got about a third of the gtkblist.c direct struct usage, much more to go obviously, but i must sleep...
Gary Kramlich <grim@reaperworld.com>
parents:
25820
diff
changeset
|
597 PurpleContact *contact = PURPLE_CONTACT(node); |
12e258fb6f3c
Got about a third of the gtkblist.c direct struct usage, much more to go obviously, but i must sleep...
Gary Kramlich <grim@reaperworld.com>
parents:
25820
diff
changeset
|
598 struct _pidgin_blist_node *gtknode = |
12e258fb6f3c
Got about a third of the gtkblist.c direct struct usage, much more to go obviously, but i must sleep...
Gary Kramlich <grim@reaperworld.com>
parents:
25820
diff
changeset
|
599 (struct _pidgin_blist_node *)purple_blist_node_get_ui_data(node); |
12e258fb6f3c
Got about a third of the gtkblist.c direct struct usage, much more to go obviously, but i must sleep...
Gary Kramlich <grim@reaperworld.com>
parents:
25820
diff
changeset
|
600 |
27920
6b05a0e36ffb
Fix setting the alias on a metacontact when it's not expanded. This is a patch.
Paul Aurich <paul@darkrain42.org>
parents:
27800
diff
changeset
|
601 /* |
6b05a0e36ffb
Fix setting the alias on a metacontact when it's not expanded. This is a patch.
Paul Aurich <paul@darkrain42.org>
parents:
27800
diff
changeset
|
602 * XXX Using purple_contact_get_alias here breaks because we |
6b05a0e36ffb
Fix setting the alias on a metacontact when it's not expanded. This is a patch.
Paul Aurich <paul@darkrain42.org>
parents:
27800
diff
changeset
|
603 * specifically want to check the contact alias only (i.e. not |
6b05a0e36ffb
Fix setting the alias on a metacontact when it's not expanded. This is a patch.
Paul Aurich <paul@darkrain42.org>
parents:
27800
diff
changeset
|
604 * the priority buddy, which purple_contact_get_alias does). |
6b05a0e36ffb
Fix setting the alias on a metacontact when it's not expanded. This is a patch.
Paul Aurich <paul@darkrain42.org>
parents:
27800
diff
changeset
|
605 * Adding yet another get_alias is evil, so figure this out |
6b05a0e36ffb
Fix setting the alias on a metacontact when it's not expanded. This is a patch.
Paul Aurich <paul@darkrain42.org>
parents:
27800
diff
changeset
|
606 * later :-P |
6b05a0e36ffb
Fix setting the alias on a metacontact when it's not expanded. This is a patch.
Paul Aurich <paul@darkrain42.org>
parents:
27800
diff
changeset
|
607 */ |
6b05a0e36ffb
Fix setting the alias on a metacontact when it's not expanded. This is a patch.
Paul Aurich <paul@darkrain42.org>
parents:
27800
diff
changeset
|
608 if (contact->alias || gtknode->contact_expanded) { |
15822 | 609 purple_blist_alias_contact(contact, arg2); |
25822
12e258fb6f3c
Got about a third of the gtkblist.c direct struct usage, much more to go obviously, but i must sleep...
Gary Kramlich <grim@reaperworld.com>
parents:
25820
diff
changeset
|
610 gtk_blist_auto_personize(purple_blist_node_get_parent(node), arg2); |
20043
4d278e98b5ac
Auto-personization. Closes #44
Sean Egan <seanegan@gmail.com>
parents:
20042
diff
changeset
|
611 } else { |
15822 | 612 PurpleBuddy *buddy = purple_contact_get_priority_buddy(contact); |
613 purple_blist_alias_buddy(buddy, arg2); | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
614 serv_alias_buddy(buddy); |
25822
12e258fb6f3c
Got about a third of the gtkblist.c direct struct usage, much more to go obviously, but i must sleep...
Gary Kramlich <grim@reaperworld.com>
parents:
25820
diff
changeset
|
615 gtk_blist_auto_personize(purple_blist_node_get_parent(node), arg2); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
616 } |
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 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
619 |
15822 | 620 case PURPLE_BLIST_BUDDY_NODE: |
25822
12e258fb6f3c
Got about a third of the gtkblist.c direct struct usage, much more to go obviously, but i must sleep...
Gary Kramlich <grim@reaperworld.com>
parents:
25820
diff
changeset
|
621 { |
12e258fb6f3c
Got about a third of the gtkblist.c direct struct usage, much more to go obviously, but i must sleep...
Gary Kramlich <grim@reaperworld.com>
parents:
25820
diff
changeset
|
622 PurpleGroup *group = purple_buddy_get_group(PURPLE_BUDDY(node)); |
12e258fb6f3c
Got about a third of the gtkblist.c direct struct usage, much more to go obviously, but i must sleep...
Gary Kramlich <grim@reaperworld.com>
parents:
25820
diff
changeset
|
623 |
12e258fb6f3c
Got about a third of the gtkblist.c direct struct usage, much more to go obviously, but i must sleep...
Gary Kramlich <grim@reaperworld.com>
parents:
25820
diff
changeset
|
624 purple_blist_alias_buddy(PURPLE_BUDDY(node), arg2); |
12e258fb6f3c
Got about a third of the gtkblist.c direct struct usage, much more to go obviously, but i must sleep...
Gary Kramlich <grim@reaperworld.com>
parents:
25820
diff
changeset
|
625 serv_alias_buddy(PURPLE_BUDDY(node)); |
12e258fb6f3c
Got about a third of the gtkblist.c direct struct usage, much more to go obviously, but i must sleep...
Gary Kramlich <grim@reaperworld.com>
parents:
25820
diff
changeset
|
626 gtk_blist_auto_personize(PURPLE_BLIST_NODE(group), arg2); |
12e258fb6f3c
Got about a third of the gtkblist.c direct struct usage, much more to go obviously, but i must sleep...
Gary Kramlich <grim@reaperworld.com>
parents:
25820
diff
changeset
|
627 } |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
628 break; |
15822 | 629 case PURPLE_BLIST_GROUP_NODE: |
630 dest = purple_find_group(arg2); | |
25890
43b721aa4b76
explicit merge of '32d4ce0b6cfc9ccb9a6e7ed661423b9260a0bead'
Richard Laager <rlaager@wiktel.com>
diff
changeset
|
631 if (dest != NULL && purple_utf8_strcasecmp(arg2, purple_group_get_name(PURPLE_GROUP(node)))) { |
25822
12e258fb6f3c
Got about a third of the gtkblist.c direct struct usage, much more to go obviously, but i must sleep...
Gary Kramlich <grim@reaperworld.com>
parents:
25820
diff
changeset
|
632 pidgin_dialogs_merge_groups(PURPLE_GROUP(node), arg2); |
12e258fb6f3c
Got about a third of the gtkblist.c direct struct usage, much more to go obviously, but i must sleep...
Gary Kramlich <grim@reaperworld.com>
parents:
25820
diff
changeset
|
633 } else { |
12e258fb6f3c
Got about a third of the gtkblist.c direct struct usage, much more to go obviously, but i must sleep...
Gary Kramlich <grim@reaperworld.com>
parents:
25820
diff
changeset
|
634 purple_blist_rename_group(PURPLE_GROUP(node), arg2); |
12e258fb6f3c
Got about a third of the gtkblist.c direct struct usage, much more to go obviously, but i must sleep...
Gary Kramlich <grim@reaperworld.com>
parents:
25820
diff
changeset
|
635 } |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
636 break; |
15822 | 637 case PURPLE_BLIST_CHAT_NODE: |
25822
12e258fb6f3c
Got about a third of the gtkblist.c direct struct usage, much more to go obviously, but i must sleep...
Gary Kramlich <grim@reaperworld.com>
parents:
25820
diff
changeset
|
638 purple_blist_alias_chat(PURPLE_CHAT(node), arg2); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
639 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
640 default: |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
641 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
642 } |
17613
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:
17597
diff
changeset
|
643 pidgin_blist_refresh(list); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
644 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
645 |
22784
cf88a302fa88
'Edit Settings' in the context menu for chats in the buddylist.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22712
diff
changeset
|
646 static void |
cf88a302fa88
'Edit Settings' in the context menu for chats in the buddylist.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22712
diff
changeset
|
647 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:
22712
diff
changeset
|
648 { |
cf88a302fa88
'Edit Settings' in the context menu for chats in the buddylist.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22712
diff
changeset
|
649 GList *groups, *fields; |
cf88a302fa88
'Edit Settings' in the context menu for chats in the buddylist.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22712
diff
changeset
|
650 |
cf88a302fa88
'Edit Settings' in the context menu for chats in the buddylist.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22712
diff
changeset
|
651 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:
22712
diff
changeset
|
652 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:
22712
diff
changeset
|
653 for (; fields; fields = fields->next) { |
cf88a302fa88
'Edit Settings' in the context menu for chats in the buddylist.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22712
diff
changeset
|
654 PurpleRequestField *field = fields->data; |
cf88a302fa88
'Edit Settings' in the context menu for chats in the buddylist.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22712
diff
changeset
|
655 const char *id; |
cf88a302fa88
'Edit Settings' in the context menu for chats in the buddylist.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22712
diff
changeset
|
656 char *val; |
cf88a302fa88
'Edit Settings' in the context menu for chats in the buddylist.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22712
diff
changeset
|
657 |
cf88a302fa88
'Edit Settings' in the context menu for chats in the buddylist.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22712
diff
changeset
|
658 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:
22712
diff
changeset
|
659 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:
22712
diff
changeset
|
660 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:
22712
diff
changeset
|
661 else |
cf88a302fa88
'Edit Settings' in the context menu for chats in the buddylist.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22712
diff
changeset
|
662 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:
22712
diff
changeset
|
663 |
22786
dd8cdf1d8b19
Fine tune the edit-settings dialog (e.g., mark fields as masked or
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22784
diff
changeset
|
664 if (!val) { |
dd8cdf1d8b19
Fine tune the edit-settings dialog (e.g., mark fields as masked or
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22784
diff
changeset
|
665 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:
22784
diff
changeset
|
666 } else { |
dd8cdf1d8b19
Fine tune the edit-settings dialog (e.g., mark fields as masked or
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22784
diff
changeset
|
667 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:
22784
diff
changeset
|
668 } |
22784
cf88a302fa88
'Edit Settings' in the context menu for chats in the buddylist.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22712
diff
changeset
|
669 } |
cf88a302fa88
'Edit Settings' in the context menu for chats in the buddylist.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22712
diff
changeset
|
670 } |
cf88a302fa88
'Edit Settings' in the context menu for chats in the buddylist.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22712
diff
changeset
|
671 } |
cf88a302fa88
'Edit Settings' in the context menu for chats in the buddylist.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22712
diff
changeset
|
672 |
cf88a302fa88
'Edit Settings' in the context menu for chats in the buddylist.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22712
diff
changeset
|
673 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:
22712
diff
changeset
|
674 { |
cf88a302fa88
'Edit Settings' in the context menu for chats in the buddylist.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22712
diff
changeset
|
675 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:
22712
diff
changeset
|
676 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:
22712
diff
changeset
|
677 PurpleRequestField *field; |
cf88a302fa88
'Edit Settings' in the context menu for chats in the buddylist.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22712
diff
changeset
|
678 GList *parts, *iter; |
cf88a302fa88
'Edit Settings' in the context menu for chats in the buddylist.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22712
diff
changeset
|
679 struct proto_chat_entry *pce; |
cf88a302fa88
'Edit Settings' in the context menu for chats in the buddylist.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22712
diff
changeset
|
680 PurpleConnection *gc; |
cf88a302fa88
'Edit Settings' in the context menu for chats in the buddylist.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22712
diff
changeset
|
681 PurpleChat *chat = (PurpleChat*)node; |
cf88a302fa88
'Edit Settings' in the context menu for chats in the buddylist.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22712
diff
changeset
|
682 |
cf88a302fa88
'Edit Settings' in the context menu for chats in the buddylist.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22712
diff
changeset
|
683 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:
22712
diff
changeset
|
684 |
cf88a302fa88
'Edit Settings' in the context menu for chats in the buddylist.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22712
diff
changeset
|
685 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:
22712
diff
changeset
|
686 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:
22712
diff
changeset
|
687 |
cf88a302fa88
'Edit Settings' in the context menu for chats in the buddylist.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22712
diff
changeset
|
688 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:
22712
diff
changeset
|
689 pce = iter->data; |
cf88a302fa88
'Edit Settings' in the context menu for chats in the buddylist.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22712
diff
changeset
|
690 if (pce->is_int) { |
cf88a302fa88
'Edit Settings' in the context menu for chats in the buddylist.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22712
diff
changeset
|
691 int val; |
cf88a302fa88
'Edit Settings' in the context menu for chats in the buddylist.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22712
diff
changeset
|
692 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:
22712
diff
changeset
|
693 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:
22712
diff
changeset
|
694 val = pce->min; |
cf88a302fa88
'Edit Settings' in the context menu for chats in the buddylist.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22712
diff
changeset
|
695 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:
22712
diff
changeset
|
696 } else { |
cf88a302fa88
'Edit Settings' in the context menu for chats in the buddylist.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22712
diff
changeset
|
697 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:
22712
diff
changeset
|
698 g_hash_table_lookup(purple_chat_get_components(chat), pce->identifier), FALSE); |
22786
dd8cdf1d8b19
Fine tune the edit-settings dialog (e.g., mark fields as masked or
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22784
diff
changeset
|
699 if (pce->secret) |
dd8cdf1d8b19
Fine tune the edit-settings dialog (e.g., mark fields as masked or
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22784
diff
changeset
|
700 purple_request_field_string_set_masked(field, TRUE); |
22784
cf88a302fa88
'Edit Settings' in the context menu for chats in the buddylist.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22712
diff
changeset
|
701 } |
cf88a302fa88
'Edit Settings' in the context menu for chats in the buddylist.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22712
diff
changeset
|
702 |
22786
dd8cdf1d8b19
Fine tune the edit-settings dialog (e.g., mark fields as masked or
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22784
diff
changeset
|
703 if (pce->required) |
dd8cdf1d8b19
Fine tune the edit-settings dialog (e.g., mark fields as masked or
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22784
diff
changeset
|
704 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:
22784
diff
changeset
|
705 |
22784
cf88a302fa88
'Edit Settings' in the context menu for chats in the buddylist.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22712
diff
changeset
|
706 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:
22712
diff
changeset
|
707 g_free(pce); |
cf88a302fa88
'Edit Settings' in the context menu for chats in the buddylist.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22712
diff
changeset
|
708 } |
cf88a302fa88
'Edit Settings' in the context menu for chats in the buddylist.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22712
diff
changeset
|
709 |
cf88a302fa88
'Edit Settings' in the context menu for chats in the buddylist.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22712
diff
changeset
|
710 g_list_free(parts); |
cf88a302fa88
'Edit Settings' in the context menu for chats in the buddylist.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22712
diff
changeset
|
711 |
22813
b4a0f4b32ba5
Tweak some strings in the Edit Chat dialog.
Will Thompson <will.thompson@collabora.co.uk>
parents:
22794
diff
changeset
|
712 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:
22794
diff
changeset
|
713 fields, _("Save"), G_CALLBACK(chat_components_edit_ok), _("Cancel"), NULL, |
22784
cf88a302fa88
'Edit Settings' in the context menu for chats in the buddylist.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22712
diff
changeset
|
714 NULL, NULL, NULL, |
cf88a302fa88
'Edit Settings' in the context menu for chats in the buddylist.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22712
diff
changeset
|
715 chat); |
cf88a302fa88
'Edit Settings' in the context menu for chats in the buddylist.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22712
diff
changeset
|
716 } |
cf88a302fa88
'Edit Settings' in the context menu for chats in the buddylist.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22712
diff
changeset
|
717 |
15822 | 718 static void gtk_blist_menu_alias_cb(GtkWidget *w, PurpleBlistNode *node) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
719 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
720 GtkTreeIter iter; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
721 GtkTreePath *path; |
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 if (!(get_iter_from_node(node, &iter))) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
724 /* This is either a bug, or the buddy is in a collapsed contact */ |
25822
12e258fb6f3c
Got about a third of the gtkblist.c direct struct usage, much more to go obviously, but i must sleep...
Gary Kramlich <grim@reaperworld.com>
parents:
25820
diff
changeset
|
725 node = purple_blist_node_get_parent(node); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
726 if (!get_iter_from_node(node, &iter)) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
727 /* Now it's definitely a bug */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
728 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
729 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
730 |
21175
4ce3e1f998f6
Don't allow tooltips to interfere with editing blist entries. Fixes #3830.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21041
diff
changeset
|
731 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
|
732 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
733 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
|
734 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
|
735 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
|
736 gtk_widget_grab_focus(gtkblist->treeview); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
737 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
|
738 gtkblist->text_column, gtkblist->text_rend, TRUE); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
739 gtk_tree_path_free(path); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
740 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
741 |
15822 | 742 static void gtk_blist_menu_bp_cb(GtkWidget *w, PurpleBuddy *b) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
743 { |
25822
12e258fb6f3c
Got about a third of the gtkblist.c direct struct usage, much more to go obviously, but i must sleep...
Gary Kramlich <grim@reaperworld.com>
parents:
25820
diff
changeset
|
744 pidgin_pounce_editor_show(purple_buddy_get_account(b), |
12e258fb6f3c
Got about a third of the gtkblist.c direct struct usage, much more to go obviously, but i must sleep...
Gary Kramlich <grim@reaperworld.com>
parents:
25820
diff
changeset
|
745 purple_buddy_get_name(b), NULL); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
746 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
747 |
15822 | 748 static void gtk_blist_menu_showlog_cb(GtkWidget *w, PurpleBlistNode *node) |
749 { | |
750 PurpleLogType type; | |
751 PurpleAccount *account; | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
752 char *name = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
753 |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
754 pidgin_set_cursor(gtkblist->window, GDK_WATCH); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
755 |
15822 | 756 if (PURPLE_BLIST_NODE_IS_BUDDY(node)) { |
757 PurpleBuddy *b = (PurpleBuddy*) node; | |
758 type = PURPLE_LOG_IM; | |
25822
12e258fb6f3c
Got about a third of the gtkblist.c direct struct usage, much more to go obviously, but i must sleep...
Gary Kramlich <grim@reaperworld.com>
parents:
25820
diff
changeset
|
759 name = g_strdup(purple_buddy_get_name(b)); |
12e258fb6f3c
Got about a third of the gtkblist.c direct struct usage, much more to go obviously, but i must sleep...
Gary Kramlich <grim@reaperworld.com>
parents:
25820
diff
changeset
|
760 account = purple_buddy_get_account(b); |
15822 | 761 } else if (PURPLE_BLIST_NODE_IS_CHAT(node)) { |
25822
12e258fb6f3c
Got about a third of the gtkblist.c direct struct usage, much more to go obviously, but i must sleep...
Gary Kramlich <grim@reaperworld.com>
parents:
25820
diff
changeset
|
762 PurpleChat *c = PURPLE_CHAT(node); |
15822 | 763 PurplePluginProtocolInfo *prpl_info = NULL; |
764 type = PURPLE_LOG_CHAT; | |
25822
12e258fb6f3c
Got about a third of the gtkblist.c direct struct usage, much more to go obviously, but i must sleep...
Gary Kramlich <grim@reaperworld.com>
parents:
25820
diff
changeset
|
765 account = purple_chat_get_account(c); |
15822 | 766 prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(purple_find_prpl(purple_account_get_protocol_id(account))); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
767 if (prpl_info && prpl_info->get_chat_name) { |
25822
12e258fb6f3c
Got about a third of the gtkblist.c direct struct usage, much more to go obviously, but i must sleep...
Gary Kramlich <grim@reaperworld.com>
parents:
25820
diff
changeset
|
768 name = prpl_info->get_chat_name(purple_chat_get_components(c)); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
769 } |
15822 | 770 } else if (PURPLE_BLIST_NODE_IS_CONTACT(node)) { |
25822
12e258fb6f3c
Got about a third of the gtkblist.c direct struct usage, much more to go obviously, but i must sleep...
Gary Kramlich <grim@reaperworld.com>
parents:
25820
diff
changeset
|
771 pidgin_log_show_contact(PURPLE_CONTACT(node)); |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
772 pidgin_clear_cursor(gtkblist->window); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
773 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
774 } else { |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
775 pidgin_clear_cursor(gtkblist->window); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
776 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
777 /* 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
|
778 * 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
|
779 g_return_if_reached(); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
780 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
781 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
782 if (name && account) { |
21340
6c4de0d24eff
Reverted changes from ef7ac46f90a801547f7dfc4295927a956f90e869 to
Richard Laager <rlaager@wiktel.com>
parents:
21227
diff
changeset
|
783 pidgin_log_show(type, name, account); |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
784 pidgin_clear_cursor(gtkblist->window); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
785 } |
25896
6c6846d169d6
This patch fixes a few string leaks (don't g_strdup the FontColorPair? values) and also fixes the bug where, with no theme, everyone on the buddy list is colored "dim grey" (chunks 2, 3, and 4 in the patch)
Paul Aurich <paul@darkrain42.org>
parents:
25891
diff
changeset
|
786 |
6c6846d169d6
This patch fixes a few string leaks (don't g_strdup the FontColorPair? values) and also fixes the bug where, with no theme, everyone on the buddy list is colored "dim grey" (chunks 2, 3, and 4 in the patch)
Paul Aurich <paul@darkrain42.org>
parents:
25891
diff
changeset
|
787 g_free(name); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
788 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
789 |
20163
1971e13bb5f6
Merge the plugin pack's showoffline plugin's functionality to pidgin proper
Stu Tomlinson <stu@nosnilmot.com>
parents:
20161
diff
changeset
|
790 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
|
791 { |
20164
7d9391b94b1c
Fix the whitespace/tab/space junk I just created
Stu Tomlinson <stu@nosnilmot.com>
parents:
20163
diff
changeset
|
792 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
|
793 { |
7d9391b94b1c
Fix the whitespace/tab/space junk I just created
Stu Tomlinson <stu@nosnilmot.com>
parents:
20163
diff
changeset
|
794 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
|
795 !purple_blist_node_get_bool(node, "show_offline")); |
22712
387071b0d4d4
Fix setting "show offline" for buddy list nodes so it takes immediate
Stu Tomlinson <stu@nosnilmot.com>
parents:
22679
diff
changeset
|
796 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
|
797 } |
7d9391b94b1c
Fix the whitespace/tab/space junk I just created
Stu Tomlinson <stu@nosnilmot.com>
parents:
20163
diff
changeset
|
798 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
|
799 { |
7d9391b94b1c
Fix the whitespace/tab/space junk I just created
Stu Tomlinson <stu@nosnilmot.com>
parents:
20163
diff
changeset
|
800 PurpleBlistNode *bnode; |
7d9391b94b1c
Fix the whitespace/tab/space junk I just created
Stu Tomlinson <stu@nosnilmot.com>
parents:
20163
diff
changeset
|
801 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
|
802 |
7d9391b94b1c
Fix the whitespace/tab/space junk I just created
Stu Tomlinson <stu@nosnilmot.com>
parents:
20163
diff
changeset
|
803 purple_blist_node_set_bool(node, "show_offline", setting); |
25822
12e258fb6f3c
Got about a third of the gtkblist.c direct struct usage, much more to go obviously, but i must sleep...
Gary Kramlich <grim@reaperworld.com>
parents:
25820
diff
changeset
|
804 for (bnode = purple_blist_node_get_first_child(node); |
12e258fb6f3c
Got about a third of the gtkblist.c direct struct usage, much more to go obviously, but i must sleep...
Gary Kramlich <grim@reaperworld.com>
parents:
25820
diff
changeset
|
805 bnode != NULL; |
12e258fb6f3c
Got about a third of the gtkblist.c direct struct usage, much more to go obviously, but i must sleep...
Gary Kramlich <grim@reaperworld.com>
parents:
25820
diff
changeset
|
806 bnode = purple_blist_node_get_sibling_next(bnode)) |
12e258fb6f3c
Got about a third of the gtkblist.c direct struct usage, much more to go obviously, but i must sleep...
Gary Kramlich <grim@reaperworld.com>
parents:
25820
diff
changeset
|
807 { |
20164
7d9391b94b1c
Fix the whitespace/tab/space junk I just created
Stu Tomlinson <stu@nosnilmot.com>
parents:
20163
diff
changeset
|
808 purple_blist_node_set_bool(bnode, "show_offline", setting); |
22712
387071b0d4d4
Fix setting "show offline" for buddy list nodes so it takes immediate
Stu Tomlinson <stu@nosnilmot.com>
parents:
22679
diff
changeset
|
809 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
|
810 } |
22447
df336908dd15
Make "Show when offline" work on group nodes too, which sets the flag for
Stu Tomlinson <stu@nosnilmot.com>
parents:
22323
diff
changeset
|
811 } 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:
22323
diff
changeset
|
812 PurpleBlistNode *cnode, *bnode; |
df336908dd15
Make "Show when offline" work on group nodes too, which sets the flag for
Stu Tomlinson <stu@nosnilmot.com>
parents:
22323
diff
changeset
|
813 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:
22323
diff
changeset
|
814 |
df336908dd15
Make "Show when offline" work on group nodes too, which sets the flag for
Stu Tomlinson <stu@nosnilmot.com>
parents:
22323
diff
changeset
|
815 purple_blist_node_set_bool(node, "show_offline", setting); |
25822
12e258fb6f3c
Got about a third of the gtkblist.c direct struct usage, much more to go obviously, but i must sleep...
Gary Kramlich <grim@reaperworld.com>
parents:
25820
diff
changeset
|
816 for (cnode = purple_blist_node_get_first_child(node); |
12e258fb6f3c
Got about a third of the gtkblist.c direct struct usage, much more to go obviously, but i must sleep...
Gary Kramlich <grim@reaperworld.com>
parents:
25820
diff
changeset
|
817 cnode != NULL; |
12e258fb6f3c
Got about a third of the gtkblist.c direct struct usage, much more to go obviously, but i must sleep...
Gary Kramlich <grim@reaperworld.com>
parents:
25820
diff
changeset
|
818 cnode = purple_blist_node_get_sibling_next(cnode)) |
12e258fb6f3c
Got about a third of the gtkblist.c direct struct usage, much more to go obviously, but i must sleep...
Gary Kramlich <grim@reaperworld.com>
parents:
25820
diff
changeset
|
819 { |
22447
df336908dd15
Make "Show when offline" work on group nodes too, which sets the flag for
Stu Tomlinson <stu@nosnilmot.com>
parents:
22323
diff
changeset
|
820 purple_blist_node_set_bool(cnode, "show_offline", setting); |
25822
12e258fb6f3c
Got about a third of the gtkblist.c direct struct usage, much more to go obviously, but i must sleep...
Gary Kramlich <grim@reaperworld.com>
parents:
25820
diff
changeset
|
821 for (bnode = purple_blist_node_get_first_child(cnode); |
12e258fb6f3c
Got about a third of the gtkblist.c direct struct usage, much more to go obviously, but i must sleep...
Gary Kramlich <grim@reaperworld.com>
parents:
25820
diff
changeset
|
822 bnode != NULL; |
12e258fb6f3c
Got about a third of the gtkblist.c direct struct usage, much more to go obviously, but i must sleep...
Gary Kramlich <grim@reaperworld.com>
parents:
25820
diff
changeset
|
823 bnode = purple_blist_node_get_sibling_next(bnode)) |
12e258fb6f3c
Got about a third of the gtkblist.c direct struct usage, much more to go obviously, but i must sleep...
Gary Kramlich <grim@reaperworld.com>
parents:
25820
diff
changeset
|
824 { |
22447
df336908dd15
Make "Show when offline" work on group nodes too, which sets the flag for
Stu Tomlinson <stu@nosnilmot.com>
parents:
22323
diff
changeset
|
825 purple_blist_node_set_bool(bnode, "show_offline", setting); |
22712
387071b0d4d4
Fix setting "show offline" for buddy list nodes so it takes immediate
Stu Tomlinson <stu@nosnilmot.com>
parents:
22679
diff
changeset
|
826 pidgin_blist_update(purple_get_blist(), bnode); |
22447
df336908dd15
Make "Show when offline" work on group nodes too, which sets the flag for
Stu Tomlinson <stu@nosnilmot.com>
parents:
22323
diff
changeset
|
827 } |
df336908dd15
Make "Show when offline" work on group nodes too, which sets the flag for
Stu Tomlinson <stu@nosnilmot.com>
parents:
22323
diff
changeset
|
828 } |
20164
7d9391b94b1c
Fix the whitespace/tab/space junk I just created
Stu Tomlinson <stu@nosnilmot.com>
parents:
20163
diff
changeset
|
829 } |
20163
1971e13bb5f6
Merge the plugin pack's showoffline plugin's functionality to pidgin proper
Stu Tomlinson <stu@nosnilmot.com>
parents:
20161
diff
changeset
|
830 } |
1971e13bb5f6
Merge the plugin pack's showoffline plugin's functionality to pidgin proper
Stu Tomlinson <stu@nosnilmot.com>
parents:
20161
diff
changeset
|
831 |
22007
c38d72677c8a
Probe for -Wstrict-prototypes to get some more warnings. I then cleaned up
Richard Laager <rlaager@wiktel.com>
parents:
21960
diff
changeset
|
832 static void gtk_blist_show_systemlog_cb(void) |
21340
6c4de0d24eff
Reverted changes from ef7ac46f90a801547f7dfc4295927a956f90e869 to
Richard Laager <rlaager@wiktel.com>
parents:
21227
diff
changeset
|
833 { |
6c4de0d24eff
Reverted changes from ef7ac46f90a801547f7dfc4295927a956f90e869 to
Richard Laager <rlaager@wiktel.com>
parents:
21227
diff
changeset
|
834 pidgin_syslog_show(); |
6c4de0d24eff
Reverted changes from ef7ac46f90a801547f7dfc4295927a956f90e869 to
Richard Laager <rlaager@wiktel.com>
parents:
21227
diff
changeset
|
835 } |
6c4de0d24eff
Reverted changes from ef7ac46f90a801547f7dfc4295927a956f90e869 to
Richard Laager <rlaager@wiktel.com>
parents:
21227
diff
changeset
|
836 |
22007
c38d72677c8a
Probe for -Wstrict-prototypes to get some more warnings. I then cleaned up
Richard Laager <rlaager@wiktel.com>
parents:
21960
diff
changeset
|
837 static void gtk_blist_show_onlinehelp_cb(void) |
17359
0bbc08d41234
disapproval of revision '1fd9445b933f2f5ff2724778f9d18e47282745cd'
Stu Tomlinson <stu@nosnilmot.com>
parents:
17358
diff
changeset
|
838 { |
17641
9e0aec946cd0
use pidgin.im/documentation as the help url (which redirects already)
Stu Tomlinson <stu@nosnilmot.com>
parents:
17640
diff
changeset
|
839 purple_notify_uri(NULL, PURPLE_WEBSITE "documentation"); |
17359
0bbc08d41234
disapproval of revision '1fd9445b933f2f5ff2724778f9d18e47282745cd'
Stu Tomlinson <stu@nosnilmot.com>
parents:
17358
diff
changeset
|
840 } |
0bbc08d41234
disapproval of revision '1fd9445b933f2f5ff2724778f9d18e47282745cd'
Stu Tomlinson <stu@nosnilmot.com>
parents:
17358
diff
changeset
|
841 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
842 static void |
26884
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
843 do_join_chat(PidginChatData *data) |
15373
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 if (data) |
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 GHashTable *components = |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
848 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
|
849 GList *tmp; |
15822 | 850 PurpleChat *chat; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
851 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
852 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
|
853 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
854 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
|
855 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
856 g_hash_table_replace(components, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
857 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
|
858 g_strdup_printf("%d", |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
859 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
|
860 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
861 else |
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 g_hash_table_replace(components, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
864 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
|
865 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
|
866 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
867 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
868 |
26884
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
869 chat = purple_chat_new(data->rq_data.account, NULL, components); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
870 gtk_blist_join_chat(chat); |
15822 | 871 purple_blist_remove_chat(chat); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
872 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
873 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
874 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
875 static void |
26884
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
876 do_joinchat(GtkWidget *dialog, int id, PidginChatData *info) |
15373
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 switch(id) |
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 case GTK_RESPONSE_OK: |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
881 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
|
882 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
|
883 |
ebe79cae6d83
Add 'Room List' buttons to Join Chat and Add Chat dialogs to ease access
Stu Tomlinson <stu@nosnilmot.com>
parents:
21662
diff
changeset
|
884 case 1: |
26884
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
885 pidgin_roomlist_dialog_show_with_account(info->rq_data.account); |
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
|
886 return; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
887 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
888 break; |
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_widget_destroy(GTK_WIDGET(dialog)); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
892 g_list_free(info->entries); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
893 g_free(info); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
894 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
895 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
896 /* |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
897 * 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
|
898 * 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
|
899 */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
900 static void |
26884
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
901 set_sensitive_if_input_cb(GtkWidget *entry, gpointer user_data) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
902 { |
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
|
903 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
|
904 PurpleConnection *gc; |
26884
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
905 PidginChatData *data; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
906 GList *tmp; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
907 const char *text; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
908 gboolean required; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
909 gboolean sensitive = TRUE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
910 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
911 data = user_data; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
912 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
913 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
|
914 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
915 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
|
916 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
917 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
|
918 text = gtk_entry_get_text(tmp->data); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
919 if (required && (*text == '\0')) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
920 sensitive = FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
921 } |
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 |
26884
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
924 gtk_dialog_set_response_sensitive(GTK_DIALOG(data->rq_data.window), GTK_RESPONSE_OK, sensitive); |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
925 |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
926 gc = purple_account_get_connection(data->rq_data.account); |
32305
2ec94166be43
On the way to hiding the PurpleConnection struct.
andrew.victor@mxit.com
parents:
32246
diff
changeset
|
927 prpl_info = (gc != NULL) ? PURPLE_PLUGIN_PROTOCOL_INFO(purple_connection_get_prpl(gc)) : NULL; |
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
|
928 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
|
929 |
26884
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
930 gtk_dialog_set_response_sensitive(GTK_DIALOG(data->rq_data.window), 1, sensitive); |
15373
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 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
933 static void |
15822 | 934 pidgin_blist_update_privacy_cb(PurpleBuddy *buddy) |
935 { | |
25822
12e258fb6f3c
Got about a third of the gtkblist.c direct struct usage, much more to go obviously, but i must sleep...
Gary Kramlich <grim@reaperworld.com>
parents:
25820
diff
changeset
|
936 struct _pidgin_blist_node *ui_data = purple_blist_node_get_ui_data(PURPLE_BLIST_NODE(buddy)); |
12e258fb6f3c
Got about a third of the gtkblist.c direct struct usage, much more to go obviously, but i must sleep...
Gary Kramlich <grim@reaperworld.com>
parents:
25820
diff
changeset
|
937 if (ui_data == NULL || ui_data->row == NULL) |
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
|
938 return; |
25822
12e258fb6f3c
Got about a third of the gtkblist.c direct struct usage, much more to go obviously, but i must sleep...
Gary Kramlich <grim@reaperworld.com>
parents:
25820
diff
changeset
|
939 pidgin_blist_update_buddy(purple_get_blist(), PURPLE_BLIST_NODE(buddy), TRUE); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
940 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
941 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
942 static gboolean |
15822 | 943 chat_account_filter_func(PurpleAccount *account) |
944 { | |
945 PurpleConnection *gc = purple_account_get_connection(account); | |
946 PurplePluginProtocolInfo *prpl_info = NULL; | |
947 | |
29957
39c1720db373
Prevent a null pointer dereference in chat_account_filter_func() if called
Stu Tomlinson <stu@nosnilmot.com>
parents:
29753
diff
changeset
|
948 if (gc == NULL) |
39c1720db373
Prevent a null pointer dereference in chat_account_filter_func() if called
Stu Tomlinson <stu@nosnilmot.com>
parents:
29753
diff
changeset
|
949 return FALSE; |
39c1720db373
Prevent a null pointer dereference in chat_account_filter_func() if called
Stu Tomlinson <stu@nosnilmot.com>
parents:
29753
diff
changeset
|
950 |
32305
2ec94166be43
On the way to hiding the PurpleConnection struct.
andrew.victor@mxit.com
parents:
32246
diff
changeset
|
951 prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(purple_connection_get_prpl(gc)); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
952 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
953 return (prpl_info->chat_info != NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
954 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
955 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
956 gboolean |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
957 pidgin_blist_joinchat_is_showable() |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
958 { |
18063
926ccb104da0
disapproval of revision '1411afd7660760db59966c3a9f18e2adab8eb27e'
Richard Laager <rlaager@wiktel.com>
parents:
18058
diff
changeset
|
959 GList *c; |
15822 | 960 PurpleConnection *gc; |
961 | |
962 for (c = purple_connections_get_all(); c != NULL; c = c->next) { | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
963 gc = c->data; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
964 |
15822 | 965 if (chat_account_filter_func(purple_connection_get_account(gc))) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
966 return TRUE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
967 } |
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 return FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
970 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
971 |
26884
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
972 static GtkWidget * |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
973 make_blist_request_dialog(PidginBlistRequestData *data, PurpleAccount *account, |
31086
a8cc50c2279f
Remove trailing whitespace
Richard Laager <rlaager@wiktel.com>
parents:
30459
diff
changeset
|
974 const char *title, const char *window_role, const char *label_text, |
26884
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
975 GCallback callback_func, PurpleFilterAccountFunc filter_func, |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
976 GCallback response_cb) |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
977 { |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
978 GtkWidget *label; |
26884
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
979 GtkWidget *img; |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
980 GtkWidget *hbox; |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
981 GtkWidget *vbox; |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
982 GtkWindow *blist_window; |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
983 PidginBuddyList *gtkblist; |
26884
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
984 |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
985 data->account = account; |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
986 |
15435 | 987 img = gtk_image_new_from_stock(PIDGIN_STOCK_DIALOG_QUESTION, |
26884
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
988 gtk_icon_size_from_name(PIDGIN_ICON_SIZE_TANGO_HUGE)); |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
989 |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
990 gtkblist = PIDGIN_BLIST(purple_get_blist()); |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
991 blist_window = gtkblist ? GTK_WINDOW(gtkblist->window) : NULL; |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
992 |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
993 data->window = gtk_dialog_new_with_buttons(title, |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
994 blist_window, GTK_DIALOG_NO_SEPARATOR, |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
995 NULL); |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
996 |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
997 gtk_window_set_transient_for(GTK_WINDOW(data->window), blist_window); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
998 gtk_dialog_set_default_response(GTK_DIALOG(data->window), GTK_RESPONSE_OK); |
15820 | 999 gtk_container_set_border_width(GTK_CONTAINER(data->window), PIDGIN_HIG_BOX_SPACE); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1000 gtk_window_set_resizable(GTK_WINDOW(data->window), FALSE); |
15820 | 1001 gtk_box_set_spacing(GTK_BOX(GTK_DIALOG(data->window)->vbox), PIDGIN_HIG_BORDER); |
26884
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
1002 gtk_container_set_border_width(GTK_CONTAINER(GTK_DIALOG(data->window)->vbox), PIDGIN_HIG_BOX_SPACE); |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
1003 gtk_window_set_role(GTK_WINDOW(data->window), window_role); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1004 |
15820 | 1005 hbox = gtk_hbox_new(FALSE, PIDGIN_HIG_BORDER); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1006 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
|
1007 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
|
1008 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
|
1009 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1010 vbox = gtk_vbox_new(FALSE, 5); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1011 gtk_container_add(GTK_CONTAINER(hbox), vbox); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1012 |
26884
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
1013 label = gtk_label_new(label_text); |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
1014 |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
1015 gtk_widget_set_size_request(label, 400, -1); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1016 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
|
1017 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
|
1018 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
|
1019 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1020 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
|
1021 |
26884
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
1022 data->account_menu = pidgin_account_option_menu_new(account, FALSE, |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
1023 callback_func, filter_func, data); |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
1024 pidgin_add_widget_to_vbox(GTK_BOX(vbox), _("A_ccount"), data->sg, data->account_menu, TRUE, NULL); |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
1025 |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
1026 data->vbox = GTK_BOX(gtk_vbox_new(FALSE, 5)); |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
1027 gtk_container_set_border_width(GTK_CONTAINER(data->vbox), 0); |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
1028 gtk_box_pack_start(GTK_BOX(vbox), GTK_WIDGET(data->vbox), FALSE, FALSE, 0); |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
1029 |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
1030 g_signal_connect(G_OBJECT(data->window), "response", response_cb, data); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1031 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1032 g_object_unref(data->sg); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1033 |
26884
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
1034 return vbox; |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
1035 } |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
1036 |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
1037 static void |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
1038 rebuild_chat_entries(PidginChatData *data, const char *default_chat_name) |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
1039 { |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
1040 PurpleConnection *gc; |
32305
2ec94166be43
On the way to hiding the PurpleConnection struct.
andrew.victor@mxit.com
parents:
32246
diff
changeset
|
1041 PurplePluginProtocolInfo *prpl_info; |
26884
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
1042 GList *list = NULL, *tmp; |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
1043 GHashTable *defaults = NULL; |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
1044 struct proto_chat_entry *pce; |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
1045 gboolean focus = TRUE; |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
1046 |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
1047 g_return_if_fail(data->rq_data.account != NULL); |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
1048 |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
1049 gc = purple_account_get_connection(data->rq_data.account); |
32305
2ec94166be43
On the way to hiding the PurpleConnection struct.
andrew.victor@mxit.com
parents:
32246
diff
changeset
|
1050 prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(purple_connection_get_prpl(gc)); |
26884
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
1051 |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
1052 gtk_container_foreach(GTK_CONTAINER(data->rq_data.vbox), (GtkCallback)gtk_widget_destroy, NULL); |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
1053 |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
1054 g_list_free(data->entries); |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
1055 data->entries = NULL; |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
1056 |
32305
2ec94166be43
On the way to hiding the PurpleConnection struct.
andrew.victor@mxit.com
parents:
32246
diff
changeset
|
1057 if (prpl_info->chat_info != NULL) |
2ec94166be43
On the way to hiding the PurpleConnection struct.
andrew.victor@mxit.com
parents:
32246
diff
changeset
|
1058 list = prpl_info->chat_info(gc); |
2ec94166be43
On the way to hiding the PurpleConnection struct.
andrew.victor@mxit.com
parents:
32246
diff
changeset
|
1059 |
2ec94166be43
On the way to hiding the PurpleConnection struct.
andrew.victor@mxit.com
parents:
32246
diff
changeset
|
1060 if (prpl_info->chat_info_defaults != NULL) |
2ec94166be43
On the way to hiding the PurpleConnection struct.
andrew.victor@mxit.com
parents:
32246
diff
changeset
|
1061 defaults = prpl_info->chat_info_defaults(gc, default_chat_name); |
26884
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
1062 |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
1063 for (tmp = list; tmp; tmp = tmp->next) |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
1064 { |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
1065 GtkWidget *input; |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
1066 |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
1067 pce = tmp->data; |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
1068 |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
1069 if (pce->is_int) |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
1070 { |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
1071 GtkObject *adjust; |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
1072 adjust = gtk_adjustment_new(pce->min, pce->min, pce->max, |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
1073 1, 10, 10); |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
1074 input = gtk_spin_button_new(GTK_ADJUSTMENT(adjust), 1, 0); |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
1075 gtk_widget_set_size_request(input, 50, -1); |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
1076 pidgin_add_widget_to_vbox(GTK_BOX(data->rq_data.vbox), pce->label, data->rq_data.sg, input, FALSE, NULL); |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
1077 } |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
1078 else |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
1079 { |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
1080 char *value; |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
1081 input = gtk_entry_new(); |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
1082 gtk_entry_set_activates_default(GTK_ENTRY(input), TRUE); |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
1083 value = g_hash_table_lookup(defaults, pce->identifier); |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
1084 if (value != NULL) |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
1085 gtk_entry_set_text(GTK_ENTRY(input), value); |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
1086 if (pce->secret) |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
1087 { |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
1088 gtk_entry_set_visibility(GTK_ENTRY(input), FALSE); |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
1089 #if !GTK_CHECK_VERSION(2,16,0) |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
1090 if (gtk_entry_get_invisible_char(GTK_ENTRY(input)) == '*') |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
1091 gtk_entry_set_invisible_char(GTK_ENTRY(input), PIDGIN_INVISIBLE_CHAR); |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
1092 #endif /* Less than GTK+ 2.16 */ |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
1093 } |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
1094 pidgin_add_widget_to_vbox(data->rq_data.vbox, pce->label, data->rq_data.sg, input, TRUE, NULL); |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
1095 g_signal_connect(G_OBJECT(input), "changed", |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
1096 G_CALLBACK(set_sensitive_if_input_cb), data); |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
1097 } |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
1098 |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
1099 /* Do the following for any type of input widget */ |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
1100 if (focus) |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
1101 { |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
1102 gtk_widget_grab_focus(input); |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
1103 focus = FALSE; |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
1104 } |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
1105 g_object_set_data(G_OBJECT(input), "identifier", (gpointer)pce->identifier); |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
1106 g_object_set_data(G_OBJECT(input), "is_spin", GINT_TO_POINTER(pce->is_int)); |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
1107 g_object_set_data(G_OBJECT(input), "required", GINT_TO_POINTER(pce->required)); |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
1108 data->entries = g_list_append(data->entries, input); |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
1109 |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
1110 g_free(pce); |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
1111 } |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
1112 |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
1113 g_list_free(list); |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
1114 g_hash_table_destroy(defaults); |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
1115 |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
1116 /* Set whether the "OK" button should be clickable initially */ |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
1117 set_sensitive_if_input_cb(NULL, data); |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
1118 |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
1119 gtk_widget_show_all(GTK_WIDGET(data->rq_data.vbox)); |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
1120 } |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
1121 |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
1122 static void |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
1123 chat_select_account_cb(GObject *w, PurpleAccount *account, |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
1124 PidginChatData *data) |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
1125 { |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
1126 if (strcmp(purple_account_get_protocol_id(data->rq_data.account), |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
1127 purple_account_get_protocol_id(account)) == 0) |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
1128 { |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
1129 data->rq_data.account = account; |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
1130 } |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
1131 else |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
1132 { |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
1133 data->rq_data.account = account; |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
1134 rebuild_chat_entries(data, data->default_chat_name); |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
1135 } |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
1136 } |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
1137 |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
1138 void |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
1139 pidgin_blist_joinchat_show(void) |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
1140 { |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
1141 PidginChatData *data = NULL; |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
1142 |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
1143 data = g_new0(PidginChatData, 1); |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
1144 |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
1145 make_blist_request_dialog((PidginBlistRequestData *)data, NULL, |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
1146 _("Join a Chat"), "join_chat", |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
1147 _("Please enter the appropriate information about the chat " |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
1148 "you would like to join.\n"), |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
1149 G_CALLBACK(chat_select_account_cb), |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
1150 chat_account_filter_func, (GCallback)do_joinchat); |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
1151 gtk_dialog_add_buttons(GTK_DIALOG(data->rq_data.window), |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
1152 _("Room _List"), 1, |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
1153 GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
1154 PIDGIN_STOCK_CHAT, GTK_RESPONSE_OK, NULL); |
27629
5d75276a575f
Make OK default for Add Buddy, Add Chat, and Join Chat.
Paul Aurich <paul@darkrain42.org>
parents:
27588
diff
changeset
|
1155 gtk_dialog_set_default_response(GTK_DIALOG(data->rq_data.window), |
5d75276a575f
Make OK default for Add Buddy, Add Chat, and Join Chat.
Paul Aurich <paul@darkrain42.org>
parents:
27588
diff
changeset
|
1156 GTK_RESPONSE_OK); |
26884
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
1157 data->default_chat_name = NULL; |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
1158 data->rq_data.account = pidgin_account_option_menu_get_selected(data->rq_data.account_menu); |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
1159 |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
1160 rebuild_chat_entries(data, NULL); |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
1161 |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
1162 gtk_widget_show_all(data->rq_data.window); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1163 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1164 |
17116
17117b8cfbb7
Patch from SuperMMX to correctly update the expand state of contacts
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
17035
diff
changeset
|
1165 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:
17035
diff
changeset
|
1166 { |
15822 | 1167 PurpleBlistNode *node; |
31096
b76def85cc04
gtkblist: Fix a few memory leaks. Refs #13162.
morshed.nader@gmail.com
parents:
31086
diff
changeset
|
1168 |
b76def85cc04
gtkblist: Fix a few memory leaks. Refs #13162.
morshed.nader@gmail.com
parents:
31086
diff
changeset
|
1169 gtk_tree_model_get(GTK_TREE_MODEL(gtkblist->treemodel), iter, NODE_COLUMN, &node, -1); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1170 |
15822 | 1171 if (PURPLE_BLIST_NODE_IS_GROUP(node)) { |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1172 char *title; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1173 |
15820 | 1174 title = pidgin_get_group_title(node, TRUE); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1175 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1176 gtk_tree_store_set(gtkblist->treemodel, iter, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1177 NAME_COLUMN, title, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1178 -1); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1179 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1180 g_free(title); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1181 |
15822 | 1182 purple_blist_node_set_bool(node, "collapsed", FALSE); |
22663
654f8386f4b3
Destroy the tooltip when a group in the buddylist is expanded or collapsed
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22611
diff
changeset
|
1183 pidgin_blist_tooltip_destroy(); |
15373
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 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1186 |
17116
17117b8cfbb7
Patch from SuperMMX to correctly update the expand state of contacts
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
17035
diff
changeset
|
1187 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:
17035
diff
changeset
|
1188 { |
15822 | 1189 PurpleBlistNode *node; |
31096
b76def85cc04
gtkblist: Fix a few memory leaks. Refs #13162.
morshed.nader@gmail.com
parents:
31086
diff
changeset
|
1190 |
b76def85cc04
gtkblist: Fix a few memory leaks. Refs #13162.
morshed.nader@gmail.com
parents:
31086
diff
changeset
|
1191 gtk_tree_model_get(GTK_TREE_MODEL(gtkblist->treemodel), iter, NODE_COLUMN, &node, -1); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1192 |
15822 | 1193 if (PURPLE_BLIST_NODE_IS_GROUP(node)) { |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1194 char *title; |
17116
17117b8cfbb7
Patch from SuperMMX to correctly update the expand state of contacts
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
17035
diff
changeset
|
1195 struct _pidgin_blist_node *gtknode; |
17117b8cfbb7
Patch from SuperMMX to correctly update the expand state of contacts
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
17035
diff
changeset
|
1196 PurpleBlistNode *cnode; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1197 |
15820 | 1198 title = pidgin_get_group_title(node, FALSE); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1199 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1200 gtk_tree_store_set(gtkblist->treemodel, iter, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1201 NAME_COLUMN, title, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1202 -1); |
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 g_free(title); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1205 |
15822 | 1206 purple_blist_node_set_bool(node, "collapsed", TRUE); |
17116
17117b8cfbb7
Patch from SuperMMX to correctly update the expand state of contacts
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
17035
diff
changeset
|
1207 |
29337
3420370e4dfb
a bunch more struct hiding fixes, but too much for me at the moment
Gary Kramlich <grim@reaperworld.com>
parents:
29219
diff
changeset
|
1208 for(cnode = purple_blist_node_get_first_child(node); cnode; cnode = purple_blist_node_get_sibling_next(cnode)) { |
17116
17117b8cfbb7
Patch from SuperMMX to correctly update the expand state of contacts
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
17035
diff
changeset
|
1209 if (PURPLE_BLIST_NODE_IS_CONTACT(cnode)) { |
29337
3420370e4dfb
a bunch more struct hiding fixes, but too much for me at the moment
Gary Kramlich <grim@reaperworld.com>
parents:
29219
diff
changeset
|
1210 gtknode = purple_blist_node_get_ui_data(cnode); |
17116
17117b8cfbb7
Patch from SuperMMX to correctly update the expand state of contacts
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
17035
diff
changeset
|
1211 if (!gtknode->contact_expanded) |
17117b8cfbb7
Patch from SuperMMX to correctly update the expand state of contacts
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
17035
diff
changeset
|
1212 continue; |
17117b8cfbb7
Patch from SuperMMX to correctly update the expand state of contacts
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
17035
diff
changeset
|
1213 gtknode->contact_expanded = FALSE; |
17117b8cfbb7
Patch from SuperMMX to correctly update the expand state of contacts
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
17035
diff
changeset
|
1214 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:
17035
diff
changeset
|
1215 } |
17117b8cfbb7
Patch from SuperMMX to correctly update the expand state of contacts
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
17035
diff
changeset
|
1216 } |
22663
654f8386f4b3
Destroy the tooltip when a group in the buddylist is expanded or collapsed
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22611
diff
changeset
|
1217 pidgin_blist_tooltip_destroy(); |
15822 | 1218 } else if(PURPLE_BLIST_NODE_IS_CONTACT(node)) { |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
1219 pidgin_blist_collapse_contact_cb(NULL, node); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1220 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1221 } |
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 static void gtk_blist_row_activated_cb(GtkTreeView *tv, GtkTreePath *path, GtkTreeViewColumn *col, gpointer data) { |
15822 | 1224 PurpleBlistNode *node; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1225 GtkTreeIter iter; |
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 gtk_tree_model_get_iter(GTK_TREE_MODEL(gtkblist->treemodel), &iter, path); |
31096
b76def85cc04
gtkblist: Fix a few memory leaks. Refs #13162.
morshed.nader@gmail.com
parents:
31086
diff
changeset
|
1228 gtk_tree_model_get(GTK_TREE_MODEL(gtkblist->treemodel), &iter, NODE_COLUMN, &node, -1); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1229 |
15822 | 1230 if(PURPLE_BLIST_NODE_IS_CONTACT(node) || PURPLE_BLIST_NODE_IS_BUDDY(node)) { |
1231 PurpleBuddy *buddy; | |
1232 | |
1233 if(PURPLE_BLIST_NODE_IS_CONTACT(node)) | |
1234 buddy = purple_contact_get_priority_buddy((PurpleContact*)node); | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1235 else |
15822 | 1236 buddy = (PurpleBuddy*)node; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1237 |
29337
3420370e4dfb
a bunch more struct hiding fixes, but too much for me at the moment
Gary Kramlich <grim@reaperworld.com>
parents:
29219
diff
changeset
|
1238 pidgin_dialogs_im_with_user(purple_buddy_get_account(buddy), purple_buddy_get_name(buddy)); |
15822 | 1239 } else if (PURPLE_BLIST_NODE_IS_CHAT(node)) { |
1240 gtk_blist_join_chat((PurpleChat *)node); | |
1241 } else if (PURPLE_BLIST_NODE_IS_GROUP(node)) { | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1242 /* 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
|
1243 gtk_tree_view_collapse_row(tv, path); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1244 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1245 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
|
1246 } |
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 |
22007
c38d72677c8a
Probe for -Wstrict-prototypes to get some more warnings. I then cleaned up
Richard Laager <rlaager@wiktel.com>
parents:
21960
diff
changeset
|
1249 static void pidgin_blist_add_chat_cb(void) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1250 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1251 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
|
1252 GtkTreeIter iter; |
15822 | 1253 PurpleBlistNode *node; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1254 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1255 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
|
1256 gtk_tree_model_get(GTK_TREE_MODEL(gtkblist->treemodel), &iter, NODE_COLUMN, &node, -1); |
15822 | 1257 if (PURPLE_BLIST_NODE_IS_BUDDY(node)) |
29337
3420370e4dfb
a bunch more struct hiding fixes, but too much for me at the moment
Gary Kramlich <grim@reaperworld.com>
parents:
29219
diff
changeset
|
1258 purple_blist_request_add_chat(NULL, purple_buddy_get_group(PURPLE_BUDDY(node)), NULL, NULL); |
15822 | 1259 if (PURPLE_BLIST_NODE_IS_CONTACT(node) || PURPLE_BLIST_NODE_IS_CHAT(node)) |
29337
3420370e4dfb
a bunch more struct hiding fixes, but too much for me at the moment
Gary Kramlich <grim@reaperworld.com>
parents:
29219
diff
changeset
|
1260 purple_blist_request_add_chat(NULL, purple_contact_get_group(PURPLE_CONTACT(node)), NULL, NULL); |
15822 | 1261 else if (PURPLE_BLIST_NODE_IS_GROUP(node)) |
1262 purple_blist_request_add_chat(NULL, (PurpleGroup*)node, NULL, NULL); | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1263 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1264 else { |
15822 | 1265 purple_blist_request_add_chat(NULL, NULL, NULL, NULL); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1266 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1267 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1268 |
22007
c38d72677c8a
Probe for -Wstrict-prototypes to get some more warnings. I then cleaned up
Richard Laager <rlaager@wiktel.com>
parents:
21960
diff
changeset
|
1269 static void pidgin_blist_add_buddy_cb(void) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1270 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1271 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
|
1272 GtkTreeIter iter; |
15822 | 1273 PurpleBlistNode *node; |
15373
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 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
|
1276 gtk_tree_model_get(GTK_TREE_MODEL(gtkblist->treemodel), &iter, NODE_COLUMN, &node, -1); |
15822 | 1277 if (PURPLE_BLIST_NODE_IS_BUDDY(node)) { |
29337
3420370e4dfb
a bunch more struct hiding fixes, but too much for me at the moment
Gary Kramlich <grim@reaperworld.com>
parents:
29219
diff
changeset
|
1278 PurpleGroup *group = purple_buddy_get_group(PURPLE_BUDDY(node)); |
3420370e4dfb
a bunch more struct hiding fixes, but too much for me at the moment
Gary Kramlich <grim@reaperworld.com>
parents:
29219
diff
changeset
|
1279 purple_blist_request_add_buddy(NULL, NULL, purple_group_get_name(group), NULL); |
3420370e4dfb
a bunch more struct hiding fixes, but too much for me at the moment
Gary Kramlich <grim@reaperworld.com>
parents:
29219
diff
changeset
|
1280 } else if (PURPLE_BLIST_NODE_IS_CONTACT(node) || PURPLE_BLIST_NODE_IS_CHAT(node)) { |
3420370e4dfb
a bunch more struct hiding fixes, but too much for me at the moment
Gary Kramlich <grim@reaperworld.com>
parents:
29219
diff
changeset
|
1281 PurpleGroup *group = purple_contact_get_group(PURPLE_CONTACT(node)); |
3420370e4dfb
a bunch more struct hiding fixes, but too much for me at the moment
Gary Kramlich <grim@reaperworld.com>
parents:
29219
diff
changeset
|
1282 purple_blist_request_add_buddy(NULL, NULL, purple_group_get_name(group), NULL); |
15822 | 1283 } else if (PURPLE_BLIST_NODE_IS_GROUP(node)) { |
29337
3420370e4dfb
a bunch more struct hiding fixes, but too much for me at the moment
Gary Kramlich <grim@reaperworld.com>
parents:
29219
diff
changeset
|
1284 purple_blist_request_add_buddy(NULL, NULL, purple_group_get_name(PURPLE_GROUP(node)), NULL); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1285 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1286 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1287 else { |
15822 | 1288 purple_blist_request_add_buddy(NULL, NULL, NULL, NULL); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1289 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1290 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1291 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1292 static void |
15822 | 1293 pidgin_blist_remove_cb (GtkWidget *w, PurpleBlistNode *node) |
1294 { | |
1295 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
|
1296 pidgin_dialogs_remove_buddy((PurpleBuddy*)node); |
15822 | 1297 } 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
|
1298 pidgin_dialogs_remove_chat((PurpleChat*)node); |
15822 | 1299 } 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
|
1300 pidgin_dialogs_remove_group((PurpleGroup*)node); |
15822 | 1301 } 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
|
1302 pidgin_dialogs_remove_contact((PurpleContact*)node); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1303 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1304 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1305 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1306 struct _expand { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1307 GtkTreeView *treeview; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1308 GtkTreePath *path; |
15822 | 1309 PurpleBlistNode *node; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1310 }; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1311 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1312 static gboolean |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1313 scroll_to_expanded_cell(gpointer data) |
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 struct _expand *ex = data; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1316 gtk_tree_view_scroll_to_cell(ex->treeview, ex->path, NULL, FALSE, 0, 0); |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
1317 pidgin_blist_update_contact(NULL, ex->node); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1318 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1319 gtk_tree_path_free(ex->path); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1320 g_free(ex); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1321 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1322 return FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1323 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1324 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1325 static void |
15822 | 1326 pidgin_blist_expand_contact_cb(GtkWidget *w, PurpleBlistNode *node) |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
1327 { |
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
1328 struct _pidgin_blist_node *gtknode; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1329 GtkTreeIter iter, parent; |
15822 | 1330 PurpleBlistNode *bnode; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1331 GtkTreePath *path; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1332 |
15822 | 1333 if(!PURPLE_BLIST_NODE_IS_CONTACT(node)) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1334 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1335 |
29337
3420370e4dfb
a bunch more struct hiding fixes, but too much for me at the moment
Gary Kramlich <grim@reaperworld.com>
parents:
29219
diff
changeset
|
1336 gtknode = purple_blist_node_get_ui_data(node); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1337 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1338 gtknode->contact_expanded = TRUE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1339 |
29337
3420370e4dfb
a bunch more struct hiding fixes, but too much for me at the moment
Gary Kramlich <grim@reaperworld.com>
parents:
29219
diff
changeset
|
1340 for(bnode = purple_blist_node_get_first_child(node); bnode; bnode = purple_blist_node_get_sibling_next(bnode)) { |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
1341 pidgin_blist_update(NULL, bnode); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1342 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1343 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1344 /* 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
|
1345 if (get_iter_from_node(node, &parent)) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1346 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
|
1347 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1348 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
|
1349 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
|
1350 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
|
1351 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1352 /* 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
|
1353 ex->treeview = GTK_TREE_VIEW(gtkblist->treeview); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1354 ex->path = path; |
29337
3420370e4dfb
a bunch more struct hiding fixes, but too much for me at the moment
Gary Kramlich <grim@reaperworld.com>
parents:
29219
diff
changeset
|
1355 ex->node = purple_blist_node_get_first_child(node); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1356 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
|
1357 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1358 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1359 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1360 static void |
15822 | 1361 pidgin_blist_collapse_contact_cb(GtkWidget *w, PurpleBlistNode *node) |
1362 { | |
1363 PurpleBlistNode *bnode; | |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
1364 struct _pidgin_blist_node *gtknode; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1365 |
15822 | 1366 if(!PURPLE_BLIST_NODE_IS_CONTACT(node)) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1367 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1368 |
29337
3420370e4dfb
a bunch more struct hiding fixes, but too much for me at the moment
Gary Kramlich <grim@reaperworld.com>
parents:
29219
diff
changeset
|
1369 gtknode = purple_blist_node_get_ui_data(node); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1370 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1371 gtknode->contact_expanded = FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1372 |
29337
3420370e4dfb
a bunch more struct hiding fixes, but too much for me at the moment
Gary Kramlich <grim@reaperworld.com>
parents:
29219
diff
changeset
|
1373 for(bnode = purple_blist_node_get_first_child(node); bnode; bnode = purple_blist_node_get_sibling_next(bnode)) { |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
1374 pidgin_blist_update(NULL, bnode); |
15373
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 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1377 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1378 static void |
15822 | 1379 toggle_privacy(GtkWidget *widget, PurpleBlistNode *node) |
1380 { | |
1381 PurpleBuddy *buddy; | |
1382 PurpleAccount *account; | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1383 gboolean permitted; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1384 const char *name; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1385 |
15822 | 1386 if (!PURPLE_BLIST_NODE_IS_BUDDY(node)) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1387 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1388 |
15822 | 1389 buddy = (PurpleBuddy *)node; |
1390 account = purple_buddy_get_account(buddy); | |
1391 name = purple_buddy_get_name(buddy); | |
1392 | |
1393 permitted = purple_privacy_check(account, name); | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1394 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1395 /* 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
|
1396 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1397 if (permitted) |
15822 | 1398 purple_privacy_deny(account, name, FALSE, FALSE); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1399 else |
15822 | 1400 purple_privacy_allow(account, name, FALSE, FALSE); |
1401 | |
1402 pidgin_blist_update(purple_get_blist(), node); | |
1403 } | |
1404 | |
1405 void pidgin_append_blist_node_privacy_menu(GtkWidget *menu, PurpleBlistNode *node) | |
1406 { | |
1407 PurpleBuddy *buddy = (PurpleBuddy *)node; | |
1408 PurpleAccount *account; | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1409 gboolean permitted; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1410 |
15822 | 1411 account = purple_buddy_get_account(buddy); |
1412 permitted = purple_privacy_check(account, purple_buddy_get_name(buddy)); | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1413 |
15506 | 1414 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
|
1415 permitted ? PIDGIN_STOCK_TOOLBAR_BLOCK : PIDGIN_STOCK_TOOLBAR_UNBLOCK, G_CALLBACK(toggle_privacy), |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1416 node, 0 ,0, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1417 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1418 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1419 void |
15822 | 1420 pidgin_append_blist_node_proto_menu(GtkWidget *menu, PurpleConnection *gc, |
1421 PurpleBlistNode *node) | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1422 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1423 GList *l, *ll; |
32305
2ec94166be43
On the way to hiding the PurpleConnection struct.
andrew.victor@mxit.com
parents:
32246
diff
changeset
|
1424 PurplePluginProtocolInfo *prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(purple_connection_get_prpl(gc)); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1425 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1426 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
|
1427 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1428 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1429 for(l = ll = prpl_info->blist_node_menu(node); l; l = l->next) { |
15822 | 1430 PurpleMenuAction *act = (PurpleMenuAction *) l->data; |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
1431 pidgin_append_menu_action(menu, act, node); |
15373
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 g_list_free(ll); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1434 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1435 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1436 void |
15822 | 1437 pidgin_append_blist_node_extended_menu(GtkWidget *menu, PurpleBlistNode *node) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1438 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1439 GList *l, *ll; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1440 |
15822 | 1441 for(l = ll = purple_blist_node_get_extended_menu(node); l; l = l->next) { |
1442 PurpleMenuAction *act = (PurpleMenuAction *) l->data; | |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
1443 pidgin_append_menu_action(menu, act, node); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1444 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1445 g_list_free(ll); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1446 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1447 |
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
|
1448 |
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
|
1449 |
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
|
1450 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
|
1451 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
|
1452 { |
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
|
1453 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
|
1454 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
|
1455 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
|
1456 |
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
|
1457 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
|
1458 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
|
1459 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
|
1460 |
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
|
1461 submenu = gtk_menu_new(); |
20099
ac6bf49cd5ba
Various warning fixes and a small leak fix.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20084
diff
changeset
|
1462 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
|
1463 |
29337
3420370e4dfb
a bunch more struct hiding fixes, but too much for me at the moment
Gary Kramlich <grim@reaperworld.com>
parents:
29219
diff
changeset
|
1464 for (group = purple_blist_get_root(); group; group = purple_blist_node_get_sibling_next(group)) { |
3420370e4dfb
a bunch more struct hiding fixes, but too much for me at the moment
Gary Kramlich <grim@reaperworld.com>
parents:
29219
diff
changeset
|
1465 if (!PURPLE_BLIST_NODE_IS_GROUP(group)) |
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
|
1466 continue; |
29337
3420370e4dfb
a bunch more struct hiding fixes, but too much for me at the moment
Gary Kramlich <grim@reaperworld.com>
parents:
29219
diff
changeset
|
1467 if (group == purple_blist_node_get_parent(node)) |
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
|
1468 continue; |
20099
ac6bf49cd5ba
Various warning fixes and a small leak fix.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20084
diff
changeset
|
1469 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
|
1470 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
|
1471 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
|
1472 } |
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
|
1473 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
|
1474 } |
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
|
1475 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1476 void |
15822 | 1477 pidgin_blist_make_buddy_menu(GtkWidget *menu, PurpleBuddy *buddy, gboolean sub) { |
29337
3420370e4dfb
a bunch more struct hiding fixes, but too much for me at the moment
Gary Kramlich <grim@reaperworld.com>
parents:
29219
diff
changeset
|
1478 PurpleAccount *account = NULL; |
3420370e4dfb
a bunch more struct hiding fixes, but too much for me at the moment
Gary Kramlich <grim@reaperworld.com>
parents:
29219
diff
changeset
|
1479 PurpleConnection *pc = NULL; |
15822 | 1480 PurplePluginProtocolInfo *prpl_info; |
1481 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
|
1482 PurpleBlistNode *node; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1483 gboolean contact_expanded = FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1484 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1485 g_return_if_fail(menu); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1486 g_return_if_fail(buddy); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1487 |
29337
3420370e4dfb
a bunch more struct hiding fixes, but too much for me at the moment
Gary Kramlich <grim@reaperworld.com>
parents:
29219
diff
changeset
|
1488 account = purple_buddy_get_account(buddy); |
3420370e4dfb
a bunch more struct hiding fixes, but too much for me at the moment
Gary Kramlich <grim@reaperworld.com>
parents:
29219
diff
changeset
|
1489 pc = purple_account_get_connection(account); |
3420370e4dfb
a bunch more struct hiding fixes, but too much for me at the moment
Gary Kramlich <grim@reaperworld.com>
parents:
29219
diff
changeset
|
1490 prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(purple_connection_get_prpl(pc)); |
3420370e4dfb
a bunch more struct hiding fixes, but too much for me at the moment
Gary Kramlich <grim@reaperworld.com>
parents:
29219
diff
changeset
|
1491 |
3420370e4dfb
a bunch more struct hiding fixes, but too much for me at the moment
Gary Kramlich <grim@reaperworld.com>
parents:
29219
diff
changeset
|
1492 node = PURPLE_BLIST_NODE(buddy); |
20163
1971e13bb5f6
Merge the plugin pack's showoffline plugin's functionality to pidgin proper
Stu Tomlinson <stu@nosnilmot.com>
parents:
20161
diff
changeset
|
1493 |
15822 | 1494 contact = purple_buddy_get_contact(buddy); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1495 if (contact) { |
29337
3420370e4dfb
a bunch more struct hiding fixes, but too much for me at the moment
Gary Kramlich <grim@reaperworld.com>
parents:
29219
diff
changeset
|
1496 PidginBlistNode *node = purple_blist_node_get_ui_data(PURPLE_BLIST_NODE(contact)); |
3420370e4dfb
a bunch more struct hiding fixes, but too much for me at the moment
Gary Kramlich <grim@reaperworld.com>
parents:
29219
diff
changeset
|
1497 contact_expanded = node->contact_expanded; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1498 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1499 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1500 if (prpl_info && prpl_info->get_info) { |
15559
442128853bdb
toolbar/menu icons. reduce the imhtmltoolbar spacing. more gaimstock pruning
Sean Egan <seanegan@gmail.com>
parents:
15558
diff
changeset
|
1501 pidgin_new_item_from_stock(menu, _("Get _Info"), PIDGIN_STOCK_TOOLBAR_USER_INFO, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1502 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
|
1503 } |
15559
442128853bdb
toolbar/menu icons. reduce the imhtmltoolbar spacing. more gaimstock pruning
Sean Egan <seanegan@gmail.com>
parents:
15558
diff
changeset
|
1504 pidgin_new_item_from_stock(menu, _("I_M"), PIDGIN_STOCK_TOOLBAR_MESSAGE_NEW, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1505 G_CALLBACK(gtk_blist_menu_im_cb), buddy, 0, 0, NULL); |
31086
a8cc50c2279f
Remove trailing whitespace
Richard Laager <rlaager@wiktel.com>
parents:
30459
diff
changeset
|
1506 |
24959
e5da7110bec9
Added menu items to buddy list context menu to start voice and video sessions
Marcus Lundblad <ml@update.uu.se>
parents:
24359
diff
changeset
|
1507 #ifdef USE_VV |
26108
d6e23439b77c
Change purple_prpl_can_do_media to purple_prpl_get_media_caps.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26068
diff
changeset
|
1508 if (prpl_info && prpl_info->get_media_caps) { |
d6e23439b77c
Change purple_prpl_can_do_media to purple_prpl_get_media_caps.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26068
diff
changeset
|
1509 PurpleAccount *account = purple_buddy_get_account(buddy); |
24959
e5da7110bec9
Added menu items to buddy list context menu to start voice and video sessions
Marcus Lundblad <ml@update.uu.se>
parents:
24359
diff
changeset
|
1510 const gchar *who = purple_buddy_get_name(buddy); |
26108
d6e23439b77c
Change purple_prpl_can_do_media to purple_prpl_get_media_caps.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26068
diff
changeset
|
1511 PurpleMediaCaps caps = purple_prpl_get_media_caps(account, who); |
d6e23439b77c
Change purple_prpl_can_do_media to purple_prpl_get_media_caps.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26068
diff
changeset
|
1512 if (caps & PURPLE_MEDIA_CAPS_AUDIO) { |
24959
e5da7110bec9
Added menu items to buddy list context menu to start voice and video sessions
Marcus Lundblad <ml@update.uu.se>
parents:
24359
diff
changeset
|
1513 pidgin_new_item_from_stock(menu, _("_Audio Call"), |
e5da7110bec9
Added menu items to buddy list context menu to start voice and video sessions
Marcus Lundblad <ml@update.uu.se>
parents:
24359
diff
changeset
|
1514 PIDGIN_STOCK_TOOLBAR_AUDIO_CALL, |
e5da7110bec9
Added menu items to buddy list context menu to start voice and video sessions
Marcus Lundblad <ml@update.uu.se>
parents:
24359
diff
changeset
|
1515 G_CALLBACK(gtk_blist_menu_audio_call_cb), buddy, 0, 0, NULL); |
e5da7110bec9
Added menu items to buddy list context menu to start voice and video sessions
Marcus Lundblad <ml@update.uu.se>
parents:
24359
diff
changeset
|
1516 } |
26108
d6e23439b77c
Change purple_prpl_can_do_media to purple_prpl_get_media_caps.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26068
diff
changeset
|
1517 if (caps & PURPLE_MEDIA_CAPS_AUDIO_VIDEO) { |
24959
e5da7110bec9
Added menu items to buddy list context menu to start voice and video sessions
Marcus Lundblad <ml@update.uu.se>
parents:
24359
diff
changeset
|
1518 pidgin_new_item_from_stock(menu, _("Audio/_Video Call"), |
e5da7110bec9
Added menu items to buddy list context menu to start voice and video sessions
Marcus Lundblad <ml@update.uu.se>
parents:
24359
diff
changeset
|
1519 PIDGIN_STOCK_TOOLBAR_VIDEO_CALL, |
e5da7110bec9
Added menu items to buddy list context menu to start voice and video sessions
Marcus Lundblad <ml@update.uu.se>
parents:
24359
diff
changeset
|
1520 G_CALLBACK(gtk_blist_menu_video_call_cb), buddy, 0, 0, NULL); |
26108
d6e23439b77c
Change purple_prpl_can_do_media to purple_prpl_get_media_caps.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26068
diff
changeset
|
1521 } else if (caps & PURPLE_MEDIA_CAPS_VIDEO) { |
24959
e5da7110bec9
Added menu items to buddy list context menu to start voice and video sessions
Marcus Lundblad <ml@update.uu.se>
parents:
24359
diff
changeset
|
1522 pidgin_new_item_from_stock(menu, _("_Video Call"), |
e5da7110bec9
Added menu items to buddy list context menu to start voice and video sessions
Marcus Lundblad <ml@update.uu.se>
parents:
24359
diff
changeset
|
1523 PIDGIN_STOCK_TOOLBAR_VIDEO_CALL, |
e5da7110bec9
Added menu items to buddy list context menu to start voice and video sessions
Marcus Lundblad <ml@update.uu.se>
parents:
24359
diff
changeset
|
1524 G_CALLBACK(gtk_blist_menu_video_call_cb), buddy, 0, 0, NULL); |
e5da7110bec9
Added menu items to buddy list context menu to start voice and video sessions
Marcus Lundblad <ml@update.uu.se>
parents:
24359
diff
changeset
|
1525 } |
e5da7110bec9
Added menu items to buddy list context menu to start voice and video sessions
Marcus Lundblad <ml@update.uu.se>
parents:
24359
diff
changeset
|
1526 } |
31086
a8cc50c2279f
Remove trailing whitespace
Richard Laager <rlaager@wiktel.com>
parents:
30459
diff
changeset
|
1527 |
24959
e5da7110bec9
Added menu items to buddy list context menu to start voice and video sessions
Marcus Lundblad <ml@update.uu.se>
parents:
24359
diff
changeset
|
1528 #endif |
31086
a8cc50c2279f
Remove trailing whitespace
Richard Laager <rlaager@wiktel.com>
parents:
30459
diff
changeset
|
1529 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1530 if (prpl_info && prpl_info->send_file) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1531 if (!prpl_info->can_receive_file || |
32342
b6276b10cb10
Use the PurpleBuddy accessor functions.
andrew.victor@mxit.com
parents:
32305
diff
changeset
|
1532 prpl_info->can_receive_file(purple_account_get_connection(purple_buddy_get_account(buddy)), purple_buddy_get_name(buddy))) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1533 { |
20546
4195e0a93b1e
Ellipsize some menu actions that require further input. Fixes #1770
Sean Egan <seanegan@gmail.com>
parents:
20543
diff
changeset
|
1534 pidgin_new_item_from_stock(menu, _("_Send File..."), |
16828 | 1535 PIDGIN_STOCK_TOOLBAR_SEND_FILE, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1536 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
|
1537 buddy, 0, 0, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1538 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1539 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1540 |
20546
4195e0a93b1e
Ellipsize some menu actions that require further input. Fixes #1770
Sean Egan <seanegan@gmail.com>
parents:
20543
diff
changeset
|
1541 pidgin_new_item_from_stock(menu, _("Add Buddy _Pounce..."), NULL, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1542 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
|
1543 |
25924
584063555949
Remove trailing whitespace
Mark Doliner <mark@kingant.net>
parents:
25920
diff
changeset
|
1544 if (node->parent && node->parent->child->next && |
18671 | 1545 !sub && !contact_expanded) { |
15559
442128853bdb
toolbar/menu icons. reduce the imhtmltoolbar spacing. more gaimstock pruning
Sean Egan <seanegan@gmail.com>
parents:
15558
diff
changeset
|
1546 pidgin_new_item_from_stock(menu, _("View _Log"), NULL, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1547 G_CALLBACK(gtk_blist_menu_showlog_cb), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1548 contact, 0, 0, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1549 } else if (!sub) { |
15558 | 1550 pidgin_new_item_from_stock(menu, _("View _Log"), NULL, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1551 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
|
1552 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1553 |
27408
71e8748bc408
Close up scope on a variable and use PURPLE_BLIST_NODE_HAS_FLAG.
Etan Reisner <pidgin@unreliablesource.net>
parents:
27347
diff
changeset
|
1554 if (!PURPLE_BLIST_NODE_HAS_FLAG(node, PURPLE_BLIST_NODE_FLAG_NO_SAVE)) { |
71e8748bc408
Close up scope on a variable and use PURPLE_BLIST_NODE_HAS_FLAG.
Etan Reisner <pidgin@unreliablesource.net>
parents:
27347
diff
changeset
|
1555 gboolean show_offline = purple_blist_node_get_bool(node, "show_offline"); |
27333
b0c20567913b
Title Case some blist right-click menu items.
Etan Reisner <pidgin@unreliablesource.net>
parents:
27030
diff
changeset
|
1556 pidgin_new_item_from_stock(menu, show_offline ? _("Hide When Offline") : _("Show When Offline"), |
20163
1971e13bb5f6
Merge the plugin pack's showoffline plugin's functionality to pidgin proper
Stu Tomlinson <stu@nosnilmot.com>
parents:
20161
diff
changeset
|
1557 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
|
1558 } |
1971e13bb5f6
Merge the plugin pack's showoffline plugin's functionality to pidgin proper
Stu Tomlinson <stu@nosnilmot.com>
parents:
20161
diff
changeset
|
1559 |
32342
b6276b10cb10
Use the PurpleBuddy accessor functions.
andrew.victor@mxit.com
parents:
32305
diff
changeset
|
1560 pidgin_append_blist_node_proto_menu(menu, purple_account_get_connection(purple_buddy_get_account(buddy)), node); |
20163
1971e13bb5f6
Merge the plugin pack's showoffline plugin's functionality to pidgin proper
Stu Tomlinson <stu@nosnilmot.com>
parents:
20161
diff
changeset
|
1561 pidgin_append_blist_node_extended_menu(menu, node); |
15822 | 1562 |
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
|
1563 if (!contact_expanded && contact != NULL) |
32350
cd46874707b1
Pidgin: Use the purple_blist_node_ accessor functions.
andrew.victor@mxit.com
parents:
32347
diff
changeset
|
1564 pidgin_append_blist_node_move_to_menu(menu, PURPLE_BLIST_NODE(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
|
1565 |
25924
584063555949
Remove trailing whitespace
Mark Doliner <mark@kingant.net>
parents:
25920
diff
changeset
|
1566 if (node->parent && node->parent->child->next && |
18671 | 1567 !sub && !contact_expanded) { |
15506 | 1568 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
|
1569 pidgin_append_blist_node_privacy_menu(menu, node); |
17468
fa5c24086481
Add the mnemonics I really meant to add before I got distracted by Add Chat
Stu Tomlinson <stu@nosnilmot.com>
parents:
17463
diff
changeset
|
1570 pidgin_new_item_from_stock(menu, _("_Alias..."), PIDGIN_STOCK_ALIAS, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1571 G_CALLBACK(gtk_blist_menu_alias_cb), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1572 contact, 0, 0, NULL); |
17468
fa5c24086481
Add the mnemonics I really meant to add before I got distracted by Add Chat
Stu Tomlinson <stu@nosnilmot.com>
parents:
17463
diff
changeset
|
1573 pidgin_new_item_from_stock(menu, _("_Remove"), GTK_STOCK_REMOVE, |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
1574 G_CALLBACK(pidgin_blist_remove_cb), |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1575 contact, 0, 0, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1576 } else if (!sub || contact_expanded) { |
15506 | 1577 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
|
1578 pidgin_append_blist_node_privacy_menu(menu, node); |
15508 | 1579 pidgin_new_item_from_stock(menu, _("_Alias..."), PIDGIN_STOCK_ALIAS, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1580 G_CALLBACK(gtk_blist_menu_alias_cb), buddy, 0, 0, NULL); |
15506 | 1581 pidgin_new_item_from_stock(menu, _("_Remove"), GTK_STOCK_REMOVE, |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
1582 G_CALLBACK(pidgin_blist_remove_cb), buddy, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1583 0, 0, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1584 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1585 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1586 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1587 static gboolean |
17750
319bcb73eb4e
Use utility functions to get user info. Closes #964.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
17116
diff
changeset
|
1588 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:
17116
diff
changeset
|
1589 { |
15822 | 1590 PurpleBlistNode *node; |
27029
e6031586fd1b
Apply patch from Peter to handle the left and right arrow keys in the buddy
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26991
diff
changeset
|
1591 GtkTreeIter iter, parent; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1592 GtkTreeSelection *sel; |
27029
e6031586fd1b
Apply patch from Peter to handle the left and right arrow keys in the buddy
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26991
diff
changeset
|
1593 GtkTreePath *path; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1594 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1595 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
|
1596 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
|
1597 return FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1598 |
31096
b76def85cc04
gtkblist: Fix a few memory leaks. Refs #13162.
morshed.nader@gmail.com
parents:
31086
diff
changeset
|
1599 gtk_tree_model_get(GTK_TREE_MODEL(gtkblist->treemodel), &iter, NODE_COLUMN, &node, -1); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1600 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1601 if(event->state & GDK_CONTROL_MASK && |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1602 (event->keyval == 'o' || event->keyval == 'O')) { |
15822 | 1603 PurpleBuddy *buddy; |
1604 | |
1605 if(PURPLE_BLIST_NODE_IS_CONTACT(node)) { | |
1606 buddy = purple_contact_get_priority_buddy((PurpleContact*)node); | |
1607 } else if(PURPLE_BLIST_NODE_IS_BUDDY(node)) { | |
1608 buddy = (PurpleBuddy*)node; | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1609 } else { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1610 return FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1611 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1612 if(buddy) |
32342
b6276b10cb10
Use the PurpleBuddy accessor functions.
andrew.victor@mxit.com
parents:
32305
diff
changeset
|
1613 pidgin_retrieve_user_info(purple_account_get_connection(purple_buddy_get_account(buddy)), purple_buddy_get_name(buddy)); |
27029
e6031586fd1b
Apply patch from Peter to handle the left and right arrow keys in the buddy
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26991
diff
changeset
|
1614 } else { |
e6031586fd1b
Apply patch from Peter to handle the left and right arrow keys in the buddy
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26991
diff
changeset
|
1615 switch (event->keyval) { |
e6031586fd1b
Apply patch from Peter to handle the left and right arrow keys in the buddy
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26991
diff
changeset
|
1616 case GDK_F2: |
e6031586fd1b
Apply patch from Peter to handle the left and right arrow keys in the buddy
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26991
diff
changeset
|
1617 gtk_blist_menu_alias_cb(tv, node); |
e6031586fd1b
Apply patch from Peter to handle the left and right arrow keys in the buddy
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26991
diff
changeset
|
1618 break; |
e6031586fd1b
Apply patch from Peter to handle the left and right arrow keys in the buddy
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26991
diff
changeset
|
1619 |
e6031586fd1b
Apply patch from Peter to handle the left and right arrow keys in the buddy
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26991
diff
changeset
|
1620 case GDK_Left: |
e6031586fd1b
Apply patch from Peter to handle the left and right arrow keys in the buddy
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26991
diff
changeset
|
1621 path = gtk_tree_model_get_path(GTK_TREE_MODEL(gtkblist->treemodel), &iter); |
e6031586fd1b
Apply patch from Peter to handle the left and right arrow keys in the buddy
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26991
diff
changeset
|
1622 if (gtk_tree_view_row_expanded(GTK_TREE_VIEW(tv), path)) { |
e6031586fd1b
Apply patch from Peter to handle the left and right arrow keys in the buddy
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26991
diff
changeset
|
1623 /* Collapse the Group */ |
e6031586fd1b
Apply patch from Peter to handle the left and right arrow keys in the buddy
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26991
diff
changeset
|
1624 gtk_tree_view_collapse_row(GTK_TREE_VIEW(tv), path); |
e6031586fd1b
Apply patch from Peter to handle the left and right arrow keys in the buddy
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26991
diff
changeset
|
1625 gtk_tree_path_free(path); |
e6031586fd1b
Apply patch from Peter to handle the left and right arrow keys in the buddy
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26991
diff
changeset
|
1626 return TRUE; |
e6031586fd1b
Apply patch from Peter to handle the left and right arrow keys in the buddy
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26991
diff
changeset
|
1627 } else { |
e6031586fd1b
Apply patch from Peter to handle the left and right arrow keys in the buddy
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26991
diff
changeset
|
1628 /* Select the Parent */ |
e6031586fd1b
Apply patch from Peter to handle the left and right arrow keys in the buddy
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26991
diff
changeset
|
1629 if (gtk_tree_model_get_iter(GTK_TREE_MODEL(gtkblist->treemodel), &iter, path)) { |
e6031586fd1b
Apply patch from Peter to handle the left and right arrow keys in the buddy
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26991
diff
changeset
|
1630 if (gtk_tree_model_iter_parent(GTK_TREE_MODEL(gtkblist->treemodel), &parent, &iter)) { |
e6031586fd1b
Apply patch from Peter to handle the left and right arrow keys in the buddy
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26991
diff
changeset
|
1631 gtk_tree_path_free(path); |
e6031586fd1b
Apply patch from Peter to handle the left and right arrow keys in the buddy
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26991
diff
changeset
|
1632 path = gtk_tree_model_get_path(GTK_TREE_MODEL(gtkblist->treemodel), &parent); |
e6031586fd1b
Apply patch from Peter to handle the left and right arrow keys in the buddy
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26991
diff
changeset
|
1633 gtk_tree_view_set_cursor(GTK_TREE_VIEW(tv), path, NULL, FALSE); |
e6031586fd1b
Apply patch from Peter to handle the left and right arrow keys in the buddy
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26991
diff
changeset
|
1634 gtk_tree_path_free(path); |
e6031586fd1b
Apply patch from Peter to handle the left and right arrow keys in the buddy
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26991
diff
changeset
|
1635 return TRUE; |
e6031586fd1b
Apply patch from Peter to handle the left and right arrow keys in the buddy
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26991
diff
changeset
|
1636 } |
e6031586fd1b
Apply patch from Peter to handle the left and right arrow keys in the buddy
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26991
diff
changeset
|
1637 } |
e6031586fd1b
Apply patch from Peter to handle the left and right arrow keys in the buddy
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26991
diff
changeset
|
1638 } |
e6031586fd1b
Apply patch from Peter to handle the left and right arrow keys in the buddy
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26991
diff
changeset
|
1639 gtk_tree_path_free(path); |
e6031586fd1b
Apply patch from Peter to handle the left and right arrow keys in the buddy
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26991
diff
changeset
|
1640 break; |
e6031586fd1b
Apply patch from Peter to handle the left and right arrow keys in the buddy
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26991
diff
changeset
|
1641 |
e6031586fd1b
Apply patch from Peter to handle the left and right arrow keys in the buddy
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26991
diff
changeset
|
1642 case GDK_Right: |
e6031586fd1b
Apply patch from Peter to handle the left and right arrow keys in the buddy
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26991
diff
changeset
|
1643 path = gtk_tree_model_get_path(GTK_TREE_MODEL(gtkblist->treemodel), &iter); |
e6031586fd1b
Apply patch from Peter to handle the left and right arrow keys in the buddy
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26991
diff
changeset
|
1644 if (!gtk_tree_view_row_expanded(GTK_TREE_VIEW(tv), path)) { |
e6031586fd1b
Apply patch from Peter to handle the left and right arrow keys in the buddy
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26991
diff
changeset
|
1645 /* Expand the Group */ |
e6031586fd1b
Apply patch from Peter to handle the left and right arrow keys in the buddy
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26991
diff
changeset
|
1646 if (PURPLE_BLIST_NODE_IS_CONTACT(node)) { |
e6031586fd1b
Apply patch from Peter to handle the left and right arrow keys in the buddy
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26991
diff
changeset
|
1647 pidgin_blist_expand_contact_cb(NULL, node); |
e6031586fd1b
Apply patch from Peter to handle the left and right arrow keys in the buddy
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26991
diff
changeset
|
1648 gtk_tree_path_free(path); |
e6031586fd1b
Apply patch from Peter to handle the left and right arrow keys in the buddy
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26991
diff
changeset
|
1649 return TRUE; |
e6031586fd1b
Apply patch from Peter to handle the left and right arrow keys in the buddy
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26991
diff
changeset
|
1650 } else if (!PURPLE_BLIST_NODE_IS_BUDDY(node)) { |
e6031586fd1b
Apply patch from Peter to handle the left and right arrow keys in the buddy
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26991
diff
changeset
|
1651 gtk_tree_view_expand_row(GTK_TREE_VIEW(tv), path, FALSE); |
e6031586fd1b
Apply patch from Peter to handle the left and right arrow keys in the buddy
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26991
diff
changeset
|
1652 gtk_tree_path_free(path); |
e6031586fd1b
Apply patch from Peter to handle the left and right arrow keys in the buddy
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26991
diff
changeset
|
1653 return TRUE; |
e6031586fd1b
Apply patch from Peter to handle the left and right arrow keys in the buddy
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26991
diff
changeset
|
1654 } |
e6031586fd1b
Apply patch from Peter to handle the left and right arrow keys in the buddy
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26991
diff
changeset
|
1655 } else { |
e6031586fd1b
Apply patch from Peter to handle the left and right arrow keys in the buddy
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26991
diff
changeset
|
1656 /* Select the First Child */ |
e6031586fd1b
Apply patch from Peter to handle the left and right arrow keys in the buddy
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26991
diff
changeset
|
1657 if (gtk_tree_model_get_iter(GTK_TREE_MODEL(gtkblist->treemodel), &parent, path)) { |
e6031586fd1b
Apply patch from Peter to handle the left and right arrow keys in the buddy
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26991
diff
changeset
|
1658 if (gtk_tree_model_iter_nth_child(GTK_TREE_MODEL(gtkblist->treemodel), &iter, &parent, 0)) { |
e6031586fd1b
Apply patch from Peter to handle the left and right arrow keys in the buddy
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26991
diff
changeset
|
1659 gtk_tree_path_free(path); |
e6031586fd1b
Apply patch from Peter to handle the left and right arrow keys in the buddy
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26991
diff
changeset
|
1660 path = gtk_tree_model_get_path(GTK_TREE_MODEL(gtkblist->treemodel), &iter); |
e6031586fd1b
Apply patch from Peter to handle the left and right arrow keys in the buddy
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26991
diff
changeset
|
1661 gtk_tree_view_set_cursor(GTK_TREE_VIEW(tv), path, NULL, FALSE); |
e6031586fd1b
Apply patch from Peter to handle the left and right arrow keys in the buddy
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26991
diff
changeset
|
1662 gtk_tree_path_free(path); |
e6031586fd1b
Apply patch from Peter to handle the left and right arrow keys in the buddy
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26991
diff
changeset
|
1663 return TRUE; |
e6031586fd1b
Apply patch from Peter to handle the left and right arrow keys in the buddy
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26991
diff
changeset
|
1664 } |
e6031586fd1b
Apply patch from Peter to handle the left and right arrow keys in the buddy
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26991
diff
changeset
|
1665 } |
e6031586fd1b
Apply patch from Peter to handle the left and right arrow keys in the buddy
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26991
diff
changeset
|
1666 } |
e6031586fd1b
Apply patch from Peter to handle the left and right arrow keys in the buddy
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26991
diff
changeset
|
1667 gtk_tree_path_free(path); |
e6031586fd1b
Apply patch from Peter to handle the left and right arrow keys in the buddy
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26991
diff
changeset
|
1668 break; |
e6031586fd1b
Apply patch from Peter to handle the left and right arrow keys in the buddy
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26991
diff
changeset
|
1669 } |
15373
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 return FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1673 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1674 |
23156
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23129
diff
changeset
|
1675 static void |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23129
diff
changeset
|
1676 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:
23129
diff
changeset
|
1677 { |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23129
diff
changeset
|
1678 if (filename) { |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23129
diff
changeset
|
1679 PurpleBlistNode *node = (PurpleBlistNode*)data; |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23129
diff
changeset
|
1680 |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23129
diff
changeset
|
1681 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:
23129
diff
changeset
|
1682 filename); |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23129
diff
changeset
|
1683 } |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23129
diff
changeset
|
1684 } |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23129
diff
changeset
|
1685 |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23129
diff
changeset
|
1686 static void |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23129
diff
changeset
|
1687 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:
23129
diff
changeset
|
1688 { |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23129
diff
changeset
|
1689 /* 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:
23129
diff
changeset
|
1690 * 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:
23129
diff
changeset
|
1691 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:
23129
diff
changeset
|
1692 gtk_widget_show_all(win); |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23129
diff
changeset
|
1693 } |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23129
diff
changeset
|
1694 |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23129
diff
changeset
|
1695 static void |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23129
diff
changeset
|
1696 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:
23129
diff
changeset
|
1697 { |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23129
diff
changeset
|
1698 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:
23129
diff
changeset
|
1699 } |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23129
diff
changeset
|
1700 |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23129
diff
changeset
|
1701 static void |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23129
diff
changeset
|
1702 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:
23129
diff
changeset
|
1703 { |
23162
78dad8135c72
Disable the 'remove custom icon' item from the menu if a custom icon isn't set.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23159
diff
changeset
|
1704 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:
23159
diff
changeset
|
1705 |
23156
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23129
diff
changeset
|
1706 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:
23129
diff
changeset
|
1707 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:
23129
diff
changeset
|
1708 0, NULL); |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23129
diff
changeset
|
1709 |
23162
78dad8135c72
Disable the 'remove custom icon' item from the menu if a custom icon isn't set.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23159
diff
changeset
|
1710 item = pidgin_new_item_from_stock(menu, _("Remove Custom Icon"), NULL, |
23156
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23129
diff
changeset
|
1711 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:
23129
diff
changeset
|
1712 0, 0, NULL); |
23162
78dad8135c72
Disable the 'remove custom icon' item from the menu if a custom icon isn't set.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23159
diff
changeset
|
1713 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:
23159
diff
changeset
|
1714 gtk_widget_set_sensitive(item, FALSE); |
23156
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23129
diff
changeset
|
1715 } |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23129
diff
changeset
|
1716 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1717 static GtkWidget * |
15822 | 1718 create_group_menu (PurpleBlistNode *node, PurpleGroup *g) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1719 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1720 GtkWidget *menu; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1721 GtkWidget *item; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1722 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1723 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
|
1724 item = pidgin_new_item_from_stock(menu, _("Add _Buddy..."), GTK_STOCK_ADD, |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
1725 G_CALLBACK(pidgin_blist_add_buddy_cb), node, 0, 0, NULL); |
16766
1de66d5d1de8
if you're offline, and right-click on a group, you shouldn't be presented
Nathan Walp <nwalp@pidgin.im>
parents:
16749
diff
changeset
|
1726 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
|
1727 item = pidgin_new_item_from_stock(menu, _("Add C_hat..."), GTK_STOCK_ADD, |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
1728 G_CALLBACK(pidgin_blist_add_chat_cb), node, 0, 0, NULL); |
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
1729 gtk_widget_set_sensitive(item, pidgin_blist_joinchat_is_showable()); |
15506 | 1730 pidgin_new_item_from_stock(menu, _("_Delete Group"), GTK_STOCK_REMOVE, |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
1731 G_CALLBACK(pidgin_blist_remove_cb), node, 0, 0, NULL); |
15506 | 1732 pidgin_new_item_from_stock(menu, _("_Rename"), NULL, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1733 G_CALLBACK(gtk_blist_menu_alias_cb), node, 0, 0, NULL); |
22447
df336908dd15
Make "Show when offline" work on group nodes too, which sets the flag for
Stu Tomlinson <stu@nosnilmot.com>
parents:
22323
diff
changeset
|
1734 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:
22323
diff
changeset
|
1735 gboolean show_offline = purple_blist_node_get_bool(node, "show_offline"); |
27333
b0c20567913b
Title Case some blist right-click menu items.
Etan Reisner <pidgin@unreliablesource.net>
parents:
27030
diff
changeset
|
1736 pidgin_new_item_from_stock(menu, show_offline ? _("Hide When Offline") : _("Show When Offline"), |
22447
df336908dd15
Make "Show when offline" work on group nodes too, which sets the flag for
Stu Tomlinson <stu@nosnilmot.com>
parents:
22323
diff
changeset
|
1737 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:
22323
diff
changeset
|
1738 } |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1739 |
23156
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23129
diff
changeset
|
1740 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:
23129
diff
changeset
|
1741 |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
1742 pidgin_append_blist_node_extended_menu(menu, node); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1743 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1744 return menu; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1745 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1746 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1747 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
|
1748 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
|
1749 { |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1750 GtkWidget *menu; |
19945
ee5b3ac0d41d
"We are going to destroy the conversations immediately only if the 'close immediately'
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19944
diff
changeset
|
1751 gboolean autojoin, persistent; |
15373
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 = gtk_menu_new(); |
31256
43f75716a233
Stop trying to get "gtk-autojoin" as a string from chat rooms in the buddy
Mark Doliner <mark@kingant.net>
parents:
31096
diff
changeset
|
1754 autojoin = purple_blist_node_get_bool(node, "gtk-autojoin"); |
19945
ee5b3ac0d41d
"We are going to destroy the conversations immediately only if the 'close immediately'
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19944
diff
changeset
|
1755 persistent = purple_blist_node_get_bool(node, "gtk-persistent"); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1756 |
15508 | 1757 pidgin_new_item_from_stock(menu, _("_Join"), PIDGIN_STOCK_CHAT, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1758 G_CALLBACK(gtk_blist_menu_join_cb), node, 0, 0, NULL); |
15506 | 1759 pidgin_new_check_item(menu, _("Auto-Join"), |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1760 G_CALLBACK(gtk_blist_menu_autojoin_cb), node, autojoin); |
19945
ee5b3ac0d41d
"We are going to destroy the conversations immediately only if the 'close immediately'
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19944
diff
changeset
|
1761 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:
19944
diff
changeset
|
1762 G_CALLBACK(gtk_blist_menu_persistent_cb), node, persistent); |
15559
442128853bdb
toolbar/menu icons. reduce the imhtmltoolbar spacing. more gaimstock pruning
Sean Egan <seanegan@gmail.com>
parents:
15558
diff
changeset
|
1763 pidgin_new_item_from_stock(menu, _("View _Log"), NULL, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1764 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
|
1765 |
32347
76096c42f558
Use the PurpleChat accessor functions.
andrew.victor@mxit.com
parents:
32346
diff
changeset
|
1766 pidgin_append_blist_node_proto_menu(menu, purple_account_get_connection(purple_chat_get_account(c)), node); |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
1767 pidgin_append_blist_node_extended_menu(menu, node); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1768 |
15506 | 1769 pidgin_separator(menu); |
1770 | |
22784
cf88a302fa88
'Edit Settings' in the context menu for chats in the buddylist.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22712
diff
changeset
|
1771 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:
22712
diff
changeset
|
1772 G_CALLBACK(chat_components_edit), node, 0, 0, NULL); |
15508 | 1773 pidgin_new_item_from_stock(menu, _("_Alias..."), PIDGIN_STOCK_ALIAS, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1774 G_CALLBACK(gtk_blist_menu_alias_cb), node, 0, 0, NULL); |
15506 | 1775 pidgin_new_item_from_stock(menu, _("_Remove"), GTK_STOCK_REMOVE, |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
1776 G_CALLBACK(pidgin_blist_remove_cb), node, 0, 0, NULL); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1777 |
23156
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23129
diff
changeset
|
1778 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:
23129
diff
changeset
|
1779 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1780 return menu; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1781 } |
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 static GtkWidget * |
15822 | 1784 create_contact_menu (PurpleBlistNode *node) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1785 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1786 GtkWidget *menu; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1787 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1788 menu = gtk_menu_new(); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1789 |
15559
442128853bdb
toolbar/menu icons. reduce the imhtmltoolbar spacing. more gaimstock pruning
Sean Egan <seanegan@gmail.com>
parents:
15558
diff
changeset
|
1790 pidgin_new_item_from_stock(menu, _("View _Log"), NULL, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1791 G_CALLBACK(gtk_blist_menu_showlog_cb), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1792 node, 0, 0, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1793 |
15506 | 1794 pidgin_separator(menu); |
1795 | |
15508 | 1796 pidgin_new_item_from_stock(menu, _("_Alias..."), PIDGIN_STOCK_ALIAS, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1797 G_CALLBACK(gtk_blist_menu_alias_cb), node, 0, 0, NULL); |
15506 | 1798 pidgin_new_item_from_stock(menu, _("_Remove"), GTK_STOCK_REMOVE, |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
1799 G_CALLBACK(pidgin_blist_remove_cb), node, 0, 0, NULL); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1800 |
23156
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23129
diff
changeset
|
1801 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:
23129
diff
changeset
|
1802 |
15506 | 1803 pidgin_separator(menu); |
1804 | |
1805 pidgin_new_item_from_stock(menu, _("_Collapse"), GTK_STOCK_ZOOM_OUT, | |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
1806 G_CALLBACK(pidgin_blist_collapse_contact_cb), |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1807 node, 0, 0, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1808 |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
1809 pidgin_append_blist_node_extended_menu(menu, node); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1810 return menu; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1811 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1812 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1813 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
|
1814 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
|
1815 { |
32350
cd46874707b1
Pidgin: Use the purple_blist_node_ accessor functions.
andrew.victor@mxit.com
parents:
32347
diff
changeset
|
1816 struct _pidgin_blist_node *gtknode = purple_blist_node_get_ui_data(node); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1817 GtkWidget *menu; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1818 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
|
1819 gboolean show_offline = purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/blist/show_offline_buddies"); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1820 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1821 menu = gtk_menu_new(); |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
1822 pidgin_blist_make_buddy_menu(menu, b, FALSE); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1823 |
15822 | 1824 if(PURPLE_BLIST_NODE_IS_CONTACT(node)) { |
15506 | 1825 pidgin_separator(menu); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1826 |
23164
28dae90906e1
Show the custom icon menu for a contact even if it's collapsed.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23162
diff
changeset
|
1827 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:
23162
diff
changeset
|
1828 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1829 if(gtknode->contact_expanded) { |
15506 | 1830 pidgin_new_item_from_stock(menu, _("_Collapse"), |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1831 GTK_STOCK_ZOOM_OUT, |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
1832 G_CALLBACK(pidgin_blist_collapse_contact_cb), |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1833 node, 0, 0, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1834 } else { |
15506 | 1835 pidgin_new_item_from_stock(menu, _("_Expand"), |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1836 GTK_STOCK_ZOOM_IN, |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
1837 G_CALLBACK(pidgin_blist_expand_contact_cb), node, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1838 0, 0, NULL); |
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(node->child->next) { |
15822 | 1841 PurpleBlistNode *bnode; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1842 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1843 for(bnode = node->child; bnode; bnode = bnode->next) { |
15822 | 1844 PurpleBuddy *buddy = (PurpleBuddy*)bnode; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1845 GdkPixbuf *buf; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1846 GtkWidget *submenu; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1847 GtkWidget *image; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1848 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1849 if(buddy == b) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1850 continue; |
32342
b6276b10cb10
Use the PurpleBuddy accessor functions.
andrew.victor@mxit.com
parents:
32305
diff
changeset
|
1851 if(!purple_account_get_connection(purple_buddy_get_account(buddy))) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1852 continue; |
15822 | 1853 if(!show_offline && !PURPLE_BUDDY_IS_ONLINE(buddy)) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1854 continue; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1855 |
32342
b6276b10cb10
Use the PurpleBuddy accessor functions.
andrew.victor@mxit.com
parents:
32305
diff
changeset
|
1856 menuitem = gtk_image_menu_item_new_with_label(purple_buddy_get_name(buddy)); |
b6276b10cb10
Use the PurpleBuddy accessor functions.
andrew.victor@mxit.com
parents:
32305
diff
changeset
|
1857 buf = pidgin_create_prpl_icon(purple_buddy_get_account(buddy), PIDGIN_PRPL_ICON_SMALL); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1858 image = gtk_image_new_from_pixbuf(buf); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1859 g_object_unref(G_OBJECT(buf)); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1860 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
|
1861 image); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1862 gtk_widget_show(image); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1863 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
|
1864 gtk_widget_show(menuitem); |
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 submenu = gtk_menu_new(); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1867 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
|
1868 gtk_widget_show(submenu); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1869 |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
1870 pidgin_blist_make_buddy_menu(submenu, buddy, TRUE); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1871 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1872 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1873 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1874 return menu; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1875 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1876 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1877 static gboolean |
15822 | 1878 pidgin_blist_show_context_menu(PurpleBlistNode *node, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1879 GtkMenuPositionFunc func, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1880 GtkWidget *tv, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1881 guint button, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1882 guint32 time) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1883 { |
32350
cd46874707b1
Pidgin: Use the purple_blist_node_ accessor functions.
andrew.victor@mxit.com
parents:
32347
diff
changeset
|
1884 struct _pidgin_blist_node *gtknode = purple_blist_node_get_ui_data(node); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1885 GtkWidget *menu = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1886 gboolean handled = FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1887 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1888 /* Create a menu based on the thing we right-clicked on */ |
15822 | 1889 if (PURPLE_BLIST_NODE_IS_GROUP(node)) { |
1890 PurpleGroup *g = (PurpleGroup *)node; | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1891 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1892 menu = create_group_menu(node, g); |
15822 | 1893 } else if (PURPLE_BLIST_NODE_IS_CHAT(node)) { |
1894 PurpleChat *c = (PurpleChat *)node; | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1895 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1896 menu = create_chat_menu(node, c); |
15822 | 1897 } else if ((PURPLE_BLIST_NODE_IS_CONTACT(node)) && (gtknode->contact_expanded)) { |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1898 menu = create_contact_menu(node); |
15822 | 1899 } else if (PURPLE_BLIST_NODE_IS_CONTACT(node) || PURPLE_BLIST_NODE_IS_BUDDY(node)) { |
1900 PurpleBuddy *b; | |
1901 | |
1902 if (PURPLE_BLIST_NODE_IS_CONTACT(node)) | |
1903 b = purple_contact_get_priority_buddy((PurpleContact*)node); | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1904 else |
15822 | 1905 b = (PurpleBuddy *)node; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1906 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1907 menu = create_buddy_menu(node, b); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1908 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1909 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1910 #ifdef _WIN32 |
22974
8ac3ffa6841e
Patch from Arban57 to prevent tooltips conflicting with the context menu on
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22934
diff
changeset
|
1911 pidgin_blist_tooltip_destroy(); |
8ac3ffa6841e
Patch from Arban57 to prevent tooltips conflicting with the context menu on
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22934
diff
changeset
|
1912 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1913 /* 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
|
1914 * 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
|
1915 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
|
1916 if (gtkblist->timeout) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1917 g_source_remove(gtkblist->timeout); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1918 gtkblist->timeout = 0; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1919 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1920 #endif |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1921 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1922 /* Now display the menu */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1923 if (menu != NULL) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1924 gtk_widget_show_all(menu); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1925 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
|
1926 handled = TRUE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1927 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1928 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1929 return handled; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1930 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1931 |
25924
584063555949
Remove trailing whitespace
Mark Doliner <mark@kingant.net>
parents:
25920
diff
changeset
|
1932 static gboolean |
25109
824e97a1dd22
fixed some small font bugs, the coloring when selected, and a segfault
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25108
diff
changeset
|
1933 gtk_blist_button_press_cb(GtkWidget *tv, GdkEventButton *event, gpointer user_data) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1934 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1935 GtkTreePath *path; |
15822 | 1936 PurpleBlistNode *node; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1937 GtkTreeIter iter; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1938 GtkTreeSelection *sel; |
15822 | 1939 PurplePlugin *prpl = NULL; |
1940 PurplePluginProtocolInfo *prpl_info = NULL; | |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
1941 struct _pidgin_blist_node *gtknode; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1942 gboolean handled = FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1943 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1944 /* 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
|
1945 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
|
1946 return FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1947 gtk_tree_model_get_iter(GTK_TREE_MODEL(gtkblist->treemodel), &iter, path); |
31096
b76def85cc04
gtkblist: Fix a few memory leaks. Refs #13162.
morshed.nader@gmail.com
parents:
31086
diff
changeset
|
1948 gtk_tree_model_get(GTK_TREE_MODEL(gtkblist->treemodel), &iter, NODE_COLUMN, &node, -1); |
32350
cd46874707b1
Pidgin: Use the purple_blist_node_ accessor functions.
andrew.victor@mxit.com
parents:
32347
diff
changeset
|
1949 gtknode = purple_blist_node_get_ui_data(node); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1950 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1951 /* Right click draws a context menu */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1952 if ((event->button == 3) && (event->type == GDK_BUTTON_PRESS)) { |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
1953 handled = pidgin_blist_show_context_menu(node, NULL, tv, 3, event->time); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1954 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1955 /* 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
|
1956 } else if ((event->button == 2) && (event->type == GDK_BUTTON_PRESS) && |
15822 | 1957 (event->state & GDK_CONTROL_MASK) && (PURPLE_BLIST_NODE_IS_CONTACT(node))) { |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1958 if (gtknode->contact_expanded) |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
1959 pidgin_blist_collapse_contact_cb(NULL, node); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1960 else |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
1961 pidgin_blist_expand_contact_cb(NULL, node); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1962 handled = TRUE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1963 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1964 /* Double middle click gets info */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1965 } else if ((event->button == 2) && (event->type == GDK_2BUTTON_PRESS) && |
15822 | 1966 ((PURPLE_BLIST_NODE_IS_CONTACT(node)) || (PURPLE_BLIST_NODE_IS_BUDDY(node)))) { |
1967 PurpleBuddy *b; | |
1968 if(PURPLE_BLIST_NODE_IS_CONTACT(node)) | |
1969 b = purple_contact_get_priority_buddy((PurpleContact*)node); | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1970 else |
15822 | 1971 b = (PurpleBuddy *)node; |
1972 | |
32342
b6276b10cb10
Use the PurpleBuddy accessor functions.
andrew.victor@mxit.com
parents:
32305
diff
changeset
|
1973 prpl = purple_find_prpl(purple_account_get_protocol_id(purple_buddy_get_account(b))); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1974 if (prpl != NULL) |
15822 | 1975 prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(prpl); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1976 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1977 if (prpl && prpl_info->get_info) |
32342
b6276b10cb10
Use the PurpleBuddy accessor functions.
andrew.victor@mxit.com
parents:
32305
diff
changeset
|
1978 pidgin_retrieve_user_info(purple_account_get_connection(purple_buddy_get_account(b)), purple_buddy_get_name(b)); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1979 handled = TRUE; |
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 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1982 #if (1) |
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 * 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
|
1985 * 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
|
1986 * 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
|
1987 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1988 * 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
|
1989 * was handled? --Mark |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1990 */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1991 if(handled) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1992 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
|
1993 gtk_tree_selection_select_path(sel, path); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1994 gtk_tree_path_free(path); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1995 return TRUE; |
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 #endif |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1998 gtk_tree_path_free(path); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1999 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2000 return FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2001 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2002 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2003 static gboolean |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
2004 pidgin_blist_popup_menu_cb(GtkWidget *tv, void *user_data) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2005 { |
15822 | 2006 PurpleBlistNode *node; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2007 GtkTreeIter iter; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2008 GtkTreeSelection *sel; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2009 gboolean handled = FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2010 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2011 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
|
2012 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
|
2013 return FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2014 |
31096
b76def85cc04
gtkblist: Fix a few memory leaks. Refs #13162.
morshed.nader@gmail.com
parents:
31086
diff
changeset
|
2015 gtk_tree_model_get(GTK_TREE_MODEL(gtkblist->treemodel), &iter, NODE_COLUMN, &node, -1); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2016 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2017 /* Shift+F10 draws a context menu */ |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
2018 handled = pidgin_blist_show_context_menu(node, pidgin_treeview_popup_menu_position_func, tv, 0, GDK_CURRENT_TIME); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2019 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2020 return handled; |
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 |
32582
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
2023 static void gtk_blist_show_xfer_dialog_cb(GtkAction *item, gpointer data) |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
2024 { |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
2025 pidgin_xfer_dialog_show(NULL); |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
2026 } |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
2027 |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
2028 static void pidgin_blist_buddy_details_cb(GtkToggleAction *item, gpointer data) |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
2029 { |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
2030 pidgin_set_cursor(gtkblist->window, GDK_WATCH); |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
2031 |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
2032 purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/blist/show_buddy_icons", |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
2033 gtk_toggle_action_get_active(item)); |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
2034 |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
2035 pidgin_clear_cursor(gtkblist->window); |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
2036 } |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
2037 |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
2038 static void pidgin_blist_show_idle_time_cb(GtkToggleAction *item, gpointer data) |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
2039 { |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
2040 pidgin_set_cursor(gtkblist->window, GDK_WATCH); |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
2041 |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
2042 purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/blist/show_idle_time", |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
2043 gtk_toggle_action_get_active(item)); |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
2044 |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
2045 pidgin_clear_cursor(gtkblist->window); |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
2046 } |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
2047 |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
2048 static void pidgin_blist_show_protocol_icons_cb(GtkToggleAction *item, gpointer data) |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
2049 { |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
2050 purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/blist/show_protocol_icons", |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
2051 gtk_toggle_action_get_active(item)); |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
2052 } |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
2053 |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
2054 static void pidgin_blist_show_empty_groups_cb(GtkToggleAction *item, gpointer data) |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
2055 { |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
2056 pidgin_set_cursor(gtkblist->window, GDK_WATCH); |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
2057 |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
2058 purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/blist/show_empty_groups", |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
2059 gtk_toggle_action_get_active(item)); |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
2060 |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
2061 pidgin_clear_cursor(gtkblist->window); |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
2062 } |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
2063 |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
2064 static void pidgin_blist_edit_mode_cb(GtkToggleAction *checkitem, gpointer data) |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
2065 { |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
2066 pidgin_set_cursor(gtkblist->window, GDK_WATCH); |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
2067 |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
2068 purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/blist/show_offline_buddies", |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
2069 gtk_toggle_action_get_active(checkitem)); |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
2070 |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
2071 pidgin_clear_cursor(gtkblist->window); |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
2072 } |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
2073 |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
2074 static void pidgin_blist_mute_sounds_cb(GtkToggleAction *item, gpointer data) |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
2075 { |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
2076 purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/sound/mute", |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
2077 gtk_toggle_action_get_active(item)); |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
2078 } |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
2079 |
15373
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 static void |
15822 | 2082 pidgin_blist_mute_pref_cb(const char *name, PurplePrefType type, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2083 gconstpointer value, gpointer data) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2084 { |
32582
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
2085 gtk_toggle_action_set_active(GTK_TOGGLE_ACTION(gtk_ui_manager_get_action(gtkblist->ui, |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
2086 "/BList/ToolsMenu/MuteSounds")), (gboolean)GPOINTER_TO_INT(value)); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2087 } |
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 static void |
15822 | 2090 pidgin_blist_sound_method_pref_cb(const char *name, PurplePrefType type, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2091 gconstpointer value, gpointer data) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2092 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2093 gboolean sensitive = TRUE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2094 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2095 if(!strcmp(value, "none")) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2096 sensitive = FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2097 |
32582
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
2098 gtk_action_set_sensitive(gtk_ui_manager_get_action(gtkblist->ui, "/BList/ToolsMenu/MuteSounds"), sensitive); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2099 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2100 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2101 static void |
15822 | 2102 add_buddies_from_vcard(const char *prpl_id, PurpleGroup *group, GList *list, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2103 const char *alias) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2104 { |
18063
926ccb104da0
disapproval of revision '1411afd7660760db59966c3a9f18e2adab8eb27e'
Richard Laager <rlaager@wiktel.com>
parents:
18058
diff
changeset
|
2105 GList *l; |
15822 | 2106 PurpleAccount *account = NULL; |
2107 PurpleConnection *gc; | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2108 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2109 if (list == NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2110 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2111 |
15822 | 2112 for (l = purple_connections_get_all(); l != NULL; l = l->next) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2113 { |
15822 | 2114 gc = (PurpleConnection *)l->data; |
2115 account = purple_connection_get_account(gc); | |
2116 | |
2117 if (!strcmp(purple_account_get_protocol_id(account), prpl_id)) | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2118 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2119 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2120 account = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2121 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2122 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2123 if (account != NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2124 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2125 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
|
2126 { |
15822 | 2127 purple_blist_request_add_buddy(account, l->data, |
32346
2fdc668362f0
Use the purple_group_get_name() accessor function.
andrew.victor@mxit.com
parents:
32342
diff
changeset
|
2128 (group ? purple_group_get_name(group) : NULL), |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2129 alias); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2130 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2131 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2132 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2133 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
|
2134 g_list_free(list); |
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 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2137 static gboolean |
15822 | 2138 parse_vcard(const char *vcard, PurpleGroup *group) |
15373
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 char *temp_vcard; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2141 char *s, *c; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2142 char *alias = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2143 GList *aims = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2144 GList *icqs = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2145 GList *yahoos = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2146 GList *msns = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2147 GList *jabbers = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2148 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2149 s = temp_vcard = g_strdup(vcard); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2150 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2151 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
|
2152 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2153 char *field, *value; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2154 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2155 field = s; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2156 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2157 /* Grab the field */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2158 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
|
2159 s++; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2160 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2161 if (*s == '\r') s++; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2162 if (*s == '\n') |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2163 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2164 s++; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2165 continue; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2166 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2167 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2168 if (*s != '\0') *s++ = '\0'; |
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 if ((c = strchr(field, ';')) != NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2171 *c = '\0'; |
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 /* Proceed to the end of the line */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2174 value = s; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2175 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2176 while (*s != '\r' && *s != '\n' && *s != '\0') |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2177 s++; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2178 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2179 if (*s == '\r') *s++ = '\0'; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2180 if (*s == '\n') *s++ = '\0'; |
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 /* 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
|
2183 if (!strcmp(field, "FN")) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2184 alias = g_strdup(value); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2185 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
|
2186 !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
|
2187 !strcmp(field, "X-JABBER")) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2188 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2189 char **values = g_strsplit(value, ":", 0); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2190 char **im; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2191 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2192 for (im = values; *im != NULL; im++) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2193 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2194 if (!strcmp(field, "X-AIM")) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2195 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
|
2196 else if (!strcmp(field, "X-ICQ")) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2197 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
|
2198 else if (!strcmp(field, "X-YAHOO")) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2199 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
|
2200 else if (!strcmp(field, "X-MSN")) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2201 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
|
2202 else if (!strcmp(field, "X-JABBER")) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2203 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
|
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_strfreev(values); |
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 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2209 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2210 g_free(temp_vcard); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2211 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2212 if (aims == NULL && icqs == NULL && yahoos == NULL && |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2213 msns == NULL && jabbers == NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2214 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2215 g_free(alias); |
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 return FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2218 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2219 |
29650
0646207f360f
Remove a bunch of old references to prpl-oscar
Mark Doliner <mark@kingant.net>
parents:
29640
diff
changeset
|
2220 add_buddies_from_vcard("prpl-aim", group, aims, alias); |
0646207f360f
Remove a bunch of old references to prpl-oscar
Mark Doliner <mark@kingant.net>
parents:
29640
diff
changeset
|
2221 add_buddies_from_vcard("prpl-icq", group, icqs, alias); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2222 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
|
2223 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
|
2224 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
|
2225 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2226 g_free(alias); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2227 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2228 return TRUE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2229 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2230 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2231 #ifdef _WIN32 |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
2232 static void pidgin_blist_drag_begin(GtkWidget *widget, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2233 GdkDragContext *drag_context, gpointer user_data) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2234 { |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
2235 pidgin_blist_tooltip_destroy(); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2236 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2237 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2238 /* 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
|
2239 * to appear and obscure the dragging operation. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2240 * 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
|
2241 if (gtkblist->timeout) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2242 g_source_remove(gtkblist->timeout); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2243 gtkblist->timeout = 0; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2244 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2245 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2246 #endif |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2247 |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
2248 static void pidgin_blist_drag_data_get_cb(GtkWidget *widget, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2249 GdkDragContext *dc, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2250 GtkSelectionData *data, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2251 guint info, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2252 guint time, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2253 gpointer null) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2254 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2255 |
15822 | 2256 if (data->target == gdk_atom_intern("PURPLE_BLIST_NODE", FALSE)) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2257 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2258 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
|
2259 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
|
2260 GtkTreeIter iter; |
15822 | 2261 PurpleBlistNode *node = NULL; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2262 if(!sourcerow) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2263 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2264 gtk_tree_model_get_iter(GTK_TREE_MODEL(gtkblist->treemodel), &iter, sourcerow); |
31096
b76def85cc04
gtkblist: Fix a few memory leaks. Refs #13162.
morshed.nader@gmail.com
parents:
31086
diff
changeset
|
2265 gtk_tree_model_get(GTK_TREE_MODEL(gtkblist->treemodel), &iter, NODE_COLUMN, &node, -1); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2266 gtk_selection_data_set (data, |
15822 | 2267 gdk_atom_intern ("PURPLE_BLIST_NODE", FALSE), |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2268 8, /* bits */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2269 (void*)&node, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2270 sizeof (node)); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2271 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2272 gtk_tree_path_free(sourcerow); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2273 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2274 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
|
2275 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2276 GtkTreeRowReference *ref; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2277 GtkTreePath *sourcerow; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2278 GtkTreeIter iter; |
15822 | 2279 PurpleBlistNode *node = NULL; |
2280 PurpleBuddy *buddy; | |
2281 PurpleConnection *gc; | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2282 GString *str; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2283 const char *protocol; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2284 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2285 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
|
2286 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
|
2287 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2288 if (!sourcerow) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2289 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2290 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2291 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
|
2292 sourcerow); |
31096
b76def85cc04
gtkblist: Fix a few memory leaks. Refs #13162.
morshed.nader@gmail.com
parents:
31086
diff
changeset
|
2293 gtk_tree_model_get(GTK_TREE_MODEL(gtkblist->treemodel), &iter, NODE_COLUMN, &node, -1); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2294 |
15822 | 2295 if (PURPLE_BLIST_NODE_IS_CONTACT(node)) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2296 { |
15822 | 2297 buddy = purple_contact_get_priority_buddy((PurpleContact *)node); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2298 } |
15822 | 2299 else if (!PURPLE_BLIST_NODE_IS_BUDDY(node)) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2300 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2301 gtk_tree_path_free(sourcerow); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2302 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2303 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2304 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2305 { |
15822 | 2306 buddy = (PurpleBuddy *)node; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2307 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2308 |
32342
b6276b10cb10
Use the PurpleBuddy accessor functions.
andrew.victor@mxit.com
parents:
32305
diff
changeset
|
2309 gc = purple_account_get_connection(purple_buddy_get_account(buddy)); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2310 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2311 if (gc == NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2312 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2313 gtk_tree_path_free(sourcerow); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2314 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2315 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2316 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2317 protocol = |
32342
b6276b10cb10
Use the PurpleBuddy accessor functions.
andrew.victor@mxit.com
parents:
32305
diff
changeset
|
2318 PURPLE_PLUGIN_PROTOCOL_INFO(purple_connection_get_prpl(gc))->list_icon(purple_buddy_get_account(buddy), |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2319 buddy); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2320 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2321 str = g_string_new(NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2322 g_string_printf(str, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2323 "MIME-Version: 1.0\r\n" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2324 "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
|
2325 "X-IM-Protocol: %s\r\n" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2326 "X-IM-Username: %s\r\n", |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2327 protocol, |
32342
b6276b10cb10
Use the PurpleBuddy accessor functions.
andrew.victor@mxit.com
parents:
32305
diff
changeset
|
2328 purple_buddy_get_name(buddy)); |
b6276b10cb10
Use the PurpleBuddy accessor functions.
andrew.victor@mxit.com
parents:
32305
diff
changeset
|
2329 |
b6276b10cb10
Use the PurpleBuddy accessor functions.
andrew.victor@mxit.com
parents:
32305
diff
changeset
|
2330 if (purple_buddy_get_local_buddy_alias(buddy) != NULL) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2331 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2332 g_string_append_printf(str, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2333 "X-IM-Alias: %s\r\n", |
32342
b6276b10cb10
Use the PurpleBuddy accessor functions.
andrew.victor@mxit.com
parents:
32305
diff
changeset
|
2334 purple_buddy_get_local_buddy_alias(buddy)); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2335 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2336 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2337 g_string_append(str, "\r\n"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2338 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2339 gtk_selection_data_set(data, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2340 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
|
2341 8, /* bits */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2342 (const guchar *)str->str, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2343 strlen(str->str) + 1); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2344 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2345 g_string_free(str, TRUE); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2346 gtk_tree_path_free(sourcerow); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2347 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2348 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2349 |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
2350 static void pidgin_blist_drag_data_rcv_cb(GtkWidget *widget, GdkDragContext *dc, guint x, guint y, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2351 GtkSelectionData *sd, guint info, guint t) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2352 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2353 if (gtkblist->drag_timeout) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2354 g_source_remove(gtkblist->drag_timeout); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2355 gtkblist->drag_timeout = 0; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2356 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2357 |
15822 | 2358 if (sd->target == gdk_atom_intern("PURPLE_BLIST_NODE", FALSE) && sd->data) { |
2359 PurpleBlistNode *n = NULL; | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2360 GtkTreePath *path = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2361 GtkTreeViewDropPosition position; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2362 memcpy(&n, sd->data, sizeof(n)); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2363 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
|
2364 /* 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
|
2365 GtkTreeIter iter; |
15822 | 2366 PurpleBlistNode *node; |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
2367 struct _pidgin_blist_node *gtknode; |
15373
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_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
|
2370 &iter, path); |
31096
b76def85cc04
gtkblist: Fix a few memory leaks. Refs #13162.
morshed.nader@gmail.com
parents:
31086
diff
changeset
|
2371 gtk_tree_model_get(GTK_TREE_MODEL(gtkblist->treemodel), |
b76def85cc04
gtkblist: Fix a few memory leaks. Refs #13162.
morshed.nader@gmail.com
parents:
31086
diff
changeset
|
2372 &iter, NODE_COLUMN, &node, -1); |
32350
cd46874707b1
Pidgin: Use the purple_blist_node_ accessor functions.
andrew.victor@mxit.com
parents:
32347
diff
changeset
|
2373 gtknode = purple_blist_node_get_ui_data(node); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2374 |
15822 | 2375 if (PURPLE_BLIST_NODE_IS_CONTACT(n)) { |
2376 PurpleContact *c = (PurpleContact*)n; | |
2377 if (PURPLE_BLIST_NODE_IS_CONTACT(node) && gtknode->contact_expanded) { | |
2378 purple_blist_merge_contact(c, node); | |
2379 } else if (PURPLE_BLIST_NODE_IS_CONTACT(node) || | |
2380 PURPLE_BLIST_NODE_IS_CHAT(node)) { | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2381 switch(position) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2382 case GTK_TREE_VIEW_DROP_AFTER: |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2383 case GTK_TREE_VIEW_DROP_INTO_OR_AFTER: |
15822 | 2384 purple_blist_add_contact(c, (PurpleGroup*)node->parent, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2385 node); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2386 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2387 case GTK_TREE_VIEW_DROP_BEFORE: |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2388 case GTK_TREE_VIEW_DROP_INTO_OR_BEFORE: |
15822 | 2389 purple_blist_add_contact(c, (PurpleGroup*)node->parent, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2390 node->prev); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2391 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2392 } |
15822 | 2393 } else if(PURPLE_BLIST_NODE_IS_GROUP(node)) { |
2394 purple_blist_add_contact(c, (PurpleGroup*)node, NULL); | |
2395 } else if(PURPLE_BLIST_NODE_IS_BUDDY(node)) { | |
2396 purple_blist_merge_contact(c, node); | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2397 } |
15822 | 2398 } else if (PURPLE_BLIST_NODE_IS_BUDDY(n)) { |
2399 PurpleBuddy *b = (PurpleBuddy*)n; | |
2400 if (PURPLE_BLIST_NODE_IS_BUDDY(node)) { | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2401 switch(position) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2402 case GTK_TREE_VIEW_DROP_AFTER: |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2403 case GTK_TREE_VIEW_DROP_INTO_OR_AFTER: |
15822 | 2404 purple_blist_add_buddy(b, (PurpleContact*)node->parent, |
2405 (PurpleGroup*)node->parent->parent, node); | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2406 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2407 case GTK_TREE_VIEW_DROP_BEFORE: |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2408 case GTK_TREE_VIEW_DROP_INTO_OR_BEFORE: |
15822 | 2409 purple_blist_add_buddy(b, (PurpleContact*)node->parent, |
2410 (PurpleGroup*)node->parent->parent, | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2411 node->prev); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2412 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2413 } |
15822 | 2414 } else if(PURPLE_BLIST_NODE_IS_CHAT(node)) { |
2415 purple_blist_add_buddy(b, NULL, (PurpleGroup*)node->parent, | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2416 NULL); |
15822 | 2417 } else if (PURPLE_BLIST_NODE_IS_GROUP(node)) { |
2418 purple_blist_add_buddy(b, NULL, (PurpleGroup*)node, NULL); | |
2419 } else if (PURPLE_BLIST_NODE_IS_CONTACT(node)) { | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2420 if(gtknode->contact_expanded) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2421 switch(position) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2422 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
|
2423 case GTK_TREE_VIEW_DROP_AFTER: |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2424 case GTK_TREE_VIEW_DROP_INTO_OR_BEFORE: |
15822 | 2425 purple_blist_add_buddy(b, (PurpleContact*)node, |
2426 (PurpleGroup*)node->parent, NULL); | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2427 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2428 case GTK_TREE_VIEW_DROP_BEFORE: |
15822 | 2429 purple_blist_add_buddy(b, NULL, |
2430 (PurpleGroup*)node->parent, node->prev); | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2431 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2432 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2433 } else { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2434 switch(position) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2435 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
|
2436 case GTK_TREE_VIEW_DROP_AFTER: |
15822 | 2437 purple_blist_add_buddy(b, NULL, |
2438 (PurpleGroup*)node->parent, NULL); | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2439 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2440 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
|
2441 case GTK_TREE_VIEW_DROP_BEFORE: |
15822 | 2442 purple_blist_add_buddy(b, NULL, |
2443 (PurpleGroup*)node->parent, node->prev); | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2444 break; |
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 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2447 } |
15822 | 2448 } else if (PURPLE_BLIST_NODE_IS_CHAT(n)) { |
2449 PurpleChat *chat = (PurpleChat *)n; | |
2450 if (PURPLE_BLIST_NODE_IS_BUDDY(node)) { | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2451 switch(position) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2452 case GTK_TREE_VIEW_DROP_AFTER: |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2453 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
|
2454 case GTK_TREE_VIEW_DROP_BEFORE: |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2455 case GTK_TREE_VIEW_DROP_INTO_OR_BEFORE: |
15822 | 2456 purple_blist_add_chat(chat, |
2457 (PurpleGroup*)node->parent->parent, | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2458 node->parent); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2459 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2460 } |
15822 | 2461 } else if(PURPLE_BLIST_NODE_IS_CONTACT(node) || |
2462 PURPLE_BLIST_NODE_IS_CHAT(node)) { | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2463 switch(position) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2464 case GTK_TREE_VIEW_DROP_AFTER: |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2465 case GTK_TREE_VIEW_DROP_INTO_OR_AFTER: |
15822 | 2466 purple_blist_add_chat(chat, (PurpleGroup*)node->parent, node); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2467 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2468 case GTK_TREE_VIEW_DROP_BEFORE: |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2469 case GTK_TREE_VIEW_DROP_INTO_OR_BEFORE: |
15822 | 2470 purple_blist_add_chat(chat, (PurpleGroup*)node->parent, node->prev); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2471 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2472 } |
15822 | 2473 } else if (PURPLE_BLIST_NODE_IS_GROUP(node)) { |
2474 purple_blist_add_chat(chat, (PurpleGroup*)node, NULL); | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2475 } |
15822 | 2476 } else if (PURPLE_BLIST_NODE_IS_GROUP(n)) { |
2477 PurpleGroup *g = (PurpleGroup*)n; | |
2478 if (PURPLE_BLIST_NODE_IS_GROUP(node)) { | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2479 switch (position) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2480 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
|
2481 case GTK_TREE_VIEW_DROP_AFTER: |
15822 | 2482 purple_blist_add_group(g, node); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2483 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2484 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
|
2485 case GTK_TREE_VIEW_DROP_BEFORE: |
15822 | 2486 purple_blist_add_group(g, node->prev); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2487 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2488 } |
15822 | 2489 } else if(PURPLE_BLIST_NODE_IS_BUDDY(node)) { |
2490 purple_blist_add_group(g, node->parent->parent); | |
2491 } else if(PURPLE_BLIST_NODE_IS_CONTACT(node) || | |
2492 PURPLE_BLIST_NODE_IS_CHAT(node)) { | |
2493 purple_blist_add_group(g, node->parent); | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2494 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2495 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2496 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2497 gtk_tree_path_free(path); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2498 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
|
2499 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2500 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2501 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
|
2502 FALSE) && sd->data) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2503 { |
15822 | 2504 PurpleGroup *group = NULL; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2505 GtkTreePath *path = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2506 GtkTreeViewDropPosition position; |
15822 | 2507 PurpleAccount *account; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2508 char *protocol = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2509 char *username = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2510 char *alias = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2511 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2512 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
|
2513 x, y, &path, &position)) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2514 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2515 GtkTreeIter iter; |
15822 | 2516 PurpleBlistNode *node; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2517 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2518 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
|
2519 &iter, path); |
31096
b76def85cc04
gtkblist: Fix a few memory leaks. Refs #13162.
morshed.nader@gmail.com
parents:
31086
diff
changeset
|
2520 gtk_tree_model_get(GTK_TREE_MODEL(gtkblist->treemodel), |
b76def85cc04
gtkblist: Fix a few memory leaks. Refs #13162.
morshed.nader@gmail.com
parents:
31086
diff
changeset
|
2521 &iter, NODE_COLUMN, &node, -1); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2522 |
15822 | 2523 if (PURPLE_BLIST_NODE_IS_BUDDY(node)) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2524 { |
15822 | 2525 group = (PurpleGroup *)node->parent->parent; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2526 } |
15822 | 2527 else if (PURPLE_BLIST_NODE_IS_CHAT(node) || |
2528 PURPLE_BLIST_NODE_IS_CONTACT(node)) | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2529 { |
15822 | 2530 group = (PurpleGroup *)node->parent; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2531 } |
15822 | 2532 else if (PURPLE_BLIST_NODE_IS_GROUP(node)) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2533 { |
15822 | 2534 group = (PurpleGroup *)node; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2535 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2536 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2537 |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
2538 if (pidgin_parse_x_im_contact((const char *)sd->data, FALSE, &account, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2539 &protocol, &username, &alias)) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2540 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2541 if (account == NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2542 { |
15822 | 2543 purple_notify_error(NULL, NULL, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2544 _("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
|
2545 "can add that buddy."), NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2546 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2547 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2548 { |
15822 | 2549 purple_blist_request_add_buddy(account, username, |
32346
2fdc668362f0
Use the purple_group_get_name() accessor function.
andrew.victor@mxit.com
parents:
32342
diff
changeset
|
2550 (group ? purple_group_get_name(group) : NULL), |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2551 alias); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2552 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2553 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2554 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2555 g_free(username); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2556 g_free(protocol); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2557 g_free(alias); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2558 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2559 if (path != NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2560 gtk_tree_path_free(path); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2561 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2562 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
|
2563 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2564 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
|
2565 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2566 gboolean result; |
15822 | 2567 PurpleGroup *group = NULL; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2568 GtkTreePath *path = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2569 GtkTreeViewDropPosition position; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2570 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2571 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
|
2572 x, y, &path, &position)) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2573 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2574 GtkTreeIter iter; |
15822 | 2575 PurpleBlistNode *node; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2576 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2577 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
|
2578 &iter, path); |
31096
b76def85cc04
gtkblist: Fix a few memory leaks. Refs #13162.
morshed.nader@gmail.com
parents:
31086
diff
changeset
|
2579 gtk_tree_model_get(GTK_TREE_MODEL(gtkblist->treemodel), |
b76def85cc04
gtkblist: Fix a few memory leaks. Refs #13162.
morshed.nader@gmail.com
parents:
31086
diff
changeset
|
2580 &iter, NODE_COLUMN, &node, -1); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2581 |
15822 | 2582 if (PURPLE_BLIST_NODE_IS_BUDDY(node)) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2583 { |
15822 | 2584 group = (PurpleGroup *)node->parent->parent; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2585 } |
15822 | 2586 else if (PURPLE_BLIST_NODE_IS_CHAT(node) || |
2587 PURPLE_BLIST_NODE_IS_CONTACT(node)) | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2588 { |
15822 | 2589 group = (PurpleGroup *)node->parent; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2590 } |
15822 | 2591 else if (PURPLE_BLIST_NODE_IS_GROUP(node)) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2592 { |
15822 | 2593 group = (PurpleGroup *)node; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2594 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2595 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2596 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2597 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
|
2598 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2599 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
|
2600 } 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
|
2601 GtkTreePath *path = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2602 GtkTreeViewDropPosition position; |
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 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
|
2605 x, y, &path, &position)) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2606 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2607 GtkTreeIter iter; |
15822 | 2608 PurpleBlistNode *node; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2609 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2610 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
|
2611 &iter, path); |
31096
b76def85cc04
gtkblist: Fix a few memory leaks. Refs #13162.
morshed.nader@gmail.com
parents:
31086
diff
changeset
|
2612 gtk_tree_model_get(GTK_TREE_MODEL(gtkblist->treemodel), |
b76def85cc04
gtkblist: Fix a few memory leaks. Refs #13162.
morshed.nader@gmail.com
parents:
31086
diff
changeset
|
2613 &iter, NODE_COLUMN, &node, -1); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2614 |
15822 | 2615 if (PURPLE_BLIST_NODE_IS_BUDDY(node) || PURPLE_BLIST_NODE_IS_CONTACT(node)) { |
25827
0e08c847517d
Update some casts (that the script didn't fix correctly) to GObject macros.
Richard Laager <rlaager@wiktel.com>
parents:
25822
diff
changeset
|
2616 PurpleBuddy *b = PURPLE_BLIST_NODE_IS_BUDDY(node) ? PURPLE_BUDDY(node) : purple_contact_get_priority_buddy(PURPLE_CONTACT(node)); |
32342
b6276b10cb10
Use the PurpleBuddy accessor functions.
andrew.victor@mxit.com
parents:
32305
diff
changeset
|
2617 pidgin_dnd_file_manage(sd, purple_buddy_get_account(b), purple_buddy_get_name(b)); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2618 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
|
2619 } else { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2620 gtk_drag_finish(dc, FALSE, FALSE, t); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2621 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2622 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2623 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2624 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2625 |
15490
88070d5f4c62
dim buddy icons on idle and offline. Still need to do status icons.
Sean Egan <seanegan@gmail.com>
parents:
15489
diff
changeset
|
2626 /* 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:
15489
diff
changeset
|
2627 static void |
29482
bd28b8515eb2
Simplify: dest always equals src. No need to copy everything.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29473
diff
changeset
|
2628 do_alphashift(GdkPixbuf *pixbuf, int shift) |
15490
88070d5f4c62
dim buddy icons on idle and offline. Still need to do status icons.
Sean Egan <seanegan@gmail.com>
parents:
15489
diff
changeset
|
2629 { |
88070d5f4c62
dim buddy icons on idle and offline. Still need to do status icons.
Sean Egan <seanegan@gmail.com>
parents:
15489
diff
changeset
|
2630 gint i, j; |
29482
bd28b8515eb2
Simplify: dest always equals src. No need to copy everything.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29473
diff
changeset
|
2631 gint width, height, padding; |
bd28b8515eb2
Simplify: dest always equals src. No need to copy everything.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29473
diff
changeset
|
2632 guchar *pixels; |
15490
88070d5f4c62
dim buddy icons on idle and offline. Still need to do status icons.
Sean Egan <seanegan@gmail.com>
parents:
15489
diff
changeset
|
2633 int val; |
29482
bd28b8515eb2
Simplify: dest always equals src. No need to copy everything.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29473
diff
changeset
|
2634 |
bd28b8515eb2
Simplify: dest always equals src. No need to copy everything.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29473
diff
changeset
|
2635 if (!gdk_pixbuf_get_has_alpha(pixbuf)) |
15490
88070d5f4c62
dim buddy icons on idle and offline. Still need to do status icons.
Sean Egan <seanegan@gmail.com>
parents:
15489
diff
changeset
|
2636 return; |
88070d5f4c62
dim buddy icons on idle and offline. Still need to do status icons.
Sean Egan <seanegan@gmail.com>
parents:
15489
diff
changeset
|
2637 |
29482
bd28b8515eb2
Simplify: dest always equals src. No need to copy everything.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29473
diff
changeset
|
2638 width = gdk_pixbuf_get_width(pixbuf); |
bd28b8515eb2
Simplify: dest always equals src. No need to copy everything.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29473
diff
changeset
|
2639 height = gdk_pixbuf_get_height(pixbuf); |
bd28b8515eb2
Simplify: dest always equals src. No need to copy everything.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29473
diff
changeset
|
2640 padding = gdk_pixbuf_get_rowstride(pixbuf) - width * 4; |
bd28b8515eb2
Simplify: dest always equals src. No need to copy everything.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29473
diff
changeset
|
2641 pixels = gdk_pixbuf_get_pixels(pixbuf); |
15490
88070d5f4c62
dim buddy icons on idle and offline. Still need to do status icons.
Sean Egan <seanegan@gmail.com>
parents:
15489
diff
changeset
|
2642 |
88070d5f4c62
dim buddy icons on idle and offline. Still need to do status icons.
Sean Egan <seanegan@gmail.com>
parents:
15489
diff
changeset
|
2643 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:
15489
diff
changeset
|
2644 for (j = 0; j < width; j++) { |
29482
bd28b8515eb2
Simplify: dest always equals src. No need to copy everything.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29473
diff
changeset
|
2645 pixels++; |
bd28b8515eb2
Simplify: dest always equals src. No need to copy everything.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29473
diff
changeset
|
2646 pixels++; |
bd28b8515eb2
Simplify: dest always equals src. No need to copy everything.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29473
diff
changeset
|
2647 pixels++; |
bd28b8515eb2
Simplify: dest always equals src. No need to copy everything.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29473
diff
changeset
|
2648 val = *pixels - shift; |
bd28b8515eb2
Simplify: dest always equals src. No need to copy everything.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29473
diff
changeset
|
2649 *(pixels++) = CLAMP(val, 0, 255); |
bd28b8515eb2
Simplify: dest always equals src. No need to copy everything.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29473
diff
changeset
|
2650 } |
bd28b8515eb2
Simplify: dest always equals src. No need to copy everything.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29473
diff
changeset
|
2651 pixels += padding; |
15490
88070d5f4c62
dim buddy icons on idle and offline. Still need to do status icons.
Sean Egan <seanegan@gmail.com>
parents:
15489
diff
changeset
|
2652 } |
88070d5f4c62
dim buddy icons on idle and offline. Still need to do status icons.
Sean Egan <seanegan@gmail.com>
parents:
15489
diff
changeset
|
2653 } |
88070d5f4c62
dim buddy icons on idle and offline. Still need to do status icons.
Sean Egan <seanegan@gmail.com>
parents:
15489
diff
changeset
|
2654 |
88070d5f4c62
dim buddy icons on idle and offline. Still need to do status icons.
Sean Egan <seanegan@gmail.com>
parents:
15489
diff
changeset
|
2655 |
15822 | 2656 static GdkPixbuf *pidgin_blist_get_buddy_icon(PurpleBlistNode *node, |
23156
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23129
diff
changeset
|
2657 gboolean scaled, gboolean greyed) |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23129
diff
changeset
|
2658 { |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23129
diff
changeset
|
2659 gsize len; |
15822 | 2660 PurpleBuddy *buddy = NULL; |
23156
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23129
diff
changeset
|
2661 PurpleGroup *group = NULL; |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23129
diff
changeset
|
2662 const guchar *data = NULL; |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23129
diff
changeset
|
2663 GdkPixbuf *buf, *ret = NULL; |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23129
diff
changeset
|
2664 PurpleBuddyIcon *icon = NULL; |
15822 | 2665 PurpleAccount *account = NULL; |
23156
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23129
diff
changeset
|
2666 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
|
2667 PurpleStoredImage *custom_img; |
23156
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23129
diff
changeset
|
2668 PurplePluginProtocolInfo *prpl_info = NULL; |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23129
diff
changeset
|
2669 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:
23129
diff
changeset
|
2670 |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23129
diff
changeset
|
2671 if (PURPLE_BLIST_NODE_IS_CONTACT(node)) { |
15822 | 2672 buddy = purple_contact_get_priority_buddy((PurpleContact*)node); |
23156
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23129
diff
changeset
|
2673 contact = (PurpleContact*)node; |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23129
diff
changeset
|
2674 } else if (PURPLE_BLIST_NODE_IS_BUDDY(node)) { |
15822 | 2675 buddy = (PurpleBuddy*)node; |
23156
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23129
diff
changeset
|
2676 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:
23129
diff
changeset
|
2677 } 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:
23129
diff
changeset
|
2678 group = (PurpleGroup*)node; |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23129
diff
changeset
|
2679 } 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:
23129
diff
changeset
|
2680 /* 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:
23129
diff
changeset
|
2681 * into the else block and return. */ |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2682 } else { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2683 return NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2684 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2685 |
23156
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23129
diff
changeset
|
2686 if (buddy) { |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23129
diff
changeset
|
2687 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:
23129
diff
changeset
|
2688 } |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23129
diff
changeset
|
2689 |
32246
10e5000326a5
Convert code to use the purple_account accessor functions.
andrew.victor@mxit.com
parents:
32240
diff
changeset
|
2690 if(account && purple_account_get_connection(account)) { |
32305
2ec94166be43
On the way to hiding the PurpleConnection struct.
andrew.victor@mxit.com
parents:
32246
diff
changeset
|
2691 prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(purple_connection_get_prpl(purple_account_get_connection(account))); |
23156
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23129
diff
changeset
|
2692 } |
15422
051a5c4f0917
this would use the protocol icons in place of the buddy icon for chats,
Nathan Walp <nwalp@pidgin.im>
parents:
15417
diff
changeset
|
2693 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2694 #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
|
2695 if (!purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/blist/show_buddy_icons")) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2696 return NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2697 #endif |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2698 |
23156
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23129
diff
changeset
|
2699 /* 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:
23129
diff
changeset
|
2700 * 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:
23129
diff
changeset
|
2701 * 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:
23129
diff
changeset
|
2702 * want to use that directly. */ |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23129
diff
changeset
|
2703 if (contact) { |
32350
cd46874707b1
Pidgin: Use the purple_blist_node_ accessor functions.
andrew.victor@mxit.com
parents:
32347
diff
changeset
|
2704 custom_img = purple_buddy_icons_node_find_custom_icon(PURPLE_BLIST_NODE(contact)); |
23156
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23129
diff
changeset
|
2705 } else { |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23129
diff
changeset
|
2706 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:
23129
diff
changeset
|
2707 } |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23129
diff
changeset
|
2708 |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23129
diff
changeset
|
2709 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
|
2710 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
|
2711 len = purple_imgstore_get_size(custom_img); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2712 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2713 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2714 if (data == NULL) { |
23156
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23129
diff
changeset
|
2715 if (buddy) { |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23129
diff
changeset
|
2716 /* Not sure I like this...*/ |
32342
b6276b10cb10
Use the PurpleBuddy accessor functions.
andrew.victor@mxit.com
parents:
32305
diff
changeset
|
2717 if (!(icon = purple_buddy_icons_find(purple_buddy_get_account(buddy), purple_buddy_get_name(buddy)))) |
23156
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23129
diff
changeset
|
2718 return NULL; |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23129
diff
changeset
|
2719 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:
23129
diff
changeset
|
2720 } |
16556
26fb9b308cc1
This is Sadrul's icon-migrate.patch from ticket #314.
Richard Laager <rlaager@wiktel.com>
parents:
16475
diff
changeset
|
2721 |
26fb9b308cc1
This is Sadrul's icon-migrate.patch from ticket #314.
Richard Laager <rlaager@wiktel.com>
parents:
16475
diff
changeset
|
2722 if(data == NULL) |
26fb9b308cc1
This is Sadrul's icon-migrate.patch from ticket #314.
Richard Laager <rlaager@wiktel.com>
parents:
16475
diff
changeset
|
2723 return NULL; |
26fb9b308cc1
This is Sadrul's icon-migrate.patch from ticket #314.
Richard Laager <rlaager@wiktel.com>
parents:
16475
diff
changeset
|
2724 } |
15422
051a5c4f0917
this would use the protocol icons in place of the buddy icon for chats,
Nathan Walp <nwalp@pidgin.im>
parents:
15417
diff
changeset
|
2725 |
31682
e2c6e4fc3c84
Start looking at the GError parameter every time we call these functions:
Mark Doliner <mark@kingant.net>
parents:
31443
diff
changeset
|
2726 buf = pidgin_pixbuf_from_data(data, len); |
16817
56823a55581a
Rework purple_buddy_icons_find() to return a reference for the caller, which
Richard Laager <rlaager@wiktel.com>
parents:
16766
diff
changeset
|
2727 purple_buddy_icon_unref(icon); |
23156
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23129
diff
changeset
|
2728 if (!buf) { |
31682
e2c6e4fc3c84
Start looking at the GError parameter every time we call these functions:
Mark Doliner <mark@kingant.net>
parents:
31443
diff
changeset
|
2729 purple_debug_warning("gtkblist", "Couldn't load buddy icon " |
e2c6e4fc3c84
Start looking at the GError parameter every time we call these functions:
Mark Doliner <mark@kingant.net>
parents:
31443
diff
changeset
|
2730 "on account %s (%s) buddyname=%s " |
e2c6e4fc3c84
Start looking at the GError parameter every time we call these functions:
Mark Doliner <mark@kingant.net>
parents:
31443
diff
changeset
|
2731 "custom_img_data=%p\n", |
e2c6e4fc3c84
Start looking at the GError parameter every time we call these functions:
Mark Doliner <mark@kingant.net>
parents:
31443
diff
changeset
|
2732 account ? purple_account_get_username(account) : "(no account)", |
e2c6e4fc3c84
Start looking at the GError parameter every time we call these functions:
Mark Doliner <mark@kingant.net>
parents:
31443
diff
changeset
|
2733 account ? purple_account_get_protocol_id(account) : "(no account)", |
e2c6e4fc3c84
Start looking at the GError parameter every time we call these functions:
Mark Doliner <mark@kingant.net>
parents:
31443
diff
changeset
|
2734 buddy ? purple_buddy_get_name(buddy) : "(no buddy)", |
e2c6e4fc3c84
Start looking at the GError parameter every time we call these functions:
Mark Doliner <mark@kingant.net>
parents:
31443
diff
changeset
|
2735 custom_img ? purple_imgstore_get_data(custom_img) : NULL); |
e2c6e4fc3c84
Start looking at the GError parameter every time we call these functions:
Mark Doliner <mark@kingant.net>
parents:
31443
diff
changeset
|
2736 purple_imgstore_unref(custom_img); |
23156
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23129
diff
changeset
|
2737 return NULL; |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23129
diff
changeset
|
2738 } |
31682
e2c6e4fc3c84
Start looking at the GError parameter every time we call these functions:
Mark Doliner <mark@kingant.net>
parents:
31443
diff
changeset
|
2739 purple_imgstore_unref(custom_img); |
23156
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23129
diff
changeset
|
2740 |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23129
diff
changeset
|
2741 if (greyed) { |
23158
85f567c95af1
Buddy icons in the buddy list should not default to being marked idle. Thanks
Etan Reisner <pidgin@unreliablesource.net>
parents:
23156
diff
changeset
|
2742 gboolean offline = FALSE, idle = FALSE; |
23156
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23129
diff
changeset
|
2743 |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23129
diff
changeset
|
2744 if (buddy) { |
15822 | 2745 PurplePresence *presence = purple_buddy_get_presence(buddy); |
2746 if (!PURPLE_BUDDY_IS_ONLINE(buddy)) | |
23156
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23129
diff
changeset
|
2747 offline = TRUE; |
15822 | 2748 if (purple_presence_is_idle(presence)) |
23156
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23129
diff
changeset
|
2749 idle = TRUE; |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23129
diff
changeset
|
2750 } else if (group) { |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23129
diff
changeset
|
2751 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:
23129
diff
changeset
|
2752 offline = TRUE; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2753 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2754 |
23156
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23129
diff
changeset
|
2755 if (offline) |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23129
diff
changeset
|
2756 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:
23129
diff
changeset
|
2757 |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23129
diff
changeset
|
2758 if (idle) |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23129
diff
changeset
|
2759 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:
23129
diff
changeset
|
2760 } |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23129
diff
changeset
|
2761 |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23129
diff
changeset
|
2762 /* 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:
23129
diff
changeset
|
2763 * 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:
23129
diff
changeset
|
2764 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:
23129
diff
changeset
|
2765 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:
23129
diff
changeset
|
2766 |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23129
diff
changeset
|
2767 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:
23129
diff
changeset
|
2768 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:
23129
diff
changeset
|
2769 |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23129
diff
changeset
|
2770 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:
23129
diff
changeset
|
2771 GdkPixbuf *tmpbuf; |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23129
diff
changeset
|
2772 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:
23129
diff
changeset
|
2773 if(scale_height > scale_width) { |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23129
diff
changeset
|
2774 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:
23129
diff
changeset
|
2775 scale_height = scale_size; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2776 } else { |
23156
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23129
diff
changeset
|
2777 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:
23129
diff
changeset
|
2778 scale_width = scale_size; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2779 } |
23156
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23129
diff
changeset
|
2780 /* 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:
23129
diff
changeset
|
2781 * 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:
23129
diff
changeset
|
2782 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:
23129
diff
changeset
|
2783 gdk_pixbuf_fill(tmpbuf, 0x00000000); |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23129
diff
changeset
|
2784 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:
23129
diff
changeset
|
2785 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:
23129
diff
changeset
|
2786 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:
23129
diff
changeset
|
2787 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:
23129
diff
changeset
|
2788 gdk_pixbuf_fill(ret, 0x00000000); |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23129
diff
changeset
|
2789 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:
23129
diff
changeset
|
2790 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:
23129
diff
changeset
|
2791 } else { |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23129
diff
changeset
|
2792 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:
23129
diff
changeset
|
2793 } |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23129
diff
changeset
|
2794 g_object_unref(G_OBJECT(buf)); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2795 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2796 return ret; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2797 } |
23156
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23129
diff
changeset
|
2798 |
15441 | 2799 /* # - Status Icon |
2800 * P - Protocol Icon | |
2801 * A - Buddy Icon | |
2802 * [ - SMALL_SPACE | |
2803 * = - LARGE_SPACE | |
2804 * +--- STATUS_SIZE +--- td->avatar_width | |
2805 * | +-- td->name_width | | |
2806 * +----+ +-------+ +---------+ | |
2807 * | | | | | | | |
2808 * +-------------------------------------------+ | |
2809 * | [ = [ |--- TOOLTIP_BORDER | |
2810 *name_height --+-| ######[BuddyName = PP [ AAAAAAAAAAA |--+ | |
2811 * | | ######[ = PP [ AAAAAAAAAAA | | | |
2812 * STATUS SIZE -| | ######[[[[[[[[[[[[[[[[[[[[[ AAAAAAAAAAA | | | |
2813 * +--+-| ######[Account: So-and-so [ AAAAAAAAAAA | |-- td->avatar_height | |
2814 * | | [Idle: 4h 15m [ AAAAAAAAAAA | | | |
2815 * height --+ | [Foo: Bar, Baz [ AAAAAAAAAAA | | | |
2816 * | | [Status: Awesome [ AAAAAAAAAAA |--+ | |
2817 * +----| [Stop: Hammer Time [ | | |
2818 * | [ [ |--- TOOLTIP_BORDER | |
2819 * +-------------------------------------------+ | |
2820 * | | | | | |
2821 * | +----------------+ | | |
2822 * | | | | |
2823 * | +-- td->width | | |
2824 * | | | |
2825 * +---- TOOLTIP_BORDER +---- TOOLTIP_BORDER | |
2826 * | |
15631
a830f9756f23
Some more pidgininfication
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15614
diff
changeset
|
2827 * |
15441 | 2828 */ |
25924
584063555949
Remove trailing whitespace
Mark Doliner <mark@kingant.net>
parents:
25920
diff
changeset
|
2829 #define STATUS_SIZE 16 |
15441 | 2830 #define TOOLTIP_BORDER 12 |
2831 #define SMALL_SPACE 6 | |
2832 #define LARGE_SPACE 12 | |
15631
a830f9756f23
Some more pidgininfication
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15614
diff
changeset
|
2833 #define PRPL_SIZE 16 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2834 struct tooltip_data { |
15447 | 2835 PangoLayout *layout; |
15441 | 2836 PangoLayout *name_layout; |
2837 GdkPixbuf *prpl_icon; | |
15447 | 2838 GdkPixbuf *status_icon; |
2839 GdkPixbuf *avatar; | |
2840 gboolean avatar_is_prpl_icon; | |
15441 | 2841 int avatar_width; |
15447 | 2842 int avatar_height; |
15441 | 2843 int name_height; |
2844 int name_width; | |
15447 | 2845 int width; |
2846 int height; | |
22998
d678dbea81a4
Reduce the enormous padding in the group tooltip. People will hopefully dislike it less now.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22974
diff
changeset
|
2847 int padding; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2848 }; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2849 |
21986
0eb3ea7e5784
Show prpl icons in the tooltip for groups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21985
diff
changeset
|
2850 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
|
2851 { |
0eb3ea7e5784
Show prpl icons in the tooltip for groups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21985
diff
changeset
|
2852 PangoLayout *layout; |
0eb3ea7e5784
Show prpl icons in the tooltip for groups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21985
diff
changeset
|
2853 int w, h; |
0eb3ea7e5784
Show prpl icons in the tooltip for groups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21985
diff
changeset
|
2854 |
0eb3ea7e5784
Show prpl icons in the tooltip for groups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21985
diff
changeset
|
2855 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
|
2856 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
|
2857 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
|
2858 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
|
2859 |
0eb3ea7e5784
Show prpl icons in the tooltip for groups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21985
diff
changeset
|
2860 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
|
2861 if (width) |
0eb3ea7e5784
Show prpl icons in the tooltip for groups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21985
diff
changeset
|
2862 *width = PANGO_PIXELS(w); |
0eb3ea7e5784
Show prpl icons in the tooltip for groups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21985
diff
changeset
|
2863 if (height) |
0eb3ea7e5784
Show prpl icons in the tooltip for groups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21985
diff
changeset
|
2864 *height = PANGO_PIXELS(h); |
0eb3ea7e5784
Show prpl icons in the tooltip for groups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21985
diff
changeset
|
2865 return layout; |
0eb3ea7e5784
Show prpl icons in the tooltip for groups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21985
diff
changeset
|
2866 } |
0eb3ea7e5784
Show prpl icons in the tooltip for groups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21985
diff
changeset
|
2867 |
0eb3ea7e5784
Show prpl icons in the tooltip for groups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21985
diff
changeset
|
2868 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
|
2869 { |
0eb3ea7e5784
Show prpl icons in the tooltip for groups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21985
diff
changeset
|
2870 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
|
2871 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
|
2872 /* 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
|
2873 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
|
2874 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
|
2875 td->layout = create_pango_layout(purple_account_get_username(account), &td->width, &td->height); |
22998
d678dbea81a4
Reduce the enormous padding in the group tooltip. People will hopefully dislike it less now.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22974
diff
changeset
|
2876 td->padding = SMALL_SPACE; |
21986
0eb3ea7e5784
Show prpl icons in the tooltip for groups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21985
diff
changeset
|
2877 return td; |
0eb3ea7e5784
Show prpl icons in the tooltip for groups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21985
diff
changeset
|
2878 } |
0eb3ea7e5784
Show prpl icons in the tooltip for groups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21985
diff
changeset
|
2879 |
15822 | 2880 static struct tooltip_data * create_tip_for_node(PurpleBlistNode *node, gboolean full) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2881 { |
15447 | 2882 struct tooltip_data *td = g_new0(struct tooltip_data, 1); |
15822 | 2883 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
|
2884 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
|
2885 |
2b6e6dd24a37
Add tooltips to groups in the buddy list. The tooltips show the current online
Etan Reisner <pidgin@unreliablesource.net>
parents:
21912
diff
changeset
|
2886 if (PURPLE_BLIST_NODE_IS_BUDDY(node)) { |
32342
b6276b10cb10
Use the PurpleBuddy accessor functions.
andrew.victor@mxit.com
parents:
32305
diff
changeset
|
2887 account = purple_buddy_get_account((PurpleBuddy*)(node)); |
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
|
2888 } else if (PURPLE_BLIST_NODE_IS_CHAT(node)) { |
32347
76096c42f558
Use the PurpleChat accessor functions.
andrew.victor@mxit.com
parents:
32346
diff
changeset
|
2889 account = purple_chat_get_account((PurpleChat*)(node)); |
15447 | 2890 } |
2891 | |
22998
d678dbea81a4
Reduce the enormous padding in the group tooltip. People will hopefully dislike it less now.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22974
diff
changeset
|
2892 td->padding = TOOLTIP_BORDER; |
15507
94031a2b0aaa
gtkblist changes to pidgin
Sean Egan <seanegan@gmail.com>
parents:
15506
diff
changeset
|
2893 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
|
2894 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
|
2895 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
|
2896 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
|
2897 } |
15820 | 2898 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
|
2899 if (tooltip_text && *tooltip_text) { |
0eb3ea7e5784
Show prpl icons in the tooltip for groups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21985
diff
changeset
|
2900 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
|
2901 } |
15441 | 2902 |
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
|
2903 if (PURPLE_BLIST_NODE_IS_BUDDY(node)) { |
15822 | 2904 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
|
2905 } else if (PURPLE_BLIST_NODE_IS_CHAT(node)) { |
15822 | 2906 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
|
2907 } 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
|
2908 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
|
2909 } 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
|
2910 /* 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
|
2911 * 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
|
2912 * 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
|
2913 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
|
2914 } |
22934
5a359f6666c2
Fix a NULL printf. Fixes #5387.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22813
diff
changeset
|
2915 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:
22813
diff
changeset
|
2916 tmp ? tmp : ""); |
15919
6a5089fafd19
Fix a small tooltip-related memleak
Mark Doliner <mark@kingant.net>
parents:
15870
diff
changeset
|
2917 g_free(tmp); |
15441 | 2918 |
21986
0eb3ea7e5784
Show prpl icons in the tooltip for groups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21985
diff
changeset
|
2919 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
|
2920 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
|
2921 td->name_height = MAX(td->name_height, PRPL_SIZE + SMALL_SPACE); |
15474 | 2922 #if 0 /* PRPL Icon as avatar */ |
15447 | 2923 if(!td->avatar && full) { |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
2924 td->avatar = pidgin_create_prpl_icon(account, PIDGIN_PRPL_ICON_LARGE); |
15441 | 2925 td->avatar_is_prpl_icon = TRUE; |
2926 } | |
15474 | 2927 #endif |
15707
c50358666110
Fix asserts when there is no buddy icon
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15631
diff
changeset
|
2928 |
c50358666110
Fix asserts when there is no buddy icon
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15631
diff
changeset
|
2929 if (td->avatar) { |
c50358666110
Fix asserts when there is no buddy icon
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15631
diff
changeset
|
2930 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:
15631
diff
changeset
|
2931 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:
15631
diff
changeset
|
2932 } |
15447 | 2933 |
15488
29e8e230d1b6
A small memory leak in the tooltip.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
15486
diff
changeset
|
2934 g_free(node_name); |
15447 | 2935 g_free(tooltip_text); |
2936 return td; | |
15396
a8ee645e7fb4
A lot of status icon changes:
Sean Egan <seanegan@gmail.com>
parents:
15373
diff
changeset
|
2937 } |
a8ee645e7fb4
A lot of status icon changes:
Sean Egan <seanegan@gmail.com>
parents:
15373
diff
changeset
|
2938 |
21885
f5d961556972
Refactor some of the tooltip drawing functions. And add some pretend docs.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21877
diff
changeset
|
2939 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
|
2940 pidgin_blist_paint_tip(GtkWidget *widget, gpointer null) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2941 { |
15447 | 2942 GtkStyle *style; |
32691
e71b9033d9f5
Cairo-ify buddy list tooltips.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32686
diff
changeset
|
2943 cairo_t *cr; |
15447 | 2944 int current_height, max_width; |
15480
62a1ebd08b74
fix a weird tooltip rendering bug when the second buddy in a contact tooltip
Nathan Walp <nwalp@pidgin.im>
parents:
15479
diff
changeset
|
2945 int max_text_width; |
15486
5369a4999f1c
fix the display bug a bit smarter
Nathan Walp <nwalp@pidgin.im>
parents:
15485
diff
changeset
|
2946 int max_avatar_width; |
15447 | 2947 GList *l; |
15474 | 2948 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
|
2949 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
|
2950 int status_size = 0; |
15631
a830f9756f23
Some more pidgininfication
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15614
diff
changeset
|
2951 |
15447 | 2952 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
|
2953 return FALSE; |
15447 | 2954 |
2955 style = gtkblist->tipwindow->style; | |
2956 | |
15480
62a1ebd08b74
fix a weird tooltip rendering bug when the second buddy in a contact tooltip
Nathan Walp <nwalp@pidgin.im>
parents:
15479
diff
changeset
|
2957 max_text_width = 0; |
15486
5369a4999f1c
fix the display bug a bit smarter
Nathan Walp <nwalp@pidgin.im>
parents:
15485
diff
changeset
|
2958 max_avatar_width = 0; |
15485
e9a869472b40
really fix that tooltip display glitch
Nathan Walp <nwalp@pidgin.im>
parents:
15484
diff
changeset
|
2959 |
15447 | 2960 for(l = gtkblist->tooltipdata; l; l = l->next) |
2961 { | |
2962 struct tooltip_data *td = l->data; | |
15486
5369a4999f1c
fix the display bug a bit smarter
Nathan Walp <nwalp@pidgin.im>
parents:
15485
diff
changeset
|
2963 |
15480
62a1ebd08b74
fix a weird tooltip rendering bug when the second buddy in a contact tooltip
Nathan Walp <nwalp@pidgin.im>
parents:
15479
diff
changeset
|
2964 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:
15479
diff
changeset
|
2965 MAX(td->width, td->name_width)); |
15486
5369a4999f1c
fix the display bug a bit smarter
Nathan Walp <nwalp@pidgin.im>
parents:
15485
diff
changeset
|
2966 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
|
2967 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
|
2968 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
|
2969 } |
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
|
2970 |
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
|
2971 max_width = TOOLTIP_BORDER + status_size + SMALL_SPACE + max_text_width + SMALL_SPACE + max_avatar_width + TOOLTIP_BORDER; |
15582 | 2972 if (dir == GTK_TEXT_DIR_RTL) |
2973 prpl_col = TOOLTIP_BORDER + max_avatar_width + SMALL_SPACE; | |
2974 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
|
2975 prpl_col = TOOLTIP_BORDER + status_size + SMALL_SPACE + max_text_width - PRPL_SIZE; |
15447 | 2976 |
32691
e71b9033d9f5
Cairo-ify buddy list tooltips.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32686
diff
changeset
|
2977 cr = gdk_cairo_create(GDK_DRAWABLE(gtk_widget_get_window(gtkblist->tipwindow))); |
15447 | 2978 current_height = 12; |
2979 for(l = gtkblist->tooltipdata; l; l = l->next) | |
2980 { | |
2981 struct tooltip_data *td = l->data; | |
2982 | |
15506 | 2983 if (td->avatar && pidgin_gdk_pixbuf_is_opaque(td->avatar)) |
15585
1dfa6945e13f
Add some braces to eliminate a compiler warning about an ambiguous else.
Richard Laager <rlaager@wiktel.com>
parents:
15582
diff
changeset
|
2984 { |
15582 | 2985 if (dir == GTK_TEXT_DIR_RTL) |
2986 gtk_paint_flat_box(style, gtkblist->tipwindow->window, GTK_STATE_NORMAL, GTK_SHADOW_OUT, | |
2987 NULL, gtkblist->tipwindow, "tooltip", | |
2988 TOOLTIP_BORDER -1, current_height -1, td->avatar_width +2, td->avatar_height + 2); | |
2989 else | |
2990 gtk_paint_flat_box(style, gtkblist->tipwindow->window, GTK_STATE_NORMAL, GTK_SHADOW_OUT, | |
2991 NULL, gtkblist->tipwindow, "tooltip", | |
2992 max_width - (td->avatar_width+ TOOLTIP_BORDER)-1, | |
2993 current_height-1,td->avatar_width+2, td->avatar_height+2); | |
15585
1dfa6945e13f
Add some braces to eliminate a compiler warning about an ambiguous else.
Richard Laager <rlaager@wiktel.com>
parents:
15582
diff
changeset
|
2994 } |
15396
a8ee645e7fb4
A lot of status icon changes:
Sean Egan <seanegan@gmail.com>
parents:
15373
diff
changeset
|
2995 |
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
|
2996 if (td->status_icon) { |
32691
e71b9033d9f5
Cairo-ify buddy list tooltips.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32686
diff
changeset
|
2997 if (dir == GTK_TEXT_DIR_RTL) { |
e71b9033d9f5
Cairo-ify buddy list tooltips.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32686
diff
changeset
|
2998 gdk_cairo_set_source_pixbuf(cr, td->status_icon, |
e71b9033d9f5
Cairo-ify buddy list tooltips.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32686
diff
changeset
|
2999 max_width - TOOLTIP_BORDER - status_size, |
e71b9033d9f5
Cairo-ify buddy list tooltips.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32686
diff
changeset
|
3000 current_height); |
e71b9033d9f5
Cairo-ify buddy list tooltips.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32686
diff
changeset
|
3001 cairo_paint(cr); |
e71b9033d9f5
Cairo-ify buddy list tooltips.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32686
diff
changeset
|
3002 } else { |
e71b9033d9f5
Cairo-ify buddy list tooltips.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32686
diff
changeset
|
3003 gdk_cairo_set_source_pixbuf(cr, td->status_icon, |
e71b9033d9f5
Cairo-ify buddy list tooltips.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32686
diff
changeset
|
3004 TOOLTIP_BORDER, current_height); |
e71b9033d9f5
Cairo-ify buddy list tooltips.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32686
diff
changeset
|
3005 cairo_paint(cr); |
e71b9033d9f5
Cairo-ify buddy list tooltips.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32686
diff
changeset
|
3006 } |
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
|
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 |
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
|
3009 if(td->avatar) { |
32691
e71b9033d9f5
Cairo-ify buddy list tooltips.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32686
diff
changeset
|
3010 if (dir == GTK_TEXT_DIR_RTL) { |
e71b9033d9f5
Cairo-ify buddy list tooltips.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32686
diff
changeset
|
3011 gdk_cairo_set_source_pixbuf(cr, td->avatar, |
e71b9033d9f5
Cairo-ify buddy list tooltips.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32686
diff
changeset
|
3012 TOOLTIP_BORDER, current_height); |
e71b9033d9f5
Cairo-ify buddy list tooltips.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32686
diff
changeset
|
3013 cairo_paint(cr); |
e71b9033d9f5
Cairo-ify buddy list tooltips.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32686
diff
changeset
|
3014 } else { |
e71b9033d9f5
Cairo-ify buddy list tooltips.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32686
diff
changeset
|
3015 gdk_cairo_set_source_pixbuf(cr, td->avatar, |
e71b9033d9f5
Cairo-ify buddy list tooltips.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32686
diff
changeset
|
3016 max_width - (td->avatar_width + TOOLTIP_BORDER), |
e71b9033d9f5
Cairo-ify buddy list tooltips.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32686
diff
changeset
|
3017 current_height); |
e71b9033d9f5
Cairo-ify buddy list tooltips.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32686
diff
changeset
|
3018 cairo_paint(cr); |
e71b9033d9f5
Cairo-ify buddy list tooltips.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32686
diff
changeset
|
3019 } |
e71b9033d9f5
Cairo-ify buddy list tooltips.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32686
diff
changeset
|
3020 } |
e71b9033d9f5
Cairo-ify buddy list tooltips.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32686
diff
changeset
|
3021 |
e71b9033d9f5
Cairo-ify buddy list tooltips.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32686
diff
changeset
|
3022 if (!td->avatar_is_prpl_icon && td->prpl_icon) { |
e71b9033d9f5
Cairo-ify buddy list tooltips.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32686
diff
changeset
|
3023 gdk_cairo_set_source_pixbuf(cr, td->prpl_icon, prpl_col, |
e71b9033d9f5
Cairo-ify buddy list tooltips.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32686
diff
changeset
|
3024 current_height + |
e71b9033d9f5
Cairo-ify buddy list tooltips.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32686
diff
changeset
|
3025 (td->name_height - PRPL_SIZE) / 2); |
e71b9033d9f5
Cairo-ify buddy list tooltips.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32686
diff
changeset
|
3026 cairo_paint(cr); |
e71b9033d9f5
Cairo-ify buddy list tooltips.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32686
diff
changeset
|
3027 } |
15447 | 3028 |
21986
0eb3ea7e5784
Show prpl icons in the tooltip for groups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21985
diff
changeset
|
3029 if (td->name_layout) { |
0eb3ea7e5784
Show prpl icons in the tooltip for groups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21985
diff
changeset
|
3030 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
|
3031 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
|
3032 NULL, gtkblist->tipwindow, "tooltip", |
0eb3ea7e5784
Show prpl icons in the tooltip for groups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21985
diff
changeset
|
3033 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
|
3034 current_height, td->name_layout); |
0eb3ea7e5784
Show prpl icons in the tooltip for groups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21985
diff
changeset
|
3035 } else { |
0eb3ea7e5784
Show prpl icons in the tooltip for groups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21985
diff
changeset
|
3036 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
|
3037 NULL, gtkblist->tipwindow, "tooltip", |
0eb3ea7e5784
Show prpl icons in the tooltip for groups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21985
diff
changeset
|
3038 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
|
3039 } |
15582 | 3040 } |
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
|
3041 |
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
|
3042 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
|
3043 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
|
3044 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
|
3045 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
|
3046 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
|
3047 } 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
|
3048 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
|
3049 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
|
3050 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
|
3051 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
|
3052 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
|
3053 } |
15582 | 3054 } |
15479
5551adcf8f97
fix overlapping in tooltips w/ large avatars
Nathan Walp <nwalp@pidgin.im>
parents:
15474
diff
changeset
|
3055 |
22998
d678dbea81a4
Reduce the enormous padding in the group tooltip. People will hopefully dislike it less now.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22974
diff
changeset
|
3056 current_height += MAX(td->name_height + td->height, td->avatar_height) + td->padding; |
15447 | 3057 } |
32691
e71b9033d9f5
Cairo-ify buddy list tooltips.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32686
diff
changeset
|
3058 |
e71b9033d9f5
Cairo-ify buddy list tooltips.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32686
diff
changeset
|
3059 cairo_destroy(cr); |
21877
6bf73aea6450
Some utility functions for showing tooltips. This is used by the buddylist,
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21781
diff
changeset
|
3060 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
|
3061 } |
6bf73aea6450
Some utility functions for showing tooltips. This is used by the buddylist,
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21781
diff
changeset
|
3062 |
6bf73aea6450
Some utility functions for showing tooltips. This is used by the buddylist,
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21781
diff
changeset
|
3063 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
|
3064 pidgin_blist_destroy_tooltip_data(void) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3065 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3066 while(gtkblist->tooltipdata) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3067 struct tooltip_data *td = gtkblist->tooltipdata->data; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3068 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3069 if(td->avatar) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3070 g_object_unref(td->avatar); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3071 if(td->status_icon) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3072 g_object_unref(td->status_icon); |
15441 | 3073 if(td->prpl_icon) |
3074 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
|
3075 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
|
3076 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
|
3077 if (td->name_layout) |
0eb3ea7e5784
Show prpl icons in the tooltip for groups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21985
diff
changeset
|
3078 g_object_unref(td->name_layout); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3079 g_free(td); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3080 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
|
3081 } |
21877
6bf73aea6450
Some utility functions for showing tooltips. This is used by the buddylist,
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21781
diff
changeset
|
3082 } |
6bf73aea6450
Some utility functions for showing tooltips. This is used by the buddylist,
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21781
diff
changeset
|
3083 |
6bf73aea6450
Some utility functions for showing tooltips. This is used by the buddylist,
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21781
diff
changeset
|
3084 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
|
3085 { |
6bf73aea6450
Some utility functions for showing tooltips. This is used by the buddylist,
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21781
diff
changeset
|
3086 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
|
3087 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
|
3088 } |
6bf73aea6450
Some utility functions for showing tooltips. This is used by the buddylist,
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21781
diff
changeset
|
3089 |
24467
558523cebd10
A patch from db42 to fix right-to-left text in tooltips.
Richard Laager <rlaager@wiktel.com>
parents:
24414
diff
changeset
|
3090 static void |
25924
584063555949
Remove trailing whitespace
Mark Doliner <mark@kingant.net>
parents:
25920
diff
changeset
|
3091 pidgin_blist_align_tooltip(struct tooltip_data *td, GtkWidget *widget) |
584063555949
Remove trailing whitespace
Mark Doliner <mark@kingant.net>
parents:
25920
diff
changeset
|
3092 { |
584063555949
Remove trailing whitespace
Mark Doliner <mark@kingant.net>
parents:
25920
diff
changeset
|
3093 GtkTextDirection dir = gtk_widget_get_direction(widget); |
584063555949
Remove trailing whitespace
Mark Doliner <mark@kingant.net>
parents:
25920
diff
changeset
|
3094 |
584063555949
Remove trailing whitespace
Mark Doliner <mark@kingant.net>
parents:
25920
diff
changeset
|
3095 if (dir == GTK_TEXT_DIR_RTL) |
24467
558523cebd10
A patch from db42 to fix right-to-left text in tooltips.
Richard Laager <rlaager@wiktel.com>
parents:
24414
diff
changeset
|
3096 { |
558523cebd10
A patch from db42 to fix right-to-left text in tooltips.
Richard Laager <rlaager@wiktel.com>
parents:
24414
diff
changeset
|
3097 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:
24414
diff
changeset
|
3098 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:
24414
diff
changeset
|
3099 if (dir == PANGO_DIRECTION_RTL || dir == PANGO_DIRECTION_NEUTRAL) |
25924
584063555949
Remove trailing whitespace
Mark Doliner <mark@kingant.net>
parents:
25920
diff
changeset
|
3100 pango_layout_set_alignment(td->name_layout, PANGO_ALIGN_RIGHT); |
24467
558523cebd10
A patch from db42 to fix right-to-left text in tooltips.
Richard Laager <rlaager@wiktel.com>
parents:
24414
diff
changeset
|
3101 g_free(layout_name); |
25924
584063555949
Remove trailing whitespace
Mark Doliner <mark@kingant.net>
parents:
25920
diff
changeset
|
3102 pango_layout_set_alignment(td->layout, PANGO_ALIGN_RIGHT); |
24467
558523cebd10
A patch from db42 to fix right-to-left text in tooltips.
Richard Laager <rlaager@wiktel.com>
parents:
24414
diff
changeset
|
3103 } |
558523cebd10
A patch from db42 to fix right-to-left text in tooltips.
Richard Laager <rlaager@wiktel.com>
parents:
24414
diff
changeset
|
3104 } |
558523cebd10
A patch from db42 to fix right-to-left text in tooltips.
Richard Laager <rlaager@wiktel.com>
parents:
24414
diff
changeset
|
3105 |
21877
6bf73aea6450
Some utility functions for showing tooltips. This is used by the buddylist,
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21781
diff
changeset
|
3106 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
|
3107 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
|
3108 { |
6bf73aea6450
Some utility functions for showing tooltips. This is used by the buddylist,
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21781
diff
changeset
|
3109 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
|
3110 int width, height; |
21986
0eb3ea7e5784
Show prpl icons in the tooltip for groups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21985
diff
changeset
|
3111 GList *list; |
0eb3ea7e5784
Show prpl icons in the tooltip for groups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21985
diff
changeset
|
3112 int max_text_width = 0; |
0eb3ea7e5784
Show prpl icons in the tooltip for groups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21985
diff
changeset
|
3113 int max_avatar_width = 0; |
0eb3ea7e5784
Show prpl icons in the tooltip for groups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21985
diff
changeset
|
3114 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
|
3115 |
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
|
3116 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
|
3117 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
|
3118 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
|
3119 } |
3fc5862b834a
Use the new tooltip functions to draw the tooltips in the conversation window.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21933
diff
changeset
|
3120 |
21877
6bf73aea6450
Some utility functions for showing tooltips. This is used by the buddylist,
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21781
diff
changeset
|
3121 gtkblist->tipwindow = widget; |
21986
0eb3ea7e5784
Show prpl icons in the tooltip for groups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21985
diff
changeset
|
3122 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
|
3123 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
|
3124 struct tooltip_data *td = create_tip_for_node(node, TRUE); |
24467
558523cebd10
A patch from db42 to fix right-to-left text in tooltips.
Richard Laager <rlaager@wiktel.com>
parents:
24414
diff
changeset
|
3125 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
|
3126 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
|
3127 } 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
|
3128 PurpleGroup *group = (PurpleGroup*)node; |
0eb3ea7e5784
Show prpl icons in the tooltip for groups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21985
diff
changeset
|
3129 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
|
3130 struct tooltip_data *td = create_tip_for_node(node, TRUE); |
24467
558523cebd10
A patch from db42 to fix right-to-left text in tooltips.
Richard Laager <rlaager@wiktel.com>
parents:
24414
diff
changeset
|
3131 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
|
3132 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
|
3133 |
0eb3ea7e5784
Show prpl icons in the tooltip for groups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21985
diff
changeset
|
3134 /* Accounts with buddies in group */ |
0eb3ea7e5784
Show prpl icons in the tooltip for groups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21985
diff
changeset
|
3135 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
|
3136 for (; accounts != NULL; |
0eb3ea7e5784
Show prpl icons in the tooltip for groups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21985
diff
changeset
|
3137 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
|
3138 PurpleAccount *account = accounts->data; |
0eb3ea7e5784
Show prpl icons in the tooltip for groups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21985
diff
changeset
|
3139 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
|
3140 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
|
3141 } |
0eb3ea7e5784
Show prpl icons in the tooltip for groups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21985
diff
changeset
|
3142 } 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
|
3143 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
|
3144 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
|
3145 |
6bf73aea6450
Some utility functions for showing tooltips. This is used by the buddylist,
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21781
diff
changeset
|
3146 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
|
3147 { |
6bf73aea6450
Some utility functions for showing tooltips. This is used by the buddylist,
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21781
diff
changeset
|
3148 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
|
3149 struct tooltip_data *td = create_tip_for_node(child, (b == (PurpleBuddy*)child)); |
24467
558523cebd10
A patch from db42 to fix right-to-left text in tooltips.
Richard Laager <rlaager@wiktel.com>
parents:
24414
diff
changeset
|
3150 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
|
3151 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
|
3152 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
|
3153 } else { |
6bf73aea6450
Some utility functions for showing tooltips. This is used by the buddylist,
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21781
diff
changeset
|
3154 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
|
3155 } |
6bf73aea6450
Some utility functions for showing tooltips. This is used by the buddylist,
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21781
diff
changeset
|
3156 } |
6bf73aea6450
Some utility functions for showing tooltips. This is used by the buddylist,
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21781
diff
changeset
|
3157 } |
6bf73aea6450
Some utility functions for showing tooltips. This is used by the buddylist,
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21781
diff
changeset
|
3158 } else { |
6bf73aea6450
Some utility functions for showing tooltips. This is used by the buddylist,
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21781
diff
changeset
|
3159 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
|
3160 } |
6bf73aea6450
Some utility functions for showing tooltips. This is used by the buddylist,
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21781
diff
changeset
|
3161 |
21986
0eb3ea7e5784
Show prpl icons in the tooltip for groups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21985
diff
changeset
|
3162 height = width = 0; |
0eb3ea7e5784
Show prpl icons in the tooltip for groups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21985
diff
changeset
|
3163 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
|
3164 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
|
3165 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
|
3166 max_avatar_width = MAX(max_avatar_width, td->avatar_width); |
22998
d678dbea81a4
Reduce the enormous padding in the group tooltip. People will hopefully dislike it less now.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22974
diff
changeset
|
3167 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
|
3168 if (td->status_icon) |
0eb3ea7e5784
Show prpl icons in the tooltip for groups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21985
diff
changeset
|
3169 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
|
3170 } |
0eb3ea7e5784
Show prpl icons in the tooltip for groups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21985
diff
changeset
|
3171 height += TOOLTIP_BORDER; |
0eb3ea7e5784
Show prpl icons in the tooltip for groups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21985
diff
changeset
|
3172 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
|
3173 |
21877
6bf73aea6450
Some utility functions for showing tooltips. This is used by the buddylist,
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21781
diff
changeset
|
3174 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
|
3175 *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
|
3176 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
|
3177 *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
|
3178 |
6bf73aea6450
Some utility functions for showing tooltips. This is used by the buddylist,
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21781
diff
changeset
|
3179 return TRUE; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3180 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3181 |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
3182 static gboolean pidgin_blist_expand_timeout(GtkWidget *tv) |
15373
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 GtkTreePath *path; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3185 GtkTreeIter iter; |
15822 | 3186 PurpleBlistNode *node; |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
3187 struct _pidgin_blist_node *gtknode; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3188 |
25924
584063555949
Remove trailing whitespace
Mark Doliner <mark@kingant.net>
parents:
25920
diff
changeset
|
3189 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), |
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
|
3190 &path, NULL, NULL, NULL)) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3191 return FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3192 gtk_tree_model_get_iter(GTK_TREE_MODEL(gtkblist->treemodel), &iter, path); |
31096
b76def85cc04
gtkblist: Fix a few memory leaks. Refs #13162.
morshed.nader@gmail.com
parents:
31086
diff
changeset
|
3193 gtk_tree_model_get(GTK_TREE_MODEL(gtkblist->treemodel), &iter, NODE_COLUMN, &node, -1); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3194 |
15822 | 3195 if(!PURPLE_BLIST_NODE_IS_CONTACT(node)) { |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3196 gtk_tree_path_free(path); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3197 return FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3198 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3199 |
32350
cd46874707b1
Pidgin: Use the purple_blist_node_ accessor functions.
andrew.victor@mxit.com
parents:
32347
diff
changeset
|
3200 gtknode = purple_blist_node_get_ui_data(node); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3201 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3202 if (!gtknode->contact_expanded) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3203 GtkTreeIter i; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3204 |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
3205 pidgin_blist_expand_contact_cb(NULL, node); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3206 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3207 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
|
3208 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
|
3209 gtkblist->mouseover_contact = node; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3210 gtk_tree_path_down (path); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3211 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
|
3212 GdkRectangle rect; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3213 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
|
3214 gtkblist->contact_rect.height += rect.height; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3215 gtk_tree_path_next(path); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3216 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3217 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3218 gtk_tree_path_free(path); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3219 return FALSE; |
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 |
15822 | 3222 static gboolean buddy_is_displayable(PurpleBuddy *buddy) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3223 { |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
3224 struct _pidgin_blist_node *gtknode; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3225 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3226 if(!buddy) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3227 return FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3228 |
32350
cd46874707b1
Pidgin: Use the purple_blist_node_ accessor functions.
andrew.victor@mxit.com
parents:
32347
diff
changeset
|
3229 gtknode = purple_blist_node_get_ui_data(PURPLE_BLIST_NODE(buddy)); |
15822 | 3230 |
32342
b6276b10cb10
Use the PurpleBuddy accessor functions.
andrew.victor@mxit.com
parents:
32305
diff
changeset
|
3231 return (purple_account_is_connected(purple_buddy_get_account(buddy)) && |
b6276b10cb10
Use the PurpleBuddy accessor functions.
andrew.victor@mxit.com
parents:
32305
diff
changeset
|
3232 (purple_presence_is_online(purple_buddy_get_presence(buddy)) || |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3233 (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
|
3234 purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/blist/show_offline_buddies") || |
32350
cd46874707b1
Pidgin: Use the purple_blist_node_ accessor functions.
andrew.victor@mxit.com
parents:
32347
diff
changeset
|
3235 purple_blist_node_get_bool(PURPLE_BLIST_NODE(buddy), "show_offline"))); |
15373
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 |
18671 | 3238 void pidgin_blist_draw_tooltip(PurpleBlistNode *node, GtkWidget *widget) |
3239 { | |
21877
6bf73aea6450
Some utility functions for showing tooltips. This is used by the buddylist,
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21781
diff
changeset
|
3240 pidgin_tooltip_show(widget, node, pidgin_blist_create_tooltip_for_node, pidgin_blist_paint_tip); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3241 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3242 |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
3243 static gboolean pidgin_blist_drag_motion_cb(GtkWidget *tv, GdkDragContext *drag_context, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3244 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
|
3245 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3246 GtkTreePath *path; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3247 int delay; |
17404
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:
17360
diff
changeset
|
3248 GdkRectangle rect; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3249 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3250 /* |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3251 * 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
|
3252 * the contact auto-expands. |
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 delay = 900; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3255 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3256 if (gtkblist->drag_timeout) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3257 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
|
3258 return FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3259 /* 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
|
3260 g_source_remove(gtkblist->drag_timeout); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3261 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3262 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3263 gtk_tree_view_get_path_at_pos(GTK_TREE_VIEW(tv), x, y, &path, NULL, NULL, NULL); |
17404
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:
17360
diff
changeset
|
3264 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:
17360
diff
changeset
|
3265 |
22323
42724bd41274
Plug some leaks caused by GtkTreePaths not being freed.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22299
diff
changeset
|
3266 if (path) |
42724bd41274
Plug some leaks caused by GtkTreePaths not being freed.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22299
diff
changeset
|
3267 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
|
3268 |
17404
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:
17360
diff
changeset
|
3269 /* 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:
17360
diff
changeset
|
3270 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:
17360
diff
changeset
|
3271 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:
17360
diff
changeset
|
3272 return FALSE; |
25924
584063555949
Remove trailing whitespace
Mark Doliner <mark@kingant.net>
parents:
25920
diff
changeset
|
3273 |
17404
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:
17360
diff
changeset
|
3274 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:
17360
diff
changeset
|
3275 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:
17360
diff
changeset
|
3276 |
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:
17360
diff
changeset
|
3277 gtkblist->tip_rect = rect; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3278 |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
3279 gtkblist->drag_timeout = g_timeout_add(delay, (GSourceFunc)pidgin_blist_expand_timeout, tv); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3280 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3281 if (gtkblist->mouseover_contact) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3282 if ((y < gtkblist->contact_rect.y) || ((y - gtkblist->contact_rect.height) > gtkblist->contact_rect.y)) { |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
3283 pidgin_blist_collapse_contact_cb(NULL, gtkblist->mouseover_contact); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3284 gtkblist->mouseover_contact = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3285 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3286 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3287 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3288 return FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3289 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3290 |
21877
6bf73aea6450
Some utility functions for showing tooltips. This is used by the buddylist,
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21781
diff
changeset
|
3291 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
|
3292 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
|
3293 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
|
3294 { |
6bf73aea6450
Some utility functions for showing tooltips. This is used by the buddylist,
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21781
diff
changeset
|
3295 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
|
3296 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
|
3297 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
|
3298 |
6bf73aea6450
Some utility functions for showing tooltips. This is used by the buddylist,
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21781
diff
changeset
|
3299 /* 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
|
3300 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
|
3301 if (editable) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3302 return FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3303 |
21877
6bf73aea6450
Some utility functions for showing tooltips. This is used by the buddylist,
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21781
diff
changeset
|
3304 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
|
3305 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
|
3306 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
|
3307 } |
6bf73aea6450
Some utility functions for showing tooltips. This is used by the buddylist,
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21781
diff
changeset
|
3308 |
6bf73aea6450
Some utility functions for showing tooltips. This is used by the buddylist,
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21781
diff
changeset
|
3309 gtk_tree_model_get_iter(GTK_TREE_MODEL(gtkblist->treemodel), &iter, path); |
31096
b76def85cc04
gtkblist: Fix a few memory leaks. Refs #13162.
morshed.nader@gmail.com
parents:
31086
diff
changeset
|
3310 gtk_tree_model_get(GTK_TREE_MODEL(gtkblist->treemodel), &iter, NODE_COLUMN, &node, -1); |
b76def85cc04
gtkblist: Fix a few memory leaks. Refs #13162.
morshed.nader@gmail.com
parents:
31086
diff
changeset
|
3311 |
21877
6bf73aea6450
Some utility functions for showing tooltips. This is used by the buddylist,
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21781
diff
changeset
|
3312 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
|
3313 } |
6bf73aea6450
Some utility functions for showing tooltips. This is used by the buddylist,
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21781
diff
changeset
|
3314 |
6bf73aea6450
Some utility functions for showing tooltips. This is used by the buddylist,
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21781
diff
changeset
|
3315 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
|
3316 { |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3317 if (gtkblist->mouseover_contact) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3318 if ((event->y < gtkblist->contact_rect.y) || ((event->y - gtkblist->contact_rect.height) > gtkblist->contact_rect.y)) { |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
3319 pidgin_blist_collapse_contact_cb(NULL, gtkblist->mouseover_contact); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3320 gtkblist->mouseover_contact = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3321 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3322 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3323 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3324 return FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3325 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3326 |
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
|
3327 static gboolean pidgin_blist_leave_cb (GtkWidget *w, GdkEventCrossing *e, gpointer n) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3328 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3329 if (gtkblist->timeout) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3330 g_source_remove(gtkblist->timeout); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3331 gtkblist->timeout = 0; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3332 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3333 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3334 if (gtkblist->drag_timeout) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3335 g_source_remove(gtkblist->drag_timeout); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3336 gtkblist->drag_timeout = 0; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3337 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3338 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3339 if (gtkblist->mouseover_contact && |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3340 !((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
|
3341 (e->y > gtkblist->contact_rect.y) && (e->y < (gtkblist->contact_rect.y + gtkblist->contact_rect.height)))) { |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
3342 pidgin_blist_collapse_contact_cb(NULL, gtkblist->mouseover_contact); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3343 gtkblist->mouseover_contact = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3344 } |
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
|
3345 return FALSE; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3346 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3347 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3348 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3349 toggle_debug(void) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3350 { |
16062
07554cc5d090
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <stu@nosnilmot.com>
parents:
16010
diff
changeset
|
3351 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
|
3352 !purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/debug/enabled")); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3353 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3354 |
29591
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3355 static char *get_mood_icon_path(const char *mood) |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3356 { |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3357 char *path; |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3358 |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3359 if (!strcmp(mood, "busy")) { |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3360 path = g_build_filename(DATADIR, "pixmaps", "pidgin", |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3361 "status", "16", "busy.png", NULL); |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3362 } else if (!strcmp(mood, "hiptop")) { |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3363 path = g_build_filename(DATADIR, "pixmaps", "pidgin", |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3364 "emblems", "16", "hiptop.png", NULL); |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3365 } else { |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3366 char *filename = g_strdup_printf("%s.png", mood); |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3367 path = g_build_filename(DATADIR, "pixmaps", "pidgin", |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3368 "emotes", "small", filename, NULL); |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3369 g_free(filename); |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3370 } |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3371 return path; |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3372 } |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3373 |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3374 static void |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3375 update_status_with_mood(PurpleAccount *account, const gchar *mood, |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3376 const gchar *text) |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3377 { |
29639
d98eee650379
Some fixes related to setting moods.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
29636
diff
changeset
|
3378 if (mood && *mood) { |
29591
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3379 if (text) { |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3380 purple_account_set_status(account, "mood", TRUE, |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3381 PURPLE_MOOD_NAME, mood, |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3382 PURPLE_MOOD_COMMENT, text, |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3383 NULL); |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3384 } else { |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3385 purple_account_set_status(account, "mood", TRUE, |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3386 PURPLE_MOOD_NAME, mood, |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3387 NULL); |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3388 } |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3389 } else { |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3390 purple_account_set_status(account, "mood", FALSE, NULL); |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3391 } |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3392 } |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3393 |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3394 static void |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3395 edit_mood_cb(PurpleConnection *gc, PurpleRequestFields *fields) |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3396 { |
29639
d98eee650379
Some fixes related to setting moods.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
29636
diff
changeset
|
3397 PurpleRequestField *mood_field; |
29591
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3398 GList *l; |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3399 |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3400 mood_field = purple_request_fields_get_field(fields, "mood"); |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3401 l = purple_request_field_list_get_selected(mood_field); |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3402 |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3403 if (l) { |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3404 const char *mood = purple_request_field_list_get_data(mood_field, l->data); |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3405 |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3406 if (gc) { |
29639
d98eee650379
Some fixes related to setting moods.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
29636
diff
changeset
|
3407 const char *text; |
29591
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3408 PurpleAccount *account = purple_connection_get_account(gc); |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3409 |
32305
2ec94166be43
On the way to hiding the PurpleConnection struct.
andrew.victor@mxit.com
parents:
32246
diff
changeset
|
3410 if (purple_connection_get_flags(gc) & PURPLE_CONNECTION_SUPPORT_MOOD_MESSAGES) { |
29639
d98eee650379
Some fixes related to setting moods.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
29636
diff
changeset
|
3411 PurpleRequestField *text_field; |
d98eee650379
Some fixes related to setting moods.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
29636
diff
changeset
|
3412 text_field = purple_request_fields_get_field(fields, "text"); |
d98eee650379
Some fixes related to setting moods.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
29636
diff
changeset
|
3413 text = purple_request_field_string_get_value(text_field); |
d98eee650379
Some fixes related to setting moods.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
29636
diff
changeset
|
3414 } else { |
d98eee650379
Some fixes related to setting moods.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
29636
diff
changeset
|
3415 text = NULL; |
d98eee650379
Some fixes related to setting moods.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
29636
diff
changeset
|
3416 } |
d98eee650379
Some fixes related to setting moods.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
29636
diff
changeset
|
3417 |
29591
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3418 update_status_with_mood(account, mood, text); |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3419 } else { |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3420 GList *accounts = purple_accounts_get_all_active(); |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3421 |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3422 for (; accounts ; accounts = g_list_delete_link(accounts, accounts)) { |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3423 PurpleAccount *account = (PurpleAccount *) accounts->data; |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3424 PurpleConnection *gc = purple_account_get_connection(account); |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3425 |
32305
2ec94166be43
On the way to hiding the PurpleConnection struct.
andrew.victor@mxit.com
parents:
32246
diff
changeset
|
3426 if (gc && (purple_connection_get_flags(gc) & PURPLE_CONNECTION_SUPPORT_MOODS)) { |
29639
d98eee650379
Some fixes related to setting moods.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
29636
diff
changeset
|
3427 update_status_with_mood(account, mood, NULL); |
29591
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3428 } |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3429 } |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3430 } |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3431 } |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3432 } |
31086
a8cc50c2279f
Remove trailing whitespace
Richard Laager <rlaager@wiktel.com>
parents:
30459
diff
changeset
|
3433 |
29591
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3434 static void |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3435 global_moods_for_each(gpointer key, gpointer value, gpointer user_data) |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3436 { |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3437 GList **out_moods = (GList **) user_data; |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3438 PurpleMood *mood = (PurpleMood *) value; |
31086
a8cc50c2279f
Remove trailing whitespace
Richard Laager <rlaager@wiktel.com>
parents:
30459
diff
changeset
|
3439 |
29591
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3440 *out_moods = g_list_append(*out_moods, mood); |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3441 } |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3442 |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3443 static PurpleMood * |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3444 get_global_moods(void) |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3445 { |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3446 GHashTable *global_moods = |
29639
d98eee650379
Some fixes related to setting moods.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
29636
diff
changeset
|
3447 g_hash_table_new_full(g_str_hash, g_str_equal, NULL, NULL); |
29591
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3448 GHashTable *mood_counts = |
29639
d98eee650379
Some fixes related to setting moods.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
29636
diff
changeset
|
3449 g_hash_table_new_full(g_str_hash, g_str_equal, NULL, NULL); |
29591
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3450 GList *accounts = purple_accounts_get_all_active(); |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3451 PurpleMood *result = NULL; |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3452 GList *out_moods = NULL; |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3453 int i = 0; |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3454 int num_accounts = 0; |
31086
a8cc50c2279f
Remove trailing whitespace
Richard Laager <rlaager@wiktel.com>
parents:
30459
diff
changeset
|
3455 |
29591
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3456 for (; accounts ; accounts = g_list_delete_link(accounts, accounts)) { |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3457 PurpleAccount *account = (PurpleAccount *) accounts->data; |
29981
8e060965d69f
pidgin: Fix a crash when accessing the Set Moods tool menu when having
Marcus Lundblad <ml@update.uu.se>
parents:
29957
diff
changeset
|
3458 if (purple_account_is_connected(account)) { |
8e060965d69f
pidgin: Fix a crash when accessing the Set Moods tool menu when having
Marcus Lundblad <ml@update.uu.se>
parents:
29957
diff
changeset
|
3459 PurpleConnection *gc = purple_account_get_connection(account); |
8e060965d69f
pidgin: Fix a crash when accessing the Set Moods tool menu when having
Marcus Lundblad <ml@update.uu.se>
parents:
29957
diff
changeset
|
3460 |
32305
2ec94166be43
On the way to hiding the PurpleConnection struct.
andrew.victor@mxit.com
parents:
32246
diff
changeset
|
3461 if (purple_connection_get_flags(gc) & PURPLE_CONNECTION_SUPPORT_MOODS) { |
29981
8e060965d69f
pidgin: Fix a crash when accessing the Set Moods tool menu when having
Marcus Lundblad <ml@update.uu.se>
parents:
29957
diff
changeset
|
3462 PurplePluginProtocolInfo *prpl_info = |
32305
2ec94166be43
On the way to hiding the PurpleConnection struct.
andrew.victor@mxit.com
parents:
32246
diff
changeset
|
3463 PURPLE_PLUGIN_PROTOCOL_INFO(purple_connection_get_prpl(gc)); |
29981
8e060965d69f
pidgin: Fix a crash when accessing the Set Moods tool menu when having
Marcus Lundblad <ml@update.uu.se>
parents:
29957
diff
changeset
|
3464 PurpleMood *mood = NULL; |
8e060965d69f
pidgin: Fix a crash when accessing the Set Moods tool menu when having
Marcus Lundblad <ml@update.uu.se>
parents:
29957
diff
changeset
|
3465 |
8e060965d69f
pidgin: Fix a crash when accessing the Set Moods tool menu when having
Marcus Lundblad <ml@update.uu.se>
parents:
29957
diff
changeset
|
3466 /* PURPLE_CONNECTION_SUPPORT_MOODS would not be set if the prpl doesn't |
8e060965d69f
pidgin: Fix a crash when accessing the Set Moods tool menu when having
Marcus Lundblad <ml@update.uu.se>
parents:
29957
diff
changeset
|
3467 * have get_moods, so using PURPLE_PROTOCOL_PLUGIN_HAS_FUNC isn't necessary |
8e060965d69f
pidgin: Fix a crash when accessing the Set Moods tool menu when having
Marcus Lundblad <ml@update.uu.se>
parents:
29957
diff
changeset
|
3468 * here */ |
8e060965d69f
pidgin: Fix a crash when accessing the Set Moods tool menu when having
Marcus Lundblad <ml@update.uu.se>
parents:
29957
diff
changeset
|
3469 for (mood = prpl_info->get_moods(account) ; |
8e060965d69f
pidgin: Fix a crash when accessing the Set Moods tool menu when having
Marcus Lundblad <ml@update.uu.se>
parents:
29957
diff
changeset
|
3470 mood->mood != NULL ; mood++) { |
8e060965d69f
pidgin: Fix a crash when accessing the Set Moods tool menu when having
Marcus Lundblad <ml@update.uu.se>
parents:
29957
diff
changeset
|
3471 int mood_count = |
8e060965d69f
pidgin: Fix a crash when accessing the Set Moods tool menu when having
Marcus Lundblad <ml@update.uu.se>
parents:
29957
diff
changeset
|
3472 GPOINTER_TO_INT(g_hash_table_lookup(mood_counts, mood->mood)); |
8e060965d69f
pidgin: Fix a crash when accessing the Set Moods tool menu when having
Marcus Lundblad <ml@update.uu.se>
parents:
29957
diff
changeset
|
3473 |
8e060965d69f
pidgin: Fix a crash when accessing the Set Moods tool menu when having
Marcus Lundblad <ml@update.uu.se>
parents:
29957
diff
changeset
|
3474 if (!g_hash_table_lookup(global_moods, mood->mood)) { |
8e060965d69f
pidgin: Fix a crash when accessing the Set Moods tool menu when having
Marcus Lundblad <ml@update.uu.se>
parents:
29957
diff
changeset
|
3475 g_hash_table_insert(global_moods, (gpointer)mood->mood, mood); |
8e060965d69f
pidgin: Fix a crash when accessing the Set Moods tool menu when having
Marcus Lundblad <ml@update.uu.se>
parents:
29957
diff
changeset
|
3476 } |
8e060965d69f
pidgin: Fix a crash when accessing the Set Moods tool menu when having
Marcus Lundblad <ml@update.uu.se>
parents:
29957
diff
changeset
|
3477 g_hash_table_insert(mood_counts, (gpointer)mood->mood, |
8e060965d69f
pidgin: Fix a crash when accessing the Set Moods tool menu when having
Marcus Lundblad <ml@update.uu.se>
parents:
29957
diff
changeset
|
3478 GINT_TO_POINTER(mood_count + 1)); |
29591
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3479 } |
29981
8e060965d69f
pidgin: Fix a crash when accessing the Set Moods tool menu when having
Marcus Lundblad <ml@update.uu.se>
parents:
29957
diff
changeset
|
3480 |
8e060965d69f
pidgin: Fix a crash when accessing the Set Moods tool menu when having
Marcus Lundblad <ml@update.uu.se>
parents:
29957
diff
changeset
|
3481 num_accounts++; |
29591
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3482 } |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3483 } |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3484 } |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3485 |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3486 g_hash_table_foreach(global_moods, global_moods_for_each, &out_moods); |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3487 result = g_new0(PurpleMood, g_hash_table_size(global_moods) + 1); |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3488 |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3489 while (out_moods) { |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3490 PurpleMood *mood = (PurpleMood *) out_moods->data; |
31086
a8cc50c2279f
Remove trailing whitespace
Richard Laager <rlaager@wiktel.com>
parents:
30459
diff
changeset
|
3491 int in_num_accounts = |
29591
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3492 GPOINTER_TO_INT(g_hash_table_lookup(mood_counts, mood->mood)); |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3493 |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3494 if (in_num_accounts == num_accounts) { |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3495 /* mood is present in all accounts supporting moods */ |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3496 result[i].mood = mood->mood; |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3497 result[i].description = mood->description; |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3498 i++; |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3499 } |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3500 out_moods = g_list_delete_link(out_moods, out_moods); |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3501 } |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3502 |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3503 g_hash_table_destroy(global_moods); |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3504 g_hash_table_destroy(mood_counts); |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3505 |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3506 return result; |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3507 } |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3508 |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3509 /* get current set mood for all mood-supporting accounts, or NULL if not set |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3510 or not set to the same on all */ |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3511 static const gchar * |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3512 get_global_mood_status(void) |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3513 { |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3514 GList *accounts = purple_accounts_get_all_active(); |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3515 const gchar *found_mood = NULL; |
31086
a8cc50c2279f
Remove trailing whitespace
Richard Laager <rlaager@wiktel.com>
parents:
30459
diff
changeset
|
3516 |
29591
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3517 for (; accounts ; accounts = g_list_delete_link(accounts, accounts)) { |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3518 PurpleAccount *account = (PurpleAccount *) accounts->data; |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3519 |
29981
8e060965d69f
pidgin: Fix a crash when accessing the Set Moods tool menu when having
Marcus Lundblad <ml@update.uu.se>
parents:
29957
diff
changeset
|
3520 if (purple_account_is_connected(account) && |
32305
2ec94166be43
On the way to hiding the PurpleConnection struct.
andrew.victor@mxit.com
parents:
32246
diff
changeset
|
3521 (purple_connection_get_flags(purple_account_get_connection(account)) & |
29981
8e060965d69f
pidgin: Fix a crash when accessing the Set Moods tool menu when having
Marcus Lundblad <ml@update.uu.se>
parents:
29957
diff
changeset
|
3522 PURPLE_CONNECTION_SUPPORT_MOODS)) { |
29591
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3523 PurplePresence *presence = purple_account_get_presence(account); |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3524 PurpleStatus *status = purple_presence_get_status(presence, "mood"); |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3525 const gchar *curr_mood = purple_status_get_attr_string(status, PURPLE_MOOD_NAME); |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3526 |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3527 if (found_mood != NULL && !purple_strequal(curr_mood, found_mood)) { |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3528 /* found a different mood */ |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3529 found_mood = NULL; |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3530 break; |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3531 } else { |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3532 found_mood = curr_mood; |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3533 } |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3534 } |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3535 } |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3536 |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3537 return found_mood; |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3538 } |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3539 |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3540 static void |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3541 set_mood_cb(GtkWidget *widget, PurpleAccount *account) |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3542 { |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3543 const char *current_mood; |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3544 PurpleRequestFields *fields; |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3545 PurpleRequestFieldGroup *g; |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3546 PurpleRequestField *f; |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3547 PurpleConnection *gc = NULL; |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3548 PurplePluginProtocolInfo *prpl_info = NULL; |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3549 PurpleMood *mood; |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3550 PurpleMood *global_moods = get_global_moods(); |
31086
a8cc50c2279f
Remove trailing whitespace
Richard Laager <rlaager@wiktel.com>
parents:
30459
diff
changeset
|
3551 |
29591
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3552 if (account) { |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3553 PurplePresence *presence = purple_account_get_presence(account); |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3554 PurpleStatus *status = purple_presence_get_status(presence, "mood"); |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3555 gc = purple_account_get_connection(account); |
32305
2ec94166be43
On the way to hiding the PurpleConnection struct.
andrew.victor@mxit.com
parents:
32246
diff
changeset
|
3556 g_return_if_fail(purple_connection_get_prpl(gc) != NULL); |
2ec94166be43
On the way to hiding the PurpleConnection struct.
andrew.victor@mxit.com
parents:
32246
diff
changeset
|
3557 prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(purple_connection_get_prpl(gc)); |
29591
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3558 current_mood = purple_status_get_attr_string(status, PURPLE_MOOD_NAME); |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3559 } else { |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3560 current_mood = get_global_mood_status(); |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3561 } |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3562 |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3563 fields = purple_request_fields_new(); |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3564 g = purple_request_field_group_new(NULL); |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3565 f = purple_request_field_list_new("mood", _("Please select your mood from the list")); |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3566 |
32153
694382c3d150
Remove deprecated purple_request_field_list_add().
andrew.victor@mxit.com
parents:
32031
diff
changeset
|
3567 purple_request_field_list_add_icon(f, _("None"), NULL, ""); |
29591
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3568 if (current_mood == NULL) |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3569 purple_request_field_list_add_selected(f, _("None")); |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3570 |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3571 /* TODO: rlaager wants this sorted. */ |
30220
53469b47d3f3
Add a comment noting the moods should be sorted post-translation.
Paul Aurich <paul@darkrain42.org>
parents:
30183
diff
changeset
|
3572 /* TODO: darkrain wants it sorted post-translation */ |
53469b47d3f3
Add a comment noting the moods should be sorted post-translation.
Paul Aurich <paul@darkrain42.org>
parents:
30183
diff
changeset
|
3573 if (account && PURPLE_PROTOCOL_PLUGIN_HAS_FUNC(prpl_info, get_moods)) |
53469b47d3f3
Add a comment noting the moods should be sorted post-translation.
Paul Aurich <paul@darkrain42.org>
parents:
30183
diff
changeset
|
3574 mood = prpl_info->get_moods(account); |
53469b47d3f3
Add a comment noting the moods should be sorted post-translation.
Paul Aurich <paul@darkrain42.org>
parents:
30183
diff
changeset
|
3575 else |
53469b47d3f3
Add a comment noting the moods should be sorted post-translation.
Paul Aurich <paul@darkrain42.org>
parents:
30183
diff
changeset
|
3576 mood = global_moods; |
53469b47d3f3
Add a comment noting the moods should be sorted post-translation.
Paul Aurich <paul@darkrain42.org>
parents:
30183
diff
changeset
|
3577 for ( ; mood->mood != NULL ; mood++) { |
29591
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3578 char *path; |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3579 |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3580 if (mood->mood == NULL || mood->description == NULL) |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3581 continue; |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3582 |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3583 path = get_mood_icon_path(mood->mood); |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3584 purple_request_field_list_add_icon(f, _(mood->description), |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3585 path, (gpointer)mood->mood); |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3586 g_free(path); |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3587 |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3588 if (current_mood && !strcmp(current_mood, mood->mood)) |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3589 purple_request_field_list_add_selected(f, _(mood->description)); |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3590 } |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3591 purple_request_field_group_add_field(g, f); |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3592 |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3593 purple_request_fields_add_group(fields, g); |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3594 |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3595 /* if the connection allows setting a mood message */ |
32305
2ec94166be43
On the way to hiding the PurpleConnection struct.
andrew.victor@mxit.com
parents:
32246
diff
changeset
|
3596 if (gc && (purple_connection_get_flags(gc) & PURPLE_CONNECTION_SUPPORT_MOOD_MESSAGES)) { |
29591
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3597 g = purple_request_field_group_new(NULL); |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3598 f = purple_request_field_string_new("text", |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3599 _("Message (optional)"), NULL, FALSE); |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3600 purple_request_field_group_add_field(g, f); |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3601 purple_request_fields_add_group(fields, g); |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3602 } |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3603 |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3604 purple_request_fields(gc, _("Edit User Mood"), _("Edit User Mood"), |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3605 NULL, fields, |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3606 _("OK"), G_CALLBACK(edit_mood_cb), |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3607 _("Cancel"), NULL, |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3608 gc ? purple_connection_get_account(gc) : NULL, |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3609 NULL, NULL, gc); |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3610 |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3611 g_free(global_moods); |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3612 } |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3613 |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3614 static void |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3615 set_mood_show(void) |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3616 { |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3617 set_mood_cb(NULL, NULL); |
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
3618 } |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3619 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3620 /*************************************************** |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3621 * Crap * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3622 ***************************************************/ |
32582
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
3623 /* TODO: fill out tooltips... */ |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
3624 static const GtkActionEntry blist_menu_entries[] = { |
32683
d8c74de25b5f
Apply some updates to UI Manager version of blist menu: Change the key
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32673
diff
changeset
|
3625 /* NOTE: Do not set any accelerator to Control+O. It is mapped by |
d8c74de25b5f
Apply some updates to UI Manager version of blist menu: Change the key
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32673
diff
changeset
|
3626 gtk_blist_key_press_cb to "Get User Info" on the selected buddy. */ |
32582
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
3627 /* Buddies menu */ |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
3628 { "BuddiesMenu", NULL, N_("_Buddies"), NULL, NULL, NULL }, |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
3629 { "NewInstantMessage", PIDGIN_STOCK_TOOLBAR_MESSAGE_NEW, N_("New Instant _Message..."), "<control>M", NULL, pidgin_dialogs_im }, |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
3630 { "JoinAChat", PIDGIN_STOCK_CHAT, N_("Join a _Chat..."), "<control>C", NULL, pidgin_blist_joinchat_show }, |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
3631 { "GetUserInfo", PIDGIN_STOCK_TOOLBAR_USER_INFO, N_("Get User _Info..."), "<control>I", NULL, pidgin_dialogs_info }, |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
3632 { "ViewUserLog", NULL, N_("View User _Log..."), "<control>L", NULL, pidgin_dialogs_log }, |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
3633 { "ShowMenu", NULL, N_("Sh_ow"), NULL, NULL, NULL }, |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
3634 { "SortMenu", NULL, N_("_Sort Buddies"), NULL, NULL, NULL }, |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
3635 { "AddBuddy", GTK_STOCK_ADD, N_("_Add Buddy..."), "<control>B", NULL, pidgin_blist_add_buddy_cb }, |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
3636 { "AddChat", GTK_STOCK_ADD, N_("Add C_hat..."), NULL, NULL, pidgin_blist_add_chat_cb }, |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
3637 { "AddGroup", GTK_STOCK_ADD, N_("Add _Group..."), NULL, NULL, purple_blist_request_add_group }, |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
3638 { "Quit", GTK_STOCK_QUIT, N_("_Quit"), "<control>Q", NULL, purple_core_quit }, |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
3639 |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
3640 /* Accounts menu */ |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
3641 { "AccountsMenu", NULL, N_("_Accounts"), NULL, NULL, NULL }, |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
3642 { "ManageAccounts", NULL, N_("Manage Accounts"), "<control>A", NULL, pidgin_accounts_window_show }, |
32585
7b00e8c1ada8
Sort of get the accounts menu working again. Except UI manager insists on
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32584
diff
changeset
|
3643 { "EnableAccountMenu", NULL, N_("Enable Account"), NULL, NULL, NULL }, |
32582
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
3644 |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
3645 /* Tools */ |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
3646 { "ToolsMenu", NULL, N_("_Tools"), NULL, NULL, NULL }, |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
3647 { "BuddyPounces", NULL, N_("Buddy _Pounces"), NULL, NULL, pidgin_pounces_manager_show }, |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
3648 { "Certificates", NULL, N_("_Certificates"), NULL, NULL, pidgin_certmgr_show }, |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
3649 { "CustomSmileys", PIDGIN_STOCK_TOOLBAR_SMILEY, N_("Custom Smile_ys"), "<control>Y", NULL, pidgin_smiley_manager_show }, |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
3650 { "Plugins", PIDGIN_STOCK_TOOLBAR_PLUGINS, N_("Plu_gins"), "<control>U", NULL, pidgin_plugin_dialog_show }, |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
3651 { "Preferences", GTK_STOCK_PREFERENCES, N_("Pr_eferences"), "<control>P", NULL, pidgin_prefs_show }, |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
3652 { "Privacy", NULL, N_("Pr_ivacy"), NULL, NULL, pidgin_privacy_dialog_show }, |
32683
d8c74de25b5f
Apply some updates to UI Manager version of blist menu: Change the key
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32673
diff
changeset
|
3653 { "SetMood", NULL, N_("Set _Mood"), "<control>D", NULL, set_mood_show }, |
32588
c8e05a81428f
Get rid of the remaining warnings in gtkblist.c.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32587
diff
changeset
|
3654 { "FileTransfers", PIDGIN_STOCK_TOOLBAR_TRANSFER, N_("_File Transfers"), "<control>T", NULL, G_CALLBACK(gtk_blist_show_xfer_dialog_cb) }, |
32582
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
3655 { "RoomList", NULL, N_("R_oom List"), NULL, NULL, pidgin_roomlist_dialog_show }, |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
3656 { "SystemLog", NULL, N_("System _Log"), NULL, NULL, gtk_blist_show_systemlog_cb }, |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
3657 |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
3658 /* Help */ |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
3659 { "HelpMenu", NULL, N_("_Help"), NULL, NULL, NULL }, |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
3660 { "OnlineHelp", GTK_STOCK_HELP, N_("Online _Help"), "F1", NULL, gtk_blist_show_onlinehelp_cb }, |
32607
9a0990fd41ed
propagate from branch 'im.pidgin.pidgin' (head 302c560990dbae6b00f9ca0ef36b3c160b190bdb)
Elliott Sales de Andrade <qulogic@pidgin.im>
diff
changeset
|
3661 { "BuildInformation", NULL, N_("_Build Information"), NULL, NULL, pidgin_dialogs_buildinfo }, |
32582
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
3662 { "DebugWindow", NULL, N_("_Debug Window"), NULL, NULL, toggle_debug }, |
32607
9a0990fd41ed
propagate from branch 'im.pidgin.pidgin' (head 302c560990dbae6b00f9ca0ef36b3c160b190bdb)
Elliott Sales de Andrade <qulogic@pidgin.im>
diff
changeset
|
3663 { "DeveloperInformation", NULL, N_("De_veloper Information"), NULL, NULL, pidgin_dialogs_developers }, |
32683
d8c74de25b5f
Apply some updates to UI Manager version of blist menu: Change the key
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32673
diff
changeset
|
3664 { "PluginInformation", NULL, N_("_Plugin Information"), NULL, NULL, pidgin_dialogs_plugins_info }, |
32607
9a0990fd41ed
propagate from branch 'im.pidgin.pidgin' (head 302c560990dbae6b00f9ca0ef36b3c160b190bdb)
Elliott Sales de Andrade <qulogic@pidgin.im>
diff
changeset
|
3665 { "TranslatorInformation", NULL, N_("_Translator Information"), NULL, NULL, pidgin_dialogs_translators }, |
32582
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
3666 { "About", GTK_STOCK_ABOUT, N_("_About"), NULL, NULL, pidgin_dialogs_about }, |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
3667 }; |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
3668 |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
3669 /* Toggle items */ |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
3670 static const GtkToggleActionEntry blist_menu_toggle_entries[] = { |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
3671 /* Buddies->Show menu */ |
32588
c8e05a81428f
Get rid of the remaining warnings in gtkblist.c.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32587
diff
changeset
|
3672 { "ShowOffline", NULL, N_("_Offline Buddies"), NULL, NULL, G_CALLBACK(pidgin_blist_edit_mode_cb), FALSE }, |
c8e05a81428f
Get rid of the remaining warnings in gtkblist.c.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32587
diff
changeset
|
3673 { "ShowEmptyGroups", NULL, N_("_Empty Groups"), NULL, NULL, G_CALLBACK(pidgin_blist_show_empty_groups_cb), FALSE }, |
c8e05a81428f
Get rid of the remaining warnings in gtkblist.c.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32587
diff
changeset
|
3674 { "ShowBuddyDetails", NULL, N_("Buddy _Details"), NULL, NULL, G_CALLBACK(pidgin_blist_buddy_details_cb), FALSE }, |
c8e05a81428f
Get rid of the remaining warnings in gtkblist.c.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32587
diff
changeset
|
3675 { "ShowIdleTimes", NULL, N_("Idle _Times"), NULL, NULL, G_CALLBACK(pidgin_blist_show_idle_time_cb), FALSE }, |
c8e05a81428f
Get rid of the remaining warnings in gtkblist.c.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32587
diff
changeset
|
3676 { "ShowProtocolIcons", NULL, N_("_Protocol Icons"), NULL, NULL, G_CALLBACK(pidgin_blist_show_protocol_icons_cb), FALSE }, |
32582
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
3677 |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
3678 /* Tools menu */ |
32588
c8e05a81428f
Get rid of the remaining warnings in gtkblist.c.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32587
diff
changeset
|
3679 { "MuteSounds", NULL, N_("Mute _Sounds"), NULL, NULL, G_CALLBACK(pidgin_blist_mute_sounds_cb), FALSE }, |
32582
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
3680 }; |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
3681 |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
3682 static const char *blist_menu = |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
3683 "<ui>" |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
3684 "<menubar name='BList'>" |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
3685 "<menu action='BuddiesMenu'>" |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
3686 "<menuitem action='NewInstantMessage'/>" |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
3687 "<menuitem action='JoinAChat'/>" |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
3688 "<menuitem action='GetUserInfo'/>" |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
3689 "<menuitem action='ViewUserLog'/>" |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
3690 "<separator/>" |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
3691 "<menu action='ShowMenu'>" |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
3692 "<menuitem action='ShowOffline'/>" |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
3693 "<menuitem action='ShowEmptyGroups'/>" |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
3694 "<menuitem action='ShowBuddyDetails'/>" |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
3695 "<menuitem action='ShowIdleTimes'/>" |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
3696 "<menuitem action='ShowProtocolIcons'/>" |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
3697 "</menu>" |
32584
a91802881406
Get BList sort methods actually working, and clean up the warnings that
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32583
diff
changeset
|
3698 "<menu action='SortMenu'/>" |
32582
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
3699 "<separator/>" |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
3700 "<menuitem action='AddBuddy'/>" |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
3701 "<menuitem action='AddChat'/>" |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
3702 "<menuitem action='AddGroup'/>" |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
3703 "<separator/>" |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
3704 "<menuitem action='Quit'/>" |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
3705 "</menu>" |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
3706 "<menu action='AccountsMenu'>" |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
3707 "<menuitem action='ManageAccounts'/>" |
32585
7b00e8c1ada8
Sort of get the accounts menu working again. Except UI manager insists on
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32584
diff
changeset
|
3708 "<menu action='EnableAccountMenu'/>" |
7b00e8c1ada8
Sort of get the accounts menu working again. Except UI manager insists on
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32584
diff
changeset
|
3709 "<separator/>" |
32582
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
3710 "<placeholder name='Accounts'/>" |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
3711 "</menu>" |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
3712 "<menu action='ToolsMenu'>" |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
3713 "<menuitem action='BuddyPounces'/>" |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
3714 "<menuitem action='Certificates'/>" |
32618
065b157e2b3c
Fix blist menu and small compile error.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32614
diff
changeset
|
3715 "<menuitem action='CustomSmileys'/>" |
32582
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
3716 "<menuitem action='Plugins'/>" |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
3717 "<menuitem action='Preferences'/>" |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
3718 "<menuitem action='Privacy'/>" |
32618
065b157e2b3c
Fix blist menu and small compile error.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32614
diff
changeset
|
3719 "<menuitem action='SetMood'/>" |
32582
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
3720 "<separator/>" |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
3721 "<menuitem action='FileTransfers'/>" |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
3722 "<menuitem action='RoomList'/>" |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
3723 "<menuitem action='SystemLog'/>" |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
3724 "<separator/>" |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
3725 "<menuitem action='MuteSounds'/>" |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
3726 "<placeholder name='PluginActions'/>" |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
3727 "</menu>" |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
3728 "<menu action='HelpMenu'>" |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
3729 "<menuitem action='OnlineHelp'/>" |
32607
9a0990fd41ed
propagate from branch 'im.pidgin.pidgin' (head 302c560990dbae6b00f9ca0ef36b3c160b190bdb)
Elliott Sales de Andrade <qulogic@pidgin.im>
diff
changeset
|
3730 "<separator/>" |
9a0990fd41ed
propagate from branch 'im.pidgin.pidgin' (head 302c560990dbae6b00f9ca0ef36b3c160b190bdb)
Elliott Sales de Andrade <qulogic@pidgin.im>
diff
changeset
|
3731 "<menuitem action='BuildInformation'/>" |
32582
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
3732 "<menuitem action='DebugWindow'/>" |
32607
9a0990fd41ed
propagate from branch 'im.pidgin.pidgin' (head 302c560990dbae6b00f9ca0ef36b3c160b190bdb)
Elliott Sales de Andrade <qulogic@pidgin.im>
diff
changeset
|
3733 "<menuitem action='DeveloperInformation'/>" |
32683
d8c74de25b5f
Apply some updates to UI Manager version of blist menu: Change the key
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32673
diff
changeset
|
3734 "<menuitem action='PluginInformation'/>" |
32607
9a0990fd41ed
propagate from branch 'im.pidgin.pidgin' (head 302c560990dbae6b00f9ca0ef36b3c160b190bdb)
Elliott Sales de Andrade <qulogic@pidgin.im>
diff
changeset
|
3735 "<menuitem action='TranslatorInformation'/>" |
9a0990fd41ed
propagate from branch 'im.pidgin.pidgin' (head 302c560990dbae6b00f9ca0ef36b3c160b190bdb)
Elliott Sales de Andrade <qulogic@pidgin.im>
diff
changeset
|
3736 "<separator/>" |
32582
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
3737 "<menuitem action='About'/>" |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
3738 "</menu>" |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
3739 "</menubar>" |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
3740 "</ui>"; |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
3741 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3742 /********************************************************* |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3743 * Private Utility functions * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3744 *********************************************************/ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3745 |
15822 | 3746 static char *pidgin_get_tooltip_text(PurpleBlistNode *node, gboolean full) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3747 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3748 GString *str = g_string_new(""); |
15822 | 3749 PurplePlugin *prpl; |
3750 PurplePluginProtocolInfo *prpl_info = NULL; | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3751 char *tmp; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3752 |
15822 | 3753 if (PURPLE_BLIST_NODE_IS_CHAT(node)) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3754 { |
15822 | 3755 PurpleChat *chat; |
24552
f10aba5592c6
The other day while struct hiding, I noticed a for loop that was checking
Richard Laager <rlaager@wiktel.com>
parents:
24467
diff
changeset
|
3756 GList *connections; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3757 GList *cur; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3758 struct proto_chat_entry *pce; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3759 char *name, *value; |
22448
8802eddbfedc
Fix Topic in chat node tooltips, and turn on using the transient chat node
Stu Tomlinson <stu@nosnilmot.com>
parents:
22447
diff
changeset
|
3760 PurpleConversation *conv; |
32350
cd46874707b1
Pidgin: Use the purple_blist_node_ accessor functions.
andrew.victor@mxit.com
parents:
32347
diff
changeset
|
3761 PidginBlistNode *bnode = purple_blist_node_get_ui_data(node); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3762 |
15822 | 3763 chat = (PurpleChat *)node; |
32347
76096c42f558
Use the PurpleChat accessor functions.
andrew.victor@mxit.com
parents:
32346
diff
changeset
|
3764 prpl = purple_find_prpl(purple_account_get_protocol_id(purple_chat_get_account(chat))); |
15822 | 3765 prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(prpl); |
3766 | |
24552
f10aba5592c6
The other day while struct hiding, I noticed a for loop that was checking
Richard Laager <rlaager@wiktel.com>
parents:
24467
diff
changeset
|
3767 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:
24467
diff
changeset
|
3768 if (connections && connections->next) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3769 { |
32347
76096c42f558
Use the PurpleChat accessor functions.
andrew.victor@mxit.com
parents:
32346
diff
changeset
|
3770 tmp = g_markup_escape_text(purple_account_get_username(purple_chat_get_account(chat)), -1); |
21986
0eb3ea7e5784
Show prpl icons in the tooltip for groups.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21985
diff
changeset
|
3771 g_string_append_printf(str, _("<b>Account:</b> %s"), tmp); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3772 g_free(tmp); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3773 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3774 |
22448
8802eddbfedc
Fix Topic in chat node tooltips, and turn on using the transient chat node
Stu Tomlinson <stu@nosnilmot.com>
parents:
22447
diff
changeset
|
3775 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:
22447
diff
changeset
|
3776 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:
22447
diff
changeset
|
3777 } else { |
22461 | 3778 char *chat_name; |
22448
8802eddbfedc
Fix Topic in chat node tooltips, and turn on using the transient chat node
Stu Tomlinson <stu@nosnilmot.com>
parents:
22447
diff
changeset
|
3779 if (prpl_info && prpl_info->get_chat_name) |
32347
76096c42f558
Use the PurpleChat accessor functions.
andrew.victor@mxit.com
parents:
32346
diff
changeset
|
3780 chat_name = prpl_info->get_chat_name(purple_chat_get_components(chat)); |
22448
8802eddbfedc
Fix Topic in chat node tooltips, and turn on using the transient chat node
Stu Tomlinson <stu@nosnilmot.com>
parents:
22447
diff
changeset
|
3781 else |
22461 | 3782 chat_name = g_strdup(purple_chat_get_name(chat)); |
22448
8802eddbfedc
Fix Topic in chat node tooltips, and turn on using the transient chat node
Stu Tomlinson <stu@nosnilmot.com>
parents:
22447
diff
changeset
|
3783 |
8802eddbfedc
Fix Topic in chat node tooltips, and turn on using the transient chat node
Stu Tomlinson <stu@nosnilmot.com>
parents:
22447
diff
changeset
|
3784 conv = purple_find_conversation_with_account(PURPLE_CONV_TYPE_CHAT, chat_name, |
32347
76096c42f558
Use the PurpleChat accessor functions.
andrew.victor@mxit.com
parents:
32346
diff
changeset
|
3785 purple_chat_get_account(chat)); |
22461 | 3786 g_free(chat_name); |
22448
8802eddbfedc
Fix Topic in chat node tooltips, and turn on using the transient chat node
Stu Tomlinson <stu@nosnilmot.com>
parents:
22447
diff
changeset
|
3787 } |
22611
3bf963b9c715
Add number of occupants to the tooltip for chats. Fixes #3346
Stu Tomlinson <stu@nosnilmot.com>
parents:
22527
diff
changeset
|
3788 |
3bf963b9c715
Add number of occupants to the tooltip for chats. Fixes #3346
Stu Tomlinson <stu@nosnilmot.com>
parents:
22527
diff
changeset
|
3789 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:
22527
diff
changeset
|
3790 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:
22527
diff
changeset
|
3791 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:
22527
diff
changeset
|
3792 |
3bf963b9c715
Add number of occupants to the tooltip for chats. Fixes #3346
Stu Tomlinson <stu@nosnilmot.com>
parents:
22527
diff
changeset
|
3793 if (prpl_info && (prpl_info->options & OPT_PROTO_CHAT_TOPIC)) { |
23175
4d8dced30fa2
Don't try to escape a NULL text. This gets rid of a runtime warning.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23164
diff
changeset
|
3794 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:
23164
diff
changeset
|
3795 char *topic = chattopic ? g_markup_escape_text(chattopic, -1) : NULL; |
22611
3bf963b9c715
Add number of occupants to the tooltip for chats. Fixes #3346
Stu Tomlinson <stu@nosnilmot.com>
parents:
22527
diff
changeset
|
3796 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:
22527
diff
changeset
|
3797 g_free(topic); |
3bf963b9c715
Add number of occupants to the tooltip for chats. Fixes #3346
Stu Tomlinson <stu@nosnilmot.com>
parents:
22527
diff
changeset
|
3798 } |
21771
3303c02a46f5
Show the topic of a chat, when available, in the tooltip.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21757
diff
changeset
|
3799 } |
3303c02a46f5
Show the topic of a chat, when available, in the tooltip.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21757
diff
changeset
|
3800 |
24414 | 3801 if (prpl_info && prpl_info->chat_info != NULL) |
32347
76096c42f558
Use the PurpleChat accessor functions.
andrew.victor@mxit.com
parents:
32346
diff
changeset
|
3802 cur = prpl_info->chat_info(purple_account_get_connection(purple_chat_get_account(chat))); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3803 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3804 cur = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3805 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3806 while (cur != NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3807 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3808 pce = cur->data; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3809 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3810 if (!pce->secret && (!pce->required && |
32347
76096c42f558
Use the PurpleChat accessor functions.
andrew.victor@mxit.com
parents:
32346
diff
changeset
|
3811 g_hash_table_lookup(purple_chat_get_components(chat), pce->identifier) == NULL)) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3812 { |
15822 | 3813 tmp = purple_text_strip_mnemonic(pce->label); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3814 name = g_markup_escape_text(tmp, -1); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3815 g_free(tmp); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3816 value = g_markup_escape_text(g_hash_table_lookup( |
32347
76096c42f558
Use the PurpleChat accessor functions.
andrew.victor@mxit.com
parents:
32346
diff
changeset
|
3817 purple_chat_get_components(chat), pce->identifier), -1); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3818 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
|
3819 name ? name : "", |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3820 value ? value : ""); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3821 g_free(name); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3822 g_free(value); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3823 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3824 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3825 g_free(pce); |
27800
deecc1d663c4
Don't use pointers (even opaquely) once they're freed. Closes #9822.
Paul Aurich <paul@darkrain42.org>
parents:
27665
diff
changeset
|
3826 cur = g_list_delete_link(cur, cur); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3827 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3828 } |
15822 | 3829 else if (PURPLE_BLIST_NODE_IS_CONTACT(node) || PURPLE_BLIST_NODE_IS_BUDDY(node)) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3830 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3831 /* 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
|
3832 * 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
|
3833 */ |
15822 | 3834 PurpleContact *c; |
3835 PurpleBuddy *b; | |
3836 PurplePresence *presence; | |
3837 PurpleNotifyUserInfo *user_info; | |
24552
f10aba5592c6
The other day while struct hiding, I noticed a for loop that was checking
Richard Laager <rlaager@wiktel.com>
parents:
24467
diff
changeset
|
3838 GList *connections; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3839 char *tmp; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3840 time_t idle_secs, signon; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3841 |
15822 | 3842 if (PURPLE_BLIST_NODE_IS_CONTACT(node)) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3843 { |
15822 | 3844 c = (PurpleContact *)node; |
3845 b = purple_contact_get_priority_buddy(c); | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3846 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3847 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3848 { |
15822 | 3849 b = (PurpleBuddy *)node; |
3850 c = purple_buddy_get_contact(b); | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3851 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3852 |
32342
b6276b10cb10
Use the PurpleBuddy accessor functions.
andrew.victor@mxit.com
parents:
32305
diff
changeset
|
3853 prpl = purple_find_prpl(purple_account_get_protocol_id(purple_buddy_get_account(b))); |
15822 | 3854 prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(prpl); |
3855 | |
3856 presence = purple_buddy_get_presence(b); | |
3857 user_info = purple_notify_user_info_new(); | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3858 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3859 /* Account */ |
24552
f10aba5592c6
The other day while struct hiding, I noticed a for loop that was checking
Richard Laager <rlaager@wiktel.com>
parents:
24467
diff
changeset
|
3860 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:
24467
diff
changeset
|
3861 if (full && connections && connections->next) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3862 { |
31904
3322201b446f
I went through all our calls to purple_notify_user_info_add_pair() and
Mark Doliner <mark@kingant.net>
parents:
31863
diff
changeset
|
3863 purple_notify_user_info_add_pair_plaintext(user_info, _("Account"), |
3322201b446f
I went through all our calls to purple_notify_user_info_add_pair() and
Mark Doliner <mark@kingant.net>
parents:
31863
diff
changeset
|
3864 purple_account_get_username(purple_buddy_get_account(b))); |
15373
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 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3867 /* Alias */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3868 /* 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
|
3869 * this alias, so there's no point in showing it in the tooltip. */ |
32342
b6276b10cb10
Use the PurpleBuddy accessor functions.
andrew.victor@mxit.com
parents:
32305
diff
changeset
|
3870 if (full && c && purple_buddy_get_local_buddy_alias(b) != NULL && purple_buddy_get_local_buddy_alias(b)[0] != '\0' && |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3871 (c->alias != NULL && c->alias[0] != '\0') && |
32342
b6276b10cb10
Use the PurpleBuddy accessor functions.
andrew.victor@mxit.com
parents:
32305
diff
changeset
|
3872 strcmp(c->alias, purple_buddy_get_local_buddy_alias(b)) != 0) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3873 { |
31904
3322201b446f
I went through all our calls to purple_notify_user_info_add_pair() and
Mark Doliner <mark@kingant.net>
parents:
31863
diff
changeset
|
3874 purple_notify_user_info_add_pair_plaintext(user_info, |
32342
b6276b10cb10
Use the PurpleBuddy accessor functions.
andrew.victor@mxit.com
parents:
32305
diff
changeset
|
3875 _("Buddy Alias"), purple_buddy_get_local_buddy_alias(b)); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3876 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3877 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3878 /* Nickname/Server Alias */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3879 /* 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
|
3880 * 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
|
3881 * 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
|
3882 * to look at the tooltip. */ |
32342
b6276b10cb10
Use the PurpleBuddy accessor functions.
andrew.victor@mxit.com
parents:
32305
diff
changeset
|
3883 if (full && purple_buddy_get_server_alias(b)) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3884 { |
31904
3322201b446f
I went through all our calls to purple_notify_user_info_add_pair() and
Mark Doliner <mark@kingant.net>
parents:
31863
diff
changeset
|
3885 purple_notify_user_info_add_pair_plaintext(user_info, |
32342
b6276b10cb10
Use the PurpleBuddy accessor functions.
andrew.victor@mxit.com
parents:
32305
diff
changeset
|
3886 _("Nickname"), purple_buddy_get_server_alias(b)); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3887 } |
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 /* Logged In */ |
15822 | 3890 signon = purple_presence_get_login_time(presence); |
3891 if (full && PURPLE_BUDDY_IS_ONLINE(b) && signon > 0) | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3892 { |
18241
83ea1733979b
This is a less dumb way to make sure we don't wrap
Mark Doliner <mark@kingant.net>
parents:
18217
diff
changeset
|
3893 if (signon > time(NULL)) { |
17596
18b62b0fc253
Get outta my house. This adds a failsafe for the "Logged In"
Mark Doliner <mark@kingant.net>
parents:
17551
diff
changeset
|
3894 /* |
18241
83ea1733979b
This is a less dumb way to make sure we don't wrap
Mark Doliner <mark@kingant.net>
parents:
18217
diff
changeset
|
3895 * 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
|
3896 * 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
|
3897 * "4 days", etc. |
17596
18b62b0fc253
Get outta my house. This adds a failsafe for the "Logged In"
Mark Doliner <mark@kingant.net>
parents:
17551
diff
changeset
|
3898 */ |
18b62b0fc253
Get outta my house. This adds a failsafe for the "Logged In"
Mark Doliner <mark@kingant.net>
parents:
17551
diff
changeset
|
3899 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:
17551
diff
changeset
|
3900 } else |
18b62b0fc253
Get outta my house. This adds a failsafe for the "Logged In"
Mark Doliner <mark@kingant.net>
parents:
17551
diff
changeset
|
3901 tmp = purple_str_seconds_to_string(time(NULL) - signon); |
31904
3322201b446f
I went through all our calls to purple_notify_user_info_add_pair() and
Mark Doliner <mark@kingant.net>
parents:
31863
diff
changeset
|
3902 purple_notify_user_info_add_pair_plaintext(user_info, _("Logged In"), tmp); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3903 g_free(tmp); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3904 } |
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 /* Idle */ |
15822 | 3907 if (purple_presence_is_idle(presence)) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3908 { |
15822 | 3909 idle_secs = purple_presence_get_idle_time(presence); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3910 if (idle_secs > 0) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3911 { |
15822 | 3912 tmp = purple_str_seconds_to_string(time(NULL) - idle_secs); |
31904
3322201b446f
I went through all our calls to purple_notify_user_info_add_pair() and
Mark Doliner <mark@kingant.net>
parents:
31863
diff
changeset
|
3913 purple_notify_user_info_add_pair_plaintext(user_info, _("Idle"), tmp); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3914 g_free(tmp); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3915 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3916 } |
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 /* 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
|
3919 if (full && c && !PURPLE_BUDDY_IS_ONLINE(b)) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3920 { |
32350
cd46874707b1
Pidgin: Use the purple_blist_node_ accessor functions.
andrew.victor@mxit.com
parents:
32347
diff
changeset
|
3921 struct _pidgin_blist_node *gtknode = purple_blist_node_get_ui_data(PURPLE_BLIST_NODE(c)); |
15822 | 3922 PurpleBlistNode *bnode; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3923 int lastseen = 0; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3924 |
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
|
3925 if (gtknode && (!gtknode->contact_expanded || PURPLE_BLIST_NODE_IS_CONTACT(node))) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3926 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3927 /* 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
|
3928 * 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
|
3929 * (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
|
3930 * the contact. */ |
15822 | 3931 for (bnode = ((PurpleBlistNode *)c)->child ; bnode != NULL ; bnode = bnode->next) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3932 { |
15822 | 3933 int value = purple_blist_node_get_int(bnode, "last_seen"); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3934 if (value > lastseen) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3935 lastseen = value; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3936 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3937 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3938 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3939 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3940 /* 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
|
3941 * so we show the last_seen time for the buddy. */ |
15822 | 3942 lastseen = purple_blist_node_get_int(&b->node, "last_seen"); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3943 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3944 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3945 if (lastseen > 0) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3946 { |
15822 | 3947 tmp = purple_str_seconds_to_string(time(NULL) - lastseen); |
31904
3322201b446f
I went through all our calls to purple_notify_user_info_add_pair() and
Mark Doliner <mark@kingant.net>
parents:
31863
diff
changeset
|
3948 purple_notify_user_info_add_pair_plaintext(user_info, _("Last Seen"), tmp); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3949 g_free(tmp); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3950 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3951 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3952 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3953 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3954 /* Offline? */ |
29455
93cb9f54df45
Now that the "Set Mood" UI is in Pidgin, it can do whatever it likes to
Richard Laager <rlaager@wiktel.com>
parents:
29443
diff
changeset
|
3955 /* FIXME: Why is this status special-cased by the core? --rlaager |
93cb9f54df45
Now that the "Set Mood" UI is in Pidgin, it can do whatever it likes to
Richard Laager <rlaager@wiktel.com>
parents:
29443
diff
changeset
|
3956 * FIXME: Alternatively, why not have the core do all of them? --rlaager */ |
15822 | 3957 if (!PURPLE_BUDDY_IS_ONLINE(b)) { |
31904
3322201b446f
I went through all our calls to purple_notify_user_info_add_pair() and
Mark Doliner <mark@kingant.net>
parents:
31863
diff
changeset
|
3958 purple_notify_user_info_add_pair_plaintext(user_info, _("Status"), _("Offline")); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3959 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3960 |
32342
b6276b10cb10
Use the PurpleBuddy accessor functions.
andrew.victor@mxit.com
parents:
32305
diff
changeset
|
3961 if (purple_account_is_connected(purple_buddy_get_account(b)) && |
19636
1481ea6bb805
Do not bother the prpl about a tooltip for a disconnected account.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19611
diff
changeset
|
3962 prpl_info && prpl_info->tooltip_text) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3963 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3964 /* Additional text from the PRPL */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3965 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
|
3966 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3967 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3968 /* These are Easter Eggs. Patches to remove them will be rejected. */ |
32342
b6276b10cb10
Use the PurpleBuddy accessor functions.
andrew.victor@mxit.com
parents:
32305
diff
changeset
|
3969 if (!g_ascii_strcasecmp(purple_buddy_get_name(b), "robflynn")) |
31904
3322201b446f
I went through all our calls to purple_notify_user_info_add_pair() and
Mark Doliner <mark@kingant.net>
parents:
31863
diff
changeset
|
3970 purple_notify_user_info_add_pair_plaintext(user_info, _("Description"), _("Spooky")); |
32342
b6276b10cb10
Use the PurpleBuddy accessor functions.
andrew.victor@mxit.com
parents:
32305
diff
changeset
|
3971 if (!g_ascii_strcasecmp(purple_buddy_get_name(b), "seanegn")) |
31904
3322201b446f
I went through all our calls to purple_notify_user_info_add_pair() and
Mark Doliner <mark@kingant.net>
parents:
31863
diff
changeset
|
3972 purple_notify_user_info_add_pair_plaintext(user_info, _("Status"), _("Awesome")); |
32342
b6276b10cb10
Use the PurpleBuddy accessor functions.
andrew.victor@mxit.com
parents:
32305
diff
changeset
|
3973 if (!g_ascii_strcasecmp(purple_buddy_get_name(b), "chipx86")) |
31904
3322201b446f
I went through all our calls to purple_notify_user_info_add_pair() and
Mark Doliner <mark@kingant.net>
parents:
31863
diff
changeset
|
3974 purple_notify_user_info_add_pair_plaintext(user_info, _("Status"), _("Rockin'")); |
15822 | 3975 |
3976 tmp = purple_notify_user_info_get_text_with_newline(user_info, "\n"); | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3977 g_string_append(str, tmp); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3978 g_free(tmp); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3979 |
15822 | 3980 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
|
3981 } else if (PURPLE_BLIST_NODE_IS_GROUP(node)) { |
22524
2f7b42cc612c
Change up the Add Budy dialog a little bit, this hopefully makes it a bit
Etan Reisner <pidgin@unreliablesource.net>
parents:
22323
diff
changeset
|
3982 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
|
3983 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
|
3984 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
|
3985 |
2b6e6dd24a37
Add tooltips to groups in the buddy list. The tooltips show the current online
Etan Reisner <pidgin@unreliablesource.net>
parents:
21912
diff
changeset
|
3986 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
|
3987 |
22524
2f7b42cc612c
Change up the Add Budy dialog a little bit, this hopefully makes it a bit
Etan Reisner <pidgin@unreliablesource.net>
parents:
22323
diff
changeset
|
3988 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:
22323
diff
changeset
|
3989 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:
22323
diff
changeset
|
3990 /* Online buddies in group */ |
31904
3322201b446f
I went through all our calls to purple_notify_user_info_add_pair() and
Mark Doliner <mark@kingant.net>
parents:
31863
diff
changeset
|
3991 char tmp2[12]; |
3322201b446f
I went through all our calls to purple_notify_user_info_add_pair() and
Mark Doliner <mark@kingant.net>
parents:
31863
diff
changeset
|
3992 sprintf(tmp2, "%d", count); |
3322201b446f
I went through all our calls to purple_notify_user_info_add_pair() and
Mark Doliner <mark@kingant.net>
parents:
31863
diff
changeset
|
3993 purple_notify_user_info_add_pair_plaintext(user_info, |
3322201b446f
I went through all our calls to purple_notify_user_info_add_pair() and
Mark Doliner <mark@kingant.net>
parents:
31863
diff
changeset
|
3994 _("Online Buddies"), tmp2); |
22524
2f7b42cc612c
Change up the Add Budy dialog a little bit, this hopefully makes it a bit
Etan Reisner <pidgin@unreliablesource.net>
parents:
22323
diff
changeset
|
3995 } |
2f7b42cc612c
Change up the Add Budy dialog a little bit, this hopefully makes it a bit
Etan Reisner <pidgin@unreliablesource.net>
parents:
22323
diff
changeset
|
3996 |
2f7b42cc612c
Change up the Add Budy dialog a little bit, this hopefully makes it a bit
Etan Reisner <pidgin@unreliablesource.net>
parents:
22323
diff
changeset
|
3997 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:
22323
diff
changeset
|
3998 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:
22323
diff
changeset
|
3999 /* Total buddies (from online accounts) in group */ |
31904
3322201b446f
I went through all our calls to purple_notify_user_info_add_pair() and
Mark Doliner <mark@kingant.net>
parents:
31863
diff
changeset
|
4000 char tmp2[12]; |
3322201b446f
I went through all our calls to purple_notify_user_info_add_pair() and
Mark Doliner <mark@kingant.net>
parents:
31863
diff
changeset
|
4001 sprintf(tmp2, "%d", count); |
31907
99ca503ea087
Rename purple_notify_user_info_add_pair to
Mark Doliner <mark@kingant.net>
parents:
31904
diff
changeset
|
4002 purple_notify_user_info_add_pair_html(user_info, |
31904
3322201b446f
I went through all our calls to purple_notify_user_info_add_pair() and
Mark Doliner <mark@kingant.net>
parents:
31863
diff
changeset
|
4003 _("Total Buddies"), tmp2); |
22524
2f7b42cc612c
Change up the Add Budy dialog a little bit, this hopefully makes it a bit
Etan Reisner <pidgin@unreliablesource.net>
parents:
22323
diff
changeset
|
4004 } |
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
|
4005 |
2b6e6dd24a37
Add tooltips to groups in the buddy list. The tooltips show the current online
Etan Reisner <pidgin@unreliablesource.net>
parents:
21912
diff
changeset
|
4006 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
|
4007 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
|
4008 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
|
4009 |
2b6e6dd24a37
Add tooltips to groups in the buddy list. The tooltips show the current online
Etan Reisner <pidgin@unreliablesource.net>
parents:
21912
diff
changeset
|
4010 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
|
4011 } |
2b6e6dd24a37
Add tooltips to groups in the buddy list. The tooltips show the current online
Etan Reisner <pidgin@unreliablesource.net>
parents:
21912
diff
changeset
|
4012 |
2b6e6dd24a37
Add tooltips to groups in the buddy list. The tooltips show the current online
Etan Reisner <pidgin@unreliablesource.net>
parents:
21912
diff
changeset
|
4013 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
|
4014 node, str, full); |
15373
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 return g_string_free(str, FALSE); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4017 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4018 |
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
|
4019 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
|
4020 |
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
|
4021 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
|
4022 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
|
4023 } |
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
|
4024 |
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
|
4025 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
|
4026 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
|
4027 |
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
|
4028 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
|
4029 /* 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
|
4030 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
|
4031 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
|
4032 } else { |
31682
e2c6e4fc3c84
Start looking at the GError parameter every time we call these functions:
Mark Doliner <mark@kingant.net>
parents:
31443
diff
changeset
|
4033 pb = pidgin_pixbuf_new_from_file(path); |
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
|
4034 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
|
4035 /* 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
|
4036 /* 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
|
4037 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
|
4038 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
|
4039 } 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
|
4040 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
|
4041 } |
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
|
4042 |
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
|
4043 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
|
4044 } |
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
|
4045 |
15462 | 4046 GdkPixbuf * |
15822 | 4047 pidgin_blist_get_emblem(PurpleBlistNode *node) |
4048 { | |
4049 PurpleBuddy *buddy = NULL; | |
32350
cd46874707b1
Pidgin: Use the purple_blist_node_ accessor functions.
andrew.victor@mxit.com
parents:
32347
diff
changeset
|
4050 struct _pidgin_blist_node *gtknode = purple_blist_node_get_ui_data(node); |
15822 | 4051 PurplePlugin *prpl; |
4052 PurplePluginProtocolInfo *prpl_info; | |
15462 | 4053 const char *name = NULL; |
4054 char *filename, *path; | |
29460 | 4055 PurplePresence *p = NULL; |
24510
e344426d7c28
Add the Games and Office media to MSN as attributes tacked on to the tune
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24467
diff
changeset
|
4056 PurpleStatus *tune; |
15822 | 4057 |
4058 if(PURPLE_BLIST_NODE_IS_CONTACT(node)) { | |
15462 | 4059 if(!gtknode->contact_expanded) { |
15822 | 4060 buddy = purple_contact_get_priority_buddy((PurpleContact*)node); |
15462 | 4061 } |
15822 | 4062 } else if(PURPLE_BLIST_NODE_IS_BUDDY(node)) { |
4063 buddy = (PurpleBuddy*)node; | |
29460 | 4064 p = purple_buddy_get_presence(buddy); |
4065 if (purple_presence_is_status_primitive_active(p, PURPLE_STATUS_MOBILE)) { | |
29455
93cb9f54df45
Now that the "Set Mood" UI is in Pidgin, it can do whatever it likes to
Richard Laager <rlaager@wiktel.com>
parents:
29443
diff
changeset
|
4066 /* This emblem comes from the small emoticon set now, |
93cb9f54df45
Now that the "Set Mood" UI is in Pidgin, it can do whatever it likes to
Richard Laager <rlaager@wiktel.com>
parents:
29443
diff
changeset
|
4067 * to reduce duplication. */ |
93cb9f54df45
Now that the "Set Mood" UI is in Pidgin, it can do whatever it likes to
Richard Laager <rlaager@wiktel.com>
parents:
29443
diff
changeset
|
4068 path = g_build_filename(DATADIR, "pixmaps", "pidgin", "emotes", |
93cb9f54df45
Now that the "Set Mood" UI is in Pidgin, it can do whatever it likes to
Richard Laager <rlaager@wiktel.com>
parents:
29443
diff
changeset
|
4069 "small", "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
|
4070 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
|
4071 } |
9b3c2ba1a5c3
Mobile icon trumps prpl icon in expanded buddies. Fixes #515
Sean Egan <seanegan@gmail.com>
parents:
18309
diff
changeset
|
4072 |
32350
cd46874707b1
Pidgin: Use the purple_blist_node_ accessor functions.
andrew.victor@mxit.com
parents:
32347
diff
changeset
|
4073 if (((struct _pidgin_blist_node*)purple_blist_node_get_ui_data(node->parent))->contact_expanded) { |
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
|
4074 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
|
4075 return NULL; |
32342
b6276b10cb10
Use the PurpleBuddy accessor functions.
andrew.victor@mxit.com
parents:
32305
diff
changeset
|
4076 return pidgin_create_prpl_icon(purple_buddy_get_account((PurpleBuddy*)node), 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
|
4077 } |
15462 | 4078 } else { |
4079 return NULL; | |
4080 } | |
15631
a830f9756f23
Some more pidgininfication
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15614
diff
changeset
|
4081 |
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
|
4082 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
|
4083 |
32342
b6276b10cb10
Use the PurpleBuddy accessor functions.
andrew.victor@mxit.com
parents:
32305
diff
changeset
|
4084 if (!purple_privacy_check(purple_buddy_get_account(buddy), purple_buddy_get_name(buddy))) { |
15499 | 4085 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
|
4086 return _pidgin_blist_get_cached_emblem(path); |
15523
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:
15513
diff
changeset
|
4087 } |
15631
a830f9756f23
Some more pidgininfication
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15614
diff
changeset
|
4088 |
29435
11cb7f2bb6e8
Add a PURPLE_STATUS_MOOD primitive and change ICQ to use it.
Richard Laager <rlaager@wiktel.com>
parents:
29434
diff
changeset
|
4089 /* If we came through the contact code flow above, we didn't need |
11cb7f2bb6e8
Add a PURPLE_STATUS_MOOD primitive and change ICQ to use it.
Richard Laager <rlaager@wiktel.com>
parents:
29434
diff
changeset
|
4090 * to get the presence until now. */ |
29460 | 4091 if (p == NULL) |
4092 p = purple_buddy_get_presence(buddy); | |
4093 | |
4094 if (purple_presence_is_status_primitive_active(p, PURPLE_STATUS_MOBILE)) { | |
29455
93cb9f54df45
Now that the "Set Mood" UI is in Pidgin, it can do whatever it likes to
Richard Laager <rlaager@wiktel.com>
parents:
29443
diff
changeset
|
4095 /* This emblem comes from the small emoticon set now, to reduce duplication. */ |
93cb9f54df45
Now that the "Set Mood" UI is in Pidgin, it can do whatever it likes to
Richard Laager <rlaager@wiktel.com>
parents:
29443
diff
changeset
|
4096 path = g_build_filename(DATADIR, "pixmaps", "pidgin", "emotes", "small", "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
|
4097 return _pidgin_blist_get_cached_emblem(path); |
15499 | 4098 } |
15462 | 4099 |
24510
e344426d7c28
Add the Games and Office media to MSN as attributes tacked on to the tune
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24467
diff
changeset
|
4100 tune = purple_presence_get_status(p, "tune"); |
e344426d7c28
Add the Games and Office media to MSN as attributes tacked on to the tune
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24467
diff
changeset
|
4101 if (tune && purple_status_is_active(tune)) { |
e344426d7c28
Add the Games and Office media to MSN as attributes tacked on to the tune
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24467
diff
changeset
|
4102 /* Only in MSN. |
e344426d7c28
Add the Games and Office media to MSN as attributes tacked on to the tune
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24467
diff
changeset
|
4103 * TODO: Replace "Tune" with generalized "Media" in 3.0. */ |
e344426d7c28
Add the Games and Office media to MSN as attributes tacked on to the tune
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24467
diff
changeset
|
4104 if (purple_status_get_attr_string(tune, "game") != NULL) { |
e344426d7c28
Add the Games and Office media to MSN as attributes tacked on to the tune
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24467
diff
changeset
|
4105 path = g_build_filename(DATADIR, "pixmaps", "pidgin", "emblems", "16", "game.png", NULL); |
e344426d7c28
Add the Games and Office media to MSN as attributes tacked on to the tune
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24467
diff
changeset
|
4106 return _pidgin_blist_get_cached_emblem(path); |
e344426d7c28
Add the Games and Office media to MSN as attributes tacked on to the tune
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24467
diff
changeset
|
4107 } |
e344426d7c28
Add the Games and Office media to MSN as attributes tacked on to the tune
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24467
diff
changeset
|
4108 /* Only in MSN. |
e344426d7c28
Add the Games and Office media to MSN as attributes tacked on to the tune
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24467
diff
changeset
|
4109 * TODO: Replace "Tune" with generalized "Media" in 3.0. */ |
e344426d7c28
Add the Games and Office media to MSN as attributes tacked on to the tune
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24467
diff
changeset
|
4110 if (purple_status_get_attr_string(tune, "office") != NULL) { |
e344426d7c28
Add the Games and Office media to MSN as attributes tacked on to the tune
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24467
diff
changeset
|
4111 path = g_build_filename(DATADIR, "pixmaps", "pidgin", "emblems", "16", "office.png", NULL); |
e344426d7c28
Add the Games and Office media to MSN as attributes tacked on to the tune
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24467
diff
changeset
|
4112 return _pidgin_blist_get_cached_emblem(path); |
e344426d7c28
Add the Games and Office media to MSN as attributes tacked on to the tune
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24467
diff
changeset
|
4113 } |
e344426d7c28
Add the Games and Office media to MSN as attributes tacked on to the tune
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24467
diff
changeset
|
4114 /* Regular old "tune" is the only one in all protocols. */ |
29455
93cb9f54df45
Now that the "Set Mood" UI is in Pidgin, it can do whatever it likes to
Richard Laager <rlaager@wiktel.com>
parents:
29443
diff
changeset
|
4115 /* This emblem comes from the small emoticon set now, to reduce duplication. */ |
93cb9f54df45
Now that the "Set Mood" UI is in Pidgin, it can do whatever it likes to
Richard Laager <rlaager@wiktel.com>
parents:
29443
diff
changeset
|
4116 path = g_build_filename(DATADIR, "pixmaps", "pidgin", "emotes", "small", "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
|
4117 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
|
4118 } |
d97c43dbc1ca
Display a music emblem in the buddylist when appropriate.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
20050
diff
changeset
|
4119 |
32342
b6276b10cb10
Use the PurpleBuddy accessor functions.
andrew.victor@mxit.com
parents:
32305
diff
changeset
|
4120 prpl = purple_find_prpl(purple_account_get_protocol_id(purple_buddy_get_account(buddy))); |
15462 | 4121 if (!prpl) |
4122 return NULL; | |
4123 | |
15822 | 4124 prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(prpl); |
15462 | 4125 if (prpl_info && prpl_info->list_emblem) |
4126 name = prpl_info->list_emblem(buddy); | |
4127 | |
29434
1034b0d09398
Look at the mood status attribute on a buddy when picking the emblem.
Richard Laager <rlaager@wiktel.com>
parents:
24414
diff
changeset
|
4128 if (name == NULL) { |
29435
11cb7f2bb6e8
Add a PURPLE_STATUS_MOOD primitive and change ICQ to use it.
Richard Laager <rlaager@wiktel.com>
parents:
29434
diff
changeset
|
4129 PurpleStatus *status; |
11cb7f2bb6e8
Add a PURPLE_STATUS_MOOD primitive and change ICQ to use it.
Richard Laager <rlaager@wiktel.com>
parents:
29434
diff
changeset
|
4130 |
29460 | 4131 if (!purple_presence_is_status_primitive_active(p, PURPLE_STATUS_MOOD)) |
29435
11cb7f2bb6e8
Add a PURPLE_STATUS_MOOD primitive and change ICQ to use it.
Richard Laager <rlaager@wiktel.com>
parents:
29434
diff
changeset
|
4132 return NULL; |
11cb7f2bb6e8
Add a PURPLE_STATUS_MOOD primitive and change ICQ to use it.
Richard Laager <rlaager@wiktel.com>
parents:
29434
diff
changeset
|
4133 |
29460 | 4134 status = purple_presence_get_status(p, "mood"); |
29435
11cb7f2bb6e8
Add a PURPLE_STATUS_MOOD primitive and change ICQ to use it.
Richard Laager <rlaager@wiktel.com>
parents:
29434
diff
changeset
|
4135 name = purple_status_get_attr_string(status, PURPLE_MOOD_NAME); |
31086
a8cc50c2279f
Remove trailing whitespace
Richard Laager <rlaager@wiktel.com>
parents:
30459
diff
changeset
|
4136 |
29435
11cb7f2bb6e8
Add a PURPLE_STATUS_MOOD primitive and change ICQ to use it.
Richard Laager <rlaager@wiktel.com>
parents:
29434
diff
changeset
|
4137 if (!(name && *name)) |
29434
1034b0d09398
Look at the mood status attribute on a buddy when picking the emblem.
Richard Laager <rlaager@wiktel.com>
parents:
24414
diff
changeset
|
4138 return NULL; |
29455
93cb9f54df45
Now that the "Set Mood" UI is in Pidgin, it can do whatever it likes to
Richard Laager <rlaager@wiktel.com>
parents:
29443
diff
changeset
|
4139 |
93cb9f54df45
Now that the "Set Mood" UI is in Pidgin, it can do whatever it likes to
Richard Laager <rlaager@wiktel.com>
parents:
29443
diff
changeset
|
4140 path = get_mood_icon_path(name); |
93cb9f54df45
Now that the "Set Mood" UI is in Pidgin, it can do whatever it likes to
Richard Laager <rlaager@wiktel.com>
parents:
29443
diff
changeset
|
4141 } else { |
93cb9f54df45
Now that the "Set Mood" UI is in Pidgin, it can do whatever it likes to
Richard Laager <rlaager@wiktel.com>
parents:
29443
diff
changeset
|
4142 filename = g_strdup_printf("%s.png", name); |
93cb9f54df45
Now that the "Set Mood" UI is in Pidgin, it can do whatever it likes to
Richard Laager <rlaager@wiktel.com>
parents:
29443
diff
changeset
|
4143 path = g_build_filename(DATADIR, "pixmaps", "pidgin", "emblems", "16", filename, NULL); |
93cb9f54df45
Now that the "Set Mood" UI is in Pidgin, it can do whatever it likes to
Richard Laager <rlaager@wiktel.com>
parents:
29443
diff
changeset
|
4144 g_free(filename); |
93cb9f54df45
Now that the "Set Mood" UI is in Pidgin, it can do whatever it likes to
Richard Laager <rlaager@wiktel.com>
parents:
29443
diff
changeset
|
4145 } |
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
|
4146 |
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
|
4147 /* _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
|
4148 return _pidgin_blist_get_cached_emblem(path); |
15462 | 4149 } |
4150 | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4151 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4152 GdkPixbuf * |
15822 | 4153 pidgin_blist_get_status_icon(PurpleBlistNode *node, PidginStatusIconSize size) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4154 { |
15396
a8ee645e7fb4
A lot of status icon changes:
Sean Egan <seanegan@gmail.com>
parents:
15373
diff
changeset
|
4155 GdkPixbuf *ret; |
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
|
4156 const char *icon = NULL; |
32350
cd46874707b1
Pidgin: Use the purple_blist_node_ accessor functions.
andrew.victor@mxit.com
parents:
32347
diff
changeset
|
4157 struct _pidgin_blist_node *gtknode = purple_blist_node_get_ui_data(node); |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
4158 struct _pidgin_blist_node *gtkbuddynode = NULL; |
15822 | 4159 PurpleBuddy *buddy = NULL; |
4160 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
|
4161 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
|
4162 PIDGIN_ICON_SIZE_TANGO_MICROSCOPIC); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4163 |
15822 | 4164 if(PURPLE_BLIST_NODE_IS_CONTACT(node)) { |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4165 if(!gtknode->contact_expanded) { |
15822 | 4166 buddy = purple_contact_get_priority_buddy((PurpleContact*)node); |
17031
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:
17027
diff
changeset
|
4167 if (buddy != NULL) |
32350
cd46874707b1
Pidgin: Use the purple_blist_node_ accessor functions.
andrew.victor@mxit.com
parents:
32347
diff
changeset
|
4168 gtkbuddynode = purple_blist_node_get_ui_data(PURPLE_BLIST_NODE(buddy)); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4169 } |
15822 | 4170 } else if(PURPLE_BLIST_NODE_IS_BUDDY(node)) { |
4171 buddy = (PurpleBuddy*)node; | |
32350
cd46874707b1
Pidgin: Use the purple_blist_node_ accessor functions.
andrew.victor@mxit.com
parents:
32347
diff
changeset
|
4172 gtkbuddynode = purple_blist_node_get_ui_data(node); |
15822 | 4173 } else if(PURPLE_BLIST_NODE_IS_CHAT(node)) { |
4174 chat = (PurpleChat*)node; | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4175 } else { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4176 return NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4177 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4178 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4179 if(buddy || chat) { |
15822 | 4180 PurpleAccount *account; |
4181 PurplePlugin *prpl; | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4182 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4183 if(buddy) |
32342
b6276b10cb10
Use the PurpleBuddy accessor functions.
andrew.victor@mxit.com
parents:
32305
diff
changeset
|
4184 account = purple_buddy_get_account(buddy); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4185 else |
32347
76096c42f558
Use the PurpleChat accessor functions.
andrew.victor@mxit.com
parents:
32346
diff
changeset
|
4186 account = purple_chat_get_account(chat); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4187 |
15822 | 4188 prpl = purple_find_prpl(purple_account_get_protocol_id(account)); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4189 if(!prpl) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4190 return NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4191 } |
15631
a830f9756f23
Some more pidgininfication
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15614
diff
changeset
|
4192 |
15396
a8ee645e7fb4
A lot of status icon changes:
Sean Egan <seanegan@gmail.com>
parents:
15373
diff
changeset
|
4193 if(buddy) { |
19939
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
|
4194 PurpleConversation *conv = find_conversation_with_buddy(buddy); |
15822 | 4195 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
|
4196 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
|
4197 |
15496
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:
15492
diff
changeset
|
4198 if(conv != NULL) { |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
4199 PidginConversation *gtkconv = PIDGIN_CONVERSATION(conv); |
19940
1fe1ac03e1fe
Show the 'new message' icon correctly.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19939
diff
changeset
|
4200 if (gtkconv == NULL && size == PIDGIN_STATUS_ICON_SMALL) { |
32350
cd46874707b1
Pidgin: Use the purple_blist_node_ accessor functions.
andrew.victor@mxit.com
parents:
32347
diff
changeset
|
4201 PidginBlistNode *ui = purple_blist_node_get_ui_data(&(buddy->node)); |
19940
1fe1ac03e1fe
Show the 'new message' icon correctly.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19939
diff
changeset
|
4202 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:
19939
diff
changeset
|
4203 return gtk_widget_render_icon (GTK_WIDGET(gtkblist->treeview), |
1fe1ac03e1fe
Show the 'new message' icon correctly.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19939
diff
changeset
|
4204 PIDGIN_STOCK_STATUS_MESSAGE, icon_size, "GtkTreeView"); |
15496
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:
15492
diff
changeset
|
4205 } |
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:
15492
diff
changeset
|
4206 } |
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
|
4207 |
15822 | 4208 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
|
4209 trans = purple_presence_is_idle(p); |
15822 | 4210 |
24039
5045f2ce9cff
disapproval of revision 'f5ca7968e3f6be8f81d068232d389e0b1dab784b'
Kevin Stange <kevin@simguy.net>
parents:
24037
diff
changeset
|
4211 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
|
4212 icon = PIDGIN_STOCK_STATUS_LOGIN; |
15447 | 4213 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
|
4214 icon = PIDGIN_STOCK_STATUS_LOGOUT; |
24039
5045f2ce9cff
disapproval of revision 'f5ca7968e3f6be8f81d068232d389e0b1dab784b'
Kevin Stange <kevin@simguy.net>
parents:
24037
diff
changeset
|
4215 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
|
4216 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
|
4217 icon = PIDGIN_STOCK_STATUS_BUSY_I; |
15492 | 4218 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
|
4219 icon = PIDGIN_STOCK_STATUS_BUSY; |
15822 | 4220 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
|
4221 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
|
4222 icon = PIDGIN_STOCK_STATUS_AWAY_I; |
15492 | 4223 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
|
4224 icon = PIDGIN_STOCK_STATUS_AWAY; |
15822 | 4225 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
|
4226 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
|
4227 icon = PIDGIN_STOCK_STATUS_XA_I; |
15492 | 4228 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
|
4229 icon = PIDGIN_STOCK_STATUS_XA; |
15822 | 4230 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
|
4231 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
|
4232 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
|
4233 icon = PIDGIN_STOCK_STATUS_AVAILABLE_I; |
17405
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:
17404
diff
changeset
|
4234 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
|
4235 icon = PIDGIN_STOCK_STATUS_INVISIBLE; |
15447 | 4236 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
|
4237 icon = PIDGIN_STOCK_STATUS_AVAILABLE; |
15447 | 4238 } 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
|
4239 icon = PIDGIN_STOCK_STATUS_CHAT; |
15447 | 4240 } 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
|
4241 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
|
4242 } |
712a448722b6
If a conversation doesn't have UI-data, consider it a hidden conversation.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19538
diff
changeset
|
4243 |
712a448722b6
If a conversation doesn't have UI-data, consider it a hidden conversation.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19538
diff
changeset
|
4244 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
|
4245 icon_size, "GtkTreeView"); |
15396
a8ee645e7fb4
A lot of status icon changes:
Sean Egan <seanegan@gmail.com>
parents:
15373
diff
changeset
|
4246 return ret; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4247 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4248 |
26572
f099e7f2739c
Several changes:
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26554
diff
changeset
|
4249 static const char * |
f099e7f2739c
Several changes:
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26554
diff
changeset
|
4250 theme_font_get_color_default(PidginThemeFont *font, const char *def) |
f099e7f2739c
Several changes:
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26554
diff
changeset
|
4251 { |
f099e7f2739c
Several changes:
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26554
diff
changeset
|
4252 const char *ret; |
f099e7f2739c
Several changes:
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26554
diff
changeset
|
4253 if (!font || !(ret = pidgin_theme_font_get_color_describe(font))) |
f099e7f2739c
Several changes:
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26554
diff
changeset
|
4254 ret = def; |
f099e7f2739c
Several changes:
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26554
diff
changeset
|
4255 return ret; |
f099e7f2739c
Several changes:
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26554
diff
changeset
|
4256 } |
f099e7f2739c
Several changes:
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26554
diff
changeset
|
4257 |
f099e7f2739c
Several changes:
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26554
diff
changeset
|
4258 static const char * |
f099e7f2739c
Several changes:
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26554
diff
changeset
|
4259 theme_font_get_face_default(PidginThemeFont *font, const char *def) |
f099e7f2739c
Several changes:
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26554
diff
changeset
|
4260 { |
f099e7f2739c
Several changes:
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26554
diff
changeset
|
4261 const char *ret; |
f099e7f2739c
Several changes:
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26554
diff
changeset
|
4262 if (!font || !(ret = pidgin_theme_font_get_font_face(font))) |
f099e7f2739c
Several changes:
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26554
diff
changeset
|
4263 ret = def; |
f099e7f2739c
Several changes:
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26554
diff
changeset
|
4264 return ret; |
f099e7f2739c
Several changes:
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26554
diff
changeset
|
4265 } |
f099e7f2739c
Several changes:
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26554
diff
changeset
|
4266 |
25108
06392c8252c0
Added text and font coloring for buddies, contacts and chats, as well as fix a few small bugs
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25107
diff
changeset
|
4267 gchar * |
06392c8252c0
Added text and font coloring for buddies, contacts and chats, as well as fix a few small bugs
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25107
diff
changeset
|
4268 pidgin_blist_get_name_markup(PurpleBuddy *b, gboolean selected, gboolean aliased) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4269 { |
25119
fc8047e1fa39
fixed some leaks and made theme loading safer
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25118
diff
changeset
|
4270 const char *name, *name_color, *name_font, *status_color, *status_font; |
fc8047e1fa39
fixed some leaks and made theme loading safer
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25118
diff
changeset
|
4271 char *text = NULL; |
15822 | 4272 PurplePlugin *prpl; |
4273 PurplePluginProtocolInfo *prpl_info = NULL; | |
4274 PurpleContact *contact; | |
4275 PurplePresence *presence; | |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
4276 struct _pidgin_blist_node *gtkcontactnode = NULL; |
25119
fc8047e1fa39
fixed some leaks and made theme loading safer
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25118
diff
changeset
|
4277 char *idletime = NULL, *statustext = NULL, *nametext = NULL; |
19939
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
|
4278 PurpleConversation *conv = find_conversation_with_buddy(b); |
15496
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:
15492
diff
changeset
|
4279 gboolean hidden_conv = FALSE; |
25108
06392c8252c0
Added text and font coloring for buddies, contacts and chats, as well as fix a few small bugs
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25107
diff
changeset
|
4280 gboolean biglist = purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/blist/show_buddy_icons"); |
26572
f099e7f2739c
Several changes:
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26554
diff
changeset
|
4281 PidginThemeFont *statusfont = NULL, *namefont = NULL; |
25108
06392c8252c0
Added text and font coloring for buddies, contacts and chats, as well as fix a few small bugs
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25107
diff
changeset
|
4282 PidginBlistTheme *theme; |
15496
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:
15492
diff
changeset
|
4283 |
19939
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
|
4284 if (conv != NULL) { |
32350
cd46874707b1
Pidgin: Use the purple_blist_node_ accessor functions.
andrew.victor@mxit.com
parents:
32347
diff
changeset
|
4285 PidginBlistNode *ui = purple_blist_node_get_ui_data(&(b->node)); |
19939
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
|
4286 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
|
4287 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
|
4288 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
|
4289 } 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
|
4290 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
|
4291 hidden_conv = TRUE; |
15496
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:
15492
diff
changeset
|
4292 } |
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:
15492
diff
changeset
|
4293 } |
15631
a830f9756f23
Some more pidgininfication
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15614
diff
changeset
|
4294 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4295 /* XXX Good luck cleaning up this crap */ |
25827
0e08c847517d
Update some casts (that the script didn't fix correctly) to GObject macros.
Richard Laager <rlaager@wiktel.com>
parents:
25822
diff
changeset
|
4296 contact = PURPLE_CONTACT(PURPLE_BLIST_NODE(b)->parent); |
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
|
4297 if(contact) |
25827
0e08c847517d
Update some casts (that the script didn't fix correctly) to GObject macros.
Richard Laager <rlaager@wiktel.com>
parents:
25822
diff
changeset
|
4298 gtkcontactnode = purple_blist_node_get_ui_data(PURPLE_BLIST_NODE(contact)); |
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
|
4299 |
25108
06392c8252c0
Added text and font coloring for buddies, contacts and chats, as well as fix a few small bugs
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25107
diff
changeset
|
4300 /* Name */ |
25109
824e97a1dd22
fixed some small font bugs, the coloring when selected, and a segfault
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25108
diff
changeset
|
4301 if (gtkcontactnode && !gtkcontactnode->contact_expanded && contact->alias) |
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
|
4302 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
|
4303 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
|
4304 name = purple_buddy_get_alias(b); |
25924
584063555949
Remove trailing whitespace
Mark Doliner <mark@kingant.net>
parents:
25920
diff
changeset
|
4305 |
29636
d75813811637
Add a new signal, drawing-buddy, to allow plugins to handle markup in buddy
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
29618
diff
changeset
|
4306 /* Raise a contact pre-draw signal here. THe callback will return an |
d75813811637
Add a new signal, drawing-buddy, to allow plugins to handle markup in buddy
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
29618
diff
changeset
|
4307 * escaped version of the name. */ |
d75813811637
Add a new signal, drawing-buddy, to allow plugins to handle markup in buddy
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
29618
diff
changeset
|
4308 nametext = purple_signal_emit_return_1(pidgin_blist_get_handle(), "drawing-buddy", b); |
d75813811637
Add a new signal, drawing-buddy, to allow plugins to handle markup in buddy
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
29618
diff
changeset
|
4309 |
d75813811637
Add a new signal, drawing-buddy, to allow plugins to handle markup in buddy
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
29618
diff
changeset
|
4310 if(!nametext) |
d75813811637
Add a new signal, drawing-buddy, to allow plugins to handle markup in buddy
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
29618
diff
changeset
|
4311 nametext = g_markup_escape_text(name, strlen(name)); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4312 |
15822 | 4313 presence = purple_buddy_get_presence(b); |
4314 | |
25108
06392c8252c0
Added text and font coloring for buddies, contacts and chats, as well as fix a few small bugs
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25107
diff
changeset
|
4315 /* Name is all that is needed */ |
26209
fb937c4c2a50
Fix displaying of status messages in the conversation infopane.
Paul Aurich <paul@darkrain42.org>
parents:
26206
diff
changeset
|
4316 if (!aliased || biglist) { |
25108
06392c8252c0
Added text and font coloring for buddies, contacts and chats, as well as fix a few small bugs
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25107
diff
changeset
|
4317 |
06392c8252c0
Added text and font coloring for buddies, contacts and chats, as well as fix a few small bugs
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25107
diff
changeset
|
4318 /* Status Info */ |
32342
b6276b10cb10
Use the PurpleBuddy accessor functions.
andrew.victor@mxit.com
parents:
32305
diff
changeset
|
4319 prpl = purple_find_prpl(purple_account_get_protocol_id(purple_buddy_get_account(b))); |
25924
584063555949
Remove trailing whitespace
Mark Doliner <mark@kingant.net>
parents:
25920
diff
changeset
|
4320 |
25108
06392c8252c0
Added text and font coloring for buddies, contacts and chats, as well as fix a few small bugs
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25107
diff
changeset
|
4321 if (prpl != NULL) |
06392c8252c0
Added text and font coloring for buddies, contacts and chats, as well as fix a few small bugs
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25107
diff
changeset
|
4322 prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(prpl); |
25924
584063555949
Remove trailing whitespace
Mark Doliner <mark@kingant.net>
parents:
25920
diff
changeset
|
4323 |
32342
b6276b10cb10
Use the PurpleBuddy accessor functions.
andrew.victor@mxit.com
parents:
32305
diff
changeset
|
4324 if (prpl_info && prpl_info->status_text && purple_account_get_connection(purple_buddy_get_account(b))) { |
25108
06392c8252c0
Added text and font coloring for buddies, contacts and chats, as well as fix a few small bugs
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25107
diff
changeset
|
4325 char *tmp = prpl_info->status_text(b); |
06392c8252c0
Added text and font coloring for buddies, contacts and chats, as well as fix a few small bugs
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25107
diff
changeset
|
4326 const char *end; |
25924
584063555949
Remove trailing whitespace
Mark Doliner <mark@kingant.net>
parents:
25920
diff
changeset
|
4327 |
25108
06392c8252c0
Added text and font coloring for buddies, contacts and chats, as well as fix a few small bugs
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25107
diff
changeset
|
4328 if(tmp && !g_utf8_validate(tmp, -1, &end)) { |
06392c8252c0
Added text and font coloring for buddies, contacts and chats, as well as fix a few small bugs
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25107
diff
changeset
|
4329 char *new = g_strndup(tmp, |
06392c8252c0
Added text and font coloring for buddies, contacts and chats, as well as fix a few small bugs
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25107
diff
changeset
|
4330 g_utf8_pointer_to_offset(tmp, end)); |
06392c8252c0
Added text and font coloring for buddies, contacts and chats, as well as fix a few small bugs
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25107
diff
changeset
|
4331 g_free(tmp); |
06392c8252c0
Added text and font coloring for buddies, contacts and chats, as well as fix a few small bugs
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25107
diff
changeset
|
4332 tmp = new; |
06392c8252c0
Added text and font coloring for buddies, contacts and chats, as well as fix a few small bugs
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25107
diff
changeset
|
4333 } |
06392c8252c0
Added text and font coloring for buddies, contacts and chats, as well as fix a few small bugs
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25107
diff
changeset
|
4334 if(tmp) { |
06392c8252c0
Added text and font coloring for buddies, contacts and chats, as well as fix a few small bugs
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25107
diff
changeset
|
4335 g_strdelimit(tmp, "\n", ' '); |
06392c8252c0
Added text and font coloring for buddies, contacts and chats, as well as fix a few small bugs
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25107
diff
changeset
|
4336 purple_str_strip_char(tmp, '\r'); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4337 } |
25108
06392c8252c0
Added text and font coloring for buddies, contacts and chats, as well as fix a few small bugs
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25107
diff
changeset
|
4338 statustext = tmp; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4339 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4340 |
25108
06392c8252c0
Added text and font coloring for buddies, contacts and chats, as well as fix a few small bugs
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25107
diff
changeset
|
4341 if(!purple_presence_is_online(presence) && !statustext) |
06392c8252c0
Added text and font coloring for buddies, contacts and chats, as well as fix a few small bugs
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25107
diff
changeset
|
4342 statustext = g_strdup(_("Offline")); |
25924
584063555949
Remove trailing whitespace
Mark Doliner <mark@kingant.net>
parents:
25920
diff
changeset
|
4343 |
584063555949
Remove trailing whitespace
Mark Doliner <mark@kingant.net>
parents:
25920
diff
changeset
|
4344 /* Idle Text */ |
25108
06392c8252c0
Added text and font coloring for buddies, contacts and chats, as well as fix a few small bugs
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25107
diff
changeset
|
4345 if (purple_presence_is_idle(presence) && purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/blist/show_idle_time")) { |
15822 | 4346 time_t idle_secs = purple_presence_get_idle_time(presence); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4347 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4348 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
|
4349 int iday, ihrs, imin; |
25108
06392c8252c0
Added text and font coloring for buddies, contacts and chats, as well as fix a few small bugs
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25107
diff
changeset
|
4350 time_t t; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4351 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4352 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
|
4353 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
|
4354 ihrs = ((t - idle_secs) / 60 / 60) % 24; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4355 imin = ((t - idle_secs) / 60) % 60; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4356 |
25920
c0e3b62f8098
* Alphabetize files in a few Makefile.am files
Mark Doliner <mark@kingant.net>
parents:
25919
diff
changeset
|
4357 if (iday) |
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
|
4358 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
|
4359 else if (ihrs) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4360 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
|
4361 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4362 idletime = g_strdup_printf(_("Idle %dm"), imin); |
25108
06392c8252c0
Added text and font coloring for buddies, contacts and chats, as well as fix a few small bugs
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25107
diff
changeset
|
4363 |
25920
c0e3b62f8098
* Alphabetize files in a few Makefile.am files
Mark Doliner <mark@kingant.net>
parents:
25919
diff
changeset
|
4364 } else |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4365 idletime = g_strdup(_("Idle")); |
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
|
4366 } |
25108
06392c8252c0
Added text and font coloring for buddies, contacts and chats, as well as fix a few small bugs
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25107
diff
changeset
|
4367 } |
06392c8252c0
Added text and font coloring for buddies, contacts and chats, as well as fix a few small bugs
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25107
diff
changeset
|
4368 |
06392c8252c0
Added text and font coloring for buddies, contacts and chats, as well as fix a few small bugs
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25107
diff
changeset
|
4369 /* choose the colors of the text */ |
06392c8252c0
Added text and font coloring for buddies, contacts and chats, as well as fix a few small bugs
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25107
diff
changeset
|
4370 theme = pidgin_blist_get_theme(); |
26572
f099e7f2739c
Several changes:
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26554
diff
changeset
|
4371 name_color = NULL; |
f099e7f2739c
Several changes:
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26554
diff
changeset
|
4372 |
f099e7f2739c
Several changes:
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26554
diff
changeset
|
4373 if (theme) { |
f099e7f2739c
Several changes:
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26554
diff
changeset
|
4374 if (purple_presence_is_idle(presence)) { |
f099e7f2739c
Several changes:
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26554
diff
changeset
|
4375 namefont = statusfont = pidgin_blist_theme_get_idle_text_info(theme); |
f099e7f2739c
Several changes:
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26554
diff
changeset
|
4376 name_color = "dim grey"; |
f099e7f2739c
Several changes:
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26554
diff
changeset
|
4377 } else if (!purple_presence_is_online(presence)) { |
f099e7f2739c
Several changes:
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26554
diff
changeset
|
4378 namefont = pidgin_blist_theme_get_offline_text_info(theme); |
28063
f1a8a28432f4
Make idle and offline buddy names and the idle time in the small list grey
Mark Doliner <mark@kingant.net>
parents:
27999
diff
changeset
|
4379 name_color = "dim grey"; |
26572
f099e7f2739c
Several changes:
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26554
diff
changeset
|
4380 statusfont = pidgin_blist_theme_get_status_text_info(theme); |
f099e7f2739c
Several changes:
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26554
diff
changeset
|
4381 } else if (purple_presence_is_available(presence)) { |
f099e7f2739c
Several changes:
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26554
diff
changeset
|
4382 namefont = pidgin_blist_theme_get_online_text_info(theme); |
f099e7f2739c
Several changes:
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26554
diff
changeset
|
4383 statusfont = pidgin_blist_theme_get_status_text_info(theme); |
f099e7f2739c
Several changes:
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26554
diff
changeset
|
4384 } else { |
f099e7f2739c
Several changes:
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26554
diff
changeset
|
4385 namefont = pidgin_blist_theme_get_away_text_info(theme); |
f099e7f2739c
Several changes:
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26554
diff
changeset
|
4386 statusfont = pidgin_blist_theme_get_status_text_info(theme); |
f099e7f2739c
Several changes:
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26554
diff
changeset
|
4387 } |
25108
06392c8252c0
Added text and font coloring for buddies, contacts and chats, as well as fix a few small bugs
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25107
diff
changeset
|
4388 } else { |
28063
f1a8a28432f4
Make idle and offline buddy names and the idle time in the small list grey
Mark Doliner <mark@kingant.net>
parents:
27999
diff
changeset
|
4389 if (!selected |
f1a8a28432f4
Make idle and offline buddy names and the idle time in the small list grey
Mark Doliner <mark@kingant.net>
parents:
27999
diff
changeset
|
4390 && (purple_presence_is_idle(presence) |
f1a8a28432f4
Make idle and offline buddy names and the idle time in the small list grey
Mark Doliner <mark@kingant.net>
parents:
27999
diff
changeset
|
4391 || !purple_presence_is_online(presence))) |
f1a8a28432f4
Make idle and offline buddy names and the idle time in the small list grey
Mark Doliner <mark@kingant.net>
parents:
27999
diff
changeset
|
4392 { |
f1a8a28432f4
Make idle and offline buddy names and the idle time in the small list grey
Mark Doliner <mark@kingant.net>
parents:
27999
diff
changeset
|
4393 name_color = "dim grey"; |
f1a8a28432f4
Make idle and offline buddy names and the idle time in the small list grey
Mark Doliner <mark@kingant.net>
parents:
27999
diff
changeset
|
4394 } |
26572
f099e7f2739c
Several changes:
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26554
diff
changeset
|
4395 } |
f099e7f2739c
Several changes:
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26554
diff
changeset
|
4396 |
f099e7f2739c
Several changes:
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26554
diff
changeset
|
4397 name_color = theme_font_get_color_default(namefont, name_color); |
f099e7f2739c
Several changes:
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26554
diff
changeset
|
4398 name_font = theme_font_get_face_default(namefont, ""); |
f099e7f2739c
Several changes:
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26554
diff
changeset
|
4399 |
f099e7f2739c
Several changes:
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26554
diff
changeset
|
4400 status_color = theme_font_get_color_default(statusfont, "dim grey"); |
f099e7f2739c
Several changes:
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26554
diff
changeset
|
4401 status_font = theme_font_get_face_default(statusfont, ""); |
25108
06392c8252c0
Added text and font coloring for buddies, contacts and chats, as well as fix a few small bugs
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25107
diff
changeset
|
4402 |
25118
f76e9db37141
Fixes blist theme bug in buddy markup
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25117
diff
changeset
|
4403 if (aliased && selected) { |
25966
36f6f798e48a
Use text colours from the GTK+ theme instead of black when no buddy list theme
Marcus Lundblad <ml@update.uu.se>
parents:
25947
diff
changeset
|
4404 if (theme) { |
36f6f798e48a
Use text colours from the GTK+ theme instead of black when no buddy list theme
Marcus Lundblad <ml@update.uu.se>
parents:
25947
diff
changeset
|
4405 name_color = "black"; |
36f6f798e48a
Use text colours from the GTK+ theme instead of black when no buddy list theme
Marcus Lundblad <ml@update.uu.se>
parents:
25947
diff
changeset
|
4406 status_color = "black"; |
36f6f798e48a
Use text colours from the GTK+ theme instead of black when no buddy list theme
Marcus Lundblad <ml@update.uu.se>
parents:
25947
diff
changeset
|
4407 } else { |
36f6f798e48a
Use text colours from the GTK+ theme instead of black when no buddy list theme
Marcus Lundblad <ml@update.uu.se>
parents:
25947
diff
changeset
|
4408 name_color = NULL; |
36f6f798e48a
Use text colours from the GTK+ theme instead of black when no buddy list theme
Marcus Lundblad <ml@update.uu.se>
parents:
25947
diff
changeset
|
4409 status_color = NULL; |
36f6f798e48a
Use text colours from the GTK+ theme instead of black when no buddy list theme
Marcus Lundblad <ml@update.uu.se>
parents:
25947
diff
changeset
|
4410 } |
25108
06392c8252c0
Added text and font coloring for buddies, contacts and chats, as well as fix a few small bugs
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25107
diff
changeset
|
4411 } |
06392c8252c0
Added text and font coloring for buddies, contacts and chats, as well as fix a few small bugs
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25107
diff
changeset
|
4412 |
28434
876ffa0f5465
pidgin: Bold usernames with unread messages in the buddy list again. Closes #10068.
Paul Aurich <paul@darkrain42.org>
parents:
28211
diff
changeset
|
4413 if (hidden_conv) { |
876ffa0f5465
pidgin: Bold usernames with unread messages in the buddy list again. Closes #10068.
Paul Aurich <paul@darkrain42.org>
parents:
28211
diff
changeset
|
4414 char *tmp = nametext; |
876ffa0f5465
pidgin: Bold usernames with unread messages in the buddy list again. Closes #10068.
Paul Aurich <paul@darkrain42.org>
parents:
28211
diff
changeset
|
4415 nametext = g_strdup_printf("<b>%s</b>", tmp); |
876ffa0f5465
pidgin: Bold usernames with unread messages in the buddy list again. Closes #10068.
Paul Aurich <paul@darkrain42.org>
parents:
28211
diff
changeset
|
4416 g_free(tmp); |
876ffa0f5465
pidgin: Bold usernames with unread messages in the buddy list again. Closes #10068.
Paul Aurich <paul@darkrain42.org>
parents:
28211
diff
changeset
|
4417 } |
876ffa0f5465
pidgin: Bold usernames with unread messages in the buddy list again. Closes #10068.
Paul Aurich <paul@darkrain42.org>
parents:
28211
diff
changeset
|
4418 |
25108
06392c8252c0
Added text and font coloring for buddies, contacts and chats, as well as fix a few small bugs
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25107
diff
changeset
|
4419 /* Put it all together */ |
26209
fb937c4c2a50
Fix displaying of status messages in the conversation infopane.
Paul Aurich <paul@darkrain42.org>
parents:
26206
diff
changeset
|
4420 if ((!aliased || biglist) && (statustext || idletime)) { |
25109
824e97a1dd22
fixed some small font bugs, the coloring when selected, and a segfault
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25108
diff
changeset
|
4421 /* using <span size='smaller'> breaks the status, so it must be seperated into <small><span>*/ |
25966
36f6f798e48a
Use text colours from the GTK+ theme instead of black when no buddy list theme
Marcus Lundblad <ml@update.uu.se>
parents:
25947
diff
changeset
|
4422 if (name_color) { |
36f6f798e48a
Use text colours from the GTK+ theme instead of black when no buddy list theme
Marcus Lundblad <ml@update.uu.se>
parents:
25947
diff
changeset
|
4423 text = g_strdup_printf("<span font_desc='%s' foreground='%s'>%s</span>\n" |
36f6f798e48a
Use text colours from the GTK+ theme instead of black when no buddy list theme
Marcus Lundblad <ml@update.uu.se>
parents:
25947
diff
changeset
|
4424 "<small><span font_desc='%s' foreground='%s'>%s%s%s</span></small>", |
36f6f798e48a
Use text colours from the GTK+ theme instead of black when no buddy list theme
Marcus Lundblad <ml@update.uu.se>
parents:
25947
diff
changeset
|
4425 name_font, name_color, nametext, status_font, status_color, |
36f6f798e48a
Use text colours from the GTK+ theme instead of black when no buddy list theme
Marcus Lundblad <ml@update.uu.se>
parents:
25947
diff
changeset
|
4426 idletime != NULL ? idletime : "", |
36f6f798e48a
Use text colours from the GTK+ theme instead of black when no buddy list theme
Marcus Lundblad <ml@update.uu.se>
parents:
25947
diff
changeset
|
4427 (idletime != NULL && statustext != NULL) ? " - " : "", |
36f6f798e48a
Use text colours from the GTK+ theme instead of black when no buddy list theme
Marcus Lundblad <ml@update.uu.se>
parents:
25947
diff
changeset
|
4428 statustext != NULL ? statustext : ""); |
36f6f798e48a
Use text colours from the GTK+ theme instead of black when no buddy list theme
Marcus Lundblad <ml@update.uu.se>
parents:
25947
diff
changeset
|
4429 } else if (status_color) { |
36f6f798e48a
Use text colours from the GTK+ theme instead of black when no buddy list theme
Marcus Lundblad <ml@update.uu.se>
parents:
25947
diff
changeset
|
4430 text = g_strdup_printf("<span font_desc='%s'>%s</span>\n" |
36f6f798e48a
Use text colours from the GTK+ theme instead of black when no buddy list theme
Marcus Lundblad <ml@update.uu.se>
parents:
25947
diff
changeset
|
4431 "<small><span font_desc='%s' foreground='%s'>%s%s%s</span></small>", |
36f6f798e48a
Use text colours from the GTK+ theme instead of black when no buddy list theme
Marcus Lundblad <ml@update.uu.se>
parents:
25947
diff
changeset
|
4432 name_font, nametext, status_font, status_color, |
36f6f798e48a
Use text colours from the GTK+ theme instead of black when no buddy list theme
Marcus Lundblad <ml@update.uu.se>
parents:
25947
diff
changeset
|
4433 idletime != NULL ? idletime : "", |
36f6f798e48a
Use text colours from the GTK+ theme instead of black when no buddy list theme
Marcus Lundblad <ml@update.uu.se>
parents:
25947
diff
changeset
|
4434 (idletime != NULL && statustext != NULL) ? " - " : "", |
36f6f798e48a
Use text colours from the GTK+ theme instead of black when no buddy list theme
Marcus Lundblad <ml@update.uu.se>
parents:
25947
diff
changeset
|
4435 statustext != NULL ? statustext : ""); |
36f6f798e48a
Use text colours from the GTK+ theme instead of black when no buddy list theme
Marcus Lundblad <ml@update.uu.se>
parents:
25947
diff
changeset
|
4436 } else { |
36f6f798e48a
Use text colours from the GTK+ theme instead of black when no buddy list theme
Marcus Lundblad <ml@update.uu.se>
parents:
25947
diff
changeset
|
4437 text = g_strdup_printf("<span font_desc='%s'>%s</span>\n" |
36f6f798e48a
Use text colours from the GTK+ theme instead of black when no buddy list theme
Marcus Lundblad <ml@update.uu.se>
parents:
25947
diff
changeset
|
4438 "<small><span font_desc='%s'>%s%s%s</span></small>", |
36f6f798e48a
Use text colours from the GTK+ theme instead of black when no buddy list theme
Marcus Lundblad <ml@update.uu.se>
parents:
25947
diff
changeset
|
4439 name_font, nametext, status_font, |
36f6f798e48a
Use text colours from the GTK+ theme instead of black when no buddy list theme
Marcus Lundblad <ml@update.uu.se>
parents:
25947
diff
changeset
|
4440 idletime != NULL ? idletime : "", |
36f6f798e48a
Use text colours from the GTK+ theme instead of black when no buddy list theme
Marcus Lundblad <ml@update.uu.se>
parents:
25947
diff
changeset
|
4441 (idletime != NULL && statustext != NULL) ? " - " : "", |
36f6f798e48a
Use text colours from the GTK+ theme instead of black when no buddy list theme
Marcus Lundblad <ml@update.uu.se>
parents:
25947
diff
changeset
|
4442 statustext != NULL ? statustext : ""); |
36f6f798e48a
Use text colours from the GTK+ theme instead of black when no buddy list theme
Marcus Lundblad <ml@update.uu.se>
parents:
25947
diff
changeset
|
4443 } |
36f6f798e48a
Use text colours from the GTK+ theme instead of black when no buddy list theme
Marcus Lundblad <ml@update.uu.se>
parents:
25947
diff
changeset
|
4444 } else { |
36f6f798e48a
Use text colours from the GTK+ theme instead of black when no buddy list theme
Marcus Lundblad <ml@update.uu.se>
parents:
25947
diff
changeset
|
4445 if (name_color) { |
31086
a8cc50c2279f
Remove trailing whitespace
Richard Laager <rlaager@wiktel.com>
parents:
30459
diff
changeset
|
4446 text = g_strdup_printf("<span font_desc='%s' color='%s'>%s</span>", |
25966
36f6f798e48a
Use text colours from the GTK+ theme instead of black when no buddy list theme
Marcus Lundblad <ml@update.uu.se>
parents:
25947
diff
changeset
|
4447 name_font, name_color, nametext); |
36f6f798e48a
Use text colours from the GTK+ theme instead of black when no buddy list theme
Marcus Lundblad <ml@update.uu.se>
parents:
25947
diff
changeset
|
4448 } else { |
36f6f798e48a
Use text colours from the GTK+ theme instead of black when no buddy list theme
Marcus Lundblad <ml@update.uu.se>
parents:
25947
diff
changeset
|
4449 text = g_strdup_printf("<span font_desc='%s'>%s</span>", name_font, |
36f6f798e48a
Use text colours from the GTK+ theme instead of black when no buddy list theme
Marcus Lundblad <ml@update.uu.se>
parents:
25947
diff
changeset
|
4450 nametext); |
36f6f798e48a
Use text colours from the GTK+ theme instead of black when no buddy list theme
Marcus Lundblad <ml@update.uu.se>
parents:
25947
diff
changeset
|
4451 } |
36f6f798e48a
Use text colours from the GTK+ theme instead of black when no buddy list theme
Marcus Lundblad <ml@update.uu.se>
parents:
25947
diff
changeset
|
4452 } |
25119
fc8047e1fa39
fixed some leaks and made theme loading safer
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25118
diff
changeset
|
4453 g_free(nametext); |
25920
c0e3b62f8098
* Alphabetize files in a few Makefile.am files
Mark Doliner <mark@kingant.net>
parents:
25919
diff
changeset
|
4454 g_free(statustext); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4455 g_free(idletime); |
15631
a830f9756f23
Some more pidgininfication
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15614
diff
changeset
|
4456 |
15496
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:
15492
diff
changeset
|
4457 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:
15492
diff
changeset
|
4458 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:
15492
diff
changeset
|
4459 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:
15492
diff
changeset
|
4460 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:
15492
diff
changeset
|
4461 } |
15631
a830f9756f23
Some more pidgininfication
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15614
diff
changeset
|
4462 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4463 return text; |
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 |
22007
c38d72677c8a
Probe for -Wstrict-prototypes to get some more warnings. I then cleaned up
Richard Laager <rlaager@wiktel.com>
parents:
21960
diff
changeset
|
4466 static void pidgin_blist_restore_position(void) |
15373
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 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
|
4469 |
16062
07554cc5d090
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <stu@nosnilmot.com>
parents:
16010
diff
changeset
|
4470 blist_width = purple_prefs_get_int(PIDGIN_PREFS_ROOT "/blist/width"); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4471 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4472 /* 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
|
4473 * position is sane... */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4474 if (gtkblist && gtkblist->window && |
32686
3538e783b98c
Fix all deprecated GTK_WIDGET_* macros.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32684
diff
changeset
|
4475 !gtk_widget_get_visible(gtkblist->window) && blist_width != 0) { |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4476 |
16062
07554cc5d090
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <stu@nosnilmot.com>
parents:
16010
diff
changeset
|
4477 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
|
4478 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
|
4479 blist_height = purple_prefs_get_int(PIDGIN_PREFS_ROOT "/blist/height"); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4480 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4481 /* ...check position is on screen... */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4482 if (blist_x >= gdk_screen_width()) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4483 blist_x = gdk_screen_width() - 100; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4484 else if (blist_x + blist_width < 0) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4485 blist_x = 100; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4486 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4487 if (blist_y >= gdk_screen_height()) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4488 blist_y = gdk_screen_height() - 100; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4489 else if (blist_y + blist_height < 0) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4490 blist_y = 100; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4491 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4492 /* ...and move it back. */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4493 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
|
4494 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
|
4495 if (purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/blist/list_maximized")) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4496 gtk_window_maximize(GTK_WINDOW(gtkblist->window)); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4497 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4498 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4499 |
15822 | 4500 static gboolean pidgin_blist_refresh_timer(PurpleBuddyList *list) |
4501 { | |
4502 PurpleBlistNode *gnode, *cnode; | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4503 |
21041
094bbbe89d0d
Track the actual visibility for the buddy list (unobscured, partially and
Casey Harkins <charkins@pidgin.im>
parents:
21040
diff
changeset
|
4504 if (gtk_blist_visibility == GDK_VISIBILITY_FULLY_OBSCURED |
32686
3538e783b98c
Fix all deprecated GTK_WIDGET_* macros.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32684
diff
changeset
|
4505 || !gtk_widget_get_visible(gtkblist->window)) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4506 return TRUE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4507 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4508 for(gnode = list->root; gnode; gnode = gnode->next) { |
15822 | 4509 if(!PURPLE_BLIST_NODE_IS_GROUP(gnode)) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4510 continue; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4511 for(cnode = gnode->child; cnode; cnode = cnode->next) { |
15822 | 4512 if(PURPLE_BLIST_NODE_IS_CONTACT(cnode)) { |
4513 PurpleBuddy *buddy; | |
4514 | |
4515 buddy = purple_contact_get_priority_buddy((PurpleContact*)cnode); | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4516 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4517 if (buddy && |
15822 | 4518 purple_presence_is_idle(purple_buddy_get_presence(buddy))) |
32350
cd46874707b1
Pidgin: Use the purple_blist_node_ accessor functions.
andrew.victor@mxit.com
parents:
32347
diff
changeset
|
4519 pidgin_blist_update_contact(list, PURPLE_BLIST_NODE(buddy)); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4520 } |
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 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4524 /* keep on going */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4525 return TRUE; |
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 |
15822 | 4528 static void pidgin_blist_hide_node(PurpleBuddyList *list, PurpleBlistNode *node, gboolean update) |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
4529 { |
32350
cd46874707b1
Pidgin: Use the purple_blist_node_ accessor functions.
andrew.victor@mxit.com
parents:
32347
diff
changeset
|
4530 struct _pidgin_blist_node *gtknode = purple_blist_node_get_ui_data(node); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4531 GtkTreeIter iter; |
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 if (!gtknode || !gtknode->row || !gtkblist) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4534 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4535 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4536 if(gtkblist->selected_node == node) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4537 gtkblist->selected_node = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4538 if (get_iter_from_node(node, &iter)) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4539 gtk_tree_store_remove(gtkblist->treemodel, &iter); |
15822 | 4540 if(update && (PURPLE_BLIST_NODE_IS_CONTACT(node) || |
4541 PURPLE_BLIST_NODE_IS_BUDDY(node) || PURPLE_BLIST_NODE_IS_CHAT(node))) { | |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
4542 pidgin_blist_update(list, node->parent); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4543 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4544 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4545 gtk_tree_row_reference_free(gtknode->row); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4546 gtknode->row = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4547 } |
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 static const char *require_connection[] = |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4550 { |
32582
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
4551 "/BList/BuddiesMenu/NewInstantMessage", |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
4552 "/BList/BuddiesMenu/JoinAChat", |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
4553 "/BList/BuddiesMenu/GetUserInfo", |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
4554 "/BList/BuddiesMenu/AddBuddy", |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
4555 "/BList/BuddiesMenu/AddChat", |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
4556 "/BList/BuddiesMenu/AddGroup", |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4557 }; |
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 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
|
4560 / sizeof(*require_connection); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4561 |
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 * 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
|
4564 * where appropriate. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4565 */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4566 static void |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
4567 update_menu_bar(PidginBuddyList *gtkblist) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4568 { |
32582
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
4569 GtkAction *action; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4570 gboolean sensitive; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4571 int i; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4572 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4573 g_return_if_fail(gtkblist != NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4574 |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
4575 pidgin_blist_update_accounts_menu(); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4576 |
15822 | 4577 sensitive = (purple_connections_get_all() != NULL); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4578 |
32582
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
4579 for (i = 0; i < require_connection_size; i++) |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
4580 { |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
4581 action = gtk_ui_manager_get_action(gtkblist->ui, require_connection[i]); |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
4582 gtk_action_set_sensitive(action, sensitive); |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
4583 } |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
4584 |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
4585 action = gtk_ui_manager_get_action(gtkblist->ui, "/BList/BuddiesMenu/JoinAChat"); |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
4586 gtk_action_set_sensitive(action, pidgin_blist_joinchat_is_showable()); |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
4587 |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
4588 action = gtk_ui_manager_get_action(gtkblist->ui, "/BList/BuddiesMenu/AddChat"); |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
4589 gtk_action_set_sensitive(action, pidgin_blist_joinchat_is_showable()); |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
4590 |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
4591 action = gtk_ui_manager_get_action(gtkblist->ui, "/BList/ToolsMenu/Privacy"); |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
4592 gtk_action_set_sensitive(action, sensitive); |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
4593 |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
4594 action = gtk_ui_manager_get_action(gtkblist->ui, "/BList/ToolsMenu/RoomList"); |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
4595 gtk_action_set_sensitive(action, pidgin_roomlist_is_showable()); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4596 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4597 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4598 static void |
15822 | 4599 sign_on_off_cb(PurpleConnection *gc, PurpleBuddyList *blist) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4600 { |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
4601 PidginBuddyList *gtkblist = PIDGIN_BLIST(blist); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4602 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4603 update_menu_bar(gtkblist); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4604 } |
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 void |
30173
2a51b2c643d2
gpointer* is redundant.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30116
diff
changeset
|
4607 plugin_changed_cb(PurplePlugin *p, gpointer data) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4608 { |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
4609 pidgin_blist_update_plugin_actions(); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4610 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4611 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4612 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
|
4613 unseen_conv_menu(void) |
15373
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 static GtkWidget *menu = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4616 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
|
4617 GList *chats, *ims; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4618 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4619 if (menu) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4620 gtk_widget_destroy(menu); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4621 menu = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4622 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4623 |
20960
f9d1e6b138a7
Make the docklet and buddy list menutray agree on unread messages. Both
Casey Harkins <charkins@pidgin.im>
parents:
20937
diff
changeset
|
4624 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
|
4625 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
|
4626 |
f9d1e6b138a7
Make the docklet and buddy list menutray agree on unread messages. Both
Casey Harkins <charkins@pidgin.im>
parents:
20937
diff
changeset
|
4627 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
|
4628 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
|
4629 |
f9d1e6b138a7
Make the docklet and buddy list menutray agree on unread messages. Both
Casey Harkins <charkins@pidgin.im>
parents:
20937
diff
changeset
|
4630 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
|
4631 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
|
4632 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
|
4633 convs = ims; |
f9d1e6b138a7
Make the docklet and buddy list menutray agree on unread messages. Both
Casey Harkins <charkins@pidgin.im>
parents:
20937
diff
changeset
|
4634 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
|
4635 convs = chats; |
f9d1e6b138a7
Make the docklet and buddy list menutray agree on unread messages. Both
Casey Harkins <charkins@pidgin.im>
parents:
20937
diff
changeset
|
4636 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4637 if (!convs) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4638 /* 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
|
4639 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4640 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4641 menu = gtk_menu_new(); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4642 |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
4643 pidgin_conversations_fill_menu(menu, convs); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4644 g_list_free(convs); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4645 gtk_widget_show_all(menu); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4646 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
|
4647 gtk_get_current_event_time()); |
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 static gboolean |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4651 menutray_press_cb(GtkWidget *widget, GdkEventButton *event) |
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 GList *convs; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4654 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4655 switch (event->button) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4656 case 1: |
15822 | 4657 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
|
4658 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
|
4659 |
f9d1e6b138a7
Make the docklet and buddy list menutray agree on unread messages. Both
Casey Harkins <charkins@pidgin.im>
parents:
20937
diff
changeset
|
4660 if(!convs) |
f9d1e6b138a7
Make the docklet and buddy list menutray agree on unread messages. Both
Casey Harkins <charkins@pidgin.im>
parents:
20937
diff
changeset
|
4661 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
|
4662 PIDGIN_UNSEEN_NICK, FALSE, 1); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4663 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
|
4664 pidgin_conv_present_conversation((PurpleConversation*)convs->data); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4665 g_list_free(convs); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4666 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4667 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4668 case 3: |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4669 unseen_conv_menu(); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4670 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4671 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4672 return TRUE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4673 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4674 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4675 static void |
15822 | 4676 conversation_updated_cb(PurpleConversation *conv, PurpleConvUpdateType type, |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
4677 PidginBuddyList *gtkblist) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4678 { |
32240
78fae2fc38d5
More code changed to use the accessor functions.
andrew.victor@mxit.com
parents:
32154
diff
changeset
|
4679 PurpleAccount *account = purple_conversation_get_account(conv); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4680 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
|
4681 GList *ims, *chats; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4682 GList *l = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4683 |
15822 | 4684 if (type != PURPLE_CONV_UPDATE_UNSEEN) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4685 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4686 |
32240
78fae2fc38d5
More code changed to use the accessor functions.
andrew.victor@mxit.com
parents:
32154
diff
changeset
|
4687 if(account != NULL && purple_conversation_get_name(conv) != NULL) { |
78fae2fc38d5
More code changed to use the accessor functions.
andrew.victor@mxit.com
parents:
32154
diff
changeset
|
4688 PurpleBuddy *buddy = purple_find_buddy(account, purple_conversation_get_name(conv)); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4689 if(buddy != NULL) |
32350
cd46874707b1
Pidgin: Use the purple_blist_node_ accessor functions.
andrew.victor@mxit.com
parents:
32347
diff
changeset
|
4690 pidgin_blist_update_buddy(NULL, PURPLE_BLIST_NODE(buddy), TRUE); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4691 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4692 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4693 if (gtkblist->menutrayicon) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4694 gtk_widget_destroy(gtkblist->menutrayicon); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4695 gtkblist->menutrayicon = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4696 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4697 |
20960
f9d1e6b138a7
Make the docklet and buddy list menutray agree on unread messages. Both
Casey Harkins <charkins@pidgin.im>
parents:
20937
diff
changeset
|
4698 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
|
4699 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
|
4700 |
f9d1e6b138a7
Make the docklet and buddy list menutray agree on unread messages. Both
Casey Harkins <charkins@pidgin.im>
parents:
20937
diff
changeset
|
4701 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
|
4702 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
|
4703 |
f9d1e6b138a7
Make the docklet and buddy list menutray agree on unread messages. Both
Casey Harkins <charkins@pidgin.im>
parents:
20937
diff
changeset
|
4704 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
|
4705 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
|
4706 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
|
4707 convs = ims; |
f9d1e6b138a7
Make the docklet and buddy list menutray agree on unread messages. Both
Casey Harkins <charkins@pidgin.im>
parents:
20937
diff
changeset
|
4708 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
|
4709 convs = chats; |
f9d1e6b138a7
Make the docklet and buddy list menutray agree on unread messages. Both
Casey Harkins <charkins@pidgin.im>
parents:
20937
diff
changeset
|
4710 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4711 if (convs) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4712 GtkWidget *img = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4713 GString *tooltip_text = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4714 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4715 tooltip_text = g_string_new(""); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4716 l = convs; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4717 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
|
4718 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
|
4719 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
|
4720 |
f9d1e6b138a7
Make the docklet and buddy list menutray agree on unread messages. Both
Casey Harkins <charkins@pidgin.im>
parents:
20937
diff
changeset
|
4721 if(gtkconv) |
f9d1e6b138a7
Make the docklet and buddy list menutray agree on unread messages. Both
Casey Harkins <charkins@pidgin.im>
parents:
20937
diff
changeset
|
4722 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
|
4723 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
|
4724 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
|
4725 |
19944
25f4be036a16
Make changes in the buddylist menutray icon for hidden conversations to work
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19940
diff
changeset
|
4726 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:
19940
diff
changeset
|
4727 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
|
4728 count, purple_conversation_get_title(l->data)); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4729 l = l->next; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4730 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4731 if(tooltip_text->len > 0) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4732 /* get rid of the last newline */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4733 g_string_truncate(tooltip_text, tooltip_text->len -1); |
15631
a830f9756f23
Some more pidgininfication
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15614
diff
changeset
|
4734 img = gtk_image_new_from_stock(PIDGIN_STOCK_TOOLBAR_PENDING, |
15559
442128853bdb
toolbar/menu icons. reduce the imhtmltoolbar spacing. more gaimstock pruning
Sean Egan <seanegan@gmail.com>
parents:
15558
diff
changeset
|
4735 gtk_icon_size_from_name(PIDGIN_ICON_SIZE_TANGO_EXTRA_SMALL)); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4736 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4737 gtkblist->menutrayicon = gtk_event_box_new(); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4738 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
|
4739 gtk_widget_show(img); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4740 gtk_widget_show(gtkblist->menutrayicon); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4741 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
|
4742 |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
4743 pidgin_menu_tray_append(PIDGIN_MENU_TRAY(gtkblist->menutray), gtkblist->menutrayicon, tooltip_text->str); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4744 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4745 g_string_free(tooltip_text, TRUE); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4746 g_list_free(convs); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4747 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4748 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4749 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4750 static void |
15822 | 4751 conversation_deleting_cb(PurpleConversation *conv, PidginBuddyList *gtkblist) |
4752 { | |
4753 conversation_updated_cb(conv, PURPLE_CONV_UPDATE_UNSEEN, gtkblist); | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4754 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4755 |
19939
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
|
4756 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
|
4757 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
|
4758 { |
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
|
4759 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
|
4760 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
|
4761 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
|
4762 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
|
4763 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
|
4764 } |
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
|
4765 |
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
|
4766 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
|
4767 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
|
4768 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
|
4769 { |
32350
cd46874707b1
Pidgin: Use the purple_blist_node_ accessor functions.
andrew.victor@mxit.com
parents:
32347
diff
changeset
|
4770 PidginBlistNode *ui = purple_blist_node_get_ui_data(node); |
21772
21371ea85970
Fix boldifying the chat entries in the buddylist.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21771
diff
changeset
|
4771 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
|
4772 !(flag & (PURPLE_MESSAGE_SEND | PURPLE_MESSAGE_RECV))) |
19939
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
|
4773 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
|
4774 ui->conv.flags |= PIDGIN_BLIST_NODE_HAS_PENDING_MESSAGE; |
25898
dc2584ebaa1a
Adding the patch to extend the blist theme to allow coloring of chat nodes with unread messages mentioning your nick.
Paul Aurich <paul@darkrain42.org>
parents:
25896
diff
changeset
|
4775 if (purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_CHAT |
dc2584ebaa1a
Adding the patch to extend the blist theme to allow coloring of chat nodes with unread messages mentioning your nick.
Paul Aurich <paul@darkrain42.org>
parents:
25896
diff
changeset
|
4776 && (flag & PURPLE_MESSAGE_NICK)) |
dc2584ebaa1a
Adding the patch to extend the blist theme to allow coloring of chat nodes with unread messages mentioning your nick.
Paul Aurich <paul@darkrain42.org>
parents:
25896
diff
changeset
|
4777 ui->conv.flags |= PIDGIN_BLIST_CHAT_HAS_PENDING_MESSAGE_WITH_NICK; |
dc2584ebaa1a
Adding the patch to extend the blist theme to allow coloring of chat nodes with unread messages mentioning your nick.
Paul Aurich <paul@darkrain42.org>
parents:
25896
diff
changeset
|
4778 |
19939
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
|
4779 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
|
4780 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
|
4781 } |
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
|
4782 |
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
|
4783 static void |
21772
21371ea85970
Fix boldifying the chat entries in the buddylist.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21771
diff
changeset
|
4784 displayed_msg_update_ui_cb(PidginConversation *gtkconv, PurpleBlistNode *node) |
19939
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
|
4785 { |
32350
cd46874707b1
Pidgin: Use the purple_blist_node_ accessor functions.
andrew.victor@mxit.com
parents:
32347
diff
changeset
|
4786 PidginBlistNode *ui = purple_blist_node_get_ui_data(node); |
21772
21371ea85970
Fix boldifying the chat entries in the buddylist.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21771
diff
changeset
|
4787 if (ui->conv.conv != gtkconv->active_conv) |
19939
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
|
4788 return; |
25898
dc2584ebaa1a
Adding the patch to extend the blist theme to allow coloring of chat nodes with unread messages mentioning your nick.
Paul Aurich <paul@darkrain42.org>
parents:
25896
diff
changeset
|
4789 ui->conv.flags &= ~(PIDGIN_BLIST_NODE_HAS_PENDING_MESSAGE | |
dc2584ebaa1a
Adding the patch to extend the blist theme to allow coloring of chat nodes with unread messages mentioning your nick.
Paul Aurich <paul@darkrain42.org>
parents:
25896
diff
changeset
|
4790 PIDGIN_BLIST_CHAT_HAS_PENDING_MESSAGE_WITH_NICK); |
19939
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
|
4791 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
|
4792 } |
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
|
4793 |
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
|
4794 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
|
4795 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
|
4796 { |
32240
78fae2fc38d5
More code changed to use the accessor functions.
andrew.victor@mxit.com
parents:
32154
diff
changeset
|
4797 PurpleAccount *account = purple_conversation_get_account(conv); |
78fae2fc38d5
More code changed to use the accessor functions.
andrew.victor@mxit.com
parents:
32154
diff
changeset
|
4798 |
78fae2fc38d5
More code changed to use the accessor functions.
andrew.victor@mxit.com
parents:
32154
diff
changeset
|
4799 switch (purple_conversation_get_type(conv)) { |
19939
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
|
4800 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
|
4801 { |
32240
78fae2fc38d5
More code changed to use the accessor functions.
andrew.victor@mxit.com
parents:
32154
diff
changeset
|
4802 GSList *buddies = purple_find_buddies(account, purple_conversation_get_name(conv)); |
19939
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
|
4803 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
|
4804 PurpleBlistNode *buddy = buddies->data; |
32350
cd46874707b1
Pidgin: Use the purple_blist_node_ accessor functions.
andrew.victor@mxit.com
parents:
32347
diff
changeset
|
4805 struct _pidgin_blist_node *ui = purple_blist_node_get_ui_data(buddy); |
19939
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
|
4806 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
|
4807 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
|
4808 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
|
4809 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
|
4810 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
|
4811 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
|
4812 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
|
4813 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
|
4814 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
|
4815 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
|
4816 purple_signal_connect(pidgin_conversations_get_handle(), "conversation-displayed", |
19939
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
|
4817 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
|
4818 } |
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
|
4819 } |
21772
21371ea85970
Fix boldifying the chat entries in the buddylist.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21771
diff
changeset
|
4820 break; |
19939
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
|
4821 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
|
4822 { |
32240
78fae2fc38d5
More code changed to use the accessor functions.
andrew.victor@mxit.com
parents:
32154
diff
changeset
|
4823 PurpleChat *chat = purple_blist_find_chat(account, purple_conversation_get_name(conv)); |
19939
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
|
4824 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
|
4825 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
|
4826 break; |
32350
cd46874707b1
Pidgin: Use the purple_blist_node_ accessor functions.
andrew.victor@mxit.com
parents:
32347
diff
changeset
|
4827 ui = purple_blist_node_get_ui_data(&(chat->node)); |
19939
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
|
4828 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
|
4829 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
|
4830 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
|
4831 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
|
4832 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
|
4833 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
|
4834 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
|
4835 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
|
4836 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
|
4837 purple_signal_connect(pidgin_conversations_get_handle(), "conversation-displayed", |
19939
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
|
4838 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
|
4839 } |
21772
21371ea85970
Fix boldifying the chat entries in the buddylist.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21771
diff
changeset
|
4840 break; |
19939
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
|
4841 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
|
4842 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
|
4843 } |
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
|
4844 } |
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
|
4845 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4846 /********************************************************************************** |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4847 * Public API Functions * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4848 **********************************************************************************/ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4849 |
15822 | 4850 static void pidgin_blist_new_list(PurpleBuddyList *blist) |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
4851 { |
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
4852 PidginBuddyList *gtkblist; |
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
4853 |
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
4854 gtkblist = g_new0(PidginBuddyList, 1); |
22108
e21cdaffbcdb
Plug a small leak.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22087
diff
changeset
|
4855 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
|
4856 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4857 blist->ui_data = gtkblist; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4858 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4859 |
15822 | 4860 static void pidgin_blist_new_node(PurpleBlistNode *node) |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
4861 { |
32350
cd46874707b1
Pidgin: Use the purple_blist_node_ accessor functions.
andrew.victor@mxit.com
parents:
32347
diff
changeset
|
4862 purple_blist_node_set_ui_data(node, g_new0(struct _pidgin_blist_node, 1)); |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
4863 } |
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
4864 |
15822 | 4865 gboolean pidgin_blist_node_is_contact_expanded(PurpleBlistNode *node) |
4866 { | |
17592
0e445e906cfd
Fix pidgin_blist_node_is_contact_expanded() to not crash on buddy list
Stu Tomlinson <stu@nosnilmot.com>
parents:
17551
diff
changeset
|
4867 if (PURPLE_BLIST_NODE_IS_BUDDY(node)) { |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4868 node = node->parent; |
17592
0e445e906cfd
Fix pidgin_blist_node_is_contact_expanded() to not crash on buddy list
Stu Tomlinson <stu@nosnilmot.com>
parents:
17551
diff
changeset
|
4869 if (node == NULL) |
0e445e906cfd
Fix pidgin_blist_node_is_contact_expanded() to not crash on buddy list
Stu Tomlinson <stu@nosnilmot.com>
parents:
17551
diff
changeset
|
4870 return FALSE; |
0e445e906cfd
Fix pidgin_blist_node_is_contact_expanded() to not crash on buddy list
Stu Tomlinson <stu@nosnilmot.com>
parents:
17551
diff
changeset
|
4871 } |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4872 |
15822 | 4873 g_return_val_if_fail(PURPLE_BLIST_NODE_IS_CONTACT(node), FALSE); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4874 |
32350
cd46874707b1
Pidgin: Use the purple_blist_node_ accessor functions.
andrew.victor@mxit.com
parents:
32347
diff
changeset
|
4875 return ((struct _pidgin_blist_node *)purple_blist_node_get_ui_data(node))->contact_expanded; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4876 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4877 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4878 enum { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4879 DRAG_BUDDY, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4880 DRAG_ROW, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4881 DRAG_VCARD, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4882 DRAG_TEXT, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4883 DRAG_URI, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4884 NUM_TARGETS |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4885 }; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4886 |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
4887 void pidgin_blist_setup_sort_methods() |
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
4888 { |
27649
bbce09a8e5a5
Don't allow NULL sort method IDs and don't crash on them. Fixes #9658.
Paul Aurich <paul@darkrain42.org>
parents:
27629
diff
changeset
|
4889 const char *id; |
bbce09a8e5a5
Don't allow NULL sort method IDs and don't crash on them. Fixes #9658.
Paul Aurich <paul@darkrain42.org>
parents:
27629
diff
changeset
|
4890 |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
4891 pidgin_blist_sort_method_reg("none", _("Manually"), sort_method_none); |
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
4892 pidgin_blist_sort_method_reg("alphabetical", _("Alphabetically"), sort_method_alphabetical); |
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
4893 pidgin_blist_sort_method_reg("status", _("By status"), sort_method_status); |
25919
52b2e7260340
A patch from Chris Connett to change the log size sorting method to weight
Richard Laager <rlaager@wiktel.com>
parents:
25912
diff
changeset
|
4894 pidgin_blist_sort_method_reg("log_size", _("By recent log activity"), sort_method_log_activity); |
27649
bbce09a8e5a5
Don't allow NULL sort method IDs and don't crash on them. Fixes #9658.
Paul Aurich <paul@darkrain42.org>
parents:
27629
diff
changeset
|
4895 |
bbce09a8e5a5
Don't allow NULL sort method IDs and don't crash on them. Fixes #9658.
Paul Aurich <paul@darkrain42.org>
parents:
27629
diff
changeset
|
4896 id = purple_prefs_get_string(PIDGIN_PREFS_ROOT "/blist/sort_type"); |
bbce09a8e5a5
Don't allow NULL sort method IDs and don't crash on them. Fixes #9658.
Paul Aurich <paul@darkrain42.org>
parents:
27629
diff
changeset
|
4897 if (id == NULL) { |
bbce09a8e5a5
Don't allow NULL sort method IDs and don't crash on them. Fixes #9658.
Paul Aurich <paul@darkrain42.org>
parents:
27629
diff
changeset
|
4898 purple_debug_warning("gtkblist", "Sort method was NULL, resetting to alphabetical\n"); |
bbce09a8e5a5
Don't allow NULL sort method IDs and don't crash on them. Fixes #9658.
Paul Aurich <paul@darkrain42.org>
parents:
27629
diff
changeset
|
4899 id = "alphabetical"; |
bbce09a8e5a5
Don't allow NULL sort method IDs and don't crash on them. Fixes #9658.
Paul Aurich <paul@darkrain42.org>
parents:
27629
diff
changeset
|
4900 } |
bbce09a8e5a5
Don't allow NULL sort method IDs and don't crash on them. Fixes #9658.
Paul Aurich <paul@darkrain42.org>
parents:
27629
diff
changeset
|
4901 pidgin_blist_sort_method_set(id); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4902 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4903 |
22011
76e0463db3aa
Squash some compiler warnings, some from my -Wstrict-prototypes fixing.
Richard Laager <rlaager@wiktel.com>
parents:
22007
diff
changeset
|
4904 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
|
4905 gconstpointer val, gpointer data) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4906 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4907 GtkTreeSelection *sel; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4908 GtkTreeIter iter; |
15822 | 4909 PurpleBlistNode *node = NULL; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4910 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4911 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
|
4912 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
|
4913 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4914 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
|
4915 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4916 |
15822 | 4917 redo_buddy_list(purple_get_blist(), FALSE, FALSE); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4918 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
|
4919 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4920 if (node) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4921 { |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
4922 struct _pidgin_blist_node *gtknode; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4923 GtkTreePath *path; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4924 |
32350
cd46874707b1
Pidgin: Use the purple_blist_node_ accessor functions.
andrew.victor@mxit.com
parents:
32347
diff
changeset
|
4925 gtknode = purple_blist_node_get_ui_data(node); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4926 if (gtknode && gtknode->row) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4927 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4928 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
|
4929 gtk_tree_selection_select_path(sel, path); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4930 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
|
4931 gtk_tree_path_free(path); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4932 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4933 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4934 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4935 |
15822 | 4936 static void _prefs_change_sort_method(const char *pref_name, PurplePrefType type, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4937 gconstpointer val, gpointer data) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4938 { |
16062
07554cc5d090
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <stu@nosnilmot.com>
parents:
16010
diff
changeset
|
4939 if(!strcmp(pref_name, PIDGIN_PREFS_ROOT "/blist/sort_type")) |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
4940 pidgin_blist_sort_method_set(val); |
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
4941 } |
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
4942 |
21583
21cbdaf265f6
This fixes the problem where all accounts are disabled due to connection
Stu Tomlinson <stu@nosnilmot.com>
parents:
21582
diff
changeset
|
4943 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
|
4944 { |
21cbdaf265f6
This fixes the problem where all accounts are disabled due to connection
Stu Tomlinson <stu@nosnilmot.com>
parents:
21582
diff
changeset
|
4945 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
|
4946 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
|
4947 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
|
4948 PidginBuddyListPrivate *priv; |
21cbdaf265f6
This fixes the problem where all accounts are disabled due to connection
Stu Tomlinson <stu@nosnilmot.com>
parents:
21582
diff
changeset
|
4949 |
21cbdaf265f6
This fixes the problem where all accounts are disabled due to connection
Stu Tomlinson <stu@nosnilmot.com>
parents:
21582
diff
changeset
|
4950 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
|
4951 |
21cbdaf265f6
This fixes the problem where all accounts are disabled due to connection
Stu Tomlinson <stu@nosnilmot.com>
parents:
21582
diff
changeset
|
4952 /* 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
|
4953 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
|
4954 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
|
4955 } |
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
|
4956 if ((list = purple_accounts_get_all_active()) != NULL || errors) { |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4957 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
|
4958 g_list_free(list); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4959 } else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4960 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
|
4961 |
21583
21cbdaf265f6
This fixes the problem where all accounts are disabled due to connection
Stu Tomlinson <stu@nosnilmot.com>
parents:
21582
diff
changeset
|
4962 return FALSE; |
21cbdaf265f6
This fixes the problem where all accounts are disabled due to connection
Stu Tomlinson <stu@nosnilmot.com>
parents:
21582
diff
changeset
|
4963 } |
21cbdaf265f6
This fixes the problem where all accounts are disabled due to connection
Stu Tomlinson <stu@nosnilmot.com>
parents:
21582
diff
changeset
|
4964 |
21cbdaf265f6
This fixes the problem where all accounts are disabled due to connection
Stu Tomlinson <stu@nosnilmot.com>
parents:
21582
diff
changeset
|
4965 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
|
4966 { |
21cbdaf265f6
This fixes the problem where all accounts are disabled due to connection
Stu Tomlinson <stu@nosnilmot.com>
parents:
21582
diff
changeset
|
4967 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
|
4968 } |
21cbdaf265f6
This fixes the problem where all accounts are disabled due to connection
Stu Tomlinson <stu@nosnilmot.com>
parents:
21582
diff
changeset
|
4969 |
21cbdaf265f6
This fixes the problem where all accounts are disabled due to connection
Stu Tomlinson <stu@nosnilmot.com>
parents:
21582
diff
changeset
|
4970 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
|
4971 { |
21cbdaf265f6
This fixes the problem where all accounts are disabled due to connection
Stu Tomlinson <stu@nosnilmot.com>
parents:
21582
diff
changeset
|
4972 if (!gtkblist) |
21cbdaf265f6
This fixes the problem where all accounts are disabled due to connection
Stu Tomlinson <stu@nosnilmot.com>
parents:
21582
diff
changeset
|
4973 return; |
21cbdaf265f6
This fixes the problem where all accounts are disabled due to connection
Stu Tomlinson <stu@nosnilmot.com>
parents:
21582
diff
changeset
|
4974 |
21cbdaf265f6
This fixes the problem where all accounts are disabled due to connection
Stu Tomlinson <stu@nosnilmot.com>
parents:
21582
diff
changeset
|
4975 pidgin_blist_select_notebook_page(gtkblist); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4976 update_menu_bar(gtkblist); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4977 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4978 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4979 static void |
26694
83e6e710cbf3
Add a new signal which is emitted (after the account is connected) if the
Paul Aurich <paul@darkrain42.org>
parents:
26637
diff
changeset
|
4980 account_actions_changed(PurpleAccount *account, gpointer data) |
83e6e710cbf3
Add a new signal which is emitted (after the account is connected) if the
Paul Aurich <paul@darkrain42.org>
parents:
26637
diff
changeset
|
4981 { |
83e6e710cbf3
Add a new signal which is emitted (after the account is connected) if the
Paul Aurich <paul@darkrain42.org>
parents:
26637
diff
changeset
|
4982 pidgin_blist_update_accounts_menu(); |
83e6e710cbf3
Add a new signal which is emitted (after the account is connected) if the
Paul Aurich <paul@darkrain42.org>
parents:
26637
diff
changeset
|
4983 } |
83e6e710cbf3
Add a new signal which is emitted (after the account is connected) if the
Paul Aurich <paul@darkrain42.org>
parents:
26637
diff
changeset
|
4984 |
83e6e710cbf3
Add a new signal which is emitted (after the account is connected) if the
Paul Aurich <paul@darkrain42.org>
parents:
26637
diff
changeset
|
4985 static void |
15822 | 4986 account_status_changed(PurpleAccount *account, PurpleStatus *old, |
4987 PurpleStatus *new, PidginBuddyList *gtkblist) | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4988 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4989 if (!gtkblist) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4990 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4991 |
21583
21cbdaf265f6
This fixes the problem where all accounts are disabled due to connection
Stu Tomlinson <stu@nosnilmot.com>
parents:
21582
diff
changeset
|
4992 account_modified(account, gtkblist); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4993 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4994 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4995 static gboolean |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
4996 gtk_blist_window_key_press_cb(GtkWidget *w, GdkEventKey *event, PidginBuddyList *gtkblist) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4997 { |
17803
e83972691531
Fix #1284. "Pressing Ctrl+C while editing a buddy list alias shouldn't "Join a chat""
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
17750
diff
changeset
|
4998 GtkWidget *widget; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4999 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5000 if (!gtkblist) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5001 return FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5002 |
25469
33ceb2b708cf
Close the tooltip window on a keypress event. Fixes #8150.
Kosta Arvanitis <karvanitis@hotmail.com>
parents:
25442
diff
changeset
|
5003 /* clear any tooltips */ |
33ceb2b708cf
Close the tooltip window on a keypress event. Fixes #8150.
Kosta Arvanitis <karvanitis@hotmail.com>
parents:
25442
diff
changeset
|
5004 pidgin_blist_tooltip_destroy(); |
33ceb2b708cf
Close the tooltip window on a keypress event. Fixes #8150.
Kosta Arvanitis <karvanitis@hotmail.com>
parents:
25442
diff
changeset
|
5005 |
17803
e83972691531
Fix #1284. "Pressing Ctrl+C while editing a buddy list alias shouldn't "Join a chat""
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
17750
diff
changeset
|
5006 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:
17750
diff
changeset
|
5007 |
e83972691531
Fix #1284. "Pressing Ctrl+C while editing a buddy list alias shouldn't "Join a chat""
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
17750
diff
changeset
|
5008 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:
17750
diff
changeset
|
5009 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:
17750
diff
changeset
|
5010 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:
17750
diff
changeset
|
5011 } |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5012 return FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5013 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5014 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5015 static gboolean |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
5016 headline_box_enter_cb(GtkWidget *widget, GdkEventCrossing *event, PidginBuddyList *gtkblist) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5017 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5018 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
|
5019 return FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5020 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5021 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5022 static gboolean |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
5023 headline_box_leave_cb(GtkWidget *widget, GdkEventCrossing *event, PidginBuddyList *gtkblist) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5024 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5025 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
|
5026 return FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5027 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5028 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5029 static void |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
5030 reset_headline(PidginBuddyList *gtkblist) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5031 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5032 gtkblist->headline_callback = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5033 gtkblist->headline_data = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5034 gtkblist->headline_destroy = NULL; |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
5035 pidgin_set_urgent(GTK_WINDOW(gtkblist->window), FALSE); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5036 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5037 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5038 static gboolean |
22679
84dc71e67a72
Fix a null pointer deref (hopefully). I haven't been able to consistently
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22663
diff
changeset
|
5039 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:
22663
diff
changeset
|
5040 { |
84dc71e67a72
Fix a null pointer deref (hopefully). I haven't been able to consistently
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22663
diff
changeset
|
5041 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:
22663
diff
changeset
|
5042 ((GSourceFunc) gtkblist->headline_callback)(gtkblist->headline_data); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5043 reset_headline(gtkblist); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5044 return FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5045 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5046 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5047 static gboolean |
29615
97005a2e99d7
Use a small GtkButton instead of the custom "X" for close in various
Kosta Arvanitis <karvanitis@hotmail.com>
parents:
29591
diff
changeset
|
5048 headline_close_press_cb(GtkButton *button, PidginBuddyList *gtkblist) |
97005a2e99d7
Use a small GtkButton instead of the custom "X" for close in various
Kosta Arvanitis <karvanitis@hotmail.com>
parents:
29591
diff
changeset
|
5049 { |
97005a2e99d7
Use a small GtkButton instead of the custom "X" for close in various
Kosta Arvanitis <karvanitis@hotmail.com>
parents:
29591
diff
changeset
|
5050 gtk_widget_hide(gtkblist->headline_hbox); |
97005a2e99d7
Use a small GtkButton instead of the custom "X" for close in various
Kosta Arvanitis <karvanitis@hotmail.com>
parents:
29591
diff
changeset
|
5051 return FALSE; |
97005a2e99d7
Use a small GtkButton instead of the custom "X" for close in various
Kosta Arvanitis <karvanitis@hotmail.com>
parents:
29591
diff
changeset
|
5052 } |
97005a2e99d7
Use a small GtkButton instead of the custom "X" for close in various
Kosta Arvanitis <karvanitis@hotmail.com>
parents:
29591
diff
changeset
|
5053 |
97005a2e99d7
Use a small GtkButton instead of the custom "X" for close in various
Kosta Arvanitis <karvanitis@hotmail.com>
parents:
29591
diff
changeset
|
5054 static gboolean |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
5055 headline_box_press_cb(GtkWidget *widget, GdkEventButton *event, PidginBuddyList *gtkblist) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5056 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5057 gtk_widget_hide(gtkblist->headline_hbox); |
29615
97005a2e99d7
Use a small GtkButton instead of the custom "X" for close in various
Kosta Arvanitis <karvanitis@hotmail.com>
parents:
29591
diff
changeset
|
5058 if (gtkblist->headline_callback) |
22679
84dc71e67a72
Fix a null pointer deref (hopefully). I haven't been able to consistently
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22663
diff
changeset
|
5059 g_idle_add(headline_click_callback, NULL); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5060 else { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5061 if (gtkblist->headline_destroy) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5062 gtkblist->headline_destroy(gtkblist->headline_data); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5063 reset_headline(gtkblist); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5064 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5065 return TRUE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5066 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5067 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5068 /***********************************/ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5069 /* Connection error handling stuff */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5070 /***********************************/ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5071 |
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
|
5072 #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
|
5073 #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
|
5074 |
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
|
5075 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
|
5076 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
|
5077 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
|
5078 { |
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
|
5079 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
|
5080 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
|
5081 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
|
5082 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
|
5083 } |
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
|
5084 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5085 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
|
5086 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
|
5087 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
|
5088 { |
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
|
5089 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
|
5090 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
|
5091 |
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
|
5092 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
|
5093 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
|
5094 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
|
5095 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
|
5096 |
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
|
5097 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
|
5098 } |
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
|
5099 } |
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
|
5100 |
21401
c1c7e28223f8
Display all connection errors in a scrollbook, which is packed inside
Will Thompson <will.thompson@collabora.co.uk>
parents:
21400
diff
changeset
|
5101 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
|
5102 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
|
5103 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
|
5104 { |
c1c7e28223f8
Display all connection errors in a scrollbook, which is packed inside
Will Thompson <will.thompson@collabora.co.uk>
parents:
21400
diff
changeset
|
5105 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
|
5106 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
|
5107 } |
c1c7e28223f8
Display all connection errors in a scrollbook, which is packed inside
Will Thompson <will.thompson@collabora.co.uk>
parents:
21400
diff
changeset
|
5108 |
21410
4ccc4ad0a8b0
Use PidginMiniDialog to display signed in elsewhere errors in the blist.
Will Thompson <will.thompson@collabora.co.uk>
parents:
21401
diff
changeset
|
5109 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
|
5110 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
|
5111 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
|
5112 { |
c1c7e28223f8
Display all connection errors in a scrollbook, which is packed inside
Will Thompson <will.thompson@collabora.co.uk>
parents:
21400
diff
changeset
|
5113 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
|
5114 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
|
5115 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
|
5116 /* 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
|
5117 if (PIDGIN_IS_SCROLL_BOOK(container)) |
21622
1c139f0493b9
Squish a compile warning
Stu Tomlinson <stu@nosnilmot.com>
parents:
21618
diff
changeset
|
5118 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
|
5119 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
|
5120 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
|
5121 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
|
5122 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
|
5123 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
|
5124 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
|
5125 } |
4ccc4ad0a8b0
Use PidginMiniDialog to display signed in elsewhere errors in the blist.
Will Thompson <will.thompson@collabora.co.uk>
parents:
21401
diff
changeset
|
5126 |
4ccc4ad0a8b0
Use PidginMiniDialog to display signed in elsewhere errors in the blist.
Will Thompson <will.thompson@collabora.co.uk>
parents:
21401
diff
changeset
|
5127 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
|
5128 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
|
5129 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
|
5130 { |
4ccc4ad0a8b0
Use PidginMiniDialog to display signed in elsewhere errors in the blist.
Will Thompson <will.thompson@collabora.co.uk>
parents:
21401
diff
changeset
|
5131 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
|
5132 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
|
5133 /* 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
|
5134 * 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
|
5135 */ |
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
|
5136 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
|
5137 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
|
5138 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
|
5139 } |
21401
c1c7e28223f8
Display all connection errors in a scrollbook, which is packed inside
Will Thompson <will.thompson@collabora.co.uk>
parents:
21400
diff
changeset
|
5140 } |
c1c7e28223f8
Display all connection errors in a scrollbook, which is packed inside
Will Thompson <will.thompson@collabora.co.uk>
parents:
21400
diff
changeset
|
5141 |
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
|
5142 /* 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
|
5143 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5144 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
|
5145 generic_error_modify_cb(PurpleAccount *account) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5146 { |
21583
21cbdaf265f6
This fixes the problem where all accounts are disabled due to connection
Stu Tomlinson <stu@nosnilmot.com>
parents:
21582
diff
changeset
|
5147 purple_account_clear_current_error(account); |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
5148 pidgin_account_dialog_show(PIDGIN_MODIFY_ACCOUNT_DIALOG, account); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5149 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5150 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5151 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
|
5152 generic_error_enable_cb(PurpleAccount *account) |
15822 | 5153 { |
21583
21cbdaf265f6
This fixes the problem where all accounts are disabled due to connection
Stu Tomlinson <stu@nosnilmot.com>
parents:
21582
diff
changeset
|
5154 purple_account_clear_current_error(account); |
15822 | 5155 purple_account_set_enabled(account, purple_core_get_ui(), TRUE); |
15373
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 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5158 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
|
5159 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
|
5160 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
|
5161 { |
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
|
5162 /* 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
|
5163 * 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
|
5164 * 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
|
5165 */ |
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
|
5166 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
|
5167 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
|
5168 } |
a62b60a5745d
* When an account error changes, just recreate its button rather than every
Will Thompson <will.thompson@collabora.co.uk>
parents:
21378
diff
changeset
|
5169 |
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
|
5170 #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
|
5171 |
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
|
5172 static void |
25982
c0115655a94e
I have no idea how we've gone nearly 16 months with no one noticing that the
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
25966
diff
changeset
|
5173 ssl_faq_clicked_cb(PidginMiniDialog *mini_dialog, |
c0115655a94e
I have no idea how we've gone nearly 16 months with no one noticing that the
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
25966
diff
changeset
|
5174 GtkButton *button, |
c0115655a94e
I have no idea how we've gone nearly 16 months with no one noticing that the
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
25966
diff
changeset
|
5175 gpointer ignored) |
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
|
5176 { |
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
|
5177 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
|
5178 } |
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
|
5179 |
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
|
5180 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
|
5181 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
|
5182 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
|
5183 { |
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
|
5184 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
|
5185 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
|
5186 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
|
5187 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
|
5188 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
|
5189 |
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
|
5190 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
|
5191 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
|
5192 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
|
5193 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
|
5194 |
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
|
5195 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
|
5196 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
|
5197 (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
|
5198 (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
|
5199 : 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
|
5200 _("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
|
5201 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
|
5202 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5203 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
|
5204 |
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
|
5205 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
|
5206 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
|
5207 |
25982
c0115655a94e
I have no idea how we've gone nearly 16 months with no one noticing that the
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
25966
diff
changeset
|
5208 if(err->type == PURPLE_CONNECTION_ERROR_NO_SSL_SUPPORT) |
31443
1551c9a140fd
Finally merged the code that fixes #5038 to i.p.p.
ivan.komarov@pidgin.im
parents:
31402
diff
changeset
|
5209 pidgin_mini_dialog_add_non_closing_button(PIDGIN_MINI_DIALOG(mini_dialog), |
25982
c0115655a94e
I have no idea how we've gone nearly 16 months with no one noticing that the
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
25966
diff
changeset
|
5210 _("SSL FAQs"), ssl_faq_clicked_cb, NULL); |
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
|
5211 |
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
|
5212 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
|
5213 (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
|
5214 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
|
5215 |
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
|
5216 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
|
5217 } |
a62b60a5745d
* When an account error changes, just recreate its button rather than every
Will Thompson <will.thompson@collabora.co.uk>
parents:
21378
diff
changeset
|
5218 |
21373
cbf197042bad
Add the old error to the account-error-changed signal.
Will Thompson <will.thompson@collabora.co.uk>
parents:
21369
diff
changeset
|
5219 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
|
5220 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
|
5221 { |
21401
c1c7e28223f8
Display all connection errors in a scrollbook, which is packed inside
Will Thompson <will.thompson@collabora.co.uk>
parents:
21400
diff
changeset
|
5222 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
|
5223 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
|
5224 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
|
5225 } |
5c26dc790c71
Break creating and removing generic error boxes by account into their own
Will Thompson <will.thompson@collabora.co.uk>
parents:
21382
diff
changeset
|
5226 |
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
|
5227 |
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
|
5228 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
|
5229 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
|
5230 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
|
5231 { |
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
|
5232 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
|
5233 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
|
5234 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
|
5235 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
|
5236 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
|
5237 } |
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
|
5238 |
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
|
5239 |
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
|
5240 /* 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
|
5241 * 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
|
5242 */ |
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
|
5243 |
21410
4ccc4ad0a8b0
Use PidginMiniDialog to display signed in elsewhere errors in the blist.
Will Thompson <will.thompson@collabora.co.uk>
parents:
21401
diff
changeset
|
5244 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
|
5245 |
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
|
5246 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
|
5247 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
|
5248 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
|
5249 { |
4ccc4ad0a8b0
Use PidginMiniDialog to display signed in elsewhere errors in the blist.
Will Thompson <will.thompson@collabora.co.uk>
parents:
21401
diff
changeset
|
5250 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
|
5251 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
|
5252 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
|
5253 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
|
5254 |
4ccc4ad0a8b0
Use PidginMiniDialog to display signed in elsewhere errors in the blist.
Will Thompson <will.thompson@collabora.co.uk>
parents:
21401
diff
changeset
|
5255 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
|
5256 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
|
5257 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
|
5258 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
|
5259 else |
4ccc4ad0a8b0
Use PidginMiniDialog to display signed in elsewhere errors in the blist.
Will Thompson <will.thompson@collabora.co.uk>
parents:
21401
diff
changeset
|
5260 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
|
5261 "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
|
5262 } |
4ccc4ad0a8b0
Use PidginMiniDialog to display signed in elsewhere errors in the blist.
Will Thompson <will.thompson@collabora.co.uk>
parents:
21401
diff
changeset
|
5263 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
|
5264 } |
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
|
5265 |
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
|
5266 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
|
5267 enable_account(PurpleAccount *account) |
15822 | 5268 { |
5269 purple_account_set_enabled(account, purple_core_get_ui(), TRUE); | |
15373
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 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5272 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
|
5273 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
|
5274 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
|
5275 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
|
5276 { |
4ccc4ad0a8b0
Use PidginMiniDialog to display signed in elsewhere errors in the blist.
Will Thompson <will.thompson@collabora.co.uk>
parents:
21401
diff
changeset
|
5277 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
|
5278 } |
4ccc4ad0a8b0
Use PidginMiniDialog to display signed in elsewhere errors in the blist.
Will Thompson <will.thompson@collabora.co.uk>
parents:
21401
diff
changeset
|
5279 |
4ccc4ad0a8b0
Use PidginMiniDialog to display signed in elsewhere errors in the blist.
Will Thompson <will.thompson@collabora.co.uk>
parents:
21401
diff
changeset
|
5280 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
|
5281 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
|
5282 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
|
5283 { |
45d1e229fadd
Dismissing the signed on elsewhere minidialog should clear all the errors;
Will Thompson <will.thompson@collabora.co.uk>
parents:
21781
diff
changeset
|
5284 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
|
5285 } |
45d1e229fadd
Dismissing the signed on elsewhere minidialog should clear all the errors;
Will Thompson <will.thompson@collabora.co.uk>
parents:
21781
diff
changeset
|
5286 |
45d1e229fadd
Dismissing the signed on elsewhere minidialog should clear all the errors;
Will Thompson <will.thompson@collabora.co.uk>
parents:
21781
diff
changeset
|
5287 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
|
5288 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
|
5289 { |
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
|
5290 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
|
5291 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
|
5292 |
4ccc4ad0a8b0
Use PidginMiniDialog to display signed in elsewhere errors in the blist.
Will Thompson <will.thompson@collabora.co.uk>
parents:
21401
diff
changeset
|
5293 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
|
5294 return; |
21618
85fc97ffe538
Workarounds to fix some issues with the minidialog and scrollbook.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21583
diff
changeset
|
5295 |
21410
4ccc4ad0a8b0
Use PidginMiniDialog to display signed in elsewhere errors in the blist.
Will Thompson <will.thompson@collabora.co.uk>
parents:
21401
diff
changeset
|
5296 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
|
5297 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
|
5298 |
4ccc4ad0a8b0
Use PidginMiniDialog to display signed in elsewhere errors in the blist.
Will Thompson <will.thompson@collabora.co.uk>
parents:
21401
diff
changeset
|
5299 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
|
5300 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
|
5301 |
21845
45d1e229fadd
Dismissing the signed on elsewhere minidialog should clear all the errors;
Will Thompson <will.thompson@collabora.co.uk>
parents:
21781
diff
changeset
|
5302 /* 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
|
5303 * 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
|
5304 */ |
45d1e229fadd
Dismissing the signed on elsewhere minidialog should clear all the errors;
Will Thompson <will.thompson@collabora.co.uk>
parents:
21781
diff
changeset
|
5305 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
|
5306 (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
|
5307 |
21410
4ccc4ad0a8b0
Use PidginMiniDialog to display signed in elsewhere errors in the blist.
Will Thompson <will.thompson@collabora.co.uk>
parents:
21401
diff
changeset
|
5308 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
|
5309 |
b089fd1ad059
Hide the description label of the PidginMiniDialog used for signed on elsewhere
Will Thompson <will.thompson@collabora.co.uk>
parents:
21410
diff
changeset
|
5310 /* 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
|
5311 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
|
5312 (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
|
5313 } |
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
|
5314 |
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
|
5315 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
|
5316 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
|
5317 { |
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
|
5318 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
|
5319 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
|
5320 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
|
5321 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
|
5322 |
4ccc4ad0a8b0
Use PidginMiniDialog to display signed in elsewhere errors in the blist.
Will Thompson <will.thompson@collabora.co.uk>
parents:
21401
diff
changeset
|
5323 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
|
5324 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
|
5325 |
4ccc4ad0a8b0
Use PidginMiniDialog to display signed in elsewhere errors in the blist.
Will Thompson <will.thompson@collabora.co.uk>
parents:
21401
diff
changeset
|
5326 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
|
5327 if (accounts == 0) { |
85fc97ffe538
Workarounds to fix some issues with the minidialog and scrollbook.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21583
diff
changeset
|
5328 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
|
5329 return; |
85fc97ffe538
Workarounds to fix some issues with the minidialog and scrollbook.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21583
diff
changeset
|
5330 } |
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
|
5331 |
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
|
5332 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
|
5333 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
|
5334 "%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
|
5335 accounts), |
4ccc4ad0a8b0
Use PidginMiniDialog to display signed in elsewhere errors in the blist.
Will Thompson <will.thompson@collabora.co.uk>
parents:
21401
diff
changeset
|
5336 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
|
5337 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
|
5338 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
|
5339 } |
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
|
5340 |
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
|
5341 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
|
5342 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
|
5343 { |
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
|
5344 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
|
5345 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
|
5346 char *markup; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5347 |
17033
c28f4593f723
Pack connection error buttons the same way the statusbox is. Fixes #120
Sean Egan <seanegan@gmail.com>
parents:
17031
diff
changeset
|
5348 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
|
5349 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
|
5350 |
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
|
5351 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
|
5352 |
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
|
5353 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
|
5354 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
|
5355 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
|
5356 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
|
5357 gtk_misc_set_alignment(GTK_MISC(label), 0, 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
|
5358 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
|
5359 #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
|
5360 { /* 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
|
5361 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
|
5362 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
|
5363 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
|
5364 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
|
5365 } |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5366 #endif |
17033
c28f4593f723
Pack connection error buttons the same way the statusbox is. Fixes #120
Sean Egan <seanegan@gmail.com>
parents:
17031
diff
changeset
|
5367 gtk_box_pack_start(GTK_BOX(hbox), label, TRUE, TRUE, 0); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5368 |
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
|
5369 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
|
5370 } |
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
|
5371 |
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
|
5372 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
|
5373 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
|
5374 { |
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
|
5375 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
|
5376 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
|
5377 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
|
5378 |
4ccc4ad0a8b0
Use PidginMiniDialog to display signed in elsewhere errors in the blist.
Will Thompson <will.thompson@collabora.co.uk>
parents:
21401
diff
changeset
|
5379 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
|
5380 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
|
5381 |
4ccc4ad0a8b0
Use PidginMiniDialog to display signed in elsewhere errors in the blist.
Will Thompson <will.thompson@collabora.co.uk>
parents:
21401
diff
changeset
|
5382 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
|
5383 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
|
5384 |
21410
4ccc4ad0a8b0
Use PidginMiniDialog to display signed in elsewhere errors in the blist.
Will Thompson <will.thompson@collabora.co.uk>
parents:
21401
diff
changeset
|
5385 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
|
5386 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
|
5387 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
|
5388 |
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
|
5389 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
|
5390 } |
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
|
5391 |
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
|
5392 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
|
5393 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
|
5394 { |
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
|
5395 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
|
5396 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
|
5397 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
|
5398 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
|
5399 |
21410
4ccc4ad0a8b0
Use PidginMiniDialog to display signed in elsewhere errors in the blist.
Will Thompson <will.thompson@collabora.co.uk>
parents:
21401
diff
changeset
|
5400 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
|
5401 |
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
|
5402 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
|
5403 } |
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
|
5404 |
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
|
5405 |
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
|
5406 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
|
5407 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
|
5408 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
|
5409 { |
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
|
5410 #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
|
5411 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
|
5412 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
|
5413 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
|
5414 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
|
5415 #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
|
5416 } |
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
|
5417 |
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
|
5418 |
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
|
5419 /* 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
|
5420 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
|
5421 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
|
5422 const PurpleConnectionErrorInfo *old, |
c1033e943d2a
The two PurpleConnectionErrorInfo parameters are meant to be const.
Will Thompson <will.thompson@collabora.co.uk>
parents:
21377
diff
changeset
|
5423 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
|
5424 PidginBuddyList *gtkblist) |
cbf197042bad
Add the old error to the account-error-changed signal.
Will Thompson <will.thompson@collabora.co.uk>
parents:
21369
diff
changeset
|
5425 { |
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
|
5426 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
|
5427 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
|
5428 |
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
|
5429 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
|
5430 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
|
5431 |
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
|
5432 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
|
5433 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
|
5434 |
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
|
5435 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
|
5436 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
|
5437 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
|
5438 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
|
5439 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
|
5440 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
|
5441 } |
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
|
5442 |
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
|
5443 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
|
5444 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
|
5445 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
|
5446 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
|
5447 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
|
5448 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
|
5449 } |
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
|
5450 |
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
|
5451 /* 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
|
5452 |
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
|
5453 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
|
5454 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
|
5455 |
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
|
5456 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
|
5457 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
|
5458 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
|
5459 && 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
|
5460 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
|
5461 } 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
|
5462 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
|
5463 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
|
5464 } |
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
|
5465 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
|
5466 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
|
5467 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
|
5468 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
|
5469 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
|
5470 } 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
|
5471 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
|
5472 } |
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
|
5473 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
|
5474 } |
21369
318b3f5d1516
Call pidgin_blist_update_account_error_state in response to
Will Thompson <will.thompson@collabora.co.uk>
parents:
21368
diff
changeset
|
5475 } |
318b3f5d1516
Call pidgin_blist_update_account_error_state in response to
Will Thompson <will.thompson@collabora.co.uk>
parents:
21368
diff
changeset
|
5476 |
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
|
5477 /* 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
|
5478 * 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
|
5479 * 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
|
5480 */ |
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
|
5481 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
|
5482 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
|
5483 { |
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
|
5484 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
|
5485 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
|
5486 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
|
5487 |
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
|
5488 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
|
5489 { |
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
|
5490 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
|
5491 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
|
5492 |
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
|
5493 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
|
5494 } |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5495 } |
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 static gboolean |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5498 paint_headline_hbox (GtkWidget *widget, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5499 GdkEventExpose *event, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5500 gpointer user_data) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5501 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5502 gtk_paint_flat_box (widget->style, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5503 widget->window, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5504 GTK_STATE_NORMAL, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5505 GTK_SHADOW_OUT, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5506 NULL, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5507 widget, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5508 "tooltip", |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5509 widget->allocation.x + 1, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5510 widget->allocation.y + 1, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5511 widget->allocation.width - 2, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5512 widget->allocation.height - 2); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5513 return FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5514 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5515 |
15557
0324f69112f9
Make group background colors update when the theme changes.
Sean Egan <seanegan@gmail.com>
parents:
15552
diff
changeset
|
5516 /* 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:
15552
diff
changeset
|
5517 * 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:
15552
diff
changeset
|
5518 */ |
0324f69112f9
Make group background colors update when the theme changes.
Sean Egan <seanegan@gmail.com>
parents:
15552
diff
changeset
|
5519 static void |
0324f69112f9
Make group background colors update when the theme changes.
Sean Egan <seanegan@gmail.com>
parents:
15552
diff
changeset
|
5520 treeview_style_set (GtkWidget *widget, |
0324f69112f9
Make group background colors update when the theme changes.
Sean Egan <seanegan@gmail.com>
parents:
15552
diff
changeset
|
5521 GtkStyle *prev_style, |
0324f69112f9
Make group background colors update when the theme changes.
Sean Egan <seanegan@gmail.com>
parents:
15552
diff
changeset
|
5522 gpointer data) |
0324f69112f9
Make group background colors update when the theme changes.
Sean Egan <seanegan@gmail.com>
parents:
15552
diff
changeset
|
5523 { |
15822 | 5524 PurpleBuddyList *list = data; |
5525 PurpleBlistNode *node = list->root; | |
15557
0324f69112f9
Make group background colors update when the theme changes.
Sean Egan <seanegan@gmail.com>
parents:
15552
diff
changeset
|
5526 while (node) { |
0324f69112f9
Make group background colors update when the theme changes.
Sean Egan <seanegan@gmail.com>
parents:
15552
diff
changeset
|
5527 pidgin_blist_update_group(list, node); |
0324f69112f9
Make group background colors update when the theme changes.
Sean Egan <seanegan@gmail.com>
parents:
15552
diff
changeset
|
5528 node = node->next; |
0324f69112f9
Make group background colors update when the theme changes.
Sean Egan <seanegan@gmail.com>
parents:
15552
diff
changeset
|
5529 } |
0324f69112f9
Make group background colors update when the theme changes.
Sean Egan <seanegan@gmail.com>
parents:
15552
diff
changeset
|
5530 } |
0324f69112f9
Make group background colors update when the theme changes.
Sean Egan <seanegan@gmail.com>
parents:
15552
diff
changeset
|
5531 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5532 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5533 headline_style_set (GtkWidget *widget, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5534 GtkStyle *prev_style) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5535 { |
32579
38e3ec8251d3
If gedit can do it, then so can we!
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32578
diff
changeset
|
5536 GtkStyle *style; |
32566
e84bdaa9d227
Replace GtkTooltips code with GtkTooltip on GTK+ 2.12+.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26397
diff
changeset
|
5537 #if GTK_CHECK_VERSION(2,12,0) |
32579
38e3ec8251d3
If gedit can do it, then so can we!
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32578
diff
changeset
|
5538 GtkWidget *window; |
38e3ec8251d3
If gedit can do it, then so can we!
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32578
diff
changeset
|
5539 |
38e3ec8251d3
If gedit can do it, then so can we!
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32578
diff
changeset
|
5540 if (gtkblist->changing_style) |
38e3ec8251d3
If gedit can do it, then so can we!
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32578
diff
changeset
|
5541 return; |
38e3ec8251d3
If gedit can do it, then so can we!
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32578
diff
changeset
|
5542 |
38e3ec8251d3
If gedit can do it, then so can we!
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32578
diff
changeset
|
5543 /* This is a hack needed to use the tooltip background colour */ |
38e3ec8251d3
If gedit can do it, then so can we!
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32578
diff
changeset
|
5544 window = gtk_window_new(GTK_WINDOW_POPUP); |
38e3ec8251d3
If gedit can do it, then so can we!
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32578
diff
changeset
|
5545 gtk_widget_set_name(window, "gtk-tooltip"); |
38e3ec8251d3
If gedit can do it, then so can we!
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32578
diff
changeset
|
5546 gtk_widget_ensure_style(window); |
38e3ec8251d3
If gedit can do it, then so can we!
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32578
diff
changeset
|
5547 style = gtk_widget_get_style(window); |
38e3ec8251d3
If gedit can do it, then so can we!
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32578
diff
changeset
|
5548 |
38e3ec8251d3
If gedit can do it, then so can we!
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32578
diff
changeset
|
5549 gtkblist->changing_style = TRUE; |
38e3ec8251d3
If gedit can do it, then so can we!
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32578
diff
changeset
|
5550 gtk_widget_set_style(gtkblist->headline_hbox, style); |
38e3ec8251d3
If gedit can do it, then so can we!
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32578
diff
changeset
|
5551 gtkblist->changing_style = FALSE; |
38e3ec8251d3
If gedit can do it, then so can we!
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32578
diff
changeset
|
5552 |
38e3ec8251d3
If gedit can do it, then so can we!
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32578
diff
changeset
|
5553 gtk_widget_destroy(window); |
38e3ec8251d3
If gedit can do it, then so can we!
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32578
diff
changeset
|
5554 |
38e3ec8251d3
If gedit can do it, then so can we!
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32578
diff
changeset
|
5555 gtk_widget_queue_draw(gtkblist->headline_hbox); |
32566
e84bdaa9d227
Replace GtkTooltips code with GtkTooltip on GTK+ 2.12+.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26397
diff
changeset
|
5556 #else |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5557 GtkTooltips *tooltips; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5558 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5559 if (gtkblist->changing_style) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5560 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5561 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5562 tooltips = gtk_tooltips_new (); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5563 g_object_ref_sink (tooltips); |
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 gtk_tooltips_force_window (tooltips); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5566 gtk_widget_ensure_style (tooltips->tip_window); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5567 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
|
5568 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5569 gtkblist->changing_style = TRUE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5570 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
|
5571 gtkblist->changing_style = FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5572 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5573 g_object_unref (tooltips); |
32566
e84bdaa9d227
Replace GtkTooltips code with GtkTooltip on GTK+ 2.12+.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26397
diff
changeset
|
5574 #endif |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5575 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5576 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5577 /******************************************/ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5578 /* End of connection error handling stuff */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5579 /******************************************/ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5580 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5581 static int |
22850
5d833ca5a265
Make pidgin_blist_toggle_visibility() hide the buddy list when it is
Casey Harkins <charkins@pidgin.im>
parents:
22813
diff
changeset
|
5582 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:
22813
diff
changeset
|
5583 { |
5d833ca5a265
Make pidgin_blist_toggle_visibility() hide the buddy list when it is
Casey Harkins <charkins@pidgin.im>
parents:
22813
diff
changeset
|
5584 if(event->in) { |
5d833ca5a265
Make pidgin_blist_toggle_visibility() hide the buddy list when it is
Casey Harkins <charkins@pidgin.im>
parents:
22813
diff
changeset
|
5585 gtk_blist_focused = TRUE; |
5d833ca5a265
Make pidgin_blist_toggle_visibility() hide the buddy list when it is
Casey Harkins <charkins@pidgin.im>
parents:
22813
diff
changeset
|
5586 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:
22813
diff
changeset
|
5587 } else { |
5d833ca5a265
Make pidgin_blist_toggle_visibility() hide the buddy list when it is
Casey Harkins <charkins@pidgin.im>
parents:
22813
diff
changeset
|
5588 gtk_blist_focused = FALSE; |
5d833ca5a265
Make pidgin_blist_toggle_visibility() hide the buddy list when it is
Casey Harkins <charkins@pidgin.im>
parents:
22813
diff
changeset
|
5589 } |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5590 return 0; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5591 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5592 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5593 #if 0 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5594 static GtkWidget * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5595 kiosk_page() |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5596 { |
15820 | 5597 GtkWidget *ret = gtk_vbox_new(FALSE, PIDGIN_HIG_BOX_SPACE); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5598 GtkWidget *label; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5599 GtkWidget *entry; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5600 GtkWidget *bbox; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5601 GtkWidget *button; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5602 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5603 label = gtk_label_new(NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5604 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
|
5605 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5606 label = gtk_label_new(NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5607 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
|
5608 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
|
5609 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
|
5610 entry = gtk_entry_new(); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5611 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
|
5612 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5613 label = gtk_label_new(NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5614 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
|
5615 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
|
5616 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
|
5617 entry = gtk_entry_new(); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5618 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
|
5619 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
|
5620 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5621 label = gtk_label_new(" "); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5622 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
|
5623 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5624 bbox = gtk_hbutton_box_new(); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5625 button = gtk_button_new_with_mnemonic(_("_Login")); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5626 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
|
5627 gtk_container_add(GTK_CONTAINER(bbox), button); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5628 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5629 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5630 label = gtk_label_new(NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5631 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
|
5632 |
15820 | 5633 gtk_container_set_border_width(GTK_CONTAINER(ret), PIDGIN_HIG_BORDER); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5634 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5635 gtk_widget_show_all(ret); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5636 return ret; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5637 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5638 #endif |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5639 |
25106
d17d6e83f428
Added layout capabilities to blist themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25105
diff
changeset
|
5640 /* builds the blist layout according to to the current theme */ |
d17d6e83f428
Added layout capabilities to blist themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25105
diff
changeset
|
5641 static void |
d17d6e83f428
Added layout capabilities to blist themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25105
diff
changeset
|
5642 pidgin_blist_build_layout(PurpleBuddyList *list) |
d17d6e83f428
Added layout capabilities to blist themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25105
diff
changeset
|
5643 { |
d17d6e83f428
Added layout capabilities to blist themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25105
diff
changeset
|
5644 GtkTreeViewColumn *column; |
d17d6e83f428
Added layout capabilities to blist themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25105
diff
changeset
|
5645 PidginBlistLayout *layout; |
d17d6e83f428
Added layout capabilities to blist themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25105
diff
changeset
|
5646 PidginBlistTheme *theme; |
d17d6e83f428
Added layout capabilities to blist themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25105
diff
changeset
|
5647 GtkCellRenderer *rend; |
25108
06392c8252c0
Added text and font coloring for buddies, contacts and chats, as well as fix a few small bugs
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25107
diff
changeset
|
5648 gint i, status_icon = 0, text = 1, emblem = 2, protocol_icon = 3, buddy_icon = 4; |
25924
584063555949
Remove trailing whitespace
Mark Doliner <mark@kingant.net>
parents:
25920
diff
changeset
|
5649 |
25106
d17d6e83f428
Added layout capabilities to blist themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25105
diff
changeset
|
5650 |
d17d6e83f428
Added layout capabilities to blist themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25105
diff
changeset
|
5651 column = gtkblist->text_column; |
d17d6e83f428
Added layout capabilities to blist themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25105
diff
changeset
|
5652 |
25108
06392c8252c0
Added text and font coloring for buddies, contacts and chats, as well as fix a few small bugs
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25107
diff
changeset
|
5653 if ((theme = pidgin_blist_get_theme()) != NULL && (layout = pidgin_blist_theme_get_layout(theme)) != NULL) { |
25924
584063555949
Remove trailing whitespace
Mark Doliner <mark@kingant.net>
parents:
25920
diff
changeset
|
5654 status_icon = layout->status_icon ; |
25108
06392c8252c0
Added text and font coloring for buddies, contacts and chats, as well as fix a few small bugs
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25107
diff
changeset
|
5655 text = layout->text; |
06392c8252c0
Added text and font coloring for buddies, contacts and chats, as well as fix a few small bugs
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25107
diff
changeset
|
5656 emblem = layout->emblem; |
06392c8252c0
Added text and font coloring for buddies, contacts and chats, as well as fix a few small bugs
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25107
diff
changeset
|
5657 protocol_icon = layout->protocol_icon; |
06392c8252c0
Added text and font coloring for buddies, contacts and chats, as well as fix a few small bugs
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25107
diff
changeset
|
5658 buddy_icon = layout->buddy_icon; |
25106
d17d6e83f428
Added layout capabilities to blist themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25105
diff
changeset
|
5659 } |
d17d6e83f428
Added layout capabilities to blist themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25105
diff
changeset
|
5660 |
d17d6e83f428
Added layout capabilities to blist themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25105
diff
changeset
|
5661 gtk_tree_view_column_clear(column); |
d17d6e83f428
Added layout capabilities to blist themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25105
diff
changeset
|
5662 |
d17d6e83f428
Added layout capabilities to blist themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25105
diff
changeset
|
5663 /* group */ |
d17d6e83f428
Added layout capabilities to blist themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25105
diff
changeset
|
5664 rend = pidgin_cell_renderer_expander_new(); |
d17d6e83f428
Added layout capabilities to blist themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25105
diff
changeset
|
5665 gtk_tree_view_column_pack_start(column, rend, FALSE); |
d17d6e83f428
Added layout capabilities to blist themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25105
diff
changeset
|
5666 gtk_tree_view_column_set_attributes(column, rend, |
d17d6e83f428
Added layout capabilities to blist themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25105
diff
changeset
|
5667 "visible", GROUP_EXPANDER_VISIBLE_COLUMN, |
d17d6e83f428
Added layout capabilities to blist themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25105
diff
changeset
|
5668 "expander-visible", GROUP_EXPANDER_COLUMN, |
d17d6e83f428
Added layout capabilities to blist themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25105
diff
changeset
|
5669 "sensitive", GROUP_EXPANDER_COLUMN, |
d17d6e83f428
Added layout capabilities to blist themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25105
diff
changeset
|
5670 "cell-background-gdk", BGCOLOR_COLUMN, |
d17d6e83f428
Added layout capabilities to blist themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25105
diff
changeset
|
5671 NULL); |
d17d6e83f428
Added layout capabilities to blist themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25105
diff
changeset
|
5672 |
d17d6e83f428
Added layout capabilities to blist themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25105
diff
changeset
|
5673 /* contact */ |
d17d6e83f428
Added layout capabilities to blist themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25105
diff
changeset
|
5674 rend = pidgin_cell_renderer_expander_new(); |
d17d6e83f428
Added layout capabilities to blist themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25105
diff
changeset
|
5675 gtk_tree_view_column_pack_start(column, rend, FALSE); |
d17d6e83f428
Added layout capabilities to blist themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25105
diff
changeset
|
5676 gtk_tree_view_column_set_attributes(column, rend, |
25108
06392c8252c0
Added text and font coloring for buddies, contacts and chats, as well as fix a few small bugs
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25107
diff
changeset
|
5677 "visible", CONTACT_EXPANDER_VISIBLE_COLUMN, |
25106
d17d6e83f428
Added layout capabilities to blist themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25105
diff
changeset
|
5678 "expander-visible", CONTACT_EXPANDER_COLUMN, |
d17d6e83f428
Added layout capabilities to blist themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25105
diff
changeset
|
5679 "sensitive", CONTACT_EXPANDER_COLUMN, |
d17d6e83f428
Added layout capabilities to blist themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25105
diff
changeset
|
5680 "cell-background-gdk", BGCOLOR_COLUMN, |
d17d6e83f428
Added layout capabilities to blist themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25105
diff
changeset
|
5681 NULL); |
d17d6e83f428
Added layout capabilities to blist themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25105
diff
changeset
|
5682 |
d17d6e83f428
Added layout capabilities to blist themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25105
diff
changeset
|
5683 for (i = 0; i < 5; i++) { |
d17d6e83f428
Added layout capabilities to blist themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25105
diff
changeset
|
5684 |
25924
584063555949
Remove trailing whitespace
Mark Doliner <mark@kingant.net>
parents:
25920
diff
changeset
|
5685 if (status_icon == i) { |
25106
d17d6e83f428
Added layout capabilities to blist themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25105
diff
changeset
|
5686 /* status icons */ |
d17d6e83f428
Added layout capabilities to blist themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25105
diff
changeset
|
5687 rend = gtk_cell_renderer_pixbuf_new(); |
d17d6e83f428
Added layout capabilities to blist themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25105
diff
changeset
|
5688 gtk_tree_view_column_pack_start(column, rend, FALSE); |
d17d6e83f428
Added layout capabilities to blist themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25105
diff
changeset
|
5689 gtk_tree_view_column_set_attributes(column, rend, |
d17d6e83f428
Added layout capabilities to blist themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25105
diff
changeset
|
5690 "pixbuf", STATUS_ICON_COLUMN, |
d17d6e83f428
Added layout capabilities to blist themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25105
diff
changeset
|
5691 "visible", STATUS_ICON_VISIBLE_COLUMN, |
d17d6e83f428
Added layout capabilities to blist themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25105
diff
changeset
|
5692 "cell-background-gdk", BGCOLOR_COLUMN, |
d17d6e83f428
Added layout capabilities to blist themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25105
diff
changeset
|
5693 NULL); |
d17d6e83f428
Added layout capabilities to blist themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25105
diff
changeset
|
5694 g_object_set(rend, "xalign", 0.0, "xpad", 6, "ypad", 0, NULL); |
d17d6e83f428
Added layout capabilities to blist themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25105
diff
changeset
|
5695 |
25108
06392c8252c0
Added text and font coloring for buddies, contacts and chats, as well as fix a few small bugs
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25107
diff
changeset
|
5696 } else if (text == i) { |
25106
d17d6e83f428
Added layout capabilities to blist themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25105
diff
changeset
|
5697 /* name */ |
d17d6e83f428
Added layout capabilities to blist themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25105
diff
changeset
|
5698 gtkblist->text_rend = rend = gtk_cell_renderer_text_new(); |
25123
1a4417138a8f
clean up formatting, and added render settings for the names/markup on the blist
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25120
diff
changeset
|
5699 gtk_tree_view_column_pack_start(column, rend, TRUE); |
25106
d17d6e83f428
Added layout capabilities to blist themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25105
diff
changeset
|
5700 gtk_tree_view_column_set_attributes(column, rend, |
d17d6e83f428
Added layout capabilities to blist themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25105
diff
changeset
|
5701 "cell-background-gdk", BGCOLOR_COLUMN, |
d17d6e83f428
Added layout capabilities to blist themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25105
diff
changeset
|
5702 "markup", NAME_COLUMN, |
d17d6e83f428
Added layout capabilities to blist themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25105
diff
changeset
|
5703 NULL); |
d17d6e83f428
Added layout capabilities to blist themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25105
diff
changeset
|
5704 g_signal_connect(G_OBJECT(rend), "editing-started", G_CALLBACK(gtk_blist_renderer_editing_started_cb), NULL); |
d17d6e83f428
Added layout capabilities to blist themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25105
diff
changeset
|
5705 g_signal_connect(G_OBJECT(rend), "editing-canceled", G_CALLBACK(gtk_blist_renderer_editing_cancelled_cb), list); |
d17d6e83f428
Added layout capabilities to blist themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25105
diff
changeset
|
5706 g_signal_connect(G_OBJECT(rend), "edited", G_CALLBACK(gtk_blist_renderer_edited_cb), list); |
25123
1a4417138a8f
clean up formatting, and added render settings for the names/markup on the blist
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25120
diff
changeset
|
5707 g_object_set(rend, "ypad", 0, "yalign", 0.5, NULL); |
25106
d17d6e83f428
Added layout capabilities to blist themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25105
diff
changeset
|
5708 g_object_set(rend, "ellipsize", PANGO_ELLIPSIZE_END, NULL); |
d17d6e83f428
Added layout capabilities to blist themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25105
diff
changeset
|
5709 |
d17d6e83f428
Added layout capabilities to blist themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25105
diff
changeset
|
5710 /* idle */ |
d17d6e83f428
Added layout capabilities to blist themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25105
diff
changeset
|
5711 rend = gtk_cell_renderer_text_new(); |
d17d6e83f428
Added layout capabilities to blist themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25105
diff
changeset
|
5712 g_object_set(rend, "xalign", 1.0, "ypad", 0, NULL); |
d17d6e83f428
Added layout capabilities to blist themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25105
diff
changeset
|
5713 gtk_tree_view_column_pack_start(column, rend, FALSE); |
d17d6e83f428
Added layout capabilities to blist themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25105
diff
changeset
|
5714 gtk_tree_view_column_set_attributes(column, rend, |
d17d6e83f428
Added layout capabilities to blist themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25105
diff
changeset
|
5715 "markup", IDLE_COLUMN, |
d17d6e83f428
Added layout capabilities to blist themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25105
diff
changeset
|
5716 "visible", IDLE_VISIBLE_COLUMN, |
d17d6e83f428
Added layout capabilities to blist themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25105
diff
changeset
|
5717 "cell-background-gdk", BGCOLOR_COLUMN, |
d17d6e83f428
Added layout capabilities to blist themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25105
diff
changeset
|
5718 NULL); |
25108
06392c8252c0
Added text and font coloring for buddies, contacts and chats, as well as fix a few small bugs
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25107
diff
changeset
|
5719 } else if (emblem == i) { |
25106
d17d6e83f428
Added layout capabilities to blist themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25105
diff
changeset
|
5720 /* emblem */ |
d17d6e83f428
Added layout capabilities to blist themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25105
diff
changeset
|
5721 rend = gtk_cell_renderer_pixbuf_new(); |
d17d6e83f428
Added layout capabilities to blist themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25105
diff
changeset
|
5722 g_object_set(rend, "xalign", 1.0, "yalign", 0.5, "ypad", 0, "xpad", 3, NULL); |
d17d6e83f428
Added layout capabilities to blist themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25105
diff
changeset
|
5723 gtk_tree_view_column_pack_start(column, rend, FALSE); |
d17d6e83f428
Added layout capabilities to blist themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25105
diff
changeset
|
5724 gtk_tree_view_column_set_attributes(column, rend, "pixbuf", EMBLEM_COLUMN, |
d17d6e83f428
Added layout capabilities to blist themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25105
diff
changeset
|
5725 "cell-background-gdk", BGCOLOR_COLUMN, |
d17d6e83f428
Added layout capabilities to blist themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25105
diff
changeset
|
5726 "visible", EMBLEM_VISIBLE_COLUMN, NULL); |
d17d6e83f428
Added layout capabilities to blist themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25105
diff
changeset
|
5727 |
25108
06392c8252c0
Added text and font coloring for buddies, contacts and chats, as well as fix a few small bugs
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25107
diff
changeset
|
5728 } else if (protocol_icon == i) { |
25106
d17d6e83f428
Added layout capabilities to blist themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25105
diff
changeset
|
5729 /* protocol icon */ |
d17d6e83f428
Added layout capabilities to blist themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25105
diff
changeset
|
5730 rend = gtk_cell_renderer_pixbuf_new(); |
d17d6e83f428
Added layout capabilities to blist themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25105
diff
changeset
|
5731 gtk_tree_view_column_pack_start(column, rend, FALSE); |
d17d6e83f428
Added layout capabilities to blist themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25105
diff
changeset
|
5732 gtk_tree_view_column_set_attributes(column, rend, |
d17d6e83f428
Added layout capabilities to blist themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25105
diff
changeset
|
5733 "pixbuf", PROTOCOL_ICON_COLUMN, |
d17d6e83f428
Added layout capabilities to blist themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25105
diff
changeset
|
5734 "visible", PROTOCOL_ICON_VISIBLE_COLUMN, |
d17d6e83f428
Added layout capabilities to blist themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25105
diff
changeset
|
5735 "cell-background-gdk", BGCOLOR_COLUMN, |
d17d6e83f428
Added layout capabilities to blist themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25105
diff
changeset
|
5736 NULL); |
d17d6e83f428
Added layout capabilities to blist themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25105
diff
changeset
|
5737 g_object_set(rend, "xalign", 0.0, "xpad", 3, "ypad", 0, NULL); |
d17d6e83f428
Added layout capabilities to blist themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25105
diff
changeset
|
5738 |
25108
06392c8252c0
Added text and font coloring for buddies, contacts and chats, as well as fix a few small bugs
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25107
diff
changeset
|
5739 } else if (buddy_icon == i) { |
25106
d17d6e83f428
Added layout capabilities to blist themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25105
diff
changeset
|
5740 /* buddy icon */ |
d17d6e83f428
Added layout capabilities to blist themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25105
diff
changeset
|
5741 rend = gtk_cell_renderer_pixbuf_new(); |
d17d6e83f428
Added layout capabilities to blist themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25105
diff
changeset
|
5742 g_object_set(rend, "xalign", 1.0, "ypad", 0, NULL); |
d17d6e83f428
Added layout capabilities to blist themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25105
diff
changeset
|
5743 gtk_tree_view_column_pack_start(column, rend, FALSE); |
d17d6e83f428
Added layout capabilities to blist themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25105
diff
changeset
|
5744 gtk_tree_view_column_set_attributes(column, rend, "pixbuf", BUDDY_ICON_COLUMN, |
d17d6e83f428
Added layout capabilities to blist themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25105
diff
changeset
|
5745 "cell-background-gdk", BGCOLOR_COLUMN, |
d17d6e83f428
Added layout capabilities to blist themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25105
diff
changeset
|
5746 "visible", BUDDY_ICON_VISIBLE_COLUMN, |
d17d6e83f428
Added layout capabilities to blist themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25105
diff
changeset
|
5747 NULL); |
d17d6e83f428
Added layout capabilities to blist themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25105
diff
changeset
|
5748 } |
d17d6e83f428
Added layout capabilities to blist themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25105
diff
changeset
|
5749 |
d17d6e83f428
Added layout capabilities to blist themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25105
diff
changeset
|
5750 }/* end for loop */ |
25108
06392c8252c0
Added text and font coloring for buddies, contacts and chats, as well as fix a few small bugs
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25107
diff
changeset
|
5751 |
25106
d17d6e83f428
Added layout capabilities to blist themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25105
diff
changeset
|
5752 } |
d17d6e83f428
Added layout capabilities to blist themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25105
diff
changeset
|
5753 |
28923
fff8cf8459c4
Search friends by email addresses in the buddylist.
Luoh Ren-Shan <lcamel@gmail.com>
parents:
28921
diff
changeset
|
5754 static gboolean |
fff8cf8459c4
Search friends by email addresses in the buddylist.
Luoh Ren-Shan <lcamel@gmail.com>
parents:
28921
diff
changeset
|
5755 pidgin_blist_search_equal_func(GtkTreeModel *model, gint column, |
fff8cf8459c4
Search friends by email addresses in the buddylist.
Luoh Ren-Shan <lcamel@gmail.com>
parents:
28921
diff
changeset
|
5756 const gchar *key, GtkTreeIter *iter, gpointer data) |
fff8cf8459c4
Search friends by email addresses in the buddylist.
Luoh Ren-Shan <lcamel@gmail.com>
parents:
28921
diff
changeset
|
5757 { |
fff8cf8459c4
Search friends by email addresses in the buddylist.
Luoh Ren-Shan <lcamel@gmail.com>
parents:
28921
diff
changeset
|
5758 PurpleBlistNode *node = NULL; |
fff8cf8459c4
Search friends by email addresses in the buddylist.
Luoh Ren-Shan <lcamel@gmail.com>
parents:
28921
diff
changeset
|
5759 gboolean res = TRUE; |
fff8cf8459c4
Search friends by email addresses in the buddylist.
Luoh Ren-Shan <lcamel@gmail.com>
parents:
28921
diff
changeset
|
5760 const char *compare = NULL; |
fff8cf8459c4
Search friends by email addresses in the buddylist.
Luoh Ren-Shan <lcamel@gmail.com>
parents:
28921
diff
changeset
|
5761 |
fff8cf8459c4
Search friends by email addresses in the buddylist.
Luoh Ren-Shan <lcamel@gmail.com>
parents:
28921
diff
changeset
|
5762 if (!pidgin_tree_view_search_equal_func(model, column, key, iter, data)) |
fff8cf8459c4
Search friends by email addresses in the buddylist.
Luoh Ren-Shan <lcamel@gmail.com>
parents:
28921
diff
changeset
|
5763 return FALSE; |
fff8cf8459c4
Search friends by email addresses in the buddylist.
Luoh Ren-Shan <lcamel@gmail.com>
parents:
28921
diff
changeset
|
5764 |
fff8cf8459c4
Search friends by email addresses in the buddylist.
Luoh Ren-Shan <lcamel@gmail.com>
parents:
28921
diff
changeset
|
5765 /* If the search string does not match the displayed label, then look |
fff8cf8459c4
Search friends by email addresses in the buddylist.
Luoh Ren-Shan <lcamel@gmail.com>
parents:
28921
diff
changeset
|
5766 * at the alternate labels for the nodes and search in them. Currently, |
fff8cf8459c4
Search friends by email addresses in the buddylist.
Luoh Ren-Shan <lcamel@gmail.com>
parents:
28921
diff
changeset
|
5767 * alternate labels that make sense are usernames/email addresses for |
fff8cf8459c4
Search friends by email addresses in the buddylist.
Luoh Ren-Shan <lcamel@gmail.com>
parents:
28921
diff
changeset
|
5768 * buddies (but only for the ones who don't have a local alias). |
fff8cf8459c4
Search friends by email addresses in the buddylist.
Luoh Ren-Shan <lcamel@gmail.com>
parents:
28921
diff
changeset
|
5769 */ |
fff8cf8459c4
Search friends by email addresses in the buddylist.
Luoh Ren-Shan <lcamel@gmail.com>
parents:
28921
diff
changeset
|
5770 |
fff8cf8459c4
Search friends by email addresses in the buddylist.
Luoh Ren-Shan <lcamel@gmail.com>
parents:
28921
diff
changeset
|
5771 gtk_tree_model_get(model, iter, NODE_COLUMN, &node, -1); |
fff8cf8459c4
Search friends by email addresses in the buddylist.
Luoh Ren-Shan <lcamel@gmail.com>
parents:
28921
diff
changeset
|
5772 if (!node) |
fff8cf8459c4
Search friends by email addresses in the buddylist.
Luoh Ren-Shan <lcamel@gmail.com>
parents:
28921
diff
changeset
|
5773 return TRUE; |
fff8cf8459c4
Search friends by email addresses in the buddylist.
Luoh Ren-Shan <lcamel@gmail.com>
parents:
28921
diff
changeset
|
5774 |
fff8cf8459c4
Search friends by email addresses in the buddylist.
Luoh Ren-Shan <lcamel@gmail.com>
parents:
28921
diff
changeset
|
5775 compare = NULL; |
fff8cf8459c4
Search friends by email addresses in the buddylist.
Luoh Ren-Shan <lcamel@gmail.com>
parents:
28921
diff
changeset
|
5776 if (PURPLE_BLIST_NODE_IS_CONTACT(node)) { |
fff8cf8459c4
Search friends by email addresses in the buddylist.
Luoh Ren-Shan <lcamel@gmail.com>
parents:
28921
diff
changeset
|
5777 PurpleBuddy *b = purple_contact_get_priority_buddy(PURPLE_CONTACT(node)); |
fff8cf8459c4
Search friends by email addresses in the buddylist.
Luoh Ren-Shan <lcamel@gmail.com>
parents:
28921
diff
changeset
|
5778 if (!purple_buddy_get_local_buddy_alias(b)) |
fff8cf8459c4
Search friends by email addresses in the buddylist.
Luoh Ren-Shan <lcamel@gmail.com>
parents:
28921
diff
changeset
|
5779 compare = purple_buddy_get_name(b); |
fff8cf8459c4
Search friends by email addresses in the buddylist.
Luoh Ren-Shan <lcamel@gmail.com>
parents:
28921
diff
changeset
|
5780 } else if (PURPLE_BLIST_NODE_IS_BUDDY(node)) { |
fff8cf8459c4
Search friends by email addresses in the buddylist.
Luoh Ren-Shan <lcamel@gmail.com>
parents:
28921
diff
changeset
|
5781 if (!purple_buddy_get_local_buddy_alias(PURPLE_BUDDY(node))) |
fff8cf8459c4
Search friends by email addresses in the buddylist.
Luoh Ren-Shan <lcamel@gmail.com>
parents:
28921
diff
changeset
|
5782 compare = purple_buddy_get_name(PURPLE_BUDDY(node)); |
fff8cf8459c4
Search friends by email addresses in the buddylist.
Luoh Ren-Shan <lcamel@gmail.com>
parents:
28921
diff
changeset
|
5783 } |
fff8cf8459c4
Search friends by email addresses in the buddylist.
Luoh Ren-Shan <lcamel@gmail.com>
parents:
28921
diff
changeset
|
5784 |
fff8cf8459c4
Search friends by email addresses in the buddylist.
Luoh Ren-Shan <lcamel@gmail.com>
parents:
28921
diff
changeset
|
5785 if (compare) { |
fff8cf8459c4
Search friends by email addresses in the buddylist.
Luoh Ren-Shan <lcamel@gmail.com>
parents:
28921
diff
changeset
|
5786 char *tmp, *enteredstring; |
fff8cf8459c4
Search friends by email addresses in the buddylist.
Luoh Ren-Shan <lcamel@gmail.com>
parents:
28921
diff
changeset
|
5787 tmp = g_utf8_normalize(key, -1, G_NORMALIZE_DEFAULT); |
fff8cf8459c4
Search friends by email addresses in the buddylist.
Luoh Ren-Shan <lcamel@gmail.com>
parents:
28921
diff
changeset
|
5788 enteredstring = g_utf8_casefold(tmp, -1); |
fff8cf8459c4
Search friends by email addresses in the buddylist.
Luoh Ren-Shan <lcamel@gmail.com>
parents:
28921
diff
changeset
|
5789 g_free(tmp); |
fff8cf8459c4
Search friends by email addresses in the buddylist.
Luoh Ren-Shan <lcamel@gmail.com>
parents:
28921
diff
changeset
|
5790 |
fff8cf8459c4
Search friends by email addresses in the buddylist.
Luoh Ren-Shan <lcamel@gmail.com>
parents:
28921
diff
changeset
|
5791 if (purple_str_has_prefix(compare, enteredstring)) |
fff8cf8459c4
Search friends by email addresses in the buddylist.
Luoh Ren-Shan <lcamel@gmail.com>
parents:
28921
diff
changeset
|
5792 res = FALSE; |
fff8cf8459c4
Search friends by email addresses in the buddylist.
Luoh Ren-Shan <lcamel@gmail.com>
parents:
28921
diff
changeset
|
5793 g_free(enteredstring); |
fff8cf8459c4
Search friends by email addresses in the buddylist.
Luoh Ren-Shan <lcamel@gmail.com>
parents:
28921
diff
changeset
|
5794 } |
fff8cf8459c4
Search friends by email addresses in the buddylist.
Luoh Ren-Shan <lcamel@gmail.com>
parents:
28921
diff
changeset
|
5795 |
fff8cf8459c4
Search friends by email addresses in the buddylist.
Luoh Ren-Shan <lcamel@gmail.com>
parents:
28921
diff
changeset
|
5796 return res; |
fff8cf8459c4
Search friends by email addresses in the buddylist.
Luoh Ren-Shan <lcamel@gmail.com>
parents:
28921
diff
changeset
|
5797 } |
fff8cf8459c4
Search friends by email addresses in the buddylist.
Luoh Ren-Shan <lcamel@gmail.com>
parents:
28921
diff
changeset
|
5798 |
15822 | 5799 static void pidgin_blist_show(PurpleBuddyList *list) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5800 { |
21401
c1c7e28223f8
Display all connection errors in a scrollbook, which is packed inside
Will Thompson <will.thompson@collabora.co.uk>
parents:
21400
diff
changeset
|
5801 PidginBuddyListPrivate *priv; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5802 void *handle; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5803 GtkTreeViewColumn *column; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5804 GtkWidget *menu; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5805 GtkWidget *ebox; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5806 GtkWidget *sep; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5807 GtkWidget *label; |
29615
97005a2e99d7
Use a small GtkButton instead of the custom "X" for close in various
Kosta Arvanitis <karvanitis@hotmail.com>
parents:
29591
diff
changeset
|
5808 GtkWidget *close; |
16010
eae8e127e4fb
make things cleaner for translators
Nathan Walp <nwalp@pidgin.im>
parents:
16007
diff
changeset
|
5809 char *pretty, *tmp; |
26528
bd61f91e669a
Fix assertion when the blist theme preference is empty.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26397
diff
changeset
|
5810 const char *theme_name; |
32582
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
5811 GtkActionGroup *action_group; |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
5812 GError *error; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5813 GtkAccelGroup *accel_group; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5814 GtkTreeSelection *selection; |
15822 | 5815 GtkTargetEntry dte[] = {{"PURPLE_BLIST_NODE", GTK_TARGET_SAME_APP, DRAG_ROW}, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5816 {"application/x-im-contact", 0, DRAG_BUDDY}, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5817 {"text/x-vcard", 0, DRAG_VCARD }, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5818 {"text/uri-list", 0, DRAG_URI}, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5819 {"text/plain", 0, DRAG_TEXT}}; |
15822 | 5820 GtkTargetEntry ste[] = {{"PURPLE_BLIST_NODE", GTK_TARGET_SAME_APP, DRAG_ROW}, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5821 {"application/x-im-contact", 0, DRAG_BUDDY}, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5822 {"text/x-vcard", 0, DRAG_VCARD }}; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5823 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
|
5824 purple_blist_set_visible(purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/blist/list_visible")); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5825 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5826 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5827 |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
5828 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
|
5829 priv = PIDGIN_BUDDY_LIST_GET_PRIVATE(gtkblist); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5830 |
26991
85a4c248f751
Buddy List needs to take a reference to the loaded theme. Fixes #8798.
Paul Aurich <paul@darkrain42.org>
parents:
26884
diff
changeset
|
5831 if (priv->current_theme) |
85a4c248f751
Buddy List needs to take a reference to the loaded theme. Fixes #8798.
Paul Aurich <paul@darkrain42.org>
parents:
26884
diff
changeset
|
5832 g_object_unref(priv->current_theme); |
85a4c248f751
Buddy List needs to take a reference to the loaded theme. Fixes #8798.
Paul Aurich <paul@darkrain42.org>
parents:
26884
diff
changeset
|
5833 |
26528
bd61f91e669a
Fix assertion when the blist theme preference is empty.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26397
diff
changeset
|
5834 theme_name = purple_prefs_get_string(PIDGIN_PREFS_ROOT "/blist/theme"); |
bd61f91e669a
Fix assertion when the blist theme preference is empty.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26397
diff
changeset
|
5835 if (theme_name && *theme_name) |
26991
85a4c248f751
Buddy List needs to take a reference to the loaded theme. Fixes #8798.
Paul Aurich <paul@darkrain42.org>
parents:
26884
diff
changeset
|
5836 priv->current_theme = g_object_ref(PIDGIN_BLIST_THEME(purple_theme_manager_find_theme(theme_name, "blist"))); |
26528
bd61f91e669a
Fix assertion when the blist theme preference is empty.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26397
diff
changeset
|
5837 else |
bd61f91e669a
Fix assertion when the blist theme preference is empty.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26397
diff
changeset
|
5838 priv->current_theme = NULL; |
25099
1242a922a4bc
start of blist themes (themes have no effect on display)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23393
diff
changeset
|
5839 |
15447 | 5840 gtkblist->empty_avatar = gdk_pixbuf_new(GDK_COLORSPACE_RGB, TRUE, 8, 32, 32); |
5841 gdk_pixbuf_fill(gtkblist->empty_avatar, 0x00000000); | |
15396
a8ee645e7fb4
A lot of status icon changes:
Sean Egan <seanegan@gmail.com>
parents:
15373
diff
changeset
|
5842 |
17720 | 5843 gtkblist->window = pidgin_create_window(_("Buddy List"), 0, "buddy_list", TRUE); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5844 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
|
5845 G_CALLBACK(blist_focus_cb), gtkblist); |
22850
5d833ca5a265
Make pidgin_blist_toggle_visibility() hide the buddy list when it is
Casey Harkins <charkins@pidgin.im>
parents:
22813
diff
changeset
|
5846 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:
22813
diff
changeset
|
5847 G_CALLBACK(blist_focus_cb), gtkblist); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5848 GTK_WINDOW(gtkblist->window)->allow_shrink = TRUE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5849 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5850 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
|
5851 gtk_widget_show(gtkblist->main_vbox); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5852 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
|
5853 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5854 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
|
5855 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
|
5856 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
|
5857 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
|
5858 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
|
5859 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
|
5860 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5861 /******************************* Menu bar *************************************/ |
32582
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
5862 action_group = gtk_action_group_new("BListActions"); |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
5863 gtk_action_group_add_actions(action_group, |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
5864 blist_menu_entries, |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
5865 G_N_ELEMENTS(blist_menu_entries), |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
5866 GTK_WINDOW(gtkblist->window)); |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
5867 gtk_action_group_add_toggle_actions(action_group, |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
5868 blist_menu_toggle_entries, |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
5869 G_N_ELEMENTS(blist_menu_toggle_entries), |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
5870 GTK_WINDOW(gtkblist->window)); |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
5871 #ifdef ENABLE_NLS |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
5872 gtk_action_group_set_translation_domain(action_group, |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
5873 PACKAGE); |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
5874 #endif |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
5875 |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
5876 gtkblist->ui = gtk_ui_manager_new(); |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
5877 gtk_ui_manager_insert_action_group(gtkblist->ui, action_group, 0); |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
5878 |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
5879 accel_group = gtk_ui_manager_get_accel_group(gtkblist->ui); |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
5880 gtk_window_add_accel_group(GTK_WINDOW(gtkblist->window), accel_group); |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
5881 |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
5882 error = NULL; |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
5883 if (!gtk_ui_manager_add_ui_from_string(gtkblist->ui, blist_menu, -1, &error)) |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
5884 { |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
5885 g_message("building menus failed: %s", error->message); |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
5886 g_error_free(error); |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
5887 exit(EXIT_FAILURE); |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
5888 } |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
5889 |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
5890 menu = gtk_ui_manager_get_widget(gtkblist->ui, "/BList"); |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
5891 gtkblist->menutray = pidgin_menu_tray_new(); |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
5892 gtk_menu_shell_append(GTK_MENU_SHELL(menu), gtkblist->menutray); |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
5893 gtk_widget_show(gtkblist->menutray); |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
5894 gtk_widget_show(menu); |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
5895 gtk_box_pack_start(GTK_BOX(gtkblist->main_vbox), menu, FALSE, FALSE, 0); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5896 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5897 /****************************** Notebook *************************************/ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5898 gtkblist->notebook = gtk_notebook_new(); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5899 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
|
5900 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
|
5901 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
|
5902 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5903 #if 0 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5904 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
|
5905 #endif |
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 /* 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
|
5908 tmp = g_strdup_printf(_("<span weight='bold' size='larger'>Welcome to %s!</span>\n\n" |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5909 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5910 "You have no accounts enabled. Enable your IM accounts from the " |
23310
a3759c05cc5b
Bring back the unintentionally hidden 'Manage Accounts' dialog. Thanks to
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23307
diff
changeset
|
5911 "<b>Accounts</b> window at <b>Accounts->Manage Accounts</b>. Once you " |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5912 "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
|
5913 "and talk to your friends."), PIDGIN_NAME); |
eae8e127e4fb
make things cleaner for translators
Nathan Walp <nwalp@pidgin.im>
parents:
16007
diff
changeset
|
5914 pretty = pidgin_make_pretty_arrows(tmp); |
eae8e127e4fb
make things cleaner for translators
Nathan Walp <nwalp@pidgin.im>
parents:
16007
diff
changeset
|
5915 g_free(tmp); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5916 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
|
5917 gtk_widget_set_size_request(label, purple_prefs_get_int(PIDGIN_PREFS_ROOT "/blist/width") - 12, -1); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5918 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
|
5919 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
|
5920 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
|
5921 g_free(pretty); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5922 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
|
5923 gtkblist->vbox = gtk_vbox_new(FALSE, 0); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5924 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
|
5925 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
|
5926 pidgin_blist_select_notebook_page(gtkblist); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5927 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5928 ebox = gtk_event_box_new(); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5929 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
|
5930 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
|
5931 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
|
5932 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
|
5933 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
|
5934 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
|
5935 gtkblist->headline_label = gtk_label_new(NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5936 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
|
5937 purple_prefs_get_int(PIDGIN_PREFS_ROOT "/blist/width")-25,-1); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5938 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
|
5939 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
|
5940 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
|
5941 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
|
5942 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
|
5943 "style-set", |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5944 G_CALLBACK(headline_style_set), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5945 NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5946 g_signal_connect (gtkblist->headline_hbox, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5947 "expose_event", |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5948 G_CALLBACK (paint_headline_hbox), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5949 NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5950 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
|
5951 |
29616
0d613fa75e5f
Maintain ABI compatibility by keeping headline_close a GdkPixbuf.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29615
diff
changeset
|
5952 gtkblist->headline_close = gtk_widget_render_icon(ebox, GTK_STOCK_CLOSE, |
0d613fa75e5f
Maintain ABI compatibility by keeping headline_close a GdkPixbuf.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29615
diff
changeset
|
5953 gtk_icon_size_from_name(PIDGIN_ICON_SIZE_TANGO_MICROSCOPIC), NULL); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5954 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
|
5955 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
|
5956 |
29615
97005a2e99d7
Use a small GtkButton instead of the custom "X" for close in various
Kosta Arvanitis <karvanitis@hotmail.com>
parents:
29591
diff
changeset
|
5957 /* Close button. */ |
97005a2e99d7
Use a small GtkButton instead of the custom "X" for close in various
Kosta Arvanitis <karvanitis@hotmail.com>
parents:
29591
diff
changeset
|
5958 close = gtk_image_new_from_stock(GTK_STOCK_CLOSE, GTK_ICON_SIZE_MENU); |
29616
0d613fa75e5f
Maintain ABI compatibility by keeping headline_close a GdkPixbuf.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29615
diff
changeset
|
5959 close = pidgin_create_small_button(close); |
0d613fa75e5f
Maintain ABI compatibility by keeping headline_close a GdkPixbuf.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29615
diff
changeset
|
5960 gtk_box_pack_start(GTK_BOX(gtkblist->headline_hbox), close, FALSE, FALSE, 0); |
29615
97005a2e99d7
Use a small GtkButton instead of the custom "X" for close in various
Kosta Arvanitis <karvanitis@hotmail.com>
parents:
29591
diff
changeset
|
5961 #if GTK_CHECK_VERSION(2,12,0) |
29616
0d613fa75e5f
Maintain ABI compatibility by keeping headline_close a GdkPixbuf.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29615
diff
changeset
|
5962 gtk_widget_set_tooltip_text(close, _("Close")); |
29615
97005a2e99d7
Use a small GtkButton instead of the custom "X" for close in various
Kosta Arvanitis <karvanitis@hotmail.com>
parents:
29591
diff
changeset
|
5963 #endif |
29616
0d613fa75e5f
Maintain ABI compatibility by keeping headline_close a GdkPixbuf.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29615
diff
changeset
|
5964 g_signal_connect(close, "clicked", G_CALLBACK(headline_close_press_cb), gtkblist); |
29615
97005a2e99d7
Use a small GtkButton instead of the custom "X" for close in various
Kosta Arvanitis <karvanitis@hotmail.com>
parents:
29591
diff
changeset
|
5965 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5966 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
|
5967 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
|
5968 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
|
5969 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5970 /****************************** GtkTreeView **********************************/ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5971 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
|
5972 GDK_TYPE_PIXBUF, /* Status icon */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5973 G_TYPE_BOOLEAN, /* Status icon visible */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5974 G_TYPE_STRING, /* Name */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5975 G_TYPE_STRING, /* Idle */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5976 G_TYPE_BOOLEAN, /* Idle visible */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5977 GDK_TYPE_PIXBUF, /* Buddy icon */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5978 G_TYPE_BOOLEAN, /* Buddy icon visible */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5979 G_TYPE_POINTER, /* Node */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5980 GDK_TYPE_COLOR, /* bgcolor */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5981 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
|
5982 G_TYPE_BOOLEAN, /* Group expander visible */ |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5983 G_TYPE_BOOLEAN, /* Contact expander */ |
15462 | 5984 G_TYPE_BOOLEAN, /* Contact expander visible */ |
5985 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
|
5986 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
|
5987 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
|
5988 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
|
5989 ); |
15373
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 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
|
5992 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5993 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
|
5994 gtk_widget_set_name(gtkblist->treeview, "pidgin_blist_treeview"); |
15557
0324f69112f9
Make group background colors update when the theme changes.
Sean Egan <seanegan@gmail.com>
parents:
15552
diff
changeset
|
5995 |
0324f69112f9
Make group background colors update when the theme changes.
Sean Egan <seanegan@gmail.com>
parents:
15552
diff
changeset
|
5996 g_signal_connect(gtkblist->treeview, |
0324f69112f9
Make group background colors update when the theme changes.
Sean Egan <seanegan@gmail.com>
parents:
15552
diff
changeset
|
5997 "style-set", |
0324f69112f9
Make group background colors update when the theme changes.
Sean Egan <seanegan@gmail.com>
parents:
15552
diff
changeset
|
5998 G_CALLBACK(treeview_style_set), list); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5999 /* Set up selection stuff */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6000 selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(gtkblist->treeview)); |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
6001 g_signal_connect(G_OBJECT(selection), "changed", G_CALLBACK(pidgin_blist_selection_changed), NULL); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6002 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6003 /* Set up dnd */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6004 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
|
6005 GDK_BUTTON1_MASK, ste, 3, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6006 GDK_ACTION_COPY); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6007 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
|
6008 dte, 5, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6009 GDK_ACTION_COPY | GDK_ACTION_MOVE); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6010 |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
6011 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:
15499
diff
changeset
|
6012 g_signal_connect(G_OBJECT(gtkblist->treeview), "drag-data-get", G_CALLBACK(pidgin_blist_drag_data_get_cb), NULL); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6013 #ifdef _WIN32 |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
6014 g_signal_connect(G_OBJECT(gtkblist->treeview), "drag-begin", G_CALLBACK(pidgin_blist_drag_begin), NULL); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6015 #endif |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
6016 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
|
6017 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
|
6018 g_signal_connect(G_OBJECT(gtkblist->treeview), "leave-notify-event", G_CALLBACK(pidgin_blist_leave_cb), NULL); |
15373
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 /* 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
|
6021 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
|
6022 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
|
6023 pidgin_blist_paint_tip); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6024 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6025 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
|
6026 |
25106
d17d6e83f428
Added layout capabilities to blist themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25105
diff
changeset
|
6027 /* expander columns */ |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6028 column = gtk_tree_view_column_new(); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6029 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
|
6030 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
|
6031 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
|
6032 |
25106
d17d6e83f428
Added layout capabilities to blist themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25105
diff
changeset
|
6033 /* everything else column */ |
d17d6e83f428
Added layout capabilities to blist themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25105
diff
changeset
|
6034 gtkblist->text_column = gtk_tree_view_column_new (); |
d17d6e83f428
Added layout capabilities to blist themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25105
diff
changeset
|
6035 gtk_tree_view_append_column(GTK_TREE_VIEW(gtkblist->treeview), gtkblist->text_column); |
d17d6e83f428
Added layout capabilities to blist themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25105
diff
changeset
|
6036 pidgin_blist_build_layout(list); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6037 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6038 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
|
6039 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
|
6040 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
|
6041 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
|
6042 g_signal_connect(G_OBJECT(gtkblist->treeview), "key-press-event", G_CALLBACK(gtk_blist_key_press_cb), NULL); |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
6043 g_signal_connect(G_OBJECT(gtkblist->treeview), "popup-menu", G_CALLBACK(pidgin_blist_popup_menu_cb), NULL); |
15373
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 /* Enable CTRL+F searching */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6046 gtk_tree_view_set_search_column(GTK_TREE_VIEW(gtkblist->treeview), NAME_COLUMN); |
28923
fff8cf8459c4
Search friends by email addresses in the buddylist.
Luoh Ren-Shan <lcamel@gmail.com>
parents:
28921
diff
changeset
|
6047 gtk_tree_view_set_search_equal_func(GTK_TREE_VIEW(gtkblist->treeview), |
fff8cf8459c4
Search friends by email addresses in the buddylist.
Luoh Ren-Shan <lcamel@gmail.com>
parents:
28921
diff
changeset
|
6048 pidgin_blist_search_equal_func, NULL, NULL); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6049 |
31367
917c597beb97
Add pidgin_make_scrollable and use it. Cleans up a bunch of duplicate code. Net code loss of 180 lines. Fixes #13073.
Gabriel Schulhof <nix@go-nix.ca>
parents:
31096
diff
changeset
|
6050 gtk_box_pack_start(GTK_BOX(gtkblist->vbox), |
917c597beb97
Add pidgin_make_scrollable and use it. Cleans up a bunch of duplicate code. Net code loss of 180 lines. Fixes #13073.
Gabriel Schulhof <nix@go-nix.ca>
parents:
31096
diff
changeset
|
6051 pidgin_make_scrollable(gtkblist->treeview, GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC, GTK_SHADOW_NONE, -1, -1), |
917c597beb97
Add pidgin_make_scrollable and use it. Cleans up a bunch of duplicate code. Net code loss of 180 lines. Fixes #13073.
Gabriel Schulhof <nix@go-nix.ca>
parents:
31096
diff
changeset
|
6052 TRUE, TRUE, 0); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6053 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6054 sep = gtk_hseparator_new(); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6055 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
|
6056 |
15513 | 6057 gtkblist->scrollbook = pidgin_scroll_book_new(); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6058 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
|
6059 |
21401
c1c7e28223f8
Display all connection errors in a scrollbook, which is packed inside
Will Thompson <will.thompson@collabora.co.uk>
parents:
21400
diff
changeset
|
6060 /* 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
|
6061 * 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
|
6062 * 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
|
6063 */ |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6064 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
|
6065 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
|
6066 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
|
6067 |
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
|
6068 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
|
6069 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
|
6070 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
|
6071 |
c1c7e28223f8
Display all connection errors in a scrollbook, which is packed inside
Will Thompson <will.thompson@collabora.co.uk>
parents:
21400
diff
changeset
|
6072 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6073 /* Add the statusbox */ |
15513 | 6074 gtkblist->statusbox = pidgin_status_box_new(); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6075 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
|
6076 gtk_widget_set_name(gtkblist->statusbox, "pidgin_blist_statusbox"); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6077 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
|
6078 gtk_widget_show(gtkblist->statusbox); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6079 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6080 /* 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
|
6081 * 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
|
6082 */ |
32582
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
6083 gtk_toggle_action_set_active(GTK_TOGGLE_ACTION(gtk_ui_manager_get_action(gtkblist->ui, "/BList/BuddiesMenu/ShowMenu/ShowOffline")), |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
6084 purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/blist/show_offline_buddies")); |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
6085 |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
6086 gtk_toggle_action_set_active(GTK_TOGGLE_ACTION(gtk_ui_manager_get_action(gtkblist->ui, "/BList/BuddiesMenu/ShowMenu/ShowEmptyGroups")), |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
6087 purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/blist/show_empty_groups")); |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
6088 |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
6089 gtk_toggle_action_set_active(GTK_TOGGLE_ACTION(gtk_ui_manager_get_action(gtkblist->ui, "/BList/ToolsMenu/MuteSounds")), |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
6090 purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/sound/mute")); |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
6091 |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
6092 gtk_toggle_action_set_active(GTK_TOGGLE_ACTION(gtk_ui_manager_get_action(gtkblist->ui, "/BList/BuddiesMenu/ShowMenu/ShowBuddyDetails")), |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
6093 purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/blist/show_buddy_icons")); |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
6094 |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
6095 gtk_toggle_action_set_active(GTK_TOGGLE_ACTION(gtk_ui_manager_get_action(gtkblist->ui, "/BList/BuddiesMenu/ShowMenu/ShowIdleTimes")), |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
6096 purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/blist/show_idle_time")); |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
6097 |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
6098 gtk_toggle_action_set_active(GTK_TOGGLE_ACTION(gtk_ui_manager_get_action(gtkblist->ui, "/BList/BuddiesMenu/ShowMenu/ShowProtocolIcons")), |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
6099 purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/blist/show_protocol_icons")); |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
6100 |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
6101 if(!strcmp(purple_prefs_get_string(PIDGIN_PREFS_ROOT "/sound/method"), "none")) |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
6102 gtk_action_set_sensitive(gtk_ui_manager_get_action(gtkblist->ui, "/BList/ToolsMenu/MuteSounds"), FALSE); |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
6103 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6104 /* Update some dynamic things */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6105 update_menu_bar(gtkblist); |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
6106 pidgin_blist_update_plugin_actions(); |
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
6107 pidgin_blist_update_sort_methods(); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6108 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6109 /* OK... let's show this bad boy. */ |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
6110 pidgin_blist_refresh(list); |
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
6111 pidgin_blist_restore_position(); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6112 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
|
6113 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
|
6114 purple_blist_set_visible(purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/blist/list_visible")); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6115 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6116 /* start the refresh timer */ |
26531
b162300ab1e7
A patch from Arunan Balasubramaniam to use timeouts in seconds instead of
foss@abala.me
parents:
26528
diff
changeset
|
6117 gtkblist->refresh_timer = purple_timeout_add_seconds(30, (GSourceFunc)pidgin_blist_refresh_timer, list); |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
6118 |
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
6119 handle = pidgin_blist_get_handle(); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6120 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6121 /* 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
|
6122 purple_prefs_connect_callback(handle, PIDGIN_PREFS_ROOT "/blist/show_buddy_icons", |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6123 _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
|
6124 purple_prefs_connect_callback(handle, PIDGIN_PREFS_ROOT "/blist/show_idle_time", |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6125 _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
|
6126 purple_prefs_connect_callback(handle, PIDGIN_PREFS_ROOT "/blist/show_empty_groups", |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6127 _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
|
6128 purple_prefs_connect_callback(handle, PIDGIN_PREFS_ROOT "/blist/show_offline_buddies", |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6129 _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
|
6130 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
|
6131 _prefs_change_redo_list, NULL); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6132 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6133 /* 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
|
6134 purple_prefs_connect_callback(handle, PIDGIN_PREFS_ROOT "/blist/sort_type", |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6135 _prefs_change_sort_method, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6136 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6137 /* 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
|
6138 purple_prefs_connect_callback(handle, PIDGIN_PREFS_ROOT "/sound/mute", |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
6139 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
|
6140 purple_prefs_connect_callback(handle, PIDGIN_PREFS_ROOT "/sound/method", |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
6141 pidgin_blist_sound_method_pref_cb, NULL); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6142 |
15822 | 6143 /* 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
|
6144 |
089fc89b6996
Remove repeated calls to purple_*_get_handle().
Will Thompson <will.thompson@collabora.co.uk>
parents:
21244
diff
changeset
|
6145 handle = purple_accounts_get_handle(); |
089fc89b6996
Remove repeated calls to purple_*_get_handle().
Will Thompson <will.thompson@collabora.co.uk>
parents:
21244
diff
changeset
|
6146 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
|
6147 PURPLE_CALLBACK(account_modified), gtkblist); |
089fc89b6996
Remove repeated calls to purple_*_get_handle().
Will Thompson <will.thompson@collabora.co.uk>
parents:
21244
diff
changeset
|
6148 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
|
6149 PURPLE_CALLBACK(account_modified), gtkblist); |
089fc89b6996
Remove repeated calls to purple_*_get_handle().
Will Thompson <will.thompson@collabora.co.uk>
parents:
21244
diff
changeset
|
6150 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
|
6151 PURPLE_CALLBACK(account_modified), gtkblist); |
089fc89b6996
Remove repeated calls to purple_*_get_handle().
Will Thompson <will.thompson@collabora.co.uk>
parents:
21244
diff
changeset
|
6152 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
|
6153 PURPLE_CALLBACK(account_status_changed), |
089fc89b6996
Remove repeated calls to purple_*_get_handle().
Will Thompson <will.thompson@collabora.co.uk>
parents:
21244
diff
changeset
|
6154 gtkblist); |
21369
318b3f5d1516
Call pidgin_blist_update_account_error_state in response to
Will Thompson <will.thompson@collabora.co.uk>
parents:
21368
diff
changeset
|
6155 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
|
6156 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
|
6157 gtkblist); |
26694
83e6e710cbf3
Add a new signal which is emitted (after the account is connected) if the
Paul Aurich <paul@darkrain42.org>
parents:
26637
diff
changeset
|
6158 purple_signal_connect(handle, "account-actions-changed", gtkblist, |
83e6e710cbf3
Add a new signal which is emitted (after the account is connected) if the
Paul Aurich <paul@darkrain42.org>
parents:
26637
diff
changeset
|
6159 PURPLE_CALLBACK(account_actions_changed), NULL); |
21368
089fc89b6996
Remove repeated calls to purple_*_get_handle().
Will Thompson <will.thompson@collabora.co.uk>
parents:
21244
diff
changeset
|
6160 |
089fc89b6996
Remove repeated calls to purple_*_get_handle().
Will Thompson <will.thompson@collabora.co.uk>
parents:
21244
diff
changeset
|
6161 handle = pidgin_account_get_handle(); |
089fc89b6996
Remove repeated calls to purple_*_get_handle().
Will Thompson <will.thompson@collabora.co.uk>
parents:
21244
diff
changeset
|
6162 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
|
6163 PURPLE_CALLBACK(account_modified), gtkblist); |
089fc89b6996
Remove repeated calls to purple_*_get_handle().
Will Thompson <will.thompson@collabora.co.uk>
parents:
21244
diff
changeset
|
6164 |
089fc89b6996
Remove repeated calls to purple_*_get_handle().
Will Thompson <will.thompson@collabora.co.uk>
parents:
21244
diff
changeset
|
6165 handle = purple_connections_get_handle(); |
089fc89b6996
Remove repeated calls to purple_*_get_handle().
Will Thompson <will.thompson@collabora.co.uk>
parents:
21244
diff
changeset
|
6166 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
|
6167 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
|
6168 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
|
6169 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
|
6170 |
089fc89b6996
Remove repeated calls to purple_*_get_handle().
Will Thompson <will.thompson@collabora.co.uk>
parents:
21244
diff
changeset
|
6171 handle = purple_plugins_get_handle(); |
089fc89b6996
Remove repeated calls to purple_*_get_handle().
Will Thompson <will.thompson@collabora.co.uk>
parents:
21244
diff
changeset
|
6172 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
|
6173 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
|
6174 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
|
6175 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
|
6176 |
089fc89b6996
Remove repeated calls to purple_*_get_handle().
Will Thompson <will.thompson@collabora.co.uk>
parents:
21244
diff
changeset
|
6177 handle = purple_conversations_get_handle(); |
089fc89b6996
Remove repeated calls to purple_*_get_handle().
Will Thompson <will.thompson@collabora.co.uk>
parents:
21244
diff
changeset
|
6178 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
|
6179 PURPLE_CALLBACK(conversation_updated_cb), |
089fc89b6996
Remove repeated calls to purple_*_get_handle().
Will Thompson <will.thompson@collabora.co.uk>
parents:
21244
diff
changeset
|
6180 gtkblist); |
089fc89b6996
Remove repeated calls to purple_*_get_handle().
Will Thompson <will.thompson@collabora.co.uk>
parents:
21244
diff
changeset
|
6181 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
|
6182 PURPLE_CALLBACK(conversation_deleting_cb), |
089fc89b6996
Remove repeated calls to purple_*_get_handle().
Will Thompson <will.thompson@collabora.co.uk>
parents:
21244
diff
changeset
|
6183 gtkblist); |
089fc89b6996
Remove repeated calls to purple_*_get_handle().
Will Thompson <will.thompson@collabora.co.uk>
parents:
21244
diff
changeset
|
6184 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
|
6185 PURPLE_CALLBACK(conversation_created_cb), |
089fc89b6996
Remove repeated calls to purple_*_get_handle().
Will Thompson <will.thompson@collabora.co.uk>
parents:
21244
diff
changeset
|
6186 gtkblist); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6187 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6188 gtk_widget_hide(gtkblist->headline_hbox); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6189 |
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
|
6190 show_initial_account_errors(gtkblist); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6191 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6192 /* emit our created signal */ |
21368
089fc89b6996
Remove repeated calls to purple_*_get_handle().
Will Thompson <will.thompson@collabora.co.uk>
parents:
21244
diff
changeset
|
6193 handle = pidgin_blist_get_handle(); |
15822 | 6194 purple_signal_emit(handle, "gtkblist-created", list); |
6195 } | |
6196 | |
6197 static void redo_buddy_list(PurpleBuddyList *list, gboolean remove, gboolean rerender) | |
6198 { | |
6199 PurpleBlistNode *node; | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6200 |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
6201 gtkblist = PIDGIN_BLIST(list); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6202 if(!gtkblist || !gtkblist->treeview) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6203 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6204 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6205 node = list->root; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6206 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6207 while (node) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6208 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6209 /* 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
|
6210 * 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
|
6211 */ |
15822 | 6212 if (remove && !PURPLE_BLIST_NODE_IS_GROUP(node)) |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
6213 pidgin_blist_hide_node(list, node, FALSE); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6214 |
15822 | 6215 if (PURPLE_BLIST_NODE_IS_BUDDY(node)) |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
6216 pidgin_blist_update_buddy(list, node, rerender); |
15822 | 6217 else if (PURPLE_BLIST_NODE_IS_CHAT(node)) |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
6218 pidgin_blist_update(list, node); |
15822 | 6219 else if (PURPLE_BLIST_NODE_IS_GROUP(node)) |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
6220 pidgin_blist_update(list, node); |
15822 | 6221 node = purple_blist_node_next(node, FALSE); |
6222 } | |
6223 | |
6224 } | |
6225 | |
6226 void pidgin_blist_refresh(PurpleBuddyList *list) | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6227 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6228 redo_buddy_list(list, FALSE, TRUE); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6229 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6230 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6231 void |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
6232 pidgin_blist_update_refresh_timeout() |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6233 { |
15822 | 6234 PurpleBuddyList *blist; |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
6235 PidginBuddyList *gtkblist; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6236 |
15822 | 6237 blist = purple_get_blist(); |
6238 gtkblist = PIDGIN_BLIST(purple_get_blist()); | |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
6239 |
26531
b162300ab1e7
A patch from Arunan Balasubramaniam to use timeouts in seconds instead of
foss@abala.me
parents:
26528
diff
changeset
|
6240 gtkblist->refresh_timer = purple_timeout_add_seconds(30,(GSourceFunc)pidgin_blist_refresh_timer, blist); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6241 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6242 |
15822 | 6243 static gboolean get_iter_from_node(PurpleBlistNode *node, GtkTreeIter *iter) { |
32350
cd46874707b1
Pidgin: Use the purple_blist_node_ accessor functions.
andrew.victor@mxit.com
parents:
32347
diff
changeset
|
6244 struct _pidgin_blist_node *gtknode = purple_blist_node_get_ui_data(node); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6245 GtkTreePath *path; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6246 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6247 if (!gtknode) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6248 return FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6249 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6250 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6251 if (!gtkblist) { |
15822 | 6252 purple_debug_error("gtkblist", "get_iter_from_node was called, but we don't seem to have a blist\n"); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6253 return FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6254 } |
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 if (!gtknode->row) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6257 return FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6258 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6259 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6260 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
|
6261 return FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6262 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6263 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
|
6264 gtk_tree_path_free(path); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6265 return FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6266 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6267 gtk_tree_path_free(path); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6268 return TRUE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6269 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6270 |
15822 | 6271 static void pidgin_blist_remove(PurpleBuddyList *list, PurpleBlistNode *node) |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
6272 { |
32350
cd46874707b1
Pidgin: Use the purple_blist_node_ accessor functions.
andrew.victor@mxit.com
parents:
32347
diff
changeset
|
6273 struct _pidgin_blist_node *gtknode = purple_blist_node_get_ui_data(node); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6274 |
15822 | 6275 purple_request_close_with_handle(node); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6276 |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
6277 pidgin_blist_hide_node(list, node, TRUE); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6278 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6279 if(node->parent) |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
6280 pidgin_blist_update(list, node->parent); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6281 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6282 /* 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
|
6283 /* 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
|
6284 * 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
|
6285 * 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
|
6286 * comment it out again. Stu */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6287 /* 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
|
6288 * contacts, the dragged buddy mysteriously 'disappears'. Stu. */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6289 /* I think it's fixed now. Stu. */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6290 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6291 if(gtknode) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6292 if(gtknode->recent_signonoff_timer > 0) |
15822 | 6293 purple_timeout_remove(gtknode->recent_signonoff_timer); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6294 |
32350
cd46874707b1
Pidgin: Use the purple_blist_node_ accessor functions.
andrew.victor@mxit.com
parents:
32347
diff
changeset
|
6295 purple_signals_disconnect_by_handle(gtknode); |
cd46874707b1
Pidgin: Use the purple_blist_node_ accessor functions.
andrew.victor@mxit.com
parents:
32347
diff
changeset
|
6296 g_free(gtknode); |
cd46874707b1
Pidgin: Use the purple_blist_node_ accessor functions.
andrew.victor@mxit.com
parents:
32347
diff
changeset
|
6297 purple_blist_node_set_ui_data(node, NULL); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6298 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6299 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6300 |
15822 | 6301 static gboolean do_selection_changed(PurpleBlistNode *new_selection) |
6302 { | |
6303 PurpleBlistNode *old_selection = NULL; | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6304 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6305 /* 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
|
6306 if (gtkblist && new_selection != gtkblist->selected_node) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6307 old_selection = gtkblist->selected_node; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6308 gtkblist->selected_node = new_selection; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6309 if(new_selection) |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
6310 pidgin_blist_update(NULL, new_selection); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6311 if(old_selection) |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
6312 pidgin_blist_update(NULL, old_selection); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6313 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6314 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6315 return FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6316 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6317 |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
6318 static void pidgin_blist_selection_changed(GtkTreeSelection *selection, gpointer data) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6319 { |
15822 | 6320 PurpleBlistNode *new_selection = NULL; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6321 GtkTreeIter iter; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6322 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6323 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
|
6324 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
|
6325 NODE_COLUMN, &new_selection, -1); |
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 |
17451
0e4a789cd027
We use a timeout in our blist selection changed callback to prevent buddy
Stu Tomlinson <stu@nosnilmot.com>
parents:
17405
diff
changeset
|
6328 /* 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:
17405
diff
changeset
|
6329 * 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:
17405
diff
changeset
|
6330 * 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:
17405
diff
changeset
|
6331 */ |
0e4a789cd027
We use a timeout in our blist selection changed callback to prevent buddy
Stu Tomlinson <stu@nosnilmot.com>
parents:
17405
diff
changeset
|
6332 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:
17405
diff
changeset
|
6333 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:
17405
diff
changeset
|
6334 } else { |
0e4a789cd027
We use a timeout in our blist selection changed callback to prevent buddy
Stu Tomlinson <stu@nosnilmot.com>
parents:
17405
diff
changeset
|
6335 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:
17405
diff
changeset
|
6336 } |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6337 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6338 |
15822 | 6339 static gboolean insert_node(PurpleBuddyList *list, PurpleBlistNode *node, GtkTreeIter *iter) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6340 { |
32407
025230c2f7dd
Initialize parent_iter to prevent clang-analyzer from complaining.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32351
diff
changeset
|
6341 GtkTreeIter parent_iter = {0, NULL, NULL, NULL}, cur, *curptr = NULL; |
32350
cd46874707b1
Pidgin: Use the purple_blist_node_ accessor functions.
andrew.victor@mxit.com
parents:
32347
diff
changeset
|
6342 struct _pidgin_blist_node *gtknode = purple_blist_node_get_ui_data(node); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6343 GtkTreePath *newpath; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6344 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6345 if(!iter) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6346 return FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6347 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6348 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
|
6349 return FALSE; |
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 if(get_iter_from_node(node, &cur)) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6352 curptr = &cur; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6353 |
15822 | 6354 if(PURPLE_BLIST_NODE_IS_CONTACT(node) || PURPLE_BLIST_NODE_IS_CHAT(node)) { |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6355 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
|
6356 } else { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6357 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
|
6358 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6359 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6360 if(gtknode != NULL) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6361 gtk_tree_row_reference_free(gtknode->row); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6362 } else { |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
6363 pidgin_blist_new_node(node); |
32350
cd46874707b1
Pidgin: Use the purple_blist_node_ accessor functions.
andrew.victor@mxit.com
parents:
32347
diff
changeset
|
6364 gtknode = purple_blist_node_get_ui_data(node); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6365 } |
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 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
|
6368 iter); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6369 gtknode->row = |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6370 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
|
6371 newpath); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6372 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6373 gtk_tree_path_free(newpath); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6374 |
17613
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:
17597
diff
changeset
|
6375 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:
17597
diff
changeset
|
6376 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:
17597
diff
changeset
|
6377 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:
17597
diff
changeset
|
6378 -1); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6379 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6380 if(node->parent) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6381 GtkTreePath *expand = NULL; |
32350
cd46874707b1
Pidgin: Use the purple_blist_node_ accessor functions.
andrew.victor@mxit.com
parents:
32347
diff
changeset
|
6382 struct _pidgin_blist_node *gtkparentnode = purple_blist_node_get_ui_data(node->parent); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6383 |
15822 | 6384 if(PURPLE_BLIST_NODE_IS_GROUP(node->parent)) { |
6385 if(!purple_blist_node_get_bool(node->parent, "collapsed")) | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6386 expand = gtk_tree_model_get_path(GTK_TREE_MODEL(gtkblist->treemodel), &parent_iter); |
15822 | 6387 } else if(PURPLE_BLIST_NODE_IS_CONTACT(node->parent) && |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6388 gtkparentnode->contact_expanded) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6389 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
|
6390 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6391 if(expand) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6392 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
|
6393 gtk_tree_path_free(expand); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6394 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6395 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6396 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6397 return TRUE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6398 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6399 |
21582
b00659aa0acf
Fix showing groups that contain offline buddies that have the "Show when
Stu Tomlinson <stu@nosnilmot.com>
parents:
21560
diff
changeset
|
6400 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
|
6401 { |
b00659aa0acf
Fix showing groups that contain offline buddies that have the "Show when
Stu Tomlinson <stu@nosnilmot.com>
parents:
21560
diff
changeset
|
6402 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
|
6403 |
32350
cd46874707b1
Pidgin: Use the purple_blist_node_ accessor functions.
andrew.victor@mxit.com
parents:
32347
diff
changeset
|
6404 gnode = PURPLE_BLIST_NODE(group); |
21582
b00659aa0acf
Fix showing groups that contain offline buddies that have the "Show when
Stu Tomlinson <stu@nosnilmot.com>
parents:
21560
diff
changeset
|
6405 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
|
6406 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
|
6407 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
|
6408 PurpleBuddy *buddy = (PurpleBuddy *)bnode; |
32342
b6276b10cb10
Use the PurpleBuddy accessor functions.
andrew.victor@mxit.com
parents:
32305
diff
changeset
|
6409 if (purple_account_is_connected(purple_buddy_get_account(buddy)) && |
21582
b00659aa0acf
Fix showing groups that contain offline buddies that have the "Show when
Stu Tomlinson <stu@nosnilmot.com>
parents:
21560
diff
changeset
|
6410 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
|
6411 return TRUE; |
b00659aa0acf
Fix showing groups that contain offline buddies that have the "Show when
Stu Tomlinson <stu@nosnilmot.com>
parents:
21560
diff
changeset
|
6412 } |
b00659aa0acf
Fix showing groups that contain offline buddies that have the "Show when
Stu Tomlinson <stu@nosnilmot.com>
parents:
21560
diff
changeset
|
6413 } |
b00659aa0acf
Fix showing groups that contain offline buddies that have the "Show when
Stu Tomlinson <stu@nosnilmot.com>
parents:
21560
diff
changeset
|
6414 } |
b00659aa0acf
Fix showing groups that contain offline buddies that have the "Show when
Stu Tomlinson <stu@nosnilmot.com>
parents:
21560
diff
changeset
|
6415 return FALSE; |
b00659aa0acf
Fix showing groups that contain offline buddies that have the "Show when
Stu Tomlinson <stu@nosnilmot.com>
parents:
21560
diff
changeset
|
6416 } |
b00659aa0acf
Fix showing groups that contain offline buddies that have the "Show when
Stu Tomlinson <stu@nosnilmot.com>
parents:
21560
diff
changeset
|
6417 |
23156
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23129
diff
changeset
|
6418 /* 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:
23129
diff
changeset
|
6419 * 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:
23129
diff
changeset
|
6420 */ |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23129
diff
changeset
|
6421 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:
23129
diff
changeset
|
6422 PurpleBlistNode *node) |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23129
diff
changeset
|
6423 { |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23129
diff
changeset
|
6424 gint count; |
15822 | 6425 PurpleGroup *group; |
23156
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23129
diff
changeset
|
6426 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
|
6427 gboolean show = FALSE, show_offline = FALSE; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6428 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6429 g_return_if_fail(node != NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6430 |
17613
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:
17597
diff
changeset
|
6431 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:
17597
diff
changeset
|
6432 return; |
25924
584063555949
Remove trailing whitespace
Mark Doliner <mark@kingant.net>
parents:
25920
diff
changeset
|
6433 |
15822 | 6434 if (PURPLE_BLIST_NODE_IS_GROUP(node)) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6435 gnode = node; |
15822 | 6436 else if (PURPLE_BLIST_NODE_IS_BUDDY(node)) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6437 gnode = node->parent->parent; |
15822 | 6438 else if (PURPLE_BLIST_NODE_IS_CONTACT(node) || PURPLE_BLIST_NODE_IS_CHAT(node)) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6439 gnode = node->parent; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6440 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6441 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6442 |
15822 | 6443 group = (PurpleGroup*)gnode; |
6444 | |
21582
b00659aa0acf
Fix showing groups that contain offline buddies that have the "Show when
Stu Tomlinson <stu@nosnilmot.com>
parents:
21560
diff
changeset
|
6445 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
|
6446 |
b00659aa0acf
Fix showing groups that contain offline buddies that have the "Show when
Stu Tomlinson <stu@nosnilmot.com>
parents:
21560
diff
changeset
|
6447 if(show_offline) |
15822 | 6448 count = purple_blist_get_group_size(group, FALSE); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6449 else |
15822 | 6450 count = purple_blist_get_group_online_count(group); |
6451 | |
16062
07554cc5d090
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <stu@nosnilmot.com>
parents:
16010
diff
changeset
|
6452 if (count > 0 || purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/blist/show_empty_groups")) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6453 show = TRUE; |
27030
005d20d58ac7
Patch to change around some logic that should fix missing buddies that are
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27029
diff
changeset
|
6454 else if (PURPLE_BLIST_NODE_IS_BUDDY(node) && buddy_is_displayable((PurpleBuddy*)node)) { /* Or chat? */ |
005d20d58ac7
Patch to change around some logic that should fix missing buddies that are
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27029
diff
changeset
|
6455 show = TRUE; |
005d20d58ac7
Patch to change around some logic that should fix missing buddies that are
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27029
diff
changeset
|
6456 } else if (!show_offline) { |
21582
b00659aa0acf
Fix showing groups that contain offline buddies that have the "Show when
Stu Tomlinson <stu@nosnilmot.com>
parents:
21560
diff
changeset
|
6457 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
|
6458 } |
15373
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 if (show) { |
23156
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23129
diff
changeset
|
6461 gchar *title; |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23129
diff
changeset
|
6462 gboolean biglist; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6463 GtkTreeIter iter; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6464 GtkTreePath *path; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6465 gboolean expanded; |
25105
fc3600ba68f1
fixed group coloring
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25104
diff
changeset
|
6466 GdkColor *bgcolor = NULL; |
23156
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23129
diff
changeset
|
6467 GdkPixbuf *avatar = NULL; |
25108
06392c8252c0
Added text and font coloring for buddies, contacts and chats, as well as fix a few small bugs
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25107
diff
changeset
|
6468 PidginBlistTheme *theme = NULL; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6469 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6470 if(!insert_node(list, gnode, &iter)) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6471 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6472 |
25108
06392c8252c0
Added text and font coloring for buddies, contacts and chats, as well as fix a few small bugs
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25107
diff
changeset
|
6473 if ((theme = pidgin_blist_get_theme()) == NULL) |
06392c8252c0
Added text and font coloring for buddies, contacts and chats, as well as fix a few small bugs
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25107
diff
changeset
|
6474 bgcolor = NULL; |
25105
fc3600ba68f1
fixed group coloring
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25104
diff
changeset
|
6475 else if (purple_blist_node_get_bool(gnode, "collapsed") || count <= 0) |
fc3600ba68f1
fixed group coloring
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25104
diff
changeset
|
6476 bgcolor = pidgin_blist_theme_get_collapsed_background_color(theme); |
25920
c0e3b62f8098
* Alphabetize files in a few Makefile.am files
Mark Doliner <mark@kingant.net>
parents:
25919
diff
changeset
|
6477 else |
c0e3b62f8098
* Alphabetize files in a few Makefile.am files
Mark Doliner <mark@kingant.net>
parents:
25919
diff
changeset
|
6478 bgcolor = pidgin_blist_theme_get_expanded_background_color(theme); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6479 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6480 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
|
6481 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
|
6482 gtk_tree_path_free(path); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6483 |
15820 | 6484 title = pidgin_get_group_title(gnode, expanded); |
23156
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23129
diff
changeset
|
6485 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:
23129
diff
changeset
|
6486 |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23129
diff
changeset
|
6487 if (biglist) { |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23129
diff
changeset
|
6488 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:
23129
diff
changeset
|
6489 } |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6490 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6491 gtk_tree_store_set(gtkblist->treemodel, &iter, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6492 STATUS_ICON_VISIBLE_COLUMN, FALSE, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6493 STATUS_ICON_COLUMN, NULL, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6494 NAME_COLUMN, title, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6495 NODE_COLUMN, gnode, |
25105
fc3600ba68f1
fixed group coloring
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25104
diff
changeset
|
6496 BGCOLOR_COLUMN, bgcolor, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6497 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
|
6498 GROUP_EXPANDER_VISIBLE_COLUMN, TRUE, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6499 CONTACT_EXPANDER_VISIBLE_COLUMN, FALSE, |
23156
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23129
diff
changeset
|
6500 BUDDY_ICON_COLUMN, avatar, |
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23129
diff
changeset
|
6501 BUDDY_ICON_VISIBLE_COLUMN, biglist, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6502 IDLE_VISIBLE_COLUMN, FALSE, |
15462 | 6503 EMBLEM_VISIBLE_COLUMN, FALSE, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6504 -1); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6505 g_free(title); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6506 } else { |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
6507 pidgin_blist_hide_node(list, gnode, TRUE); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6508 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6509 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6510 |
15822 | 6511 static char *pidgin_get_group_title(PurpleBlistNode *gnode, gboolean expanded) |
6512 { | |
6513 PurpleGroup *group; | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6514 gboolean selected; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6515 char group_count[12] = ""; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6516 char *mark, *esc; |
18309
c50e960e7086
Patch from SuperMMX to correct group colors. Fixes #1640
Sean Egan <seanegan@gmail.com>
parents:
18285
diff
changeset
|
6517 PurpleBlistNode *selected_node = NULL; |
c50e960e7086
Patch from SuperMMX to correct group colors. Fixes #1640
Sean Egan <seanegan@gmail.com>
parents:
18285
diff
changeset
|
6518 GtkTreeIter iter; |
26572
f099e7f2739c
Several changes:
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26554
diff
changeset
|
6519 PidginThemeFont *pair; |
26554
548871664d3b
PidginBlistTheme now copies all its parameters instead of taking ownership.
Paul Aurich <paul@darkrain42.org>
parents:
26531
diff
changeset
|
6520 gchar const *text_color, *text_font; |
25106
d17d6e83f428
Added layout capabilities to blist themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25105
diff
changeset
|
6521 PidginBlistTheme *theme; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6522 |
15822 | 6523 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
|
6524 |
18309
c50e960e7086
Patch from SuperMMX to correct group colors. Fixes #1640
Sean Egan <seanegan@gmail.com>
parents:
18285
diff
changeset
|
6525 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
|
6526 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
|
6527 NODE_COLUMN, &selected_node, -1); |
c50e960e7086
Patch from SuperMMX to correct group colors. Fixes #1640
Sean Egan <seanegan@gmail.com>
parents:
18285
diff
changeset
|
6528 } |
c50e960e7086
Patch from SuperMMX to correct group colors. Fixes #1640
Sean Egan <seanegan@gmail.com>
parents:
18285
diff
changeset
|
6529 selected = (gnode == selected_node); |
15373
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 if (!expanded) { |
27334
9715022e8e35
De-emphasize the () around the collapsed group counts. I can't actually see
Etan Reisner <pidgin@unreliablesource.net>
parents:
27333
diff
changeset
|
6532 g_snprintf(group_count, sizeof(group_count), "%d/%d", |
15822 | 6533 purple_blist_get_group_online_count(group), |
6534 purple_blist_get_group_size(group, FALSE)); | |
15373
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 |
25106
d17d6e83f428
Added layout capabilities to blist themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25105
diff
changeset
|
6537 theme = pidgin_blist_get_theme(); |
25108
06392c8252c0
Added text and font coloring for buddies, contacts and chats, as well as fix a few small bugs
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25107
diff
changeset
|
6538 if (theme == NULL) |
06392c8252c0
Added text and font coloring for buddies, contacts and chats, as well as fix a few small bugs
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25107
diff
changeset
|
6539 pair = NULL; |
25920
c0e3b62f8098
* Alphabetize files in a few Makefile.am files
Mark Doliner <mark@kingant.net>
parents:
25919
diff
changeset
|
6540 else if (expanded) |
c0e3b62f8098
* Alphabetize files in a few Makefile.am files
Mark Doliner <mark@kingant.net>
parents:
25919
diff
changeset
|
6541 pair = pidgin_blist_theme_get_expanded_text_info(theme); |
c0e3b62f8098
* Alphabetize files in a few Makefile.am files
Mark Doliner <mark@kingant.net>
parents:
25919
diff
changeset
|
6542 else |
c0e3b62f8098
* Alphabetize files in a few Makefile.am files
Mark Doliner <mark@kingant.net>
parents:
25919
diff
changeset
|
6543 pair = pidgin_blist_theme_get_collapsed_text_info(theme); |
25108
06392c8252c0
Added text and font coloring for buddies, contacts and chats, as well as fix a few small bugs
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25107
diff
changeset
|
6544 |
25924
584063555949
Remove trailing whitespace
Mark Doliner <mark@kingant.net>
parents:
25920
diff
changeset
|
6545 |
26572
f099e7f2739c
Several changes:
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26554
diff
changeset
|
6546 text_color = selected ? NULL : theme_font_get_color_default(pair, NULL); |
f099e7f2739c
Several changes:
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26554
diff
changeset
|
6547 text_font = theme_font_get_face_default(pair, ""); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6548 |
32346
2fdc668362f0
Use the purple_group_get_name() accessor function.
andrew.victor@mxit.com
parents:
32342
diff
changeset
|
6549 esc = g_markup_escape_text(purple_group_get_name(group), -1); |
25966
36f6f798e48a
Use text colours from the GTK+ theme instead of black when no buddy list theme
Marcus Lundblad <ml@update.uu.se>
parents:
25947
diff
changeset
|
6550 if (text_color) { |
27334
9715022e8e35
De-emphasize the () around the collapsed group counts. I can't actually see
Etan Reisner <pidgin@unreliablesource.net>
parents:
27333
diff
changeset
|
6551 mark = g_strdup_printf("<span foreground='%s' font_desc='%s'><b>%s</b>%s%s%s</span>", |
9715022e8e35
De-emphasize the () around the collapsed group counts. I can't actually see
Etan Reisner <pidgin@unreliablesource.net>
parents:
27333
diff
changeset
|
6552 text_color, text_font, |
9715022e8e35
De-emphasize the () around the collapsed group counts. I can't actually see
Etan Reisner <pidgin@unreliablesource.net>
parents:
27333
diff
changeset
|
6553 esc ? esc : "", |
27411
b2106bf5a6b4
Apparently font_weight was only relatively recently added to pango, so use
Etan Reisner <pidgin@unreliablesource.net>
parents:
27408
diff
changeset
|
6554 !expanded ? " <span weight='light'>(</span>" : "", |
27334
9715022e8e35
De-emphasize the () around the collapsed group counts. I can't actually see
Etan Reisner <pidgin@unreliablesource.net>
parents:
27333
diff
changeset
|
6555 group_count, |
27411
b2106bf5a6b4
Apparently font_weight was only relatively recently added to pango, so use
Etan Reisner <pidgin@unreliablesource.net>
parents:
27408
diff
changeset
|
6556 !expanded ? "<span weight='light'>)</span>" : ""); |
25966
36f6f798e48a
Use text colours from the GTK+ theme instead of black when no buddy list theme
Marcus Lundblad <ml@update.uu.se>
parents:
25947
diff
changeset
|
6557 } else { |
27334
9715022e8e35
De-emphasize the () around the collapsed group counts. I can't actually see
Etan Reisner <pidgin@unreliablesource.net>
parents:
27333
diff
changeset
|
6558 mark = g_strdup_printf("<span font_desc='%s'><b>%s</b>%s%s%s</span>", |
9715022e8e35
De-emphasize the () around the collapsed group counts. I can't actually see
Etan Reisner <pidgin@unreliablesource.net>
parents:
27333
diff
changeset
|
6559 text_font, esc ? esc : "", |
27411
b2106bf5a6b4
Apparently font_weight was only relatively recently added to pango, so use
Etan Reisner <pidgin@unreliablesource.net>
parents:
27408
diff
changeset
|
6560 !expanded ? " <span weight='light'>(</span>" : "", |
27334
9715022e8e35
De-emphasize the () around the collapsed group counts. I can't actually see
Etan Reisner <pidgin@unreliablesource.net>
parents:
27333
diff
changeset
|
6561 group_count, |
27411
b2106bf5a6b4
Apparently font_weight was only relatively recently added to pango, so use
Etan Reisner <pidgin@unreliablesource.net>
parents:
27408
diff
changeset
|
6562 !expanded ? "<span weight='light'>)</span>" : ""); |
25966
36f6f798e48a
Use text colours from the GTK+ theme instead of black when no buddy list theme
Marcus Lundblad <ml@update.uu.se>
parents:
25947
diff
changeset
|
6563 } |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6564 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6565 g_free(esc); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6566 return mark; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6567 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6568 |
15822 | 6569 static void buddy_node(PurpleBuddy *buddy, GtkTreeIter *iter, PurpleBlistNode *node) |
6570 { | |
25108
06392c8252c0
Added text and font coloring for buddies, contacts and chats, as well as fix a few small bugs
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25107
diff
changeset
|
6571 PurplePresence *presence = purple_buddy_get_presence(buddy); |
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
|
6572 GdkPixbuf *status, *avatar, *emblem, *prpl_icon; |
25108
06392c8252c0
Added text and font coloring for buddies, contacts and chats, as well as fix a few small bugs
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25107
diff
changeset
|
6573 GdkColor *color = NULL; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6574 char *mark; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6575 char *idle = NULL; |
32350
cd46874707b1
Pidgin: Use the purple_blist_node_ accessor functions.
andrew.victor@mxit.com
parents:
32347
diff
changeset
|
6576 gboolean expanded = ((struct _pidgin_blist_node *)purple_blist_node_get_ui_data(node->parent))->contact_expanded; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6577 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
|
6578 gboolean biglist = purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/blist/show_buddy_icons"); |
25924
584063555949
Remove trailing whitespace
Mark Doliner <mark@kingant.net>
parents:
25920
diff
changeset
|
6579 PidginBlistTheme *theme; |
15822 | 6580 |
17613
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:
17597
diff
changeset
|
6581 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:
17597
diff
changeset
|
6582 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
|
6583 |
32350
cd46874707b1
Pidgin: Use the purple_blist_node_ accessor functions.
andrew.victor@mxit.com
parents:
32347
diff
changeset
|
6584 status = pidgin_blist_get_status_icon(PURPLE_BLIST_NODE(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
|
6585 biglist ? PIDGIN_STATUS_ICON_LARGE : PIDGIN_STATUS_ICON_SMALL); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6586 |
16894
aa87ecd650d2
Speed up blist manipulations, by Scott Wolchok (EvilSporkMan)
Ethan Blanton <elb@pidgin.im>
parents:
16847
diff
changeset
|
6587 /* 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:
16847
diff
changeset
|
6588 if(biglist) |
32350
cd46874707b1
Pidgin: Use the purple_blist_node_ accessor functions.
andrew.victor@mxit.com
parents:
32347
diff
changeset
|
6589 avatar = pidgin_blist_get_buddy_icon(PURPLE_BLIST_NODE(buddy), TRUE, TRUE); |
16894
aa87ecd650d2
Speed up blist manipulations, by Scott Wolchok (EvilSporkMan)
Ethan Blanton <elb@pidgin.im>
parents:
16847
diff
changeset
|
6590 else |
aa87ecd650d2
Speed up blist manipulations, by Scott Wolchok (EvilSporkMan)
Ethan Blanton <elb@pidgin.im>
parents:
16847
diff
changeset
|
6591 avatar = NULL; |
aa87ecd650d2
Speed up blist manipulations, by Scott Wolchok (EvilSporkMan)
Ethan Blanton <elb@pidgin.im>
parents:
16847
diff
changeset
|
6592 |
15396
a8ee645e7fb4
A lot of status icon changes:
Sean Egan <seanegan@gmail.com>
parents:
15373
diff
changeset
|
6593 if (!avatar) { |
a8ee645e7fb4
A lot of status icon changes:
Sean Egan <seanegan@gmail.com>
parents:
15373
diff
changeset
|
6594 g_object_ref(G_OBJECT(gtkblist->empty_avatar)); |
a8ee645e7fb4
A lot of status icon changes:
Sean Egan <seanegan@gmail.com>
parents:
15373
diff
changeset
|
6595 avatar = gtkblist->empty_avatar; |
15822 | 6596 } else if ((!PURPLE_BUDDY_IS_ONLINE(buddy) || purple_presence_is_idle(presence))) { |
29482
bd28b8515eb2
Simplify: dest always equals src. No need to copy everything.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29473
diff
changeset
|
6597 do_alphashift(avatar, 77); |
15490
88070d5f4c62
dim buddy icons on idle and offline. Still need to do status icons.
Sean Egan <seanegan@gmail.com>
parents:
15489
diff
changeset
|
6598 } |
88070d5f4c62
dim buddy icons on idle and offline. Still need to do status icons.
Sean Egan <seanegan@gmail.com>
parents:
15489
diff
changeset
|
6599 |
32350
cd46874707b1
Pidgin: Use the purple_blist_node_ accessor functions.
andrew.victor@mxit.com
parents:
32347
diff
changeset
|
6600 emblem = pidgin_blist_get_emblem(PURPLE_BLIST_NODE(buddy)); |
18211
84b577372b90
Show screenname instead of alias in conversation infopanes
Sean Egan <seanegan@gmail.com>
parents:
18208
diff
changeset
|
6601 mark = pidgin_blist_get_name_markup(buddy, selected, TRUE); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6602 |
25108
06392c8252c0
Added text and font coloring for buddies, contacts and chats, as well as fix a few small bugs
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25107
diff
changeset
|
6603 theme = pidgin_blist_get_theme(); |
06392c8252c0
Added text and font coloring for buddies, contacts and chats, as well as fix a few small bugs
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25107
diff
changeset
|
6604 |
16062
07554cc5d090
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <stu@nosnilmot.com>
parents:
16010
diff
changeset
|
6605 if (purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/blist/show_idle_time") && |
25108
06392c8252c0
Added text and font coloring for buddies, contacts and chats, as well as fix a few small bugs
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25107
diff
changeset
|
6606 purple_presence_is_idle(presence) && !biglist) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6607 { |
15822 | 6608 time_t idle_secs = purple_presence_get_idle_time(presence); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6609 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6610 if (idle_secs > 0) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6611 { |
26572
f099e7f2739c
Several changes:
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26554
diff
changeset
|
6612 PidginThemeFont *pair = NULL; |
25108
06392c8252c0
Added text and font coloring for buddies, contacts and chats, as well as fix a few small bugs
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25107
diff
changeset
|
6613 const gchar *textcolor; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6614 time_t t; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6615 int ihrs, imin; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6616 time(&t); |
25108
06392c8252c0
Added text and font coloring for buddies, contacts and chats, as well as fix a few small bugs
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25107
diff
changeset
|
6617 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6618 ihrs = (t - idle_secs) / 3600; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6619 imin = ((t - idle_secs) / 60) % 60; |
25108
06392c8252c0
Added text and font coloring for buddies, contacts and chats, as well as fix a few small bugs
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25107
diff
changeset
|
6620 |
28063
f1a8a28432f4
Make idle and offline buddy names and the idle time in the small list grey
Mark Doliner <mark@kingant.net>
parents:
27999
diff
changeset
|
6621 if (selected) |
f1a8a28432f4
Make idle and offline buddy names and the idle time in the small list grey
Mark Doliner <mark@kingant.net>
parents:
27999
diff
changeset
|
6622 textcolor = NULL; |
f1a8a28432f4
Make idle and offline buddy names and the idle time in the small list grey
Mark Doliner <mark@kingant.net>
parents:
27999
diff
changeset
|
6623 else if (theme != NULL && (pair = pidgin_blist_theme_get_idle_text_info(theme)) != NULL) |
26572
f099e7f2739c
Several changes:
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26554
diff
changeset
|
6624 textcolor = pidgin_theme_font_get_color_describe(pair); |
25920
c0e3b62f8098
* Alphabetize files in a few Makefile.am files
Mark Doliner <mark@kingant.net>
parents:
25919
diff
changeset
|
6625 else |
28063
f1a8a28432f4
Make idle and offline buddy names and the idle time in the small list grey
Mark Doliner <mark@kingant.net>
parents:
27999
diff
changeset
|
6626 /* If no theme them default to making idle buddy names grey */ |
f1a8a28432f4
Make idle and offline buddy names and the idle time in the small list grey
Mark Doliner <mark@kingant.net>
parents:
27999
diff
changeset
|
6627 textcolor = "dim grey"; |
25966
36f6f798e48a
Use text colours from the GTK+ theme instead of black when no buddy list theme
Marcus Lundblad <ml@update.uu.se>
parents:
25947
diff
changeset
|
6628 |
36f6f798e48a
Use text colours from the GTK+ theme instead of black when no buddy list theme
Marcus Lundblad <ml@update.uu.se>
parents:
25947
diff
changeset
|
6629 if (textcolor) { |
36f6f798e48a
Use text colours from the GTK+ theme instead of black when no buddy list theme
Marcus Lundblad <ml@update.uu.se>
parents:
25947
diff
changeset
|
6630 idle = g_strdup_printf("<span color='%s' font_desc='%s'>%d:%02d</span>", |
26572
f099e7f2739c
Several changes:
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26554
diff
changeset
|
6631 textcolor, theme_font_get_face_default(pair, ""), |
25966
36f6f798e48a
Use text colours from the GTK+ theme instead of black when no buddy list theme
Marcus Lundblad <ml@update.uu.se>
parents:
25947
diff
changeset
|
6632 ihrs, imin); |
36f6f798e48a
Use text colours from the GTK+ theme instead of black when no buddy list theme
Marcus Lundblad <ml@update.uu.se>
parents:
25947
diff
changeset
|
6633 } else { |
36f6f798e48a
Use text colours from the GTK+ theme instead of black when no buddy list theme
Marcus Lundblad <ml@update.uu.se>
parents:
25947
diff
changeset
|
6634 idle = g_strdup_printf("<span font_desc='%s'>%d:%02d</span>", |
31086
a8cc50c2279f
Remove trailing whitespace
Richard Laager <rlaager@wiktel.com>
parents:
30459
diff
changeset
|
6635 theme_font_get_face_default(pair, ""), |
25966
36f6f798e48a
Use text colours from the GTK+ theme instead of black when no buddy list theme
Marcus Lundblad <ml@update.uu.se>
parents:
25947
diff
changeset
|
6636 ihrs, imin); |
36f6f798e48a
Use text colours from the GTK+ theme instead of black when no buddy list theme
Marcus Lundblad <ml@update.uu.se>
parents:
25947
diff
changeset
|
6637 } |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6638 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6639 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6640 |
32342
b6276b10cb10
Use the PurpleBuddy accessor functions.
andrew.victor@mxit.com
parents:
32305
diff
changeset
|
6641 prpl_icon = pidgin_create_prpl_icon(purple_buddy_get_account(buddy), PIDGIN_PRPL_ICON_SMALL); |
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
|
6642 |
25108
06392c8252c0
Added text and font coloring for buddies, contacts and chats, as well as fix a few small bugs
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25107
diff
changeset
|
6643 if (theme != NULL) |
06392c8252c0
Added text and font coloring for buddies, contacts and chats, as well as fix a few small bugs
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25107
diff
changeset
|
6644 color = pidgin_blist_theme_get_contact_color(theme); |
06392c8252c0
Added text and font coloring for buddies, contacts and chats, as well as fix a few small bugs
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25107
diff
changeset
|
6645 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6646 gtk_tree_store_set(gtkblist->treemodel, iter, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6647 STATUS_ICON_COLUMN, status, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6648 STATUS_ICON_VISIBLE_COLUMN, TRUE, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6649 NAME_COLUMN, mark, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6650 IDLE_COLUMN, idle, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6651 IDLE_VISIBLE_COLUMN, !biglist && idle, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6652 BUDDY_ICON_COLUMN, avatar, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6653 BUDDY_ICON_VISIBLE_COLUMN, biglist, |
15462 | 6654 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
|
6655 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
|
6656 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
|
6657 PROTOCOL_ICON_VISIBLE_COLUMN, purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/blist/show_protocol_icons"), |
25108
06392c8252c0
Added text and font coloring for buddies, contacts and chats, as well as fix a few small bugs
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25107
diff
changeset
|
6658 BGCOLOR_COLUMN, color, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6659 CONTACT_EXPANDER_COLUMN, NULL, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6660 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
|
6661 GROUP_EXPANDER_VISIBLE_COLUMN, FALSE, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6662 -1); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6663 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6664 g_free(mark); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6665 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
|
6666 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
|
6667 g_object_unref(emblem); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6668 if(status) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6669 g_object_unref(status); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6670 if(avatar) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6671 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
|
6672 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
|
6673 g_object_unref(prpl_icon); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6674 } |
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 /* 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
|
6677 can know in advance which buddy has changed so we can just update that */ |
15822 | 6678 static void pidgin_blist_update_contact(PurpleBuddyList *list, PurpleBlistNode *node) |
6679 { | |
6680 PurpleBlistNode *cnode; | |
6681 PurpleContact *contact; | |
6682 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
|
6683 gboolean biglist = purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/blist/show_buddy_icons"); |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
6684 struct _pidgin_blist_node *gtknode; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6685 |
17613
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:
17597
diff
changeset
|
6686 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:
17597
diff
changeset
|
6687 return; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6688 |
15822 | 6689 if (PURPLE_BLIST_NODE_IS_BUDDY(node)) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6690 cnode = node->parent; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6691 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6692 cnode = node; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6693 |
15822 | 6694 g_return_if_fail(PURPLE_BLIST_NODE_IS_CONTACT(cnode)); |
15373
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 /* First things first, update the group */ |
15822 | 6697 if (PURPLE_BLIST_NODE_IS_BUDDY(node)) |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
6698 pidgin_blist_update_group(list, node); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6699 else |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
6700 pidgin_blist_update_group(list, cnode->parent); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6701 |
15822 | 6702 contact = (PurpleContact*)cnode; |
6703 buddy = purple_contact_get_priority_buddy(contact); | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6704 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6705 if (buddy_is_displayable(buddy)) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6706 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6707 GtkTreeIter iter; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6708 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6709 if(!insert_node(list, cnode, &iter)) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6710 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6711 |
32350
cd46874707b1
Pidgin: Use the purple_blist_node_ accessor functions.
andrew.victor@mxit.com
parents:
32347
diff
changeset
|
6712 gtknode = purple_blist_node_get_ui_data(cnode); |
15373
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 if(gtknode->contact_expanded) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6715 GdkPixbuf *status; |
25896
6c6846d169d6
This patch fixes a few string leaks (don't g_strdup the FontColorPair? values) and also fixes the bug where, with no theme, everyone on the buddy list is colored "dim grey" (chunks 2, 3, and 4 in the patch)
Paul Aurich <paul@darkrain42.org>
parents:
25891
diff
changeset
|
6716 gchar *mark, *tmp; |
6c6846d169d6
This patch fixes a few string leaks (don't g_strdup the FontColorPair? values) and also fixes the bug where, with no theme, everyone on the buddy list is colored "dim grey" (chunks 2, 3, and 4 in the patch)
Paul Aurich <paul@darkrain42.org>
parents:
25891
diff
changeset
|
6717 const gchar *fg_color, *font; |
25108
06392c8252c0
Added text and font coloring for buddies, contacts and chats, as well as fix a few small bugs
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25107
diff
changeset
|
6718 GdkColor *color = NULL; |
28211
0d9f5172ebc9
No need to call this twice.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28097
diff
changeset
|
6719 PidginBlistTheme *theme; |
26572
f099e7f2739c
Several changes:
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26554
diff
changeset
|
6720 PidginThemeFont *pair; |
25109
824e97a1dd22
fixed some small font bugs, the coloring when selected, and a segfault
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25108
diff
changeset
|
6721 gboolean selected = (gtkblist->selected_node == cnode); |
25896
6c6846d169d6
This patch fixes a few string leaks (don't g_strdup the FontColorPair? values) and also fixes the bug where, with no theme, everyone on the buddy list is colored "dim grey" (chunks 2, 3, and 4 in the patch)
Paul Aurich <paul@darkrain42.org>
parents:
25891
diff
changeset
|
6722 |
25108
06392c8252c0
Added text and font coloring for buddies, contacts and chats, as well as fix a few small bugs
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25107
diff
changeset
|
6723 mark = g_markup_escape_text(purple_contact_get_alias(contact), -1); |
06392c8252c0
Added text and font coloring for buddies, contacts and chats, as well as fix a few small bugs
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25107
diff
changeset
|
6724 |
25896
6c6846d169d6
This patch fixes a few string leaks (don't g_strdup the FontColorPair? values) and also fixes the bug where, with no theme, everyone on the buddy list is colored "dim grey" (chunks 2, 3, and 4 in the patch)
Paul Aurich <paul@darkrain42.org>
parents:
25891
diff
changeset
|
6725 theme = pidgin_blist_get_theme(); |
6c6846d169d6
This patch fixes a few string leaks (don't g_strdup the FontColorPair? values) and also fixes the bug where, with no theme, everyone on the buddy list is colored "dim grey" (chunks 2, 3, and 4 in the patch)
Paul Aurich <paul@darkrain42.org>
parents:
25891
diff
changeset
|
6726 if (theme == NULL) |
6c6846d169d6
This patch fixes a few string leaks (don't g_strdup the FontColorPair? values) and also fixes the bug where, with no theme, everyone on the buddy list is colored "dim grey" (chunks 2, 3, and 4 in the patch)
Paul Aurich <paul@darkrain42.org>
parents:
25891
diff
changeset
|
6727 pair = NULL; |
6c6846d169d6
This patch fixes a few string leaks (don't g_strdup the FontColorPair? values) and also fixes the bug where, with no theme, everyone on the buddy list is colored "dim grey" (chunks 2, 3, and 4 in the patch)
Paul Aurich <paul@darkrain42.org>
parents:
25891
diff
changeset
|
6728 else { |
6c6846d169d6
This patch fixes a few string leaks (don't g_strdup the FontColorPair? values) and also fixes the bug where, with no theme, everyone on the buddy list is colored "dim grey" (chunks 2, 3, and 4 in the patch)
Paul Aurich <paul@darkrain42.org>
parents:
25891
diff
changeset
|
6729 pair = pidgin_blist_theme_get_contact_text_info(theme); |
25108
06392c8252c0
Added text and font coloring for buddies, contacts and chats, as well as fix a few small bugs
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25107
diff
changeset
|
6730 color = pidgin_blist_theme_get_contact_color(theme); |
06392c8252c0
Added text and font coloring for buddies, contacts and chats, as well as fix a few small bugs
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25107
diff
changeset
|
6731 } |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6732 |
26572
f099e7f2739c
Several changes:
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26554
diff
changeset
|
6733 font = theme_font_get_face_default(pair, ""); |
f099e7f2739c
Several changes:
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26554
diff
changeset
|
6734 fg_color = selected ? NULL : theme_font_get_color_default(pair, NULL); |
25966
36f6f798e48a
Use text colours from the GTK+ theme instead of black when no buddy list theme
Marcus Lundblad <ml@update.uu.se>
parents:
25947
diff
changeset
|
6735 |
36f6f798e48a
Use text colours from the GTK+ theme instead of black when no buddy list theme
Marcus Lundblad <ml@update.uu.se>
parents:
25947
diff
changeset
|
6736 if (fg_color) { |
36f6f798e48a
Use text colours from the GTK+ theme instead of black when no buddy list theme
Marcus Lundblad <ml@update.uu.se>
parents:
25947
diff
changeset
|
6737 tmp = g_strdup_printf("<span font_desc='%s' color='%s'>%s</span>", |
25896
6c6846d169d6
This patch fixes a few string leaks (don't g_strdup the FontColorPair? values) and also fixes the bug where, with no theme, everyone on the buddy list is colored "dim grey" (chunks 2, 3, and 4 in the patch)
Paul Aurich <paul@darkrain42.org>
parents:
25891
diff
changeset
|
6738 font, fg_color, mark); |
25966
36f6f798e48a
Use text colours from the GTK+ theme instead of black when no buddy list theme
Marcus Lundblad <ml@update.uu.se>
parents:
25947
diff
changeset
|
6739 } else { |
31086
a8cc50c2279f
Remove trailing whitespace
Richard Laager <rlaager@wiktel.com>
parents:
30459
diff
changeset
|
6740 tmp = g_strdup_printf("<span font_desc='%s'>%s</span>", font, |
25966
36f6f798e48a
Use text colours from the GTK+ theme instead of black when no buddy list theme
Marcus Lundblad <ml@update.uu.se>
parents:
25947
diff
changeset
|
6741 mark); |
36f6f798e48a
Use text colours from the GTK+ theme instead of black when no buddy list theme
Marcus Lundblad <ml@update.uu.se>
parents:
25947
diff
changeset
|
6742 } |
25896
6c6846d169d6
This patch fixes a few string leaks (don't g_strdup the FontColorPair? values) and also fixes the bug where, with no theme, everyone on the buddy list is colored "dim grey" (chunks 2, 3, and 4 in the patch)
Paul Aurich <paul@darkrain42.org>
parents:
25891
diff
changeset
|
6743 g_free(mark); |
6c6846d169d6
This patch fixes a few string leaks (don't g_strdup the FontColorPair? values) and also fixes the bug where, with no theme, everyone on the buddy list is colored "dim grey" (chunks 2, 3, and 4 in the patch)
Paul Aurich <paul@darkrain42.org>
parents:
25891
diff
changeset
|
6744 mark = tmp; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6745 |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
6746 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
|
6747 biglist? PIDGIN_STATUS_ICON_LARGE : PIDGIN_STATUS_ICON_SMALL); |
15373
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 gtk_tree_store_set(gtkblist->treemodel, &iter, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6750 STATUS_ICON_COLUMN, status, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6751 STATUS_ICON_VISIBLE_COLUMN, TRUE, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6752 NAME_COLUMN, mark, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6753 IDLE_COLUMN, NULL, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6754 IDLE_VISIBLE_COLUMN, FALSE, |
25108
06392c8252c0
Added text and font coloring for buddies, contacts and chats, as well as fix a few small bugs
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25107
diff
changeset
|
6755 BGCOLOR_COLUMN, color, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6756 BUDDY_ICON_COLUMN, NULL, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6757 CONTACT_EXPANDER_COLUMN, TRUE, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6758 CONTACT_EXPANDER_VISIBLE_COLUMN, TRUE, |
24039
5045f2ce9cff
disapproval of revision 'f5ca7968e3f6be8f81d068232d389e0b1dab784b'
Kevin Stange <kevin@simguy.net>
parents:
24037
diff
changeset
|
6759 GROUP_EXPANDER_VISIBLE_COLUMN, FALSE, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6760 -1); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6761 g_free(mark); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6762 if(status) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6763 g_object_unref(status); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6764 } else { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6765 buddy_node(buddy, &iter, cnode); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6766 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6767 } else { |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
6768 pidgin_blist_hide_node(list, cnode, TRUE); |
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
6769 } |
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
6770 } |
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
6771 |
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
6772 |
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
6773 |
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
|
6774 static void pidgin_blist_update_buddy(PurpleBuddyList *list, PurpleBlistNode *node, gboolean status_change) |
15822 | 6775 { |
6776 PurpleBuddy *buddy; | |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
6777 struct _pidgin_blist_node *gtkparentnode; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6778 |
15822 | 6779 g_return_if_fail(PURPLE_BLIST_NODE_IS_BUDDY(node)); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6780 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6781 if (node->parent == NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6782 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6783 |
15822 | 6784 buddy = (PurpleBuddy*)node; |
15373
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 /* First things first, update the contact */ |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
6787 pidgin_blist_update_contact(list, node); |
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
6788 |
32350
cd46874707b1
Pidgin: Use the purple_blist_node_ accessor functions.
andrew.victor@mxit.com
parents:
32347
diff
changeset
|
6789 gtkparentnode = purple_blist_node_get_ui_data(node->parent); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6790 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6791 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
|
6792 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6793 GtkTreeIter iter; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6794 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6795 if (!insert_node(list, node, &iter)) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6796 return; |
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 buddy_node(buddy, &iter, node); |
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 } else { |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
6801 pidgin_blist_hide_node(list, node, TRUE); |
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
6802 } |
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
6803 |
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
6804 } |
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
6805 |
15822 | 6806 static void pidgin_blist_update_chat(PurpleBuddyList *list, PurpleBlistNode *node) |
6807 { | |
6808 PurpleChat *chat; | |
6809 | |
6810 g_return_if_fail(PURPLE_BLIST_NODE_IS_CHAT(node)); | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6811 |
17613
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:
17597
diff
changeset
|
6812 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:
17597
diff
changeset
|
6813 return; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6814 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6815 /* First things first, update the group */ |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
6816 pidgin_blist_update_group(list, node->parent); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6817 |
15822 | 6818 chat = (PurpleChat*)node; |
6819 | |
32347
76096c42f558
Use the PurpleChat accessor functions.
andrew.victor@mxit.com
parents:
32346
diff
changeset
|
6820 if(purple_account_is_connected(purple_chat_get_account(chat))) { |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6821 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
|
6822 GdkPixbuf *status, *avatar, *emblem, *prpl_icon; |
25898
dc2584ebaa1a
Adding the patch to extend the blist theme to allow coloring of chat nodes with unread messages mentioning your nick.
Paul Aurich <paul@darkrain42.org>
parents:
25896
diff
changeset
|
6823 const gchar *color, *font; |
dc2584ebaa1a
Adding the patch to extend the blist theme to allow coloring of chat nodes with unread messages mentioning your nick.
Paul Aurich <paul@darkrain42.org>
parents:
25896
diff
changeset
|
6824 gchar *mark, *tmp; |
16894
aa87ecd650d2
Speed up blist manipulations, by Scott Wolchok (EvilSporkMan)
Ethan Blanton <elb@pidgin.im>
parents:
16847
diff
changeset
|
6825 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
|
6826 gboolean biglist = purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/blist/show_buddy_icons"); |
19939
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
|
6827 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
|
6828 PurpleConversation *conv; |
26208 | 6829 gboolean hidden = FALSE; |
25108
06392c8252c0
Added text and font coloring for buddies, contacts and chats, as well as fix a few small bugs
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25107
diff
changeset
|
6830 GdkColor *bgcolor = NULL; |
26572
f099e7f2739c
Several changes:
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26554
diff
changeset
|
6831 PidginThemeFont *pair; |
25108
06392c8252c0
Added text and font coloring for buddies, contacts and chats, as well as fix a few small bugs
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25107
diff
changeset
|
6832 PidginBlistTheme *theme; |
25109
824e97a1dd22
fixed some small font bugs, the coloring when selected, and a segfault
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25108
diff
changeset
|
6833 gboolean selected = (gtkblist->selected_node == node); |
25898
dc2584ebaa1a
Adding the patch to extend the blist theme to allow coloring of chat nodes with unread messages mentioning your nick.
Paul Aurich <paul@darkrain42.org>
parents:
25896
diff
changeset
|
6834 gboolean nick_said = FALSE; |
19939
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
|
6835 |
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
|
6836 if (!insert_node(list, node, &iter)) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6837 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6838 |
32350
cd46874707b1
Pidgin: Use the purple_blist_node_ accessor functions.
andrew.victor@mxit.com
parents:
32347
diff
changeset
|
6839 ui = purple_blist_node_get_ui_data(node); |
19939
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
|
6840 conv = ui->conv.conv; |
25898
dc2584ebaa1a
Adding the patch to extend the blist theme to allow coloring of chat nodes with unread messages mentioning your nick.
Paul Aurich <paul@darkrain42.org>
parents:
25896
diff
changeset
|
6841 if (conv && pidgin_conv_is_hidden(PIDGIN_CONVERSATION(conv))) { |
dc2584ebaa1a
Adding the patch to extend the blist theme to allow coloring of chat nodes with unread messages mentioning your nick.
Paul Aurich <paul@darkrain42.org>
parents:
25896
diff
changeset
|
6842 hidden = (ui->conv.flags & PIDGIN_BLIST_NODE_HAS_PENDING_MESSAGE); |
dc2584ebaa1a
Adding the patch to extend the blist theme to allow coloring of chat nodes with unread messages mentioning your nick.
Paul Aurich <paul@darkrain42.org>
parents:
25896
diff
changeset
|
6843 nick_said = (ui->conv.flags & PIDGIN_BLIST_CHAT_HAS_PENDING_MESSAGE_WITH_NICK); |
dc2584ebaa1a
Adding the patch to extend the blist theme to allow coloring of chat nodes with unread messages mentioning your nick.
Paul Aurich <paul@darkrain42.org>
parents:
25896
diff
changeset
|
6844 } |
19939
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
|
6845 |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
6846 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
|
6847 biglist ? PIDGIN_STATUS_ICON_LARGE : PIDGIN_STATUS_ICON_SMALL); |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
6848 emblem = pidgin_blist_get_emblem(node); |
16894
aa87ecd650d2
Speed up blist manipulations, by Scott Wolchok (EvilSporkMan)
Ethan Blanton <elb@pidgin.im>
parents:
16847
diff
changeset
|
6849 |
aa87ecd650d2
Speed up blist manipulations, by Scott Wolchok (EvilSporkMan)
Ethan Blanton <elb@pidgin.im>
parents:
16847
diff
changeset
|
6850 /* 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:
16847
diff
changeset
|
6851 if(showicons) |
aa87ecd650d2
Speed up blist manipulations, by Scott Wolchok (EvilSporkMan)
Ethan Blanton <elb@pidgin.im>
parents:
16847
diff
changeset
|
6852 avatar = pidgin_blist_get_buddy_icon(node, TRUE, FALSE); |
aa87ecd650d2
Speed up blist manipulations, by Scott Wolchok (EvilSporkMan)
Ethan Blanton <elb@pidgin.im>
parents:
16847
diff
changeset
|
6853 else |
aa87ecd650d2
Speed up blist manipulations, by Scott Wolchok (EvilSporkMan)
Ethan Blanton <elb@pidgin.im>
parents:
16847
diff
changeset
|
6854 avatar = NULL; |
15422
051a5c4f0917
this would use the protocol icons in place of the buddy icon for chats,
Nathan Walp <nwalp@pidgin.im>
parents:
15417
diff
changeset
|
6855 |
15822 | 6856 mark = g_markup_escape_text(purple_chat_get_name(chat), -1); |
25924
584063555949
Remove trailing whitespace
Mark Doliner <mark@kingant.net>
parents:
25920
diff
changeset
|
6857 |
25108
06392c8252c0
Added text and font coloring for buddies, contacts and chats, as well as fix a few small bugs
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25107
diff
changeset
|
6858 theme = pidgin_blist_get_theme(); |
06392c8252c0
Added text and font coloring for buddies, contacts and chats, as well as fix a few small bugs
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25107
diff
changeset
|
6859 |
25924
584063555949
Remove trailing whitespace
Mark Doliner <mark@kingant.net>
parents:
25920
diff
changeset
|
6860 if (theme == NULL) |
25108
06392c8252c0
Added text and font coloring for buddies, contacts and chats, as well as fix a few small bugs
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25107
diff
changeset
|
6861 pair = NULL; |
25898
dc2584ebaa1a
Adding the patch to extend the blist theme to allow coloring of chat nodes with unread messages mentioning your nick.
Paul Aurich <paul@darkrain42.org>
parents:
25896
diff
changeset
|
6862 else if (nick_said) |
dc2584ebaa1a
Adding the patch to extend the blist theme to allow coloring of chat nodes with unread messages mentioning your nick.
Paul Aurich <paul@darkrain42.org>
parents:
25896
diff
changeset
|
6863 pair = pidgin_blist_theme_get_unread_message_nick_said_text_info(theme); |
25924
584063555949
Remove trailing whitespace
Mark Doliner <mark@kingant.net>
parents:
25920
diff
changeset
|
6864 else if (hidden) |
25108
06392c8252c0
Added text and font coloring for buddies, contacts and chats, as well as fix a few small bugs
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25107
diff
changeset
|
6865 pair = pidgin_blist_theme_get_unread_message_text_info(theme); |
25924
584063555949
Remove trailing whitespace
Mark Doliner <mark@kingant.net>
parents:
25920
diff
changeset
|
6866 else pair = pidgin_blist_theme_get_online_text_info(theme); |
25898
dc2584ebaa1a
Adding the patch to extend the blist theme to allow coloring of chat nodes with unread messages mentioning your nick.
Paul Aurich <paul@darkrain42.org>
parents:
25896
diff
changeset
|
6867 |
dc2584ebaa1a
Adding the patch to extend the blist theme to allow coloring of chat nodes with unread messages mentioning your nick.
Paul Aurich <paul@darkrain42.org>
parents:
25896
diff
changeset
|
6868 |
26572
f099e7f2739c
Several changes:
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26554
diff
changeset
|
6869 font = theme_font_get_face_default(pair, ""); |
f099e7f2739c
Several changes:
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26554
diff
changeset
|
6870 if (selected || !(color = theme_font_get_color_default(pair, NULL))) |
25898
dc2584ebaa1a
Adding the patch to extend the blist theme to allow coloring of chat nodes with unread messages mentioning your nick.
Paul Aurich <paul@darkrain42.org>
parents:
25896
diff
changeset
|
6871 /* nick_said color is the same as gtkconv:tab-label-attention */ |
25966
36f6f798e48a
Use text colours from the GTK+ theme instead of black when no buddy list theme
Marcus Lundblad <ml@update.uu.se>
parents:
25947
diff
changeset
|
6872 color = (nick_said ? "#006aff" : NULL); |
25108
06392c8252c0
Added text and font coloring for buddies, contacts and chats, as well as fix a few small bugs
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25107
diff
changeset
|
6873 |
25966
36f6f798e48a
Use text colours from the GTK+ theme instead of black when no buddy list theme
Marcus Lundblad <ml@update.uu.se>
parents:
25947
diff
changeset
|
6874 if (color) { |
36f6f798e48a
Use text colours from the GTK+ theme instead of black when no buddy list theme
Marcus Lundblad <ml@update.uu.se>
parents:
25947
diff
changeset
|
6875 tmp = g_strdup_printf("<span font_desc='%s' color='%s' weight='%s'>%s</span>", |
36f6f798e48a
Use text colours from the GTK+ theme instead of black when no buddy list theme
Marcus Lundblad <ml@update.uu.se>
parents:
25947
diff
changeset
|
6876 font, color, hidden ? "bold" : "normal", mark); |
36f6f798e48a
Use text colours from the GTK+ theme instead of black when no buddy list theme
Marcus Lundblad <ml@update.uu.se>
parents:
25947
diff
changeset
|
6877 } else { |
36f6f798e48a
Use text colours from the GTK+ theme instead of black when no buddy list theme
Marcus Lundblad <ml@update.uu.se>
parents:
25947
diff
changeset
|
6878 tmp = g_strdup_printf("<span font_desc='%s' weight='%s'>%s</span>", |
36f6f798e48a
Use text colours from the GTK+ theme instead of black when no buddy list theme
Marcus Lundblad <ml@update.uu.se>
parents:
25947
diff
changeset
|
6879 font, hidden ? "bold" : "normal", mark); |
36f6f798e48a
Use text colours from the GTK+ theme instead of black when no buddy list theme
Marcus Lundblad <ml@update.uu.se>
parents:
25947
diff
changeset
|
6880 } |
25108
06392c8252c0
Added text and font coloring for buddies, contacts and chats, as well as fix a few small bugs
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25107
diff
changeset
|
6881 g_free(mark); |
06392c8252c0
Added text and font coloring for buddies, contacts and chats, as well as fix a few small bugs
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25107
diff
changeset
|
6882 mark = tmp; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6883 |
32347
76096c42f558
Use the PurpleChat accessor functions.
andrew.victor@mxit.com
parents:
32346
diff
changeset
|
6884 prpl_icon = pidgin_create_prpl_icon(purple_chat_get_account(chat), PIDGIN_PRPL_ICON_SMALL); |
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
|
6885 |
25108
06392c8252c0
Added text and font coloring for buddies, contacts and chats, as well as fix a few small bugs
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25107
diff
changeset
|
6886 if (theme != NULL) |
06392c8252c0
Added text and font coloring for buddies, contacts and chats, as well as fix a few small bugs
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25107
diff
changeset
|
6887 bgcolor = pidgin_blist_theme_get_contact_color(theme); |
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
|
6888 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6889 gtk_tree_store_set(gtkblist->treemodel, &iter, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6890 STATUS_ICON_COLUMN, status, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6891 STATUS_ICON_VISIBLE_COLUMN, TRUE, |
15422
051a5c4f0917
this would use the protocol icons in place of the buddy icon for chats,
Nathan Walp <nwalp@pidgin.im>
parents:
15417
diff
changeset
|
6892 BUDDY_ICON_COLUMN, avatar ? avatar : gtkblist->empty_avatar, |
23156
da5d1ecc5c20
Add support for setting and removing custom buddy icons to contacts, chats,
Etan Reisner <pidgin@unreliablesource.net>
parents:
23129
diff
changeset
|
6893 BUDDY_ICON_VISIBLE_COLUMN, showicons, |
19558
f902cd0dc925
Boldify the hidden chats in the buddylist.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19540
diff
changeset
|
6894 EMBLEM_COLUMN, emblem, |
15462 | 6895 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
|
6896 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
|
6897 PROTOCOL_ICON_VISIBLE_COLUMN, purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/blist/show_protocol_icons"), |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6898 NAME_COLUMN, mark, |
25108
06392c8252c0
Added text and font coloring for buddies, contacts and chats, as well as fix a few small bugs
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25107
diff
changeset
|
6899 BGCOLOR_COLUMN, bgcolor, |
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
|
6900 GROUP_EXPANDER_VISIBLE_COLUMN, FALSE, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6901 -1); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6902 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6903 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
|
6904 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
|
6905 g_object_unref(emblem); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6906 if(status) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6907 g_object_unref(status); |
15422
051a5c4f0917
this would use the protocol icons in place of the buddy icon for chats,
Nathan Walp <nwalp@pidgin.im>
parents:
15417
diff
changeset
|
6908 if(avatar) |
051a5c4f0917
this would use the protocol icons in place of the buddy icon for chats,
Nathan Walp <nwalp@pidgin.im>
parents:
15417
diff
changeset
|
6909 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
|
6910 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
|
6911 g_object_unref(prpl_icon); |
25109
824e97a1dd22
fixed some small font bugs, the coloring when selected, and a segfault
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25108
diff
changeset
|
6912 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6913 } else { |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
6914 pidgin_blist_hide_node(list, node, TRUE); |
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
6915 } |
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
6916 } |
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
6917 |
15822 | 6918 static void pidgin_blist_update(PurpleBuddyList *list, PurpleBlistNode *node) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6919 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6920 if (list) |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
6921 gtkblist = PIDGIN_BLIST(list); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6922 if(!gtkblist || !gtkblist->treeview || !node) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6923 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6924 |
32350
cd46874707b1
Pidgin: Use the purple_blist_node_ accessor functions.
andrew.victor@mxit.com
parents:
32347
diff
changeset
|
6925 if (purple_blist_node_get_ui_data(node) == NULL) |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
6926 pidgin_blist_new_node(node); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6927 |
32351
03efb97b552b
Convert to using purple_blist_node_ accessor functions.
andrew.victor@mxit.com
parents:
32350
diff
changeset
|
6928 switch (purple_blist_node_get_type(node)) { |
15822 | 6929 case PURPLE_BLIST_GROUP_NODE: |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
6930 pidgin_blist_update_group(list, node); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6931 break; |
15822 | 6932 case PURPLE_BLIST_CONTACT_NODE: |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
6933 pidgin_blist_update_contact(list, node); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6934 break; |
15822 | 6935 case PURPLE_BLIST_BUDDY_NODE: |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
6936 pidgin_blist_update_buddy(list, node, TRUE); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6937 break; |
15822 | 6938 case PURPLE_BLIST_CHAT_NODE: |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
6939 pidgin_blist_update_chat(list, node); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6940 break; |
15822 | 6941 case PURPLE_BLIST_OTHER_NODE: |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6942 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6943 } |
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 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6946 |
15822 | 6947 static void pidgin_blist_destroy(PurpleBuddyList *list) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6948 { |
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
|
6949 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
|
6950 |
27480
cbee8aecc90a
Free the buddy list data some more at shutdown and some deprecations.
Paul Aurich <paul@darkrain42.org>
parents:
27411
diff
changeset
|
6951 if (!list || !list->ui_data) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6952 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6953 |
27514
381acdb3cedc
Fix a reversed assertion.
Paul Aurich <paul@darkrain42.org>
parents:
27480
diff
changeset
|
6954 g_return_if_fail(list->ui_data == gtkblist); |
27480
cbee8aecc90a
Free the buddy list data some more at shutdown and some deprecations.
Paul Aurich <paul@darkrain42.org>
parents:
27411
diff
changeset
|
6955 |
15822 | 6956 purple_signals_disconnect_by_handle(gtkblist); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6957 |
29616
0d613fa75e5f
Maintain ABI compatibility by keeping headline_close a GdkPixbuf.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29615
diff
changeset
|
6958 if (gtkblist->headline_close) |
32618
065b157e2b3c
Fix blist menu and small compile error.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32614
diff
changeset
|
6959 g_object_unref(G_OBJECT(gtkblist->headline_close)); |
29616
0d613fa75e5f
Maintain ABI compatibility by keeping headline_close a GdkPixbuf.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29615
diff
changeset
|
6960 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6961 gtk_widget_destroy(gtkblist->window); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6962 |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
6963 pidgin_blist_tooltip_destroy(); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6964 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6965 if (gtkblist->refresh_timer) |
26531
b162300ab1e7
A patch from Arunan Balasubramaniam to use timeouts in seconds instead of
foss@abala.me
parents:
26528
diff
changeset
|
6966 purple_timeout_remove(gtkblist->refresh_timer); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6967 if (gtkblist->timeout) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6968 g_source_remove(gtkblist->timeout); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6969 if (gtkblist->drag_timeout) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6970 g_source_remove(gtkblist->drag_timeout); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6971 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6972 gtkblist->refresh_timer = 0; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6973 gtkblist->timeout = 0; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6974 gtkblist->drag_timeout = 0; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6975 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
|
6976 g_object_unref(G_OBJECT(gtkblist->treemodel)); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6977 gtkblist->treemodel = NULL; |
32582
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
6978 g_object_unref(G_OBJECT(gtkblist->ui)); |
15396
a8ee645e7fb4
A lot of status icon changes:
Sean Egan <seanegan@gmail.com>
parents:
15373
diff
changeset
|
6979 g_object_unref(G_OBJECT(gtkblist->empty_avatar)); |
15373
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 gdk_cursor_unref(gtkblist->hand_cursor); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6982 gdk_cursor_unref(gtkblist->arrow_cursor); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6983 gtkblist->hand_cursor = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6984 gtkblist->arrow_cursor = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6985 |
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
|
6986 priv = PIDGIN_BUDDY_LIST_GET_PRIVATE(gtkblist); |
26991
85a4c248f751
Buddy List needs to take a reference to the loaded theme. Fixes #8798.
Paul Aurich <paul@darkrain42.org>
parents:
26884
diff
changeset
|
6987 if (priv->current_theme) |
85a4c248f751
Buddy List needs to take a reference to the loaded theme. Fixes #8798.
Paul Aurich <paul@darkrain42.org>
parents:
26884
diff
changeset
|
6988 g_object_unref(priv->current_theme); |
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
|
6989 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
|
6990 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6991 g_free(gtkblist); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6992 gtkblist = NULL; |
15822 | 6993 purple_prefs_disconnect_by_handle(pidgin_blist_get_handle()); |
6994 } | |
6995 | |
6996 static void pidgin_blist_set_visible(PurpleBuddyList *list, gboolean show) | |
15373
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 if (!(gtkblist && gtkblist->window)) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6999 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7000 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7001 if (show) { |
32686
3538e783b98c
Fix all deprecated GTK_WIDGET_* macros.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32684
diff
changeset
|
7002 if(!PIDGIN_WINDOW_ICONIFIED(gtkblist->window) && !gtk_widget_get_visible(gtkblist->window)) |
15822 | 7003 purple_signal_emit(pidgin_blist_get_handle(), "gtkblist-unhiding", gtkblist); |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
7004 pidgin_blist_restore_position(); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7005 gtk_window_present(GTK_WINDOW(gtkblist->window)); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7006 } else { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7007 if(visibility_manager_count) { |
15822 | 7008 purple_signal_emit(pidgin_blist_get_handle(), "gtkblist-hiding", gtkblist); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7009 gtk_widget_hide(gtkblist->window); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7010 } else { |
32686
3538e783b98c
Fix all deprecated GTK_WIDGET_* macros.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32684
diff
changeset
|
7011 if (!gtk_widget_get_visible(gtkblist->window)) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7012 gtk_widget_show(gtkblist->window); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7013 gtk_window_iconify(GTK_WINDOW(gtkblist->window)); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7014 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7015 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7016 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7017 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7018 static GList * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7019 groups_tree(void) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7020 { |
20028
a2b4eac83902
Part of #1332 to introduce pidgin_text_combo_box_new_entry and
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19681
diff
changeset
|
7021 static GList *list = NULL; |
15822 | 7022 PurpleGroup *g; |
7023 PurpleBlistNode *gnode; | |
7024 | |
20028
a2b4eac83902
Part of #1332 to introduce pidgin_text_combo_box_new_entry and
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19681
diff
changeset
|
7025 g_list_free(list); |
a2b4eac83902
Part of #1332 to introduce pidgin_text_combo_box_new_entry and
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19681
diff
changeset
|
7026 list = NULL; |
a2b4eac83902
Part of #1332 to introduce pidgin_text_combo_box_new_entry and
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19681
diff
changeset
|
7027 |
15822 | 7028 if (purple_get_blist()->root == NULL) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7029 { |
20028
a2b4eac83902
Part of #1332 to introduce pidgin_text_combo_box_new_entry and
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19681
diff
changeset
|
7030 list = g_list_append(list, (gpointer)_("Buddies")); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7031 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7032 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7033 { |
15822 | 7034 for (gnode = purple_get_blist()->root; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7035 gnode != NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7036 gnode = gnode->next) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7037 { |
15822 | 7038 if (PURPLE_BLIST_NODE_IS_GROUP(gnode)) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7039 { |
15822 | 7040 g = (PurpleGroup *)gnode; |
32346
2fdc668362f0
Use the purple_group_get_name() accessor function.
andrew.victor@mxit.com
parents:
32342
diff
changeset
|
7041 list = g_list_append(list, (char *) purple_group_get_name(g)); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7042 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7043 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7044 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7045 |
20028
a2b4eac83902
Part of #1332 to introduce pidgin_text_combo_box_new_entry and
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19681
diff
changeset
|
7046 return list; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7047 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7048 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7049 static void |
15822 | 7050 add_buddy_select_account_cb(GObject *w, PurpleAccount *account, |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
7051 PidginAddBuddyData *data) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7052 { |
31402
c0a122c22475
Show invite message entry in the Add Buddy dialog.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31374
diff
changeset
|
7053 PurpleConnection *pc = NULL; |
c0a122c22475
Show invite message entry in the Add Buddy dialog.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31374
diff
changeset
|
7054 PurplePlugin *prpl = NULL; |
c0a122c22475
Show invite message entry in the Add Buddy dialog.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31374
diff
changeset
|
7055 PurplePluginProtocolInfo *prpl_info = NULL; |
c0a122c22475
Show invite message entry in the Add Buddy dialog.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31374
diff
changeset
|
7056 gboolean invite_enabled = TRUE; |
c0a122c22475
Show invite message entry in the Add Buddy dialog.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31374
diff
changeset
|
7057 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7058 /* Save our account */ |
26884
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
7059 data->rq_data.account = account; |
31402
c0a122c22475
Show invite message entry in the Add Buddy dialog.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31374
diff
changeset
|
7060 |
c0a122c22475
Show invite message entry in the Add Buddy dialog.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31374
diff
changeset
|
7061 if (account) |
c0a122c22475
Show invite message entry in the Add Buddy dialog.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31374
diff
changeset
|
7062 pc = purple_account_get_connection(account); |
c0a122c22475
Show invite message entry in the Add Buddy dialog.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31374
diff
changeset
|
7063 if (pc) |
c0a122c22475
Show invite message entry in the Add Buddy dialog.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31374
diff
changeset
|
7064 prpl = purple_connection_get_prpl(pc); |
c0a122c22475
Show invite message entry in the Add Buddy dialog.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31374
diff
changeset
|
7065 if (prpl) |
c0a122c22475
Show invite message entry in the Add Buddy dialog.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31374
diff
changeset
|
7066 prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(prpl); |
c0a122c22475
Show invite message entry in the Add Buddy dialog.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31374
diff
changeset
|
7067 if (prpl_info && !(prpl_info->options & OPT_PROTO_INVITE_MESSAGE)) |
c0a122c22475
Show invite message entry in the Add Buddy dialog.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31374
diff
changeset
|
7068 invite_enabled = FALSE; |
c0a122c22475
Show invite message entry in the Add Buddy dialog.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31374
diff
changeset
|
7069 |
c0a122c22475
Show invite message entry in the Add Buddy dialog.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31374
diff
changeset
|
7070 gtk_widget_set_sensitive(data->entry_for_invite, invite_enabled); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7071 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7072 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7073 static void |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
7074 destroy_add_buddy_dialog_cb(GtkWidget *win, PidginAddBuddyData *data) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7075 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7076 g_free(data); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7077 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7078 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7079 static void |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
7080 add_buddy_cb(GtkWidget *w, int resp, PidginAddBuddyData *data) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7081 { |
31402
c0a122c22475
Show invite message entry in the Add Buddy dialog.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31374
diff
changeset
|
7082 const char *grp, *who, *whoalias, *invite; |
26884
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
7083 PurpleAccount *account; |
15822 | 7084 PurpleGroup *g; |
7085 PurpleBuddy *b; | |
7086 PurpleConversation *c; | |
7087 PurpleBuddyIcon *icon; | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7088 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7089 if (resp == GTK_RESPONSE_OK) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7090 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7091 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:
19681
diff
changeset
|
7092 grp = pidgin_text_combo_box_entry_get_text(data->combo); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7093 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
|
7094 if (*whoalias == '\0') |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7095 whoalias = NULL; |
31402
c0a122c22475
Show invite message entry in the Add Buddy dialog.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31374
diff
changeset
|
7096 invite = gtk_entry_get_text(GTK_ENTRY(data->entry_for_invite)); |
c0a122c22475
Show invite message entry in the Add Buddy dialog.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31374
diff
changeset
|
7097 if (*invite == '\0') |
c0a122c22475
Show invite message entry in the Add Buddy dialog.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31374
diff
changeset
|
7098 invite = NULL; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7099 |
26884
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
7100 account = data->rq_data.account; |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
7101 |
20161
0077c1f21f3d
Patch from db42. Fixes #3191
Sean Egan <seanegan@gmail.com>
parents:
20158
diff
changeset
|
7102 g = NULL; |
25242
6eecd6ba2862
Fix situation in which group was not specified and
Paul Aurich <paul@darkrain42.org>
parents:
25237
diff
changeset
|
7103 if ((grp != NULL) && (*grp != '\0')) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7104 { |
25242
6eecd6ba2862
Fix situation in which group was not specified and
Paul Aurich <paul@darkrain42.org>
parents:
25237
diff
changeset
|
7105 if ((g = purple_find_group(grp)) == NULL) |
6eecd6ba2862
Fix situation in which group was not specified and
Paul Aurich <paul@darkrain42.org>
parents:
25237
diff
changeset
|
7106 { |
6eecd6ba2862
Fix situation in which group was not specified and
Paul Aurich <paul@darkrain42.org>
parents:
25237
diff
changeset
|
7107 g = purple_group_new(grp); |
6eecd6ba2862
Fix situation in which group was not specified and
Paul Aurich <paul@darkrain42.org>
parents:
25237
diff
changeset
|
7108 purple_blist_add_group(g, NULL); |
6eecd6ba2862
Fix situation in which group was not specified and
Paul Aurich <paul@darkrain42.org>
parents:
25237
diff
changeset
|
7109 } |
6eecd6ba2862
Fix situation in which group was not specified and
Paul Aurich <paul@darkrain42.org>
parents:
25237
diff
changeset
|
7110 |
26884
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
7111 b = purple_find_buddy_in_group(account, who, g); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7112 } |
26884
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
7113 else if ((b = purple_find_buddy(account, who)) != NULL) |
25242
6eecd6ba2862
Fix situation in which group was not specified and
Paul Aurich <paul@darkrain42.org>
parents:
25237
diff
changeset
|
7114 { |
26206 | 7115 g = purple_buddy_get_group(b); |
25242
6eecd6ba2862
Fix situation in which group was not specified and
Paul Aurich <paul@darkrain42.org>
parents:
25237
diff
changeset
|
7116 } |
6eecd6ba2862
Fix situation in which group was not specified and
Paul Aurich <paul@darkrain42.org>
parents:
25237
diff
changeset
|
7117 |
6eecd6ba2862
Fix situation in which group was not specified and
Paul Aurich <paul@darkrain42.org>
parents:
25237
diff
changeset
|
7118 if (b == NULL) |
25172
125cac3e24ee
The Add Buddy dialog should not blindly create a duplicate buddy in a group
Paul Aurich <paul@darkrain42.org>
parents:
24552
diff
changeset
|
7119 { |
26884
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
7120 b = purple_buddy_new(account, who, whoalias); |
25172
125cac3e24ee
The Add Buddy dialog should not blindly create a duplicate buddy in a group
Paul Aurich <paul@darkrain42.org>
parents:
24552
diff
changeset
|
7121 purple_blist_add_buddy(b, NULL, g, NULL); |
125cac3e24ee
The Add Buddy dialog should not blindly create a duplicate buddy in a group
Paul Aurich <paul@darkrain42.org>
parents:
24552
diff
changeset
|
7122 } |
125cac3e24ee
The Add Buddy dialog should not blindly create a duplicate buddy in a group
Paul Aurich <paul@darkrain42.org>
parents:
24552
diff
changeset
|
7123 |
32031
cd1d9e04c587
Rename the _with_invite functions to their counterparts.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31907
diff
changeset
|
7124 purple_account_add_buddy(account, b, invite); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7125 |
23324
aec041e8f3e0
Make the Add Buddy dialog cause the auto-personize prompt where appropriate.
Kevin Stange <kevin@simguy.net>
parents:
23310
diff
changeset
|
7126 /* Offer to merge people with the same alias. */ |
23995
fd0e8c6ffa4b
Path from Toby Schaffer to fix a null ptr deref when adding a buddy. Fixes #6821.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
23393
diff
changeset
|
7127 if (whoalias != NULL && g != NULL) |
32350
cd46874707b1
Pidgin: Use the purple_blist_node_ accessor functions.
andrew.victor@mxit.com
parents:
32347
diff
changeset
|
7128 gtk_blist_auto_personize(PURPLE_BLIST_NODE(g), whoalias); |
23324
aec041e8f3e0
Make the Add Buddy dialog cause the auto-personize prompt where appropriate.
Kevin Stange <kevin@simguy.net>
parents:
23310
diff
changeset
|
7129 |
15373
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 * XXX |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7132 * It really seems like it would be better if the call to |
15822 | 7133 * purple_account_add_buddy() and purple_conversation_update() were done in |
7134 * blist.c, possibly in the purple_blist_add_buddy() function. Maybe | |
7135 * purple_account_add_buddy() should be renamed to | |
7136 * purple_blist_add_new_buddy() or something, and have it call | |
7137 * purple_blist_add_buddy() after it creates it. --Mark | |
15373
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 * 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
|
7140 * local list. We need a new, non-gtk file that calls both |
15822 | 7141 * purple_account_add_buddy and purple_blist_add_buddy(). |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7142 * Or something. --Mark |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7143 */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7144 |
26884
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
7145 c = purple_find_conversation_with_account(PURPLE_CONV_TYPE_IM, who, data->rq_data.account); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7146 if (c != NULL) { |
15822 | 7147 icon = purple_conv_im_get_icon(PURPLE_CONV_IM(c)); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7148 if (icon != NULL) |
15822 | 7149 purple_buddy_icon_update(icon); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7150 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7151 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7152 |
26884
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
7153 gtk_widget_destroy(data->rq_data.window); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7154 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7155 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7156 static void |
15822 | 7157 pidgin_blist_request_add_buddy(PurpleAccount *account, const char *username, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7158 const char *group, const char *alias) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7159 { |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
7160 PidginAddBuddyData *data = g_new0(PidginAddBuddyData, 1); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7161 |
31402
c0a122c22475
Show invite message entry in the Add Buddy dialog.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31374
diff
changeset
|
7162 if (account == NULL) |
c0a122c22475
Show invite message entry in the Add Buddy dialog.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31374
diff
changeset
|
7163 account = purple_connection_get_account(purple_connections_get_all()->data); |
c0a122c22475
Show invite message entry in the Add Buddy dialog.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31374
diff
changeset
|
7164 |
26884
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
7165 make_blist_request_dialog((PidginBlistRequestData *)data, |
31402
c0a122c22475
Show invite message entry in the Add Buddy dialog.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31374
diff
changeset
|
7166 account, |
26884
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
7167 _("Add Buddy"), "add_buddy", |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
7168 _("Add a buddy.\n"), |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
7169 G_CALLBACK(add_buddy_select_account_cb), NULL, |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
7170 G_CALLBACK(add_buddy_cb)); |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
7171 gtk_dialog_add_buttons(GTK_DIALOG(data->rq_data.window), |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7172 GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7173 GTK_STOCK_ADD, GTK_RESPONSE_OK, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7174 NULL); |
27629
5d75276a575f
Make OK default for Add Buddy, Add Chat, and Join Chat.
Paul Aurich <paul@darkrain42.org>
parents:
27588
diff
changeset
|
7175 gtk_dialog_set_default_response(GTK_DIALOG(data->rq_data.window), |
5d75276a575f
Make OK default for Add Buddy, Add Chat, and Join Chat.
Paul Aurich <paul@darkrain42.org>
parents:
27588
diff
changeset
|
7176 GTK_RESPONSE_OK); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7177 |
26884
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
7178 g_signal_connect(G_OBJECT(data->rq_data.window), "destroy", |
22524
2f7b42cc612c
Change up the Add Budy dialog a little bit, this hopefully makes it a bit
Etan Reisner <pidgin@unreliablesource.net>
parents:
22323
diff
changeset
|
7179 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:
22323
diff
changeset
|
7180 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7181 data->entry = gtk_entry_new(); |
26884
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
7182 |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
7183 pidgin_add_widget_to_vbox(data->rq_data.vbox, _("Buddy's _username:"), |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
7184 data->rq_data.sg, data->entry, TRUE, NULL); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7185 gtk_widget_grab_focus(data->entry); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7186 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7187 if (username != NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7188 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
|
7189 else |
26884
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
7190 gtk_dialog_set_response_sensitive(GTK_DIALOG(data->rq_data.window), |
22524
2f7b42cc612c
Change up the Add Budy dialog a little bit, this hopefully makes it a bit
Etan Reisner <pidgin@unreliablesource.net>
parents:
22323
diff
changeset
|
7191 GTK_RESPONSE_OK, FALSE); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7192 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7193 gtk_entry_set_activates_default (GTK_ENTRY(data->entry), TRUE); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7194 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7195 g_signal_connect(G_OBJECT(data->entry), "changed", |
22524
2f7b42cc612c
Change up the Add Budy dialog a little bit, this hopefully makes it a bit
Etan Reisner <pidgin@unreliablesource.net>
parents:
22323
diff
changeset
|
7196 G_CALLBACK(pidgin_set_sensitive_if_input), |
26884
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
7197 data->rq_data.window); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7198 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7199 data->entry_for_alias = gtk_entry_new(); |
26884
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
7200 pidgin_add_widget_to_vbox(data->rq_data.vbox, _("(Optional) A_lias:"), |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
7201 data->rq_data.sg, data->entry_for_alias, TRUE, |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
7202 NULL); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7203 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7204 if (alias != NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7205 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
|
7206 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7207 if (username != NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7208 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
|
7209 |
31402
c0a122c22475
Show invite message entry in the Add Buddy dialog.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31374
diff
changeset
|
7210 data->entry_for_invite = gtk_entry_new(); |
c0a122c22475
Show invite message entry in the Add Buddy dialog.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31374
diff
changeset
|
7211 pidgin_add_widget_to_vbox(data->rq_data.vbox, _("(Optional) _Invite message:"), |
c0a122c22475
Show invite message entry in the Add Buddy dialog.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31374
diff
changeset
|
7212 data->rq_data.sg, data->entry_for_invite, TRUE, |
c0a122c22475
Show invite message entry in the Add Buddy dialog.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31374
diff
changeset
|
7213 NULL); |
c0a122c22475
Show invite message entry in the Add Buddy dialog.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31374
diff
changeset
|
7214 |
20028
a2b4eac83902
Part of #1332 to introduce pidgin_text_combo_box_new_entry and
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19681
diff
changeset
|
7215 data->combo = pidgin_text_combo_box_entry_new(group, groups_tree()); |
26884
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
7216 pidgin_add_widget_to_vbox(data->rq_data.vbox, _("Add buddy to _group:"), |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
7217 data->rq_data.sg, data->combo, TRUE, NULL); |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
7218 |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
7219 gtk_widget_show_all(data->rq_data.window); |
31402
c0a122c22475
Show invite message entry in the Add Buddy dialog.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31374
diff
changeset
|
7220 |
c0a122c22475
Show invite message entry in the Add Buddy dialog.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31374
diff
changeset
|
7221 /* Force update of invite message entry sensitivity */ |
c0a122c22475
Show invite message entry in the Add Buddy dialog.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31374
diff
changeset
|
7222 add_buddy_select_account_cb(NULL, account, data); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7223 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7224 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7225 static void |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
7226 add_chat_cb(GtkWidget *w, PidginAddChatData *data) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7227 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7228 GList *tmp; |
15822 | 7229 PurpleChat *chat; |
27416
22dd196b9a0c
Close up scope on some variables and more correctly handle the
Etan Reisner <pidgin@unreliablesource.net>
parents:
27411
diff
changeset
|
7230 GHashTable *components; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7231 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7232 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
|
7233 g_free, g_free); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7234 |
26884
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
7235 for (tmp = data->chat_data.entries; tmp; tmp = tmp->next) |
15373
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 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
|
7238 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7239 g_hash_table_replace(components, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7240 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
|
7241 g_strdup_printf("%d", |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7242 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
|
7243 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7244 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7245 { |
27416
22dd196b9a0c
Close up scope on some variables and more correctly handle the
Etan Reisner <pidgin@unreliablesource.net>
parents:
27411
diff
changeset
|
7246 const char *value = gtk_entry_get_text(tmp->data); |
22dd196b9a0c
Close up scope on some variables and more correctly handle the
Etan Reisner <pidgin@unreliablesource.net>
parents:
27411
diff
changeset
|
7247 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7248 if (*value != '\0') |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7249 g_hash_table_replace(components, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7250 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
|
7251 g_strdup(value)); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7252 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7253 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7254 |
26884
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
7255 chat = purple_chat_new(data->chat_data.rq_data.account, |
27416
22dd196b9a0c
Close up scope on some variables and more correctly handle the
Etan Reisner <pidgin@unreliablesource.net>
parents:
27411
diff
changeset
|
7256 gtk_entry_get_text(GTK_ENTRY(data->alias_entry)), |
22dd196b9a0c
Close up scope on some variables and more correctly handle the
Etan Reisner <pidgin@unreliablesource.net>
parents:
27411
diff
changeset
|
7257 components); |
22dd196b9a0c
Close up scope on some variables and more correctly handle the
Etan Reisner <pidgin@unreliablesource.net>
parents:
27411
diff
changeset
|
7258 |
22dd196b9a0c
Close up scope on some variables and more correctly handle the
Etan Reisner <pidgin@unreliablesource.net>
parents:
27411
diff
changeset
|
7259 if (chat != NULL) { |
22dd196b9a0c
Close up scope on some variables and more correctly handle the
Etan Reisner <pidgin@unreliablesource.net>
parents:
27411
diff
changeset
|
7260 PurpleGroup *group; |
22dd196b9a0c
Close up scope on some variables and more correctly handle the
Etan Reisner <pidgin@unreliablesource.net>
parents:
27411
diff
changeset
|
7261 const char *group_name; |
22dd196b9a0c
Close up scope on some variables and more correctly handle the
Etan Reisner <pidgin@unreliablesource.net>
parents:
27411
diff
changeset
|
7262 |
22dd196b9a0c
Close up scope on some variables and more correctly handle the
Etan Reisner <pidgin@unreliablesource.net>
parents:
27411
diff
changeset
|
7263 group_name = pidgin_text_combo_box_entry_get_text(data->group_combo); |
22dd196b9a0c
Close up scope on some variables and more correctly handle the
Etan Reisner <pidgin@unreliablesource.net>
parents:
27411
diff
changeset
|
7264 |
22dd196b9a0c
Close up scope on some variables and more correctly handle the
Etan Reisner <pidgin@unreliablesource.net>
parents:
27411
diff
changeset
|
7265 group = NULL; |
22dd196b9a0c
Close up scope on some variables and more correctly handle the
Etan Reisner <pidgin@unreliablesource.net>
parents:
27411
diff
changeset
|
7266 if ((group_name != NULL) && (*group_name != '\0') && |
22dd196b9a0c
Close up scope on some variables and more correctly handle the
Etan Reisner <pidgin@unreliablesource.net>
parents:
27411
diff
changeset
|
7267 ((group = purple_find_group(group_name)) == NULL)) |
22dd196b9a0c
Close up scope on some variables and more correctly handle the
Etan Reisner <pidgin@unreliablesource.net>
parents:
27411
diff
changeset
|
7268 { |
22dd196b9a0c
Close up scope on some variables and more correctly handle the
Etan Reisner <pidgin@unreliablesource.net>
parents:
27411
diff
changeset
|
7269 group = purple_group_new(group_name); |
22dd196b9a0c
Close up scope on some variables and more correctly handle the
Etan Reisner <pidgin@unreliablesource.net>
parents:
27411
diff
changeset
|
7270 purple_blist_add_group(group, NULL); |
22dd196b9a0c
Close up scope on some variables and more correctly handle the
Etan Reisner <pidgin@unreliablesource.net>
parents:
27411
diff
changeset
|
7271 } |
22dd196b9a0c
Close up scope on some variables and more correctly handle the
Etan Reisner <pidgin@unreliablesource.net>
parents:
27411
diff
changeset
|
7272 |
15822 | 7273 purple_blist_add_chat(chat, group, NULL); |
27416
22dd196b9a0c
Close up scope on some variables and more correctly handle the
Etan Reisner <pidgin@unreliablesource.net>
parents:
27411
diff
changeset
|
7274 |
22dd196b9a0c
Close up scope on some variables and more correctly handle the
Etan Reisner <pidgin@unreliablesource.net>
parents:
27411
diff
changeset
|
7275 if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(data->autojoin))) |
32350
cd46874707b1
Pidgin: Use the purple_blist_node_ accessor functions.
andrew.victor@mxit.com
parents:
32347
diff
changeset
|
7276 purple_blist_node_set_bool(PURPLE_BLIST_NODE(chat), "gtk-autojoin", TRUE); |
27416
22dd196b9a0c
Close up scope on some variables and more correctly handle the
Etan Reisner <pidgin@unreliablesource.net>
parents:
27411
diff
changeset
|
7277 |
22dd196b9a0c
Close up scope on some variables and more correctly handle the
Etan Reisner <pidgin@unreliablesource.net>
parents:
27411
diff
changeset
|
7278 if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(data->persistent))) |
32350
cd46874707b1
Pidgin: Use the purple_blist_node_ accessor functions.
andrew.victor@mxit.com
parents:
32347
diff
changeset
|
7279 purple_blist_node_set_bool(PURPLE_BLIST_NODE(chat), "gtk-persistent", TRUE); |
27416
22dd196b9a0c
Close up scope on some variables and more correctly handle the
Etan Reisner <pidgin@unreliablesource.net>
parents:
27411
diff
changeset
|
7280 } |
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
|
7281 |
26884
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
7282 gtk_widget_destroy(data->chat_data.rq_data.window); |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
7283 g_free(data->chat_data.default_chat_name); |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
7284 g_list_free(data->chat_data.entries); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7285 g_free(data); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7286 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7287 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7288 static void |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
7289 add_chat_resp_cb(GtkWidget *w, int resp, PidginAddChatData *data) |
15373
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 (resp == GTK_RESPONSE_OK) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7292 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7293 add_chat_cb(NULL, data); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7294 } |
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
|
7295 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
|
7296 { |
26884
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
7297 pidgin_roomlist_dialog_show_with_account(data->chat_data.rq_data.account); |
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
|
7298 } |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7299 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7300 { |
26884
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
7301 gtk_widget_destroy(data->chat_data.rq_data.window); |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
7302 g_free(data->chat_data.default_chat_name); |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
7303 g_list_free(data->chat_data.entries); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7304 g_free(data); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7305 } |
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 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7308 static void |
15822 | 7309 pidgin_blist_request_add_chat(PurpleAccount *account, PurpleGroup *group, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7310 const char *alias, const char *name) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7311 { |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
7312 PidginAddChatData *data; |
18063
926ccb104da0
disapproval of revision '1411afd7660760db59966c3a9f18e2adab8eb27e'
Richard Laager <rlaager@wiktel.com>
parents:
18058
diff
changeset
|
7313 GList *l; |
15822 | 7314 PurpleConnection *gc; |
26884
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
7315 GtkBox *vbox; |
32305
2ec94166be43
On the way to hiding the PurpleConnection struct.
andrew.victor@mxit.com
parents:
32246
diff
changeset
|
7316 PurplePluginProtocolInfo *prpl_info = NULL; |
15373
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 if (account != NULL) { |
15822 | 7319 gc = purple_account_get_connection(account); |
32305
2ec94166be43
On the way to hiding the PurpleConnection struct.
andrew.victor@mxit.com
parents:
32246
diff
changeset
|
7320 prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(purple_connection_get_prpl(gc)); |
2ec94166be43
On the way to hiding the PurpleConnection struct.
andrew.victor@mxit.com
parents:
32246
diff
changeset
|
7321 |
2ec94166be43
On the way to hiding the PurpleConnection struct.
andrew.victor@mxit.com
parents:
32246
diff
changeset
|
7322 if (prpl_info->join_chat == NULL) { |
15822 | 7323 purple_notify_error(gc, NULL, _("This protocol does not support chat rooms."), NULL); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7324 return; |
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 } else { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7327 /* Find an account with chat capabilities */ |
15822 | 7328 for (l = purple_connections_get_all(); l != NULL; l = l->next) { |
7329 gc = (PurpleConnection *)l->data; | |
32305
2ec94166be43
On the way to hiding the PurpleConnection struct.
andrew.victor@mxit.com
parents:
32246
diff
changeset
|
7330 prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(purple_connection_get_prpl(gc)); |
2ec94166be43
On the way to hiding the PurpleConnection struct.
andrew.victor@mxit.com
parents:
32246
diff
changeset
|
7331 |
2ec94166be43
On the way to hiding the PurpleConnection struct.
andrew.victor@mxit.com
parents:
32246
diff
changeset
|
7332 if (prpl_info->join_chat != NULL) { |
15822 | 7333 account = purple_connection_get_account(gc); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7334 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7335 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7336 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7337 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7338 if (account == NULL) { |
15822 | 7339 purple_notify_error(NULL, NULL, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7340 _("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
|
7341 "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
|
7342 return; |
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 |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
7346 data = g_new0(PidginAddChatData, 1); |
26884
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
7347 vbox = GTK_BOX(make_blist_request_dialog((PidginBlistRequestData *)data, account, |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
7348 _("Add Chat"), "add_chat", |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
7349 _("Please enter an alias, and the appropriate information " |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
7350 "about the chat you would like to add to your buddy list.\n"), |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
7351 G_CALLBACK(chat_select_account_cb), chat_account_filter_func, |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
7352 G_CALLBACK(add_chat_resp_cb))); |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
7353 gtk_dialog_add_buttons(GTK_DIALOG(data->chat_data.rq_data.window), |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
7354 _("Room List"), 1, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7355 GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7356 GTK_STOCK_ADD, GTK_RESPONSE_OK, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7357 NULL); |
27629
5d75276a575f
Make OK default for Add Buddy, Add Chat, and Join Chat.
Paul Aurich <paul@darkrain42.org>
parents:
27588
diff
changeset
|
7358 gtk_dialog_set_default_response(GTK_DIALOG(data->chat_data.rq_data.window), |
5d75276a575f
Make OK default for Add Buddy, Add Chat, and Join Chat.
Paul Aurich <paul@darkrain42.org>
parents:
27588
diff
changeset
|
7359 GTK_RESPONSE_OK); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7360 |
26884
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
7361 data->chat_data.default_chat_name = g_strdup(name); |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
7362 |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
7363 rebuild_chat_entries((PidginChatData *)data, name); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7364 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7365 data->alias_entry = gtk_entry_new(); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7366 if (alias != NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7367 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
|
7368 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
|
7369 |
26884
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
7370 pidgin_add_widget_to_vbox(GTK_BOX(vbox), _("A_lias:"), |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
7371 data->chat_data.rq_data.sg, data->alias_entry, |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
7372 TRUE, NULL); |
17345
202f4df12cf4
Closes #348 'Conversation -> Add (for Chats) should move focus to the alias field.'
Sean Egan <seanegan@gmail.com>
parents:
17116
diff
changeset
|
7373 if (name != NULL) |
202f4df12cf4
Closes #348 'Conversation -> Add (for Chats) should move focus to the alias field.'
Sean Egan <seanegan@gmail.com>
parents:
17116
diff
changeset
|
7374 gtk_widget_grab_focus(data->alias_entry); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7375 |
32346
2fdc668362f0
Use the purple_group_get_name() accessor function.
andrew.victor@mxit.com
parents:
32342
diff
changeset
|
7376 data->group_combo = pidgin_text_combo_box_entry_new(group ? purple_group_get_name(group) : NULL, groups_tree()); |
26884
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
7377 pidgin_add_widget_to_vbox(GTK_BOX(vbox), _("_Group:"), |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
7378 data->chat_data.rq_data.sg, data->group_combo, |
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
7379 TRUE, NULL); |
25924
584063555949
Remove trailing whitespace
Mark Doliner <mark@kingant.net>
parents:
25920
diff
changeset
|
7380 |
27980
3a45ecbe4821
I think this is a little better.
Paul Aurich <paul@darkrain42.org>
parents:
27665
diff
changeset
|
7381 data->autojoin = gtk_check_button_new_with_mnemonic(_("Auto_join when account connects.")); |
24359
d9a50381a20c
A little clearer description for an option.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24340
diff
changeset
|
7382 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
|
7383 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
|
7384 gtk_box_pack_start(GTK_BOX(vbox), data->persistent, FALSE, FALSE, 0); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7385 |
26884
88c87a40a738
A patch from Gabriel Schulhof, updated to apply by Paul 'darkrain42' Aurich,
Gabriel Schulhof <nix@go-nix.ca>
parents:
26694
diff
changeset
|
7386 gtk_widget_show_all(data->chat_data.rq_data.window); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7387 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7388 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7389 static void |
15822 | 7390 add_group_cb(PurpleConnection *gc, const char *group_name) |
7391 { | |
7392 PurpleGroup *group; | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7393 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7394 if ((group_name == NULL) || (*group_name == '\0')) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7395 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7396 |
15822 | 7397 group = purple_group_new(group_name); |
7398 purple_blist_add_group(group, NULL); | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7399 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7400 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7401 static void |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
7402 pidgin_blist_request_add_group(void) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7403 { |
21099
51cf02dbdb0e
disapproval of revision 'c484d979c4fda4433a9633ff8b69bd8a395c9479'
Richard Laager <rlaager@wiktel.com>
parents:
21095
diff
changeset
|
7404 purple_request_input(NULL, _("Add Group"), NULL, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7405 _("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
|
7406 NULL, FALSE, FALSE, NULL, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7407 _("Add"), G_CALLBACK(add_group_cb), |
16439
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
|
7408 _("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
|
7409 NULL, NULL, NULL, |
21099
51cf02dbdb0e
disapproval of revision 'c484d979c4fda4433a9633ff8b69bd8a395c9479'
Richard Laager <rlaager@wiktel.com>
parents:
21095
diff
changeset
|
7410 NULL); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7411 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7412 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7413 void |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
7414 pidgin_blist_toggle_visibility() |
15373
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 (gtkblist && gtkblist->window) { |
32686
3538e783b98c
Fix all deprecated GTK_WIDGET_* macros.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32684
diff
changeset
|
7417 if (gtk_widget_get_visible(gtkblist->window)) { |
22850
5d833ca5a265
Make pidgin_blist_toggle_visibility() hide the buddy list when it is
Casey Harkins <charkins@pidgin.im>
parents:
22813
diff
changeset
|
7418 /* 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:
22813
diff
changeset
|
7419 * 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:
22813
diff
changeset
|
7420 * 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:
22813
diff
changeset
|
7421 * 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:
22813
diff
changeset
|
7422 * buddy list |
5d833ca5a265
Make pidgin_blist_toggle_visibility() hide the buddy list when it is
Casey Harkins <charkins@pidgin.im>
parents:
22813
diff
changeset
|
7423 */ |
21041
094bbbe89d0d
Track the actual visibility for the buddy list (unobscured, partially and
Casey Harkins <charkins@pidgin.im>
parents:
21040
diff
changeset
|
7424 purple_blist_set_visible(PIDGIN_WINDOW_ICONIFIED(gtkblist->window) || |
22850
5d833ca5a265
Make pidgin_blist_toggle_visibility() hide the buddy list when it is
Casey Harkins <charkins@pidgin.im>
parents:
22813
diff
changeset
|
7425 ((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:
22813
diff
changeset
|
7426 !gtk_blist_focused)); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7427 } else { |
15822 | 7428 purple_blist_set_visible(TRUE); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7429 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7430 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7431 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7432 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7433 void |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
7434 pidgin_blist_visibility_manager_add() |
15373
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 visibility_manager_count++; |
15822 | 7437 purple_debug_info("gtkblist", "added visibility manager: %d\n", visibility_manager_count); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7438 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7439 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7440 void |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
7441 pidgin_blist_visibility_manager_remove() |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7442 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7443 if (visibility_manager_count) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7444 visibility_manager_count--; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7445 if (!visibility_manager_count) |
15822 | 7446 purple_blist_set_visible(TRUE); |
7447 purple_debug_info("gtkblist", "removed visibility manager: %d\n", visibility_manager_count); | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7448 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7449 |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
7450 void pidgin_blist_add_alert(GtkWidget *widget) |
15373
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 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
|
7453 set_urgent(); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7454 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7455 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7456 void |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
7457 pidgin_blist_set_headline(const char *text, GdkPixbuf *pixbuf, GCallback callback, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7458 gpointer user_data, GDestroyNotify destroy) |
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 /* Destroy any existing headline first */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7461 if (gtkblist->headline_destroy) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7462 gtkblist->headline_destroy(gtkblist->headline_data); |
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 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
|
7465 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
|
7466 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7467 gtkblist->headline_callback = callback; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7468 gtkblist->headline_data = user_data; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7469 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
|
7470 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
|
7471 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
|
7472 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
|
7473 } 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
|
7474 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
|
7475 } |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7476 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7477 |
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
|
7478 |
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
|
7479 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
|
7480 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
|
7481 { |
32686
3538e783b98c
Fix all deprecated GTK_WIDGET_* macros.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32684
diff
changeset
|
7482 if (gtkblist->window && !gtk_widget_has_focus(gtkblist->window)) |
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
|
7483 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
|
7484 } |
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
|
7485 |
15822 | 7486 static PurpleBlistUiOps blist_ui_ops = |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7487 { |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
7488 pidgin_blist_new_list, |
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
7489 pidgin_blist_new_node, |
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
7490 pidgin_blist_show, |
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
7491 pidgin_blist_update, |
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
7492 pidgin_blist_remove, |
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
7493 pidgin_blist_destroy, |
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
7494 pidgin_blist_set_visible, |
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
7495 pidgin_blist_request_add_buddy, |
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
7496 pidgin_blist_request_add_chat, |
16673
fbf111436896
Patch from John 'rekkanoryo' Bailey to add the padding struct members in pidgin
Gary Kramlich <grim@reaperworld.com>
parents:
16556
diff
changeset
|
7497 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:
16556
diff
changeset
|
7498 NULL, |
fbf111436896
Patch from John 'rekkanoryo' Bailey to add the padding struct members in pidgin
Gary Kramlich <grim@reaperworld.com>
parents:
16556
diff
changeset
|
7499 NULL, |
fbf111436896
Patch from John 'rekkanoryo' Bailey to add the padding struct members in pidgin
Gary Kramlich <grim@reaperworld.com>
parents:
16556
diff
changeset
|
7500 NULL, |
fbf111436896
Patch from John 'rekkanoryo' Bailey to add the padding struct members in pidgin
Gary Kramlich <grim@reaperworld.com>
parents:
16556
diff
changeset
|
7501 NULL |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7502 }; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7503 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7504 |
15822 | 7505 PurpleBlistUiOps * |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
7506 pidgin_blist_get_ui_ops(void) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7507 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7508 return &blist_ui_ops; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7509 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7510 |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
7511 PidginBuddyList *pidgin_blist_get_default_gtk_blist() |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7512 { |
15447 | 7513 return gtkblist; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7514 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7515 |
29753
378cceb9131d
Add an autojoin connection signal
Richard Laager <rlaager@wiktel.com>
parents:
29650
diff
changeset
|
7516 static gboolean autojoin_cb(PurpleConnection *gc, gpointer data) |
15822 | 7517 { |
7518 PurpleAccount *account = purple_connection_get_account(gc); | |
7519 PurpleBlistNode *gnode, *cnode; | |
7520 for(gnode = purple_get_blist()->root; gnode; gnode = gnode->next) | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7521 { |
15822 | 7522 if(!PURPLE_BLIST_NODE_IS_GROUP(gnode)) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7523 continue; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7524 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
|
7525 { |
15822 | 7526 PurpleChat *chat; |
7527 | |
7528 if(!PURPLE_BLIST_NODE_IS_CHAT(cnode)) | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7529 continue; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7530 |
15822 | 7531 chat = (PurpleChat *)cnode; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7532 |
32347
76096c42f558
Use the PurpleChat accessor functions.
andrew.victor@mxit.com
parents:
32346
diff
changeset
|
7533 if(purple_chat_get_account(chat) != account) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7534 continue; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7535 |
32350
cd46874707b1
Pidgin: Use the purple_blist_node_ accessor functions.
andrew.victor@mxit.com
parents:
32347
diff
changeset
|
7536 if (purple_blist_node_get_bool(PURPLE_BLIST_NODE(chat), "gtk-autojoin")) |
32347
76096c42f558
Use the PurpleChat accessor functions.
andrew.victor@mxit.com
parents:
32346
diff
changeset
|
7537 serv_join_chat(gc, purple_chat_get_components(chat)); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7538 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7539 } |
29753
378cceb9131d
Add an autojoin connection signal
Richard Laager <rlaager@wiktel.com>
parents:
29650
diff
changeset
|
7540 |
378cceb9131d
Add an autojoin connection signal
Richard Laager <rlaager@wiktel.com>
parents:
29650
diff
changeset
|
7541 /* Stop processing; we handled the autojoins. */ |
378cceb9131d
Add an autojoin connection signal
Richard Laager <rlaager@wiktel.com>
parents:
29650
diff
changeset
|
7542 return TRUE; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7543 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7544 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7545 void * |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
7546 pidgin_blist_get_handle() { |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7547 static int handle; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7548 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7549 return &handle; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7550 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7551 |
15822 | 7552 static gboolean buddy_signonoff_timeout_cb(PurpleBuddy *buddy) |
7553 { | |
32350
cd46874707b1
Pidgin: Use the purple_blist_node_ accessor functions.
andrew.victor@mxit.com
parents:
32347
diff
changeset
|
7554 struct _pidgin_blist_node *gtknode = purple_blist_node_get_ui_data(PURPLE_BLIST_NODE(buddy)); |
24039
5045f2ce9cff
disapproval of revision 'f5ca7968e3f6be8f81d068232d389e0b1dab784b'
Kevin Stange <kevin@simguy.net>
parents:
24037
diff
changeset
|
7555 |
5045f2ce9cff
disapproval of revision 'f5ca7968e3f6be8f81d068232d389e0b1dab784b'
Kevin Stange <kevin@simguy.net>
parents:
24037
diff
changeset
|
7556 gtknode->recent_signonoff = FALSE; |
5045f2ce9cff
disapproval of revision 'f5ca7968e3f6be8f81d068232d389e0b1dab784b'
Kevin Stange <kevin@simguy.net>
parents:
24037
diff
changeset
|
7557 gtknode->recent_signonoff_timer = 0; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7558 |
32350
cd46874707b1
Pidgin: Use the purple_blist_node_ accessor functions.
andrew.victor@mxit.com
parents:
32347
diff
changeset
|
7559 pidgin_blist_update(NULL, PURPLE_BLIST_NODE(buddy)); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7560 |
24039
5045f2ce9cff
disapproval of revision 'f5ca7968e3f6be8f81d068232d389e0b1dab784b'
Kevin Stange <kevin@simguy.net>
parents:
24037
diff
changeset
|
7561 return FALSE; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7562 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7563 |
15822 | 7564 static void buddy_signonoff_cb(PurpleBuddy *buddy) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7565 { |
32350
cd46874707b1
Pidgin: Use the purple_blist_node_ accessor functions.
andrew.victor@mxit.com
parents:
32347
diff
changeset
|
7566 struct _pidgin_blist_node *gtknode = purple_blist_node_get_ui_data(PURPLE_BLIST_NODE(buddy)); |
cd46874707b1
Pidgin: Use the purple_blist_node_ accessor functions.
andrew.victor@mxit.com
parents:
32347
diff
changeset
|
7567 |
cd46874707b1
Pidgin: Use the purple_blist_node_ accessor functions.
andrew.victor@mxit.com
parents:
32347
diff
changeset
|
7568 if(!gtknode) { |
cd46874707b1
Pidgin: Use the purple_blist_node_ accessor functions.
andrew.victor@mxit.com
parents:
32347
diff
changeset
|
7569 pidgin_blist_new_node(PURPLE_BLIST_NODE(buddy)); |
cd46874707b1
Pidgin: Use the purple_blist_node_ accessor functions.
andrew.victor@mxit.com
parents:
32347
diff
changeset
|
7570 } |
cd46874707b1
Pidgin: Use the purple_blist_node_ accessor functions.
andrew.victor@mxit.com
parents:
32347
diff
changeset
|
7571 |
cd46874707b1
Pidgin: Use the purple_blist_node_ accessor functions.
andrew.victor@mxit.com
parents:
32347
diff
changeset
|
7572 gtknode = purple_blist_node_get_ui_data(PURPLE_BLIST_NODE(buddy)); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7573 |
24039
5045f2ce9cff
disapproval of revision 'f5ca7968e3f6be8f81d068232d389e0b1dab784b'
Kevin Stange <kevin@simguy.net>
parents:
24037
diff
changeset
|
7574 gtknode->recent_signonoff = TRUE; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7575 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7576 if(gtknode->recent_signonoff_timer > 0) |
15822 | 7577 purple_timeout_remove(gtknode->recent_signonoff_timer); |
26531
b162300ab1e7
A patch from Arunan Balasubramaniam to use timeouts in seconds instead of
foss@abala.me
parents:
26528
diff
changeset
|
7578 gtknode->recent_signonoff_timer = purple_timeout_add_seconds(10, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7579 (GSourceFunc)buddy_signonoff_timeout_cb, buddy); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7580 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7581 |
25924
584063555949
Remove trailing whitespace
Mark Doliner <mark@kingant.net>
parents:
25920
diff
changeset
|
7582 void |
25102
4aeef8c3cce3
restructured much of the loader and themes for the buddy list, along with a basic trial of group background
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25100
diff
changeset
|
7583 pidgin_blist_set_theme(PidginBlistTheme *theme) |
25099
1242a922a4bc
start of blist themes (themes have no effect on display)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23393
diff
changeset
|
7584 { |
1242a922a4bc
start of blist themes (themes have no effect on display)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23393
diff
changeset
|
7585 PidginBuddyListPrivate *priv = PIDGIN_BUDDY_LIST_GET_PRIVATE(gtkblist); |
25106
d17d6e83f428
Added layout capabilities to blist themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25105
diff
changeset
|
7586 PurpleBuddyList *list = purple_get_blist(); |
25104
2ccad3a8d9fe
fixed segfault when changing blist themes, changed prefs to not rely on static iter, fixed a few leaks
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25103
diff
changeset
|
7587 |
2ccad3a8d9fe
fixed segfault when changing blist themes, changed prefs to not rely on static iter, fixed a few leaks
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25103
diff
changeset
|
7588 if (theme != NULL) |
25924
584063555949
Remove trailing whitespace
Mark Doliner <mark@kingant.net>
parents:
25920
diff
changeset
|
7589 purple_prefs_set_string(PIDGIN_PREFS_ROOT "/blist/theme", |
25100
8941e76e0762
flushed out blist themes a bit with lots of properties and get methods
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25099
diff
changeset
|
7590 purple_theme_get_name(PURPLE_THEME(theme))); |
25920
c0e3b62f8098
* Alphabetize files in a few Makefile.am files
Mark Doliner <mark@kingant.net>
parents:
25919
diff
changeset
|
7591 else |
c0e3b62f8098
* Alphabetize files in a few Makefile.am files
Mark Doliner <mark@kingant.net>
parents:
25919
diff
changeset
|
7592 purple_prefs_set_string(PIDGIN_PREFS_ROOT "/blist/theme", ""); |
25104
2ccad3a8d9fe
fixed segfault when changing blist themes, changed prefs to not rely on static iter, fixed a few leaks
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25103
diff
changeset
|
7593 |
26991
85a4c248f751
Buddy List needs to take a reference to the loaded theme. Fixes #8798.
Paul Aurich <paul@darkrain42.org>
parents:
26884
diff
changeset
|
7594 if (priv->current_theme) |
85a4c248f751
Buddy List needs to take a reference to the loaded theme. Fixes #8798.
Paul Aurich <paul@darkrain42.org>
parents:
26884
diff
changeset
|
7595 g_object_unref(priv->current_theme); |
85a4c248f751
Buddy List needs to take a reference to the loaded theme. Fixes #8798.
Paul Aurich <paul@darkrain42.org>
parents:
26884
diff
changeset
|
7596 |
85a4c248f751
Buddy List needs to take a reference to the loaded theme. Fixes #8798.
Paul Aurich <paul@darkrain42.org>
parents:
26884
diff
changeset
|
7597 priv->current_theme = theme ? g_object_ref(theme) : NULL; |
25102
4aeef8c3cce3
restructured much of the loader and themes for the buddy list, along with a basic trial of group background
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25100
diff
changeset
|
7598 |
25106
d17d6e83f428
Added layout capabilities to blist themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25105
diff
changeset
|
7599 pidgin_blist_build_layout(list); |
d17d6e83f428
Added layout capabilities to blist themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25105
diff
changeset
|
7600 |
d17d6e83f428
Added layout capabilities to blist themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25105
diff
changeset
|
7601 pidgin_blist_refresh(list); |
25102
4aeef8c3cce3
restructured much of the loader and themes for the buddy list, along with a basic trial of group background
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25100
diff
changeset
|
7602 } |
4aeef8c3cce3
restructured much of the loader and themes for the buddy list, along with a basic trial of group background
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25100
diff
changeset
|
7603 |
4aeef8c3cce3
restructured much of the loader and themes for the buddy list, along with a basic trial of group background
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25100
diff
changeset
|
7604 |
4aeef8c3cce3
restructured much of the loader and themes for the buddy list, along with a basic trial of group background
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25100
diff
changeset
|
7605 PidginBlistTheme * |
25099
1242a922a4bc
start of blist themes (themes have no effect on display)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23393
diff
changeset
|
7606 pidgin_blist_get_theme() |
1242a922a4bc
start of blist themes (themes have no effect on display)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23393
diff
changeset
|
7607 { |
25924
584063555949
Remove trailing whitespace
Mark Doliner <mark@kingant.net>
parents:
25920
diff
changeset
|
7608 PidginBuddyListPrivate *priv = PIDGIN_BUDDY_LIST_GET_PRIVATE(gtkblist); |
584063555949
Remove trailing whitespace
Mark Doliner <mark@kingant.net>
parents:
25920
diff
changeset
|
7609 |
25099
1242a922a4bc
start of blist themes (themes have no effect on display)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23393
diff
changeset
|
7610 return priv->current_theme; |
1242a922a4bc
start of blist themes (themes have no effect on display)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23393
diff
changeset
|
7611 } |
1242a922a4bc
start of blist themes (themes have no effect on display)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23393
diff
changeset
|
7612 |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
7613 void pidgin_blist_init(void) |
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
7614 { |
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
7615 void *gtk_blist_handle = pidgin_blist_get_handle(); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7616 |
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
|
7617 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
|
7618 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7619 /* 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
|
7620 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
|
7621 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
|
7622 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
|
7623 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
|
7624 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
|
7625 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
|
7626 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
|
7627 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
|
7628 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
|
7629 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
|
7630 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
|
7631 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
|
7632 purple_prefs_add_int(PIDGIN_PREFS_ROOT "/blist/height", 405); /* Golden ratio, baby */ |
24340
d38d854cd0bf
Use GtkSetting to obtain the tooltip preferences instead of our own hidden
Richard Laager <rlaager@wiktel.com>
parents:
24199
diff
changeset
|
7633 #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:
24199
diff
changeset
|
7634 /* 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
|
7635 purple_prefs_add_int(PIDGIN_PREFS_ROOT "/blist/tooltip_delay", 500); |
24340
d38d854cd0bf
Use GtkSetting to obtain the tooltip preferences instead of our own hidden
Richard Laager <rlaager@wiktel.com>
parents:
24199
diff
changeset
|
7636 #endif |
25099
1242a922a4bc
start of blist themes (themes have no effect on display)
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
23393
diff
changeset
|
7637 purple_prefs_add_string(PIDGIN_PREFS_ROOT "/blist/theme", ""); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7638 |
25103
edb03a8d54bd
Fixed gtkblist-loader_build to no longer assume xml file is correct, added set methods to gtkblist-theme
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
25102
diff
changeset
|
7639 purple_theme_manager_register_type(g_object_new(PIDGIN_TYPE_BLIST_THEME_LOADER, "type", "blist", NULL)); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7640 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7641 /* Register our signals */ |
15822 | 7642 purple_signal_register(gtk_blist_handle, "gtkblist-hiding", |
7643 purple_marshal_VOID__POINTER, NULL, 1, | |
7644 purple_value_new(PURPLE_TYPE_SUBTYPE, | |
7645 PURPLE_SUBTYPE_BLIST)); | |
7646 | |
7647 purple_signal_register(gtk_blist_handle, "gtkblist-unhiding", | |
7648 purple_marshal_VOID__POINTER, NULL, 1, | |
7649 purple_value_new(PURPLE_TYPE_SUBTYPE, | |
7650 PURPLE_SUBTYPE_BLIST)); | |
7651 | |
7652 purple_signal_register(gtk_blist_handle, "gtkblist-created", | |
7653 purple_marshal_VOID__POINTER, NULL, 1, | |
7654 purple_value_new(PURPLE_TYPE_SUBTYPE, | |
7655 PURPLE_SUBTYPE_BLIST)); | |
7656 | |
7657 purple_signal_register(gtk_blist_handle, "drawing-tooltip", | |
7658 purple_marshal_VOID__POINTER_POINTER_UINT, NULL, 3, | |
7659 purple_value_new(PURPLE_TYPE_SUBTYPE, | |
7660 PURPLE_SUBTYPE_BLIST_NODE), | |
7661 purple_value_new_outgoing(PURPLE_TYPE_BOXED, "GString *"), | |
7662 purple_value_new(PURPLE_TYPE_BOOLEAN)); | |
7663 | |
29636
d75813811637
Add a new signal, drawing-buddy, to allow plugins to handle markup in buddy
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
29618
diff
changeset
|
7664 purple_signal_register(gtk_blist_handle, "drawing-buddy", |
d75813811637
Add a new signal, drawing-buddy, to allow plugins to handle markup in buddy
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
29618
diff
changeset
|
7665 purple_marshal_POINTER__POINTER, |
d75813811637
Add a new signal, drawing-buddy, to allow plugins to handle markup in buddy
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
29618
diff
changeset
|
7666 purple_value_new(PURPLE_TYPE_STRING), 1, |
d75813811637
Add a new signal, drawing-buddy, to allow plugins to handle markup in buddy
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
29618
diff
changeset
|
7667 purple_value_new(PURPLE_TYPE_SUBTYPE, |
d75813811637
Add a new signal, drawing-buddy, to allow plugins to handle markup in buddy
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
29618
diff
changeset
|
7668 PURPLE_SUBTYPE_BLIST_BUDDY)); |
d75813811637
Add a new signal, drawing-buddy, to allow plugins to handle markup in buddy
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
29618
diff
changeset
|
7669 |
d75813811637
Add a new signal, drawing-buddy, to allow plugins to handle markup in buddy
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
29618
diff
changeset
|
7670 purple_signal_connect(purple_blist_get_handle(), "buddy-signed-on", |
d75813811637
Add a new signal, drawing-buddy, to allow plugins to handle markup in buddy
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
29618
diff
changeset
|
7671 gtk_blist_handle, PURPLE_CALLBACK(buddy_signonoff_cb), NULL); |
d75813811637
Add a new signal, drawing-buddy, to allow plugins to handle markup in buddy
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
29618
diff
changeset
|
7672 purple_signal_connect(purple_blist_get_handle(), "buddy-signed-off", |
d75813811637
Add a new signal, drawing-buddy, to allow plugins to handle markup in buddy
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
29618
diff
changeset
|
7673 gtk_blist_handle, PURPLE_CALLBACK(buddy_signonoff_cb), NULL); |
d75813811637
Add a new signal, drawing-buddy, to allow plugins to handle markup in buddy
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
29618
diff
changeset
|
7674 purple_signal_connect(purple_blist_get_handle(), "buddy-privacy-changed", |
d75813811637
Add a new signal, drawing-buddy, to allow plugins to handle markup in buddy
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
29618
diff
changeset
|
7675 gtk_blist_handle, PURPLE_CALLBACK(pidgin_blist_update_privacy_cb), NULL); |
d75813811637
Add a new signal, drawing-buddy, to allow plugins to handle markup in buddy
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
29618
diff
changeset
|
7676 |
29753
378cceb9131d
Add an autojoin connection signal
Richard Laager <rlaager@wiktel.com>
parents:
29650
diff
changeset
|
7677 purple_signal_connect_priority(purple_connections_get_handle(), "autojoin", |
378cceb9131d
Add an autojoin connection signal
Richard Laager <rlaager@wiktel.com>
parents:
29650
diff
changeset
|
7678 gtk_blist_handle, PURPLE_CALLBACK(autojoin_cb), |
378cceb9131d
Add an autojoin connection signal
Richard Laager <rlaager@wiktel.com>
parents:
29650
diff
changeset
|
7679 NULL, PURPLE_SIGNAL_PRIORITY_HIGHEST); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7680 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7681 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7682 void |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
7683 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
|
7684 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
|
7685 |
15822 | 7686 purple_signals_unregister_by_instance(pidgin_blist_get_handle()); |
7687 purple_signals_disconnect_by_handle(pidgin_blist_get_handle()); | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7688 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7689 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7690 /********************************************************************* |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7691 * Buddy List sorting functions * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7692 *********************************************************************/ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7693 |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
7694 GList *pidgin_blist_get_sort_methods() |
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
7695 { |
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
7696 return pidgin_blist_sort_methods; |
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
7697 } |
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
7698 |
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
7699 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:
15499
diff
changeset
|
7700 { |
27649
bbce09a8e5a5
Don't allow NULL sort method IDs and don't crash on them. Fixes #9658.
Paul Aurich <paul@darkrain42.org>
parents:
27629
diff
changeset
|
7701 struct pidgin_blist_sort_method *method; |
bbce09a8e5a5
Don't allow NULL sort method IDs and don't crash on them. Fixes #9658.
Paul Aurich <paul@darkrain42.org>
parents:
27629
diff
changeset
|
7702 |
bbce09a8e5a5
Don't allow NULL sort method IDs and don't crash on them. Fixes #9658.
Paul Aurich <paul@darkrain42.org>
parents:
27629
diff
changeset
|
7703 g_return_if_fail(id != NULL); |
bbce09a8e5a5
Don't allow NULL sort method IDs and don't crash on them. Fixes #9658.
Paul Aurich <paul@darkrain42.org>
parents:
27629
diff
changeset
|
7704 g_return_if_fail(name != NULL); |
bbce09a8e5a5
Don't allow NULL sort method IDs and don't crash on them. Fixes #9658.
Paul Aurich <paul@darkrain42.org>
parents:
27629
diff
changeset
|
7705 g_return_if_fail(func != NULL); |
bbce09a8e5a5
Don't allow NULL sort method IDs and don't crash on them. Fixes #9658.
Paul Aurich <paul@darkrain42.org>
parents:
27629
diff
changeset
|
7706 |
bbce09a8e5a5
Don't allow NULL sort method IDs and don't crash on them. Fixes #9658.
Paul Aurich <paul@darkrain42.org>
parents:
27629
diff
changeset
|
7707 method = g_new0(struct pidgin_blist_sort_method, 1); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7708 method->id = g_strdup(id); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7709 method->name = g_strdup(name); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7710 method->func = func; |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
7711 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:
15499
diff
changeset
|
7712 pidgin_blist_update_sort_methods(); |
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
7713 } |
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
7714 |
21990
d309d662a32c
Fix an infinite loop. Fixes #4486.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21986
diff
changeset
|
7715 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
|
7716 { |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
7717 GList *l = pidgin_blist_sort_methods; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7718 |
27649
bbce09a8e5a5
Don't allow NULL sort method IDs and don't crash on them. Fixes #9658.
Paul Aurich <paul@darkrain42.org>
parents:
27629
diff
changeset
|
7719 g_return_if_fail(id != NULL); |
bbce09a8e5a5
Don't allow NULL sort method IDs and don't crash on them. Fixes #9658.
Paul Aurich <paul@darkrain42.org>
parents:
27629
diff
changeset
|
7720 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7721 while(l) { |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
7722 struct pidgin_blist_sort_method *method = l->data; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7723 if(!strcmp(method->id, id)) { |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
7724 pidgin_blist_sort_methods = g_list_delete_link(pidgin_blist_sort_methods, l); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7725 g_free(method->id); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7726 g_free(method->name); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7727 g_free(method); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7728 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7729 } |
21990
d309d662a32c
Fix an infinite loop. Fixes #4486.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21986
diff
changeset
|
7730 l = l->next; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7731 } |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
7732 pidgin_blist_update_sort_methods(); |
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
7733 } |
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
7734 |
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
7735 void pidgin_blist_sort_method_set(const char *id){ |
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
7736 GList *l = pidgin_blist_sort_methods; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7737 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7738 if(!id) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7739 id = "none"; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7740 |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
7741 while (l && strcmp(((struct pidgin_blist_sort_method*)l->data)->id, id)) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7742 l = l->next; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7743 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7744 if (l) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7745 current_sort_method = l->data; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7746 } else if (!current_sort_method) { |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
7747 pidgin_blist_sort_method_set("none"); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7748 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7749 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7750 if (!strcmp(id, "none")) { |
15822 | 7751 redo_buddy_list(purple_get_blist(), TRUE, FALSE); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7752 } else { |
15822 | 7753 redo_buddy_list(purple_get_blist(), FALSE, FALSE); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7754 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7755 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7756 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7757 /****************************************** |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7758 ** Sort Methods |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7759 ******************************************/ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7760 |
15822 | 7761 static void sort_method_none(PurpleBlistNode *node, PurpleBuddyList *blist, GtkTreeIter parent_iter, GtkTreeIter *cur, GtkTreeIter *iter) |
7762 { | |
7763 PurpleBlistNode *sibling = node->prev; | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7764 GtkTreeIter sibling_iter; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7765 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7766 if (cur != NULL) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7767 *iter = *cur; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7768 return; |
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 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
|
7772 sibling = sibling->prev; |
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 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7775 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
|
7776 node->parent ? &parent_iter : NULL, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7777 sibling ? &sibling_iter : NULL); |
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 |
15822 | 7780 static void sort_method_alphabetical(PurpleBlistNode *node, PurpleBuddyList *blist, GtkTreeIter groupiter, GtkTreeIter *cur, GtkTreeIter *iter) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7781 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7782 GtkTreeIter more_z; |
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 const char *my_name; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7785 |
15822 | 7786 if(PURPLE_BLIST_NODE_IS_CONTACT(node)) { |
7787 my_name = purple_contact_get_alias((PurpleContact*)node); | |
7788 } else if(PURPLE_BLIST_NODE_IS_CHAT(node)) { | |
7789 my_name = purple_chat_get_name((PurpleChat*)node); | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7790 } else { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7791 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
|
7792 return; |
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 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7795 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
|
7796 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
|
7797 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7798 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7799 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7800 do { |
15822 | 7801 PurpleBlistNode *n; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7802 const char *this_name; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7803 int cmp; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7804 |
31096
b76def85cc04
gtkblist: Fix a few memory leaks. Refs #13162.
morshed.nader@gmail.com
parents:
31086
diff
changeset
|
7805 gtk_tree_model_get(GTK_TREE_MODEL(gtkblist->treemodel), &more_z, NODE_COLUMN, &n, -1); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7806 |
15822 | 7807 if(PURPLE_BLIST_NODE_IS_CONTACT(n)) { |
7808 this_name = purple_contact_get_alias((PurpleContact*)n); | |
7809 } else if(PURPLE_BLIST_NODE_IS_CHAT(n)) { | |
7810 this_name = purple_chat_get_name((PurpleChat*)n); | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7811 } else { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7812 this_name = NULL; |
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 |
15822 | 7815 cmp = purple_utf8_strcasecmp(my_name, this_name); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7816 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7817 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
|
7818 if(cur) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7819 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
|
7820 *iter = *cur; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7821 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7822 } else { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7823 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
|
7824 &groupiter, &more_z); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7825 return; |
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 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7828 } 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
|
7829 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7830 if(cur) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7831 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
|
7832 *iter = *cur; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7833 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7834 } else { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7835 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
|
7836 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7837 } |
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 |
15822 | 7840 static void sort_method_status(PurpleBlistNode *node, PurpleBuddyList *blist, GtkTreeIter groupiter, GtkTreeIter *cur, GtkTreeIter *iter) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7841 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7842 GtkTreeIter more_z; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7843 |
15822 | 7844 PurpleBuddy *my_buddy, *this_buddy; |
7845 | |
7846 if(PURPLE_BLIST_NODE_IS_CONTACT(node)) { | |
7847 my_buddy = purple_contact_get_priority_buddy((PurpleContact*)node); | |
7848 } else if(PURPLE_BLIST_NODE_IS_CHAT(node)) { | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7849 if (cur != NULL) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7850 *iter = *cur; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7851 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7852 } |
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 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
|
7855 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7856 } else { |
31265
2a5e10237d69
Sort by status, then alphabetical. Sorting by status and then "none"
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31256
diff
changeset
|
7857 sort_method_alphabetical(node, blist, groupiter, cur, iter); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7858 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7859 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7860 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7861 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7862 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
|
7863 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
|
7864 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7865 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7866 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7867 do { |
15822 | 7868 PurpleBlistNode *n; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7869 gint name_cmp; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7870 gint presence_cmp; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7871 |
31096
b76def85cc04
gtkblist: Fix a few memory leaks. Refs #13162.
morshed.nader@gmail.com
parents:
31086
diff
changeset
|
7872 gtk_tree_model_get(GTK_TREE_MODEL(gtkblist->treemodel), &more_z, NODE_COLUMN, &n, -1); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7873 |
15822 | 7874 if(PURPLE_BLIST_NODE_IS_CONTACT(n)) { |
7875 this_buddy = purple_contact_get_priority_buddy((PurpleContact*)n); | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7876 } else { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7877 this_buddy = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7878 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7879 |
15822 | 7880 name_cmp = purple_utf8_strcasecmp( |
7881 purple_contact_get_alias(purple_buddy_get_contact(my_buddy)), | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7882 (this_buddy |
15822 | 7883 ? purple_contact_get_alias(purple_buddy_get_contact(this_buddy)) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7884 : NULL)); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7885 |
15822 | 7886 presence_cmp = purple_presence_compare( |
7887 purple_buddy_get_presence(my_buddy), | |
7888 this_buddy ? purple_buddy_get_presence(this_buddy) : NULL); | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7889 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7890 if (this_buddy == NULL || |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7891 (presence_cmp < 0 || |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7892 (presence_cmp == 0 && |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7893 (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
|
7894 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7895 if (cur != NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7896 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7897 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
|
7898 *iter = *cur; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7899 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7900 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7901 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7902 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7903 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
|
7904 &groupiter, &more_z); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7905 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7906 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7907 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7908 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7909 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
|
7910 &more_z)); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7911 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7912 if (cur) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7913 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
|
7914 *iter = *cur; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7915 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7916 } else { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7917 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
|
7918 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7919 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7920 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7921 |
25919
52b2e7260340
A patch from Chris Connett to change the log size sorting method to weight
Richard Laager <rlaager@wiktel.com>
parents:
25912
diff
changeset
|
7922 static void sort_method_log_activity(PurpleBlistNode *node, PurpleBuddyList *blist, GtkTreeIter groupiter, GtkTreeIter *cur, GtkTreeIter *iter) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7923 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7924 GtkTreeIter more_z; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7925 |
25919
52b2e7260340
A patch from Chris Connett to change the log size sorting method to weight
Richard Laager <rlaager@wiktel.com>
parents:
25912
diff
changeset
|
7926 int activity_score = 0, this_log_activity_score = 0; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7927 const char *buddy_name, *this_buddy_name; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7928 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7929 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
|
7930 *iter = *cur; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7931 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7932 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7933 |
15822 | 7934 if(PURPLE_BLIST_NODE_IS_CONTACT(node)) { |
7935 PurpleBlistNode *n; | |
25919
52b2e7260340
A patch from Chris Connett to change the log size sorting method to weight
Richard Laager <rlaager@wiktel.com>
parents:
25912
diff
changeset
|
7936 PurpleBuddy *buddy; |
52b2e7260340
A patch from Chris Connett to change the log size sorting method to weight
Richard Laager <rlaager@wiktel.com>
parents:
25912
diff
changeset
|
7937 for (n = node->child; n; n = n->next) { |
52b2e7260340
A patch from Chris Connett to change the log size sorting method to weight
Richard Laager <rlaager@wiktel.com>
parents:
25912
diff
changeset
|
7938 buddy = (PurpleBuddy*)n; |
32342
b6276b10cb10
Use the PurpleBuddy accessor functions.
andrew.victor@mxit.com
parents:
32305
diff
changeset
|
7939 activity_score += purple_log_get_activity_score(PURPLE_LOG_IM, purple_buddy_get_name(buddy), purple_buddy_get_account(buddy)); |
25919
52b2e7260340
A patch from Chris Connett to change the log size sorting method to weight
Richard Laager <rlaager@wiktel.com>
parents:
25912
diff
changeset
|
7940 } |
15822 | 7941 buddy_name = purple_contact_get_alias((PurpleContact*)node); |
7942 } else if(PURPLE_BLIST_NODE_IS_CHAT(node)) { | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7943 /* 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
|
7944 * 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
|
7945 if (cur != NULL) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7946 *iter = *cur; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7947 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7948 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7949 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7950 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
|
7951 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7952 } else { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7953 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
|
7954 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7955 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7956 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7957 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7958 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
|
7959 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
|
7960 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7961 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7962 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7963 do { |
15822 | 7964 PurpleBlistNode *n; |
7965 PurpleBlistNode *n2; | |
25919
52b2e7260340
A patch from Chris Connett to change the log size sorting method to weight
Richard Laager <rlaager@wiktel.com>
parents:
25912
diff
changeset
|
7966 PurpleBuddy *buddy; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7967 int cmp; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7968 |
31096
b76def85cc04
gtkblist: Fix a few memory leaks. Refs #13162.
morshed.nader@gmail.com
parents:
31086
diff
changeset
|
7969 gtk_tree_model_get(GTK_TREE_MODEL(gtkblist->treemodel), &more_z, NODE_COLUMN, &n, -1); |
25919
52b2e7260340
A patch from Chris Connett to change the log size sorting method to weight
Richard Laager <rlaager@wiktel.com>
parents:
25912
diff
changeset
|
7970 this_log_activity_score = 0; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7971 |
15822 | 7972 if(PURPLE_BLIST_NODE_IS_CONTACT(n)) { |
25919
52b2e7260340
A patch from Chris Connett to change the log size sorting method to weight
Richard Laager <rlaager@wiktel.com>
parents:
25912
diff
changeset
|
7973 for (n2 = n->child; n2; n2 = n2->next) { |
52b2e7260340
A patch from Chris Connett to change the log size sorting method to weight
Richard Laager <rlaager@wiktel.com>
parents:
25912
diff
changeset
|
7974 buddy = (PurpleBuddy*)n2; |
32342
b6276b10cb10
Use the PurpleBuddy accessor functions.
andrew.victor@mxit.com
parents:
32305
diff
changeset
|
7975 this_log_activity_score += purple_log_get_activity_score(PURPLE_LOG_IM, purple_buddy_get_name(buddy), purple_buddy_get_account(buddy)); |
25919
52b2e7260340
A patch from Chris Connett to change the log size sorting method to weight
Richard Laager <rlaager@wiktel.com>
parents:
25912
diff
changeset
|
7976 } |
15822 | 7977 this_buddy_name = purple_contact_get_alias((PurpleContact*)n); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7978 } else { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7979 this_buddy_name = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7980 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7981 |
15822 | 7982 cmp = purple_utf8_strcasecmp(buddy_name, this_buddy_name); |
7983 | |
25919
52b2e7260340
A patch from Chris Connett to change the log size sorting method to weight
Richard Laager <rlaager@wiktel.com>
parents:
25912
diff
changeset
|
7984 if (!PURPLE_BLIST_NODE_IS_CONTACT(n) || activity_score > this_log_activity_score || |
52b2e7260340
A patch from Chris Connett to change the log size sorting method to weight
Richard Laager <rlaager@wiktel.com>
parents:
25912
diff
changeset
|
7985 ((activity_score == this_log_activity_score) && |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7986 (cmp < 0 || (cmp == 0 && node < n)))) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7987 if (cur != NULL) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7988 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
|
7989 *iter = *cur; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7990 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7991 } else { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7992 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
|
7993 &groupiter, &more_z); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7994 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7995 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7996 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7997 } 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
|
7998 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7999 if (cur != NULL) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
8000 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
|
8001 *iter = *cur; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
8002 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
8003 } else { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
8004 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
|
8005 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
8006 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
8007 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
8008 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
8009 static void |
15822 | 8010 plugin_act(GtkObject *obj, PurplePluginAction *pam) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
8011 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
8012 if (pam && pam->callback) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
8013 pam->callback(pam); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
8014 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
8015 |
32585
7b00e8c1ada8
Sort of get the accounts menu working again. Except UI manager insists on
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32584
diff
changeset
|
8016 static void |
32589
f55f8592986c
Don't get account and plugin actions confused by using the same action name
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32588
diff
changeset
|
8017 build_plugin_actions(GtkActionGroup *action_group, GString *ui, char *parent, |
32585
7b00e8c1ada8
Sort of get the accounts menu working again. Except UI manager insists on
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32584
diff
changeset
|
8018 PurplePlugin *plugin, gpointer context) |
7b00e8c1ada8
Sort of get the accounts menu working again. Except UI manager insists on
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32584
diff
changeset
|
8019 { |
7b00e8c1ada8
Sort of get the accounts menu working again. Except UI manager insists on
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32584
diff
changeset
|
8020 GtkAction *menuaction; |
7b00e8c1ada8
Sort of get the accounts menu working again. Except UI manager insists on
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32584
diff
changeset
|
8021 PurplePluginAction *action = NULL; |
7b00e8c1ada8
Sort of get the accounts menu working again. Except UI manager insists on
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32584
diff
changeset
|
8022 GList *actions, *l; |
7b00e8c1ada8
Sort of get the accounts menu working again. Except UI manager insists on
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32584
diff
changeset
|
8023 char *name; |
7b00e8c1ada8
Sort of get the accounts menu working again. Except UI manager insists on
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32584
diff
changeset
|
8024 int count = 0; |
7b00e8c1ada8
Sort of get the accounts menu working again. Except UI manager insists on
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32584
diff
changeset
|
8025 |
7b00e8c1ada8
Sort of get the accounts menu working again. Except UI manager insists on
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32584
diff
changeset
|
8026 actions = PURPLE_PLUGIN_ACTIONS(plugin, context); |
7b00e8c1ada8
Sort of get the accounts menu working again. Except UI manager insists on
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32584
diff
changeset
|
8027 |
7b00e8c1ada8
Sort of get the accounts menu working again. Except UI manager insists on
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32584
diff
changeset
|
8028 for (l = actions; l != NULL; l = l->next) { |
7b00e8c1ada8
Sort of get the accounts menu working again. Except UI manager insists on
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32584
diff
changeset
|
8029 if (l->data) { |
7b00e8c1ada8
Sort of get the accounts menu working again. Except UI manager insists on
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32584
diff
changeset
|
8030 action = (PurplePluginAction *)l->data; |
7b00e8c1ada8
Sort of get the accounts menu working again. Except UI manager insists on
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32584
diff
changeset
|
8031 action->plugin = plugin; |
7b00e8c1ada8
Sort of get the accounts menu working again. Except UI manager insists on
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32584
diff
changeset
|
8032 action->context = context; |
7b00e8c1ada8
Sort of get the accounts menu working again. Except UI manager insists on
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32584
diff
changeset
|
8033 |
32589
f55f8592986c
Don't get account and plugin actions confused by using the same action name
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32588
diff
changeset
|
8034 name = g_strdup_printf("%s-action-%d", parent, count++); |
32585
7b00e8c1ada8
Sort of get the accounts menu working again. Except UI manager insists on
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32584
diff
changeset
|
8035 menuaction = gtk_action_new(name, action->label, NULL, NULL); |
7b00e8c1ada8
Sort of get the accounts menu working again. Except UI manager insists on
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32584
diff
changeset
|
8036 gtk_action_group_add_action(action_group, menuaction); |
7b00e8c1ada8
Sort of get the accounts menu working again. Except UI manager insists on
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32584
diff
changeset
|
8037 g_string_append_printf(ui, "<menuitem action='%s'/>", name); |
7b00e8c1ada8
Sort of get the accounts menu working again. Except UI manager insists on
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32584
diff
changeset
|
8038 |
7b00e8c1ada8
Sort of get the accounts menu working again. Except UI manager insists on
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32584
diff
changeset
|
8039 g_signal_connect(G_OBJECT(menuaction), "activate", |
7b00e8c1ada8
Sort of get the accounts menu working again. Except UI manager insists on
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32584
diff
changeset
|
8040 G_CALLBACK(plugin_act), action); |
7b00e8c1ada8
Sort of get the accounts menu working again. Except UI manager insists on
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32584
diff
changeset
|
8041 g_object_set_data_full(G_OBJECT(menuaction), "plugin_action", |
7b00e8c1ada8
Sort of get the accounts menu working again. Except UI manager insists on
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32584
diff
changeset
|
8042 action, |
7b00e8c1ada8
Sort of get the accounts menu working again. Except UI manager insists on
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32584
diff
changeset
|
8043 (GDestroyNotify)purple_plugin_action_free); |
7b00e8c1ada8
Sort of get the accounts menu working again. Except UI manager insists on
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32584
diff
changeset
|
8044 g_free(name); |
7b00e8c1ada8
Sort of get the accounts menu working again. Except UI manager insists on
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32584
diff
changeset
|
8045 } |
7b00e8c1ada8
Sort of get the accounts menu working again. Except UI manager insists on
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32584
diff
changeset
|
8046 else |
7b00e8c1ada8
Sort of get the accounts menu working again. Except UI manager insists on
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32584
diff
changeset
|
8047 g_string_append(ui, "<separator/>"); |
7b00e8c1ada8
Sort of get the accounts menu working again. Except UI manager insists on
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32584
diff
changeset
|
8048 } |
7b00e8c1ada8
Sort of get the accounts menu working again. Except UI manager insists on
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32584
diff
changeset
|
8049 |
7b00e8c1ada8
Sort of get the accounts menu working again. Except UI manager insists on
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32584
diff
changeset
|
8050 g_list_free(actions); |
7b00e8c1ada8
Sort of get the accounts menu working again. Except UI manager insists on
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32584
diff
changeset
|
8051 } |
7b00e8c1ada8
Sort of get the accounts menu working again. Except UI manager insists on
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32584
diff
changeset
|
8052 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
8053 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
8054 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
8055 modify_account_cb(GtkWidget *widget, gpointer data) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
8056 { |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
8057 pidgin_account_dialog_show(PIDGIN_MODIFY_ACCOUNT_DIALOG, data); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
8058 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
8059 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
8060 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
8061 enable_account_cb(GtkCheckMenuItem *widget, gpointer data) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
8062 { |
15822 | 8063 PurpleAccount *account = data; |
8064 const PurpleSavedStatus *saved_status; | |
8065 | |
8066 saved_status = purple_savedstatus_get_current(); | |
8067 purple_savedstatus_activate_for_account(saved_status, account); | |
8068 | |
8069 purple_account_set_enabled(account, PIDGIN_UI, TRUE); | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
8070 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
8071 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
8072 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
8073 disable_account_cb(GtkCheckMenuItem *widget, gpointer data) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
8074 { |
15822 | 8075 PurpleAccount *account = data; |
8076 | |
8077 purple_account_set_enabled(account, PIDGIN_UI, FALSE); | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
8078 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
8079 |
29591
41c53be0e8b5
Added ability to set the mood on all mood-supporting accounts at once (the
Marcus Lundblad <ml@update.uu.se>
parents:
29531
diff
changeset
|
8080 |
29460 | 8081 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
8082 void |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
8083 pidgin_blist_update_accounts_menu(void) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
8084 { |
32585
7b00e8c1ada8
Sort of get the accounts menu working again. Except UI manager insists on
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32584
diff
changeset
|
8085 GList *accounts = NULL; |
7b00e8c1ada8
Sort of get the accounts menu working again. Except UI manager insists on
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32584
diff
changeset
|
8086 |
7b00e8c1ada8
Sort of get the accounts menu working again. Except UI manager insists on
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32584
diff
changeset
|
8087 GtkAction *action; |
7b00e8c1ada8
Sort of get the accounts menu working again. Except UI manager insists on
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32584
diff
changeset
|
8088 GString *accounts_ui; |
7b00e8c1ada8
Sort of get the accounts menu working again. Except UI manager insists on
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32584
diff
changeset
|
8089 GString *enable_ui; |
7b00e8c1ada8
Sort of get the accounts menu working again. Except UI manager insists on
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32584
diff
changeset
|
8090 gchar *ui_string; |
7b00e8c1ada8
Sort of get the accounts menu working again. Except UI manager insists on
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32584
diff
changeset
|
8091 int count = 0; |
7b00e8c1ada8
Sort of get the accounts menu working again. Except UI manager insists on
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32584
diff
changeset
|
8092 |
7b00e8c1ada8
Sort of get the accounts menu working again. Except UI manager insists on
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32584
diff
changeset
|
8093 if ((gtkblist == NULL) || (gtkblist->ui == NULL)) |
7b00e8c1ada8
Sort of get the accounts menu working again. Except UI manager insists on
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32584
diff
changeset
|
8094 return; |
7b00e8c1ada8
Sort of get the accounts menu working again. Except UI manager insists on
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32584
diff
changeset
|
8095 |
7b00e8c1ada8
Sort of get the accounts menu working again. Except UI manager insists on
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32584
diff
changeset
|
8096 /* Clear the old menu */ |
32587
5a809d851acc
Cleanup things in a slightly less (non-fatal) error-producing way.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
8097 if (accounts_action_group) { |
5a809d851acc
Cleanup things in a slightly less (non-fatal) error-producing way.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
8098 gtk_ui_manager_remove_ui(gtkblist->ui, accounts_merge_id); |
5a809d851acc
Cleanup things in a slightly less (non-fatal) error-producing way.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
8099 gtk_ui_manager_remove_action_group(gtkblist->ui, accounts_action_group); |
5a809d851acc
Cleanup things in a slightly less (non-fatal) error-producing way.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
8100 g_object_unref(G_OBJECT(accounts_action_group)); |
5a809d851acc
Cleanup things in a slightly less (non-fatal) error-producing way.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
8101 } |
32585
7b00e8c1ada8
Sort of get the accounts menu working again. Except UI manager insists on
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32584
diff
changeset
|
8102 |
7b00e8c1ada8
Sort of get the accounts menu working again. Except UI manager insists on
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32584
diff
changeset
|
8103 accounts_action_group = gtk_action_group_new("Accounts"); |
7b00e8c1ada8
Sort of get the accounts menu working again. Except UI manager insists on
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32584
diff
changeset
|
8104 #ifdef ENABLE_NLS |
7b00e8c1ada8
Sort of get the accounts menu working again. Except UI manager insists on
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32584
diff
changeset
|
8105 gtk_action_group_set_translation_domain(accounts_action_group, PACKAGE); |
7b00e8c1ada8
Sort of get the accounts menu working again. Except UI manager insists on
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32584
diff
changeset
|
8106 #endif |
7b00e8c1ada8
Sort of get the accounts menu working again. Except UI manager insists on
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32584
diff
changeset
|
8107 accounts_ui = g_string_new(NULL); |
7b00e8c1ada8
Sort of get the accounts menu working again. Except UI manager insists on
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32584
diff
changeset
|
8108 enable_ui = g_string_new(NULL); |
7b00e8c1ada8
Sort of get the accounts menu working again. Except UI manager insists on
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32584
diff
changeset
|
8109 |
7b00e8c1ada8
Sort of get the accounts menu working again. Except UI manager insists on
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32584
diff
changeset
|
8110 action = gtk_action_new("none-available", N_("No actions available"), NULL, NULL); |
7b00e8c1ada8
Sort of get the accounts menu working again. Except UI manager insists on
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32584
diff
changeset
|
8111 gtk_action_group_add_action(accounts_action_group, action); |
7b00e8c1ada8
Sort of get the accounts menu working again. Except UI manager insists on
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32584
diff
changeset
|
8112 gtk_action_set_sensitive(action, FALSE); |
7b00e8c1ada8
Sort of get the accounts menu working again. Except UI manager insists on
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32584
diff
changeset
|
8113 |
7b00e8c1ada8
Sort of get the accounts menu working again. Except UI manager insists on
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32584
diff
changeset
|
8114 for (accounts = purple_accounts_get_all(); accounts; accounts = accounts->next) { |
7b00e8c1ada8
Sort of get the accounts menu working again. Except UI manager insists on
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32584
diff
changeset
|
8115 char *label; |
32590
a3c70b71e18a
Try to reduce the printf'ing a little in the account menu creation.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32589
diff
changeset
|
8116 char *base; |
32585
7b00e8c1ada8
Sort of get the accounts menu working again. Except UI manager insists on
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32584
diff
changeset
|
8117 char *name; |
7b00e8c1ada8
Sort of get the accounts menu working again. Except UI manager insists on
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32584
diff
changeset
|
8118 PurpleAccount *account = NULL; |
7b00e8c1ada8
Sort of get the accounts menu working again. Except UI manager insists on
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32584
diff
changeset
|
8119 |
7b00e8c1ada8
Sort of get the accounts menu working again. Except UI manager insists on
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32584
diff
changeset
|
8120 account = accounts->data; |
7b00e8c1ada8
Sort of get the accounts menu working again. Except UI manager insists on
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32584
diff
changeset
|
8121 |
32590
a3c70b71e18a
Try to reduce the printf'ing a little in the account menu creation.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32589
diff
changeset
|
8122 base = name = g_strdup_printf("account%d", count); |
32585
7b00e8c1ada8
Sort of get the accounts menu working again. Except UI manager insists on
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32584
diff
changeset
|
8123 label = g_strconcat(purple_account_get_username(account), " (", |
7b00e8c1ada8
Sort of get the accounts menu working again. Except UI manager insists on
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32584
diff
changeset
|
8124 purple_account_get_protocol_name(account), ")", NULL); |
7b00e8c1ada8
Sort of get the accounts menu working again. Except UI manager insists on
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32584
diff
changeset
|
8125 action = gtk_action_new(name, label, NULL, NULL); |
7b00e8c1ada8
Sort of get the accounts menu working again. Except UI manager insists on
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32584
diff
changeset
|
8126 g_free(label); |
7b00e8c1ada8
Sort of get the accounts menu working again. Except UI manager insists on
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32584
diff
changeset
|
8127 gtk_action_group_add_action(accounts_action_group, action); |
7b00e8c1ada8
Sort of get the accounts menu working again. Except UI manager insists on
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32584
diff
changeset
|
8128 |
7b00e8c1ada8
Sort of get the accounts menu working again. Except UI manager insists on
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32584
diff
changeset
|
8129 if (!purple_account_get_enabled(account, PIDGIN_UI)) { |
7b00e8c1ada8
Sort of get the accounts menu working again. Except UI manager insists on
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32584
diff
changeset
|
8130 g_string_append_printf(enable_ui, "<menuitem action='%s'/>", name); |
7b00e8c1ada8
Sort of get the accounts menu working again. Except UI manager insists on
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32584
diff
changeset
|
8131 g_signal_connect(G_OBJECT(action), "activate", |
7b00e8c1ada8
Sort of get the accounts menu working again. Except UI manager insists on
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32584
diff
changeset
|
8132 G_CALLBACK(enable_account_cb), account); |
7b00e8c1ada8
Sort of get the accounts menu working again. Except UI manager insists on
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32584
diff
changeset
|
8133 |
7b00e8c1ada8
Sort of get the accounts menu working again. Except UI manager insists on
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32584
diff
changeset
|
8134 } else { |
7b00e8c1ada8
Sort of get the accounts menu working again. Except UI manager insists on
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32584
diff
changeset
|
8135 PurpleConnection *gc = NULL; |
7b00e8c1ada8
Sort of get the accounts menu working again. Except UI manager insists on
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32584
diff
changeset
|
8136 PurplePlugin *plugin = NULL; |
7b00e8c1ada8
Sort of get the accounts menu working again. Except UI manager insists on
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32584
diff
changeset
|
8137 |
7b00e8c1ada8
Sort of get the accounts menu working again. Except UI manager insists on
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32584
diff
changeset
|
8138 g_string_append_printf(accounts_ui, "<menu action='%s'>", name); |
32590
a3c70b71e18a
Try to reduce the printf'ing a little in the account menu creation.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32589
diff
changeset
|
8139 |
a3c70b71e18a
Try to reduce the printf'ing a little in the account menu creation.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32589
diff
changeset
|
8140 name = g_strconcat(base, "-edit", NULL); |
32585
7b00e8c1ada8
Sort of get the accounts menu working again. Except UI manager insists on
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32584
diff
changeset
|
8141 action = gtk_action_new(name, N_("_Edit Account"), NULL, NULL); |
7b00e8c1ada8
Sort of get the accounts menu working again. Except UI manager insists on
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32584
diff
changeset
|
8142 gtk_action_group_add_action(accounts_action_group, action); |
7b00e8c1ada8
Sort of get the accounts menu working again. Except UI manager insists on
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32584
diff
changeset
|
8143 g_signal_connect(G_OBJECT(action), "activate", |
7b00e8c1ada8
Sort of get the accounts menu working again. Except UI manager insists on
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32584
diff
changeset
|
8144 G_CALLBACK(modify_account_cb), account); |
7b00e8c1ada8
Sort of get the accounts menu working again. Except UI manager insists on
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32584
diff
changeset
|
8145 g_string_append_printf(accounts_ui, "<menuitem action='%s'/>", name); |
7b00e8c1ada8
Sort of get the accounts menu working again. Except UI manager insists on
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32584
diff
changeset
|
8146 g_free(name); |
7b00e8c1ada8
Sort of get the accounts menu working again. Except UI manager insists on
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32584
diff
changeset
|
8147 |
7b00e8c1ada8
Sort of get the accounts menu working again. Except UI manager insists on
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32584
diff
changeset
|
8148 g_string_append(accounts_ui, "<separator/>"); |
7b00e8c1ada8
Sort of get the accounts menu working again. Except UI manager insists on
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32584
diff
changeset
|
8149 |
7b00e8c1ada8
Sort of get the accounts menu working again. Except UI manager insists on
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32584
diff
changeset
|
8150 gc = purple_account_get_connection(account); |
32696
763d65f3f758
explicit merge of '6ab9f5ff810acde3c06a2add7b8df2bd75cce6e3'
Elliott Sales de Andrade <qulogic@pidgin.im>
diff
changeset
|
8151 plugin = gc && PURPLE_CONNECTION_IS_CONNECTED(gc) ? purple_connection_get_prpl(gc) : NULL; |
32585
7b00e8c1ada8
Sort of get the accounts menu working again. Except UI manager insists on
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32584
diff
changeset
|
8152 if (plugin && PURPLE_PLUGIN_HAS_ACTIONS(plugin)) { |
32590
a3c70b71e18a
Try to reduce the printf'ing a little in the account menu creation.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32589
diff
changeset
|
8153 build_plugin_actions(accounts_action_group, accounts_ui, base, plugin, gc); |
32585
7b00e8c1ada8
Sort of get the accounts menu working again. Except UI manager insists on
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32584
diff
changeset
|
8154 } else { |
7b00e8c1ada8
Sort of get the accounts menu working again. Except UI manager insists on
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32584
diff
changeset
|
8155 g_string_append(accounts_ui, "<menuitem action='none-available'/>"); |
7b00e8c1ada8
Sort of get the accounts menu working again. Except UI manager insists on
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32584
diff
changeset
|
8156 } |
7b00e8c1ada8
Sort of get the accounts menu working again. Except UI manager insists on
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32584
diff
changeset
|
8157 |
7b00e8c1ada8
Sort of get the accounts menu working again. Except UI manager insists on
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32584
diff
changeset
|
8158 g_string_append(accounts_ui, "<separator/>"); |
7b00e8c1ada8
Sort of get the accounts menu working again. Except UI manager insists on
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32584
diff
changeset
|
8159 |
32590
a3c70b71e18a
Try to reduce the printf'ing a little in the account menu creation.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32589
diff
changeset
|
8160 name = g_strconcat(base, "-disable", NULL); |
32585
7b00e8c1ada8
Sort of get the accounts menu working again. Except UI manager insists on
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32584
diff
changeset
|
8161 action = gtk_action_new(name, N_("_Disable"), NULL, NULL); |
7b00e8c1ada8
Sort of get the accounts menu working again. Except UI manager insists on
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32584
diff
changeset
|
8162 gtk_action_group_add_action(accounts_action_group, action); |
7b00e8c1ada8
Sort of get the accounts menu working again. Except UI manager insists on
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32584
diff
changeset
|
8163 g_signal_connect(G_OBJECT(action), "activate", |
7b00e8c1ada8
Sort of get the accounts menu working again. Except UI manager insists on
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32584
diff
changeset
|
8164 G_CALLBACK(disable_account_cb), account); |
7b00e8c1ada8
Sort of get the accounts menu working again. Except UI manager insists on
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32584
diff
changeset
|
8165 g_string_append_printf(accounts_ui, "<menuitem action='%s'/>", name); |
7b00e8c1ada8
Sort of get the accounts menu working again. Except UI manager insists on
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32584
diff
changeset
|
8166 g_free(name); |
7b00e8c1ada8
Sort of get the accounts menu working again. Except UI manager insists on
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32584
diff
changeset
|
8167 |
7b00e8c1ada8
Sort of get the accounts menu working again. Except UI manager insists on
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32584
diff
changeset
|
8168 g_string_append(accounts_ui, "</menu>"); |
7b00e8c1ada8
Sort of get the accounts menu working again. Except UI manager insists on
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32584
diff
changeset
|
8169 } |
32590
a3c70b71e18a
Try to reduce the printf'ing a little in the account menu creation.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32589
diff
changeset
|
8170 |
a3c70b71e18a
Try to reduce the printf'ing a little in the account menu creation.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32589
diff
changeset
|
8171 g_free(base); |
32585
7b00e8c1ada8
Sort of get the accounts menu working again. Except UI manager insists on
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32584
diff
changeset
|
8172 count++; |
7b00e8c1ada8
Sort of get the accounts menu working again. Except UI manager insists on
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32584
diff
changeset
|
8173 } |
7b00e8c1ada8
Sort of get the accounts menu working again. Except UI manager insists on
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32584
diff
changeset
|
8174 |
7b00e8c1ada8
Sort of get the accounts menu working again. Except UI manager insists on
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32584
diff
changeset
|
8175 ui_string = g_strconcat("<ui><menubar action='BList'><menu action='AccountsMenu'><menu action='EnableAccountMenu'>", |
7b00e8c1ada8
Sort of get the accounts menu working again. Except UI manager insists on
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32584
diff
changeset
|
8176 enable_ui->str, |
7b00e8c1ada8
Sort of get the accounts menu working again. Except UI manager insists on
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32584
diff
changeset
|
8177 "</menu><placeholder name='Accounts'>", |
7b00e8c1ada8
Sort of get the accounts menu working again. Except UI manager insists on
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32584
diff
changeset
|
8178 accounts_ui->str, |
7b00e8c1ada8
Sort of get the accounts menu working again. Except UI manager insists on
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32584
diff
changeset
|
8179 "</placeholder></menu></menubar></ui>", |
7b00e8c1ada8
Sort of get the accounts menu working again. Except UI manager insists on
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32584
diff
changeset
|
8180 NULL); |
7b00e8c1ada8
Sort of get the accounts menu working again. Except UI manager insists on
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32584
diff
changeset
|
8181 gtk_ui_manager_insert_action_group(gtkblist->ui, accounts_action_group, 1); |
7b00e8c1ada8
Sort of get the accounts menu working again. Except UI manager insists on
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32584
diff
changeset
|
8182 accounts_merge_id = gtk_ui_manager_add_ui_from_string(gtkblist->ui, ui_string, -1, NULL); |
7b00e8c1ada8
Sort of get the accounts menu working again. Except UI manager insists on
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32584
diff
changeset
|
8183 purple_debug_info("blist", "The account menu is {%s}\n", ui_string); |
32590
a3c70b71e18a
Try to reduce the printf'ing a little in the account menu creation.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32589
diff
changeset
|
8184 |
32585
7b00e8c1ada8
Sort of get the accounts menu working again. Except UI manager insists on
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32584
diff
changeset
|
8185 g_string_free(enable_ui, TRUE); |
7b00e8c1ada8
Sort of get the accounts menu working again. Except UI manager insists on
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32584
diff
changeset
|
8186 g_string_free(accounts_ui, TRUE); |
7b00e8c1ada8
Sort of get the accounts menu working again. Except UI manager insists on
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32584
diff
changeset
|
8187 g_free(ui_string); |
32620
82f26939d2ba
Remove all the old GTK_CHECK_VERSION stuff. Of course, this makes this
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32618
diff
changeset
|
8188 } |
82f26939d2ba
Remove all the old GTK_CHECK_VERSION stuff. Of course, this makes this
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32618
diff
changeset
|
8189 |
32583
2bc917bbd07e
Move some UI manager stuff out of the blist structure and into the source
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32582
diff
changeset
|
8190 static guint plugins_merge_id; |
2bc917bbd07e
Move some UI manager stuff out of the blist structure and into the source
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32582
diff
changeset
|
8191 static GtkActionGroup *plugins_action_group = NULL; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
8192 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
8193 void |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
8194 pidgin_blist_update_plugin_actions(void) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
8195 { |
15822 | 8196 PurplePlugin *plugin = NULL; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
8197 GList *l; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
8198 |
32586
3abf90b398fc
Re-enable the plugin sub-menus. Even though it's similar to the accounts
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32585
diff
changeset
|
8199 GtkAction *action; |
3abf90b398fc
Re-enable the plugin sub-menus. Even though it's similar to the accounts
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32585
diff
changeset
|
8200 GString *plugins_ui; |
3abf90b398fc
Re-enable the plugin sub-menus. Even though it's similar to the accounts
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32585
diff
changeset
|
8201 gchar *ui_string; |
3abf90b398fc
Re-enable the plugin sub-menus. Even though it's similar to the accounts
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32585
diff
changeset
|
8202 int count = 0; |
3abf90b398fc
Re-enable the plugin sub-menus. Even though it's similar to the accounts
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32585
diff
changeset
|
8203 |
3abf90b398fc
Re-enable the plugin sub-menus. Even though it's similar to the accounts
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32585
diff
changeset
|
8204 if ((gtkblist == NULL) || (gtkblist->ui == NULL)) |
3abf90b398fc
Re-enable the plugin sub-menus. Even though it's similar to the accounts
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32585
diff
changeset
|
8205 return; |
3abf90b398fc
Re-enable the plugin sub-menus. Even though it's similar to the accounts
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32585
diff
changeset
|
8206 |
3abf90b398fc
Re-enable the plugin sub-menus. Even though it's similar to the accounts
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32585
diff
changeset
|
8207 /* Clear the old menu */ |
32587
5a809d851acc
Cleanup things in a slightly less (non-fatal) error-producing way.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
8208 if (plugins_action_group) { |
5a809d851acc
Cleanup things in a slightly less (non-fatal) error-producing way.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
8209 gtk_ui_manager_remove_ui(gtkblist->ui, plugins_merge_id); |
5a809d851acc
Cleanup things in a slightly less (non-fatal) error-producing way.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
8210 gtk_ui_manager_remove_action_group(gtkblist->ui, plugins_action_group); |
5a809d851acc
Cleanup things in a slightly less (non-fatal) error-producing way.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
8211 g_object_unref(G_OBJECT(plugins_action_group)); |
5a809d851acc
Cleanup things in a slightly less (non-fatal) error-producing way.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
8212 } |
32586
3abf90b398fc
Re-enable the plugin sub-menus. Even though it's similar to the accounts
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32585
diff
changeset
|
8213 |
32598
fb50e2499748
Fix copy+paste typo. Doesn't seem to make a real difference though.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32590
diff
changeset
|
8214 plugins_action_group = gtk_action_group_new("PluginActions"); |
32586
3abf90b398fc
Re-enable the plugin sub-menus. Even though it's similar to the accounts
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32585
diff
changeset
|
8215 #ifdef ENABLE_NLS |
3abf90b398fc
Re-enable the plugin sub-menus. Even though it's similar to the accounts
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32585
diff
changeset
|
8216 gtk_action_group_set_translation_domain(plugins_action_group, PACKAGE); |
3abf90b398fc
Re-enable the plugin sub-menus. Even though it's similar to the accounts
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32585
diff
changeset
|
8217 #endif |
3abf90b398fc
Re-enable the plugin sub-menus. Even though it's similar to the accounts
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32585
diff
changeset
|
8218 plugins_ui = g_string_new(NULL); |
3abf90b398fc
Re-enable the plugin sub-menus. Even though it's similar to the accounts
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32585
diff
changeset
|
8219 |
3abf90b398fc
Re-enable the plugin sub-menus. Even though it's similar to the accounts
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32585
diff
changeset
|
8220 /* Add a submenu for each plugin with custom actions */ |
3abf90b398fc
Re-enable the plugin sub-menus. Even though it's similar to the accounts
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32585
diff
changeset
|
8221 for (l = purple_plugins_get_loaded(); l; l = l->next) { |
3abf90b398fc
Re-enable the plugin sub-menus. Even though it's similar to the accounts
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32585
diff
changeset
|
8222 char *name; |
3abf90b398fc
Re-enable the plugin sub-menus. Even though it's similar to the accounts
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32585
diff
changeset
|
8223 |
3abf90b398fc
Re-enable the plugin sub-menus. Even though it's similar to the accounts
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32585
diff
changeset
|
8224 plugin = (PurplePlugin *)l->data; |
3abf90b398fc
Re-enable the plugin sub-menus. Even though it's similar to the accounts
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32585
diff
changeset
|
8225 |
3abf90b398fc
Re-enable the plugin sub-menus. Even though it's similar to the accounts
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32585
diff
changeset
|
8226 if (PURPLE_IS_PROTOCOL_PLUGIN(plugin)) |
3abf90b398fc
Re-enable the plugin sub-menus. Even though it's similar to the accounts
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32585
diff
changeset
|
8227 continue; |
3abf90b398fc
Re-enable the plugin sub-menus. Even though it's similar to the accounts
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32585
diff
changeset
|
8228 |
3abf90b398fc
Re-enable the plugin sub-menus. Even though it's similar to the accounts
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32585
diff
changeset
|
8229 if (!PURPLE_PLUGIN_HAS_ACTIONS(plugin)) |
3abf90b398fc
Re-enable the plugin sub-menus. Even though it's similar to the accounts
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32585
diff
changeset
|
8230 continue; |
3abf90b398fc
Re-enable the plugin sub-menus. Even though it's similar to the accounts
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32585
diff
changeset
|
8231 |
3abf90b398fc
Re-enable the plugin sub-menus. Even though it's similar to the accounts
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32585
diff
changeset
|
8232 name = g_strdup_printf("plugin%d", count); |
3abf90b398fc
Re-enable the plugin sub-menus. Even though it's similar to the accounts
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32585
diff
changeset
|
8233 action = gtk_action_new(name, plugin->info->name, NULL, NULL); |
3abf90b398fc
Re-enable the plugin sub-menus. Even though it's similar to the accounts
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32585
diff
changeset
|
8234 gtk_action_group_add_action(plugins_action_group, action); |
3abf90b398fc
Re-enable the plugin sub-menus. Even though it's similar to the accounts
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32585
diff
changeset
|
8235 g_string_append_printf(plugins_ui, "<menu action='%s'>", name); |
32589
f55f8592986c
Don't get account and plugin actions confused by using the same action name
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32588
diff
changeset
|
8236 |
f55f8592986c
Don't get account and plugin actions confused by using the same action name
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32588
diff
changeset
|
8237 build_plugin_actions(plugins_action_group, plugins_ui, name, plugin, NULL); |
32586
3abf90b398fc
Re-enable the plugin sub-menus. Even though it's similar to the accounts
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32585
diff
changeset
|
8238 |
3abf90b398fc
Re-enable the plugin sub-menus. Even though it's similar to the accounts
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32585
diff
changeset
|
8239 g_string_append(plugins_ui, "</menu>"); |
3abf90b398fc
Re-enable the plugin sub-menus. Even though it's similar to the accounts
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32585
diff
changeset
|
8240 count++; |
32589
f55f8592986c
Don't get account and plugin actions confused by using the same action name
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32588
diff
changeset
|
8241 |
f55f8592986c
Don't get account and plugin actions confused by using the same action name
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32588
diff
changeset
|
8242 g_free(name); |
32586
3abf90b398fc
Re-enable the plugin sub-menus. Even though it's similar to the accounts
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32585
diff
changeset
|
8243 } |
3abf90b398fc
Re-enable the plugin sub-menus. Even though it's similar to the accounts
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32585
diff
changeset
|
8244 |
3abf90b398fc
Re-enable the plugin sub-menus. Even though it's similar to the accounts
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32585
diff
changeset
|
8245 ui_string = g_strconcat("<ui><menubar action='BList'><menu action='ToolsMenu'><placeholder name='PluginActions'>", |
3abf90b398fc
Re-enable the plugin sub-menus. Even though it's similar to the accounts
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32585
diff
changeset
|
8246 plugins_ui->str, |
3abf90b398fc
Re-enable the plugin sub-menus. Even though it's similar to the accounts
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32585
diff
changeset
|
8247 "</placeholder></menu></menubar></ui>", |
3abf90b398fc
Re-enable the plugin sub-menus. Even though it's similar to the accounts
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32585
diff
changeset
|
8248 NULL); |
3abf90b398fc
Re-enable the plugin sub-menus. Even though it's similar to the accounts
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32585
diff
changeset
|
8249 gtk_ui_manager_insert_action_group(gtkblist->ui, plugins_action_group, 1); |
3abf90b398fc
Re-enable the plugin sub-menus. Even though it's similar to the accounts
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32585
diff
changeset
|
8250 plugins_merge_id = gtk_ui_manager_add_ui_from_string(gtkblist->ui, ui_string, -1, NULL); |
3abf90b398fc
Re-enable the plugin sub-menus. Even though it's similar to the accounts
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32585
diff
changeset
|
8251 purple_debug_info("blist", "The plugins menu is {%s}\n", ui_string); |
3abf90b398fc
Re-enable the plugin sub-menus. Even though it's similar to the accounts
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32585
diff
changeset
|
8252 |
3abf90b398fc
Re-enable the plugin sub-menus. Even though it's similar to the accounts
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32585
diff
changeset
|
8253 g_string_free(plugins_ui, TRUE); |
3abf90b398fc
Re-enable the plugin sub-menus. Even though it's similar to the accounts
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32585
diff
changeset
|
8254 g_free(ui_string); |
32620
82f26939d2ba
Remove all the old GTK_CHECK_VERSION stuff. Of course, this makes this
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32618
diff
changeset
|
8255 } |
82f26939d2ba
Remove all the old GTK_CHECK_VERSION stuff. Of course, this makes this
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32618
diff
changeset
|
8256 |
32584
a91802881406
Get BList sort methods actually working, and clean up the warnings that
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32583
diff
changeset
|
8257 static void |
a91802881406
Get BList sort methods actually working, and clean up the warnings that
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32583
diff
changeset
|
8258 sortmethod_act(GtkRadioAction *action, GtkRadioAction *current, char *id) |
a91802881406
Get BList sort methods actually working, and clean up the warnings that
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32583
diff
changeset
|
8259 { |
a91802881406
Get BList sort methods actually working, and clean up the warnings that
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32583
diff
changeset
|
8260 if (action == current) |
a91802881406
Get BList sort methods actually working, and clean up the warnings that
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32583
diff
changeset
|
8261 { |
a91802881406
Get BList sort methods actually working, and clean up the warnings that
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32583
diff
changeset
|
8262 pidgin_set_cursor(gtkblist->window, GDK_WATCH); |
a91802881406
Get BList sort methods actually working, and clean up the warnings that
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32583
diff
changeset
|
8263 /* This is redundant. I think. */ |
a91802881406
Get BList sort methods actually working, and clean up the warnings that
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32583
diff
changeset
|
8264 /* pidgin_blist_sort_method_set(id); */ |
a91802881406
Get BList sort methods actually working, and clean up the warnings that
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32583
diff
changeset
|
8265 purple_prefs_set_string(PIDGIN_PREFS_ROOT "/blist/sort_type", id); |
a91802881406
Get BList sort methods actually working, and clean up the warnings that
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32583
diff
changeset
|
8266 |
a91802881406
Get BList sort methods actually working, and clean up the warnings that
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32583
diff
changeset
|
8267 pidgin_clear_cursor(gtkblist->window); |
a91802881406
Get BList sort methods actually working, and clean up the warnings that
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32583
diff
changeset
|
8268 } |
a91802881406
Get BList sort methods actually working, and clean up the warnings that
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32583
diff
changeset
|
8269 } |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
8270 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
8271 void |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
8272 pidgin_blist_update_sort_methods(void) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
8273 { |
15500
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15499
diff
changeset
|
8274 PidginBlistSortMethod *method = NULL; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
8275 GList *l; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
8276 GSList *sl = 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
|
8277 const char *m = purple_prefs_get_string(PIDGIN_PREFS_ROOT "/blist/sort_type"); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
8278 |
32584
a91802881406
Get BList sort methods actually working, and clean up the warnings that
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32583
diff
changeset
|
8279 GtkRadioAction *action; |
32582
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
8280 GString *ui_string; |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
8281 |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
8282 if ((gtkblist == NULL) || (gtkblist->ui == NULL)) |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
8283 return; |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
8284 |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
8285 /* Clear the old menu */ |
32587
5a809d851acc
Cleanup things in a slightly less (non-fatal) error-producing way.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
8286 if (sort_action_group) { |
5a809d851acc
Cleanup things in a slightly less (non-fatal) error-producing way.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
8287 gtk_ui_manager_remove_ui(gtkblist->ui, sort_merge_id); |
5a809d851acc
Cleanup things in a slightly less (non-fatal) error-producing way.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
8288 gtk_ui_manager_remove_action_group(gtkblist->ui, sort_action_group); |
5a809d851acc
Cleanup things in a slightly less (non-fatal) error-producing way.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
8289 g_object_unref(G_OBJECT(sort_action_group)); |
5a809d851acc
Cleanup things in a slightly less (non-fatal) error-producing way.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32586
diff
changeset
|
8290 } |
32584
a91802881406
Get BList sort methods actually working, and clean up the warnings that
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32583
diff
changeset
|
8291 |
a91802881406
Get BList sort methods actually working, and clean up the warnings that
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32583
diff
changeset
|
8292 sort_action_group = gtk_action_group_new("SortMethods"); |
a91802881406
Get BList sort methods actually working, and clean up the warnings that
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32583
diff
changeset
|
8293 #ifdef ENABLE_NLS |
a91802881406
Get BList sort methods actually working, and clean up the warnings that
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32583
diff
changeset
|
8294 gtk_action_group_set_translation_domain(sort_action_group, PACKAGE); |
a91802881406
Get BList sort methods actually working, and clean up the warnings that
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32583
diff
changeset
|
8295 #endif |
a91802881406
Get BList sort methods actually working, and clean up the warnings that
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32583
diff
changeset
|
8296 ui_string = g_string_new("<ui><menubar name='BList'>" |
a91802881406
Get BList sort methods actually working, and clean up the warnings that
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32583
diff
changeset
|
8297 "<menu action='BuddiesMenu'><menu action='SortMenu'>"); |
a91802881406
Get BList sort methods actually working, and clean up the warnings that
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32583
diff
changeset
|
8298 |
32582
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
8299 for (l = pidgin_blist_sort_methods; l; l = l->next) { |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
8300 method = (PidginBlistSortMethod *)l->data; |
32584
a91802881406
Get BList sort methods actually working, and clean up the warnings that
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32583
diff
changeset
|
8301 |
a91802881406
Get BList sort methods actually working, and clean up the warnings that
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32583
diff
changeset
|
8302 g_string_append_printf(ui_string, "<menuitem action='%s'/>", method->id); |
32582
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
8303 action = gtk_radio_action_new(method->id, |
32584
a91802881406
Get BList sort methods actually working, and clean up the warnings that
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32583
diff
changeset
|
8304 method->name, |
32582
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
8305 NULL, |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
8306 NULL, |
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
8307 0); |
32584
a91802881406
Get BList sort methods actually working, and clean up the warnings that
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32583
diff
changeset
|
8308 gtk_action_group_add_action_with_accel(sort_action_group, GTK_ACTION(action), NULL); |
a91802881406
Get BList sort methods actually working, and clean up the warnings that
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32583
diff
changeset
|
8309 |
a91802881406
Get BList sort methods actually working, and clean up the warnings that
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32583
diff
changeset
|
8310 gtk_radio_action_set_group(action, sl); |
a91802881406
Get BList sort methods actually working, and clean up the warnings that
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32583
diff
changeset
|
8311 sl = gtk_radio_action_get_group(action); |
a91802881406
Get BList sort methods actually working, and clean up the warnings that
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32583
diff
changeset
|
8312 |
32582
816f62c582d9
Start converting Buddy List to new UI Manager code. Some auto-generated
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32581
diff
changeset
|
8313 if (!strcmp(m, method->id)) |
32584
a91802881406
Get BList sort methods actually working, and clean up the warnings that
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32583
diff
changeset
|
8314 gtk_toggle_action_set_active(GTK_TOGGLE_ACTION(action), TRUE); |
a91802881406
Get BList sort methods actually working, and clean up the warnings that
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32583
diff
changeset
|
8315 else |
a91802881406
Get BList sort methods actually working, and clean up the warnings that
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32583
diff
changeset
|
8316 gtk_toggle_action_set_active(GTK_TOGGLE_ACTION(action), FALSE); |
a91802881406
Get BList sort methods actually working, and clean up the warnings that
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32583
diff
changeset
|
8317 |
a91802881406
Get BList sort methods actually working, and clean up the warnings that
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32583
diff
changeset
|
8318 g_signal_connect(G_OBJECT(action), "changed", |
a91802881406
Get BList sort methods actually working, and clean up the warnings that
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32583
diff
changeset
|
8319 G_CALLBACK(sortmethod_act), method->id); |
a91802881406
Get BList sort methods actually working, and clean up the warnings that
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32583
diff
changeset
|
8320 } |
a91802881406
Get BList sort methods actually working, and clean up the warnings that
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32583
diff
changeset
|
8321 |
a91802881406
Get BList sort methods actually working, and clean up the warnings that
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32583
diff
changeset
|
8322 g_string_append(ui_string, "</menu></menu></menubar></ui>"); |
a91802881406
Get BList sort methods actually working, and clean up the warnings that
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32583
diff
changeset
|
8323 gtk_ui_manager_insert_action_group(gtkblist->ui, sort_action_group, 1); |
32583
2bc917bbd07e
Move some UI manager stuff out of the blist structure and into the source
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32582
diff
changeset
|
8324 sort_merge_id = gtk_ui_manager_add_ui_from_string(gtkblist->ui, ui_string->str, -1, NULL); |
32584
a91802881406
Get BList sort methods actually working, and clean up the warnings that
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32583
diff
changeset
|
8325 |
a91802881406
Get BList sort methods actually working, and clean up the warnings that
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32583
diff
changeset
|
8326 g_string_free(ui_string, TRUE); |
32683
d8c74de25b5f
Apply some updates to UI Manager version of blist menu: Change the key
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32673
diff
changeset
|
8327 } |
d8c74de25b5f
Apply some updates to UI Manager version of blist menu: Change the key
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32673
diff
changeset
|
8328 |