annotate pidgin/gtkblist.c @ 17835:751fbc2eff7e

merge of '3b80bf600e31f234766ed90a7bba5ea586178f08' and '3c31f6f6c8e998f6e9c550e05bf5dfdcdc9bb154'
author Stu Tomlinson <stu@nosnilmot.com>
date Mon, 11 Jun 2007 13:08:54 +0000
parents 0e445e906cfd 18b62b0fc253
children 452bd3baa9af
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1 /*
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2 * @file gtkblist.c GTK+ BuddyList API
16193
247e421c4fa6 Rename the Doxygen group from gtkui to pidgin.
Richard Laager <rlaager@wiktel.com>
parents: 16122
diff changeset
3 * @ingroup pidgin
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4 *
15871
66dff3dfdea6 Re-sed the copyright notices so they don't all talk about Purple.
Richard Laager <rlaager@wiktel.com>
parents: 15823
diff changeset
5 * pidgin
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6 *
15871
66dff3dfdea6 Re-sed the copyright notices so they don't all talk about Purple.
Richard Laager <rlaager@wiktel.com>
parents: 15823
diff changeset
7 * Pidgin is the legal property of its developers, whose names are too numerous
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
8 * 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
9 * source distribution.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
10 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
11 * 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
12 * 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
13 * 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
14 * (at your option) any later version.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
15 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
16 * 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
17 * 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
18 * 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
19 * GNU General Public License for more details.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
20 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
21 * 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
22 * along with this program; if not, write to the Free Software
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
24 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
25 */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
26 #include "internal.h"
15514
535f002e7b0f More pidgin changes
Sean Egan <seanegan@gmail.com>
parents: 15510
diff changeset
27 #include "pidgin.h"
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
28
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
29 #include "account.h"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
30 #include "connection.h"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
31 #include "core.h"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
32 #include "debug.h"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
33 #include "notify.h"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
34 #include "prpl.h"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
35 #include "prefs.h"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
36 #include "plugin.h"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
37 #include "request.h"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
38 #include "signals.h"
15822
84b0f9b23ede According to etags, pidgin/ should be completely clean of references to 'gaim' as a client
Sean Egan <seanegan@gmail.com>
parents: 15821
diff changeset
39 #include "pidginstock.h"
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
40 #include "util.h"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
41
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
42 #include "gtkaccount.h"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
43 #include "gtkblist.h"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
44 #include "gtkcellrendererexpander.h"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
45 #include "gtkconv.h"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
46 #include "gtkdebug.h"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
47 #include "gtkdialogs.h"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
48 #include "gtkft.h"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
49 #include "gtklog.h"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
50 #include "gtkmenutray.h"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
51 #include "gtkpounce.h"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
52 #include "gtkplugin.h"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
53 #include "gtkprefs.h"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
54 #include "gtkprivacy.h"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
55 #include "gtkroomlist.h"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
56 #include "gtkstatusbox.h"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
57 #include "gtkscrollbook.h"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
58 #include "gtkutils.h"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
59
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
60 #include <gdk/gdkkeysyms.h>
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
61 #include <gtk/gtk.h>
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
62 #include <gdk/gdk.h>
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
63
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
64 #define HEADLINE_CLOSE_SIZE 12
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
65
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
66 typedef struct
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
67 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
68 PurpleAccount *account;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
69
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
70 GtkWidget *window;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
71 GtkWidget *combo;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
72 GtkWidget *entry;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
73 GtkWidget *entry_for_alias;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
74 GtkWidget *account_box;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
75
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
76 } PidginAddBuddyData;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
77
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
78 typedef struct
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
79 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
80 PurpleAccount *account;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
81 gchar *default_chat_name;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
82
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
83 GtkWidget *window;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
84 GtkWidget *account_menu;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
85 GtkWidget *alias_entry;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
86 GtkWidget *group_combo;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
87 GtkWidget *entries_box;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
88 GtkSizeGroup *sg;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
89
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
90 GList *entries;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
91
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
92 } PidginAddChatData;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
93
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
94 typedef struct
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
95 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
96 PurpleAccount *account;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
97
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
98 GtkWidget *window;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
99 GtkWidget *account_menu;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
100 GtkWidget *entries_box;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
101 GtkSizeGroup *sg;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
102
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
103 GList *entries;
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
104 } PidginJoinChatData;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
105
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
106
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
107 static GtkWidget *accountmenu = NULL;
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 static guint visibility_manager_count = 0;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
110 static gboolean gtk_blist_obscured = FALSE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
111
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
112 static GList *pidgin_blist_sort_methods = NULL;
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
113 static struct pidgin_blist_sort_method *current_sort_method = NULL;
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
114 static void sort_method_none(PurpleBlistNode *node, PurpleBuddyList *blist, GtkTreeIter groupiter, GtkTreeIter *cur, GtkTreeIter *iter);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
115
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
116 /* The functions we use for sorting aren't available in gtk 2.0.x, and
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
117 * segfault in 2.2.0. 2.2.1 is known to work, so I'll require that */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
118 #if GTK_CHECK_VERSION(2,2,1)
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
119 static void sort_method_alphabetical(PurpleBlistNode *node, PurpleBuddyList *blist, GtkTreeIter groupiter, GtkTreeIter *cur, GtkTreeIter *iter);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
120 static void sort_method_status(PurpleBlistNode *node, PurpleBuddyList *blist, GtkTreeIter groupiter, GtkTreeIter *cur, GtkTreeIter *iter);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
121 static void sort_method_log(PurpleBlistNode *node, PurpleBuddyList *blist, GtkTreeIter groupiter, GtkTreeIter *cur, GtkTreeIter *iter);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
122 #endif
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
123 static PidginBuddyList *gtkblist = NULL;
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
124
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
125 static gboolean pidgin_blist_refresh_timer(PurpleBuddyList *list);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
126 static void pidgin_blist_update_buddy(PurpleBuddyList *list, PurpleBlistNode *node, gboolean statusChange);
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
127 static void pidgin_blist_selection_changed(GtkTreeSelection *selection, gpointer data);
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
128 static void pidgin_blist_update(PurpleBuddyList *list, PurpleBlistNode *node);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
129 static void pidgin_blist_update_group(PurpleBuddyList *list, PurpleBlistNode *node);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
130 static void pidgin_blist_update_contact(PurpleBuddyList *list, PurpleBlistNode *node);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
131 static char *pidgin_get_tooltip_text(PurpleBlistNode *node, gboolean full);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
132 static const char *item_factory_translate_func (const char *path, gpointer func_data);
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
133 static gboolean get_iter_from_node(PurpleBlistNode *node, GtkTreeIter *iter);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
134 static void redo_buddy_list(PurpleBuddyList *list, gboolean remove, gboolean rerender);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
135 static void pidgin_blist_collapse_contact_cb(GtkWidget *w, PurpleBlistNode *node);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
136 static char *pidgin_get_group_title(PurpleBlistNode *gnode, gboolean expanded);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
137
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
138 static void pidgin_blist_tooltip_destroy(void);
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
139
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
140 struct _pidgin_blist_node {
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
141 GtkTreeRowReference *row;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
142 gboolean contact_expanded;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
143 gboolean recent_signonoff;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
144 gint recent_signonoff_timer;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
145 };
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
146
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
147 static char dim_grey_string[8] = "";
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
148 static char *dim_grey()
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
149 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
150 if (!gtkblist)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
151 return "dim grey";
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
152 if (!dim_grey_string[0]) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
153 GtkStyle *style = gtk_widget_get_style(gtkblist->treeview);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
154 snprintf(dim_grey_string, sizeof(dim_grey_string), "#%02x%02x%02x",
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
155 style->text_aa[GTK_STATE_NORMAL].red >> 8,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
156 style->text_aa[GTK_STATE_NORMAL].green >> 8,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
157 style->text_aa[GTK_STATE_NORMAL].blue >> 8);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
158 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
159 return dim_grey_string;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
160 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
161
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
162 /***************************************************
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
163 * Callbacks *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
164 ***************************************************/
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
165 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
166 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
167 if (event->state == GDK_VISIBILITY_FULLY_OBSCURED)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
168 gtk_blist_obscured = TRUE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
169 else if (gtk_blist_obscured) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
170 gtk_blist_obscured = FALSE;
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
171 pidgin_blist_refresh_timer(purple_get_blist());
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
172 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
173
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
174 /* continue to handle event normally */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
175 return FALSE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
176 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
177
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
178 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
179 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
180 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
181 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
182 purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/blist/list_visible", FALSE);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
183 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
184 purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/blist/list_visible", TRUE);
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
185 pidgin_blist_refresh_timer(purple_get_blist());
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
186 }
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
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
189 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
190 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
191 purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/blist/list_maximized", TRUE);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
192 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
193 purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/blist/list_maximized", FALSE);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
194 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
195
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
196 /* Refresh gtkblist if un-iconifying */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
197 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
198 if (!(event->new_window_state & GDK_WINDOW_STATE_ICONIFIED))
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
199 pidgin_blist_refresh_timer(purple_get_blist());
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
200 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
201
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
202 return FALSE;
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
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
205 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
206 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
207 if(visibility_manager_count)
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
208 purple_blist_set_visible(FALSE);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
209 else
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
210 purple_core_quit();
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
211
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
212 /* 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
213 return TRUE;
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
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
216 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
217 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
218 /* unfortunately GdkEventConfigure ignores the window gravity, but *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
219 * 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
220 * 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
221 * 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
222 * to work correctly. - Robot101 */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
223 gint x, y;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
224
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
225 /* 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
226 * give us bogus (0,0) coordinates. - xOr */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
227 if (GTK_WIDGET_VISIBLE(w))
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
228 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
229 else
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
230 return FALSE; /* carry on normally */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
231
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
232 #ifdef _WIN32
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
233 /* 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
234 * when the window is being maximized */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
235 if (gdk_window_get_state(w->window)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
236 & GDK_WINDOW_STATE_MAXIMIZED) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
237 return FALSE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
238 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
239 #endif
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 /* 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
242 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
243 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
244 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
245 event->height == purple_prefs_get_int(PIDGIN_PREFS_ROOT "/blist/height")) {
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
246
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
247 return FALSE; /* carry on normally */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
248 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
249
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
250 /* don't save off-screen positioning */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
251 if (x + event->width < 0 ||
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
252 y + event->height < 0 ||
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
253 x > gdk_screen_width() ||
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
254 y > gdk_screen_height()) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
255
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
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
259 /* 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
260 if(purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/blist/list_maximized"))
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
261 return FALSE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
262
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
263 /* 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
264 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
265 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
266 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
267 purple_prefs_set_int(PIDGIN_PREFS_ROOT "/blist/height", event->height);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
268
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
269 /* continue to handle event normally */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
270 return FALSE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
271 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
272
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
273 static void gtk_blist_menu_info_cb(GtkWidget *w, PurpleBuddy *b)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
274 {
16988
563a42d98e3a Fix ticket #387.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16905
diff changeset
275 PurpleNotifyUserInfo *info = purple_notify_user_info_new();
563a42d98e3a Fix ticket #387.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16905
diff changeset
276 purple_notify_user_info_add_pair(info, _("Information"), _("Retrieving..."));
563a42d98e3a Fix ticket #387.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16905
diff changeset
277 purple_notify_userinfo(b->account->gc, purple_buddy_get_name(b), info, NULL, NULL);
563a42d98e3a Fix ticket #387.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16905
diff changeset
278 purple_notify_user_info_destroy(info);
563a42d98e3a Fix ticket #387.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16905
diff changeset
279
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
280 serv_get_info(b->account->gc, b->name);
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
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
283 static void gtk_blist_menu_im_cb(GtkWidget *w, PurpleBuddy *b)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
284 {
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
285 pidgin_dialogs_im_with_user(b->account, b->name);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
286 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
287
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
288 static void gtk_blist_menu_send_file_cb(GtkWidget *w, PurpleBuddy *b)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
289 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
290 serv_send_file(b->account->gc, b->name, NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
291 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
292
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
293 static void gtk_blist_menu_autojoin_cb(GtkWidget *w, PurpleChat *chat)
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
294 {
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
295 purple_blist_node_set_bool((PurpleBlistNode*)chat, "gtk-autojoin",
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
296 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
297 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
298
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
299 static void gtk_blist_join_chat(PurpleChat *chat)
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
300 {
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
301 PurpleConversation *conv;
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
302
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
303 conv = purple_find_conversation_with_account(PURPLE_CONV_TYPE_CHAT,
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
304 purple_chat_get_name(chat),
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
305 chat->account);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
306
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
307 if (conv != NULL)
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
308 purple_conversation_present(conv);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
309
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
310 serv_join_chat(chat->account->gc, chat->components);
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
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
313 static void gtk_blist_menu_join_cb(GtkWidget *w, PurpleChat *chat)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
314 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
315 gtk_blist_join_chat(chat);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
316 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
317
16275
9a4854d71234 Patch #205, from SuperMMX. Fix a bug related to using F2 to alias
Mark Doliner <mark@kingant.net>
parents: 16222
diff changeset
318 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
319 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
320 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
321 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
322 {
9a4854d71234 Patch #205, from SuperMMX. Fix a bug related to using F2 to alias
Mark Doliner <mark@kingant.net>
parents: 16222
diff changeset
323 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
324 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
325 GValue val;
9a4854d71234 Patch #205, from SuperMMX. Fix a bug related to using F2 to alias
Mark Doliner <mark@kingant.net>
parents: 16222
diff changeset
326 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
327 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
328
9a4854d71234 Patch #205, from SuperMMX. Fix a bug related to using F2 to alias
Mark Doliner <mark@kingant.net>
parents: 16222
diff changeset
329 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
330 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
331 gtk_tree_path_free (path);
9a4854d71234 Patch #205, from SuperMMX. Fix a bug related to using F2 to alias
Mark Doliner <mark@kingant.net>
parents: 16222
diff changeset
332 val.g_type = 0;
9a4854d71234 Patch #205, from SuperMMX. Fix a bug related to using F2 to alias
Mark Doliner <mark@kingant.net>
parents: 16222
diff changeset
333 gtk_tree_model_get_value (GTK_TREE_MODEL(gtkblist->treemodel), &iter, NODE_COLUMN, &val);
9a4854d71234 Patch #205, from SuperMMX. Fix a bug related to using F2 to alias
Mark Doliner <mark@kingant.net>
parents: 16222
diff changeset
334 node = g_value_get_pointer(&val);
9a4854d71234 Patch #205, from SuperMMX. Fix a bug related to using F2 to alias
Mark Doliner <mark@kingant.net>
parents: 16222
diff changeset
335
9a4854d71234 Patch #205, from SuperMMX. Fix a bug related to using F2 to alias
Mark Doliner <mark@kingant.net>
parents: 16222
diff changeset
336 switch (node->type) {
9a4854d71234 Patch #205, from SuperMMX. Fix a bug related to using F2 to alias
Mark Doliner <mark@kingant.net>
parents: 16222
diff changeset
337 case PURPLE_BLIST_CONTACT_NODE:
9a4854d71234 Patch #205, from SuperMMX. Fix a bug related to using F2 to alias
Mark Doliner <mark@kingant.net>
parents: 16222
diff changeset
338 text = purple_contact_get_alias((PurpleContact *)node);
9a4854d71234 Patch #205, from SuperMMX. Fix a bug related to using F2 to alias
Mark Doliner <mark@kingant.net>
parents: 16222
diff changeset
339 break;
9a4854d71234 Patch #205, from SuperMMX. Fix a bug related to using F2 to alias
Mark Doliner <mark@kingant.net>
parents: 16222
diff changeset
340 case PURPLE_BLIST_BUDDY_NODE:
9a4854d71234 Patch #205, from SuperMMX. Fix a bug related to using F2 to alias
Mark Doliner <mark@kingant.net>
parents: 16222
diff changeset
341 text = purple_buddy_get_alias((PurpleBuddy *)node);
9a4854d71234 Patch #205, from SuperMMX. Fix a bug related to using F2 to alias
Mark Doliner <mark@kingant.net>
parents: 16222
diff changeset
342 break;
9a4854d71234 Patch #205, from SuperMMX. Fix a bug related to using F2 to alias
Mark Doliner <mark@kingant.net>
parents: 16222
diff changeset
343 case PURPLE_BLIST_GROUP_NODE:
9a4854d71234 Patch #205, from SuperMMX. Fix a bug related to using F2 to alias
Mark Doliner <mark@kingant.net>
parents: 16222
diff changeset
344 text = ((PurpleGroup *)node)->name;
9a4854d71234 Patch #205, from SuperMMX. Fix a bug related to using F2 to alias
Mark Doliner <mark@kingant.net>
parents: 16222
diff changeset
345 break;
9a4854d71234 Patch #205, from SuperMMX. Fix a bug related to using F2 to alias
Mark Doliner <mark@kingant.net>
parents: 16222
diff changeset
346 default:
9a4854d71234 Patch #205, from SuperMMX. Fix a bug related to using F2 to alias
Mark Doliner <mark@kingant.net>
parents: 16222
diff changeset
347 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
348 }
9a4854d71234 Patch #205, from SuperMMX. Fix a bug related to using F2 to alias
Mark Doliner <mark@kingant.net>
parents: 16222
diff changeset
349
9a4854d71234 Patch #205, from SuperMMX. Fix a bug related to using F2 to alias
Mark Doliner <mark@kingant.net>
parents: 16222
diff changeset
350 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
351 GtkEntry *entry = GTK_ENTRY (editable);
17046
0be41b604566 Patch #702, Info not reset on URL redirect
Sean Egan <seanegan@gmail.com>
parents: 17044
diff changeset
352 gtk_entry_set_text(entry, text);
0be41b604566 Patch #702, Info not reset on URL redirect
Sean Egan <seanegan@gmail.com>
parents: 17044
diff changeset
353 }
16275
9a4854d71234 Patch #205, from SuperMMX. Fix a bug related to using F2 to alias
Mark Doliner <mark@kingant.net>
parents: 16222
diff changeset
354 }
9a4854d71234 Patch #205, from SuperMMX. Fix a bug related to using F2 to alias
Mark Doliner <mark@kingant.net>
parents: 16222
diff changeset
355
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
356 static void gtk_blist_renderer_edited_cb(GtkCellRendererText *text_rend, char *arg1,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
357 char *arg2, gpointer nada)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
358 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
359 GtkTreeIter iter;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
360 GtkTreePath *path;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
361 GValue val;
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
362 PurpleBlistNode *node;
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
363 PurpleGroup *dest;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
364
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
365 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
366 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
367 gtk_tree_path_free (path);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
368 val.g_type = 0;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
369 gtk_tree_model_get_value (GTK_TREE_MODEL(gtkblist->treemodel), &iter, NODE_COLUMN, &val);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
370 node = g_value_get_pointer(&val);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
371 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
372 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
373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
374 switch (node->type)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
375 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
376 case PURPLE_BLIST_CONTACT_NODE:
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
377 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
378 PurpleContact *contact = (PurpleContact *)node;
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
379 struct _pidgin_blist_node *gtknode = (struct _pidgin_blist_node *)node->ui_data;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
380
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
381 if (contact->alias || gtknode->contact_expanded)
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
382 purple_blist_alias_contact(contact, arg2);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
383 else
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
384 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
385 PurpleBuddy *buddy = purple_contact_get_priority_buddy(contact);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
386 purple_blist_alias_buddy(buddy, arg2);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
387 serv_alias_buddy(buddy);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
388 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
389 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
390 break;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
391
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
392 case PURPLE_BLIST_BUDDY_NODE:
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
393 purple_blist_alias_buddy((PurpleBuddy*)node, arg2);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
394 serv_alias_buddy((PurpleBuddy *)node);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
395 break;
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
396 case PURPLE_BLIST_GROUP_NODE:
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
397 dest = purple_find_group(arg2);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
398 if (dest != NULL && strcmp(arg2, ((PurpleGroup*) node)->name)) {
16202
0973688f4b74 Word on the street is that we don't want things named pidginfoo_bar(), but
Richard Laager <rlaager@wiktel.com>
parents: 16198
diff changeset
399 pidgin_dialogs_merge_groups((PurpleGroup*) node, arg2);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
400 } else
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
401 purple_blist_rename_group((PurpleGroup*)node, arg2);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
402 break;
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
403 case PURPLE_BLIST_CHAT_NODE:
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
404 purple_blist_alias_chat((PurpleChat*)node, arg2);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
405 break;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
406 default:
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
407 break;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
408 }
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
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
411 static void gtk_blist_menu_alias_cb(GtkWidget *w, PurpleBlistNode *node)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
412 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
413 GtkTreeIter iter;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
414 GtkTreePath *path;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
415
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
416 if (!(get_iter_from_node(node, &iter))) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
417 /* This is either a bug, or the buddy is in a collapsed contact */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
418 node = node->parent;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
419 if (!get_iter_from_node(node, &iter))
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
420 /* Now it's definitely a bug */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
421 return;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
422 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
423
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
424 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
425 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
426 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
427 gtk_widget_grab_focus(gtkblist->treeview);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
428 #if GTK_CHECK_VERSION(2,2,0)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
429 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
430 gtkblist->text_column, gtkblist->text_rend, TRUE);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
431 #else
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
432 gtk_tree_view_set_cursor(GTK_TREE_VIEW(gtkblist->treeview), path, gtkblist->text_column, TRUE);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
433 #endif
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
434 gtk_tree_path_free(path);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
435 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
436
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
437 static void gtk_blist_menu_bp_cb(GtkWidget *w, PurpleBuddy *b)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
438 {
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
439 pidgin_pounce_editor_show(b->account, b->name, NULL);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
440 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
441
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
442 static void gtk_blist_menu_showlog_cb(GtkWidget *w, PurpleBlistNode *node)
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
443 {
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
444 PurpleLogType type;
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
445 PurpleAccount *account;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
446 char *name = NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
447
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
448 pidgin_set_cursor(gtkblist->window, GDK_WATCH);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
449
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
450 if (PURPLE_BLIST_NODE_IS_BUDDY(node)) {
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
451 PurpleBuddy *b = (PurpleBuddy*) node;
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
452 type = PURPLE_LOG_IM;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
453 name = g_strdup(b->name);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
454 account = b->account;
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
455 } else if (PURPLE_BLIST_NODE_IS_CHAT(node)) {
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
456 PurpleChat *c = (PurpleChat*) node;
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
457 PurplePluginProtocolInfo *prpl_info = NULL;
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
458 type = PURPLE_LOG_CHAT;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
459 account = c->account;
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
460 prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(purple_find_prpl(purple_account_get_protocol_id(account)));
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
461 if (prpl_info && prpl_info->get_chat_name) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
462 name = prpl_info->get_chat_name(c->components);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
463 }
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
464 } else if (PURPLE_BLIST_NODE_IS_CONTACT(node)) {
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
465 pidgin_log_show_contact((PurpleContact *)node);
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
466 pidgin_clear_cursor(gtkblist->window);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
467 return;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
468 } else {
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
469 pidgin_clear_cursor(gtkblist->window);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
470
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
471 /* 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
472 * 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
473 g_return_if_reached();
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
474 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
475
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
476 if (name && account) {
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
477 pidgin_log_show(type, name, account);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
478 g_free(name);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
479
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
480 pidgin_clear_cursor(gtkblist->window);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
481 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
482 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
483
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
484 static void gtk_blist_show_systemlog_cb()
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
485 {
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
486 pidgin_syslog_show();
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
487 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
488
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
489 static void
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
490 do_join_chat(PidginJoinChatData *data)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
491 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
492 if (data)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
493 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
494 GHashTable *components =
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
495 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
496 GList *tmp;
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
497 PurpleChat *chat;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
498
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
499 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
500 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
501 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
502 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
503 g_hash_table_replace(components,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
504 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
505 g_strdup_printf("%d",
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
506 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
507 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
508 else
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
509 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
510 g_hash_table_replace(components,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
511 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
512 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
513 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
514 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
515
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
516 chat = purple_chat_new(data->account, NULL, components);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
517 gtk_blist_join_chat(chat);
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
518 purple_blist_remove_chat(chat);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
519 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
520 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
521
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
522 static void
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
523 do_joinchat(GtkWidget *dialog, int id, PidginJoinChatData *info)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
524 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
525 switch(id)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
526 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
527 case GTK_RESPONSE_OK:
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
528 do_join_chat(info);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
529
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
530 break;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
531 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
532
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
533 gtk_widget_destroy(GTK_WIDGET(dialog));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
534 g_list_free(info->entries);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
535 g_free(info);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
536 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
537
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
538 /*
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
539 * 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
540 * 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
541 */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
542 static void
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
543 joinchat_set_sensitive_if_input_cb(GtkWidget *entry, gpointer user_data)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
544 {
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
545 PidginJoinChatData *data;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
546 GList *tmp;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
547 const char *text;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
548 gboolean required;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
549 gboolean sensitive = TRUE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
550
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
551 data = user_data;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
552
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
553 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
554 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
555 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
556 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
557 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
558 text = gtk_entry_get_text(tmp->data);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
559 if (required && (*text == '\0'))
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
560 sensitive = FALSE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
561 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
562 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
563
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
564 gtk_dialog_set_response_sensitive(GTK_DIALOG(data->window), GTK_RESPONSE_OK, sensitive);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
565 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
566
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
567 static void
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
568 pidgin_blist_update_privacy_cb(PurpleBuddy *buddy)
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
569 {
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
570 pidgin_blist_update_buddy(purple_get_blist(), (PurpleBlistNode*)(buddy), TRUE);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
571 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
572
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
573 static void
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
574 rebuild_joinchat_entries(PidginJoinChatData *data)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
575 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
576 PurpleConnection *gc;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
577 GList *list = NULL, *tmp;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
578 GHashTable *defaults = NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
579 struct proto_chat_entry *pce;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
580 gboolean focus = TRUE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
581
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
582 g_return_if_fail(data->account != NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
583
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
584 gc = purple_account_get_connection(data->account);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
585
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
586 while ((tmp = gtk_container_get_children(GTK_CONTAINER(data->entries_box))))
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
587 gtk_widget_destroy(tmp->data);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
588
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
589 g_list_free(data->entries);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
590 data->entries = NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
591
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
592 if (PURPLE_PLUGIN_PROTOCOL_INFO(gc->prpl)->chat_info != NULL)
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
593 list = PURPLE_PLUGIN_PROTOCOL_INFO(gc->prpl)->chat_info(gc);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
594
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
595 if (PURPLE_PLUGIN_PROTOCOL_INFO(gc->prpl)->chat_info_defaults != NULL)
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
596 defaults = PURPLE_PLUGIN_PROTOCOL_INFO(gc->prpl)->chat_info_defaults(gc, NULL);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
597
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
598 for (tmp = list; tmp; tmp = tmp->next)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
599 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
600 GtkWidget *label;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
601 GtkWidget *rowbox;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
602 GtkWidget *input;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
603
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
604 pce = tmp->data;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
605
15821
cebfc6af3eb5 More Gaim to Pidgin stuff
Sean Egan <seanegan@gmail.com>
parents: 15738
diff changeset
606 rowbox = gtk_hbox_new(FALSE, PIDGIN_HIG_BORDER);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
607 gtk_box_pack_start(GTK_BOX(data->entries_box), rowbox, FALSE, FALSE, 0);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
608
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
609 label = gtk_label_new_with_mnemonic(pce->label);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
610 gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
611 gtk_size_group_add_widget(data->sg, label);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
612 gtk_box_pack_start(GTK_BOX(rowbox), label, FALSE, FALSE, 0);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
613
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
614 if (pce->is_int)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
615 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
616 GtkObject *adjust;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
617 adjust = gtk_adjustment_new(pce->min, pce->min, pce->max,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
618 1, 10, 10);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
619 input = gtk_spin_button_new(GTK_ADJUSTMENT(adjust), 1, 0);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
620 gtk_widget_set_size_request(input, 50, -1);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
621 gtk_box_pack_end(GTK_BOX(rowbox), input, FALSE, FALSE, 0);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
622 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
623 else
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
624 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
625 char *value;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
626 input = gtk_entry_new();
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
627 gtk_entry_set_activates_default(GTK_ENTRY(input), TRUE);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
628 value = g_hash_table_lookup(defaults, pce->identifier);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
629 if (value != NULL)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
630 gtk_entry_set_text(GTK_ENTRY(input), value);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
631 if (pce->secret)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
632 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
633 gtk_entry_set_visibility(GTK_ENTRY(input), FALSE);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
634 if (gtk_entry_get_invisible_char(GTK_ENTRY(input)) == '*')
15821
cebfc6af3eb5 More Gaim to Pidgin stuff
Sean Egan <seanegan@gmail.com>
parents: 15738
diff changeset
635 gtk_entry_set_invisible_char(GTK_ENTRY(input), PIDGIN_INVISIBLE_CHAR);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
636 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
637 gtk_box_pack_end(GTK_BOX(rowbox), input, TRUE, TRUE, 0);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
638 g_signal_connect(G_OBJECT(input), "changed",
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
639 G_CALLBACK(joinchat_set_sensitive_if_input_cb), data);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
640 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
641
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
642 /* Do the following for any type of input widget */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
643 if (focus)
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 gtk_widget_grab_focus(input);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
646 focus = FALSE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
647 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
648 gtk_label_set_mnemonic_widget(GTK_LABEL(label), input);
15507
311315e979f7 gtkutils changes
Sean Egan <seanegan@gmail.com>
parents: 15505
diff changeset
649 pidgin_set_accessible_label(input, label);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
650 g_object_set_data(G_OBJECT(input), "identifier", (gpointer)pce->identifier);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
651 g_object_set_data(G_OBJECT(input), "is_spin", GINT_TO_POINTER(pce->is_int));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
652 g_object_set_data(G_OBJECT(input), "required", GINT_TO_POINTER(pce->required));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
653 data->entries = g_list_append(data->entries, input);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
654
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
655 g_free(pce);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
656 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
657
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
658 g_list_free(list);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
659 g_hash_table_destroy(defaults);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
660
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
661 /* Set whether the "OK" button should be clickable initially */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
662 joinchat_set_sensitive_if_input_cb(NULL, data);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
663
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
664 gtk_widget_show_all(data->entries_box);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
665 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
666
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
667 static void
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
668 joinchat_select_account_cb(GObject *w, PurpleAccount *account,
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
669 PidginJoinChatData *data)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
670 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
671 data->account = account;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
672 rebuild_joinchat_entries(data);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
673 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
674
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
675 static gboolean
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
676 chat_account_filter_func(PurpleAccount *account)
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
677 {
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
678 PurpleConnection *gc = purple_account_get_connection(account);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
679 PurplePluginProtocolInfo *prpl_info = NULL;
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
680
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
681 prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(gc->prpl);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
682
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
683 return (prpl_info->chat_info != NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
684 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
685
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
686 gboolean
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
687 pidgin_blist_joinchat_is_showable()
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
688 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
689 GList *c;
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
690 PurpleConnection *gc;
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
691
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
692 for (c = purple_connections_get_all(); c != NULL; c = c->next) {
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
693 gc = c->data;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
694
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
695 if (chat_account_filter_func(purple_connection_get_account(gc)))
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
696 return TRUE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
697 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
698
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
699 return FALSE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
700 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
701
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
702 void
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
703 pidgin_blist_joinchat_show(void)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
704 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
705 GtkWidget *hbox, *vbox;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
706 GtkWidget *rowbox;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
707 GtkWidget *label;
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
708 PidginBuddyList *gtkblist;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
709 GtkWidget *img = NULL;
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
710 PidginJoinChatData *data = NULL;
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
711
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
712 gtkblist = PIDGIN_BLIST(purple_get_blist());
15436
9c0cf4db1f4d Dialog icon changes
Sean Egan <seanegan@gmail.com>
parents: 15435
diff changeset
713 img = gtk_image_new_from_stock(PIDGIN_STOCK_DIALOG_QUESTION,
9c0cf4db1f4d Dialog icon changes
Sean Egan <seanegan@gmail.com>
parents: 15435
diff changeset
714 gtk_icon_size_from_name(PIDGIN_ICON_SIZE_TANGO_HUGE));
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
715 data = g_new0(PidginJoinChatData, 1);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
716
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
717 data->window = gtk_dialog_new_with_buttons(_("Join a Chat"),
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
718 NULL, GTK_DIALOG_NO_SEPARATOR,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
719 GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
15509
23ca11f8a8c4 stock to pidgin
Sean Egan <seanegan@gmail.com>
parents: 15508
diff changeset
720 PIDGIN_STOCK_CHAT, GTK_RESPONSE_OK, NULL);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
721 gtk_dialog_set_default_response(GTK_DIALOG(data->window), GTK_RESPONSE_OK);
15821
cebfc6af3eb5 More Gaim to Pidgin stuff
Sean Egan <seanegan@gmail.com>
parents: 15738
diff changeset
722 gtk_container_set_border_width(GTK_CONTAINER(data->window), PIDGIN_HIG_BOX_SPACE);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
723 gtk_window_set_resizable(GTK_WINDOW(data->window), FALSE);
15821
cebfc6af3eb5 More Gaim to Pidgin stuff
Sean Egan <seanegan@gmail.com>
parents: 15738
diff changeset
724 gtk_box_set_spacing(GTK_BOX(GTK_DIALOG(data->window)->vbox), PIDGIN_HIG_BORDER);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
725 gtk_container_set_border_width(
15821
cebfc6af3eb5 More Gaim to Pidgin stuff
Sean Egan <seanegan@gmail.com>
parents: 15738
diff changeset
726 GTK_CONTAINER(GTK_DIALOG(data->window)->vbox), PIDGIN_HIG_BOX_SPACE);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
727 gtk_window_set_role(GTK_WINDOW(data->window), "join_chat");
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
728
15821
cebfc6af3eb5 More Gaim to Pidgin stuff
Sean Egan <seanegan@gmail.com>
parents: 15738
diff changeset
729 hbox = gtk_hbox_new(FALSE, PIDGIN_HIG_BORDER);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
730 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
731 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
732 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
733
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
734 vbox = gtk_vbox_new(FALSE, 5);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
735 gtk_container_set_border_width(GTK_CONTAINER(vbox), 0);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
736 gtk_container_add(GTK_CONTAINER(hbox), vbox);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
737
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
738 label = gtk_label_new(_("Please enter the appropriate information "
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
739 "about the chat you would like to join.\n"));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
740 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
741 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
742 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
743
15821
cebfc6af3eb5 More Gaim to Pidgin stuff
Sean Egan <seanegan@gmail.com>
parents: 15738
diff changeset
744 rowbox = gtk_hbox_new(FALSE, PIDGIN_HIG_BORDER);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
745 gtk_box_pack_start(GTK_BOX(vbox), rowbox, TRUE, TRUE, 0);
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 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
748
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
749 label = gtk_label_new_with_mnemonic(_("_Account:"));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
750 gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
751 gtk_box_pack_start(GTK_BOX(rowbox), label, FALSE, FALSE, 0);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
752 gtk_size_group_add_widget(data->sg, label);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
753
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
754 data->account_menu = pidgin_account_option_menu_new(NULL, FALSE,
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
755 G_CALLBACK(joinchat_select_account_cb),
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
756 chat_account_filter_func, data);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
757 gtk_box_pack_start(GTK_BOX(rowbox), data->account_menu, TRUE, TRUE, 0);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
758 gtk_label_set_mnemonic_widget(GTK_LABEL(label),
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
759 GTK_WIDGET(data->account_menu));
15507
311315e979f7 gtkutils changes
Sean Egan <seanegan@gmail.com>
parents: 15505
diff changeset
760 pidgin_set_accessible_label (data->account_menu, label);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
761
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
762 data->entries_box = gtk_vbox_new(FALSE, 5);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
763 gtk_container_add(GTK_CONTAINER(vbox), data->entries_box);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
764 gtk_container_set_border_width(GTK_CONTAINER(data->entries_box), 0);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
765
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
766 data->account = pidgin_account_option_menu_get_selected(data->account_menu);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
767
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
768 rebuild_joinchat_entries(data);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
769
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
770 g_signal_connect(G_OBJECT(data->window), "response",
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
771 G_CALLBACK(do_joinchat), data);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
772
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
773 g_object_unref(data->sg);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
774
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
775 gtk_widget_show_all(data->window);
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
17139
17117b8cfbb7 Patch from SuperMMX to correctly update the expand state of contacts
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 17046
diff changeset
778 static void gtk_blist_row_expanded_cb(GtkTreeView *tv, GtkTreeIter *iter, GtkTreePath *path, gpointer user_data)
17117b8cfbb7 Patch from SuperMMX to correctly update the expand state of contacts
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 17046
diff changeset
779 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
780 PurpleBlistNode *node;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
781 GValue val;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
782
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
783 val.g_type = 0;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
784 gtk_tree_model_get_value(GTK_TREE_MODEL(gtkblist->treemodel), iter, NODE_COLUMN, &val);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
785
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
786 node = g_value_get_pointer(&val);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
787
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
788 if (PURPLE_BLIST_NODE_IS_GROUP(node)) {
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
789 char *title;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
790
15821
cebfc6af3eb5 More Gaim to Pidgin stuff
Sean Egan <seanegan@gmail.com>
parents: 15738
diff changeset
791 title = pidgin_get_group_title(node, TRUE);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
792
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
793 gtk_tree_store_set(gtkblist->treemodel, iter,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
794 NAME_COLUMN, title,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
795 -1);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
796
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
797 g_free(title);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
798
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
799 purple_blist_node_set_bool(node, "collapsed", FALSE);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
800 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
801 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
802
17139
17117b8cfbb7 Patch from SuperMMX to correctly update the expand state of contacts
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 17046
diff changeset
803 static void gtk_blist_row_collapsed_cb(GtkTreeView *tv, GtkTreeIter *iter, GtkTreePath *path, gpointer user_data)
17117b8cfbb7 Patch from SuperMMX to correctly update the expand state of contacts
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 17046
diff changeset
804 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
805 PurpleBlistNode *node;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
806 GValue val;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
807
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
808 val.g_type = 0;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
809 gtk_tree_model_get_value(GTK_TREE_MODEL(gtkblist->treemodel), iter, NODE_COLUMN, &val);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
810
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
811 node = g_value_get_pointer(&val);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
812
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
813 if (PURPLE_BLIST_NODE_IS_GROUP(node)) {
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
814 char *title;
17139
17117b8cfbb7 Patch from SuperMMX to correctly update the expand state of contacts
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 17046
diff changeset
815 struct _pidgin_blist_node *gtknode;
17117b8cfbb7 Patch from SuperMMX to correctly update the expand state of contacts
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 17046
diff changeset
816 PurpleBlistNode *cnode;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
817
15821
cebfc6af3eb5 More Gaim to Pidgin stuff
Sean Egan <seanegan@gmail.com>
parents: 15738
diff changeset
818 title = pidgin_get_group_title(node, FALSE);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
819
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
820 gtk_tree_store_set(gtkblist->treemodel, iter,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
821 NAME_COLUMN, title,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
822 -1);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
823
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
824 g_free(title);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
825
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
826 purple_blist_node_set_bool(node, "collapsed", TRUE);
17139
17117b8cfbb7 Patch from SuperMMX to correctly update the expand state of contacts
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 17046
diff changeset
827
17117b8cfbb7 Patch from SuperMMX to correctly update the expand state of contacts
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 17046
diff changeset
828 for(cnode = node->child; cnode; cnode = cnode->next) {
17117b8cfbb7 Patch from SuperMMX to correctly update the expand state of contacts
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 17046
diff changeset
829 if (PURPLE_BLIST_NODE_IS_CONTACT(cnode)) {
17117b8cfbb7 Patch from SuperMMX to correctly update the expand state of contacts
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 17046
diff changeset
830 gtknode = cnode->ui_data;
17117b8cfbb7 Patch from SuperMMX to correctly update the expand state of contacts
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 17046
diff changeset
831 if (!gtknode->contact_expanded)
17117b8cfbb7 Patch from SuperMMX to correctly update the expand state of contacts
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 17046
diff changeset
832 continue;
17117b8cfbb7 Patch from SuperMMX to correctly update the expand state of contacts
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 17046
diff changeset
833 gtknode->contact_expanded = FALSE;
17117b8cfbb7 Patch from SuperMMX to correctly update the expand state of contacts
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 17046
diff changeset
834 pidgin_blist_update_contact(NULL, cnode);
17117b8cfbb7 Patch from SuperMMX to correctly update the expand state of contacts
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 17046
diff changeset
835 }
17117b8cfbb7 Patch from SuperMMX to correctly update the expand state of contacts
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 17046
diff changeset
836 }
17117b8cfbb7 Patch from SuperMMX to correctly update the expand state of contacts
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 17046
diff changeset
837
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
838 } else if(PURPLE_BLIST_NODE_IS_CONTACT(node)) {
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
839 pidgin_blist_collapse_contact_cb(NULL, node);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
840 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
841 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
842
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
843 static void gtk_blist_row_activated_cb(GtkTreeView *tv, GtkTreePath *path, GtkTreeViewColumn *col, gpointer data) {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
844 PurpleBlistNode *node;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
845 GtkTreeIter iter;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
846 GValue val;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
847
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
848 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
849
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
850 val.g_type = 0;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
851 gtk_tree_model_get_value (GTK_TREE_MODEL(gtkblist->treemodel), &iter, NODE_COLUMN, &val);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
852 node = g_value_get_pointer(&val);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
853
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
854 if(PURPLE_BLIST_NODE_IS_CONTACT(node) || PURPLE_BLIST_NODE_IS_BUDDY(node)) {
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
855 PurpleBuddy *buddy;
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
856
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
857 if(PURPLE_BLIST_NODE_IS_CONTACT(node))
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
858 buddy = purple_contact_get_priority_buddy((PurpleContact*)node);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
859 else
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
860 buddy = (PurpleBuddy*)node;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
861
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
862 pidgin_dialogs_im_with_user(buddy->account, buddy->name);
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
863 } else if (PURPLE_BLIST_NODE_IS_CHAT(node)) {
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
864 gtk_blist_join_chat((PurpleChat *)node);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
865 } else if (PURPLE_BLIST_NODE_IS_GROUP(node)) {
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
866 /* 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
867 gtk_tree_view_collapse_row(tv, path);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
868 else
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
869 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
870 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
871 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
872
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
873 static void pidgin_blist_add_chat_cb()
15374
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 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
876 GtkTreeIter iter;
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
877 PurpleBlistNode *node;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
878
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
879 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
880 gtk_tree_model_get(GTK_TREE_MODEL(gtkblist->treemodel), &iter, NODE_COLUMN, &node, -1);
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
881 if (PURPLE_BLIST_NODE_IS_BUDDY(node))
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
882 purple_blist_request_add_chat(NULL, (PurpleGroup*)node->parent->parent, NULL, NULL);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
883 if (PURPLE_BLIST_NODE_IS_CONTACT(node) || PURPLE_BLIST_NODE_IS_CHAT(node))
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
884 purple_blist_request_add_chat(NULL, (PurpleGroup*)node->parent, NULL, NULL);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
885 else if (PURPLE_BLIST_NODE_IS_GROUP(node))
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
886 purple_blist_request_add_chat(NULL, (PurpleGroup*)node, NULL, NULL);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
887 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
888 else {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
889 purple_blist_request_add_chat(NULL, NULL, NULL, NULL);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
890 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
891 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
892
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
893 static void pidgin_blist_add_buddy_cb()
15374
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 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
896 GtkTreeIter iter;
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
897 PurpleBlistNode *node;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
898
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
899 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
900 gtk_tree_model_get(GTK_TREE_MODEL(gtkblist->treemodel), &iter, NODE_COLUMN, &node, -1);
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
901 if (PURPLE_BLIST_NODE_IS_BUDDY(node)) {
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
902 purple_blist_request_add_buddy(NULL, NULL, ((PurpleGroup*)node->parent->parent)->name,
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
903 NULL);
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
904 } else if (PURPLE_BLIST_NODE_IS_CONTACT(node)
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
905 || PURPLE_BLIST_NODE_IS_CHAT(node)) {
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
906 purple_blist_request_add_buddy(NULL, NULL, ((PurpleGroup*)node->parent)->name, NULL);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
907 } else if (PURPLE_BLIST_NODE_IS_GROUP(node)) {
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
908 purple_blist_request_add_buddy(NULL, NULL, ((PurpleGroup*)node)->name, NULL);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
909 }
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 else {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
912 purple_blist_request_add_buddy(NULL, NULL, NULL, NULL);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
913 }
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
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
916 static void
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
917 pidgin_blist_remove_cb (GtkWidget *w, PurpleBlistNode *node)
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
918 {
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
919 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
920 pidgin_dialogs_remove_buddy((PurpleBuddy*)node);
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
921 } 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
922 pidgin_dialogs_remove_chat((PurpleChat*)node);
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
923 } 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
924 pidgin_dialogs_remove_group((PurpleGroup*)node);
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
925 } 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
926 pidgin_dialogs_remove_contact((PurpleContact*)node);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
927 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
928 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
929
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
930 struct _expand {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
931 GtkTreeView *treeview;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
932 GtkTreePath *path;
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
933 PurpleBlistNode *node;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
934 };
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
935
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
936 static gboolean
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
937 scroll_to_expanded_cell(gpointer data)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
938 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
939 struct _expand *ex = data;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
940 gtk_tree_view_scroll_to_cell(ex->treeview, ex->path, NULL, FALSE, 0, 0);
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
941 pidgin_blist_update_contact(NULL, ex->node);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
942
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
943 gtk_tree_path_free(ex->path);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
944 g_free(ex);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
945
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
946 return FALSE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
947 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
948
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
949 static void
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
950 pidgin_blist_expand_contact_cb(GtkWidget *w, PurpleBlistNode *node)
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
951 {
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
952 struct _pidgin_blist_node *gtknode;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
953 GtkTreeIter iter, parent;
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
954 PurpleBlistNode *bnode;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
955 GtkTreePath *path;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
956
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
957 if(!PURPLE_BLIST_NODE_IS_CONTACT(node))
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
958 return;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
959
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
960 gtknode = (struct _pidgin_blist_node *)node->ui_data;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
961
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
962 gtknode->contact_expanded = TRUE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
963
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
964 for(bnode = node->child; bnode; bnode = bnode->next) {
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
965 pidgin_blist_update(NULL, bnode);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
966 }
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 /* 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
969 if (get_iter_from_node(node, &parent)) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
970 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
971
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
972 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
973 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
974 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
975
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
976 /* 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
977 ex->treeview = GTK_TREE_VIEW(gtkblist->treeview);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
978 ex->path = path;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
979 ex->node = node->child;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
980 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
981 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
982 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
983
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
984 static void
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
985 pidgin_blist_collapse_contact_cb(GtkWidget *w, PurpleBlistNode *node)
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
986 {
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
987 PurpleBlistNode *bnode;
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
988 struct _pidgin_blist_node *gtknode;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
989
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
990 if(!PURPLE_BLIST_NODE_IS_CONTACT(node))
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
991 return;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
992
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
993 gtknode = (struct _pidgin_blist_node *)node->ui_data;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
994
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
995 gtknode->contact_expanded = FALSE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
996
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
997 for(bnode = node->child; bnode; bnode = bnode->next) {
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
998 pidgin_blist_update(NULL, bnode);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
999 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1000 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1001
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1002 static void
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1003 toggle_privacy(GtkWidget *widget, PurpleBlistNode *node)
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1004 {
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1005 PurpleBuddy *buddy;
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1006 PurpleAccount *account;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1007 gboolean permitted;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1008 const char *name;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1009
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1010 if (!PURPLE_BLIST_NODE_IS_BUDDY(node))
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1011 return;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1012
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1013 buddy = (PurpleBuddy *)node;
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1014 account = purple_buddy_get_account(buddy);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1015 name = purple_buddy_get_name(buddy);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1016
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1017 permitted = purple_privacy_check(account, name);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1018
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1019 /* 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
1020
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1021 if (permitted)
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1022 purple_privacy_deny(account, name, FALSE, FALSE);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1023 else
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1024 purple_privacy_allow(account, name, FALSE, FALSE);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1025
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1026 pidgin_blist_update(purple_get_blist(), node);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1027 }
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1028
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1029 void pidgin_append_blist_node_privacy_menu(GtkWidget *menu, PurpleBlistNode *node)
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1030 {
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1031 PurpleBuddy *buddy = (PurpleBuddy *)node;
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1032 PurpleAccount *account;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1033 gboolean permitted;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1034
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1035 account = purple_buddy_get_account(buddy);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1036 permitted = purple_privacy_check(account, purple_buddy_get_name(buddy));
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1037
15507
311315e979f7 gtkutils changes
Sean Egan <seanegan@gmail.com>
parents: 15505
diff changeset
1038 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
1039 permitted ? PIDGIN_STOCK_TOOLBAR_BLOCK : PIDGIN_STOCK_TOOLBAR_UNBLOCK, G_CALLBACK(toggle_privacy),
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1040 node, 0 ,0, NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1041 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1042
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1043 void
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1044 pidgin_append_blist_node_proto_menu(GtkWidget *menu, PurpleConnection *gc,
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1045 PurpleBlistNode *node)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1046 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1047 GList *l, *ll;
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1048 PurplePluginProtocolInfo *prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(gc->prpl);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1049
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1050 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
1051 return;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1052
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1053 for(l = ll = prpl_info->blist_node_menu(node); l; l = l->next) {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1054 PurpleMenuAction *act = (PurpleMenuAction *) l->data;
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
1055 pidgin_append_menu_action(menu, act, node);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1056 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1057 g_list_free(ll);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1058 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1059
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1060 void
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1061 pidgin_append_blist_node_extended_menu(GtkWidget *menu, PurpleBlistNode *node)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1062 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1063 GList *l, *ll;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1064
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1065 for(l = ll = purple_blist_node_get_extended_menu(node); l; l = l->next) {
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1066 PurpleMenuAction *act = (PurpleMenuAction *) l->data;
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
1067 pidgin_append_menu_action(menu, act, node);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1068 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1069 g_list_free(ll);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1070 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1071
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1072 void
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1073 pidgin_blist_make_buddy_menu(GtkWidget *menu, PurpleBuddy *buddy, gboolean sub) {
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1074 PurplePluginProtocolInfo *prpl_info;
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1075 PurpleContact *contact;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1076 gboolean contact_expanded = FALSE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1077
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1078 g_return_if_fail(menu);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1079 g_return_if_fail(buddy);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1080
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1081 prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(buddy->account->gc->prpl);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1082
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1083 contact = purple_buddy_get_contact(buddy);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1084 if (contact) {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1085 contact_expanded = ((struct _pidgin_blist_node *)(((PurpleBlistNode*)contact)->ui_data))->contact_expanded;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1086 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1087
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1088 if (prpl_info && prpl_info->get_info) {
15560
442128853bdb toolbar/menu icons. reduce the imhtmltoolbar spacing. more gaimstock pruning
Sean Egan <seanegan@gmail.com>
parents: 15559
diff changeset
1089 pidgin_new_item_from_stock(menu, _("Get _Info"), PIDGIN_STOCK_TOOLBAR_USER_INFO,
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1090 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
1091 }
15560
442128853bdb toolbar/menu icons. reduce the imhtmltoolbar spacing. more gaimstock pruning
Sean Egan <seanegan@gmail.com>
parents: 15559
diff changeset
1092 pidgin_new_item_from_stock(menu, _("I_M"), PIDGIN_STOCK_TOOLBAR_MESSAGE_NEW,
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1093 G_CALLBACK(gtk_blist_menu_im_cb), buddy, 0, 0, NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1094 if (prpl_info && prpl_info->send_file) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1095 if (!prpl_info->can_receive_file ||
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1096 prpl_info->can_receive_file(buddy->account->gc, buddy->name))
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1097 {
15507
311315e979f7 gtkutils changes
Sean Egan <seanegan@gmail.com>
parents: 15505
diff changeset
1098 pidgin_new_item_from_stock(menu, _("_Send File"),
16839
d6ccf170148e New Send File icon
Hylke Bons <hylkebons@gmail.com>
parents: 16837
diff changeset
1099 PIDGIN_STOCK_TOOLBAR_SEND_FILE,
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1100 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
1101 buddy, 0, 0, NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1102 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1103 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1104
15559
dad51c0e3bc6 context menu cleanup
Sean Egan <seanegan@gmail.com>
parents: 15558
diff changeset
1105 pidgin_new_item_from_stock(menu, _("Add Buddy _Pounce"), NULL,
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1106 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
1107
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1108 if(((PurpleBlistNode*)buddy)->parent->child->next && !sub && !contact_expanded) {
15560
442128853bdb toolbar/menu icons. reduce the imhtmltoolbar spacing. more gaimstock pruning
Sean Egan <seanegan@gmail.com>
parents: 15559
diff changeset
1109 pidgin_new_item_from_stock(menu, _("View _Log"), NULL,
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1110 G_CALLBACK(gtk_blist_menu_showlog_cb),
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1111 contact, 0, 0, NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1112 } else if (!sub) {
15559
dad51c0e3bc6 context menu cleanup
Sean Egan <seanegan@gmail.com>
parents: 15558
diff changeset
1113 pidgin_new_item_from_stock(menu, _("View _Log"), NULL,
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1114 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
1115 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1116
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
1117
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
1118 pidgin_append_blist_node_proto_menu(menu, buddy->account->gc,
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1119 (PurpleBlistNode *)buddy);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1120 pidgin_append_blist_node_extended_menu(menu, (PurpleBlistNode *)buddy);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1121
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1122 if (((PurpleBlistNode*)buddy)->parent->child->next && !sub && !contact_expanded) {
15507
311315e979f7 gtkutils changes
Sean Egan <seanegan@gmail.com>
parents: 15505
diff changeset
1123 pidgin_separator(menu);
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1124 pidgin_append_blist_node_privacy_menu(menu, (PurpleBlistNode *)buddy);
17693
fa5c24086481 Add the mnemonics I really meant to add before I got distracted by Add Chat
Stu Tomlinson <stu@nosnilmot.com>
parents: 17688
diff changeset
1125 pidgin_new_item_from_stock(menu, _("_Alias..."), PIDGIN_STOCK_ALIAS,
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1126 G_CALLBACK(gtk_blist_menu_alias_cb),
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1127 contact, 0, 0, NULL);
17693
fa5c24086481 Add the mnemonics I really meant to add before I got distracted by Add Chat
Stu Tomlinson <stu@nosnilmot.com>
parents: 17688
diff changeset
1128 pidgin_new_item_from_stock(menu, _("_Remove"), GTK_STOCK_REMOVE,
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
1129 G_CALLBACK(pidgin_blist_remove_cb),
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1130 contact, 0, 0, NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1131 } else if (!sub || contact_expanded) {
15507
311315e979f7 gtkutils changes
Sean Egan <seanegan@gmail.com>
parents: 15505
diff changeset
1132 pidgin_separator(menu);
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1133 pidgin_append_blist_node_privacy_menu(menu, (PurpleBlistNode *)buddy);
15509
23ca11f8a8c4 stock to pidgin
Sean Egan <seanegan@gmail.com>
parents: 15508
diff changeset
1134 pidgin_new_item_from_stock(menu, _("_Alias..."), PIDGIN_STOCK_ALIAS,
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1135 G_CALLBACK(gtk_blist_menu_alias_cb), buddy, 0, 0, NULL);
15507
311315e979f7 gtkutils changes
Sean Egan <seanegan@gmail.com>
parents: 15505
diff changeset
1136 pidgin_new_item_from_stock(menu, _("_Remove"), GTK_STOCK_REMOVE,
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
1137 G_CALLBACK(pidgin_blist_remove_cb), buddy,
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1138 0, 0, NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1139 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1140 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1141
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1142 static gboolean
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1143 gtk_blist_key_press_cb(GtkWidget *tv, GdkEventKey *event, gpointer data) {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1144 PurpleBlistNode *node;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1145 GValue val;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1146 GtkTreeIter iter;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1147 GtkTreeSelection *sel;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1148
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1149 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
1150 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
1151 return FALSE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1152
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1153 val.g_type = 0;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1154 gtk_tree_model_get_value(GTK_TREE_MODEL(gtkblist->treemodel), &iter,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1155 NODE_COLUMN, &val);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1156 node = g_value_get_pointer(&val);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1157
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1158 if(event->state & GDK_CONTROL_MASK &&
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1159 (event->keyval == 'o' || event->keyval == 'O')) {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1160 PurpleBuddy *buddy;
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1161
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1162 if(PURPLE_BLIST_NODE_IS_CONTACT(node)) {
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1163 buddy = purple_contact_get_priority_buddy((PurpleContact*)node);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1164 } else if(PURPLE_BLIST_NODE_IS_BUDDY(node)) {
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1165 buddy = (PurpleBuddy*)node;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1166 } else {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1167 return FALSE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1168 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1169 if(buddy)
17789
f13334f5717e show the "Retrieving..." window whenever we request user info. Fixes #1617.
Nathan Walp <nwalp@pidgin.im>
parents: 17731
diff changeset
1170 gtk_blist_menu_info_cb(NULL, buddy);
16220
68114539cdf7 Patch from SuperMMX, "I would like to be able to rename (alias)
Mark Doliner <mark@kingant.net>
parents: 16202
diff changeset
1171 } else if (event->keyval == GDK_F2) {
68114539cdf7 Patch from SuperMMX, "I would like to be able to rename (alias)
Mark Doliner <mark@kingant.net>
parents: 16202
diff changeset
1172 gtk_blist_menu_alias_cb(tv, node);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1173 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1174
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1175 return FALSE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1176 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1177
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1178 static GtkWidget *
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1179 create_group_menu (PurpleBlistNode *node, PurpleGroup *g)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1180 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1181 GtkWidget *menu;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1182 GtkWidget *item;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1183
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1184 menu = gtk_menu_new();
16777
1de66d5d1de8 if you're offline, and right-click on a group, you shouldn't be presented
Nathan Walp <nwalp@pidgin.im>
parents: 16760
diff changeset
1185 item = pidgin_new_item_from_stock(menu, _("Add a _Buddy"), GTK_STOCK_ADD,
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
1186 G_CALLBACK(pidgin_blist_add_buddy_cb), node, 0, 0, NULL);
16777
1de66d5d1de8 if you're offline, and right-click on a group, you shouldn't be presented
Nathan Walp <nwalp@pidgin.im>
parents: 16760
diff changeset
1187 gtk_widget_set_sensitive(item, purple_connections_get_all() != NULL);
15507
311315e979f7 gtkutils changes
Sean Egan <seanegan@gmail.com>
parents: 15505
diff changeset
1188 item = pidgin_new_item_from_stock(menu, _("Add a C_hat"), GTK_STOCK_ADD,
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
1189 G_CALLBACK(pidgin_blist_add_chat_cb), node, 0, 0, NULL);
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
1190 gtk_widget_set_sensitive(item, pidgin_blist_joinchat_is_showable());
15507
311315e979f7 gtkutils changes
Sean Egan <seanegan@gmail.com>
parents: 15505
diff changeset
1191 pidgin_new_item_from_stock(menu, _("_Delete Group"), GTK_STOCK_REMOVE,
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
1192 G_CALLBACK(pidgin_blist_remove_cb), node, 0, 0, NULL);
15507
311315e979f7 gtkutils changes
Sean Egan <seanegan@gmail.com>
parents: 15505
diff changeset
1193 pidgin_new_item_from_stock(menu, _("_Rename"), NULL,
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1194 G_CALLBACK(gtk_blist_menu_alias_cb), node, 0, 0, NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1195
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
1196 pidgin_append_blist_node_extended_menu(menu, node);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1197
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1198 return menu;
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
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1201
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1202 static GtkWidget *
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1203 create_chat_menu(PurpleBlistNode *node, PurpleChat *c) {
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1204 GtkWidget *menu;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1205 gboolean autojoin;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1206
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1207 menu = gtk_menu_new();
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1208 autojoin = (purple_blist_node_get_bool(node, "gtk-autojoin") ||
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1209 (purple_blist_node_get_string(node, "gtk-autojoin") != NULL));
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1210
15509
23ca11f8a8c4 stock to pidgin
Sean Egan <seanegan@gmail.com>
parents: 15508
diff changeset
1211 pidgin_new_item_from_stock(menu, _("_Join"), PIDGIN_STOCK_CHAT,
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1212 G_CALLBACK(gtk_blist_menu_join_cb), node, 0, 0, NULL);
15507
311315e979f7 gtkutils changes
Sean Egan <seanegan@gmail.com>
parents: 15505
diff changeset
1213 pidgin_new_check_item(menu, _("Auto-Join"),
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1214 G_CALLBACK(gtk_blist_menu_autojoin_cb), node, autojoin);
15560
442128853bdb toolbar/menu icons. reduce the imhtmltoolbar spacing. more gaimstock pruning
Sean Egan <seanegan@gmail.com>
parents: 15559
diff changeset
1215 pidgin_new_item_from_stock(menu, _("View _Log"), NULL,
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1216 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
1217
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
1218 pidgin_append_blist_node_proto_menu(menu, c->account->gc, node);
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
1219 pidgin_append_blist_node_extended_menu(menu, node);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1220
15507
311315e979f7 gtkutils changes
Sean Egan <seanegan@gmail.com>
parents: 15505
diff changeset
1221 pidgin_separator(menu);
311315e979f7 gtkutils changes
Sean Egan <seanegan@gmail.com>
parents: 15505
diff changeset
1222
15509
23ca11f8a8c4 stock to pidgin
Sean Egan <seanegan@gmail.com>
parents: 15508
diff changeset
1223 pidgin_new_item_from_stock(menu, _("_Alias..."), PIDGIN_STOCK_ALIAS,
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1224 G_CALLBACK(gtk_blist_menu_alias_cb), node, 0, 0, NULL);
15507
311315e979f7 gtkutils changes
Sean Egan <seanegan@gmail.com>
parents: 15505
diff changeset
1225 pidgin_new_item_from_stock(menu, _("_Remove"), GTK_STOCK_REMOVE,
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
1226 G_CALLBACK(pidgin_blist_remove_cb), node, 0, 0, NULL);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1227
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1228 return menu;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1229 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1230
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1231 static GtkWidget *
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1232 create_contact_menu (PurpleBlistNode *node)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1233 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1234 GtkWidget *menu;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1235
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1236 menu = gtk_menu_new();
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1237
15560
442128853bdb toolbar/menu icons. reduce the imhtmltoolbar spacing. more gaimstock pruning
Sean Egan <seanegan@gmail.com>
parents: 15559
diff changeset
1238 pidgin_new_item_from_stock(menu, _("View _Log"), NULL,
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1239 G_CALLBACK(gtk_blist_menu_showlog_cb),
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1240 node, 0, 0, NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1241
15507
311315e979f7 gtkutils changes
Sean Egan <seanegan@gmail.com>
parents: 15505
diff changeset
1242 pidgin_separator(menu);
311315e979f7 gtkutils changes
Sean Egan <seanegan@gmail.com>
parents: 15505
diff changeset
1243
15509
23ca11f8a8c4 stock to pidgin
Sean Egan <seanegan@gmail.com>
parents: 15508
diff changeset
1244 pidgin_new_item_from_stock(menu, _("_Alias..."), PIDGIN_STOCK_ALIAS,
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1245 G_CALLBACK(gtk_blist_menu_alias_cb), node, 0, 0, NULL);
15507
311315e979f7 gtkutils changes
Sean Egan <seanegan@gmail.com>
parents: 15505
diff changeset
1246 pidgin_new_item_from_stock(menu, _("_Remove"), GTK_STOCK_REMOVE,
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
1247 G_CALLBACK(pidgin_blist_remove_cb), node, 0, 0, NULL);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1248
15507
311315e979f7 gtkutils changes
Sean Egan <seanegan@gmail.com>
parents: 15505
diff changeset
1249 pidgin_separator(menu);
311315e979f7 gtkutils changes
Sean Egan <seanegan@gmail.com>
parents: 15505
diff changeset
1250
311315e979f7 gtkutils changes
Sean Egan <seanegan@gmail.com>
parents: 15505
diff changeset
1251 pidgin_new_item_from_stock(menu, _("_Collapse"), GTK_STOCK_ZOOM_OUT,
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
1252 G_CALLBACK(pidgin_blist_collapse_contact_cb),
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1253 node, 0, 0, NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1254
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
1255 pidgin_append_blist_node_extended_menu(menu, node);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1256
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1257 return menu;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1258 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1259
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1260 static GtkWidget *
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1261 create_buddy_menu(PurpleBlistNode *node, PurpleBuddy *b) {
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
1262 struct _pidgin_blist_node *gtknode = (struct _pidgin_blist_node *)node->ui_data;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1263 GtkWidget *menu;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1264 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
1265 gboolean show_offline = purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/blist/show_offline_buddies");
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1266
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1267 menu = gtk_menu_new();
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
1268 pidgin_blist_make_buddy_menu(menu, b, FALSE);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1269
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1270 if(PURPLE_BLIST_NODE_IS_CONTACT(node)) {
15507
311315e979f7 gtkutils changes
Sean Egan <seanegan@gmail.com>
parents: 15505
diff changeset
1271 pidgin_separator(menu);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1272
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1273 if(gtknode->contact_expanded) {
15507
311315e979f7 gtkutils changes
Sean Egan <seanegan@gmail.com>
parents: 15505
diff changeset
1274 pidgin_new_item_from_stock(menu, _("_Collapse"),
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1275 GTK_STOCK_ZOOM_OUT,
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
1276 G_CALLBACK(pidgin_blist_collapse_contact_cb),
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1277 node, 0, 0, NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1278 } else {
15507
311315e979f7 gtkutils changes
Sean Egan <seanegan@gmail.com>
parents: 15505
diff changeset
1279 pidgin_new_item_from_stock(menu, _("_Expand"),
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1280 GTK_STOCK_ZOOM_IN,
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
1281 G_CALLBACK(pidgin_blist_expand_contact_cb), node,
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1282 0, 0, NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1283 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1284 if(node->child->next) {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1285 PurpleBlistNode *bnode;
15374
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 for(bnode = node->child; bnode; bnode = bnode->next) {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1288 PurpleBuddy *buddy = (PurpleBuddy*)bnode;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1289 GdkPixbuf *buf;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1290 GtkWidget *submenu;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1291 GtkWidget *image;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1292
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1293 if(buddy == b)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1294 continue;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1295 if(!buddy->account->gc)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1296 continue;
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1297 if(!show_offline && !PURPLE_BUDDY_IS_ONLINE(buddy))
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1298 continue;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1299
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1300 menuitem = gtk_image_menu_item_new_with_label(buddy->name);
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
1301 buf = pidgin_create_prpl_icon(buddy->account,PIDGIN_PRPL_ICON_SMALL);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1302 image = gtk_image_new_from_pixbuf(buf);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1303 g_object_unref(G_OBJECT(buf));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1304 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
1305 image);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1306 gtk_widget_show(image);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1307 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
1308 gtk_widget_show(menuitem);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1309
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1310 submenu = gtk_menu_new();
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1311 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
1312 gtk_widget_show(submenu);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1313
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
1314 pidgin_blist_make_buddy_menu(submenu, buddy, TRUE);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1315 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1316 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1317 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1318 return menu;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1319 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1320
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1321 static gboolean
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1322 pidgin_blist_show_context_menu(PurpleBlistNode *node,
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1323 GtkMenuPositionFunc func,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1324 GtkWidget *tv,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1325 guint button,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1326 guint32 time)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1327 {
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
1328 struct _pidgin_blist_node *gtknode;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1329 GtkWidget *menu = NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1330 gboolean handled = FALSE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1331
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
1332 gtknode = (struct _pidgin_blist_node *)node->ui_data;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1333
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1334 /* Create a menu based on the thing we right-clicked on */
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1335 if (PURPLE_BLIST_NODE_IS_GROUP(node)) {
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1336 PurpleGroup *g = (PurpleGroup *)node;
15374
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 menu = create_group_menu(node, g);
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1339 } else if (PURPLE_BLIST_NODE_IS_CHAT(node)) {
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1340 PurpleChat *c = (PurpleChat *)node;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1341
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1342 menu = create_chat_menu(node, c);
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1343 } else if ((PURPLE_BLIST_NODE_IS_CONTACT(node)) && (gtknode->contact_expanded)) {
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1344 menu = create_contact_menu(node);
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1345 } else if (PURPLE_BLIST_NODE_IS_CONTACT(node) || PURPLE_BLIST_NODE_IS_BUDDY(node)) {
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1346 PurpleBuddy *b;
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1347
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1348 if (PURPLE_BLIST_NODE_IS_CONTACT(node))
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1349 b = purple_contact_get_priority_buddy((PurpleContact*)node);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1350 else
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1351 b = (PurpleBuddy *)node;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1352
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1353 menu = create_buddy_menu(node, b);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1354 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1355
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1356 #ifdef _WIN32
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1357 /* 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
1358 * 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
1359 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
1360 if (gtkblist->timeout) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1361 g_source_remove(gtkblist->timeout);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1362 gtkblist->timeout = 0;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1363 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1364 #endif
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1365
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1366 /* Now display the menu */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1367 if (menu != NULL) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1368 gtk_widget_show_all(menu);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1369 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
1370 handled = TRUE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1371 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1372
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1373 return handled;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1374 }
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 static gboolean gtk_blist_button_press_cb(GtkWidget *tv, GdkEventButton *event, gpointer user_data)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1377 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1378 GtkTreePath *path;
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1379 PurpleBlistNode *node;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1380 GValue val;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1381 GtkTreeIter iter;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1382 GtkTreeSelection *sel;
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1383 PurplePlugin *prpl = NULL;
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1384 PurplePluginProtocolInfo *prpl_info = NULL;
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
1385 struct _pidgin_blist_node *gtknode;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1386 gboolean handled = FALSE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1387
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1388 /* 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
1389 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
1390 return FALSE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1391 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
1392 val.g_type = 0;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1393 gtk_tree_model_get_value(GTK_TREE_MODEL(gtkblist->treemodel), &iter, NODE_COLUMN, &val);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1394 node = g_value_get_pointer(&val);
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
1395 gtknode = (struct _pidgin_blist_node *)node->ui_data;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1396
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1397 /* Right click draws a context menu */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1398 if ((event->button == 3) && (event->type == GDK_BUTTON_PRESS)) {
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
1399 handled = pidgin_blist_show_context_menu(node, NULL, tv, 3, event->time);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1400
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1401 /* 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
1402 } else if ((event->button == 2) && (event->type == GDK_BUTTON_PRESS) &&
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1403 (event->state & GDK_CONTROL_MASK) && (PURPLE_BLIST_NODE_IS_CONTACT(node))) {
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1404 if (gtknode->contact_expanded)
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
1405 pidgin_blist_collapse_contact_cb(NULL, node);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1406 else
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
1407 pidgin_blist_expand_contact_cb(NULL, node);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1408 handled = TRUE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1409
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1410 /* Double middle click gets info */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1411 } else if ((event->button == 2) && (event->type == GDK_2BUTTON_PRESS) &&
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1412 ((PURPLE_BLIST_NODE_IS_CONTACT(node)) || (PURPLE_BLIST_NODE_IS_BUDDY(node)))) {
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1413 PurpleBuddy *b;
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1414 if(PURPLE_BLIST_NODE_IS_CONTACT(node))
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1415 b = purple_contact_get_priority_buddy((PurpleContact*)node);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1416 else
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1417 b = (PurpleBuddy *)node;
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1418
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1419 prpl = purple_find_prpl(purple_account_get_protocol_id(b->account));
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1420 if (prpl != NULL)
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1421 prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(prpl);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1422
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1423 if (prpl && prpl_info->get_info)
17789
f13334f5717e show the "Retrieving..." window whenever we request user info. Fixes #1617.
Nathan Walp <nwalp@pidgin.im>
parents: 17731
diff changeset
1424 gtk_blist_menu_info_cb(NULL, b);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1425 handled = TRUE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1426 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1427
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1428 #if (1)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1429 /*
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1430 * 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
1431 * 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
1432 * 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
1433 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1434 * 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
1435 * was handled? --Mark
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1436 */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1437 if(handled) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1438 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
1439 gtk_tree_selection_select_path(sel, path);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1440 gtk_tree_path_free(path);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1441 return TRUE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1442 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1443 #endif
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1444 gtk_tree_path_free(path);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1445
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1446 return FALSE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1447 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1448
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1449 static gboolean
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
1450 pidgin_blist_popup_menu_cb(GtkWidget *tv, void *user_data)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1451 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1452 PurpleBlistNode *node;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1453 GValue val;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1454 GtkTreeIter iter;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1455 GtkTreeSelection *sel;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1456 gboolean handled = FALSE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1457
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1458 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
1459 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
1460 return FALSE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1461
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1462 val.g_type = 0;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1463 gtk_tree_model_get_value(GTK_TREE_MODEL(gtkblist->treemodel),
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1464 &iter, NODE_COLUMN, &val);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1465 node = g_value_get_pointer(&val);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1466
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1467 /* Shift+F10 draws a context menu */
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
1468 handled = pidgin_blist_show_context_menu(node, pidgin_treeview_popup_menu_position_func, tv, 0, GDK_CURRENT_TIME);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1469
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1470 return handled;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1471 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1472
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
1473 static void pidgin_blist_buddy_details_cb(gpointer data, guint action, GtkWidget *item)
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
1474 {
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
1475 pidgin_set_cursor(gtkblist->window, GDK_WATCH);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1476
16062
07554cc5d090 Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <stu@nosnilmot.com>
parents: 16010
diff changeset
1477 purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/blist/show_buddy_icons",
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1478 gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(item)));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1479
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
1480 pidgin_clear_cursor(gtkblist->window);
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
1481 }
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
1482
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
1483 static void pidgin_blist_show_idle_time_cb(gpointer data, guint action, GtkWidget *item)
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
1484 {
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
1485 pidgin_set_cursor(gtkblist->window, GDK_WATCH);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1486
16062
07554cc5d090 Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <stu@nosnilmot.com>
parents: 16010
diff changeset
1487 purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/blist/show_idle_time",
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1488 gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(item)));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1489
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
1490 pidgin_clear_cursor(gtkblist->window);
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
1491 }
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
1492
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
1493 static void pidgin_blist_show_empty_groups_cb(gpointer data, guint action, GtkWidget *item)
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
1494 {
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
1495 pidgin_set_cursor(gtkblist->window, GDK_WATCH);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1496
16062
07554cc5d090 Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <stu@nosnilmot.com>
parents: 16010
diff changeset
1497 purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/blist/show_empty_groups",
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1498 gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(item)));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1499
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
1500 pidgin_clear_cursor(gtkblist->window);
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
1501 }
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
1502
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
1503 static void pidgin_blist_edit_mode_cb(gpointer callback_data, guint callback_action,
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1504 GtkWidget *checkitem)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1505 {
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
1506 pidgin_set_cursor(gtkblist->window, GDK_WATCH);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1507
16062
07554cc5d090 Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <stu@nosnilmot.com>
parents: 16010
diff changeset
1508 purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/blist/show_offline_buddies",
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1509 gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(checkitem)));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1510
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
1511 pidgin_clear_cursor(gtkblist->window);
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
1512 }
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
1513
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
1514 static void pidgin_blist_mute_sounds_cb(gpointer data, guint action, GtkWidget *item)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1515 {
16062
07554cc5d090 Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <stu@nosnilmot.com>
parents: 16010
diff changeset
1516 purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/sound/mute", GTK_CHECK_MENU_ITEM(item)->active);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1517 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1518
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1519 static void
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1520 pidgin_blist_mute_pref_cb(const char *name, PurplePrefType type,
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1521 gconstpointer value, gpointer data)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1522 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1523 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(gtk_item_factory_get_item(gtkblist->ift,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1524 N_("/Tools/Mute Sounds"))), (gboolean)GPOINTER_TO_INT(value));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1525 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1526
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1527 static void
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1528 pidgin_blist_sound_method_pref_cb(const char *name, PurplePrefType type,
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1529 gconstpointer value, gpointer data)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1530 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1531 gboolean sensitive = TRUE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1532
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1533 if(!strcmp(value, "none"))
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1534 sensitive = FALSE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1535
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1536 gtk_widget_set_sensitive(gtk_item_factory_get_widget(gtkblist->ift, N_("/Tools/Mute Sounds")), sensitive);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1537 }
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 static void
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1540 add_buddies_from_vcard(const char *prpl_id, PurpleGroup *group, GList *list,
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1541 const char *alias)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1542 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1543 GList *l;
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1544 PurpleAccount *account = NULL;
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1545 PurpleConnection *gc;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1546
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1547 if (list == NULL)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1548 return;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1549
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1550 for (l = purple_connections_get_all(); l != NULL; l = l->next)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1551 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1552 gc = (PurpleConnection *)l->data;
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1553 account = purple_connection_get_account(gc);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1554
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1555 if (!strcmp(purple_account_get_protocol_id(account), prpl_id))
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1556 break;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1557
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1558 account = NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1559 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1560
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1561 if (account != NULL)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1562 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1563 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
1564 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1565 purple_blist_request_add_buddy(account, l->data,
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1566 (group ? group->name : NULL),
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1567 alias);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1568 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1569 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1570
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1571 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
1572 g_list_free(list);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1573 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1574
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1575 static gboolean
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1576 parse_vcard(const char *vcard, PurpleGroup *group)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1577 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1578 char *temp_vcard;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1579 char *s, *c;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1580 char *alias = NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1581 GList *aims = NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1582 GList *icqs = NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1583 GList *yahoos = NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1584 GList *msns = NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1585 GList *jabbers = NULL;
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 s = temp_vcard = g_strdup(vcard);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1588
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1589 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
1590 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1591 char *field, *value;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1592
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1593 field = s;
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 /* Grab the field */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1596 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
1597 s++;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1598
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1599 if (*s == '\r') s++;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1600 if (*s == '\n')
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1601 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1602 s++;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1603 continue;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1604 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1605
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1606 if (*s != '\0') *s++ = '\0';
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1607
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1608 if ((c = strchr(field, ';')) != NULL)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1609 *c = '\0';
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1610
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1611 /* Proceed to the end of the line */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1612 value = s;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1613
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1614 while (*s != '\r' && *s != '\n' && *s != '\0')
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1615 s++;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1616
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1617 if (*s == '\r') *s++ = '\0';
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1618 if (*s == '\n') *s++ = '\0';
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1619
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1620 /* 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
1621 if (!strcmp(field, "FN"))
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1622 alias = g_strdup(value);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1623 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
1624 !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
1625 !strcmp(field, "X-JABBER"))
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1626 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1627 char **values = g_strsplit(value, ":", 0);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1628 char **im;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1629
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1630 for (im = values; *im != NULL; im++)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1631 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1632 if (!strcmp(field, "X-AIM"))
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1633 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
1634 else if (!strcmp(field, "X-ICQ"))
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1635 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
1636 else if (!strcmp(field, "X-YAHOO"))
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1637 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
1638 else if (!strcmp(field, "X-MSN"))
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1639 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
1640 else if (!strcmp(field, "X-JABBER"))
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1641 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
1642 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1643
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1644 g_strfreev(values);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1645 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1646 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1647
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1648 g_free(temp_vcard);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1649
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1650 if (aims == NULL && icqs == NULL && yahoos == NULL &&
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1651 msns == NULL && jabbers == NULL)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1652 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1653 g_free(alias);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1654
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1655 return FALSE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1656 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1657
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1658 add_buddies_from_vcard("prpl-oscar", group, aims, alias);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1659 add_buddies_from_vcard("prpl-oscar", group, icqs, alias);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1660 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
1661 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
1662 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
1663
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1664 g_free(alias);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1665
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1666 return TRUE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1667 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1668
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1669 #ifdef _WIN32
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
1670 static void pidgin_blist_drag_begin(GtkWidget *widget,
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1671 GdkDragContext *drag_context, gpointer user_data)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1672 {
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
1673 pidgin_blist_tooltip_destroy();
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1674
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1675
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1676 /* 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
1677 * to appear and obscure the dragging operation.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1678 * 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
1679 if (gtkblist->timeout) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1680 g_source_remove(gtkblist->timeout);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1681 gtkblist->timeout = 0;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1682 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1683 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1684 #endif
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1685
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
1686 static void pidgin_blist_drag_data_get_cb(GtkWidget *widget,
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1687 GdkDragContext *dc,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1688 GtkSelectionData *data,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1689 guint info,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1690 guint time,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1691 gpointer null)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1692 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1693
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1694 if (data->target == gdk_atom_intern("PURPLE_BLIST_NODE", FALSE))
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1695 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1696 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
1697 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
1698 GtkTreeIter iter;
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1699 PurpleBlistNode *node = NULL;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1700 GValue val;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1701 if(!sourcerow)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1702 return;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1703 gtk_tree_model_get_iter(GTK_TREE_MODEL(gtkblist->treemodel), &iter, sourcerow);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1704 val.g_type = 0;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1705 gtk_tree_model_get_value (GTK_TREE_MODEL(gtkblist->treemodel), &iter, NODE_COLUMN, &val);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1706 node = g_value_get_pointer(&val);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1707 gtk_selection_data_set (data,
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1708 gdk_atom_intern ("PURPLE_BLIST_NODE", FALSE),
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1709 8, /* bits */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1710 (void*)&node,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1711 sizeof (node));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1712
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1713 gtk_tree_path_free(sourcerow);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1714 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1715 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
1716 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1717 GtkTreeRowReference *ref;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1718 GtkTreePath *sourcerow;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1719 GtkTreeIter iter;
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1720 PurpleBlistNode *node = NULL;
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1721 PurpleBuddy *buddy;
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1722 PurpleConnection *gc;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1723 GValue val;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1724 GString *str;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1725 const char *protocol;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1726
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1727 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
1728 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
1729
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1730 if (!sourcerow)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1731 return;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1732
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1733 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
1734 sourcerow);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1735 val.g_type = 0;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1736 gtk_tree_model_get_value(GTK_TREE_MODEL(gtkblist->treemodel), &iter,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1737 NODE_COLUMN, &val);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1738
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1739 node = g_value_get_pointer(&val);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1740
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1741 if (PURPLE_BLIST_NODE_IS_CONTACT(node))
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1742 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1743 buddy = purple_contact_get_priority_buddy((PurpleContact *)node);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1744 }
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1745 else if (!PURPLE_BLIST_NODE_IS_BUDDY(node))
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1746 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1747 gtk_tree_path_free(sourcerow);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1748 return;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1749 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1750 else
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1751 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1752 buddy = (PurpleBuddy *)node;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1753 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1754
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1755 gc = purple_account_get_connection(buddy->account);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1756
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1757 if (gc == NULL)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1758 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1759 gtk_tree_path_free(sourcerow);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1760 return;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1761 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1762
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1763 protocol =
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1764 PURPLE_PLUGIN_PROTOCOL_INFO(gc->prpl)->list_icon(buddy->account,
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1765 buddy);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1766
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1767 str = g_string_new(NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1768 g_string_printf(str,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1769 "MIME-Version: 1.0\r\n"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1770 "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
1771 "X-IM-Protocol: %s\r\n"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1772 "X-IM-Username: %s\r\n",
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1773 protocol,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1774 buddy->name);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1775
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1776 if (buddy->alias != NULL)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1777 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1778 g_string_append_printf(str,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1779 "X-IM-Alias: %s\r\n",
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1780 buddy->alias);
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 g_string_append(str, "\r\n");
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1784
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1785 gtk_selection_data_set(data,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1786 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
1787 8, /* bits */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1788 (const guchar *)str->str,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1789 strlen(str->str) + 1);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1790
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1791 g_string_free(str, TRUE);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1792 gtk_tree_path_free(sourcerow);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1793 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1794 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1795
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
1796 static void pidgin_blist_drag_data_rcv_cb(GtkWidget *widget, GdkDragContext *dc, guint x, guint y,
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1797 GtkSelectionData *sd, guint info, guint t)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1798 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1799 if (gtkblist->drag_timeout) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1800 g_source_remove(gtkblist->drag_timeout);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1801 gtkblist->drag_timeout = 0;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1802 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1803
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1804 if (sd->target == gdk_atom_intern("PURPLE_BLIST_NODE", FALSE) && sd->data) {
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1805 PurpleBlistNode *n = NULL;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1806 GtkTreePath *path = NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1807 GtkTreeViewDropPosition position;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1808 memcpy(&n, sd->data, sizeof(n));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1809 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
1810 /* 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
1811 GtkTreeIter iter;
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1812 PurpleBlistNode *node;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1813 GValue val;
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
1814 struct _pidgin_blist_node *gtknode;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1815
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1816 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
1817 &iter, path);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1818 val.g_type = 0;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1819 gtk_tree_model_get_value (GTK_TREE_MODEL(gtkblist->treemodel),
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1820 &iter, NODE_COLUMN, &val);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1821 node = g_value_get_pointer(&val);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1822 gtknode = node->ui_data;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1823
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1824 if (PURPLE_BLIST_NODE_IS_CONTACT(n)) {
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1825 PurpleContact *c = (PurpleContact*)n;
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1826 if (PURPLE_BLIST_NODE_IS_CONTACT(node) && gtknode->contact_expanded) {
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1827 purple_blist_merge_contact(c, node);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1828 } else if (PURPLE_BLIST_NODE_IS_CONTACT(node) ||
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1829 PURPLE_BLIST_NODE_IS_CHAT(node)) {
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1830 switch(position) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1831 case GTK_TREE_VIEW_DROP_AFTER:
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1832 case GTK_TREE_VIEW_DROP_INTO_OR_AFTER:
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1833 purple_blist_add_contact(c, (PurpleGroup*)node->parent,
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1834 node);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1835 break;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1836 case GTK_TREE_VIEW_DROP_BEFORE:
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1837 case GTK_TREE_VIEW_DROP_INTO_OR_BEFORE:
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1838 purple_blist_add_contact(c, (PurpleGroup*)node->parent,
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1839 node->prev);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1840 break;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1841 }
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1842 } else if(PURPLE_BLIST_NODE_IS_GROUP(node)) {
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1843 purple_blist_add_contact(c, (PurpleGroup*)node, NULL);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1844 } else if(PURPLE_BLIST_NODE_IS_BUDDY(node)) {
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1845 purple_blist_merge_contact(c, node);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1846 }
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1847 } else if (PURPLE_BLIST_NODE_IS_BUDDY(n)) {
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1848 PurpleBuddy *b = (PurpleBuddy*)n;
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1849 if (PURPLE_BLIST_NODE_IS_BUDDY(node)) {
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1850 switch(position) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1851 case GTK_TREE_VIEW_DROP_AFTER:
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1852 case GTK_TREE_VIEW_DROP_INTO_OR_AFTER:
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1853 purple_blist_add_buddy(b, (PurpleContact*)node->parent,
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1854 (PurpleGroup*)node->parent->parent, node);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1855 break;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1856 case GTK_TREE_VIEW_DROP_BEFORE:
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1857 case GTK_TREE_VIEW_DROP_INTO_OR_BEFORE:
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1858 purple_blist_add_buddy(b, (PurpleContact*)node->parent,
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1859 (PurpleGroup*)node->parent->parent,
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1860 node->prev);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1861 break;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1862 }
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1863 } else if(PURPLE_BLIST_NODE_IS_CHAT(node)) {
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1864 purple_blist_add_buddy(b, NULL, (PurpleGroup*)node->parent,
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1865 NULL);
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1866 } else if (PURPLE_BLIST_NODE_IS_GROUP(node)) {
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1867 purple_blist_add_buddy(b, NULL, (PurpleGroup*)node, NULL);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1868 } else if (PURPLE_BLIST_NODE_IS_CONTACT(node)) {
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1869 if(gtknode->contact_expanded) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1870 switch(position) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1871 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
1872 case GTK_TREE_VIEW_DROP_AFTER:
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1873 case GTK_TREE_VIEW_DROP_INTO_OR_BEFORE:
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1874 purple_blist_add_buddy(b, (PurpleContact*)node,
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1875 (PurpleGroup*)node->parent, NULL);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1876 break;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1877 case GTK_TREE_VIEW_DROP_BEFORE:
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1878 purple_blist_add_buddy(b, NULL,
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1879 (PurpleGroup*)node->parent, node->prev);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1880 break;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1881 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1882 } else {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1883 switch(position) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1884 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
1885 case GTK_TREE_VIEW_DROP_AFTER:
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1886 purple_blist_add_buddy(b, NULL,
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1887 (PurpleGroup*)node->parent, NULL);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1888 break;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1889 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
1890 case GTK_TREE_VIEW_DROP_BEFORE:
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1891 purple_blist_add_buddy(b, NULL,
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1892 (PurpleGroup*)node->parent, node->prev);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1893 break;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1894 }
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 }
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1897 } else if (PURPLE_BLIST_NODE_IS_CHAT(n)) {
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1898 PurpleChat *chat = (PurpleChat *)n;
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1899 if (PURPLE_BLIST_NODE_IS_BUDDY(node)) {
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1900 switch(position) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1901 case GTK_TREE_VIEW_DROP_AFTER:
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1902 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
1903 case GTK_TREE_VIEW_DROP_BEFORE:
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1904 case GTK_TREE_VIEW_DROP_INTO_OR_BEFORE:
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1905 purple_blist_add_chat(chat,
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1906 (PurpleGroup*)node->parent->parent,
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1907 node->parent);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1908 break;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1909 }
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1910 } else if(PURPLE_BLIST_NODE_IS_CONTACT(node) ||
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1911 PURPLE_BLIST_NODE_IS_CHAT(node)) {
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1912 switch(position) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1913 case GTK_TREE_VIEW_DROP_AFTER:
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1914 case GTK_TREE_VIEW_DROP_INTO_OR_AFTER:
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1915 purple_blist_add_chat(chat, (PurpleGroup*)node->parent, node);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1916 break;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1917 case GTK_TREE_VIEW_DROP_BEFORE:
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1918 case GTK_TREE_VIEW_DROP_INTO_OR_BEFORE:
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1919 purple_blist_add_chat(chat, (PurpleGroup*)node->parent, node->prev);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1920 break;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1921 }
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1922 } else if (PURPLE_BLIST_NODE_IS_GROUP(node)) {
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1923 purple_blist_add_chat(chat, (PurpleGroup*)node, NULL);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1924 }
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1925 } else if (PURPLE_BLIST_NODE_IS_GROUP(n)) {
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1926 PurpleGroup *g = (PurpleGroup*)n;
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1927 if (PURPLE_BLIST_NODE_IS_GROUP(node)) {
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1928 switch (position) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1929 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
1930 case GTK_TREE_VIEW_DROP_AFTER:
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1931 purple_blist_add_group(g, node);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1932 break;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1933 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
1934 case GTK_TREE_VIEW_DROP_BEFORE:
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1935 purple_blist_add_group(g, node->prev);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1936 break;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1937 }
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1938 } else if(PURPLE_BLIST_NODE_IS_BUDDY(node)) {
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1939 purple_blist_add_group(g, node->parent->parent);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1940 } else if(PURPLE_BLIST_NODE_IS_CONTACT(node) ||
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1941 PURPLE_BLIST_NODE_IS_CHAT(node)) {
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1942 purple_blist_add_group(g, node->parent);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1943 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1944 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1945
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1946 gtk_tree_path_free(path);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1947 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
1948 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1949 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1950 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
1951 FALSE) && sd->data)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1952 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1953 PurpleGroup *group = NULL;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1954 GtkTreePath *path = NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1955 GtkTreeViewDropPosition position;
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1956 PurpleAccount *account;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1957 char *protocol = NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1958 char *username = NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1959 char *alias = NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1960
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1961 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
1962 x, y, &path, &position))
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 GtkTreeIter iter;
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1965 PurpleBlistNode *node;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1966 GValue val;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1967
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1968 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
1969 &iter, path);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1970 val.g_type = 0;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1971 gtk_tree_model_get_value (GTK_TREE_MODEL(gtkblist->treemodel),
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1972 &iter, NODE_COLUMN, &val);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1973 node = g_value_get_pointer(&val);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1974
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1975 if (PURPLE_BLIST_NODE_IS_BUDDY(node))
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1976 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1977 group = (PurpleGroup *)node->parent->parent;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1978 }
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1979 else if (PURPLE_BLIST_NODE_IS_CHAT(node) ||
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1980 PURPLE_BLIST_NODE_IS_CONTACT(node))
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1981 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1982 group = (PurpleGroup *)node->parent;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1983 }
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1984 else if (PURPLE_BLIST_NODE_IS_GROUP(node))
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1985 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1986 group = (PurpleGroup *)node;
15374
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 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1989
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
1990 if (pidgin_parse_x_im_contact((const char *)sd->data, FALSE, &account,
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1991 &protocol, &username, &alias))
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1992 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1993 if (account == NULL)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1994 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1995 purple_notify_error(NULL, NULL,
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1996 _("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
1997 "can add that buddy."), NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1998 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1999 else
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2000 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
2001 purple_blist_request_add_buddy(account, username,
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2002 (group ? group->name : NULL),
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2003 alias);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2004 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2005 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2006
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2007 g_free(username);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2008 g_free(protocol);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2009 g_free(alias);
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 if (path != NULL)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2012 gtk_tree_path_free(path);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2013
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2014 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
2015 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2016 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
2017 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2018 gboolean result;
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
2019 PurpleGroup *group = NULL;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2020 GtkTreePath *path = NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2021 GtkTreeViewDropPosition position;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2022
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2023 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
2024 x, y, &path, &position))
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2025 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2026 GtkTreeIter iter;
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
2027 PurpleBlistNode *node;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2028 GValue val;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2029
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2030 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
2031 &iter, path);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2032 val.g_type = 0;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2033 gtk_tree_model_get_value (GTK_TREE_MODEL(gtkblist->treemodel),
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2034 &iter, NODE_COLUMN, &val);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2035 node = g_value_get_pointer(&val);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2036
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
2037 if (PURPLE_BLIST_NODE_IS_BUDDY(node))
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2038 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
2039 group = (PurpleGroup *)node->parent->parent;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2040 }
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
2041 else if (PURPLE_BLIST_NODE_IS_CHAT(node) ||
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
2042 PURPLE_BLIST_NODE_IS_CONTACT(node))
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2043 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
2044 group = (PurpleGroup *)node->parent;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2045 }
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
2046 else if (PURPLE_BLIST_NODE_IS_GROUP(node))
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2047 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
2048 group = (PurpleGroup *)node;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2049 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2050 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2051
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2052 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
2053
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2054 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
2055 } 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
2056 GtkTreePath *path = NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2057 GtkTreeViewDropPosition position;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2058
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2059 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
2060 x, y, &path, &position))
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2061 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2062 GtkTreeIter iter;
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
2063 PurpleBlistNode *node;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2064 GValue val;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2065
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2066 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
2067 &iter, path);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2068 val.g_type = 0;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2069 gtk_tree_model_get_value (GTK_TREE_MODEL(gtkblist->treemodel),
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2070 &iter, NODE_COLUMN, &val);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2071 node = g_value_get_pointer(&val);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2072
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
2073 if (PURPLE_BLIST_NODE_IS_BUDDY(node) || PURPLE_BLIST_NODE_IS_CONTACT(node)) {
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
2074 PurpleBuddy *b = PURPLE_BLIST_NODE_IS_BUDDY(node) ? (PurpleBuddy*)node : purple_contact_get_priority_buddy((PurpleContact*)node);
15507
311315e979f7 gtkutils changes
Sean Egan <seanegan@gmail.com>
parents: 15505
diff changeset
2075 pidgin_dnd_file_manage(sd, b->account, b->name);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2076 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
2077 } else {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2078 gtk_drag_finish(dc, FALSE, FALSE, t);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2079 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2080 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2081 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2082 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2083
16090
31e6eb50b4fd Hylke requested that we slightly round the corners of budy icons in the blist to better match the round status icons
Sean Egan <seanegan@gmail.com>
parents: 16062
diff changeset
2084 static void
31e6eb50b4fd Hylke requested that we slightly round the corners of budy icons in the blist to better match the round status icons
Sean Egan <seanegan@gmail.com>
parents: 16062
diff changeset
2085 roundify(GdkPixbuf *pixbuf) {
31e6eb50b4fd Hylke requested that we slightly round the corners of budy icons in the blist to better match the round status icons
Sean Egan <seanegan@gmail.com>
parents: 16062
diff changeset
2086 int width, height, rowstride;
31e6eb50b4fd Hylke requested that we slightly round the corners of budy icons in the blist to better match the round status icons
Sean Egan <seanegan@gmail.com>
parents: 16062
diff changeset
2087 guchar *pixels;
31e6eb50b4fd Hylke requested that we slightly round the corners of budy icons in the blist to better match the round status icons
Sean Egan <seanegan@gmail.com>
parents: 16062
diff changeset
2088
31e6eb50b4fd Hylke requested that we slightly round the corners of budy icons in the blist to better match the round status icons
Sean Egan <seanegan@gmail.com>
parents: 16062
diff changeset
2089 if (!gdk_pixbuf_get_has_alpha(pixbuf))
31e6eb50b4fd Hylke requested that we slightly round the corners of budy icons in the blist to better match the round status icons
Sean Egan <seanegan@gmail.com>
parents: 16062
diff changeset
2090 return;
31e6eb50b4fd Hylke requested that we slightly round the corners of budy icons in the blist to better match the round status icons
Sean Egan <seanegan@gmail.com>
parents: 16062
diff changeset
2091
31e6eb50b4fd Hylke requested that we slightly round the corners of budy icons in the blist to better match the round status icons
Sean Egan <seanegan@gmail.com>
parents: 16062
diff changeset
2092 width = gdk_pixbuf_get_width(pixbuf);
31e6eb50b4fd Hylke requested that we slightly round the corners of budy icons in the blist to better match the round status icons
Sean Egan <seanegan@gmail.com>
parents: 16062
diff changeset
2093 height = gdk_pixbuf_get_height(pixbuf);
31e6eb50b4fd Hylke requested that we slightly round the corners of budy icons in the blist to better match the round status icons
Sean Egan <seanegan@gmail.com>
parents: 16062
diff changeset
2094 rowstride = gdk_pixbuf_get_rowstride(pixbuf);
31e6eb50b4fd Hylke requested that we slightly round the corners of budy icons in the blist to better match the round status icons
Sean Egan <seanegan@gmail.com>
parents: 16062
diff changeset
2095 pixels = gdk_pixbuf_get_pixels(pixbuf);
31e6eb50b4fd Hylke requested that we slightly round the corners of budy icons in the blist to better match the round status icons
Sean Egan <seanegan@gmail.com>
parents: 16062
diff changeset
2096
31e6eb50b4fd Hylke requested that we slightly round the corners of budy icons in the blist to better match the round status icons
Sean Egan <seanegan@gmail.com>
parents: 16062
diff changeset
2097 if (width < 6 || height < 6)
31e6eb50b4fd Hylke requested that we slightly round the corners of budy icons in the blist to better match the round status icons
Sean Egan <seanegan@gmail.com>
parents: 16062
diff changeset
2098 return;
17042
777cdaa3b904 This is what I actually intended to commit in 105009e066f1bcaefb0af3bd1e17b7860bf12a57. The rest of the mess being pushed is me trying to clean up my mess.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 17038
diff changeset
2099
16090
31e6eb50b4fd Hylke requested that we slightly round the corners of budy icons in the blist to better match the round status icons
Sean Egan <seanegan@gmail.com>
parents: 16062
diff changeset
2100 /* Top left */
31e6eb50b4fd Hylke requested that we slightly round the corners of budy icons in the blist to better match the round status icons
Sean Egan <seanegan@gmail.com>
parents: 16062
diff changeset
2101 pixels[3] = 0;
31e6eb50b4fd Hylke requested that we slightly round the corners of budy icons in the blist to better match the round status icons
Sean Egan <seanegan@gmail.com>
parents: 16062
diff changeset
2102 pixels[7] = 0x80;
31e6eb50b4fd Hylke requested that we slightly round the corners of budy icons in the blist to better match the round status icons
Sean Egan <seanegan@gmail.com>
parents: 16062
diff changeset
2103 pixels[11] = 0xC0;
31e6eb50b4fd Hylke requested that we slightly round the corners of budy icons in the blist to better match the round status icons
Sean Egan <seanegan@gmail.com>
parents: 16062
diff changeset
2104 pixels[rowstride + 3] = 0x80;
31e6eb50b4fd Hylke requested that we slightly round the corners of budy icons in the blist to better match the round status icons
Sean Egan <seanegan@gmail.com>
parents: 16062
diff changeset
2105 pixels[rowstride * 2 + 3] = 0xC0;
17042
777cdaa3b904 This is what I actually intended to commit in 105009e066f1bcaefb0af3bd1e17b7860bf12a57. The rest of the mess being pushed is me trying to clean up my mess.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 17038
diff changeset
2106
16090
31e6eb50b4fd Hylke requested that we slightly round the corners of budy icons in the blist to better match the round status icons
Sean Egan <seanegan@gmail.com>
parents: 16062
diff changeset
2107 /* Top right */
31e6eb50b4fd Hylke requested that we slightly round the corners of budy icons in the blist to better match the round status icons
Sean Egan <seanegan@gmail.com>
parents: 16062
diff changeset
2108 pixels[width * 4 - 1] = 0;
31e6eb50b4fd Hylke requested that we slightly round the corners of budy icons in the blist to better match the round status icons
Sean Egan <seanegan@gmail.com>
parents: 16062
diff changeset
2109 pixels[width * 4 - 5] = 0x80;
31e6eb50b4fd Hylke requested that we slightly round the corners of budy icons in the blist to better match the round status icons
Sean Egan <seanegan@gmail.com>
parents: 16062
diff changeset
2110 pixels[width * 4 - 9] = 0xC0;
31e6eb50b4fd Hylke requested that we slightly round the corners of budy icons in the blist to better match the round status icons
Sean Egan <seanegan@gmail.com>
parents: 16062
diff changeset
2111 pixels[rowstride + (width * 4) - 1] = 0x80;
31e6eb50b4fd Hylke requested that we slightly round the corners of budy icons in the blist to better match the round status icons
Sean Egan <seanegan@gmail.com>
parents: 16062
diff changeset
2112 pixels[(2 * rowstride) + (width * 4) - 1] = 0xC0;
17042
777cdaa3b904 This is what I actually intended to commit in 105009e066f1bcaefb0af3bd1e17b7860bf12a57. The rest of the mess being pushed is me trying to clean up my mess.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 17038
diff changeset
2113
16090
31e6eb50b4fd Hylke requested that we slightly round the corners of budy icons in the blist to better match the round status icons
Sean Egan <seanegan@gmail.com>
parents: 16062
diff changeset
2114 /* Bottom left */
31e6eb50b4fd Hylke requested that we slightly round the corners of budy icons in the blist to better match the round status icons
Sean Egan <seanegan@gmail.com>
parents: 16062
diff changeset
2115 pixels[(height - 1) * rowstride + 3] = 0;
31e6eb50b4fd Hylke requested that we slightly round the corners of budy icons in the blist to better match the round status icons
Sean Egan <seanegan@gmail.com>
parents: 16062
diff changeset
2116 pixels[(height - 1) * rowstride + 7] = 0x80;
31e6eb50b4fd Hylke requested that we slightly round the corners of budy icons in the blist to better match the round status icons
Sean Egan <seanegan@gmail.com>
parents: 16062
diff changeset
2117 pixels[(height - 1) * rowstride + 11] = 0xC0;
31e6eb50b4fd Hylke requested that we slightly round the corners of budy icons in the blist to better match the round status icons
Sean Egan <seanegan@gmail.com>
parents: 16062
diff changeset
2118 pixels[(height - 2) * rowstride + 3] = 0x80;
31e6eb50b4fd Hylke requested that we slightly round the corners of budy icons in the blist to better match the round status icons
Sean Egan <seanegan@gmail.com>
parents: 16062
diff changeset
2119 pixels[(height - 3) * rowstride + 3] = 0xC0;
17042
777cdaa3b904 This is what I actually intended to commit in 105009e066f1bcaefb0af3bd1e17b7860bf12a57. The rest of the mess being pushed is me trying to clean up my mess.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 17038
diff changeset
2120
16090
31e6eb50b4fd Hylke requested that we slightly round the corners of budy icons in the blist to better match the round status icons
Sean Egan <seanegan@gmail.com>
parents: 16062
diff changeset
2121 /* Bottom right */
31e6eb50b4fd Hylke requested that we slightly round the corners of budy icons in the blist to better match the round status icons
Sean Egan <seanegan@gmail.com>
parents: 16062
diff changeset
2122 pixels[height * rowstride - 1] = 0;
31e6eb50b4fd Hylke requested that we slightly round the corners of budy icons in the blist to better match the round status icons
Sean Egan <seanegan@gmail.com>
parents: 16062
diff changeset
2123 pixels[(height - 1) * rowstride - 1] = 0x80;
31e6eb50b4fd Hylke requested that we slightly round the corners of budy icons in the blist to better match the round status icons
Sean Egan <seanegan@gmail.com>
parents: 16062
diff changeset
2124 pixels[(height - 2) * rowstride - 1] = 0xC0;
31e6eb50b4fd Hylke requested that we slightly round the corners of budy icons in the blist to better match the round status icons
Sean Egan <seanegan@gmail.com>
parents: 16062
diff changeset
2125 pixels[height * rowstride - 5] = 0x80;
31e6eb50b4fd Hylke requested that we slightly round the corners of budy icons in the blist to better match the round status icons
Sean Egan <seanegan@gmail.com>
parents: 16062
diff changeset
2126 pixels[height * rowstride - 9] = 0xC0;
31e6eb50b4fd Hylke requested that we slightly round the corners of budy icons in the blist to better match the round status icons
Sean Egan <seanegan@gmail.com>
parents: 16062
diff changeset
2127 }
31e6eb50b4fd Hylke requested that we slightly round the corners of budy icons in the blist to better match the round status icons
Sean Egan <seanegan@gmail.com>
parents: 16062
diff changeset
2128
15491
88070d5f4c62 dim buddy icons on idle and offline. Still need to do status icons.
Sean Egan <seanegan@gmail.com>
parents: 15490
diff changeset
2129 /* Altered from do_colorshift in gnome-panel */
88070d5f4c62 dim buddy icons on idle and offline. Still need to do status icons.
Sean Egan <seanegan@gmail.com>
parents: 15490
diff changeset
2130 static void
88070d5f4c62 dim buddy icons on idle and offline. Still need to do status icons.
Sean Egan <seanegan@gmail.com>
parents: 15490
diff changeset
2131 do_alphashift (GdkPixbuf *dest, GdkPixbuf *src, int shift)
88070d5f4c62 dim buddy icons on idle and offline. Still need to do status icons.
Sean Egan <seanegan@gmail.com>
parents: 15490
diff changeset
2132 {
88070d5f4c62 dim buddy icons on idle and offline. Still need to do status icons.
Sean Egan <seanegan@gmail.com>
parents: 15490
diff changeset
2133 gint i, j;
88070d5f4c62 dim buddy icons on idle and offline. Still need to do status icons.
Sean Egan <seanegan@gmail.com>
parents: 15490
diff changeset
2134 gint width, height, has_alpha, srcrowstride, destrowstride;
88070d5f4c62 dim buddy icons on idle and offline. Still need to do status icons.
Sean Egan <seanegan@gmail.com>
parents: 15490
diff changeset
2135 guchar *target_pixels;
88070d5f4c62 dim buddy icons on idle and offline. Still need to do status icons.
Sean Egan <seanegan@gmail.com>
parents: 15490
diff changeset
2136 guchar *original_pixels;
88070d5f4c62 dim buddy icons on idle and offline. Still need to do status icons.
Sean Egan <seanegan@gmail.com>
parents: 15490
diff changeset
2137 guchar *pixsrc;
88070d5f4c62 dim buddy icons on idle and offline. Still need to do status icons.
Sean Egan <seanegan@gmail.com>
parents: 15490
diff changeset
2138 guchar *pixdest;
88070d5f4c62 dim buddy icons on idle and offline. Still need to do status icons.
Sean Egan <seanegan@gmail.com>
parents: 15490
diff changeset
2139 int val;
88070d5f4c62 dim buddy icons on idle and offline. Still need to do status icons.
Sean Egan <seanegan@gmail.com>
parents: 15490
diff changeset
2140 guchar a;
88070d5f4c62 dim buddy icons on idle and offline. Still need to do status icons.
Sean Egan <seanegan@gmail.com>
parents: 15490
diff changeset
2141
88070d5f4c62 dim buddy icons on idle and offline. Still need to do status icons.
Sean Egan <seanegan@gmail.com>
parents: 15490
diff changeset
2142 has_alpha = gdk_pixbuf_get_has_alpha (src);
88070d5f4c62 dim buddy icons on idle and offline. Still need to do status icons.
Sean Egan <seanegan@gmail.com>
parents: 15490
diff changeset
2143 if (!has_alpha)
88070d5f4c62 dim buddy icons on idle and offline. Still need to do status icons.
Sean Egan <seanegan@gmail.com>
parents: 15490
diff changeset
2144 return;
88070d5f4c62 dim buddy icons on idle and offline. Still need to do status icons.
Sean Egan <seanegan@gmail.com>
parents: 15490
diff changeset
2145
88070d5f4c62 dim buddy icons on idle and offline. Still need to do status icons.
Sean Egan <seanegan@gmail.com>
parents: 15490
diff changeset
2146 width = gdk_pixbuf_get_width (src);
88070d5f4c62 dim buddy icons on idle and offline. Still need to do status icons.
Sean Egan <seanegan@gmail.com>
parents: 15490
diff changeset
2147 height = gdk_pixbuf_get_height (src);
88070d5f4c62 dim buddy icons on idle and offline. Still need to do status icons.
Sean Egan <seanegan@gmail.com>
parents: 15490
diff changeset
2148 srcrowstride = gdk_pixbuf_get_rowstride (src);
88070d5f4c62 dim buddy icons on idle and offline. Still need to do status icons.
Sean Egan <seanegan@gmail.com>
parents: 15490
diff changeset
2149 destrowstride = gdk_pixbuf_get_rowstride (dest);
88070d5f4c62 dim buddy icons on idle and offline. Still need to do status icons.
Sean Egan <seanegan@gmail.com>
parents: 15490
diff changeset
2150 target_pixels = gdk_pixbuf_get_pixels (dest);
88070d5f4c62 dim buddy icons on idle and offline. Still need to do status icons.
Sean Egan <seanegan@gmail.com>
parents: 15490
diff changeset
2151 original_pixels = gdk_pixbuf_get_pixels (src);
88070d5f4c62 dim buddy icons on idle and offline. Still need to do status icons.
Sean Egan <seanegan@gmail.com>
parents: 15490
diff changeset
2152
88070d5f4c62 dim buddy icons on idle and offline. Still need to do status icons.
Sean Egan <seanegan@gmail.com>
parents: 15490
diff changeset
2153 for (i = 0; i < height; i++) {
88070d5f4c62 dim buddy icons on idle and offline. Still need to do status icons.
Sean Egan <seanegan@gmail.com>
parents: 15490
diff changeset
2154 pixdest = target_pixels + i*destrowstride;
88070d5f4c62 dim buddy icons on idle and offline. Still need to do status icons.
Sean Egan <seanegan@gmail.com>
parents: 15490
diff changeset
2155 pixsrc = original_pixels + i*srcrowstride;
88070d5f4c62 dim buddy icons on idle and offline. Still need to do status icons.
Sean Egan <seanegan@gmail.com>
parents: 15490
diff changeset
2156 for (j = 0; j < width; j++) {
88070d5f4c62 dim buddy icons on idle and offline. Still need to do status icons.
Sean Egan <seanegan@gmail.com>
parents: 15490
diff changeset
2157 *(pixdest++) = *(pixsrc++);
88070d5f4c62 dim buddy icons on idle and offline. Still need to do status icons.
Sean Egan <seanegan@gmail.com>
parents: 15490
diff changeset
2158 *(pixdest++) = *(pixsrc++);
88070d5f4c62 dim buddy icons on idle and offline. Still need to do status icons.
Sean Egan <seanegan@gmail.com>
parents: 15490
diff changeset
2159 *(pixdest++) = *(pixsrc++);
88070d5f4c62 dim buddy icons on idle and offline. Still need to do status icons.
Sean Egan <seanegan@gmail.com>
parents: 15490
diff changeset
2160 a = *(pixsrc++);
88070d5f4c62 dim buddy icons on idle and offline. Still need to do status icons.
Sean Egan <seanegan@gmail.com>
parents: 15490
diff changeset
2161 val = a - shift;
88070d5f4c62 dim buddy icons on idle and offline. Still need to do status icons.
Sean Egan <seanegan@gmail.com>
parents: 15490
diff changeset
2162 *(pixdest++) = CLAMP(val, 0, 255);
88070d5f4c62 dim buddy icons on idle and offline. Still need to do status icons.
Sean Egan <seanegan@gmail.com>
parents: 15490
diff changeset
2163 }
88070d5f4c62 dim buddy icons on idle and offline. Still need to do status icons.
Sean Egan <seanegan@gmail.com>
parents: 15490
diff changeset
2164 }
88070d5f4c62 dim buddy icons on idle and offline. Still need to do status icons.
Sean Egan <seanegan@gmail.com>
parents: 15490
diff changeset
2165 }
88070d5f4c62 dim buddy icons on idle and offline. Still need to do status icons.
Sean Egan <seanegan@gmail.com>
parents: 15490
diff changeset
2166
88070d5f4c62 dim buddy icons on idle and offline. Still need to do status icons.
Sean Egan <seanegan@gmail.com>
parents: 15490
diff changeset
2167
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
2168 static GdkPixbuf *pidgin_blist_get_buddy_icon(PurpleBlistNode *node,
16375
391a79778f89 Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@wiktel.com>
parents: 16275
diff changeset
2169 gboolean scaled, gboolean greyed)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2170 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2171 GdkPixbuf *buf, *ret = NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2172 GdkPixbufLoader *loader;
16828
56823a55581a Rework purple_buddy_icons_find() to return a reference for the caller, which
Richard Laager <rlaager@wiktel.com>
parents: 16777
diff changeset
2173 PurpleBuddyIcon *icon = NULL;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2174 const guchar *data = NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2175 gsize len;
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
2176 PurpleBuddy *buddy = NULL;
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
2177 PurpleAccount *account = NULL;
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
2178 PurplePluginProtocolInfo *prpl_info = 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
2179 PurpleStoredImage *custom_img;
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
2180
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
2181 if(PURPLE_BLIST_NODE_IS_CONTACT(node)) {
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
2182 buddy = purple_contact_get_priority_buddy((PurpleContact*)node);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
2183 } else if(PURPLE_BLIST_NODE_IS_BUDDY(node)) {
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
2184 buddy = (PurpleBuddy*)node;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2185 } else {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2186 return NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2187 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2188
16564
26fb9b308cc1 This is Sadrul's icon-migrate.patch from ticket #314.
Richard Laager <rlaager@wiktel.com>
parents: 16483
diff changeset
2189 if(buddy == NULL)
26fb9b308cc1 This is Sadrul's icon-migrate.patch from ticket #314.
Richard Laager <rlaager@wiktel.com>
parents: 16483
diff changeset
2190 return NULL;
26fb9b308cc1 This is Sadrul's icon-migrate.patch from ticket #314.
Richard Laager <rlaager@wiktel.com>
parents: 16483
diff changeset
2191
26fb9b308cc1 This is Sadrul's icon-migrate.patch from ticket #314.
Richard Laager <rlaager@wiktel.com>
parents: 16483
diff changeset
2192 account = purple_buddy_get_account(buddy);
15423
051a5c4f0917 this would use the protocol icons in place of the buddy icon for chats,
Nathan Walp <nwalp@pidgin.im>
parents: 15418
diff changeset
2193
051a5c4f0917 this would use the protocol icons in place of the buddy icon for chats,
Nathan Walp <nwalp@pidgin.im>
parents: 15418
diff changeset
2194 if(account && account->gc)
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
2195 prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(account->gc->prpl);
15423
051a5c4f0917 this would use the protocol icons in place of the buddy icon for chats,
Nathan Walp <nwalp@pidgin.im>
parents: 15418
diff changeset
2196
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2197 #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
2198 if (!purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/blist/show_buddy_icons"))
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2199 return NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2200 #endif
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2201
16375
391a79778f89 Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@wiktel.com>
parents: 16275
diff changeset
2202 custom_img = purple_buddy_icons_find_custom_icon(purple_buddy_get_contact(buddy));
391a79778f89 Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@wiktel.com>
parents: 16275
diff changeset
2203 if (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
2204 {
391a79778f89 Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@wiktel.com>
parents: 16275
diff changeset
2205 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
2206 len = purple_imgstore_get_size(custom_img);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
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 if (data == NULL) {
16828
56823a55581a Rework purple_buddy_icons_find() to return a reference for the caller, which
Richard Laager <rlaager@wiktel.com>
parents: 16777
diff changeset
2210 /* Not sure I like this...*/
56823a55581a Rework purple_buddy_icons_find() to return a reference for the caller, which
Richard Laager <rlaager@wiktel.com>
parents: 16777
diff changeset
2211 if (!(icon = purple_buddy_icons_find(buddy->account, buddy->name)))
56823a55581a Rework purple_buddy_icons_find() to return a reference for the caller, which
Richard Laager <rlaager@wiktel.com>
parents: 16777
diff changeset
2212 return NULL;
16564
26fb9b308cc1 This is Sadrul's icon-migrate.patch from ticket #314.
Richard Laager <rlaager@wiktel.com>
parents: 16483
diff changeset
2213 data = purple_buddy_icon_get_data(icon, &len);
26fb9b308cc1 This is Sadrul's icon-migrate.patch from ticket #314.
Richard Laager <rlaager@wiktel.com>
parents: 16483
diff changeset
2214
26fb9b308cc1 This is Sadrul's icon-migrate.patch from ticket #314.
Richard Laager <rlaager@wiktel.com>
parents: 16483
diff changeset
2215 if(data == NULL)
26fb9b308cc1 This is Sadrul's icon-migrate.patch from ticket #314.
Richard Laager <rlaager@wiktel.com>
parents: 16483
diff changeset
2216 return NULL;
26fb9b308cc1 This is Sadrul's icon-migrate.patch from ticket #314.
Richard Laager <rlaager@wiktel.com>
parents: 16483
diff changeset
2217 }
15423
051a5c4f0917 this would use the protocol icons in place of the buddy icon for chats,
Nathan Walp <nwalp@pidgin.im>
parents: 15418
diff changeset
2218
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2219 loader = gdk_pixbuf_loader_new();
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2220 gdk_pixbuf_loader_write(loader, data, len, NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2221 gdk_pixbuf_loader_close(loader, NULL);
16383
05033ae856b2 Fix the memory leaking and improper calls to ref_filename(). Also, remove some debugging code.
Richard Laager <rlaager@wiktel.com>
parents: 16381
diff changeset
2222
05033ae856b2 Fix the memory leaking and improper calls to ref_filename(). Also, remove some debugging code.
Richard Laager <rlaager@wiktel.com>
parents: 16381
diff changeset
2223 purple_imgstore_unref(custom_img);
16828
56823a55581a Rework purple_buddy_icons_find() to return a reference for the caller, which
Richard Laager <rlaager@wiktel.com>
parents: 16777
diff changeset
2224 purple_buddy_icon_unref(icon);
16383
05033ae856b2 Fix the memory leaking and improper calls to ref_filename(). Also, remove some debugging code.
Richard Laager <rlaager@wiktel.com>
parents: 16381
diff changeset
2225
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2226 buf = gdk_pixbuf_loader_get_pixbuf(loader);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2227 if (buf)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2228 g_object_ref(G_OBJECT(buf));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2229 g_object_unref(G_OBJECT(loader));
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 if (buf) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2232 int orig_width, orig_height;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2233 int scale_width, scale_height;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2234
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2235 if (greyed) {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
2236 PurplePresence *presence = purple_buddy_get_presence(buddy);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
2237 if (!PURPLE_BUDDY_IS_ONLINE(buddy))
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2238 gdk_pixbuf_saturate_and_pixelate(buf, buf, 0.0, FALSE);
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
2239 if (purple_presence_is_idle(presence))
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2240 gdk_pixbuf_saturate_and_pixelate(buf, buf, 0.25, FALSE);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2241 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2242
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
2243 /* i'd use the pidgin_buddy_icon_get_scale_size() thing,
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2244 * but it won't tell me the original size, which I need for scaling
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2245 * purposes */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2246 scale_width = orig_width = gdk_pixbuf_get_width(buf);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2247 scale_height = orig_height = gdk_pixbuf_get_height(buf);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2248
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
2249 if (prpl_info && prpl_info->icon_spec.scale_rules & PURPLE_ICON_SCALE_DISPLAY)
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
2250 purple_buddy_icon_get_scale_size(&prpl_info->icon_spec, &scale_width, &scale_height);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2251
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2252 if (scaled) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2253 if(scale_height > scale_width) {
15397
a8ee645e7fb4 A lot of status icon changes:
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2254 scale_width = 32.0 * (double)scale_width / (double)scale_height;
a8ee645e7fb4 A lot of status icon changes:
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2255 scale_height = 32;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2256 } else {
15397
a8ee645e7fb4 A lot of status icon changes:
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2257 scale_height = 32.0 * (double)scale_height / (double)scale_width;
a8ee645e7fb4 A lot of status icon changes:
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2258 scale_width = 32;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2259 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2260
15397
a8ee645e7fb4 A lot of status icon changes:
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2261 ret = gdk_pixbuf_new(GDK_COLORSPACE_RGB, TRUE, 8, 32, 32);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2262 gdk_pixbuf_fill(ret, 0x00000000);
15397
a8ee645e7fb4 A lot of status icon changes:
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2263 gdk_pixbuf_scale(buf, ret, (32-scale_width)/2, (32-scale_height)/2, scale_width, scale_height, (32-scale_width)/2, (32-scale_height)/2, (double)scale_width/(double)orig_width, (double)scale_height/(double)orig_height, GDK_INTERP_BILINEAR);
16090
31e6eb50b4fd Hylke requested that we slightly round the corners of budy icons in the blist to better match the round status icons
Sean Egan <seanegan@gmail.com>
parents: 16062
diff changeset
2264 if (pidgin_gdk_pixbuf_is_opaque(ret))
31e6eb50b4fd Hylke requested that we slightly round the corners of budy icons in the blist to better match the round status icons
Sean Egan <seanegan@gmail.com>
parents: 16062
diff changeset
2265 roundify(ret);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2266 } else {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2267 ret = gdk_pixbuf_scale_simple(buf,scale_width,scale_height, GDK_INTERP_BILINEAR);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2268 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2269 g_object_unref(G_OBJECT(buf));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2270 }
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 return ret;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2273 }
15442
2dc742344eb7 PRPL Icons in tooltips
Sean Egan <seanegan@gmail.com>
parents: 15437
diff changeset
2274 /* # - Status Icon
2dc742344eb7 PRPL Icons in tooltips
Sean Egan <seanegan@gmail.com>
parents: 15437
diff changeset
2275 * P - Protocol Icon
2dc742344eb7 PRPL Icons in tooltips
Sean Egan <seanegan@gmail.com>
parents: 15437
diff changeset
2276 * A - Buddy Icon
2dc742344eb7 PRPL Icons in tooltips
Sean Egan <seanegan@gmail.com>
parents: 15437
diff changeset
2277 * [ - SMALL_SPACE
2dc742344eb7 PRPL Icons in tooltips
Sean Egan <seanegan@gmail.com>
parents: 15437
diff changeset
2278 * = - LARGE_SPACE
2dc742344eb7 PRPL Icons in tooltips
Sean Egan <seanegan@gmail.com>
parents: 15437
diff changeset
2279 * +--- STATUS_SIZE +--- td->avatar_width
2dc742344eb7 PRPL Icons in tooltips
Sean Egan <seanegan@gmail.com>
parents: 15437
diff changeset
2280 * | +-- td->name_width |
2dc742344eb7 PRPL Icons in tooltips
Sean Egan <seanegan@gmail.com>
parents: 15437
diff changeset
2281 * +----+ +-------+ +---------+
2dc742344eb7 PRPL Icons in tooltips
Sean Egan <seanegan@gmail.com>
parents: 15437
diff changeset
2282 * | | | | | |
2dc742344eb7 PRPL Icons in tooltips
Sean Egan <seanegan@gmail.com>
parents: 15437
diff changeset
2283 * +-------------------------------------------+
2dc742344eb7 PRPL Icons in tooltips
Sean Egan <seanegan@gmail.com>
parents: 15437
diff changeset
2284 * | [ = [ |--- TOOLTIP_BORDER
2dc742344eb7 PRPL Icons in tooltips
Sean Egan <seanegan@gmail.com>
parents: 15437
diff changeset
2285 *name_height --+-| ######[BuddyName = PP [ AAAAAAAAAAA |--+
2dc742344eb7 PRPL Icons in tooltips
Sean Egan <seanegan@gmail.com>
parents: 15437
diff changeset
2286 * | | ######[ = PP [ AAAAAAAAAAA | |
2dc742344eb7 PRPL Icons in tooltips
Sean Egan <seanegan@gmail.com>
parents: 15437
diff changeset
2287 * STATUS SIZE -| | ######[[[[[[[[[[[[[[[[[[[[[ AAAAAAAAAAA | |
2dc742344eb7 PRPL Icons in tooltips
Sean Egan <seanegan@gmail.com>
parents: 15437
diff changeset
2288 * +--+-| ######[Account: So-and-so [ AAAAAAAAAAA | |-- td->avatar_height
2dc742344eb7 PRPL Icons in tooltips
Sean Egan <seanegan@gmail.com>
parents: 15437
diff changeset
2289 * | | [Idle: 4h 15m [ AAAAAAAAAAA | |
2dc742344eb7 PRPL Icons in tooltips
Sean Egan <seanegan@gmail.com>
parents: 15437
diff changeset
2290 * height --+ | [Foo: Bar, Baz [ AAAAAAAAAAA | |
2dc742344eb7 PRPL Icons in tooltips
Sean Egan <seanegan@gmail.com>
parents: 15437
diff changeset
2291 * | | [Status: Awesome [ AAAAAAAAAAA |--+
2dc742344eb7 PRPL Icons in tooltips
Sean Egan <seanegan@gmail.com>
parents: 15437
diff changeset
2292 * +----| [Stop: Hammer Time [ |
2dc742344eb7 PRPL Icons in tooltips
Sean Egan <seanegan@gmail.com>
parents: 15437
diff changeset
2293 * | [ [ |--- TOOLTIP_BORDER
2dc742344eb7 PRPL Icons in tooltips
Sean Egan <seanegan@gmail.com>
parents: 15437
diff changeset
2294 * +-------------------------------------------+
2dc742344eb7 PRPL Icons in tooltips
Sean Egan <seanegan@gmail.com>
parents: 15437
diff changeset
2295 * | | | |
2dc742344eb7 PRPL Icons in tooltips
Sean Egan <seanegan@gmail.com>
parents: 15437
diff changeset
2296 * | +----------------+ |
2dc742344eb7 PRPL Icons in tooltips
Sean Egan <seanegan@gmail.com>
parents: 15437
diff changeset
2297 * | | |
2dc742344eb7 PRPL Icons in tooltips
Sean Egan <seanegan@gmail.com>
parents: 15437
diff changeset
2298 * | +-- td->width |
2dc742344eb7 PRPL Icons in tooltips
Sean Egan <seanegan@gmail.com>
parents: 15437
diff changeset
2299 * | |
2dc742344eb7 PRPL Icons in tooltips
Sean Egan <seanegan@gmail.com>
parents: 15437
diff changeset
2300 * +---- TOOLTIP_BORDER +---- TOOLTIP_BORDER
2dc742344eb7 PRPL Icons in tooltips
Sean Egan <seanegan@gmail.com>
parents: 15437
diff changeset
2301 *
15632
a830f9756f23 Some more pidgininfication
Daniel Atallah <daniel.atallah@gmail.com>
parents: 15615
diff changeset
2302 *
15442
2dc742344eb7 PRPL Icons in tooltips
Sean Egan <seanegan@gmail.com>
parents: 15437
diff changeset
2303 */
15545
82e3cff11243 Perhaps a 22px icon is better in the tooltip
Sean Egan <seanegan@gmail.com>
parents: 15524
diff changeset
2304 #define STATUS_SIZE 22
15442
2dc742344eb7 PRPL Icons in tooltips
Sean Egan <seanegan@gmail.com>
parents: 15437
diff changeset
2305 #define TOOLTIP_BORDER 12
2dc742344eb7 PRPL Icons in tooltips
Sean Egan <seanegan@gmail.com>
parents: 15437
diff changeset
2306 #define SMALL_SPACE 6
2dc742344eb7 PRPL Icons in tooltips
Sean Egan <seanegan@gmail.com>
parents: 15437
diff changeset
2307 #define LARGE_SPACE 12
15632
a830f9756f23 Some more pidgininfication
Daniel Atallah <daniel.atallah@gmail.com>
parents: 15615
diff changeset
2308 #define PRPL_SIZE 16
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2309 struct tooltip_data {
15448
a75f1459b578 re-indentation.
Nathan Walp <nwalp@pidgin.im>
parents: 15444
diff changeset
2310 PangoLayout *layout;
15442
2dc742344eb7 PRPL Icons in tooltips
Sean Egan <seanegan@gmail.com>
parents: 15437
diff changeset
2311 PangoLayout *name_layout;
2dc742344eb7 PRPL Icons in tooltips
Sean Egan <seanegan@gmail.com>
parents: 15437
diff changeset
2312 GdkPixbuf *prpl_icon;
15448
a75f1459b578 re-indentation.
Nathan Walp <nwalp@pidgin.im>
parents: 15444
diff changeset
2313 GdkPixbuf *status_icon;
a75f1459b578 re-indentation.
Nathan Walp <nwalp@pidgin.im>
parents: 15444
diff changeset
2314 GdkPixbuf *avatar;
a75f1459b578 re-indentation.
Nathan Walp <nwalp@pidgin.im>
parents: 15444
diff changeset
2315 gboolean avatar_is_prpl_icon;
15442
2dc742344eb7 PRPL Icons in tooltips
Sean Egan <seanegan@gmail.com>
parents: 15437
diff changeset
2316 int avatar_width;
15448
a75f1459b578 re-indentation.
Nathan Walp <nwalp@pidgin.im>
parents: 15444
diff changeset
2317 int avatar_height;
15442
2dc742344eb7 PRPL Icons in tooltips
Sean Egan <seanegan@gmail.com>
parents: 15437
diff changeset
2318 int name_height;
2dc742344eb7 PRPL Icons in tooltips
Sean Egan <seanegan@gmail.com>
parents: 15437
diff changeset
2319 int name_width;
15448
a75f1459b578 re-indentation.
Nathan Walp <nwalp@pidgin.im>
parents: 15444
diff changeset
2320 int width;
a75f1459b578 re-indentation.
Nathan Walp <nwalp@pidgin.im>
parents: 15444
diff changeset
2321 int height;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2322 };
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2323
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
2324 static struct tooltip_data * create_tip_for_node(PurpleBlistNode *node, gboolean full)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2325 {
15448
a75f1459b578 re-indentation.
Nathan Walp <nwalp@pidgin.im>
parents: 15444
diff changeset
2326 char *tooltip_text = NULL;
a75f1459b578 re-indentation.
Nathan Walp <nwalp@pidgin.im>
parents: 15444
diff changeset
2327 struct tooltip_data *td = g_new0(struct tooltip_data, 1);
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
2328 PurpleAccount *account = NULL;
15442
2dc742344eb7 PRPL Icons in tooltips
Sean Egan <seanegan@gmail.com>
parents: 15437
diff changeset
2329 char *tmp, *node_name;
15397
a8ee645e7fb4 A lot of status icon changes:
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2330
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
2331 if(PURPLE_BLIST_NODE_IS_BUDDY(node)) {
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
2332 account = ((PurpleBuddy*)(node))->account;
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
2333 } else if(PURPLE_BLIST_NODE_IS_CHAT(node)) {
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
2334 account = ((PurpleChat*)(node))->account;
15448
a75f1459b578 re-indentation.
Nathan Walp <nwalp@pidgin.im>
parents: 15444
diff changeset
2335 }
a75f1459b578 re-indentation.
Nathan Walp <nwalp@pidgin.im>
parents: 15444
diff changeset
2336
15508
94031a2b0aaa gtkblist changes to pidgin
Sean Egan <seanegan@gmail.com>
parents: 15507
diff changeset
2337 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
2338 td->avatar = pidgin_blist_get_buddy_icon(node, !full, FALSE);
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
2339 td->prpl_icon = pidgin_create_prpl_icon(account, PIDGIN_PRPL_ICON_SMALL);
15821
cebfc6af3eb5 More Gaim to Pidgin stuff
Sean Egan <seanegan@gmail.com>
parents: 15738
diff changeset
2340 tooltip_text = pidgin_get_tooltip_text(node, full);
15448
a75f1459b578 re-indentation.
Nathan Walp <nwalp@pidgin.im>
parents: 15444
diff changeset
2341 td->layout = gtk_widget_create_pango_layout(gtkblist->tipwindow, NULL);
15442
2dc742344eb7 PRPL Icons in tooltips
Sean Egan <seanegan@gmail.com>
parents: 15437
diff changeset
2342 td->name_layout = gtk_widget_create_pango_layout(gtkblist->tipwindow, NULL);
2dc742344eb7 PRPL Icons in tooltips
Sean Egan <seanegan@gmail.com>
parents: 15437
diff changeset
2343
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
2344 if (PURPLE_BLIST_NODE_IS_BUDDY(node))
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
2345 tmp = g_markup_escape_text(purple_buddy_get_name((PurpleBuddy*)node), -1);
15442
2dc742344eb7 PRPL Icons in tooltips
Sean Egan <seanegan@gmail.com>
parents: 15437
diff changeset
2346 else
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
2347 tmp = g_markup_escape_text(purple_chat_get_name((PurpleChat*)node), -1);
15442
2dc742344eb7 PRPL Icons in tooltips
Sean Egan <seanegan@gmail.com>
parents: 15437
diff changeset
2348 node_name = g_strdup_printf("<span size='x-large' weight='bold'>%s</span>", tmp);
15921
6a5089fafd19 Fix a small tooltip-related memleak
Mark Doliner <mark@kingant.net>
parents: 15871
diff changeset
2349 g_free(tmp);
15442
2dc742344eb7 PRPL Icons in tooltips
Sean Egan <seanegan@gmail.com>
parents: 15437
diff changeset
2350
15448
a75f1459b578 re-indentation.
Nathan Walp <nwalp@pidgin.im>
parents: 15444
diff changeset
2351 pango_layout_set_markup(td->layout, tooltip_text, -1);
a75f1459b578 re-indentation.
Nathan Walp <nwalp@pidgin.im>
parents: 15444
diff changeset
2352 pango_layout_set_wrap(td->layout, PANGO_WRAP_WORD);
a75f1459b578 re-indentation.
Nathan Walp <nwalp@pidgin.im>
parents: 15444
diff changeset
2353 pango_layout_set_width(td->layout, 300000);
a75f1459b578 re-indentation.
Nathan Walp <nwalp@pidgin.im>
parents: 15444
diff changeset
2354
15442
2dc742344eb7 PRPL Icons in tooltips
Sean Egan <seanegan@gmail.com>
parents: 15437
diff changeset
2355 pango_layout_get_size (td->layout, &td->width, &td->height);
2dc742344eb7 PRPL Icons in tooltips
Sean Egan <seanegan@gmail.com>
parents: 15437
diff changeset
2356 td->width = PANGO_PIXELS(td->width);
15448
a75f1459b578 re-indentation.
Nathan Walp <nwalp@pidgin.im>
parents: 15444
diff changeset
2357 td->height = PANGO_PIXELS(td->height);
15442
2dc742344eb7 PRPL Icons in tooltips
Sean Egan <seanegan@gmail.com>
parents: 15437
diff changeset
2358
2dc742344eb7 PRPL Icons in tooltips
Sean Egan <seanegan@gmail.com>
parents: 15437
diff changeset
2359 pango_layout_set_markup(td->name_layout, node_name, -1);
2dc742344eb7 PRPL Icons in tooltips
Sean Egan <seanegan@gmail.com>
parents: 15437
diff changeset
2360 pango_layout_set_wrap(td->name_layout, PANGO_WRAP_WORD);
2dc742344eb7 PRPL Icons in tooltips
Sean Egan <seanegan@gmail.com>
parents: 15437
diff changeset
2361 pango_layout_set_width(td->name_layout, 300000);
2dc742344eb7 PRPL Icons in tooltips
Sean Egan <seanegan@gmail.com>
parents: 15437
diff changeset
2362
2dc742344eb7 PRPL Icons in tooltips
Sean Egan <seanegan@gmail.com>
parents: 15437
diff changeset
2363 pango_layout_get_size (td->name_layout, &td->name_width, &td->name_height);
15448
a75f1459b578 re-indentation.
Nathan Walp <nwalp@pidgin.im>
parents: 15444
diff changeset
2364 td->name_width = PANGO_PIXELS(td->name_width) + SMALL_SPACE + PRPL_SIZE;
15442
2dc742344eb7 PRPL Icons in tooltips
Sean Egan <seanegan@gmail.com>
parents: 15437
diff changeset
2365 td->name_height = MAX(PANGO_PIXELS(td->name_height), PRPL_SIZE + SMALL_SPACE);
15475
20cd2ea47648 tooltip tweaks
Sean Egan <seanegan@gmail.com>
parents: 15474
diff changeset
2366 #if 0 /* PRPL Icon as avatar */
15448
a75f1459b578 re-indentation.
Nathan Walp <nwalp@pidgin.im>
parents: 15444
diff changeset
2367 if(!td->avatar && full) {
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
2368 td->avatar = pidgin_create_prpl_icon(account, PIDGIN_PRPL_ICON_LARGE);
15442
2dc742344eb7 PRPL Icons in tooltips
Sean Egan <seanegan@gmail.com>
parents: 15437
diff changeset
2369 td->avatar_is_prpl_icon = TRUE;
2dc742344eb7 PRPL Icons in tooltips
Sean Egan <seanegan@gmail.com>
parents: 15437
diff changeset
2370 }
15475
20cd2ea47648 tooltip tweaks
Sean Egan <seanegan@gmail.com>
parents: 15474
diff changeset
2371 #endif
15708
c50358666110 Fix asserts when there is no buddy icon
Daniel Atallah <daniel.atallah@gmail.com>
parents: 15632
diff changeset
2372
c50358666110 Fix asserts when there is no buddy icon
Daniel Atallah <daniel.atallah@gmail.com>
parents: 15632
diff changeset
2373 if (td->avatar) {
c50358666110 Fix asserts when there is no buddy icon
Daniel Atallah <daniel.atallah@gmail.com>
parents: 15632
diff changeset
2374 td->avatar_width = gdk_pixbuf_get_width(td->avatar);
c50358666110 Fix asserts when there is no buddy icon
Daniel Atallah <daniel.atallah@gmail.com>
parents: 15632
diff changeset
2375 td->avatar_height = gdk_pixbuf_get_height(td->avatar);
c50358666110 Fix asserts when there is no buddy icon
Daniel Atallah <daniel.atallah@gmail.com>
parents: 15632
diff changeset
2376 }
15448
a75f1459b578 re-indentation.
Nathan Walp <nwalp@pidgin.im>
parents: 15444
diff changeset
2377
15489
29e8e230d1b6 A small memory leak in the tooltip.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 15487
diff changeset
2378 g_free(node_name);
15448
a75f1459b578 re-indentation.
Nathan Walp <nwalp@pidgin.im>
parents: 15444
diff changeset
2379 g_free(tooltip_text);
a75f1459b578 re-indentation.
Nathan Walp <nwalp@pidgin.im>
parents: 15444
diff changeset
2380 return td;
15397
a8ee645e7fb4 A lot of status icon changes:
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2381 }
a8ee645e7fb4 A lot of status icon changes:
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2382
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
2383 static void pidgin_blist_paint_tip(GtkWidget *widget, GdkEventExpose *event, PurpleBlistNode *node)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2384 {
15448
a75f1459b578 re-indentation.
Nathan Walp <nwalp@pidgin.im>
parents: 15444
diff changeset
2385 GtkStyle *style;
a75f1459b578 re-indentation.
Nathan Walp <nwalp@pidgin.im>
parents: 15444
diff changeset
2386 int current_height, max_width;
15481
62a1ebd08b74 fix a weird tooltip rendering bug when the second buddy in a contact tooltip
Nathan Walp <nwalp@pidgin.im>
parents: 15480
diff changeset
2387 int max_text_width;
15487
5369a4999f1c fix the display bug a bit smarter
Nathan Walp <nwalp@pidgin.im>
parents: 15486
diff changeset
2388 int max_avatar_width;
15448
a75f1459b578 re-indentation.
Nathan Walp <nwalp@pidgin.im>
parents: 15444
diff changeset
2389 GList *l;
15475
20cd2ea47648 tooltip tweaks
Sean Egan <seanegan@gmail.com>
parents: 15474
diff changeset
2390 int prpl_col = 0;
15583
ad1ddb31202d RTL Tooltips.
Sean Egan <seanegan@gmail.com>
parents: 15560
diff changeset
2391 GtkTextDirection dir = gtk_widget_get_direction(widget);
15632
a830f9756f23 Some more pidgininfication
Daniel Atallah <daniel.atallah@gmail.com>
parents: 15615
diff changeset
2392
15448
a75f1459b578 re-indentation.
Nathan Walp <nwalp@pidgin.im>
parents: 15444
diff changeset
2393 if(gtkblist->tooltipdata == NULL)
a75f1459b578 re-indentation.
Nathan Walp <nwalp@pidgin.im>
parents: 15444
diff changeset
2394 return;
a75f1459b578 re-indentation.
Nathan Walp <nwalp@pidgin.im>
parents: 15444
diff changeset
2395
a75f1459b578 re-indentation.
Nathan Walp <nwalp@pidgin.im>
parents: 15444
diff changeset
2396 style = gtkblist->tipwindow->style;
a75f1459b578 re-indentation.
Nathan Walp <nwalp@pidgin.im>
parents: 15444
diff changeset
2397 gtk_paint_flat_box(style, gtkblist->tipwindow->window, GTK_STATE_NORMAL, GTK_SHADOW_OUT,
a75f1459b578 re-indentation.
Nathan Walp <nwalp@pidgin.im>
parents: 15444
diff changeset
2398 NULL, gtkblist->tipwindow, "tooltip", 0, 0, -1, -1);
a75f1459b578 re-indentation.
Nathan Walp <nwalp@pidgin.im>
parents: 15444
diff changeset
2399
15481
62a1ebd08b74 fix a weird tooltip rendering bug when the second buddy in a contact tooltip
Nathan Walp <nwalp@pidgin.im>
parents: 15480
diff changeset
2400 max_text_width = 0;
15487
5369a4999f1c fix the display bug a bit smarter
Nathan Walp <nwalp@pidgin.im>
parents: 15486
diff changeset
2401 max_avatar_width = 0;
15486
e9a869472b40 really fix that tooltip display glitch
Nathan Walp <nwalp@pidgin.im>
parents: 15485
diff changeset
2402
15448
a75f1459b578 re-indentation.
Nathan Walp <nwalp@pidgin.im>
parents: 15444
diff changeset
2403 for(l = gtkblist->tooltipdata; l; l = l->next)
a75f1459b578 re-indentation.
Nathan Walp <nwalp@pidgin.im>
parents: 15444
diff changeset
2404 {
a75f1459b578 re-indentation.
Nathan Walp <nwalp@pidgin.im>
parents: 15444
diff changeset
2405 struct tooltip_data *td = l->data;
15487
5369a4999f1c fix the display bug a bit smarter
Nathan Walp <nwalp@pidgin.im>
parents: 15486
diff changeset
2406
15481
62a1ebd08b74 fix a weird tooltip rendering bug when the second buddy in a contact tooltip
Nathan Walp <nwalp@pidgin.im>
parents: 15480
diff changeset
2407 max_text_width = MAX(max_text_width,
62a1ebd08b74 fix a weird tooltip rendering bug when the second buddy in a contact tooltip
Nathan Walp <nwalp@pidgin.im>
parents: 15480
diff changeset
2408 MAX(td->width, td->name_width));
15487
5369a4999f1c fix the display bug a bit smarter
Nathan Walp <nwalp@pidgin.im>
parents: 15486
diff changeset
2409 max_avatar_width = MAX(max_avatar_width, td->avatar_width);
5369a4999f1c fix the display bug a bit smarter
Nathan Walp <nwalp@pidgin.im>
parents: 15486
diff changeset
2410 }
5369a4999f1c fix the display bug a bit smarter
Nathan Walp <nwalp@pidgin.im>
parents: 15486
diff changeset
2411
5369a4999f1c fix the display bug a bit smarter
Nathan Walp <nwalp@pidgin.im>
parents: 15486
diff changeset
2412 max_width = TOOLTIP_BORDER + STATUS_SIZE + SMALL_SPACE + max_text_width + SMALL_SPACE + max_avatar_width + TOOLTIP_BORDER;
15583
ad1ddb31202d RTL Tooltips.
Sean Egan <seanegan@gmail.com>
parents: 15560
diff changeset
2413 if (dir == GTK_TEXT_DIR_RTL)
ad1ddb31202d RTL Tooltips.
Sean Egan <seanegan@gmail.com>
parents: 15560
diff changeset
2414 prpl_col = TOOLTIP_BORDER + max_avatar_width + SMALL_SPACE;
ad1ddb31202d RTL Tooltips.
Sean Egan <seanegan@gmail.com>
parents: 15560
diff changeset
2415 else
ad1ddb31202d RTL Tooltips.
Sean Egan <seanegan@gmail.com>
parents: 15560
diff changeset
2416 prpl_col = TOOLTIP_BORDER + STATUS_SIZE + SMALL_SPACE + max_text_width - PRPL_SIZE;
15448
a75f1459b578 re-indentation.
Nathan Walp <nwalp@pidgin.im>
parents: 15444
diff changeset
2417
a75f1459b578 re-indentation.
Nathan Walp <nwalp@pidgin.im>
parents: 15444
diff changeset
2418 current_height = 12;
a75f1459b578 re-indentation.
Nathan Walp <nwalp@pidgin.im>
parents: 15444
diff changeset
2419 for(l = gtkblist->tooltipdata; l; l = l->next)
a75f1459b578 re-indentation.
Nathan Walp <nwalp@pidgin.im>
parents: 15444
diff changeset
2420 {
a75f1459b578 re-indentation.
Nathan Walp <nwalp@pidgin.im>
parents: 15444
diff changeset
2421 struct tooltip_data *td = l->data;
a75f1459b578 re-indentation.
Nathan Walp <nwalp@pidgin.im>
parents: 15444
diff changeset
2422
15507
311315e979f7 gtkutils changes
Sean Egan <seanegan@gmail.com>
parents: 15505
diff changeset
2423 if (td->avatar && pidgin_gdk_pixbuf_is_opaque(td->avatar))
15586
1dfa6945e13f Add some braces to eliminate a compiler warning about an ambiguous else.
Richard Laager <rlaager@wiktel.com>
parents: 15583
diff changeset
2424 {
15583
ad1ddb31202d RTL Tooltips.
Sean Egan <seanegan@gmail.com>
parents: 15560
diff changeset
2425 if (dir == GTK_TEXT_DIR_RTL)
ad1ddb31202d RTL Tooltips.
Sean Egan <seanegan@gmail.com>
parents: 15560
diff changeset
2426 gtk_paint_flat_box(style, gtkblist->tipwindow->window, GTK_STATE_NORMAL, GTK_SHADOW_OUT,
ad1ddb31202d RTL Tooltips.
Sean Egan <seanegan@gmail.com>
parents: 15560
diff changeset
2427 NULL, gtkblist->tipwindow, "tooltip",
ad1ddb31202d RTL Tooltips.
Sean Egan <seanegan@gmail.com>
parents: 15560
diff changeset
2428 TOOLTIP_BORDER -1, current_height -1, td->avatar_width +2, td->avatar_height + 2);
ad1ddb31202d RTL Tooltips.
Sean Egan <seanegan@gmail.com>
parents: 15560
diff changeset
2429 else
ad1ddb31202d RTL Tooltips.
Sean Egan <seanegan@gmail.com>
parents: 15560
diff changeset
2430 gtk_paint_flat_box(style, gtkblist->tipwindow->window, GTK_STATE_NORMAL, GTK_SHADOW_OUT,
ad1ddb31202d RTL Tooltips.
Sean Egan <seanegan@gmail.com>
parents: 15560
diff changeset
2431 NULL, gtkblist->tipwindow, "tooltip",
ad1ddb31202d RTL Tooltips.
Sean Egan <seanegan@gmail.com>
parents: 15560
diff changeset
2432 max_width - (td->avatar_width+ TOOLTIP_BORDER)-1,
ad1ddb31202d RTL Tooltips.
Sean Egan <seanegan@gmail.com>
parents: 15560
diff changeset
2433 current_height-1,td->avatar_width+2, td->avatar_height+2);
15586
1dfa6945e13f Add some braces to eliminate a compiler warning about an ambiguous else.
Richard Laager <rlaager@wiktel.com>
parents: 15583
diff changeset
2434 }
15397
a8ee645e7fb4 A lot of status icon changes:
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2435
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2436 #if GTK_CHECK_VERSION(2,2,0)
15583
ad1ddb31202d RTL Tooltips.
Sean Egan <seanegan@gmail.com>
parents: 15560
diff changeset
2437 if (dir == GTK_TEXT_DIR_RTL)
ad1ddb31202d RTL Tooltips.
Sean Egan <seanegan@gmail.com>
parents: 15560
diff changeset
2438 gdk_draw_pixbuf(GDK_DRAWABLE(gtkblist->tipwindow->window), NULL, td->status_icon,
ad1ddb31202d RTL Tooltips.
Sean Egan <seanegan@gmail.com>
parents: 15560
diff changeset
2439 0, 0, max_width - TOOLTIP_BORDER - STATUS_SIZE, current_height, -1, -1, GDK_RGB_DITHER_NONE, 0, 0);
ad1ddb31202d RTL Tooltips.
Sean Egan <seanegan@gmail.com>
parents: 15560
diff changeset
2440 else
ad1ddb31202d RTL Tooltips.
Sean Egan <seanegan@gmail.com>
parents: 15560
diff changeset
2441 gdk_draw_pixbuf(GDK_DRAWABLE(gtkblist->tipwindow->window), NULL, td->status_icon,
ad1ddb31202d RTL Tooltips.
Sean Egan <seanegan@gmail.com>
parents: 15560
diff changeset
2442 0, 0, TOOLTIP_BORDER, current_height, -1 , -1, GDK_RGB_DITHER_NONE, 0, 0);
15448
a75f1459b578 re-indentation.
Nathan Walp <nwalp@pidgin.im>
parents: 15444
diff changeset
2443 if(td->avatar)
15586
1dfa6945e13f Add some braces to eliminate a compiler warning about an ambiguous else.
Richard Laager <rlaager@wiktel.com>
parents: 15583
diff changeset
2444 {
15583
ad1ddb31202d RTL Tooltips.
Sean Egan <seanegan@gmail.com>
parents: 15560
diff changeset
2445 if (dir == GTK_TEXT_DIR_RTL)
ad1ddb31202d RTL Tooltips.
Sean Egan <seanegan@gmail.com>
parents: 15560
diff changeset
2446 gdk_draw_pixbuf(GDK_DRAWABLE(gtkblist->tipwindow->window), NULL,
ad1ddb31202d RTL Tooltips.
Sean Egan <seanegan@gmail.com>
parents: 15560
diff changeset
2447 td->avatar, 0, 0, TOOLTIP_BORDER, current_height, -1, -1, GDK_RGB_DITHER_NONE, 0, 0);
ad1ddb31202d RTL Tooltips.
Sean Egan <seanegan@gmail.com>
parents: 15560
diff changeset
2448 else
ad1ddb31202d RTL Tooltips.
Sean Egan <seanegan@gmail.com>
parents: 15560
diff changeset
2449 gdk_draw_pixbuf(GDK_DRAWABLE(gtkblist->tipwindow->window), NULL,
ad1ddb31202d RTL Tooltips.
Sean Egan <seanegan@gmail.com>
parents: 15560
diff changeset
2450 td->avatar, 0, 0, max_width - (td->avatar_width + TOOLTIP_BORDER),
ad1ddb31202d RTL Tooltips.
Sean Egan <seanegan@gmail.com>
parents: 15560
diff changeset
2451 current_height, -1 , -1, GDK_RGB_DITHER_NONE, 0, 0);
15586
1dfa6945e13f Add some braces to eliminate a compiler warning about an ambiguous else.
Richard Laager <rlaager@wiktel.com>
parents: 15583
diff changeset
2452 }
1dfa6945e13f Add some braces to eliminate a compiler warning about an ambiguous else.
Richard Laager <rlaager@wiktel.com>
parents: 15583
diff changeset
2453
15448
a75f1459b578 re-indentation.
Nathan Walp <nwalp@pidgin.im>
parents: 15444
diff changeset
2454 if (!td->avatar_is_prpl_icon)
15442
2dc742344eb7 PRPL Icons in tooltips
Sean Egan <seanegan@gmail.com>
parents: 15437
diff changeset
2455 gdk_draw_pixbuf(GDK_DRAWABLE(gtkblist->tipwindow->window), NULL, td->prpl_icon,
15448
a75f1459b578 re-indentation.
Nathan Walp <nwalp@pidgin.im>
parents: 15444
diff changeset
2456 0, 0,
15475
20cd2ea47648 tooltip tweaks
Sean Egan <seanegan@gmail.com>
parents: 15474
diff changeset
2457 prpl_col,
15442
2dc742344eb7 PRPL Icons in tooltips
Sean Egan <seanegan@gmail.com>
parents: 15437
diff changeset
2458 current_height + ((td->name_height / 2) - (PRPL_SIZE / 2)),
15448
a75f1459b578 re-indentation.
Nathan Walp <nwalp@pidgin.im>
parents: 15444
diff changeset
2459 -1 , -1, GDK_RGB_DITHER_NONE, 0, 0);
a75f1459b578 re-indentation.
Nathan Walp <nwalp@pidgin.im>
parents: 15444
diff changeset
2460
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2461 #else
15448
a75f1459b578 re-indentation.
Nathan Walp <nwalp@pidgin.im>
parents: 15444
diff changeset
2462 gdk_pixbuf_render_to_drawable(td->status_icon, GDK_DRAWABLE(gtkblist->tipwindow->window), NULL, 0, 0, 12, current_height, -1, -1, GDK_RGB_DITHER_NONE, 0, 0);
a75f1459b578 re-indentation.
Nathan Walp <nwalp@pidgin.im>
parents: 15444
diff changeset
2463 if(td->avatar)
a75f1459b578 re-indentation.
Nathan Walp <nwalp@pidgin.im>
parents: 15444
diff changeset
2464 gdk_pixbuf_render_to_drawable(td->avatar,
a75f1459b578 re-indentation.
Nathan Walp <nwalp@pidgin.im>
parents: 15444
diff changeset
2465 GDK_DRAWABLE(gtkblist->tipwindow->window), NULL, 0, 0,
15486
e9a869472b40 really fix that tooltip display glitch
Nathan Walp <nwalp@pidgin.im>
parents: 15485
diff changeset
2466 max_width - (td->avatar_width + TOOLTIP_BORDER),
15448
a75f1459b578 re-indentation.
Nathan Walp <nwalp@pidgin.im>
parents: 15444
diff changeset
2467 current_height, -1, -1, GDK_RGB_DITHER_NONE, 0, 0);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2468 #endif
15583
ad1ddb31202d RTL Tooltips.
Sean Egan <seanegan@gmail.com>
parents: 15560
diff changeset
2469 if (dir == GTK_TEXT_DIR_RTL) {
ad1ddb31202d RTL Tooltips.
Sean Egan <seanegan@gmail.com>
parents: 15560
diff changeset
2470 gtk_paint_layout(style, gtkblist->tipwindow->window, GTK_STATE_NORMAL, FALSE,
ad1ddb31202d RTL Tooltips.
Sean Egan <seanegan@gmail.com>
parents: 15560
diff changeset
2471 NULL, gtkblist->tipwindow, "tooltip",
15632
a830f9756f23 Some more pidgininfication
Daniel Atallah <daniel.atallah@gmail.com>
parents: 15615
diff changeset
2472 max_width -(TOOLTIP_BORDER + STATUS_SIZE +SMALL_SPACE) - PANGO_PIXELS(300000),
15583
ad1ddb31202d RTL Tooltips.
Sean Egan <seanegan@gmail.com>
parents: 15560
diff changeset
2473 current_height, td->name_layout);
ad1ddb31202d RTL Tooltips.
Sean Egan <seanegan@gmail.com>
parents: 15560
diff changeset
2474 } else {
ad1ddb31202d RTL Tooltips.
Sean Egan <seanegan@gmail.com>
parents: 15560
diff changeset
2475 gtk_paint_layout (style, gtkblist->tipwindow->window, GTK_STATE_NORMAL, FALSE,
ad1ddb31202d RTL Tooltips.
Sean Egan <seanegan@gmail.com>
parents: 15560
diff changeset
2476 NULL, gtkblist->tipwindow, "tooltip",
ad1ddb31202d RTL Tooltips.
Sean Egan <seanegan@gmail.com>
parents: 15560
diff changeset
2477 TOOLTIP_BORDER + STATUS_SIZE + SMALL_SPACE, current_height, td->name_layout);
ad1ddb31202d RTL Tooltips.
Sean Egan <seanegan@gmail.com>
parents: 15560
diff changeset
2478 }
ad1ddb31202d RTL Tooltips.
Sean Egan <seanegan@gmail.com>
parents: 15560
diff changeset
2479 if (dir != GTK_TEXT_DIR_RTL) {
ad1ddb31202d RTL Tooltips.
Sean Egan <seanegan@gmail.com>
parents: 15560
diff changeset
2480 gtk_paint_layout (style, gtkblist->tipwindow->window, GTK_STATE_NORMAL, FALSE,
ad1ddb31202d RTL Tooltips.
Sean Egan <seanegan@gmail.com>
parents: 15560
diff changeset
2481 NULL, gtkblist->tipwindow, "tooltip",
ad1ddb31202d RTL Tooltips.
Sean Egan <seanegan@gmail.com>
parents: 15560
diff changeset
2482 TOOLTIP_BORDER + STATUS_SIZE + SMALL_SPACE, current_height + td->name_height, td->layout);
ad1ddb31202d RTL Tooltips.
Sean Egan <seanegan@gmail.com>
parents: 15560
diff changeset
2483 } else {
ad1ddb31202d RTL Tooltips.
Sean Egan <seanegan@gmail.com>
parents: 15560
diff changeset
2484 gtk_paint_layout(style, gtkblist->tipwindow->window, GTK_STATE_NORMAL, FALSE,
ad1ddb31202d RTL Tooltips.
Sean Egan <seanegan@gmail.com>
parents: 15560
diff changeset
2485 NULL, gtkblist->tipwindow, "tooltip",
ad1ddb31202d RTL Tooltips.
Sean Egan <seanegan@gmail.com>
parents: 15560
diff changeset
2486 max_width - (TOOLTIP_BORDER + STATUS_SIZE + SMALL_SPACE) - PANGO_PIXELS(300000),
ad1ddb31202d RTL Tooltips.
Sean Egan <seanegan@gmail.com>
parents: 15560
diff changeset
2487 current_height + td->name_height,
ad1ddb31202d RTL Tooltips.
Sean Egan <seanegan@gmail.com>
parents: 15560
diff changeset
2488 td->layout);
ad1ddb31202d RTL Tooltips.
Sean Egan <seanegan@gmail.com>
parents: 15560
diff changeset
2489 }
15480
5551adcf8f97 fix overlapping in tooltips w/ large avatars
Nathan Walp <nwalp@pidgin.im>
parents: 15475
diff changeset
2490
5551adcf8f97 fix overlapping in tooltips w/ large avatars
Nathan Walp <nwalp@pidgin.im>
parents: 15475
diff changeset
2491 current_height += MAX(td->name_height + td->height, td->avatar_height) + TOOLTIP_BORDER;
15448
a75f1459b578 re-indentation.
Nathan Walp <nwalp@pidgin.im>
parents: 15444
diff changeset
2492 }
15397
a8ee645e7fb4 A lot of status icon changes:
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2493 }
a8ee645e7fb4 A lot of status icon changes:
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2494
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2495
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
2496 static void pidgin_blist_tooltip_destroy()
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2497 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2498 while(gtkblist->tooltipdata) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2499 struct tooltip_data *td = gtkblist->tooltipdata->data;
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 if(td->avatar)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2502 g_object_unref(td->avatar);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2503 if(td->status_icon)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2504 g_object_unref(td->status_icon);
15442
2dc742344eb7 PRPL Icons in tooltips
Sean Egan <seanegan@gmail.com>
parents: 15437
diff changeset
2505 if(td->prpl_icon)
2dc742344eb7 PRPL Icons in tooltips
Sean Egan <seanegan@gmail.com>
parents: 15437
diff changeset
2506 g_object_unref(td->prpl_icon);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2507 g_object_unref(td->layout);
15442
2dc742344eb7 PRPL Icons in tooltips
Sean Egan <seanegan@gmail.com>
parents: 15437
diff changeset
2508 g_object_unref(td->name_layout);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2509 g_free(td);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2510 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
2511 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2512
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2513 if (gtkblist->tipwindow == NULL)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2514 return;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2515
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2516 gtk_widget_destroy(gtkblist->tipwindow);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2517 gtkblist->tipwindow = NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2518 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2519
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
2520 static gboolean pidgin_blist_expand_timeout(GtkWidget *tv)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2521 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2522 GtkTreePath *path;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2523 GtkTreeIter iter;
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
2524 PurpleBlistNode *node;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2525 GValue val;
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
2526 struct _pidgin_blist_node *gtknode;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2527
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2528 if (!gtk_tree_view_get_path_at_pos(GTK_TREE_VIEW(tv), gtkblist->tip_rect.x, gtkblist->tip_rect.y, &path, NULL, NULL, NULL))
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2529 return FALSE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2530 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
2531 val.g_type = 0;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2532 gtk_tree_model_get_value (GTK_TREE_MODEL(gtkblist->treemodel), &iter, NODE_COLUMN, &val);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2533 node = g_value_get_pointer(&val);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2534
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
2535 if(!PURPLE_BLIST_NODE_IS_CONTACT(node)) {
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2536 gtk_tree_path_free(path);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2537 return FALSE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2538 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2539
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2540 gtknode = node->ui_data;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2541
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2542 if (!gtknode->contact_expanded) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2543 GtkTreeIter i;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2544
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
2545 pidgin_blist_expand_contact_cb(NULL, node);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2546
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2547 gtk_tree_view_get_cell_area(GTK_TREE_VIEW(tv), path, NULL, &gtkblist->contact_rect);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2548 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
2549 gtkblist->mouseover_contact = node;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2550 gtk_tree_path_down (path);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2551 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
2552 GdkRectangle rect;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2553 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
2554 gtkblist->contact_rect.height += rect.height;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2555 gtk_tree_path_next(path);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2556 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2557 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2558 gtk_tree_path_free(path);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2559 return FALSE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2560 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2561
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
2562 static gboolean buddy_is_displayable(PurpleBuddy *buddy)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2563 {
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
2564 struct _pidgin_blist_node *gtknode;
15374
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 if(!buddy)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2567 return FALSE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2568
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
2569 gtknode = ((PurpleBlistNode*)buddy)->ui_data;
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
2570
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
2571 return (purple_account_is_connected(buddy->account) &&
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
2572 (purple_presence_is_online(buddy->presence) ||
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2573 (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
2574 purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/blist/show_offline_buddies") ||
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
2575 purple_blist_node_get_bool((PurpleBlistNode*)buddy, "show_offline")));
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2576 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2577
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
2578 static gboolean pidgin_blist_tooltip_timeout(GtkWidget *tv)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2579 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2580 GtkTreePath *path;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2581 GtkTreeIter iter;
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
2582 PurpleBlistNode *node;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2583 GValue val;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2584 int scr_w, scr_h, w, h, x, y;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2585 #if GTK_CHECK_VERSION(2,2,0)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2586 int mon_num;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2587 GdkScreen *screen = NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2588 #endif
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2589 gboolean tooltip_top = FALSE;
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
2590 struct _pidgin_blist_node *gtknode;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2591 GdkRectangle mon_size;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2592
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2593 /*
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2594 * Attempt to free the previous tooltip. I have a feeling
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2595 * this is never needed... but just in case.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2596 */
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
2597 pidgin_blist_tooltip_destroy();
15374
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 if (!gtk_tree_view_get_path_at_pos(GTK_TREE_VIEW(tv), gtkblist->tip_rect.x, gtkblist->tip_rect.y, &path, NULL, NULL, NULL))
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2600 return FALSE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2601 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
2602 val.g_type = 0;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2603 gtk_tree_model_get_value (GTK_TREE_MODEL(gtkblist->treemodel), &iter, NODE_COLUMN, &val);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2604 node = g_value_get_pointer(&val);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2605
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2606 gtk_tree_path_free(path);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2607
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2608 gtkblist->tipwindow = gtk_window_new(GTK_WINDOW_POPUP);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2609
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
2610 if(PURPLE_BLIST_NODE_IS_CHAT(node) || PURPLE_BLIST_NODE_IS_BUDDY(node)) {
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2611 struct tooltip_data *td = create_tip_for_node(node, TRUE);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2612 gtkblist->tooltipdata = g_list_append(gtkblist->tooltipdata, td);
15481
62a1ebd08b74 fix a weird tooltip rendering bug when the second buddy in a contact tooltip
Nathan Walp <nwalp@pidgin.im>
parents: 15480
diff changeset
2613 w = TOOLTIP_BORDER + STATUS_SIZE + SMALL_SPACE +
15442
2dc742344eb7 PRPL Icons in tooltips
Sean Egan <seanegan@gmail.com>
parents: 15437
diff changeset
2614 MAX(td->width, td->name_width) + SMALL_SPACE + td->avatar_width + TOOLTIP_BORDER;
16100
5311fcd9fbfb The things that C will allow to compile astound me. Removes an errant apostrophe.
Sean Egan <seanegan@gmail.com>
parents: 16099
diff changeset
2615 h = TOOLTIP_BORDER + MAX(td->height + td->name_height, MAX(STATUS_SIZE, td->avatar_height))
15442
2dc742344eb7 PRPL Icons in tooltips
Sean Egan <seanegan@gmail.com>
parents: 15437
diff changeset
2616 + TOOLTIP_BORDER;
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
2617 } else if(PURPLE_BLIST_NODE_IS_CONTACT(node)) {
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
2618 PurpleBlistNode *child;
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
2619 PurpleBuddy *b = purple_contact_get_priority_buddy((PurpleContact *)node);
15487
5369a4999f1c fix the display bug a bit smarter
Nathan Walp <nwalp@pidgin.im>
parents: 15486
diff changeset
2620 int max_text_width = 0;
5369a4999f1c fix the display bug a bit smarter
Nathan Walp <nwalp@pidgin.im>
parents: 15486
diff changeset
2621 int max_avatar_width = 0;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2622 w = h = 0;
15486
e9a869472b40 really fix that tooltip display glitch
Nathan Walp <nwalp@pidgin.im>
parents: 15485
diff changeset
2623
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2624 for(child = node->child; child; child = child->next)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2625 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
2626 if(PURPLE_BLIST_NODE_IS_BUDDY(child) && buddy_is_displayable((PurpleBuddy*)child)) {
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
2627 struct tooltip_data *td = create_tip_for_node(child, (b == (PurpleBuddy*)child));
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
2628 if (b == (PurpleBuddy *)child) {
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2629 gtkblist->tooltipdata = g_list_prepend(gtkblist->tooltipdata, td);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2630 } else {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2631 gtkblist->tooltipdata = g_list_append(gtkblist->tooltipdata, td);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2632 }
15487
5369a4999f1c fix the display bug a bit smarter
Nathan Walp <nwalp@pidgin.im>
parents: 15486
diff changeset
2633 max_text_width = MAX(max_text_width, MAX(td->width, td->name_width));
5369a4999f1c fix the display bug a bit smarter
Nathan Walp <nwalp@pidgin.im>
parents: 15486
diff changeset
2634 max_avatar_width = MAX(max_avatar_width, td->avatar_width);
16099
8e0a9b2f5a2e Fix ticket #52
Sean Egan <seanegan@gmail.com>
parents: 16092
diff changeset
2635 h += MAX(TOOLTIP_BORDER + MAX(STATUS_SIZE,td->avatar_height),
8e0a9b2f5a2e Fix ticket #52
Sean Egan <seanegan@gmail.com>
parents: 16092
diff changeset
2636 TOOLTIP_BORDER + td->height + td->name_height);
15486
e9a869472b40 really fix that tooltip display glitch
Nathan Walp <nwalp@pidgin.im>
parents: 15485
diff changeset
2637 }
e9a869472b40 really fix that tooltip display glitch
Nathan Walp <nwalp@pidgin.im>
parents: 15485
diff changeset
2638 }
16099
8e0a9b2f5a2e Fix ticket #52
Sean Egan <seanegan@gmail.com>
parents: 16092
diff changeset
2639 h += TOOLTIP_BORDER;
15487
5369a4999f1c fix the display bug a bit smarter
Nathan Walp <nwalp@pidgin.im>
parents: 15486
diff changeset
2640 w = TOOLTIP_BORDER + STATUS_SIZE + SMALL_SPACE + max_text_width + SMALL_SPACE + max_avatar_width + TOOLTIP_BORDER;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2641 } else {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2642 gtk_widget_destroy(gtkblist->tipwindow);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2643 gtkblist->tipwindow = NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2644 return FALSE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2645 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2646
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2647 if (gtkblist->tooltipdata == NULL) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2648 gtk_widget_destroy(gtkblist->tipwindow);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2649 gtkblist->tipwindow = NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2650 return FALSE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2651 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2652
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2653 gtknode = node->ui_data;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2654
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2655 gtk_widget_set_app_paintable(gtkblist->tipwindow, TRUE);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2656 gtk_window_set_resizable(GTK_WINDOW(gtkblist->tipwindow), FALSE);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2657 gtk_widget_set_name(gtkblist->tipwindow, "gtk-tooltips");
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2658 g_signal_connect(G_OBJECT(gtkblist->tipwindow), "expose_event",
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
2659 G_CALLBACK(pidgin_blist_paint_tip), NULL);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2660 gtk_widget_ensure_style (gtkblist->tipwindow);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2661
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2662
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2663 #if GTK_CHECK_VERSION(2,2,0)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2664 gdk_display_get_pointer(gdk_display_get_default(), &screen, &x, &y, NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2665 mon_num = gdk_screen_get_monitor_at_point(screen, x, y);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2666 gdk_screen_get_monitor_geometry(screen, mon_num, &mon_size);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2667
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2668 scr_w = mon_size.width + mon_size.x;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2669 scr_h = mon_size.height + mon_size.y;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2670 #else
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2671 scr_w = gdk_screen_width();
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2672 scr_h = gdk_screen_height();
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2673 gdk_window_get_pointer(NULL, &x, &y, NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2674 mon_size.x = 0;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2675 mon_size.y = 0;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2676 #endif
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2677
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2678 #if GTK_CHECK_VERSION(2,2,0)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2679 if (w > mon_size.width)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2680 w = mon_size.width - 10;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2681
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2682 if (h > mon_size.height)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2683 h = mon_size.height - 10;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2684 #endif
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2685
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2686 if (GTK_WIDGET_NO_WINDOW(gtkblist->window))
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2687 y+=gtkblist->window->allocation.y;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2688
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2689 x -= ((w >> 1) + 4);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2690
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2691 if ((y + h + 4) > scr_h || tooltip_top)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2692 y = y - h - 5;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2693 else
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2694 y = y + 6;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2695
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2696 if (y < mon_size.y)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2697 y = mon_size.y;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2698
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2699 if (y != mon_size.y) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2700 if ((x + w) > scr_w)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2701 x -= (x + w + 5) - scr_w;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2702 else if (x < mon_size.x)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2703 x = mon_size.x;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2704 } else {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2705 x -= (w / 2 + 10);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2706 if (x < mon_size.x)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2707 x = mon_size.x;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2708 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2709
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2710 gtk_widget_set_size_request(gtkblist->tipwindow, w, h);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2711 gtk_window_move(GTK_WINDOW(gtkblist->tipwindow), x, y);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2712 gtk_widget_show(gtkblist->tipwindow);
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 return FALSE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2715 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2716
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
2717 static gboolean pidgin_blist_drag_motion_cb(GtkWidget *tv, GdkDragContext *drag_context,
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2718 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
2719 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2720 GtkTreePath *path;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2721 int delay;
17487
4b711c5c2db8 Only auto-expand buddies when the mouse is hovering over the middle third of the buddy. This prevents un-intended expanding of buddies when you're only trying to re-order. Fixes #608
Sean Egan <seanegan@gmail.com>
parents: 17433
diff changeset
2722 GdkRectangle rect;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2723
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2724 /*
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2725 * 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
2726 * the contact auto-expands.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2727 */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2728 delay = 900;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2729
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2730 if (gtkblist->drag_timeout) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2731 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
2732 return FALSE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2733 /* 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
2734 g_source_remove(gtkblist->drag_timeout);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2735 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2736
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2737 gtk_tree_view_get_path_at_pos(GTK_TREE_VIEW(tv), x, y, &path, NULL, NULL, NULL);
17487
4b711c5c2db8 Only auto-expand buddies when the mouse is hovering over the middle third of the buddy. This prevents un-intended expanding of buddies when you're only trying to re-order. Fixes #608
Sean Egan <seanegan@gmail.com>
parents: 17433
diff changeset
2738 gtk_tree_view_get_cell_area(GTK_TREE_VIEW(tv), path, NULL, &rect);
4b711c5c2db8 Only auto-expand buddies when the mouse is hovering over the middle third of the buddy. This prevents un-intended expanding of buddies when you're only trying to re-order. Fixes #608
Sean Egan <seanegan@gmail.com>
parents: 17433
diff changeset
2739
4b711c5c2db8 Only auto-expand buddies when the mouse is hovering over the middle third of the buddy. This prevents un-intended expanding of buddies when you're only trying to re-order. Fixes #608
Sean Egan <seanegan@gmail.com>
parents: 17433
diff changeset
2740 /* Only autoexpand when in the middle of the cell to avoid annoying un-intended expands */
4b711c5c2db8 Only auto-expand buddies when the mouse is hovering over the middle third of the buddy. This prevents un-intended expanding of buddies when you're only trying to re-order. Fixes #608
Sean Egan <seanegan@gmail.com>
parents: 17433
diff changeset
2741 if (y < rect.y + (rect.height / 3) ||
4b711c5c2db8 Only auto-expand buddies when the mouse is hovering over the middle third of the buddy. This prevents un-intended expanding of buddies when you're only trying to re-order. Fixes #608
Sean Egan <seanegan@gmail.com>
parents: 17433
diff changeset
2742 y > rect.y + (2 * (rect.height /3)))
4b711c5c2db8 Only auto-expand buddies when the mouse is hovering over the middle third of the buddy. This prevents un-intended expanding of buddies when you're only trying to re-order. Fixes #608
Sean Egan <seanegan@gmail.com>
parents: 17433
diff changeset
2743 return FALSE;
4b711c5c2db8 Only auto-expand buddies when the mouse is hovering over the middle third of the buddy. This prevents un-intended expanding of buddies when you're only trying to re-order. Fixes #608
Sean Egan <seanegan@gmail.com>
parents: 17433
diff changeset
2744
4b711c5c2db8 Only auto-expand buddies when the mouse is hovering over the middle third of the buddy. This prevents un-intended expanding of buddies when you're only trying to re-order. Fixes #608
Sean Egan <seanegan@gmail.com>
parents: 17433
diff changeset
2745 rect.height = rect.height / 3;
4b711c5c2db8 Only auto-expand buddies when the mouse is hovering over the middle third of the buddy. This prevents un-intended expanding of buddies when you're only trying to re-order. Fixes #608
Sean Egan <seanegan@gmail.com>
parents: 17433
diff changeset
2746 rect.y += rect.height;
4b711c5c2db8 Only auto-expand buddies when the mouse is hovering over the middle third of the buddy. This prevents un-intended expanding of buddies when you're only trying to re-order. Fixes #608
Sean Egan <seanegan@gmail.com>
parents: 17433
diff changeset
2747
4b711c5c2db8 Only auto-expand buddies when the mouse is hovering over the middle third of the buddy. This prevents un-intended expanding of buddies when you're only trying to re-order. Fixes #608
Sean Egan <seanegan@gmail.com>
parents: 17433
diff changeset
2748 gtkblist->tip_rect = rect;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2749
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2750 if (path)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2751 gtk_tree_path_free(path);
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
2752 gtkblist->drag_timeout = g_timeout_add(delay, (GSourceFunc)pidgin_blist_expand_timeout, tv);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2753
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2754 if (gtkblist->mouseover_contact) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2755 if ((y < gtkblist->contact_rect.y) || ((y - gtkblist->contact_rect.height) > gtkblist->contact_rect.y)) {
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
2756 pidgin_blist_collapse_contact_cb(NULL, gtkblist->mouseover_contact);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2757 gtkblist->mouseover_contact = NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2758 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2759 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2760
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2761 return FALSE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2762 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2763
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
2764 static gboolean pidgin_blist_motion_cb (GtkWidget *tv, GdkEventMotion *event, gpointer null)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2765 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2766 GtkTreePath *path;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2767 int delay;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2768
16062
07554cc5d090 Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <stu@nosnilmot.com>
parents: 16010
diff changeset
2769 delay = purple_prefs_get_int(PIDGIN_PREFS_ROOT "/blist/tooltip_delay");
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2770
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2771 if (delay == 0)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2772 return FALSE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2773
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2774 if (gtkblist->timeout) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2775 if ((event->y > gtkblist->tip_rect.y) && ((event->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
2776 return FALSE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2777 /* We've left the cell. Remove the timeout and create a new one below */
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
2778 pidgin_blist_tooltip_destroy();
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2779 g_source_remove(gtkblist->timeout);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2780 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2781
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2782 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
2783 gtk_tree_view_get_cell_area(GTK_TREE_VIEW(tv), path, NULL, &gtkblist->tip_rect);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2784
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2785 if (path)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2786 gtk_tree_path_free(path);
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
2787 gtkblist->timeout = g_timeout_add(delay, (GSourceFunc)pidgin_blist_tooltip_timeout, tv);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2788
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2789 if (gtkblist->mouseover_contact) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2790 if ((event->y < gtkblist->contact_rect.y) || ((event->y - gtkblist->contact_rect.height) > gtkblist->contact_rect.y)) {
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
2791 pidgin_blist_collapse_contact_cb(NULL, gtkblist->mouseover_contact);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2792 gtkblist->mouseover_contact = NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2793 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2794 }
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 FALSE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2797 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2798
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
2799 static void pidgin_blist_leave_cb (GtkWidget *w, GdkEventCrossing *e, gpointer n)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2800 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2801
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2802 if (gtkblist->timeout) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2803 g_source_remove(gtkblist->timeout);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2804 gtkblist->timeout = 0;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2805 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2806
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2807 if (gtkblist->drag_timeout) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2808 g_source_remove(gtkblist->drag_timeout);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2809 gtkblist->drag_timeout = 0;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2810 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2811
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
2812 pidgin_blist_tooltip_destroy();
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2813
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2814 if (gtkblist->mouseover_contact &&
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2815 !((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
2816 (e->y > gtkblist->contact_rect.y) && (e->y < (gtkblist->contact_rect.y + gtkblist->contact_rect.height)))) {
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
2817 pidgin_blist_collapse_contact_cb(NULL, gtkblist->mouseover_contact);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2818 gtkblist->mouseover_contact = NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2819 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2820 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2821
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2822 static void
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2823 toggle_debug(void)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2824 {
16062
07554cc5d090 Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <stu@nosnilmot.com>
parents: 16010
diff changeset
2825 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
2826 !purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/debug/enabled"));
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2827 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2828
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2829
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2830 /***************************************************
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2831 * Crap *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2832 ***************************************************/
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2833 static GtkItemFactoryEntry blist_menu[] =
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2834 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2835 /* Buddies menu */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2836 { N_("/_Buddies"), NULL, NULL, 0, "<Branch>", NULL },
16202
0973688f4b74 Word on the street is that we don't want things named pidginfoo_bar(), but
Richard Laager <rlaager@wiktel.com>
parents: 16198
diff changeset
2837 { N_("/Buddies/New Instant _Message..."), "<CTL>M", pidgin_dialogs_im, 0, "<StockItem>", PIDGIN_STOCK_TOOLBAR_MESSAGE_NEW },
15553
29a03d2d2395 Remove excess menu item icon clutter, especialy where our icons made no sense. The Redo icon for Buddy Pounces?! Come on.
Sean Egan <seanegan@gmail.com>
parents: 15545
diff changeset
2838 { N_("/Buddies/Join a _Chat..."), "<CTL>C", pidgin_blist_joinchat_show, 0, "<Item>", NULL },
16202
0973688f4b74 Word on the street is that we don't want things named pidginfoo_bar(), but
Richard Laager <rlaager@wiktel.com>
parents: 16198
diff changeset
2839 { N_("/Buddies/Get User _Info..."), "<CTL>I", pidgin_dialogs_info, 0, "<StockItem>", PIDGIN_STOCK_TOOLBAR_USER_INFO },
0973688f4b74 Word on the street is that we don't want things named pidginfoo_bar(), but
Richard Laager <rlaager@wiktel.com>
parents: 16198
diff changeset
2840 { N_("/Buddies/View User _Log..."), "<CTL>L", pidgin_dialogs_log, 0, "<Item>", NULL },
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2841 { "/Buddies/sep1", NULL, NULL, 0, "<Separator>", NULL },
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
2842 { N_("/Buddies/Show _Offline Buddies"), NULL, pidgin_blist_edit_mode_cb, 1, "<CheckItem>", NULL },
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
2843 { N_("/Buddies/Show _Empty Groups"), NULL, pidgin_blist_show_empty_groups_cb, 1, "<CheckItem>", NULL },
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
2844 { N_("/Buddies/Show Buddy _Details"), NULL, pidgin_blist_buddy_details_cb, 1, "<CheckItem>", NULL },
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
2845 { N_("/Buddies/Show Idle _Times"), NULL, pidgin_blist_show_idle_time_cb, 1, "<CheckItem>", NULL },
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2846 { N_("/Buddies/_Sort Buddies"), NULL, NULL, 0, "<Branch>", NULL },
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2847 { "/Buddies/sep2", NULL, NULL, 0, "<Separator>", NULL },
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
2848 { N_("/Buddies/_Add Buddy..."), "<CTL>B", pidgin_blist_add_buddy_cb, 0, "<StockItem>", GTK_STOCK_ADD },
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
2849 { N_("/Buddies/Add C_hat..."), NULL, pidgin_blist_add_chat_cb, 0, "<StockItem>", GTK_STOCK_ADD },
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
2850 { N_("/Buddies/Add _Group..."), NULL, purple_blist_request_add_group, 0, "<StockItem>", GTK_STOCK_ADD },
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2851 { "/Buddies/sep3", NULL, NULL, 0, "<Separator>", NULL },
17431
9e806bf4540b Menu restructure. Kept allow_shrink for now. I want to see what people think of it.
Sean Egan <seanegan@gmail.com>
parents: 17429
diff changeset
2852 { N_("/Buddies/_About Pidgin"), NULL, pidgin_dialogs_about, 0, "<Item>", NULL },
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
2853 { N_("/Buddies/_Quit"), "<CTL>Q", purple_core_quit, 0, "<StockItem>", GTK_STOCK_QUIT },
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2854
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2855 /* Accounts menu */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2856 { N_("/_Accounts"), NULL, NULL, 0, "<Branch>", NULL },
15553
29a03d2d2395 Remove excess menu item icon clutter, especialy where our icons made no sense. The Redo icon for Buddy Pounces?! Come on.
Sean Egan <seanegan@gmail.com>
parents: 15545
diff changeset
2857 { N_("/Accounts/Add\\/Edit"), "<CTL>A", pidgin_accounts_window_show, 0, "<Item>", NULL },
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2858
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2859 /* Tools */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2860 { N_("/_Tools"), NULL, NULL, 0, "<Branch>", NULL },
15553
29a03d2d2395 Remove excess menu item icon clutter, especialy where our icons made no sense. The Redo icon for Buddy Pounces?! Come on.
Sean Egan <seanegan@gmail.com>
parents: 15545
diff changeset
2861 { N_("/Tools/Buddy _Pounces"), NULL, pidgin_pounces_manager_show, 0, "<Item>", NULL },
15560
442128853bdb toolbar/menu icons. reduce the imhtmltoolbar spacing. more gaimstock pruning
Sean Egan <seanegan@gmail.com>
parents: 15559
diff changeset
2862 { N_("/Tools/Plu_gins"), "<CTL>U", pidgin_plugin_dialog_show, 0, "<StockItem>", PIDGIN_STOCK_TOOLBAR_PLUGINS },
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
2863 { N_("/Tools/Pr_eferences"), "<CTL>P", pidgin_prefs_show, 0, "<StockItem>", GTK_STOCK_PREFERENCES },
15553
29a03d2d2395 Remove excess menu item icon clutter, especialy where our icons made no sense. The Redo icon for Buddy Pounces?! Come on.
Sean Egan <seanegan@gmail.com>
parents: 15545
diff changeset
2864 { N_("/Tools/Pr_ivacy"), NULL, pidgin_privacy_dialog_show, 0, "<Item>", NULL },
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2865 { "/Tools/sep2", NULL, NULL, 0, "<Separator>", NULL },
16202
0973688f4b74 Word on the street is that we don't want things named pidginfoo_bar(), but
Richard Laager <rlaager@wiktel.com>
parents: 16198
diff changeset
2866 { N_("/Tools/_File Transfers"), "<CTL>T", pidgin_xfer_dialog_show, 0, "<Item>", NULL },
15553
29a03d2d2395 Remove excess menu item icon clutter, especialy where our icons made no sense. The Redo icon for Buddy Pounces?! Come on.
Sean Egan <seanegan@gmail.com>
parents: 15545
diff changeset
2867 { N_("/Tools/R_oom List"), NULL, pidgin_roomlist_dialog_show, 0, "<Item>", NULL },
29a03d2d2395 Remove excess menu item icon clutter, especialy where our icons made no sense. The Redo icon for Buddy Pounces?! Come on.
Sean Egan <seanegan@gmail.com>
parents: 15545
diff changeset
2868 { N_("/Tools/System _Log"), NULL, gtk_blist_show_systemlog_cb, 0, "<Item>", NULL },
17431
9e806bf4540b Menu restructure. Kept allow_shrink for now. I want to see what people think of it.
Sean Egan <seanegan@gmail.com>
parents: 17429
diff changeset
2869 { N_("/Tools/_Debug Window"), NULL, toggle_debug, 0, "<Item>", NULL },
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2870 { "/Tools/sep3", NULL, NULL, 0, "<Separator>", NULL },
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
2871 { N_("/Tools/Mute _Sounds"), "<CTL>S", pidgin_blist_mute_sounds_cb, 0, "<CheckItem>", NULL },
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2872 };
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2873
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2874 /*********************************************************
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2875 * Private Utility functions *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2876 *********************************************************/
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2877
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
2878 static char *pidgin_get_tooltip_text(PurpleBlistNode *node, gboolean full)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2879 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2880 GString *str = g_string_new("");
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
2881 PurplePlugin *prpl;
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
2882 PurplePluginProtocolInfo *prpl_info = NULL;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2883 char *tmp;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2884
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
2885 if (PURPLE_BLIST_NODE_IS_CHAT(node))
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2886 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
2887 PurpleChat *chat;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2888 GList *cur;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2889 struct proto_chat_entry *pce;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2890 char *name, *value;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2891
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
2892 chat = (PurpleChat *)node;
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
2893 prpl = purple_find_prpl(purple_account_get_protocol_id(chat->account));
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
2894 prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(prpl);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
2895
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
2896 if (g_list_length(purple_connections_get_all()) > 1)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2897 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2898 tmp = g_markup_escape_text(chat->account->username, -1);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2899 g_string_append_printf(str, _("\n<b>Account:</b> %s"), tmp);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2900 g_free(tmp);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2901 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2902
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2903 if (prpl_info->chat_info != NULL)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2904 cur = prpl_info->chat_info(chat->account->gc);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2905 else
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2906 cur = NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2907
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2908 while (cur != NULL)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2909 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2910 pce = cur->data;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2911
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2912 if (!pce->secret && (!pce->required &&
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2913 g_hash_table_lookup(chat->components, pce->identifier) == NULL))
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2914 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
2915 tmp = purple_text_strip_mnemonic(pce->label);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2916 name = g_markup_escape_text(tmp, -1);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2917 g_free(tmp);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2918 value = g_markup_escape_text(g_hash_table_lookup(
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2919 chat->components, pce->identifier), -1);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2920 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
2921 name ? name : "",
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2922 value ? value : "");
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2923 g_free(name);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2924 g_free(value);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2925 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2926
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2927 g_free(pce);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2928 cur = g_list_remove(cur, pce);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2929 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2930 }
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
2931 else if (PURPLE_BLIST_NODE_IS_CONTACT(node) || PURPLE_BLIST_NODE_IS_BUDDY(node))
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2932 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2933 /* 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
2934 * 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
2935 */
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
2936 PurpleContact *c;
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
2937 PurpleBuddy *b;
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
2938 PurplePresence *presence;
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
2939 PurpleNotifyUserInfo *user_info;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2940 char *tmp;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2941 time_t idle_secs, signon;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2942
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
2943 if (PURPLE_BLIST_NODE_IS_CONTACT(node))
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2944 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
2945 c = (PurpleContact *)node;
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
2946 b = purple_contact_get_priority_buddy(c);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2947 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2948 else
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2949 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
2950 b = (PurpleBuddy *)node;
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
2951 c = purple_buddy_get_contact(b);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2952 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2953
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
2954 prpl = purple_find_prpl(purple_account_get_protocol_id(b->account));
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
2955 prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(prpl);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
2956
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
2957 presence = purple_buddy_get_presence(b);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
2958 user_info = purple_notify_user_info_new();
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2959
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2960 /* Account */
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
2961 if (full && g_list_length(purple_connections_get_all()) > 1)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2962 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
2963 tmp = g_markup_escape_text(purple_account_get_username(
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
2964 purple_buddy_get_account(b)), -1);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
2965 purple_notify_user_info_add_pair(user_info, _("Account"), tmp);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2966 g_free(tmp);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2967 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2968
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2969 /* Alias */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2970 /* 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
2971 * this alias, so there's no point in showing it in the tooltip. */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2972 if (full && b->alias != NULL && b->alias[0] != '\0' &&
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2973 (c->alias != NULL && c->alias[0] != '\0') &&
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2974 strcmp(c->alias, b->alias) != 0)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2975 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2976 tmp = g_markup_escape_text(b->alias, -1);
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
2977 purple_notify_user_info_add_pair(user_info, _("Buddy Alias"), tmp);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2978 g_free(tmp);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2979 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2980
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2981 /* Nickname/Server Alias */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2982 /* 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
2983 * 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
2984 * 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
2985 * to look at the tooltip. */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2986 if (full && b->server_alias != NULL && b->server_alias[0] != '\0')
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2987 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2988 tmp = g_markup_escape_text(b->server_alias, -1);
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
2989 purple_notify_user_info_add_pair(user_info, _("Nickname"), tmp);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2990 g_free(tmp);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2991 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2992
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2993 /* Logged In */
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
2994 signon = purple_presence_get_login_time(presence);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
2995 if (full && PURPLE_BUDDY_IS_ONLINE(b) && signon > 0)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2996 {
17834
18b62b0fc253 Get outta my house. This adds a failsafe for the "Logged In"
Mark Doliner <mark@kingant.net>
parents: 17789
diff changeset
2997 if (time(NULL) - signon > 63072000 /* 2 years */) {
18b62b0fc253 Get outta my house. This adds a failsafe for the "Logged In"
Mark Doliner <mark@kingant.net>
parents: 17789
diff changeset
2998 /*
18b62b0fc253 Get outta my house. This adds a failsafe for the "Logged In"
Mark Doliner <mark@kingant.net>
parents: 17789
diff changeset
2999 * Our local clock must be wrong, show the actual
18b62b0fc253 Get outta my house. This adds a failsafe for the "Logged In"
Mark Doliner <mark@kingant.net>
parents: 17789
diff changeset
3000 * date instead of "4 days", etc.
18b62b0fc253 Get outta my house. This adds a failsafe for the "Logged In"
Mark Doliner <mark@kingant.net>
parents: 17789
diff changeset
3001 */
18b62b0fc253 Get outta my house. This adds a failsafe for the "Logged In"
Mark Doliner <mark@kingant.net>
parents: 17789
diff changeset
3002 tmp = g_strdup(purple_date_format_long(localtime(&signon)));
18b62b0fc253 Get outta my house. This adds a failsafe for the "Logged In"
Mark Doliner <mark@kingant.net>
parents: 17789
diff changeset
3003 } else
18b62b0fc253 Get outta my house. This adds a failsafe for the "Logged In"
Mark Doliner <mark@kingant.net>
parents: 17789
diff changeset
3004 tmp = purple_str_seconds_to_string(time(NULL) - signon);
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
3005 purple_notify_user_info_add_pair(user_info, _("Logged In"), tmp);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3006 g_free(tmp);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3007 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3008
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3009 /* Idle */
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
3010 if (purple_presence_is_idle(presence))
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3011 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
3012 idle_secs = purple_presence_get_idle_time(presence);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3013 if (idle_secs > 0)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3014 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
3015 tmp = purple_str_seconds_to_string(time(NULL) - idle_secs);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
3016 purple_notify_user_info_add_pair(user_info, _("Idle"), tmp);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3017 g_free(tmp);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3018 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3019 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3020
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3021 /* Last Seen */
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
3022 if (full && !PURPLE_BUDDY_IS_ONLINE(b))
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3023 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
3024 struct _pidgin_blist_node *gtknode = ((PurpleBlistNode *)c)->ui_data;
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
3025 PurpleBlistNode *bnode;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3026 int lastseen = 0;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3027
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
3028 if (!gtknode->contact_expanded || PURPLE_BLIST_NODE_IS_CONTACT(node))
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3029 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3030 /* 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
3031 * 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
3032 * (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
3033 * the contact. */
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
3034 for (bnode = ((PurpleBlistNode *)c)->child ; bnode != NULL ; bnode = bnode->next)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3035 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
3036 int value = purple_blist_node_get_int(bnode, "last_seen");
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3037 if (value > lastseen)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3038 lastseen = value;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3039 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3040 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3041 else
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3042 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3043 /* 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
3044 * so we show the last_seen time for the buddy. */
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
3045 lastseen = purple_blist_node_get_int(&b->node, "last_seen");
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3046 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3047
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3048 if (lastseen > 0)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3049 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
3050 tmp = purple_str_seconds_to_string(time(NULL) - lastseen);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
3051 purple_notify_user_info_add_pair(user_info, _("Last Seen"), tmp);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3052 g_free(tmp);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3053 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3054 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3055
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3056
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3057 /* Offline? */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3058 /* FIXME: Why is this status special-cased by the core? -- rlaager */
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
3059 if (!PURPLE_BUDDY_IS_ONLINE(b)) {
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
3060 purple_notify_user_info_add_pair(user_info, _("Status"), _("Offline"));
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3061 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3062
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3063 if (prpl_info && prpl_info->tooltip_text)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3064 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3065 /* Additional text from the PRPL */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3066 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
3067 }
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 /* These are Easter Eggs. Patches to remove them will be rejected. */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3070 if (!g_ascii_strcasecmp(b->name, "robflynn"))
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
3071 purple_notify_user_info_add_pair(user_info, _("Description"), _("Spooky"));
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3072 if (!g_ascii_strcasecmp(b->name, "seanegn"))
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
3073 purple_notify_user_info_add_pair(user_info, _("Status"), _("Awesome"));
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3074 if (!g_ascii_strcasecmp(b->name, "chipx86"))
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
3075 purple_notify_user_info_add_pair(user_info, _("Status"), _("Rockin'"));
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
3076
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
3077 tmp = purple_notify_user_info_get_text_with_newline(user_info, "\n");
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3078 g_string_append(str, tmp);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3079 g_free(tmp);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3080
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
3081 purple_notify_user_info_destroy(user_info);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
3082 }
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
3083
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
3084 purple_signal_emit(pidgin_blist_get_handle(),
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3085 "drawing-tooltip", node, str, full);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3086
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3087 return g_string_free(str, FALSE);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3088 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3089
15463
0b6f337a46d5 Emblems in the blist
Sean Egan <seanegan@gmail.com>
parents: 15448
diff changeset
3090 GdkPixbuf *
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
3091 pidgin_blist_get_emblem(PurpleBlistNode *node)
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
3092 {
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
3093 PurpleBuddy *buddy = NULL;
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
3094 struct _pidgin_blist_node *gtknode = node->ui_data;
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
3095 struct _pidgin_blist_node *gtkbuddynode = NULL;
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
3096 PurplePlugin *prpl;
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
3097 PurplePluginProtocolInfo *prpl_info;
15463
0b6f337a46d5 Emblems in the blist
Sean Egan <seanegan@gmail.com>
parents: 15448
diff changeset
3098 const char *name = NULL;
0b6f337a46d5 Emblems in the blist
Sean Egan <seanegan@gmail.com>
parents: 15448
diff changeset
3099 char *filename, *path;
0b6f337a46d5 Emblems in the blist
Sean Egan <seanegan@gmail.com>
parents: 15448
diff changeset
3100 GdkPixbuf *ret;
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
3101 PurplePresence *p;
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
3102
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
3103
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
3104
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
3105 if(PURPLE_BLIST_NODE_IS_CONTACT(node)) {
15463
0b6f337a46d5 Emblems in the blist
Sean Egan <seanegan@gmail.com>
parents: 15448
diff changeset
3106 if(!gtknode->contact_expanded) {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
3107 buddy = purple_contact_get_priority_buddy((PurpleContact*)node);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
3108 gtkbuddynode = ((PurpleBlistNode*)buddy)->ui_data;
15463
0b6f337a46d5 Emblems in the blist
Sean Egan <seanegan@gmail.com>
parents: 15448
diff changeset
3109 }
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
3110 } else if(PURPLE_BLIST_NODE_IS_BUDDY(node)) {
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
3111 buddy = (PurpleBuddy*)node;
15463
0b6f337a46d5 Emblems in the blist
Sean Egan <seanegan@gmail.com>
parents: 15448
diff changeset
3112 gtkbuddynode = node->ui_data;
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
3113 if (((struct _pidgin_blist_node*)(node->parent->ui_data))->contact_expanded)
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
3114 return pidgin_create_prpl_icon(((PurpleBuddy*)node)->account, PIDGIN_PRPL_ICON_SMALL);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
3115 } else if(PURPLE_BLIST_NODE_IS_CHAT(node)) {
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
3116 return pidgin_create_prpl_icon(((PurpleChat*)node)->account, PIDGIN_PRPL_ICON_SMALL);
15463
0b6f337a46d5 Emblems in the blist
Sean Egan <seanegan@gmail.com>
parents: 15448
diff changeset
3117 } else {
0b6f337a46d5 Emblems in the blist
Sean Egan <seanegan@gmail.com>
parents: 15448
diff changeset
3118 return NULL;
0b6f337a46d5 Emblems in the blist
Sean Egan <seanegan@gmail.com>
parents: 15448
diff changeset
3119 }
15632
a830f9756f23 Some more pidgininfication
Daniel Atallah <daniel.atallah@gmail.com>
parents: 15615
diff changeset
3120
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
3121 if (!purple_privacy_check(buddy->account, purple_buddy_get_name(buddy))) {
15500
45ecefd0ce3a Blocked emblem
Sean Egan <seanegan@gmail.com>
parents: 15497
diff changeset
3122 path = g_build_filename(DATADIR, "pixmaps", "pidgin", "emblems", "16", "blocked.png", NULL);
15524
84b3ab83df35 Use the status API to handle mobileness, and convert AIM to use it. This makes mobile buddies prioritze lower in Perons, and ensures the UI is notified of changes in mobileness. Other protocols to follow.
Sean Egan <seanegan@gmail.com>
parents: 15514
diff changeset
3123 ret = gdk_pixbuf_new_from_file(path, NULL);
84b3ab83df35 Use the status API to handle mobileness, and convert AIM to use it. This makes mobile buddies prioritze lower in Perons, and ensures the UI is notified of changes in mobileness. Other protocols to follow.
Sean Egan <seanegan@gmail.com>
parents: 15514
diff changeset
3124 g_free(path);
84b3ab83df35 Use the status API to handle mobileness, and convert AIM to use it. This makes mobile buddies prioritze lower in Perons, and ensures the UI is notified of changes in mobileness. Other protocols to follow.
Sean Egan <seanegan@gmail.com>
parents: 15514
diff changeset
3125 return ret;
84b3ab83df35 Use the status API to handle mobileness, and convert AIM to use it. This makes mobile buddies prioritze lower in Perons, and ensures the UI is notified of changes in mobileness. Other protocols to follow.
Sean Egan <seanegan@gmail.com>
parents: 15514
diff changeset
3126 }
15632
a830f9756f23 Some more pidgininfication
Daniel Atallah <daniel.atallah@gmail.com>
parents: 15615
diff changeset
3127
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
3128 p = purple_buddy_get_presence(buddy);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
3129 if (purple_presence_is_status_primitive_active(p, PURPLE_STATUS_MOBILE)) {
15524
84b3ab83df35 Use the status API to handle mobileness, and convert AIM to use it. This makes mobile buddies prioritze lower in Perons, and ensures the UI is notified of changes in mobileness. Other protocols to follow.
Sean Egan <seanegan@gmail.com>
parents: 15514
diff changeset
3130 path = g_build_filename(DATADIR, "pixmaps", "pidgin", "emblems", "16", "mobile.png", NULL);
84b3ab83df35 Use the status API to handle mobileness, and convert AIM to use it. This makes mobile buddies prioritze lower in Perons, and ensures the UI is notified of changes in mobileness. Other protocols to follow.
Sean Egan <seanegan@gmail.com>
parents: 15514
diff changeset
3131 ret = gdk_pixbuf_new_from_file(path, NULL);
84b3ab83df35 Use the status API to handle mobileness, and convert AIM to use it. This makes mobile buddies prioritze lower in Perons, and ensures the UI is notified of changes in mobileness. Other protocols to follow.
Sean Egan <seanegan@gmail.com>
parents: 15514
diff changeset
3132 g_free(path);
15632
a830f9756f23 Some more pidgininfication
Daniel Atallah <daniel.atallah@gmail.com>
parents: 15615
diff changeset
3133 return ret;
15500
45ecefd0ce3a Blocked emblem
Sean Egan <seanegan@gmail.com>
parents: 15497
diff changeset
3134 }
15463
0b6f337a46d5 Emblems in the blist
Sean Egan <seanegan@gmail.com>
parents: 15448
diff changeset
3135
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
3136 prpl = purple_find_prpl(purple_account_get_protocol_id(buddy->account));
15463
0b6f337a46d5 Emblems in the blist
Sean Egan <seanegan@gmail.com>
parents: 15448
diff changeset
3137 if (!prpl)
0b6f337a46d5 Emblems in the blist
Sean Egan <seanegan@gmail.com>
parents: 15448
diff changeset
3138 return NULL;
0b6f337a46d5 Emblems in the blist
Sean Egan <seanegan@gmail.com>
parents: 15448
diff changeset
3139
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
3140 prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(prpl);
15463
0b6f337a46d5 Emblems in the blist
Sean Egan <seanegan@gmail.com>
parents: 15448
diff changeset
3141 if (prpl_info && prpl_info->list_emblem)
0b6f337a46d5 Emblems in the blist
Sean Egan <seanegan@gmail.com>
parents: 15448
diff changeset
3142 name = prpl_info->list_emblem(buddy);
0b6f337a46d5 Emblems in the blist
Sean Egan <seanegan@gmail.com>
parents: 15448
diff changeset
3143
0b6f337a46d5 Emblems in the blist
Sean Egan <seanegan@gmail.com>
parents: 15448
diff changeset
3144 if (name == NULL)
0b6f337a46d5 Emblems in the blist
Sean Egan <seanegan@gmail.com>
parents: 15448
diff changeset
3145 return NULL;
0b6f337a46d5 Emblems in the blist
Sean Egan <seanegan@gmail.com>
parents: 15448
diff changeset
3146
0b6f337a46d5 Emblems in the blist
Sean Egan <seanegan@gmail.com>
parents: 15448
diff changeset
3147 filename = g_strdup_printf("%s.png", name);
0b6f337a46d5 Emblems in the blist
Sean Egan <seanegan@gmail.com>
parents: 15448
diff changeset
3148
0b6f337a46d5 Emblems in the blist
Sean Egan <seanegan@gmail.com>
parents: 15448
diff changeset
3149 path = g_build_filename(DATADIR, "pixmaps", "pidgin", "emblems", "16", filename, NULL);
0b6f337a46d5 Emblems in the blist
Sean Egan <seanegan@gmail.com>
parents: 15448
diff changeset
3150 ret = gdk_pixbuf_new_from_file(path, NULL);
15632
a830f9756f23 Some more pidgininfication
Daniel Atallah <daniel.atallah@gmail.com>
parents: 15615
diff changeset
3151
15463
0b6f337a46d5 Emblems in the blist
Sean Egan <seanegan@gmail.com>
parents: 15448
diff changeset
3152 g_free(filename);
0b6f337a46d5 Emblems in the blist
Sean Egan <seanegan@gmail.com>
parents: 15448
diff changeset
3153 g_free(path);
0b6f337a46d5 Emblems in the blist
Sean Egan <seanegan@gmail.com>
parents: 15448
diff changeset
3154
0b6f337a46d5 Emblems in the blist
Sean Egan <seanegan@gmail.com>
parents: 15448
diff changeset
3155 return ret;
0b6f337a46d5 Emblems in the blist
Sean Egan <seanegan@gmail.com>
parents: 15448
diff changeset
3156 }
0b6f337a46d5 Emblems in the blist
Sean Egan <seanegan@gmail.com>
parents: 15448
diff changeset
3157
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3158
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3159 GdkPixbuf *
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
3160 pidgin_blist_get_status_icon(PurpleBlistNode *node, PidginStatusIconSize size)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3161 {
15397
a8ee645e7fb4 A lot of status icon changes:
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
3162 GdkPixbuf *ret;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3163 const char *protoname = NULL;
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
3164 struct _pidgin_blist_node *gtknode = node->ui_data;
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
3165 struct _pidgin_blist_node *gtkbuddynode = NULL;
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
3166 PurpleBuddy *buddy = NULL;
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
3167 PurpleChat *chat = NULL;
15545
82e3cff11243 Perhaps a 22px icon is better in the tooltip
Sean Egan <seanegan@gmail.com>
parents: 15524
diff changeset
3168 GtkIconSize icon_size = gtk_icon_size_from_name((size == PIDGIN_STATUS_ICON_LARGE) ? PIDGIN_ICON_SIZE_TANGO_SMALL :
15436
9c0cf4db1f4d Dialog icon changes
Sean Egan <seanegan@gmail.com>
parents: 15435
diff changeset
3169 PIDGIN_ICON_SIZE_TANGO_EXTRA_SMALL);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3170
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
3171 if(PURPLE_BLIST_NODE_IS_CONTACT(node)) {
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3172 if(!gtknode->contact_expanded) {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
3173 buddy = purple_contact_get_priority_buddy((PurpleContact*)node);
17042
777cdaa3b904 This is what I actually intended to commit in 105009e066f1bcaefb0af3bd1e17b7860bf12a57. The rest of the mess being pushed is me trying to clean up my mess.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 17038
diff changeset
3174 if (buddy != NULL)
777cdaa3b904 This is what I actually intended to commit in 105009e066f1bcaefb0af3bd1e17b7860bf12a57. The rest of the mess being pushed is me trying to clean up my mess.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 17038
diff changeset
3175 gtkbuddynode = ((PurpleBlistNode*)buddy)->ui_data;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3176 }
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
3177 } else if(PURPLE_BLIST_NODE_IS_BUDDY(node)) {
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
3178 buddy = (PurpleBuddy*)node;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3179 gtkbuddynode = node->ui_data;
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
3180 } else if(PURPLE_BLIST_NODE_IS_CHAT(node)) {
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
3181 chat = (PurpleChat*)node;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3182 } else {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3183 return NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3184 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3185
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3186 if(buddy || chat) {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
3187 PurpleAccount *account;
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
3188 PurplePlugin *prpl;
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
3189 PurplePluginProtocolInfo *prpl_info;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3190
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3191 if(buddy)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3192 account = buddy->account;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3193 else
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3194 account = chat->account;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3195
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
3196 prpl = purple_find_prpl(purple_account_get_protocol_id(account));
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3197 if(!prpl)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3198 return NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3199
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
3200 prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(prpl);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3201
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3202 if(prpl_info && prpl_info->list_icon) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3203 protoname = prpl_info->list_icon(account, buddy);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3204 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3205 }
15632
a830f9756f23 Some more pidgininfication
Daniel Atallah <daniel.atallah@gmail.com>
parents: 15615
diff changeset
3206
15397
a8ee645e7fb4 A lot of status icon changes:
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
3207 if(buddy) {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
3208 PurpleConversation *conv = purple_find_conversation_with_account(PURPLE_CONV_TYPE_IM,
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
3209 purple_buddy_get_name(buddy),
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
3210 purple_buddy_get_account(buddy));
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
3211 PurplePresence *p;
15497
74efe677c8a5 Restore 'hidden convo' status icon in blist. Additionally, make the name text bold when you have a hidden convo
Sean Egan <seanegan@gmail.com>
parents: 15493
diff changeset
3212 if(conv != NULL) {
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
3213 PidginConversation *gtkconv = PIDGIN_CONVERSATION(conv);
15508
94031a2b0aaa gtkblist changes to pidgin
Sean Egan <seanegan@gmail.com>
parents: 15507
diff changeset
3214 if(gtkconv != NULL && pidgin_conv_is_hidden(gtkconv) && size == PIDGIN_STATUS_ICON_SMALL) {
15497
74efe677c8a5 Restore 'hidden convo' status icon in blist. Additionally, make the name text bold when you have a hidden convo
Sean Egan <seanegan@gmail.com>
parents: 15493
diff changeset
3215 return gtk_widget_render_icon (GTK_WIDGET(gtkblist->treeview), PIDGIN_STOCK_STATUS_MESSAGE,
74efe677c8a5 Restore 'hidden convo' status icon in blist. Additionally, make the name text bold when you have a hidden convo
Sean Egan <seanegan@gmail.com>
parents: 15493
diff changeset
3216 icon_size, "GtkTreeView");
74efe677c8a5 Restore 'hidden convo' status icon in blist. Additionally, make the name text bold when you have a hidden convo
Sean Egan <seanegan@gmail.com>
parents: 15493
diff changeset
3217 }
74efe677c8a5 Restore 'hidden convo' status icon in blist. Additionally, make the name text bold when you have a hidden convo
Sean Egan <seanegan@gmail.com>
parents: 15493
diff changeset
3218 }
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
3219 p = purple_buddy_get_presence(buddy);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
3220
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
3221 if (PURPLE_BUDDY_IS_ONLINE(buddy) && gtkbuddynode && gtkbuddynode->recent_signonoff)
15448
a75f1459b578 re-indentation.
Nathan Walp <nwalp@pidgin.im>
parents: 15444
diff changeset
3222 ret = gtk_widget_render_icon (GTK_WIDGET(gtkblist->treeview), PIDGIN_STOCK_STATUS_LOGIN,
a75f1459b578 re-indentation.
Nathan Walp <nwalp@pidgin.im>
parents: 15444
diff changeset
3223 icon_size, "GtkTreeView");
a75f1459b578 re-indentation.
Nathan Walp <nwalp@pidgin.im>
parents: 15444
diff changeset
3224 else if (gtkbuddynode && gtkbuddynode->recent_signonoff)
a75f1459b578 re-indentation.
Nathan Walp <nwalp@pidgin.im>
parents: 15444
diff changeset
3225 ret = gtk_widget_render_icon (GTK_WIDGET(gtkblist->treeview), PIDGIN_STOCK_STATUS_LOGOUT,
a75f1459b578 re-indentation.
Nathan Walp <nwalp@pidgin.im>
parents: 15444
diff changeset
3226 icon_size, "GtkTreeView");
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
3227 else if (purple_presence_is_status_primitive_active(p, PURPLE_STATUS_UNAVAILABLE))
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
3228 if (purple_presence_is_idle(p) && size == PIDGIN_STATUS_ICON_SMALL)
15493
fd4afe8bb584 Faded idle status icons
Sean Egan <seanegan@gmail.com>
parents: 15491
diff changeset
3229 ret = gtk_widget_render_icon (GTK_WIDGET(gtkblist->treeview), PIDGIN_STOCK_STATUS_BUSY_I,
fd4afe8bb584 Faded idle status icons
Sean Egan <seanegan@gmail.com>
parents: 15491
diff changeset
3230 icon_size, "GtkTreeView");
fd4afe8bb584 Faded idle status icons
Sean Egan <seanegan@gmail.com>
parents: 15491
diff changeset
3231 else
fd4afe8bb584 Faded idle status icons
Sean Egan <seanegan@gmail.com>
parents: 15491
diff changeset
3232 ret = gtk_widget_render_icon (GTK_WIDGET(gtkblist->treeview), PIDGIN_STOCK_STATUS_BUSY,
fd4afe8bb584 Faded idle status icons
Sean Egan <seanegan@gmail.com>
parents: 15491
diff changeset
3233 icon_size, "GtkTreeView");
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
3234 else if (purple_presence_is_status_primitive_active(p, PURPLE_STATUS_AWAY))
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
3235 if (purple_presence_is_idle(p) && size == PIDGIN_STATUS_ICON_SMALL)
15493
fd4afe8bb584 Faded idle status icons
Sean Egan <seanegan@gmail.com>
parents: 15491
diff changeset
3236 ret = gtk_widget_render_icon (GTK_WIDGET(gtkblist->treeview), PIDGIN_STOCK_STATUS_AWAY_I,
fd4afe8bb584 Faded idle status icons
Sean Egan <seanegan@gmail.com>
parents: 15491
diff changeset
3237 icon_size, "GtkTreeView");
fd4afe8bb584 Faded idle status icons
Sean Egan <seanegan@gmail.com>
parents: 15491
diff changeset
3238 else
fd4afe8bb584 Faded idle status icons
Sean Egan <seanegan@gmail.com>
parents: 15491
diff changeset
3239 ret = gtk_widget_render_icon (GTK_WIDGET(gtkblist->treeview), PIDGIN_STOCK_STATUS_AWAY,
fd4afe8bb584 Faded idle status icons
Sean Egan <seanegan@gmail.com>
parents: 15491
diff changeset
3240 icon_size, "GtkTreeView");
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
3241 else if (purple_presence_is_status_primitive_active(p, PURPLE_STATUS_EXTENDED_AWAY))
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
3242 if (purple_presence_is_idle(p) && size == PIDGIN_STATUS_ICON_SMALL)
15493
fd4afe8bb584 Faded idle status icons
Sean Egan <seanegan@gmail.com>
parents: 15491
diff changeset
3243 ret = gtk_widget_render_icon (GTK_WIDGET(gtkblist->treeview), PIDGIN_STOCK_STATUS_XA_I,
fd4afe8bb584 Faded idle status icons
Sean Egan <seanegan@gmail.com>
parents: 15491
diff changeset
3244 icon_size, "GtkTreeView");
fd4afe8bb584 Faded idle status icons
Sean Egan <seanegan@gmail.com>
parents: 15491
diff changeset
3245 else
fd4afe8bb584 Faded idle status icons
Sean Egan <seanegan@gmail.com>
parents: 15491
diff changeset
3246 ret = gtk_widget_render_icon (GTK_WIDGET(gtkblist->treeview), PIDGIN_STOCK_STATUS_XA,
fd4afe8bb584 Faded idle status icons
Sean Egan <seanegan@gmail.com>
parents: 15491
diff changeset
3247 icon_size, "GtkTreeView");
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
3248 else if (purple_presence_is_status_primitive_active(p, PURPLE_STATUS_OFFLINE))
17433
fae50c8130d3 Change Offline icon in buddy list back to opaque. I found it too hard to discern it from idle otherwise
Sean Egan <seanegan@gmail.com>
parents: 17431
diff changeset
3249 ret = gtk_widget_render_icon (GTK_WIDGET(gtkblist->treeview), PIDGIN_STOCK_STATUS_OFFLINE,
15448
a75f1459b578 re-indentation.
Nathan Walp <nwalp@pidgin.im>
parents: 15444
diff changeset
3250 icon_size, "GtkTreeView");
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
3251 else if (purple_presence_is_idle(p) && size == PIDGIN_STATUS_ICON_SMALL)
15493
fd4afe8bb584 Faded idle status icons
Sean Egan <seanegan@gmail.com>
parents: 15491
diff changeset
3252 ret = gtk_widget_render_icon (GTK_WIDGET(gtkblist->treeview), PIDGIN_STOCK_STATUS_AVAILABLE_I,
fd4afe8bb584 Faded idle status icons
Sean Egan <seanegan@gmail.com>
parents: 15491
diff changeset
3253 icon_size, "GtkTreeView");
17488
45178b7e580d Show the Invisible icon (the same one in the statusbox for buddies that are broadcasting an invisible status to you. This should fix #740, but I'm not positive
Sean Egan <seanegan@gmail.com>
parents: 17487
diff changeset
3254 else if (purple_presence_is_status_primitive_active(p, PURPLE_STATUS_INVISIBLE))
45178b7e580d Show the Invisible icon (the same one in the statusbox for buddies that are broadcasting an invisible status to you. This should fix #740, but I'm not positive
Sean Egan <seanegan@gmail.com>
parents: 17487
diff changeset
3255 ret = gtk_widget_render_icon(GTK_WIDGET(gtkblist->treeview), PIDGIN_STOCK_STATUS_INVISIBLE,
45178b7e580d Show the Invisible icon (the same one in the statusbox for buddies that are broadcasting an invisible status to you. This should fix #740, but I'm not positive
Sean Egan <seanegan@gmail.com>
parents: 17487
diff changeset
3256 icon_size, "GtkTreeView");
15448
a75f1459b578 re-indentation.
Nathan Walp <nwalp@pidgin.im>
parents: 15444
diff changeset
3257 else
15493
fd4afe8bb584 Faded idle status icons
Sean Egan <seanegan@gmail.com>
parents: 15491
diff changeset
3258 ret = gtk_widget_render_icon(GTK_WIDGET(gtkblist->treeview), PIDGIN_STOCK_STATUS_AVAILABLE,
15448
a75f1459b578 re-indentation.
Nathan Walp <nwalp@pidgin.im>
parents: 15444
diff changeset
3259 icon_size, "GtkTreeView");
a75f1459b578 re-indentation.
Nathan Walp <nwalp@pidgin.im>
parents: 15444
diff changeset
3260 } else if (chat) {
a75f1459b578 re-indentation.
Nathan Walp <nwalp@pidgin.im>
parents: 15444
diff changeset
3261 ret = gtk_widget_render_icon (GTK_WIDGET(gtkblist->treeview), PIDGIN_STOCK_STATUS_CHAT,
a75f1459b578 re-indentation.
Nathan Walp <nwalp@pidgin.im>
parents: 15444
diff changeset
3262 icon_size, "GtkTreeView");
a75f1459b578 re-indentation.
Nathan Walp <nwalp@pidgin.im>
parents: 15444
diff changeset
3263 } else {
a75f1459b578 re-indentation.
Nathan Walp <nwalp@pidgin.im>
parents: 15444
diff changeset
3264 ret = gtk_widget_render_icon (GTK_WIDGET(gtkblist->treeview), PIDGIN_STOCK_STATUS_PERSON,
a75f1459b578 re-indentation.
Nathan Walp <nwalp@pidgin.im>
parents: 15444
diff changeset
3265 icon_size, "GtkTreeView");
a75f1459b578 re-indentation.
Nathan Walp <nwalp@pidgin.im>
parents: 15444
diff changeset
3266 }
15397
a8ee645e7fb4 A lot of status icon changes:
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
3267
a8ee645e7fb4 A lot of status icon changes:
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
3268 return ret;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3269 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3270
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
3271 static gchar *pidgin_blist_get_name_markup(PurpleBuddy *b, gboolean selected)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3272 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3273 const char *name;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3274 char *esc, *text = NULL;
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
3275 PurplePlugin *prpl;
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
3276 PurplePluginProtocolInfo *prpl_info = NULL;
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
3277 PurpleContact *contact;
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
3278 PurplePresence *presence;
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
3279 struct _pidgin_blist_node *gtkcontactnode = NULL;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3280 char *idletime = NULL, *statustext = NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3281 time_t t;
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
3282 PurpleConversation *conv = purple_find_conversation_with_account(PURPLE_CONV_TYPE_IM,
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
3283 purple_buddy_get_name(b),
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
3284 purple_buddy_get_account(b));
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
3285 PidginConversation *gtkconv;
15497
74efe677c8a5 Restore 'hidden convo' status icon in blist. Additionally, make the name text bold when you have a hidden convo
Sean Egan <seanegan@gmail.com>
parents: 15493
diff changeset
3286 gboolean hidden_conv = FALSE;
74efe677c8a5 Restore 'hidden convo' status icon in blist. Additionally, make the name text bold when you have a hidden convo
Sean Egan <seanegan@gmail.com>
parents: 15493
diff changeset
3287
74efe677c8a5 Restore 'hidden convo' status icon in blist. Additionally, make the name text bold when you have a hidden convo
Sean Egan <seanegan@gmail.com>
parents: 15493
diff changeset
3288 if(conv != NULL) {
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
3289 gtkconv = PIDGIN_CONVERSATION(conv);
15502
6fde15c1dcfc pidginconv to pidgin_conv
Sean Egan <seanegan@gmail.com>
parents: 15501
diff changeset
3290 if(gtkconv != NULL && pidgin_conv_is_hidden(gtkconv)) {
15497
74efe677c8a5 Restore 'hidden convo' status icon in blist. Additionally, make the name text bold when you have a hidden convo
Sean Egan <seanegan@gmail.com>
parents: 15493
diff changeset
3291 hidden_conv = TRUE;
74efe677c8a5 Restore 'hidden convo' status icon in blist. Additionally, make the name text bold when you have a hidden convo
Sean Egan <seanegan@gmail.com>
parents: 15493
diff changeset
3292 }
74efe677c8a5 Restore 'hidden convo' status icon in blist. Additionally, make the name text bold when you have a hidden convo
Sean Egan <seanegan@gmail.com>
parents: 15493
diff changeset
3293 }
15632
a830f9756f23 Some more pidgininfication
Daniel Atallah <daniel.atallah@gmail.com>
parents: 15615
diff changeset
3294
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3295 /* XXX Good luck cleaning up this crap */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3296
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
3297 contact = (PurpleContact*)((PurpleBlistNode*)b)->parent;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3298 if(contact)
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
3299 gtkcontactnode = ((PurpleBlistNode*)contact)->ui_data;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3300
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3301 if(gtkcontactnode && !gtkcontactnode->contact_expanded && contact->alias)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3302 name = contact->alias;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3303 else
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
3304 name = purple_buddy_get_alias(b);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3305 esc = g_markup_escape_text(name, strlen(name));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3306
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
3307 presence = purple_buddy_get_presence(b);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
3308
16062
07554cc5d090 Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <stu@nosnilmot.com>
parents: 16010
diff changeset
3309 if (!purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/blist/show_buddy_icons"))
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3310 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
3311 if (!selected && purple_presence_is_idle(presence))
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3312 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3313 text = g_strdup_printf("<span color='%s'>%s</span>",
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3314 dim_grey(), esc);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3315 g_free(esc);
15497
74efe677c8a5 Restore 'hidden convo' status icon in blist. Additionally, make the name text bold when you have a hidden convo
Sean Egan <seanegan@gmail.com>
parents: 15493
diff changeset
3316 if (hidden_conv) {
74efe677c8a5 Restore 'hidden convo' status icon in blist. Additionally, make the name text bold when you have a hidden convo
Sean Egan <seanegan@gmail.com>
parents: 15493
diff changeset
3317 char *tmp = text;
74efe677c8a5 Restore 'hidden convo' status icon in blist. Additionally, make the name text bold when you have a hidden convo
Sean Egan <seanegan@gmail.com>
parents: 15493
diff changeset
3318 text = g_strdup_printf("<b>%s</b>", text);
74efe677c8a5 Restore 'hidden convo' status icon in blist. Additionally, make the name text bold when you have a hidden convo
Sean Egan <seanegan@gmail.com>
parents: 15493
diff changeset
3319 g_free(tmp);
74efe677c8a5 Restore 'hidden convo' status icon in blist. Additionally, make the name text bold when you have a hidden convo
Sean Egan <seanegan@gmail.com>
parents: 15493
diff changeset
3320 }
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3321 return text;
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 else
15497
74efe677c8a5 Restore 'hidden convo' status icon in blist. Additionally, make the name text bold when you have a hidden convo
Sean Egan <seanegan@gmail.com>
parents: 15493
diff changeset
3324 if (hidden_conv) {
74efe677c8a5 Restore 'hidden convo' status icon in blist. Additionally, make the name text bold when you have a hidden convo
Sean Egan <seanegan@gmail.com>
parents: 15493
diff changeset
3325 char *tmp = esc;
74efe677c8a5 Restore 'hidden convo' status icon in blist. Additionally, make the name text bold when you have a hidden convo
Sean Egan <seanegan@gmail.com>
parents: 15493
diff changeset
3326 esc = g_strdup_printf("<b>%s</b>", esc);
74efe677c8a5 Restore 'hidden convo' status icon in blist. Additionally, make the name text bold when you have a hidden convo
Sean Egan <seanegan@gmail.com>
parents: 15493
diff changeset
3327 g_free(tmp);
74efe677c8a5 Restore 'hidden convo' status icon in blist. Additionally, make the name text bold when you have a hidden convo
Sean Egan <seanegan@gmail.com>
parents: 15493
diff changeset
3328 }
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3329 return esc;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3330 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3331
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
3332 prpl = purple_find_prpl(purple_account_get_protocol_id(b->account));
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3333
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3334 if (prpl != NULL)
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
3335 prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(prpl);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3336
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3337 if (prpl_info && prpl_info->status_text && b->account->gc) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3338 char *tmp = prpl_info->status_text(b);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3339 const char *end;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3340
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3341 if(tmp && !g_utf8_validate(tmp, -1, &end)) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3342 char *new = g_strndup(tmp,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3343 g_utf8_pointer_to_offset(tmp, end));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3344 g_free(tmp);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3345 tmp = new;
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 #if !GTK_CHECK_VERSION(2,6,0)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3349 if(tmp) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3350 char buf[32];
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3351 char *c = tmp;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3352 int length = 0, vis=0;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3353 gboolean inside = FALSE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3354 g_strdelimit(tmp, "\n", ' ');
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
3355 purple_str_strip_char(tmp, '\r');
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3356
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3357 while(*c && vis < 20) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3358 if(*c == '&')
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3359 inside = TRUE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3360 else if(*c == ';')
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3361 inside = FALSE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3362 if(!inside)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3363 vis++;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3364 c = g_utf8_next_char(c); /* this is fun */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3365 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3366
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3367 length = c - tmp;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3368
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3369 if(vis == 20)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3370 g_snprintf(buf, sizeof(buf), "%%.%ds...", length);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3371 else
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3372 g_snprintf(buf, sizeof(buf), "%%s ");
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3374 statustext = g_strdup_printf(buf, tmp);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3375
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3376 g_free(tmp);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3377 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3378 #else
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3379 if(tmp) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3380 g_strdelimit(tmp, "\n", ' ');
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
3381 purple_str_strip_char(tmp, '\r');
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3382 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3383 statustext = tmp;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3384 #endif
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3385 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3386
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
3387 if(!purple_presence_is_online(presence) && !statustext)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3388 statustext = g_strdup(_("Offline"));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3389 else if (!statustext)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3390 text = g_strdup(esc);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3391
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
3392 if (purple_presence_is_idle(presence)) {
16062
07554cc5d090 Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <stu@nosnilmot.com>
parents: 16010
diff changeset
3393 if (purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/blist/show_idle_time")) {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
3394 time_t idle_secs = purple_presence_get_idle_time(presence);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3395
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3396 if (idle_secs > 0) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3397 int ihrs, imin;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3398
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3399 time(&t);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3400 ihrs = (t - idle_secs) / 3600;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3401 imin = ((t - idle_secs) / 60) % 60;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3402
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3403 if (ihrs)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3404 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
3405 else
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3406 idletime = g_strdup_printf(_("Idle %dm"), imin);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3407 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3408 else
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3409 idletime = g_strdup(_("Idle"));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3410
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3411 if (!selected)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3412 text = g_strdup_printf("<span color='%s'>%s</span>\n"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3413 "<span color='%s' size='smaller'>%s%s%s</span>",
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3414 dim_grey(), esc, dim_grey(),
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3415 idletime != NULL ? idletime : "",
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3416 (idletime != NULL && statustext != NULL) ? " - " : "",
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3417 statustext != NULL ? statustext : "");
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3418 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3419 else if (!selected && !statustext) /* We handle selected text later */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3420 text = g_strdup_printf("<span color='%s'>%s</span>", dim_grey(), esc);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3421 else if (!selected && !text)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3422 text = g_strdup_printf("<span color='%s'>%s</span>\n"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3423 "<span color='%s' size='smaller'>%s</span>",
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3424 dim_grey(), esc, dim_grey(),
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3425 statustext != NULL ? statustext : "");
17429
043a1139d4e5 Fixes #464
Sean Egan <seanegan@gmail.com>
parents: 17418
diff changeset
3426 } else if (!PURPLE_BUDDY_IS_ONLINE(b)) {
043a1139d4e5 Fixes #464
Sean Egan <seanegan@gmail.com>
parents: 17418
diff changeset
3427 if (!selected && !statustext) /* We handle selected text later */
043a1139d4e5 Fixes #464
Sean Egan <seanegan@gmail.com>
parents: 17418
diff changeset
3428 text = g_strdup_printf("<span color='%s'>%s</span>", dim_grey(), esc);
043a1139d4e5 Fixes #464
Sean Egan <seanegan@gmail.com>
parents: 17418
diff changeset
3429 else if (!selected && !text)
043a1139d4e5 Fixes #464
Sean Egan <seanegan@gmail.com>
parents: 17418
diff changeset
3430 text = g_strdup_printf("<span color='%s'>%s</span>\n"
043a1139d4e5 Fixes #464
Sean Egan <seanegan@gmail.com>
parents: 17418
diff changeset
3431 "<span color='%s' size='smaller'>%s</span>",
043a1139d4e5 Fixes #464
Sean Egan <seanegan@gmail.com>
parents: 17418
diff changeset
3432 dim_grey(), esc, dim_grey(),
043a1139d4e5 Fixes #464
Sean Egan <seanegan@gmail.com>
parents: 17418
diff changeset
3433 statustext != NULL ? statustext : "");
043a1139d4e5 Fixes #464
Sean Egan <seanegan@gmail.com>
parents: 17418
diff changeset
3434
043a1139d4e5 Fixes #464
Sean Egan <seanegan@gmail.com>
parents: 17418
diff changeset
3435 }
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3436 /* Not idle and not selected */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3437 else if (!selected && !text)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3438 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3439 text = g_strdup_printf("%s\n"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3440 "<span color='%s' size='smaller'>%s</span>",
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3441 esc, dim_grey(),
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3442 statustext != NULL ? statustext : "");
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3443 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3444
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3445 /* It is selected. */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3446 if ((selected && !text) || (selected && idletime))
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3447 text = g_strdup_printf("%s\n"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3448 "<span size='smaller'>%s%s%s</span>",
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3449 esc,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3450 idletime != NULL ? idletime : "",
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3451 (idletime != NULL && statustext != NULL) ? " - " : "",
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3452 statustext != NULL ? statustext : "");
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3453
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3454 g_free(idletime);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3455 g_free(statustext);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3456 g_free(esc);
15632
a830f9756f23 Some more pidgininfication
Daniel Atallah <daniel.atallah@gmail.com>
parents: 15615
diff changeset
3457
15497
74efe677c8a5 Restore 'hidden convo' status icon in blist. Additionally, make the name text bold when you have a hidden convo
Sean Egan <seanegan@gmail.com>
parents: 15493
diff changeset
3458 if (hidden_conv) {
74efe677c8a5 Restore 'hidden convo' status icon in blist. Additionally, make the name text bold when you have a hidden convo
Sean Egan <seanegan@gmail.com>
parents: 15493
diff changeset
3459 char *tmp = text;
74efe677c8a5 Restore 'hidden convo' status icon in blist. Additionally, make the name text bold when you have a hidden convo
Sean Egan <seanegan@gmail.com>
parents: 15493
diff changeset
3460 text = g_strdup_printf("<b>%s</b>", tmp);
74efe677c8a5 Restore 'hidden convo' status icon in blist. Additionally, make the name text bold when you have a hidden convo
Sean Egan <seanegan@gmail.com>
parents: 15493
diff changeset
3461 g_free(tmp);
74efe677c8a5 Restore 'hidden convo' status icon in blist. Additionally, make the name text bold when you have a hidden convo
Sean Egan <seanegan@gmail.com>
parents: 15493
diff changeset
3462 }
15632
a830f9756f23 Some more pidgininfication
Daniel Atallah <daniel.atallah@gmail.com>
parents: 15615
diff changeset
3463
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3464 return text;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3465 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3466
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
3467 static void pidgin_blist_restore_position()
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3468 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3469 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
3470
16062
07554cc5d090 Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <stu@nosnilmot.com>
parents: 16010
diff changeset
3471 blist_width = purple_prefs_get_int(PIDGIN_PREFS_ROOT "/blist/width");
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3472
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3473 /* 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
3474 * position is sane... */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3475 if (gtkblist && gtkblist->window &&
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3476 !GTK_WIDGET_VISIBLE(gtkblist->window) && blist_width != 0) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3477
16062
07554cc5d090 Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <stu@nosnilmot.com>
parents: 16010
diff changeset
3478 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
3479 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
3480 blist_height = purple_prefs_get_int(PIDGIN_PREFS_ROOT "/blist/height");
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3481
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3482 /* ...check position is on screen... */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3483 if (blist_x >= gdk_screen_width())
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3484 blist_x = gdk_screen_width() - 100;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3485 else if (blist_x + blist_width < 0)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3486 blist_x = 100;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3487
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3488 if (blist_y >= gdk_screen_height())
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3489 blist_y = gdk_screen_height() - 100;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3490 else if (blist_y + blist_height < 0)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3491 blist_y = 100;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3492
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3493 /* ...and move it back. */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3494 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
3495 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
3496 if (purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/blist/list_maximized"))
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3497 gtk_window_maximize(GTK_WINDOW(gtkblist->window));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3498 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3499 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3500
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
3501 static gboolean pidgin_blist_refresh_timer(PurpleBuddyList *list)
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
3502 {
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
3503 PurpleBlistNode *gnode, *cnode;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3504
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3505 if (gtk_blist_obscured || !GTK_WIDGET_VISIBLE(gtkblist->window))
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3506 return TRUE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3507
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3508 for(gnode = list->root; gnode; gnode = gnode->next) {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
3509 if(!PURPLE_BLIST_NODE_IS_GROUP(gnode))
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3510 continue;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3511 for(cnode = gnode->child; cnode; cnode = cnode->next) {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
3512 if(PURPLE_BLIST_NODE_IS_CONTACT(cnode)) {
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
3513 PurpleBuddy *buddy;
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
3514
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
3515 buddy = purple_contact_get_priority_buddy((PurpleContact*)cnode);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3516
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3517 if (buddy &&
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
3518 purple_presence_is_idle(purple_buddy_get_presence(buddy)))
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
3519 pidgin_blist_update_contact(list, (PurpleBlistNode*)buddy);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3520 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3521 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3522 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3523
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3524 /* keep on going */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3525 return TRUE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3526 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3527
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
3528 static void pidgin_blist_hide_node(PurpleBuddyList *list, PurpleBlistNode *node, gboolean update)
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
3529 {
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
3530 struct _pidgin_blist_node *gtknode = (struct _pidgin_blist_node *)node->ui_data;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3531 GtkTreeIter iter;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3532
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3533 if (!gtknode || !gtknode->row || !gtkblist)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3534 return;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3535
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3536 if(gtkblist->selected_node == node)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3537 gtkblist->selected_node = NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3538 if (get_iter_from_node(node, &iter)) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3539 gtk_tree_store_remove(gtkblist->treemodel, &iter);
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
3540 if(update && (PURPLE_BLIST_NODE_IS_CONTACT(node) ||
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
3541 PURPLE_BLIST_NODE_IS_BUDDY(node) || PURPLE_BLIST_NODE_IS_CHAT(node))) {
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
3542 pidgin_blist_update(list, node->parent);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3543 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3544 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3545 gtk_tree_row_reference_free(gtknode->row);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3546 gtknode->row = NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3547 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3548
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3549 static const char *require_connection[] =
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3550 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3551 N_("/Buddies/New Instant Message..."),
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3552 N_("/Buddies/Join a Chat..."),
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3553 N_("/Buddies/Get User Info..."),
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3554 N_("/Buddies/Add Buddy..."),
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3555 N_("/Buddies/Add Chat..."),
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3556 N_("/Buddies/Add Group..."),
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3557 };
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3558
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3559 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
3560 / sizeof(*require_connection);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3561
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3562 /**
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3563 * 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
3564 * where appropriate.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3565 */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3566 static void
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
3567 update_menu_bar(PidginBuddyList *gtkblist)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3568 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3569 GtkWidget *widget;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3570 gboolean sensitive;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3571 int i;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3572
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3573 g_return_if_fail(gtkblist != NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3574
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
3575 pidgin_blist_update_accounts_menu();
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3576
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
3577 sensitive = (purple_connections_get_all() != NULL);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3578
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3579 for (i = 0; i < require_connection_size; i++)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3580 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3581 widget = gtk_item_factory_get_widget(gtkblist->ift, require_connection[i]);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3582 gtk_widget_set_sensitive(widget, sensitive);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3583 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3584
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3585 widget = gtk_item_factory_get_widget(gtkblist->ift, N_("/Buddies/Join a Chat..."));
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
3586 gtk_widget_set_sensitive(widget, pidgin_blist_joinchat_is_showable());
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3587
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3588 widget = gtk_item_factory_get_widget(gtkblist->ift, N_("/Buddies/Add Chat..."));
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
3589 gtk_widget_set_sensitive(widget, pidgin_blist_joinchat_is_showable());
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3590
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3591 widget = gtk_item_factory_get_widget(gtkblist->ift, N_("/Tools/Privacy"));
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
3592 gtk_widget_set_sensitive(widget, (purple_connections_get_all() != NULL));
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3593
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3594 widget = gtk_item_factory_get_widget(gtkblist->ift, N_("/Tools/Room List"));
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
3595 gtk_widget_set_sensitive(widget, pidgin_roomlist_is_showable());
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3596 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3597
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3598 static void
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
3599 sign_on_off_cb(PurpleConnection *gc, PurpleBuddyList *blist)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3600 {
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
3601 PidginBuddyList *gtkblist = PIDGIN_BLIST(blist);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3602
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3603 update_menu_bar(gtkblist);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3604 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3605
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3606 static void
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
3607 plugin_changed_cb(PurplePlugin *p, gpointer *data)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3608 {
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
3609 pidgin_blist_update_plugin_actions();
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3610 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3611
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3612 static void
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3613 unseen_conv_menu()
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3614 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3615 static GtkWidget *menu = NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3616 GList *convs = NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3617
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3618 if (menu) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3619 gtk_widget_destroy(menu);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3620 menu = NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3621 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3622
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
3623 convs = pidgin_conversations_find_unseen_list(PURPLE_CONV_TYPE_IM, PIDGIN_UNSEEN_TEXT, TRUE, 0);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3624 if (!convs)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3625 /* 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
3626 return;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3627
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3628 menu = gtk_menu_new();
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3629
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
3630 pidgin_conversations_fill_menu(menu, convs);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3631 g_list_free(convs);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3632 gtk_widget_show_all(menu);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3633 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
3634 gtk_get_current_event_time());
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3635 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3636
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3637 static gboolean
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3638 menutray_press_cb(GtkWidget *widget, GdkEventButton *event)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3639 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3640 GList *convs;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3641
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3642 switch (event->button) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3643 case 1:
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
3644 convs = pidgin_conversations_find_unseen_list(PURPLE_CONV_TYPE_IM,
15505
762b6547adf9 GAIM_UNSEEN to PIDGIN_UNSEEN
Sean Egan <seanegan@gmail.com>
parents: 15502
diff changeset
3645 PIDGIN_UNSEEN_TEXT, TRUE, 1);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3646 if (convs) {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
3647 purple_conversation_present((PurpleConversation*)convs->data);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3648 g_list_free(convs);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3649 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3650 break;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3651 case 3:
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3652 unseen_conv_menu();
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3653 break;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3654 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3655 return TRUE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3656 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3657
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3658 static void
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
3659 conversation_updated_cb(PurpleConversation *conv, PurpleConvUpdateType type,
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
3660 PidginBuddyList *gtkblist)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3661 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3662 GList *convs = NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3663 GList *l = NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3664
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
3665 if (type != PURPLE_CONV_UPDATE_UNSEEN)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3666 return;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3667
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3668 if(conv->account != NULL && conv->name != NULL) {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
3669 PurpleBuddy *buddy = purple_find_buddy(conv->account, conv->name);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3670 if(buddy != NULL)
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
3671 pidgin_blist_update_buddy(NULL, (PurpleBlistNode *)buddy, TRUE);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3672 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3673
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3674 if (gtkblist->menutrayicon) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3675 gtk_widget_destroy(gtkblist->menutrayicon);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3676 gtkblist->menutrayicon = NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3677 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3678
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
3679 convs = pidgin_conversations_find_unseen_list(PURPLE_CONV_TYPE_IM, PIDGIN_UNSEEN_TEXT, TRUE, 0);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3680 if (convs) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3681 GtkWidget *img = NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3682 GString *tooltip_text = NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3683
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3684 tooltip_text = g_string_new("");
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3685 l = convs;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3686 while (l != NULL) {
15632
a830f9756f23 Some more pidgininfication
Daniel Atallah <daniel.atallah@gmail.com>
parents: 15615
diff changeset
3687 if (PIDGIN_IS_PIDGIN_CONVERSATION(l->data)) {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
3688 PidginConversation *gtkconv = PIDGIN_CONVERSATION((PurpleConversation *)l->data);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3689
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3690 g_string_append_printf(tooltip_text,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3691 ngettext("%d unread message from %s\n", "%d unread messages from %s\n", gtkconv->unseen_count),
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3692 gtkconv->unseen_count,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3693 gtk_label_get_text(GTK_LABEL(gtkconv->tab_label)));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3694 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3695 l = l->next;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3696 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3697 if(tooltip_text->len > 0) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3698 /* get rid of the last newline */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3699 g_string_truncate(tooltip_text, tooltip_text->len -1);
15632
a830f9756f23 Some more pidgininfication
Daniel Atallah <daniel.atallah@gmail.com>
parents: 15615
diff changeset
3700 img = gtk_image_new_from_stock(PIDGIN_STOCK_TOOLBAR_PENDING,
15560
442128853bdb toolbar/menu icons. reduce the imhtmltoolbar spacing. more gaimstock pruning
Sean Egan <seanegan@gmail.com>
parents: 15559
diff changeset
3701 gtk_icon_size_from_name(PIDGIN_ICON_SIZE_TANGO_EXTRA_SMALL));
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3702
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3703 gtkblist->menutrayicon = gtk_event_box_new();
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3704 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
3705 gtk_widget_show(img);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3706 gtk_widget_show(gtkblist->menutrayicon);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3707 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
3708
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
3709 pidgin_menu_tray_append(PIDGIN_MENU_TRAY(gtkblist->menutray), gtkblist->menutrayicon, tooltip_text->str);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3710 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3711 g_string_free(tooltip_text, TRUE);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3712 g_list_free(convs);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3713 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3714 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3715
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3716 static void
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
3717 conversation_deleting_cb(PurpleConversation *conv, PidginBuddyList *gtkblist)
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
3718 {
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
3719 conversation_updated_cb(conv, PURPLE_CONV_UPDATE_UNSEEN, gtkblist);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3720 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3721
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3722 /**********************************************************************************
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3723 * Public API Functions *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3724 **********************************************************************************/
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3725
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
3726 static void pidgin_blist_new_list(PurpleBuddyList *blist)
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
3727 {
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
3728 PidginBuddyList *gtkblist;
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
3729
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
3730 gtkblist = g_new0(PidginBuddyList, 1);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3731 gtkblist->connection_errors = g_hash_table_new_full(g_direct_hash,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3732 g_direct_equal, NULL, g_free);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3733 blist->ui_data = gtkblist;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3734 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3735
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
3736 static void pidgin_blist_new_node(PurpleBlistNode *node)
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
3737 {
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
3738 node->ui_data = g_new0(struct _pidgin_blist_node, 1);
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
3739 }
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
3740
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
3741 gboolean pidgin_blist_node_is_contact_expanded(PurpleBlistNode *node)
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
3742 {
17830
0e445e906cfd Fix pidgin_blist_node_is_contact_expanded() to not crash on buddy list
Stu Tomlinson <stu@nosnilmot.com>
parents: 17789
diff changeset
3743 if (PURPLE_BLIST_NODE_IS_BUDDY(node)) {
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3744 node = node->parent;
17830
0e445e906cfd Fix pidgin_blist_node_is_contact_expanded() to not crash on buddy list
Stu Tomlinson <stu@nosnilmot.com>
parents: 17789
diff changeset
3745 if (node == NULL)
0e445e906cfd Fix pidgin_blist_node_is_contact_expanded() to not crash on buddy list
Stu Tomlinson <stu@nosnilmot.com>
parents: 17789
diff changeset
3746 return FALSE;
0e445e906cfd Fix pidgin_blist_node_is_contact_expanded() to not crash on buddy list
Stu Tomlinson <stu@nosnilmot.com>
parents: 17789
diff changeset
3747 }
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3748
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
3749 g_return_val_if_fail(PURPLE_BLIST_NODE_IS_CONTACT(node), FALSE);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3750
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
3751 return ((struct _pidgin_blist_node *)node->ui_data)->contact_expanded;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3752 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3753
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3754 enum {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3755 DRAG_BUDDY,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3756 DRAG_ROW,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3757 DRAG_VCARD,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3758 DRAG_TEXT,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3759 DRAG_URI,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3760 NUM_TARGETS
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3761 };
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3762
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3763 static const char *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3764 item_factory_translate_func (const char *path, gpointer func_data)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3765 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3766 return _((char *)path);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3767 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3768
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
3769 void pidgin_blist_setup_sort_methods()
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
3770 {
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
3771 pidgin_blist_sort_method_reg("none", _("Manually"), sort_method_none);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3772 #if GTK_CHECK_VERSION(2,2,1)
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
3773 pidgin_blist_sort_method_reg("alphabetical", _("Alphabetically"), sort_method_alphabetical);
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
3774 pidgin_blist_sort_method_reg("status", _("By status"), sort_method_status);
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
3775 pidgin_blist_sort_method_reg("log_size", _("By log size"), sort_method_log);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3776 #endif
16062
07554cc5d090 Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <stu@nosnilmot.com>
parents: 16010
diff changeset
3777 pidgin_blist_sort_method_set(purple_prefs_get_string(PIDGIN_PREFS_ROOT "/blist/sort_type"));
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3778 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3779
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3780 static void _prefs_change_redo_list()
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3781 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3782 GtkTreeSelection *sel;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3783 GtkTreeIter iter;
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
3784 PurpleBlistNode *node = NULL;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3785
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3786 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
3787 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
3788 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3789 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
3790 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3791
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
3792 redo_buddy_list(purple_get_blist(), FALSE, FALSE);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3793 #if GTK_CHECK_VERSION(2,6,0)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3794 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
3795 #endif
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3796
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3797 if (node)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3798 {
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
3799 struct _pidgin_blist_node *gtknode;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3800 GtkTreePath *path;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3801
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3802 gtknode = node->ui_data;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3803 if (gtknode && gtknode->row)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3804 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3805 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
3806 gtk_tree_selection_select_path(sel, path);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3807 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
3808 gtk_tree_path_free(path);
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 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3811 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3812
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
3813 static void _prefs_change_sort_method(const char *pref_name, PurplePrefType type,
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3814 gconstpointer val, gpointer data)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3815 {
16062
07554cc5d090 Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <stu@nosnilmot.com>
parents: 16010
diff changeset
3816 if(!strcmp(pref_name, PIDGIN_PREFS_ROOT "/blist/sort_type"))
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
3817 pidgin_blist_sort_method_set(val);
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
3818 }
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
3819
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
3820 static void account_modified(PurpleAccount *account, PidginBuddyList *gtkblist)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3821 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3822 GList *list;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3823 if (!gtkblist)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3824 return;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3825
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
3826 if ((list = purple_accounts_get_all_active()) != NULL) {
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3827 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
3828 g_list_free(list);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3829 } else
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3830 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
3831
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3832 update_menu_bar(gtkblist);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3833 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3834
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3835 static void
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
3836 account_status_changed(PurpleAccount *account, PurpleStatus *old,
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
3837 PurpleStatus *new, PidginBuddyList *gtkblist)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3838 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3839 if (!gtkblist)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3840 return;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3841
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3842 update_menu_bar(gtkblist);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3843 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3844
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3845 static gboolean
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
3846 gtk_blist_window_key_press_cb(GtkWidget *w, GdkEventKey *event, PidginBuddyList *gtkblist)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3847 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3848 GtkWidget *imhtml;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3849
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3850 if (!gtkblist)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3851 return FALSE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3852
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3853 imhtml = gtk_window_get_focus(GTK_WINDOW(gtkblist->window));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3854
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3855 if (GTK_IS_IMHTML(imhtml) && gtk_bindings_activate(GTK_OBJECT(imhtml), event->keyval, event->state))
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3856 return TRUE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3857 return FALSE;
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
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3860 static gboolean
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3861 headline_hover_close(int x, int y)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3862 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3863 GtkWidget *w = gtkblist->headline_hbox;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3864 if (x <= w->allocation.width && x >= w->allocation.width - HEADLINE_CLOSE_SIZE &&
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3865 y >= 0 && y <= HEADLINE_CLOSE_SIZE)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3866 return TRUE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3867 return FALSE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3868 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3869
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3870 static gboolean
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
3871 headline_box_enter_cb(GtkWidget *widget, GdkEventCrossing *event, PidginBuddyList *gtkblist)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3872 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3873 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
3874
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3875 if (gtkblist->headline_close) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3876 #if GTK_CHECK_VERSION(2,2,0)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3877 gdk_draw_pixbuf(widget->window, NULL, gtkblist->headline_close,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3878 #else
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3879 gdk_pixbuf_render_to_drawable(gtkblist->headline_close,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3880 GDK_DRAWABLE(widget->window), NULL,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3881 #endif
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3882 0, 0,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3883 widget->allocation.width - 2 - HEADLINE_CLOSE_SIZE, 2,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3884 HEADLINE_CLOSE_SIZE, HEADLINE_CLOSE_SIZE,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3885 GDK_RGB_DITHER_NONE, 0, 0);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3886 gtk_paint_focus(widget->style, widget->window, GTK_STATE_PRELIGHT,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3887 NULL, widget, NULL,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3888 widget->allocation.width - HEADLINE_CLOSE_SIZE - 3, 1,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3889 HEADLINE_CLOSE_SIZE + 2, HEADLINE_CLOSE_SIZE + 2);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3890 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3891
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3892 return FALSE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3893 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3894
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3895 #if 0
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3896 static gboolean
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
3897 headline_box_motion_cb(GtkWidget *widget, GdkEventMotion *event, PidginBuddyList *gtkblist)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3898 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
3899 purple_debug_fatal("motion", "%d %d\n", (int)event->x, (int)event->y);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3900 if (headline_hover_close((int)event->x, (int)event->y))
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3901 gtk_paint_focus(widget->style, widget->window, GTK_STATE_PRELIGHT,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3902 NULL, widget, NULL,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3903 widget->allocation.width - HEADLINE_CLOSE_SIZE - 3, 1,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3904 HEADLINE_CLOSE_SIZE + 2, HEADLINE_CLOSE_SIZE + 2);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3905 return FALSE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3906 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3907 #endif
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3908
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3909 static gboolean
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
3910 headline_box_leave_cb(GtkWidget *widget, GdkEventCrossing *event, PidginBuddyList *gtkblist)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3911 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3912 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
3913 if (gtkblist->headline_close) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3914 GdkRectangle rect = {widget->allocation.width - 3 - HEADLINE_CLOSE_SIZE, 1,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3915 HEADLINE_CLOSE_SIZE + 2, HEADLINE_CLOSE_SIZE + 2};
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3916 gdk_window_invalidate_rect(widget->window, &rect, TRUE);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3917 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3918 return FALSE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3919 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3920
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3921 static void
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
3922 reset_headline(PidginBuddyList *gtkblist)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3923 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3924 gtkblist->headline_callback = NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3925 gtkblist->headline_data = NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3926 gtkblist->headline_destroy = NULL;
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
3927 pidgin_set_urgent(GTK_WINDOW(gtkblist->window), FALSE);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3928 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3929
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3930 static gboolean
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3931 headline_click_callback(gpointer data)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3932 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3933 ((GSourceFunc)gtkblist->headline_callback)(gtkblist->headline_data);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3934 reset_headline(gtkblist);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3935 return FALSE;
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 static gboolean
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
3939 headline_box_press_cb(GtkWidget *widget, GdkEventButton *event, PidginBuddyList *gtkblist)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3940 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3941 gtk_widget_hide(gtkblist->headline_hbox);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3942 if (gtkblist->headline_callback && !headline_hover_close((int)event->x, (int)event->y))
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3943 g_idle_add((GSourceFunc)headline_click_callback, gtkblist->headline_data);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3944 else {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3945 if (gtkblist->headline_destroy)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3946 gtkblist->headline_destroy(gtkblist->headline_data);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3947 reset_headline(gtkblist);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3948 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3949 return TRUE;
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 /* Connection error handling stuff */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3954 /***********************************/
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3955
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3956 static void
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
3957 ce_modify_account_cb(PurpleAccount *account)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3958 {
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
3959 pidgin_account_dialog_show(PIDGIN_MODIFY_ACCOUNT_DIALOG, account);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3960 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3961
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3962 static void
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
3963 ce_enable_account_cb(PurpleAccount *account)
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
3964 {
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
3965 purple_account_set_enabled(account, purple_core_get_ui(), TRUE);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
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 static void
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3969 connection_error_button_clicked_cb(GtkButton *widget, gpointer user_data)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3970 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
3971 PurpleAccount *account;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3972 char *primary;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3973 const char *text;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3974 gboolean enabled;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3975
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3976 account = user_data;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3977 primary = g_strdup_printf(_("%s disconnected"),
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
3978 purple_account_get_username(account));
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3979 text = g_hash_table_lookup(gtkblist->connection_errors, account);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3980
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
3981 enabled = purple_account_get_enabled(account, purple_core_get_ui());
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
3982 purple_request_action(account, _("Connection Error"), primary, text, 2,
16442
08db93bbd798 Added account, who, and conversation parameters to the request API calls, and updated all code to match. I can't compile the Perl module, so I'd appreciate it if someone who knows it would verify that this doesn't break Perl.
Evan Schoenberg <evan.s@dreskin.net>
parents: 16275
diff changeset
3983 account, NULL, NULL,
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3984 account, 3,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3985 _("OK"), NULL,
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
3986 _("Modify Account"), PURPLE_CALLBACK(ce_modify_account_cb),
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3987 enabled ? _("Connect") : _("Re-enable Account"),
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
3988 enabled ? PURPLE_CALLBACK(purple_account_connect) :
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
3989 PURPLE_CALLBACK(ce_enable_account_cb));
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3990 g_free(primary);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3991 gtk_widget_destroy(GTK_WIDGET(widget));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3992 g_hash_table_remove(gtkblist->connection_errors, account);
17044
c28f4593f723 Pack connection error buttons the same way the statusbox is. Fixes #120
Sean Egan <seanegan@gmail.com>
parents: 17042
diff changeset
3993 if (gtk_container_get_children(GTK_CONTAINER(gtkblist->error_buttons)) == NULL) {
c28f4593f723 Pack connection error buttons the same way the statusbox is. Fixes #120
Sean Egan <seanegan@gmail.com>
parents: 17042
diff changeset
3994 gtk_widget_hide(gtkblist->error_buttons);
c28f4593f723 Pack connection error buttons the same way the statusbox is. Fixes #120
Sean Egan <seanegan@gmail.com>
parents: 17042
diff changeset
3995 }
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3996 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3997
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3998 /* Add some buttons that show connection errors */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3999 static void
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4000 create_connection_error_buttons(gpointer key, gpointer value,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4001 gpointer user_data)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4002 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
4003 PurpleAccount *account;
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
4004 PurpleStatusType *status_type;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4005 gchar *escaped, *text;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4006 GtkWidget *button, *label, *image, *hbox;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4007 GdkPixbuf *pixbuf;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4008
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4009 account = key;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4010 escaped = g_markup_escape_text((const gchar *)value, -1);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4011 text = g_strdup_printf(_("<span color=\"red\">%s disconnected: %s</span>"),
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
4012 purple_account_get_username(account),
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4013 escaped);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4014 g_free(escaped);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4015
17044
c28f4593f723 Pack connection error buttons the same way the statusbox is. Fixes #120
Sean Egan <seanegan@gmail.com>
parents: 17042
diff changeset
4016 hbox = gtk_hbox_new(FALSE, 6);
15374
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 /* Create the icon */
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
4019 if ((status_type = purple_account_get_status_type_with_primitive(account,
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
4020 PURPLE_STATUS_OFFLINE))) {
15738
20225df32b7e Change some old, busted status icon stuff to use the new hotness
Sean Egan <seanegan@gmail.com>
parents: 15708
diff changeset
4021 pixbuf = pidgin_create_prpl_icon(account, PIDGIN_PRPL_ICON_SMALL);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4022 if (pixbuf != NULL) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4023 image = gtk_image_new_from_pixbuf(pixbuf);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4024 g_object_unref(pixbuf);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4025
17044
c28f4593f723 Pack connection error buttons the same way the statusbox is. Fixes #120
Sean Egan <seanegan@gmail.com>
parents: 17042
diff changeset
4026 gtk_box_pack_start(GTK_BOX(hbox), image, FALSE, FALSE, 0);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4027 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4028 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4029
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4030 /* Create the text */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4031 label = gtk_label_new("");
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4032 gtk_label_set_markup(GTK_LABEL(label), text);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4033 g_free(text);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4034 #if GTK_CHECK_VERSION(2,6,0)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4035 g_object_set(label, "ellipsize", PANGO_ELLIPSIZE_END, NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4036 #endif
17044
c28f4593f723 Pack connection error buttons the same way the statusbox is. Fixes #120
Sean Egan <seanegan@gmail.com>
parents: 17042
diff changeset
4037 gtk_box_pack_start(GTK_BOX(hbox), label, TRUE, TRUE, 0);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4038
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4039 /* Create the actual button and put the icon and text on it */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4040 button = gtk_button_new();
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4041 gtk_container_add(GTK_CONTAINER(button), hbox);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4042 g_signal_connect(G_OBJECT(button), "clicked",
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4043 G_CALLBACK(connection_error_button_clicked_cb),
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4044 account);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4045 gtk_widget_show_all(button);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4046 gtk_box_pack_end(GTK_BOX(gtkblist->error_buttons), button,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4047 FALSE, FALSE, 0);
17044
c28f4593f723 Pack connection error buttons the same way the statusbox is. Fixes #120
Sean Egan <seanegan@gmail.com>
parents: 17042
diff changeset
4048 gtk_widget_show_all(gtkblist->error_buttons);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4049 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4050
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4051 void
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
4052 pidgin_blist_update_account_error_state(PurpleAccount *account, const char *text)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4053 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4054 GList *l;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4055
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4056 if (text == NULL)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4057 g_hash_table_remove(gtkblist->connection_errors, account);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4058 else
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4059 g_hash_table_insert(gtkblist->connection_errors, account, g_strdup(text));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4060
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4061 /* Remove the old error buttons */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4062 for (l = gtk_container_get_children(GTK_CONTAINER(gtkblist->error_buttons));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4063 l != NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4064 l = l->next)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4065 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4066 gtk_widget_destroy(GTK_WIDGET(l->data));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4067 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4068
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4069 /* Add new error buttons */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4070 g_hash_table_foreach(gtkblist->connection_errors,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4071 create_connection_error_buttons, NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4072 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4073
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4074 static gboolean
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4075 paint_headline_hbox (GtkWidget *widget,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4076 GdkEventExpose *event,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4077 gpointer user_data)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4078 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4079 gtk_paint_flat_box (widget->style,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4080 widget->window,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4081 GTK_STATE_NORMAL,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4082 GTK_SHADOW_OUT,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4083 NULL,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4084 widget,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4085 "tooltip",
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4086 widget->allocation.x + 1,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4087 widget->allocation.y + 1,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4088 widget->allocation.width - 2,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4089 widget->allocation.height - 2);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4090 return FALSE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4091 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4092
15558
0324f69112f9 Make group background colors update when the theme changes.
Sean Egan <seanegan@gmail.com>
parents: 15553
diff changeset
4093 /* This assumes there are not things like groupless buddies or multi-leveled groups.
0324f69112f9 Make group background colors update when the theme changes.
Sean Egan <seanegan@gmail.com>
parents: 15553
diff changeset
4094 * I'm sure other things in this code assumes that also.
0324f69112f9 Make group background colors update when the theme changes.
Sean Egan <seanegan@gmail.com>
parents: 15553
diff changeset
4095 */
0324f69112f9 Make group background colors update when the theme changes.
Sean Egan <seanegan@gmail.com>
parents: 15553
diff changeset
4096 static void
0324f69112f9 Make group background colors update when the theme changes.
Sean Egan <seanegan@gmail.com>
parents: 15553
diff changeset
4097 treeview_style_set (GtkWidget *widget,
0324f69112f9 Make group background colors update when the theme changes.
Sean Egan <seanegan@gmail.com>
parents: 15553
diff changeset
4098 GtkStyle *prev_style,
0324f69112f9 Make group background colors update when the theme changes.
Sean Egan <seanegan@gmail.com>
parents: 15553
diff changeset
4099 gpointer data)
0324f69112f9 Make group background colors update when the theme changes.
Sean Egan <seanegan@gmail.com>
parents: 15553
diff changeset
4100 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
4101 PurpleBuddyList *list = data;
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
4102 PurpleBlistNode *node = list->root;
15558
0324f69112f9 Make group background colors update when the theme changes.
Sean Egan <seanegan@gmail.com>
parents: 15553
diff changeset
4103 while (node) {
0324f69112f9 Make group background colors update when the theme changes.
Sean Egan <seanegan@gmail.com>
parents: 15553
diff changeset
4104 pidgin_blist_update_group(list, node);
0324f69112f9 Make group background colors update when the theme changes.
Sean Egan <seanegan@gmail.com>
parents: 15553
diff changeset
4105 node = node->next;
0324f69112f9 Make group background colors update when the theme changes.
Sean Egan <seanegan@gmail.com>
parents: 15553
diff changeset
4106 }
0324f69112f9 Make group background colors update when the theme changes.
Sean Egan <seanegan@gmail.com>
parents: 15553
diff changeset
4107 }
0324f69112f9 Make group background colors update when the theme changes.
Sean Egan <seanegan@gmail.com>
parents: 15553
diff changeset
4108
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4109 static void
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4110 headline_style_set (GtkWidget *widget,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4111 GtkStyle *prev_style)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4112 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4113 GtkTooltips *tooltips;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4114 GtkStyle *style;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4115
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4116 if (gtkblist->changing_style)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4117 return;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4118
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4119 tooltips = gtk_tooltips_new ();
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4120 #if GLIB_CHECK_VERSION(2,10,0)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4121 g_object_ref_sink (tooltips);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4122 #else
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4123 g_object_ref(tooltips);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4124 gtk_object_sink(GTK_OBJECT(tooltips));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4125 #endif
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4126
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4127 gtk_tooltips_force_window (tooltips);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4128 gtk_widget_ensure_style (tooltips->tip_window);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4129 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
4130
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4131 gtkblist->changing_style = TRUE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4132 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
4133 gtkblist->changing_style = FALSE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4134
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4135 g_object_unref (tooltips);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4136 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4137
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4138 /******************************************/
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4139 /* End of connection error handling stuff */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4140 /******************************************/
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4141
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4142 static int
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
4143 blist_focus_cb(GtkWidget *widget, gpointer data, PidginBuddyList *gtkblist)
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
4144 {
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
4145 pidgin_set_urgent(GTK_WINDOW(gtkblist->window), FALSE);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4146 return 0;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4147 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4148
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4149 #if 0
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4150 static GtkWidget *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4151 kiosk_page()
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4152 {
15821
cebfc6af3eb5 More Gaim to Pidgin stuff
Sean Egan <seanegan@gmail.com>
parents: 15738
diff changeset
4153 GtkWidget *ret = gtk_vbox_new(FALSE, PIDGIN_HIG_BOX_SPACE);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4154 GtkWidget *label;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4155 GtkWidget *entry;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4156 GtkWidget *bbox;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4157 GtkWidget *button;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4158
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4159 label = gtk_label_new(NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4160 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
4161
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4162 label = gtk_label_new(NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4163 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
4164 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
4165 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
4166 entry = gtk_entry_new();
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4167 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
4168
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4169 label = gtk_label_new(NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4170 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
4171 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
4172 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
4173 entry = gtk_entry_new();
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4174 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
4175 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
4176
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4177 label = gtk_label_new(" ");
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4178 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
4179
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4180 bbox = gtk_hbutton_box_new();
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4181 button = gtk_button_new_with_mnemonic(_("_Login"));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4182 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
4183 gtk_container_add(GTK_CONTAINER(bbox), button);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4184
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4185
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4186 label = gtk_label_new(NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4187 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
4188
15821
cebfc6af3eb5 More Gaim to Pidgin stuff
Sean Egan <seanegan@gmail.com>
parents: 15738
diff changeset
4189 gtk_container_set_border_width(GTK_CONTAINER(ret), PIDGIN_HIG_BORDER);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4190
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4191 gtk_widget_show_all(ret);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4192 return ret;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4193 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4194 #endif
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4195
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
4196 static void pidgin_blist_show(PurpleBuddyList *list)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4197 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4198 void *handle;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4199 GtkCellRenderer *rend;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4200 GtkTreeViewColumn *column;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4201 GtkWidget *menu;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4202 GtkWidget *ebox;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4203 GtkWidget *sw;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4204 GtkWidget *sep;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4205 GtkWidget *label;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4206 GList *accounts;
16010
eae8e127e4fb make things cleaner for translators
Nathan Walp <nwalp@pidgin.im>
parents: 16007
diff changeset
4207 char *pretty, *tmp;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4208 GtkAccelGroup *accel_group;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4209 GtkTreeSelection *selection;
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
4210 GtkTargetEntry dte[] = {{"PURPLE_BLIST_NODE", GTK_TARGET_SAME_APP, DRAG_ROW},
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4211 {"application/x-im-contact", 0, DRAG_BUDDY},
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4212 {"text/x-vcard", 0, DRAG_VCARD },
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4213 {"text/uri-list", 0, DRAG_URI},
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4214 {"text/plain", 0, DRAG_TEXT}};
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
4215 GtkTargetEntry ste[] = {{"PURPLE_BLIST_NODE", GTK_TARGET_SAME_APP, DRAG_ROW},
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4216 {"application/x-im-contact", 0, DRAG_BUDDY},
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4217 {"text/x-vcard", 0, DRAG_VCARD }};
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4218 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
4219 purple_blist_set_visible(purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/blist/list_visible"));
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4220 return;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4221 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4222
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
4223 gtkblist = PIDGIN_BLIST(list);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4224
15448
a75f1459b578 re-indentation.
Nathan Walp <nwalp@pidgin.im>
parents: 15444
diff changeset
4225 gtkblist->empty_avatar = gdk_pixbuf_new(GDK_COLORSPACE_RGB, TRUE, 8, 32, 32);
a75f1459b578 re-indentation.
Nathan Walp <nwalp@pidgin.im>
parents: 15444
diff changeset
4226 gdk_pixbuf_fill(gtkblist->empty_avatar, 0x00000000);
15397
a8ee645e7fb4 A lot of status icon changes:
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
4227
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4228 gtkblist->window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4229 gtk_window_set_role(GTK_WINDOW(gtkblist->window), "buddy_list");
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4230 gtk_window_set_title(GTK_WINDOW(gtkblist->window), _("Buddy List"));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4231 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
4232 G_CALLBACK(blist_focus_cb), gtkblist);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4233 GTK_WINDOW(gtkblist->window)->allow_shrink = TRUE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4234
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4235 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
4236 gtk_widget_show(gtkblist->main_vbox);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4237 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
4238
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4239 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
4240 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
4241 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
4242 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
4243 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
4244 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
4245
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4246 /******************************* Menu bar *************************************/
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4247 accel_group = gtk_accel_group_new();
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4248 gtk_window_add_accel_group(GTK_WINDOW (gtkblist->window), accel_group);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4249 g_object_unref(accel_group);
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
4250 gtkblist->ift = gtk_item_factory_new(GTK_TYPE_MENU_BAR, "<PurpleMain>", accel_group);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4251 gtk_item_factory_set_translate_func(gtkblist->ift,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4252 (GtkTranslateFunc)item_factory_translate_func,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4253 NULL, NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4254 gtk_item_factory_create_items(gtkblist->ift, sizeof(blist_menu) / sizeof(*blist_menu),
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4255 blist_menu, NULL);
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
4256 pidgin_load_accels();
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4257 g_signal_connect(G_OBJECT(accel_group), "accel-changed",
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
4258 G_CALLBACK(pidgin_save_accels_cb), NULL);
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
4259 menu = gtk_item_factory_get_widget(gtkblist->ift, "<PurpleMain>");
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
4260 gtkblist->menutray = pidgin_menu_tray_new();
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4261 gtk_menu_shell_append(GTK_MENU_SHELL(menu), gtkblist->menutray);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4262 gtk_widget_show(gtkblist->menutray);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4263 gtk_widget_show(menu);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4264 gtk_box_pack_start(GTK_BOX(gtkblist->main_vbox), menu, FALSE, FALSE, 0);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4265
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4266 accountmenu = gtk_item_factory_get_widget(gtkblist->ift, N_("/Accounts"));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4267
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4268
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4269 /****************************** Notebook *************************************/
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4270 gtkblist->notebook = gtk_notebook_new();
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4271 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
4272 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
4273 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
4274
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4275 #if 0
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4276 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
4277 #endif
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4278
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4279 /* 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
4280 tmp = g_strdup_printf(_("<span weight='bold' size='larger'>Welcome to %s!</span>\n\n"
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4281
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4282 "You have no accounts enabled. Enable your IM accounts from the "
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4283 "<b>Accounts</b> window at <b>Accounts->Add/Edit</b>. Once you "
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4284 "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
4285 "and talk to your friends."), PIDGIN_NAME);
eae8e127e4fb make things cleaner for translators
Nathan Walp <nwalp@pidgin.im>
parents: 16007
diff changeset
4286 pretty = pidgin_make_pretty_arrows(tmp);
eae8e127e4fb make things cleaner for translators
Nathan Walp <nwalp@pidgin.im>
parents: 16007
diff changeset
4287 g_free(tmp);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4288 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
4289 gtk_widget_set_size_request(label, purple_prefs_get_int(PIDGIN_PREFS_ROOT "/blist/width") - 12, -1);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4290 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
4291 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
4292 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
4293 g_free(pretty);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4294 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
4295 gtkblist->vbox = gtk_vbox_new(FALSE, 0);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4296 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
4297 gtk_widget_show_all(gtkblist->notebook);
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
4298 if ((accounts = purple_accounts_get_all_active())) {
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4299 g_list_free(accounts);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4300 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
4301 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4302
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4303 ebox = gtk_event_box_new();
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4304 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
4305 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
4306 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
4307 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
4308 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
4309 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
4310 gtkblist->headline_label = gtk_label_new(NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4311 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
4312 purple_prefs_get_int(PIDGIN_PREFS_ROOT "/blist/width")-25,-1);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4313 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
4314 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
4315 gtk_box_pack_start(GTK_BOX(gtkblist->headline_hbox), gtkblist->headline_label, TRUE, TRUE, 0);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4316 g_signal_connect(gtkblist->headline_hbox,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4317 "style-set",
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4318 G_CALLBACK(headline_style_set),
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4319 NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4320 g_signal_connect (gtkblist->headline_hbox,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4321 "expose_event",
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4322 G_CALLBACK (paint_headline_hbox),
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4323 NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4324 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
4325
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4326 gtkblist->headline_close = gtk_widget_render_icon(ebox, GTK_STOCK_CLOSE, -1, NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4327 if (gtkblist->headline_close) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4328 GdkPixbuf *scale = gdk_pixbuf_scale_simple(gtkblist->headline_close,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4329 HEADLINE_CLOSE_SIZE, HEADLINE_CLOSE_SIZE, GDK_INTERP_BILINEAR);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4330 gdk_pixbuf_unref(gtkblist->headline_close);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4331 gtkblist->headline_close = scale;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4332 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4333
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4334 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
4335 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
4336
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4337 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
4338 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
4339 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
4340 #if 0
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4341 /* I couldn't get this to work. The idea was to draw the focus-border only
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4342 * when hovering over the close image. So for now, the focus-border is
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4343 * always there. -- sad */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4344 gtk_widget_set_events(ebox, gtk_widget_get_events(ebox) | GDK_POINTER_MOTION_HINT_MASK);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4345 g_signal_connect(G_OBJECT(ebox), "motion-notify-event", G_CALLBACK(headline_box_motion_cb), gtkblist);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4346 #endif
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 /****************************** GtkTreeView **********************************/
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4349 sw = gtk_scrolled_window_new(NULL,NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4350 gtk_widget_show(sw);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4351 gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW(sw), GTK_SHADOW_NONE);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4352 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4353
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4354 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
4355 GDK_TYPE_PIXBUF, /* Status icon */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4356 G_TYPE_BOOLEAN, /* Status icon visible */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4357 G_TYPE_STRING, /* Name */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4358 G_TYPE_STRING, /* Idle */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4359 G_TYPE_BOOLEAN, /* Idle visible */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4360 GDK_TYPE_PIXBUF, /* Buddy icon */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4361 G_TYPE_BOOLEAN, /* Buddy icon visible */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4362 G_TYPE_POINTER, /* Node */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4363 GDK_TYPE_COLOR, /* bgcolor */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4364 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
4365 G_TYPE_BOOLEAN, /* Group expander visible */
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4366 G_TYPE_BOOLEAN, /* Contact expander */
15463
0b6f337a46d5 Emblems in the blist
Sean Egan <seanegan@gmail.com>
parents: 15448
diff changeset
4367 G_TYPE_BOOLEAN, /* Contact expander visible */
0b6f337a46d5 Emblems in the blist
Sean Egan <seanegan@gmail.com>
parents: 15448
diff changeset
4368 GDK_TYPE_PIXBUF, /* Emblem */
0b6f337a46d5 Emblems in the blist
Sean Egan <seanegan@gmail.com>
parents: 15448
diff changeset
4369 G_TYPE_BOOLEAN); /* Emblem visible */
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4370
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4371 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
4372
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4373 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
4374 gtk_widget_set_name(gtkblist->treeview, "pidgin_blist_treeview");
15558
0324f69112f9 Make group background colors update when the theme changes.
Sean Egan <seanegan@gmail.com>
parents: 15553
diff changeset
4375
0324f69112f9 Make group background colors update when the theme changes.
Sean Egan <seanegan@gmail.com>
parents: 15553
diff changeset
4376 g_signal_connect(gtkblist->treeview,
0324f69112f9 Make group background colors update when the theme changes.
Sean Egan <seanegan@gmail.com>
parents: 15553
diff changeset
4377 "style-set",
0324f69112f9 Make group background colors update when the theme changes.
Sean Egan <seanegan@gmail.com>
parents: 15553
diff changeset
4378 G_CALLBACK(treeview_style_set), list);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4379 /* Set up selection stuff */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4380 selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(gtkblist->treeview));
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
4381 g_signal_connect(G_OBJECT(selection), "changed", G_CALLBACK(pidgin_blist_selection_changed), NULL);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4382
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4383 /* Set up dnd */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4384 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
4385 GDK_BUTTON1_MASK, ste, 3,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4386 GDK_ACTION_COPY);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4387 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
4388 dte, 5,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4389 GDK_ACTION_COPY | GDK_ACTION_MOVE);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4390
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
4391 g_signal_connect(G_OBJECT(gtkblist->treeview), "drag-data-received", G_CALLBACK(pidgin_blist_drag_data_rcv_cb), NULL);
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
4392 g_signal_connect(G_OBJECT(gtkblist->treeview), "drag-data-get", G_CALLBACK(pidgin_blist_drag_data_get_cb), NULL);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4393 #ifdef _WIN32
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
4394 g_signal_connect(G_OBJECT(gtkblist->treeview), "drag-begin", G_CALLBACK(pidgin_blist_drag_begin), NULL);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4395 #endif
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4396
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
4397 g_signal_connect(G_OBJECT(gtkblist->treeview), "drag-motion", G_CALLBACK(pidgin_blist_drag_motion_cb), NULL);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4398
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4399 /* Tooltips */
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
4400 g_signal_connect(G_OBJECT(gtkblist->treeview), "motion-notify-event", G_CALLBACK(pidgin_blist_motion_cb), NULL);
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
4401 g_signal_connect(G_OBJECT(gtkblist->treeview), "leave-notify-event", G_CALLBACK(pidgin_blist_leave_cb), NULL);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4402
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4403 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
4404
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4405 column = gtk_tree_view_column_new();
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4406 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
4407 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
4408 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
4409
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4410 gtkblist->text_column = column = gtk_tree_view_column_new ();
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
4411 rend = pidgin_cell_renderer_expander_new();
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4412 gtk_tree_view_column_pack_start(column, rend, FALSE);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4413 gtk_tree_view_column_set_attributes(column, rend,
16121
6167ee79ecd0 Set the disable maximize button hint on the blist. I couldn't find a window manager that supports this, but I bet win32 does.
Sean Egan <seanegan@gmail.com>
parents: 16102
diff changeset
4414 "visible", GROUP_EXPANDER_VISIBLE_COLUMN,
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4415 "expander-visible", GROUP_EXPANDER_COLUMN,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4416 #if GTK_CHECK_VERSION(2,6,0)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4417 "sensitive", GROUP_EXPANDER_COLUMN,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4418 "cell-background-gdk", BGCOLOR_COLUMN,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4419 #endif
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4420 NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4421
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
4422 rend = pidgin_cell_renderer_expander_new();
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4423 gtk_tree_view_column_pack_start(column, rend, FALSE);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4424 gtk_tree_view_column_set_attributes(column, rend,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4425 "expander-visible", CONTACT_EXPANDER_COLUMN,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4426 #if GTK_CHECK_VERSION(2,6,0)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4427 "sensitive", CONTACT_EXPANDER_COLUMN,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4428 "cell-background-gdk", BGCOLOR_COLUMN,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4429 #endif
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4430 "visible", CONTACT_EXPANDER_VISIBLE_COLUMN,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4431 NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4432
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4433 rend = gtk_cell_renderer_pixbuf_new();
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4434 gtk_tree_view_column_pack_start(column, rend, FALSE);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4435 gtk_tree_view_column_set_attributes(column, rend,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4436 "pixbuf", STATUS_ICON_COLUMN,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4437 "visible", STATUS_ICON_VISIBLE_COLUMN,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4438 #if GTK_CHECK_VERSION(2,6,0)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4439 "cell-background-gdk", BGCOLOR_COLUMN,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4440 #endif
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4441 NULL);
16121
6167ee79ecd0 Set the disable maximize button hint on the blist. I couldn't find a window manager that supports this, but I bet win32 does.
Sean Egan <seanegan@gmail.com>
parents: 16102
diff changeset
4442 g_object_set(rend, "xalign", 0.0, "xpad", 6, "ypad", 0, NULL);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4443
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4444 gtkblist->text_rend = rend = gtk_cell_renderer_text_new();
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4445 gtk_tree_view_column_pack_start (column, rend, TRUE);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4446 gtk_tree_view_column_set_attributes(column, rend,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4447 #if GTK_CHECK_VERSION(2,6,0)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4448 "cell-background-gdk", BGCOLOR_COLUMN,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4449 #endif
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4450 "markup", NAME_COLUMN,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4451 NULL);
16275
9a4854d71234 Patch #205, from SuperMMX. Fix a bug related to using F2 to alias
Mark Doliner <mark@kingant.net>
parents: 16222
diff changeset
4452 g_signal_connect(G_OBJECT(rend), "editing-started", G_CALLBACK(gtk_blist_renderer_editing_started_cb), NULL);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4453 g_signal_connect(G_OBJECT(rend), "edited", G_CALLBACK(gtk_blist_renderer_edited_cb), NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4454 g_object_set(rend, "ypad", 0, "yalign", 0.5, NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4455 #if GTK_CHECK_VERSION(2,6,0)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4456 g_object_set(rend, "ellipsize", PANGO_ELLIPSIZE_END, NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4457 #endif
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4458 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
4459
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4460 rend = gtk_cell_renderer_text_new();
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4461 g_object_set(rend, "xalign", 1.0, "ypad", 0, NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4462 gtk_tree_view_column_pack_start(column, rend, FALSE);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4463 gtk_tree_view_column_set_attributes(column, rend,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4464 "markup", IDLE_COLUMN,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4465 "visible", IDLE_VISIBLE_COLUMN,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4466 #if GTK_CHECK_VERSION(2,6,0)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4467 "cell-background-gdk", BGCOLOR_COLUMN,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4468 #endif
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4469 NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4470
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4471 rend = gtk_cell_renderer_pixbuf_new();
16092
2d9045592ed3 Add some padding between the emblem and the buddy icon
Sean Egan <seanegan@gmail.com>
parents: 16091
diff changeset
4472 g_object_set(rend, "xalign", 1.0, "yalign", 0.5, "ypad", 0, "xpad", 3, NULL);
15463
0b6f337a46d5 Emblems in the blist
Sean Egan <seanegan@gmail.com>
parents: 15448
diff changeset
4473 gtk_tree_view_column_pack_start(column, rend, FALSE);
0b6f337a46d5 Emblems in the blist
Sean Egan <seanegan@gmail.com>
parents: 15448
diff changeset
4474 gtk_tree_view_column_set_attributes(column, rend, "pixbuf", EMBLEM_COLUMN,
0b6f337a46d5 Emblems in the blist
Sean Egan <seanegan@gmail.com>
parents: 15448
diff changeset
4475 #if GTK_CHECK_VERSION(2,6,0)
0b6f337a46d5 Emblems in the blist
Sean Egan <seanegan@gmail.com>
parents: 15448
diff changeset
4476 "cell-background-gdk", BGCOLOR_COLUMN,
0b6f337a46d5 Emblems in the blist
Sean Egan <seanegan@gmail.com>
parents: 15448
diff changeset
4477 #endif
0b6f337a46d5 Emblems in the blist
Sean Egan <seanegan@gmail.com>
parents: 15448
diff changeset
4478 "visible", EMBLEM_VISIBLE_COLUMN, NULL);
0b6f337a46d5 Emblems in the blist
Sean Egan <seanegan@gmail.com>
parents: 15448
diff changeset
4479
0b6f337a46d5 Emblems in the blist
Sean Egan <seanegan@gmail.com>
parents: 15448
diff changeset
4480 rend = gtk_cell_renderer_pixbuf_new();
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4481 g_object_set(rend, "xalign", 1.0, "ypad", 0, NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4482 gtk_tree_view_column_pack_start(column, rend, FALSE);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4483 gtk_tree_view_column_set_attributes(column, rend, "pixbuf", BUDDY_ICON_COLUMN,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4484 #if GTK_CHECK_VERSION(2,6,0)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4485 "cell-background-gdk", BGCOLOR_COLUMN,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4486 #endif
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4487 "visible", BUDDY_ICON_VISIBLE_COLUMN,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4488 NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4489
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4490
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4491 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
4492 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
4493 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
4494 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
4495 g_signal_connect(G_OBJECT(gtkblist->treeview), "key-press-event", G_CALLBACK(gtk_blist_key_press_cb), NULL);
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
4496 g_signal_connect(G_OBJECT(gtkblist->treeview), "popup-menu", G_CALLBACK(pidgin_blist_popup_menu_cb), NULL);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4497
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4498 /* Enable CTRL+F searching */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4499 gtk_tree_view_set_search_column(GTK_TREE_VIEW(gtkblist->treeview), NAME_COLUMN);
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
4500 gtk_tree_view_set_search_equal_func(GTK_TREE_VIEW(gtkblist->treeview), pidgin_tree_view_search_equal_func, NULL, NULL);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4501
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4502 gtk_box_pack_start(GTK_BOX(gtkblist->vbox), sw, TRUE, TRUE, 0);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4503 gtk_container_add(GTK_CONTAINER(sw), gtkblist->treeview);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4504
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4505 sep = gtk_hseparator_new();
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4506 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
4507
15514
535f002e7b0f More pidgin changes
Sean Egan <seanegan@gmail.com>
parents: 15510
diff changeset
4508 gtkblist->scrollbook = pidgin_scroll_book_new();
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4509 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
4510
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4511 /* Create an empty vbox used for showing connection errors */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4512 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
4513 gtk_box_pack_start(GTK_BOX(gtkblist->vbox), gtkblist->error_buttons, FALSE, FALSE, 0);
17044
c28f4593f723 Pack connection error buttons the same way the statusbox is. Fixes #120
Sean Egan <seanegan@gmail.com>
parents: 17042
diff changeset
4514 gtk_container_set_border_width(GTK_CONTAINER(gtkblist->error_buttons), 3);
c28f4593f723 Pack connection error buttons the same way the statusbox is. Fixes #120
Sean Egan <seanegan@gmail.com>
parents: 17042
diff changeset
4515
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4516 /* Add the statusbox */
15514
535f002e7b0f More pidgin changes
Sean Egan <seanegan@gmail.com>
parents: 15510
diff changeset
4517 gtkblist->statusbox = pidgin_status_box_new();
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4518 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
4519 gtk_widget_set_name(gtkblist->statusbox, "pidgin_blist_statusbox");
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4520 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
4521 gtk_widget_show(gtkblist->statusbox);
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 /* 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
4524 * 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
4525 */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4526 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(gtk_item_factory_get_item (gtkblist->ift, N_("/Buddies/Show Offline Buddies"))),
16062
07554cc5d090 Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <stu@nosnilmot.com>
parents: 16010
diff changeset
4527 purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/blist/show_offline_buddies"));
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4528
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4529 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(gtk_item_factory_get_item (gtkblist->ift, N_("/Buddies/Show Empty Groups"))),
16062
07554cc5d090 Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <stu@nosnilmot.com>
parents: 16010
diff changeset
4530 purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/blist/show_empty_groups"));
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4531
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4532 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(gtk_item_factory_get_item (gtkblist->ift, N_("/Tools/Mute Sounds"))),
16062
07554cc5d090 Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <stu@nosnilmot.com>
parents: 16010
diff changeset
4533 purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/sound/mute"));
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4534
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4535 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(gtk_item_factory_get_item (gtkblist->ift, N_("/Buddies/Show Buddy Details"))),
16062
07554cc5d090 Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <stu@nosnilmot.com>
parents: 16010
diff changeset
4536 purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/blist/show_buddy_icons"));
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4537
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4538 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(gtk_item_factory_get_item (gtkblist->ift, N_("/Buddies/Show Idle Times"))),
16062
07554cc5d090 Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <stu@nosnilmot.com>
parents: 16010
diff changeset
4539 purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/blist/show_idle_time"));
07554cc5d090 Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <stu@nosnilmot.com>
parents: 16010
diff changeset
4540
07554cc5d090 Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <stu@nosnilmot.com>
parents: 16010
diff changeset
4541 if(!strcmp(purple_prefs_get_string(PIDGIN_PREFS_ROOT "/sound/method"), "none"))
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4542 gtk_widget_set_sensitive(gtk_item_factory_get_widget(gtkblist->ift, N_("/Tools/Mute Sounds")), FALSE);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4543
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4544 /* Update some dynamic things */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4545 update_menu_bar(gtkblist);
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
4546 pidgin_blist_update_plugin_actions();
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
4547 pidgin_blist_update_sort_methods();
15374
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 /* OK... let's show this bad boy. */
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
4550 pidgin_blist_refresh(list);
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
4551 pidgin_blist_restore_position();
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4552 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
4553 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
4554 purple_blist_set_visible(purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/blist/list_visible"));
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4555
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4556 /* start the refresh timer */
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
4557 gtkblist->refresh_timer = g_timeout_add(30000, (GSourceFunc)pidgin_blist_refresh_timer, list);
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
4558
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
4559 handle = pidgin_blist_get_handle();
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4560
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4561 /* 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
4562 purple_prefs_connect_callback(handle, PIDGIN_PREFS_ROOT "/blist/show_buddy_icons",
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4563 _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
4564 purple_prefs_connect_callback(handle, PIDGIN_PREFS_ROOT "/blist/show_idle_time",
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4565 _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
4566 purple_prefs_connect_callback(handle, PIDGIN_PREFS_ROOT "/blist/show_empty_groups",
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4567 _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
4568 purple_prefs_connect_callback(handle, PIDGIN_PREFS_ROOT "/blist/show_offline_buddies",
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4569 _prefs_change_redo_list, NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4570
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4571 /* 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
4572 purple_prefs_connect_callback(handle, PIDGIN_PREFS_ROOT "/blist/sort_type",
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4573 _prefs_change_sort_method, NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4574
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4575 /* 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
4576 purple_prefs_connect_callback(handle, PIDGIN_PREFS_ROOT "/sound/mute",
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
4577 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
4578 purple_prefs_connect_callback(handle, PIDGIN_PREFS_ROOT "/sound/method",
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
4579 pidgin_blist_sound_method_pref_cb, NULL);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4580
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
4581 /* Setup some purple signal handlers. */
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
4582 purple_signal_connect(purple_accounts_get_handle(), "account-enabled",
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
4583 gtkblist, PURPLE_CALLBACK(account_modified), gtkblist);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
4584 purple_signal_connect(purple_accounts_get_handle(), "account-disabled",
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
4585 gtkblist, PURPLE_CALLBACK(account_modified), gtkblist);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
4586 purple_signal_connect(purple_accounts_get_handle(), "account-removed",
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
4587 gtkblist, PURPLE_CALLBACK(account_modified), gtkblist);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
4588 purple_signal_connect(purple_accounts_get_handle(), "account-status-changed",
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
4589 gtkblist, PURPLE_CALLBACK(account_status_changed), gtkblist);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
4590
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
4591 purple_signal_connect(pidgin_account_get_handle(), "account-modified",
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
4592 gtkblist, PURPLE_CALLBACK(account_modified), gtkblist);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
4593
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
4594 purple_signal_connect(purple_connections_get_handle(), "signed-on",
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
4595 gtkblist, PURPLE_CALLBACK(sign_on_off_cb), list);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
4596 purple_signal_connect(purple_connections_get_handle(), "signed-off",
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
4597 gtkblist, PURPLE_CALLBACK(sign_on_off_cb), list);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
4598
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
4599 purple_signal_connect(purple_plugins_get_handle(), "plugin-load",
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
4600 gtkblist, PURPLE_CALLBACK(plugin_changed_cb), NULL);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
4601 purple_signal_connect(purple_plugins_get_handle(), "plugin-unload",
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
4602 gtkblist, PURPLE_CALLBACK(plugin_changed_cb), NULL);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
4603
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
4604 purple_signal_connect(purple_conversations_get_handle(), "conversation-updated",
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
4605 gtkblist, PURPLE_CALLBACK(conversation_updated_cb),
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4606 gtkblist);
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
4607 purple_signal_connect(purple_conversations_get_handle(), "deleting-conversation",
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
4608 gtkblist, PURPLE_CALLBACK(conversation_deleting_cb),
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4609 gtkblist);
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 gtk_widget_hide(gtkblist->headline_hbox);
17044
c28f4593f723 Pack connection error buttons the same way the statusbox is. Fixes #120
Sean Egan <seanegan@gmail.com>
parents: 17042
diff changeset
4612 gtk_widget_hide(gtkblist->error_buttons);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4613
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4614 /* emit our created signal */
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
4615 purple_signal_emit(handle, "gtkblist-created", list);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
4616 }
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
4617
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
4618 static void redo_buddy_list(PurpleBuddyList *list, gboolean remove, gboolean rerender)
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
4619 {
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
4620 PurpleBlistNode *node;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4621
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
4622 gtkblist = PIDGIN_BLIST(list);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4623 if(!gtkblist || !gtkblist->treeview)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4624 return;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4625
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4626 node = list->root;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4627
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4628 while (node)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4629 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4630 /* 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
4631 * 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
4632 */
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
4633 if (remove && !PURPLE_BLIST_NODE_IS_GROUP(node))
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
4634 pidgin_blist_hide_node(list, node, FALSE);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4635
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
4636 if (PURPLE_BLIST_NODE_IS_BUDDY(node))
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
4637 pidgin_blist_update_buddy(list, node, rerender);
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
4638 else if (PURPLE_BLIST_NODE_IS_CHAT(node))
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
4639 pidgin_blist_update(list, node);
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
4640 else if (PURPLE_BLIST_NODE_IS_GROUP(node))
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
4641 pidgin_blist_update(list, node);
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
4642 node = purple_blist_node_next(node, FALSE);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
4643 }
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
4644
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
4645 }
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
4646
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
4647 void pidgin_blist_refresh(PurpleBuddyList *list)
15374
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 redo_buddy_list(list, FALSE, TRUE);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4650 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4651
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4652 void
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
4653 pidgin_blist_update_refresh_timeout()
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4654 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
4655 PurpleBuddyList *blist;
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
4656 PidginBuddyList *gtkblist;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4657
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
4658 blist = purple_get_blist();
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
4659 gtkblist = PIDGIN_BLIST(purple_get_blist());
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
4660
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
4661 gtkblist->refresh_timer = g_timeout_add(30000,(GSourceFunc)pidgin_blist_refresh_timer, blist);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4662 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4663
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
4664 static gboolean get_iter_from_node(PurpleBlistNode *node, GtkTreeIter *iter) {
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
4665 struct _pidgin_blist_node *gtknode = (struct _pidgin_blist_node *)node->ui_data;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4666 GtkTreePath *path;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4667
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4668 if (!gtknode) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4669 return FALSE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4670 }
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 if (!gtkblist) {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
4673 purple_debug_error("gtkblist", "get_iter_from_node was called, but we don't seem to have a blist\n");
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4674 return FALSE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4675 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4676
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4677 if (!gtknode->row)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4678 return FALSE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4679
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4680
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4681 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
4682 return FALSE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4683
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4684 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
4685 gtk_tree_path_free(path);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4686 return FALSE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4687 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4688 gtk_tree_path_free(path);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4689 return TRUE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4690 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4691
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
4692 static void pidgin_blist_remove(PurpleBuddyList *list, PurpleBlistNode *node)
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
4693 {
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
4694 struct _pidgin_blist_node *gtknode = node->ui_data;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4695
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
4696 purple_request_close_with_handle(node);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4697
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
4698 pidgin_blist_hide_node(list, node, TRUE);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4699
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4700 if(node->parent)
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
4701 pidgin_blist_update(list, node->parent);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4702
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4703 /* 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
4704 /* 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
4705 * 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
4706 * 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
4707 * comment it out again. Stu */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4708 /* 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
4709 * contacts, the dragged buddy mysteriously 'disappears'. Stu. */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4710 /* I think it's fixed now. Stu. */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4711
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4712 if(gtknode) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4713 if(gtknode->recent_signonoff_timer > 0)
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
4714 purple_timeout_remove(gtknode->recent_signonoff_timer);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4715
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4716 g_free(node->ui_data);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4717 node->ui_data = NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4718 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4719 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4720
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
4721 static gboolean do_selection_changed(PurpleBlistNode *new_selection)
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
4722 {
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
4723 PurpleBlistNode *old_selection = NULL;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4724
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4725 /* 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
4726 if (gtkblist && new_selection != gtkblist->selected_node) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4727 old_selection = gtkblist->selected_node;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4728 gtkblist->selected_node = new_selection;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4729 if(new_selection)
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
4730 pidgin_blist_update(NULL, new_selection);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4731 if(old_selection)
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
4732 pidgin_blist_update(NULL, old_selection);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4733 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4734
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4735 return FALSE;
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
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
4738 static void pidgin_blist_selection_changed(GtkTreeSelection *selection, gpointer data)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4739 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
4740 PurpleBlistNode *new_selection = NULL;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4741 GtkTreeIter iter;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4742
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4743 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
4744 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
4745 NODE_COLUMN, &new_selection, -1);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4746 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4747
17674
0e4a789cd027 We use a timeout in our blist selection changed callback to prevent buddy
Stu Tomlinson <stu@nosnilmot.com>
parents: 17488
diff changeset
4748 /* we set this up as a timeout, otherwise the blist flickers ...
0e4a789cd027 We use a timeout in our blist selection changed callback to prevent buddy
Stu Tomlinson <stu@nosnilmot.com>
parents: 17488
diff changeset
4749 * but we don't do it for groups, because it causes total bizarness -
0e4a789cd027 We use a timeout in our blist selection changed callback to prevent buddy
Stu Tomlinson <stu@nosnilmot.com>
parents: 17488
diff changeset
4750 * the previously selected buddy node might rendered at half height.
0e4a789cd027 We use a timeout in our blist selection changed callback to prevent buddy
Stu Tomlinson <stu@nosnilmot.com>
parents: 17488
diff changeset
4751 */
0e4a789cd027 We use a timeout in our blist selection changed callback to prevent buddy
Stu Tomlinson <stu@nosnilmot.com>
parents: 17488
diff changeset
4752 if ((new_selection != NULL) && PURPLE_BLIST_NODE_IS_GROUP(new_selection)) {
0e4a789cd027 We use a timeout in our blist selection changed callback to prevent buddy
Stu Tomlinson <stu@nosnilmot.com>
parents: 17488
diff changeset
4753 do_selection_changed(new_selection);
0e4a789cd027 We use a timeout in our blist selection changed callback to prevent buddy
Stu Tomlinson <stu@nosnilmot.com>
parents: 17488
diff changeset
4754 } else {
0e4a789cd027 We use a timeout in our blist selection changed callback to prevent buddy
Stu Tomlinson <stu@nosnilmot.com>
parents: 17488
diff changeset
4755 g_timeout_add(0, (GSourceFunc)do_selection_changed, new_selection);
0e4a789cd027 We use a timeout in our blist selection changed callback to prevent buddy
Stu Tomlinson <stu@nosnilmot.com>
parents: 17488
diff changeset
4756 }
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4757 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4758
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
4759 static gboolean insert_node(PurpleBuddyList *list, PurpleBlistNode *node, GtkTreeIter *iter)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4760 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4761 GtkTreeIter parent_iter, cur, *curptr = NULL;
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
4762 struct _pidgin_blist_node *gtknode = node->ui_data;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4763 GtkTreePath *newpath;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4764
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4765 if(!iter)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4766 return FALSE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4767
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4768 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
4769 return FALSE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4770
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4771 if(get_iter_from_node(node, &cur))
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4772 curptr = &cur;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4773
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
4774 if(PURPLE_BLIST_NODE_IS_CONTACT(node) || PURPLE_BLIST_NODE_IS_CHAT(node)) {
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4775 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
4776 } else {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4777 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
4778 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4779
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4780 if(gtknode != NULL) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4781 gtk_tree_row_reference_free(gtknode->row);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4782 } else {
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
4783 pidgin_blist_new_node(node);
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
4784 gtknode = (struct _pidgin_blist_node *)node->ui_data;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4785 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4786
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4787 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
4788 iter);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4789 gtknode->row =
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4790 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
4791 newpath);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4792
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4793 gtk_tree_path_free(newpath);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4794
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4795 gtk_tree_store_set(gtkblist->treemodel, iter,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4796 NODE_COLUMN, node,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4797 -1);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4798
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4799 if(node->parent) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4800 GtkTreePath *expand = NULL;
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
4801 struct _pidgin_blist_node *gtkparentnode = node->parent->ui_data;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4802
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
4803 if(PURPLE_BLIST_NODE_IS_GROUP(node->parent)) {
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
4804 if(!purple_blist_node_get_bool(node->parent, "collapsed"))
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4805 expand = gtk_tree_model_get_path(GTK_TREE_MODEL(gtkblist->treemodel), &parent_iter);
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
4806 } else if(PURPLE_BLIST_NODE_IS_CONTACT(node->parent) &&
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4807 gtkparentnode->contact_expanded) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4808 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
4809 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4810 if(expand) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4811 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
4812 gtk_tree_path_free(expand);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4813 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4814 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4815
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4816 return TRUE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4817 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4818
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
4819 /*This version of pidgin_blist_update_group can take the original buddy
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4820 or a group, but has much better algorithmic performance with a pre-known buddy*/
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
4821 static void pidgin_blist_update_group(PurpleBuddyList *list, PurpleBlistNode *node)
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
4822 {
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
4823 PurpleGroup *group;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4824 int count;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4825 gboolean show = FALSE;
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
4826 PurpleBlistNode* gnode;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4827
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4828 g_return_if_fail(node != NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4829
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
4830 if (PURPLE_BLIST_NODE_IS_GROUP(node))
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4831 gnode = node;
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
4832 else if (PURPLE_BLIST_NODE_IS_BUDDY(node))
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4833 gnode = node->parent->parent;
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
4834 else if (PURPLE_BLIST_NODE_IS_CONTACT(node) || PURPLE_BLIST_NODE_IS_CHAT(node))
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4835 gnode = node->parent;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4836 else
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4837 return;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4838
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
4839 group = (PurpleGroup*)gnode;
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
4840
16062
07554cc5d090 Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <stu@nosnilmot.com>
parents: 16010
diff changeset
4841 if(purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/blist/show_offline_buddies"))
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
4842 count = purple_blist_get_group_size(group, FALSE);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4843 else
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
4844 count = purple_blist_get_group_online_count(group);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
4845
16062
07554cc5d090 Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <stu@nosnilmot.com>
parents: 16010
diff changeset
4846 if (count > 0 || purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/blist/show_empty_groups"))
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4847 show = TRUE;
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
4848 else if (PURPLE_BLIST_NODE_IS_BUDDY(node)){ /* Or chat? */
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
4849 if (buddy_is_displayable((PurpleBuddy*)node))
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4850 show = TRUE;}
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4851
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4852 if (show) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4853 GtkTreeIter iter;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4854 GtkTreePath *path;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4855 gboolean expanded;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4856 GdkColor bgcolor;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4857 char *title;
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
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4860 if(!insert_node(list, gnode, &iter))
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4861 return;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4862
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4863 bgcolor = gtkblist->treeview->style->bg[GTK_STATE_ACTIVE];
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4864
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4865 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
4866 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
4867 gtk_tree_path_free(path);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4868
15821
cebfc6af3eb5 More Gaim to Pidgin stuff
Sean Egan <seanegan@gmail.com>
parents: 15738
diff changeset
4869 title = pidgin_get_group_title(gnode, expanded);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4870
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4871 gtk_tree_store_set(gtkblist->treemodel, &iter,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4872 STATUS_ICON_VISIBLE_COLUMN, FALSE,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4873 STATUS_ICON_COLUMN, NULL,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4874 NAME_COLUMN, title,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4875 NODE_COLUMN, gnode,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4876 BGCOLOR_COLUMN, &bgcolor,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4877 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
4878 GROUP_EXPANDER_VISIBLE_COLUMN, TRUE,
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4879 CONTACT_EXPANDER_VISIBLE_COLUMN, FALSE,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4880 BUDDY_ICON_VISIBLE_COLUMN, FALSE,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4881 IDLE_VISIBLE_COLUMN, FALSE,
15463
0b6f337a46d5 Emblems in the blist
Sean Egan <seanegan@gmail.com>
parents: 15448
diff changeset
4882 EMBLEM_VISIBLE_COLUMN, FALSE,
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4883 -1);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4884 g_free(title);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4885 } else {
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
4886 pidgin_blist_hide_node(list, gnode, TRUE);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4887 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4888 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4889
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
4890 static char *pidgin_get_group_title(PurpleBlistNode *gnode, gboolean expanded)
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
4891 {
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
4892 PurpleGroup *group;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4893 GdkColor textcolor;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4894 gboolean selected;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4895 char group_count[12] = "";
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4896 char *mark, *esc;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4897
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
4898 group = (PurpleGroup*)gnode;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4899 textcolor = gtkblist->treeview->style->fg[GTK_STATE_ACTIVE];
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4900 selected = gtkblist ? (gtkblist->selected_node == gnode) : FALSE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4901
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4902 if (!expanded) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4903 g_snprintf(group_count, sizeof(group_count), " (%d/%d)",
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
4904 purple_blist_get_group_online_count(group),
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
4905 purple_blist_get_group_size(group, FALSE));
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4906 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4907
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4908 esc = g_markup_escape_text(group->name, -1);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4909 if (selected)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4910 mark = g_strdup_printf("<span weight='bold'>%s</span>%s", esc, group_count);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4911 else
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4912 mark = g_strdup_printf("<span color='#%02x%02x%02x' weight='bold'>%s</span>%s",
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4913 textcolor.red>>8, textcolor.green>>8, textcolor.blue>>8,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4914 esc, group_count);
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 g_free(esc);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4917 return mark;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4918 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4919
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
4920 static void buddy_node(PurpleBuddy *buddy, GtkTreeIter *iter, PurpleBlistNode *node)
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
4921 {
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
4922 PurplePresence *presence;
15463
0b6f337a46d5 Emblems in the blist
Sean Egan <seanegan@gmail.com>
parents: 15448
diff changeset
4923 GdkPixbuf *status, *avatar, *emblem;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4924 char *mark;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4925 char *idle = NULL;
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
4926 gboolean expanded = ((struct _pidgin_blist_node *)(node->parent->ui_data))->contact_expanded;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4927 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
4928 gboolean biglist = purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/blist/show_buddy_icons");
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
4929 presence = purple_buddy_get_presence(buddy);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
4930
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
4931 status = pidgin_blist_get_status_icon((PurpleBlistNode*)buddy,
15508
94031a2b0aaa gtkblist changes to pidgin
Sean Egan <seanegan@gmail.com>
parents: 15507
diff changeset
4932 PIDGIN_STATUS_ICON_SMALL);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4933
16905
aa87ecd650d2 Speed up blist manipulations, by Scott Wolchok (EvilSporkMan)
Ethan Blanton <elb@pidgin.im>
parents: 16858
diff changeset
4934 /* Speed it up if we don't want buddy icons. */
aa87ecd650d2 Speed up blist manipulations, by Scott Wolchok (EvilSporkMan)
Ethan Blanton <elb@pidgin.im>
parents: 16858
diff changeset
4935 if(biglist)
aa87ecd650d2 Speed up blist manipulations, by Scott Wolchok (EvilSporkMan)
Ethan Blanton <elb@pidgin.im>
parents: 16858
diff changeset
4936 avatar = pidgin_blist_get_buddy_icon((PurpleBlistNode *)buddy, TRUE, TRUE);
aa87ecd650d2 Speed up blist manipulations, by Scott Wolchok (EvilSporkMan)
Ethan Blanton <elb@pidgin.im>
parents: 16858
diff changeset
4937 else
aa87ecd650d2 Speed up blist manipulations, by Scott Wolchok (EvilSporkMan)
Ethan Blanton <elb@pidgin.im>
parents: 16858
diff changeset
4938 avatar = NULL;
aa87ecd650d2 Speed up blist manipulations, by Scott Wolchok (EvilSporkMan)
Ethan Blanton <elb@pidgin.im>
parents: 16858
diff changeset
4939
15397
a8ee645e7fb4 A lot of status icon changes:
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
4940 if (!avatar) {
a8ee645e7fb4 A lot of status icon changes:
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
4941 g_object_ref(G_OBJECT(gtkblist->empty_avatar));
a8ee645e7fb4 A lot of status icon changes:
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
4942 avatar = gtkblist->empty_avatar;
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
4943 } else if ((!PURPLE_BUDDY_IS_ONLINE(buddy) || purple_presence_is_idle(presence))) {
15491
88070d5f4c62 dim buddy icons on idle and offline. Still need to do status icons.
Sean Egan <seanegan@gmail.com>
parents: 15490
diff changeset
4944 do_alphashift(avatar, avatar, 77);
88070d5f4c62 dim buddy icons on idle and offline. Still need to do status icons.
Sean Egan <seanegan@gmail.com>
parents: 15490
diff changeset
4945 }
88070d5f4c62 dim buddy icons on idle and offline. Still need to do status icons.
Sean Egan <seanegan@gmail.com>
parents: 15490
diff changeset
4946
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
4947 emblem = pidgin_blist_get_emblem((PurpleBlistNode*) buddy);
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
4948 mark = pidgin_blist_get_name_markup(buddy, selected);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4949
16062
07554cc5d090 Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <stu@nosnilmot.com>
parents: 16010
diff changeset
4950 if (purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/blist/show_idle_time") &&
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
4951 purple_presence_is_idle(presence) &&
16062
07554cc5d090 Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <stu@nosnilmot.com>
parents: 16010
diff changeset
4952 !purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/blist/show_buddy_icons"))
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4953 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
4954 time_t idle_secs = purple_presence_get_idle_time(presence);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4955
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4956 if (idle_secs > 0)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4957 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4958 time_t t;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4959 int ihrs, imin;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4960 time(&t);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4961 ihrs = (t - idle_secs) / 3600;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4962 imin = ((t - idle_secs) / 60) % 60;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4963 idle = g_strdup_printf("%d:%02d", ihrs, imin);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4964 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4965 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4966
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
4967 if (purple_presence_is_idle(presence))
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4968 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4969 if (idle && !selected) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4970 char *i2 = g_strdup_printf("<span color='%s'>%s</span>",
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4971 dim_grey(), idle);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4972 g_free(idle);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4973 idle = i2;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4974 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4975 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4976
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4977 gtk_tree_store_set(gtkblist->treemodel, iter,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4978 STATUS_ICON_COLUMN, status,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4979 STATUS_ICON_VISIBLE_COLUMN, TRUE,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4980 NAME_COLUMN, mark,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4981 IDLE_COLUMN, idle,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4982 IDLE_VISIBLE_COLUMN, !biglist && idle,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4983 BUDDY_ICON_COLUMN, avatar,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4984 BUDDY_ICON_VISIBLE_COLUMN, biglist,
15463
0b6f337a46d5 Emblems in the blist
Sean Egan <seanegan@gmail.com>
parents: 15448
diff changeset
4985 EMBLEM_COLUMN, emblem,
0b6f337a46d5 Emblems in the blist
Sean Egan <seanegan@gmail.com>
parents: 15448
diff changeset
4986 EMBLEM_VISIBLE_COLUMN, emblem,
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4987 BGCOLOR_COLUMN, NULL,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4988 CONTACT_EXPANDER_COLUMN, NULL,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4989 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
4990 GROUP_EXPANDER_VISIBLE_COLUMN, FALSE,
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4991 -1);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4992
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4993 g_free(mark);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4994 g_free(idle);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4995 if(status)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4996 g_object_unref(status);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4997 if(avatar)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4998 g_object_unref(avatar);
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
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5001 /* 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
5002 can know in advance which buddy has changed so we can just update that */
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
5003 static void pidgin_blist_update_contact(PurpleBuddyList *list, PurpleBlistNode *node)
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
5004 {
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
5005 PurpleBlistNode *cnode;
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
5006 PurpleContact *contact;
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
5007 PurpleBuddy *buddy;
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
5008 struct _pidgin_blist_node *gtknode;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5009
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
5010 if (PURPLE_BLIST_NODE_IS_BUDDY(node))
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5011 cnode = node->parent;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5012 else
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5013 cnode = node;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5014
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
5015 g_return_if_fail(PURPLE_BLIST_NODE_IS_CONTACT(cnode));
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5016
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5017 /* First things first, update the group */
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
5018 if (PURPLE_BLIST_NODE_IS_BUDDY(node))
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
5019 pidgin_blist_update_group(list, node);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5020 else
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
5021 pidgin_blist_update_group(list, cnode->parent);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5022
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
5023 contact = (PurpleContact*)cnode;
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
5024 buddy = purple_contact_get_priority_buddy(contact);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5025
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5026 if (buddy_is_displayable(buddy))
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 GtkTreeIter iter;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5029
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5030 if(!insert_node(list, cnode, &iter))
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5031 return;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5032
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
5033 gtknode = (struct _pidgin_blist_node *)cnode->ui_data;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5034
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5035 if(gtknode->contact_expanded) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5036 GdkPixbuf *status;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5037 char *mark;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5038
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
5039 status = pidgin_blist_get_status_icon(cnode,
15508
94031a2b0aaa gtkblist changes to pidgin
Sean Egan <seanegan@gmail.com>
parents: 15507
diff changeset
5040 PIDGIN_STATUS_ICON_SMALL);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5041
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
5042 mark = g_markup_escape_text(purple_contact_get_alias(contact), -1);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5043 gtk_tree_store_set(gtkblist->treemodel, &iter,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5044 STATUS_ICON_COLUMN, status,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5045 STATUS_ICON_VISIBLE_COLUMN, TRUE,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5046 NAME_COLUMN, mark,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5047 IDLE_COLUMN, NULL,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5048 IDLE_VISIBLE_COLUMN, FALSE,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5049 BGCOLOR_COLUMN, NULL,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5050 BUDDY_ICON_COLUMN, NULL,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5051 CONTACT_EXPANDER_COLUMN, TRUE,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5052 CONTACT_EXPANDER_VISIBLE_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
5053 GROUP_EXPANDER_VISIBLE_COLUMN, FALSE,
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5054 -1);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5055 g_free(mark);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5056 if(status)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5057 g_object_unref(status);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5058 } else {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5059 buddy_node(buddy, &iter, cnode);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5060 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5061 } else {
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
5062 pidgin_blist_hide_node(list, cnode, TRUE);
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
5063 }
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
5064 }
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
5065
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
5066
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
5067
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
5068 static void pidgin_blist_update_buddy(PurpleBuddyList *list, PurpleBlistNode *node, gboolean statusChange)
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
5069 {
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
5070 PurpleBuddy *buddy;
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
5071 struct _pidgin_blist_node *gtkparentnode;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5072
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
5073 g_return_if_fail(PURPLE_BLIST_NODE_IS_BUDDY(node));
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5074
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5075 if (node->parent == NULL)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5076 return;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5077
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
5078 buddy = (PurpleBuddy*)node;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5079
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5080 /* First things first, update the contact */
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
5081 pidgin_blist_update_contact(list, node);
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
5082
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
5083 gtkparentnode = (struct _pidgin_blist_node *)node->parent->ui_data;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5084
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5085 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
5086 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5087 GtkTreeIter iter;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5088
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5089 if (!insert_node(list, node, &iter))
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5090 return;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5091
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5092 buddy_node(buddy, &iter, node);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5093
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5094 } else {
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
5095 pidgin_blist_hide_node(list, node, TRUE);
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
5096 }
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
5097
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
5098 }
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
5099
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
5100 static void pidgin_blist_update_chat(PurpleBuddyList *list, PurpleBlistNode *node)
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
5101 {
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
5102 PurpleChat *chat;
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
5103
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
5104 g_return_if_fail(PURPLE_BLIST_NODE_IS_CHAT(node));
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5105
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5106 /* First things first, update the group */
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
5107 pidgin_blist_update_group(list, node->parent);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5108
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
5109 chat = (PurpleChat*)node;
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
5110
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
5111 if(purple_account_is_connected(chat->account)) {
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5112 GtkTreeIter iter;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5113 GdkPixbuf *status;
15423
051a5c4f0917 this would use the protocol icons in place of the buddy icon for chats,
Nathan Walp <nwalp@pidgin.im>
parents: 15418
diff changeset
5114 GdkPixbuf *avatar;
15463
0b6f337a46d5 Emblems in the blist
Sean Egan <seanegan@gmail.com>
parents: 15448
diff changeset
5115 GdkPixbuf *emblem;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5116 char *mark;
16905
aa87ecd650d2 Speed up blist manipulations, by Scott Wolchok (EvilSporkMan)
Ethan Blanton <elb@pidgin.im>
parents: 16858
diff changeset
5117 gboolean showicons = purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/blist/show_buddy_icons");
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5118
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5119 if(!insert_node(list, node, &iter))
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5120 return;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5121
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
5122 status = pidgin_blist_get_status_icon(node,
15508
94031a2b0aaa gtkblist changes to pidgin
Sean Egan <seanegan@gmail.com>
parents: 15507
diff changeset
5123 PIDGIN_STATUS_ICON_SMALL);
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
5124 emblem = pidgin_blist_get_emblem(node);
16905
aa87ecd650d2 Speed up blist manipulations, by Scott Wolchok (EvilSporkMan)
Ethan Blanton <elb@pidgin.im>
parents: 16858
diff changeset
5125
aa87ecd650d2 Speed up blist manipulations, by Scott Wolchok (EvilSporkMan)
Ethan Blanton <elb@pidgin.im>
parents: 16858
diff changeset
5126 /* Speed it up if we don't want buddy icons. */
aa87ecd650d2 Speed up blist manipulations, by Scott Wolchok (EvilSporkMan)
Ethan Blanton <elb@pidgin.im>
parents: 16858
diff changeset
5127 if(showicons)
aa87ecd650d2 Speed up blist manipulations, by Scott Wolchok (EvilSporkMan)
Ethan Blanton <elb@pidgin.im>
parents: 16858
diff changeset
5128 avatar = pidgin_blist_get_buddy_icon(node, TRUE, FALSE);
aa87ecd650d2 Speed up blist manipulations, by Scott Wolchok (EvilSporkMan)
Ethan Blanton <elb@pidgin.im>
parents: 16858
diff changeset
5129 else
aa87ecd650d2 Speed up blist manipulations, by Scott Wolchok (EvilSporkMan)
Ethan Blanton <elb@pidgin.im>
parents: 16858
diff changeset
5130 avatar = NULL;
15423
051a5c4f0917 this would use the protocol icons in place of the buddy icon for chats,
Nathan Walp <nwalp@pidgin.im>
parents: 15418
diff changeset
5131
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
5132 mark = g_markup_escape_text(purple_chat_get_name(chat), -1);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5133
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5134 gtk_tree_store_set(gtkblist->treemodel, &iter,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5135 STATUS_ICON_COLUMN, status,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5136 STATUS_ICON_VISIBLE_COLUMN, TRUE,
15423
051a5c4f0917 this would use the protocol icons in place of the buddy icon for chats,
Nathan Walp <nwalp@pidgin.im>
parents: 15418
diff changeset
5137 BUDDY_ICON_COLUMN, avatar ? avatar : gtkblist->empty_avatar,
16062
07554cc5d090 Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <stu@nosnilmot.com>
parents: 16010
diff changeset
5138 BUDDY_ICON_VISIBLE_COLUMN, purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/blist/show_buddy_icons"),
15463
0b6f337a46d5 Emblems in the blist
Sean Egan <seanegan@gmail.com>
parents: 15448
diff changeset
5139 EMBLEM_COLUMN, emblem,
0b6f337a46d5 Emblems in the blist
Sean Egan <seanegan@gmail.com>
parents: 15448
diff changeset
5140 EMBLEM_VISIBLE_COLUMN, emblem != NULL,
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5141 NAME_COLUMN, mark,
16121
6167ee79ecd0 Set the disable maximize button hint on the blist. I couldn't find a window manager that supports this, but I bet win32 does.
Sean Egan <seanegan@gmail.com>
parents: 16102
diff changeset
5142 GROUP_EXPANDER_VISIBLE_COLUMN, FALSE,
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5143 -1);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5144
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5145 g_free(mark);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5146 if(status)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5147 g_object_unref(status);
15423
051a5c4f0917 this would use the protocol icons in place of the buddy icon for chats,
Nathan Walp <nwalp@pidgin.im>
parents: 15418
diff changeset
5148 if(avatar)
051a5c4f0917 this would use the protocol icons in place of the buddy icon for chats,
Nathan Walp <nwalp@pidgin.im>
parents: 15418
diff changeset
5149 g_object_unref(avatar);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5150 } else {
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
5151 pidgin_blist_hide_node(list, node, TRUE);
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
5152 }
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
5153 }
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
5154
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
5155 static void pidgin_blist_update(PurpleBuddyList *list, PurpleBlistNode *node)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5156 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5157 if (list)
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
5158 gtkblist = PIDGIN_BLIST(list);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5159 if(!gtkblist || !gtkblist->treeview || !node)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5160 return;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5161
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5162 if (node->ui_data == NULL)
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
5163 pidgin_blist_new_node(node);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5164
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5165 switch(node->type) {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
5166 case PURPLE_BLIST_GROUP_NODE:
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
5167 pidgin_blist_update_group(list, node);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5168 break;
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
5169 case PURPLE_BLIST_CONTACT_NODE:
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
5170 pidgin_blist_update_contact(list, node);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5171 break;
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
5172 case PURPLE_BLIST_BUDDY_NODE:
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
5173 pidgin_blist_update_buddy(list, node, TRUE);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5174 break;
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
5175 case PURPLE_BLIST_CHAT_NODE:
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
5176 pidgin_blist_update_chat(list, node);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5177 break;
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
5178 case PURPLE_BLIST_OTHER_NODE:
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5179 return;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5180 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5181
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5182 #if !GTK_CHECK_VERSION(2,6,0)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5183 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
5184 #endif
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5185 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5186
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5187
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
5188 static void pidgin_blist_destroy(PurpleBuddyList *list)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5189 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5190 if (!gtkblist)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5191 return;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5192
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
5193 purple_signals_disconnect_by_handle(gtkblist);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5194
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5195 if (gtkblist->headline_close)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5196 gdk_pixbuf_unref(gtkblist->headline_close);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5197
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5198 gtk_widget_destroy(gtkblist->window);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5199
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
5200 pidgin_blist_tooltip_destroy();
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5201
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5202 if (gtkblist->refresh_timer)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5203 g_source_remove(gtkblist->refresh_timer);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5204 if (gtkblist->timeout)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5205 g_source_remove(gtkblist->timeout);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5206 if (gtkblist->drag_timeout)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5207 g_source_remove(gtkblist->drag_timeout);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5208
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5209 g_hash_table_destroy(gtkblist->connection_errors);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5210 gtkblist->refresh_timer = 0;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5211 gtkblist->timeout = 0;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5212 gtkblist->drag_timeout = 0;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5213 gtkblist->window = gtkblist->vbox = gtkblist->treeview = NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5214 gtkblist->treemodel = NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5215 g_object_unref(G_OBJECT(gtkblist->ift));
15397
a8ee645e7fb4 A lot of status icon changes:
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
5216 g_object_unref(G_OBJECT(gtkblist->empty_avatar));
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5217
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5218 gdk_cursor_unref(gtkblist->hand_cursor);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5219 gdk_cursor_unref(gtkblist->arrow_cursor);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5220 gtkblist->hand_cursor = NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5221 gtkblist->arrow_cursor = NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5222
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5223 g_free(gtkblist);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5224 accountmenu = NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5225 gtkblist = NULL;
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
5226 purple_prefs_disconnect_by_handle(pidgin_blist_get_handle());
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
5227 }
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
5228
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
5229 static void pidgin_blist_set_visible(PurpleBuddyList *list, gboolean show)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5230 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5231 if (!(gtkblist && gtkblist->window))
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5232 return;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5233
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5234 if (show) {
15510
567a499c3b06 dialogs
Sean Egan <seanegan@gmail.com>
parents: 15509
diff changeset
5235 if(!PIDGIN_WINDOW_ICONIFIED(gtkblist->window) && !GTK_WIDGET_VISIBLE(gtkblist->window))
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
5236 purple_signal_emit(pidgin_blist_get_handle(), "gtkblist-unhiding", gtkblist);
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
5237 pidgin_blist_restore_position();
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5238 gtk_window_present(GTK_WINDOW(gtkblist->window));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5239 } else {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5240 if(visibility_manager_count) {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
5241 purple_signal_emit(pidgin_blist_get_handle(), "gtkblist-hiding", gtkblist);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5242 gtk_widget_hide(gtkblist->window);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5243 } else {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5244 if (!GTK_WIDGET_VISIBLE(gtkblist->window))
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5245 gtk_widget_show(gtkblist->window);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5246 gtk_window_iconify(GTK_WINDOW(gtkblist->window));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5247 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5248 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5249 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5250
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5251 static GList *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5252 groups_tree(void)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5253 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5254 GList *tmp = NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5255 char *tmp2;
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
5256 PurpleGroup *g;
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
5257 PurpleBlistNode *gnode;
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
5258
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
5259 if (purple_get_blist()->root == NULL)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5260 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5261 tmp2 = g_strdup(_("Buddies"));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5262 tmp = g_list_append(tmp, tmp2);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5263 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5264 else
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5265 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
5266 for (gnode = purple_get_blist()->root;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5267 gnode != NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5268 gnode = gnode->next)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5269 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
5270 if (PURPLE_BLIST_NODE_IS_GROUP(gnode))
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5271 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
5272 g = (PurpleGroup *)gnode;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5273 tmp2 = g->name;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5274 tmp = g_list_append(tmp, tmp2);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5275 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5276 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5277 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5278
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5279 return tmp;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5280 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5281
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5282 static void
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
5283 add_buddy_select_account_cb(GObject *w, PurpleAccount *account,
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
5284 PidginAddBuddyData *data)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5285 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5286 /* Save our account */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5287 data->account = account;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5288 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5289
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5290 static void
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
5291 destroy_add_buddy_dialog_cb(GtkWidget *win, PidginAddBuddyData *data)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5292 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5293 g_free(data);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5294 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5295
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5296 static void
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
5297 add_buddy_cb(GtkWidget *w, int resp, PidginAddBuddyData *data)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5298 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5299 const char *grp, *who, *whoalias;
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
5300 PurpleGroup *g;
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
5301 PurpleBuddy *b;
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
5302 PurpleConversation *c;
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
5303 PurpleBuddyIcon *icon;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5304
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5305 if (resp == GTK_RESPONSE_OK)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5306 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5307 who = gtk_entry_get_text(GTK_ENTRY(data->entry));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5308 grp = gtk_entry_get_text(GTK_ENTRY(GTK_COMBO(data->combo)->entry));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5309 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
5310 if (*whoalias == '\0')
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5311 whoalias = NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5312
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
5313 if ((g = purple_find_group(grp)) == NULL)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5314 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
5315 g = purple_group_new(grp);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
5316 purple_blist_add_group(g, NULL);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5317 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5318
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
5319 b = purple_buddy_new(data->account, who, whoalias);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
5320 purple_blist_add_buddy(b, NULL, g, NULL);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
5321 purple_account_add_buddy(data->account, b);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5322
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5323 /*
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5324 * XXX
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5325 * It really seems like it would be better if the call to
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
5326 * purple_account_add_buddy() and purple_conversation_update() were done in
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
5327 * blist.c, possibly in the purple_blist_add_buddy() function. Maybe
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
5328 * purple_account_add_buddy() should be renamed to
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
5329 * purple_blist_add_new_buddy() or something, and have it call
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
5330 * purple_blist_add_buddy() after it creates it. --Mark
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5331 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5332 * 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
5333 * local list. We need a new, non-gtk file that calls both
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
5334 * purple_account_add_buddy and purple_blist_add_buddy().
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5335 * Or something. --Mark
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5336 */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5337
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
5338 c = purple_find_conversation_with_account(PURPLE_CONV_TYPE_IM, who, data->account);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5339 if (c != NULL) {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
5340 icon = purple_conv_im_get_icon(PURPLE_CONV_IM(c));
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5341 if (icon != NULL)
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
5342 purple_buddy_icon_update(icon);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5343 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5344 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5345
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5346 gtk_widget_destroy(data->window);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5347 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5348
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5349 static void
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
5350 pidgin_blist_request_add_buddy(PurpleAccount *account, const char *username,
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5351 const char *group, const char *alias)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5352 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5353 GtkWidget *table;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5354 GtkWidget *label;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5355 GtkWidget *hbox;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5356 GtkWidget *vbox;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5357 GtkWidget *img;
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
5358 PidginBuddyList *gtkblist;
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
5359 PidginAddBuddyData *data = g_new0(PidginAddBuddyData, 1);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5360
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5361 data->account =
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5362 (account != NULL
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5363 ? account
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
5364 : purple_connection_get_account(purple_connections_get_all()->data));
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5365
15436
9c0cf4db1f4d Dialog icon changes
Sean Egan <seanegan@gmail.com>
parents: 15435
diff changeset
5366 img = gtk_image_new_from_stock(PIDGIN_STOCK_DIALOG_QUESTION,
9c0cf4db1f4d Dialog icon changes
Sean Egan <seanegan@gmail.com>
parents: 15435
diff changeset
5367 gtk_icon_size_from_name(PIDGIN_ICON_SIZE_TANGO_HUGE));
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5368
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
5369 gtkblist = PIDGIN_BLIST(purple_get_blist());
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5370
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5371 data->window = gtk_dialog_new_with_buttons(_("Add Buddy"),
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5372 NULL, GTK_DIALOG_NO_SEPARATOR,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5373 GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5374 GTK_STOCK_ADD, GTK_RESPONSE_OK,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5375 NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5376
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5377 gtk_dialog_set_default_response(GTK_DIALOG(data->window), GTK_RESPONSE_OK);
15821
cebfc6af3eb5 More Gaim to Pidgin stuff
Sean Egan <seanegan@gmail.com>
parents: 15738
diff changeset
5378 gtk_container_set_border_width(GTK_CONTAINER(data->window), PIDGIN_HIG_BOX_SPACE);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5379 gtk_window_set_resizable(GTK_WINDOW(data->window), FALSE);
15821
cebfc6af3eb5 More Gaim to Pidgin stuff
Sean Egan <seanegan@gmail.com>
parents: 15738
diff changeset
5380 gtk_box_set_spacing(GTK_BOX(GTK_DIALOG(data->window)->vbox), PIDGIN_HIG_BORDER);
cebfc6af3eb5 More Gaim to Pidgin stuff
Sean Egan <seanegan@gmail.com>
parents: 15738
diff changeset
5381 gtk_container_set_border_width(GTK_CONTAINER(GTK_DIALOG(data->window)->vbox), PIDGIN_HIG_BOX_SPACE);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5382 gtk_window_set_role(GTK_WINDOW(data->window), "add_buddy");
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5383 gtk_window_set_type_hint(GTK_WINDOW(data->window),
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5384 GDK_WINDOW_TYPE_HINT_DIALOG);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5385
15821
cebfc6af3eb5 More Gaim to Pidgin stuff
Sean Egan <seanegan@gmail.com>
parents: 15738
diff changeset
5386 hbox = gtk_hbox_new(FALSE, PIDGIN_HIG_BORDER);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5387 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
5388 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
5389 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
5390
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5391 vbox = gtk_vbox_new(FALSE, 0);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5392 gtk_container_add(GTK_CONTAINER(hbox), vbox);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5393
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5394 label = gtk_label_new(
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5395 _("Please enter the screen name of the person you would like "
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5396 "to add to your buddy list. You may optionally enter an alias, "
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5397 "or nickname, for the buddy. The alias will be displayed in "
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5398 "place of the screen name whenever possible.\n"));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5399
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5400 gtk_widget_set_size_request(GTK_WIDGET(label), 400, -1);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5401 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
5402 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
5403 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
5404
15821
cebfc6af3eb5 More Gaim to Pidgin stuff
Sean Egan <seanegan@gmail.com>
parents: 15738
diff changeset
5405 hbox = gtk_hbox_new(FALSE, PIDGIN_HIG_BOX_SPACE);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5406 gtk_container_add(GTK_CONTAINER(vbox), hbox);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5407
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5408 g_signal_connect(G_OBJECT(data->window), "destroy",
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5409 G_CALLBACK(destroy_add_buddy_dialog_cb), data);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5410
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5411 table = gtk_table_new(4, 2, FALSE);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5412 gtk_table_set_row_spacings(GTK_TABLE(table), 5);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5413 gtk_table_set_col_spacings(GTK_TABLE(table), 5);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5414 gtk_container_set_border_width(GTK_CONTAINER(table), 0);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5415 gtk_box_pack_start(GTK_BOX(vbox), table, FALSE, FALSE, 0);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5416
17688
486daeb90aa9 Add mnemonics to labels in Add Buddy and Add Chat dialogs, and put Account
Stu Tomlinson <stu@nosnilmot.com>
parents: 17674
diff changeset
5417 /* Set up stuff for the account box */
486daeb90aa9 Add mnemonics to labels in Add Buddy and Add Chat dialogs, and put Account
Stu Tomlinson <stu@nosnilmot.com>
parents: 17674
diff changeset
5418 label = gtk_label_new_with_mnemonic(_("_Account:"));
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5419 gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5420 gtk_table_attach_defaults(GTK_TABLE(table), label, 0, 1, 0, 1);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5421
17688
486daeb90aa9 Add mnemonics to labels in Add Buddy and Add Chat dialogs, and put Account
Stu Tomlinson <stu@nosnilmot.com>
parents: 17674
diff changeset
5422 data->account_box = pidgin_account_option_menu_new(account, FALSE,
486daeb90aa9 Add mnemonics to labels in Add Buddy and Add Chat dialogs, and put Account
Stu Tomlinson <stu@nosnilmot.com>
parents: 17674
diff changeset
5423 G_CALLBACK(add_buddy_select_account_cb), NULL, data);
486daeb90aa9 Add mnemonics to labels in Add Buddy and Add Chat dialogs, and put Account
Stu Tomlinson <stu@nosnilmot.com>
parents: 17674
diff changeset
5424
486daeb90aa9 Add mnemonics to labels in Add Buddy and Add Chat dialogs, and put Account
Stu Tomlinson <stu@nosnilmot.com>
parents: 17674
diff changeset
5425 gtk_table_attach_defaults(GTK_TABLE(table), data->account_box, 1, 2, 0, 1);
486daeb90aa9 Add mnemonics to labels in Add Buddy and Add Chat dialogs, and put Account
Stu Tomlinson <stu@nosnilmot.com>
parents: 17674
diff changeset
5426 gtk_label_set_mnemonic_widget(GTK_LABEL(label), data->account_box);
486daeb90aa9 Add mnemonics to labels in Add Buddy and Add Chat dialogs, and put Account
Stu Tomlinson <stu@nosnilmot.com>
parents: 17674
diff changeset
5427 pidgin_set_accessible_label (data->account_box, label);
486daeb90aa9 Add mnemonics to labels in Add Buddy and Add Chat dialogs, and put Account
Stu Tomlinson <stu@nosnilmot.com>
parents: 17674
diff changeset
5428 /* End of account box */
486daeb90aa9 Add mnemonics to labels in Add Buddy and Add Chat dialogs, and put Account
Stu Tomlinson <stu@nosnilmot.com>
parents: 17674
diff changeset
5429
486daeb90aa9 Add mnemonics to labels in Add Buddy and Add Chat dialogs, and put Account
Stu Tomlinson <stu@nosnilmot.com>
parents: 17674
diff changeset
5430 label = gtk_label_new_with_mnemonic(_("_Screen name:"));
486daeb90aa9 Add mnemonics to labels in Add Buddy and Add Chat dialogs, and put Account
Stu Tomlinson <stu@nosnilmot.com>
parents: 17674
diff changeset
5431 gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
486daeb90aa9 Add mnemonics to labels in Add Buddy and Add Chat dialogs, and put Account
Stu Tomlinson <stu@nosnilmot.com>
parents: 17674
diff changeset
5432 gtk_table_attach_defaults(GTK_TABLE(table), label, 0, 1, 1, 2);
486daeb90aa9 Add mnemonics to labels in Add Buddy and Add Chat dialogs, and put Account
Stu Tomlinson <stu@nosnilmot.com>
parents: 17674
diff changeset
5433
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5434 data->entry = gtk_entry_new();
17688
486daeb90aa9 Add mnemonics to labels in Add Buddy and Add Chat dialogs, and put Account
Stu Tomlinson <stu@nosnilmot.com>
parents: 17674
diff changeset
5435 gtk_table_attach_defaults(GTK_TABLE(table), data->entry, 1, 2, 1, 2);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5436 gtk_widget_grab_focus(data->entry);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5437
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5438 if (username != NULL)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5439 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
5440 else
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5441 gtk_dialog_set_response_sensitive(GTK_DIALOG(data->window),
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5442 GTK_RESPONSE_OK, FALSE);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5443
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5444 gtk_entry_set_activates_default (GTK_ENTRY(data->entry), TRUE);
17688
486daeb90aa9 Add mnemonics to labels in Add Buddy and Add Chat dialogs, and put Account
Stu Tomlinson <stu@nosnilmot.com>
parents: 17674
diff changeset
5445 gtk_label_set_mnemonic_widget(GTK_LABEL(label), data->entry);
15507
311315e979f7 gtkutils changes
Sean Egan <seanegan@gmail.com>
parents: 15505
diff changeset
5446 pidgin_set_accessible_label (data->entry, label);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5447
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5448 g_signal_connect(G_OBJECT(data->entry), "changed",
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
5449 G_CALLBACK(pidgin_set_sensitive_if_input),
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5450 data->window);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5451
17688
486daeb90aa9 Add mnemonics to labels in Add Buddy and Add Chat dialogs, and put Account
Stu Tomlinson <stu@nosnilmot.com>
parents: 17674
diff changeset
5452 label = gtk_label_new_with_mnemonic(_("A_lias:"));
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5453 gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
17688
486daeb90aa9 Add mnemonics to labels in Add Buddy and Add Chat dialogs, and put Account
Stu Tomlinson <stu@nosnilmot.com>
parents: 17674
diff changeset
5454 gtk_table_attach_defaults(GTK_TABLE(table), label, 0, 1, 2, 3);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5455
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5456 data->entry_for_alias = gtk_entry_new();
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5457 gtk_table_attach_defaults(GTK_TABLE(table),
17688
486daeb90aa9 Add mnemonics to labels in Add Buddy and Add Chat dialogs, and put Account
Stu Tomlinson <stu@nosnilmot.com>
parents: 17674
diff changeset
5458 data->entry_for_alias, 1, 2, 2, 3);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5459
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5460 if (alias != NULL)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5461 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
5462
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5463 if (username != NULL)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5464 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
5465
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5466 gtk_entry_set_activates_default (GTK_ENTRY(data->entry_for_alias), TRUE);
17688
486daeb90aa9 Add mnemonics to labels in Add Buddy and Add Chat dialogs, and put Account
Stu Tomlinson <stu@nosnilmot.com>
parents: 17674
diff changeset
5467 gtk_label_set_mnemonic_widget(GTK_LABEL(label), data->entry_for_alias);
15507
311315e979f7 gtkutils changes
Sean Egan <seanegan@gmail.com>
parents: 15505
diff changeset
5468 pidgin_set_accessible_label (data->entry_for_alias, label);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5469
17688
486daeb90aa9 Add mnemonics to labels in Add Buddy and Add Chat dialogs, and put Account
Stu Tomlinson <stu@nosnilmot.com>
parents: 17674
diff changeset
5470 label = gtk_label_new_with_mnemonic(_("_Group:"));
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5471 gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
17688
486daeb90aa9 Add mnemonics to labels in Add Buddy and Add Chat dialogs, and put Account
Stu Tomlinson <stu@nosnilmot.com>
parents: 17674
diff changeset
5472 gtk_table_attach_defaults(GTK_TABLE(table), label, 0, 1, 3, 4);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5473
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5474 data->combo = gtk_combo_new();
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5475 gtk_combo_set_popdown_strings(GTK_COMBO(data->combo), groups_tree());
17688
486daeb90aa9 Add mnemonics to labels in Add Buddy and Add Chat dialogs, and put Account
Stu Tomlinson <stu@nosnilmot.com>
parents: 17674
diff changeset
5476 gtk_table_attach_defaults(GTK_TABLE(table), data->combo, 1, 2, 3, 4);
486daeb90aa9 Add mnemonics to labels in Add Buddy and Add Chat dialogs, and put Account
Stu Tomlinson <stu@nosnilmot.com>
parents: 17674
diff changeset
5477 gtk_label_set_mnemonic_widget(GTK_LABEL(label), GTK_COMBO(data->combo)->entry);
15507
311315e979f7 gtkutils changes
Sean Egan <seanegan@gmail.com>
parents: 15505
diff changeset
5478 pidgin_set_accessible_label (data->combo, label);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5479
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5480 g_signal_connect(G_OBJECT(data->window), "response",
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5481 G_CALLBACK(add_buddy_cb), data);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5482
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5483 gtk_widget_show_all(data->window);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5484
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5485 if (group != NULL)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5486 gtk_entry_set_text(GTK_ENTRY(GTK_COMBO(data->combo)->entry), group);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5487 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5488
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5489 static void
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
5490 add_chat_cb(GtkWidget *w, PidginAddChatData *data)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5491 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5492 GHashTable *components;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5493 GList *tmp;
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
5494 PurpleChat *chat;
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
5495 PurpleGroup *group;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5496 const char *group_name;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5497 const char *value;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5498
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5499 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
5500 g_free, g_free);
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 for (tmp = data->entries; tmp; tmp = tmp->next)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5503 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5504 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
5505 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5506 g_hash_table_replace(components,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5507 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
5508 g_strdup_printf("%d",
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5509 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
5510 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5511 else
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5512 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5513 value = gtk_entry_get_text(tmp->data);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5514 if (*value != '\0')
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5515 g_hash_table_replace(components,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5516 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
5517 g_strdup(value));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5518 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5519 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5520
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
5521 chat = purple_chat_new(data->account,
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5522 gtk_entry_get_text(GTK_ENTRY(data->alias_entry)),
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5523 components);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5524
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5525 group_name = gtk_entry_get_text(GTK_ENTRY(GTK_COMBO(data->group_combo)->entry));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5526
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
5527 if ((group = purple_find_group(group_name)) == NULL)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5528 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
5529 group = purple_group_new(group_name);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
5530 purple_blist_add_group(group, NULL);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5531 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5532
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5533 if (chat != NULL)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5534 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
5535 purple_blist_add_chat(chat, group, NULL);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5536 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5537
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5538 gtk_widget_destroy(data->window);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5539 g_free(data->default_chat_name);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5540 g_list_free(data->entries);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5541 g_free(data);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5542 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5543
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5544 static void
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
5545 add_chat_resp_cb(GtkWidget *w, int resp, PidginAddChatData *data)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5546 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5547 if (resp == GTK_RESPONSE_OK)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5548 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5549 add_chat_cb(NULL, data);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5550 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5551 else
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5552 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5553 gtk_widget_destroy(data->window);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5554 g_free(data->default_chat_name);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5555 g_list_free(data->entries);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5556 g_free(data);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5557 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5558 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5559
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5560 /*
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5561 * 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
5562 * 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
5563 */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5564 static void
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5565 addchat_set_sensitive_if_input_cb(GtkWidget *entry, gpointer user_data)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5566 {
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
5567 PidginAddChatData *data;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5568 GList *tmp;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5569 const char *text;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5570 gboolean required;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5571 gboolean sensitive = TRUE;
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 data = user_data;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5574
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5575 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
5576 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5577 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
5578 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5579 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
5580 text = gtk_entry_get_text(tmp->data);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5581 if (required && (*text == '\0'))
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5582 sensitive = FALSE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5583 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5584 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5585
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5586 gtk_dialog_set_response_sensitive(GTK_DIALOG(data->window), GTK_RESPONSE_OK, sensitive);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5587 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5588
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5589 static void
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
5590 rebuild_addchat_entries(PidginAddChatData *data)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5591 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
5592 PurpleConnection *gc;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5593 GList *list = NULL, *tmp;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5594 GHashTable *defaults = NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5595 struct proto_chat_entry *pce;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5596 gboolean focus = TRUE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5597
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5598 g_return_if_fail(data->account != NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5599
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
5600 gc = purple_account_get_connection(data->account);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5601
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5602 while ((tmp = gtk_container_get_children(GTK_CONTAINER(data->entries_box))))
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5603 gtk_widget_destroy(tmp->data);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5604
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5605 g_list_free(data->entries);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5606
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5607 data->entries = NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5608
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
5609 if (PURPLE_PLUGIN_PROTOCOL_INFO(gc->prpl)->chat_info != NULL)
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
5610 list = PURPLE_PLUGIN_PROTOCOL_INFO(gc->prpl)->chat_info(gc);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
5611
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
5612 if (PURPLE_PLUGIN_PROTOCOL_INFO(gc->prpl)->chat_info_defaults != NULL)
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
5613 defaults = PURPLE_PLUGIN_PROTOCOL_INFO(gc->prpl)->chat_info_defaults(gc, data->default_chat_name);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5614
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5615 for (tmp = list; tmp; tmp = tmp->next)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5616 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5617 GtkWidget *label;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5618 GtkWidget *rowbox;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5619 GtkWidget *input;
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 pce = tmp->data;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5622
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5623 rowbox = gtk_hbox_new(FALSE, 5);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5624 gtk_box_pack_start(GTK_BOX(data->entries_box), rowbox, FALSE, FALSE, 0);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5625
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5626 label = gtk_label_new_with_mnemonic(pce->label);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5627 gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5628 gtk_size_group_add_widget(data->sg, label);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5629 gtk_box_pack_start(GTK_BOX(rowbox), label, FALSE, FALSE, 0);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5630
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5631 if (pce->is_int)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5632 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5633 GtkObject *adjust;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5634 adjust = gtk_adjustment_new(pce->min, pce->min, pce->max,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5635 1, 10, 10);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5636 input = gtk_spin_button_new(GTK_ADJUSTMENT(adjust), 1, 0);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5637 gtk_widget_set_size_request(input, 50, -1);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5638 gtk_box_pack_end(GTK_BOX(rowbox), input, FALSE, FALSE, 0);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5639 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5640 else
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5641 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5642 char *value;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5643 input = gtk_entry_new();
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5644 gtk_entry_set_activates_default(GTK_ENTRY(input), TRUE);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5645 value = g_hash_table_lookup(defaults, pce->identifier);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5646 if (value != NULL)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5647 gtk_entry_set_text(GTK_ENTRY(input), value);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5648 if (pce->secret)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5649 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5650 gtk_entry_set_visibility(GTK_ENTRY(input), FALSE);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5651 if (gtk_entry_get_invisible_char(GTK_ENTRY(input)) == '*')
15821
cebfc6af3eb5 More Gaim to Pidgin stuff
Sean Egan <seanegan@gmail.com>
parents: 15738
diff changeset
5652 gtk_entry_set_invisible_char(GTK_ENTRY(input), PIDGIN_INVISIBLE_CHAR);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5653 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5654 gtk_box_pack_end(GTK_BOX(rowbox), input, TRUE, TRUE, 0);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5655 g_signal_connect(G_OBJECT(input), "changed",
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5656 G_CALLBACK(addchat_set_sensitive_if_input_cb), data);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5657 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5658
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5659 /* Do the following for any type of input widget */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5660 if (focus)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5661 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5662 gtk_widget_grab_focus(input);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5663 focus = FALSE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5664 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5665 gtk_label_set_mnemonic_widget(GTK_LABEL(label), input);
15507
311315e979f7 gtkutils changes
Sean Egan <seanegan@gmail.com>
parents: 15505
diff changeset
5666 pidgin_set_accessible_label(input, label);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5667 g_object_set_data(G_OBJECT(input), "identifier", (gpointer)pce->identifier);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5668 g_object_set_data(G_OBJECT(input), "is_spin", GINT_TO_POINTER(pce->is_int));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5669 g_object_set_data(G_OBJECT(input), "required", GINT_TO_POINTER(pce->required));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5670 data->entries = g_list_append(data->entries, input);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5671
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5672 g_free(pce);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5673 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5674
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5675 g_list_free(list);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5676 g_hash_table_destroy(defaults);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5677
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5678 /* Set whether the "OK" button should be clickable initially */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5679 addchat_set_sensitive_if_input_cb(NULL, data);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5680
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5681 gtk_widget_show_all(data->entries_box);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5682 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5683
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5684 static void
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
5685 addchat_select_account_cb(GObject *w, PurpleAccount *account,
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
5686 PidginAddChatData *data)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5687 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
5688 if (strcmp(purple_account_get_protocol_id(data->account),
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
5689 purple_account_get_protocol_id(account)) == 0)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5690 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5691 data->account = account;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5692 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5693 else
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5694 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5695 data->account = account;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5696 rebuild_addchat_entries(data);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5697 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5698 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5699
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5700 static void
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
5701 pidgin_blist_request_add_chat(PurpleAccount *account, PurpleGroup *group,
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5702 const char *alias, const char *name)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5703 {
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
5704 PidginAddChatData *data;
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
5705 PidginBuddyList *gtkblist;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5706 GList *l;
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
5707 PurpleConnection *gc;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5708 GtkWidget *label;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5709 GtkWidget *rowbox;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5710 GtkWidget *hbox;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5711 GtkWidget *vbox;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5712 GtkWidget *img;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5713
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5714 if (account != NULL) {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
5715 gc = purple_account_get_connection(account);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
5716
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
5717 if (PURPLE_PLUGIN_PROTOCOL_INFO(gc->prpl)->join_chat == NULL) {
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
5718 purple_notify_error(gc, NULL, _("This protocol does not support chat rooms."), NULL);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5719 return;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5720 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5721 } else {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5722 /* Find an account with chat capabilities */
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
5723 for (l = purple_connections_get_all(); l != NULL; l = l->next) {
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
5724 gc = (PurpleConnection *)l->data;
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
5725
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
5726 if (PURPLE_PLUGIN_PROTOCOL_INFO(gc->prpl)->join_chat != NULL) {
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
5727 account = purple_connection_get_account(gc);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5728 break;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5729 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5730 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5731
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5732 if (account == NULL) {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
5733 purple_notify_error(NULL, NULL,
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5734 _("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
5735 "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
5736 return;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5737 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5738 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5739
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
5740 data = g_new0(PidginAddChatData, 1);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5741 data->account = account;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5742 data->default_chat_name = g_strdup(name);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5743
15436
9c0cf4db1f4d Dialog icon changes
Sean Egan <seanegan@gmail.com>
parents: 15435
diff changeset
5744 img = gtk_image_new_from_stock(PIDGIN_STOCK_DIALOG_QUESTION,
9c0cf4db1f4d Dialog icon changes
Sean Egan <seanegan@gmail.com>
parents: 15435
diff changeset
5745 gtk_icon_size_from_name(PIDGIN_ICON_SIZE_TANGO_HUGE));
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5746
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
5747 gtkblist = PIDGIN_BLIST(purple_get_blist());
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5748
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5749 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
5750
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5751 data->window = gtk_dialog_new_with_buttons(_("Add Chat"),
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5752 NULL, GTK_DIALOG_NO_SEPARATOR,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5753 GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5754 GTK_STOCK_ADD, GTK_RESPONSE_OK,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5755 NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5756
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5757 gtk_dialog_set_default_response(GTK_DIALOG(data->window), GTK_RESPONSE_OK);
15821
cebfc6af3eb5 More Gaim to Pidgin stuff
Sean Egan <seanegan@gmail.com>
parents: 15738
diff changeset
5758 gtk_container_set_border_width(GTK_CONTAINER(data->window), PIDGIN_HIG_BOX_SPACE);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5759 gtk_window_set_resizable(GTK_WINDOW(data->window), FALSE);
15821
cebfc6af3eb5 More Gaim to Pidgin stuff
Sean Egan <seanegan@gmail.com>
parents: 15738
diff changeset
5760 gtk_box_set_spacing(GTK_BOX(GTK_DIALOG(data->window)->vbox), PIDGIN_HIG_BORDER);
cebfc6af3eb5 More Gaim to Pidgin stuff
Sean Egan <seanegan@gmail.com>
parents: 15738
diff changeset
5761 gtk_container_set_border_width(GTK_CONTAINER(GTK_DIALOG(data->window)->vbox), PIDGIN_HIG_BOX_SPACE);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5762 gtk_window_set_role(GTK_WINDOW(data->window), "add_chat");
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5763 gtk_window_set_type_hint(GTK_WINDOW(data->window),
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5764 GDK_WINDOW_TYPE_HINT_DIALOG);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5765
15821
cebfc6af3eb5 More Gaim to Pidgin stuff
Sean Egan <seanegan@gmail.com>
parents: 15738
diff changeset
5766 hbox = gtk_hbox_new(FALSE, PIDGIN_HIG_BORDER);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5767 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
5768 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
5769 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
5770
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5771 vbox = gtk_vbox_new(FALSE, 5);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5772 gtk_container_add(GTK_CONTAINER(hbox), vbox);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5773
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5774 label = gtk_label_new(
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5775 _("Please enter an alias, and the appropriate information "
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5776 "about the chat you would like to add to your buddy list.\n"));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5777 gtk_widget_set_size_request(label, 400, -1);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5778 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
5779 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
5780 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
5781
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5782 rowbox = gtk_hbox_new(FALSE, 5);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5783 gtk_box_pack_start(GTK_BOX(vbox), rowbox, FALSE, FALSE, 0);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5784
17688
486daeb90aa9 Add mnemonics to labels in Add Buddy and Add Chat dialogs, and put Account
Stu Tomlinson <stu@nosnilmot.com>
parents: 17674
diff changeset
5785 label = gtk_label_new_with_mnemonic(_("_Account:"));
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5786 gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5787 gtk_size_group_add_widget(data->sg, label);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5788 gtk_box_pack_start(GTK_BOX(rowbox), label, FALSE, FALSE, 0);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5789
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
5790 data->account_menu = pidgin_account_option_menu_new(account, FALSE,
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5791 G_CALLBACK(addchat_select_account_cb),
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5792 chat_account_filter_func, data);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5793 gtk_box_pack_start(GTK_BOX(rowbox), data->account_menu, TRUE, TRUE, 0);
17688
486daeb90aa9 Add mnemonics to labels in Add Buddy and Add Chat dialogs, and put Account
Stu Tomlinson <stu@nosnilmot.com>
parents: 17674
diff changeset
5794 gtk_label_set_mnemonic_widget(GTK_LABEL(label), data->account_menu);
15507
311315e979f7 gtkutils changes
Sean Egan <seanegan@gmail.com>
parents: 15505
diff changeset
5795 pidgin_set_accessible_label (data->account_menu, label);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5796
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5797 data->entries_box = gtk_vbox_new(FALSE, 5);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5798 gtk_container_set_border_width(GTK_CONTAINER(data->entries_box), 0);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5799 gtk_box_pack_start(GTK_BOX(vbox), data->entries_box, TRUE, TRUE, 0);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5800
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5801 rebuild_addchat_entries(data);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5802
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5803 rowbox = gtk_hbox_new(FALSE, 5);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5804 gtk_box_pack_start(GTK_BOX(vbox), rowbox, FALSE, FALSE, 0);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5805
17688
486daeb90aa9 Add mnemonics to labels in Add Buddy and Add Chat dialogs, and put Account
Stu Tomlinson <stu@nosnilmot.com>
parents: 17674
diff changeset
5806 label = gtk_label_new_with_mnemonic(_("A_lias:"));
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5807 gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5808 gtk_size_group_add_widget(data->sg, label);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5809 gtk_box_pack_start(GTK_BOX(rowbox), label, FALSE, FALSE, 0);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5810
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5811 data->alias_entry = gtk_entry_new();
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5812 if (alias != NULL)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5813 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
5814 gtk_box_pack_end(GTK_BOX(rowbox), data->alias_entry, TRUE, TRUE, 0);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5815 gtk_entry_set_activates_default(GTK_ENTRY(data->alias_entry), TRUE);
17688
486daeb90aa9 Add mnemonics to labels in Add Buddy and Add Chat dialogs, and put Account
Stu Tomlinson <stu@nosnilmot.com>
parents: 17674
diff changeset
5816 gtk_label_set_mnemonic_widget(GTK_LABEL(label), data->alias_entry);
15507
311315e979f7 gtkutils changes
Sean Egan <seanegan@gmail.com>
parents: 15505
diff changeset
5817 pidgin_set_accessible_label (data->alias_entry, label);
17418
202f4df12cf4 Closes #348 'Conversation -> Add (for Chats) should move focus to the alias field.'
Sean Egan <seanegan@gmail.com>
parents: 17139
diff changeset
5818 if (name != NULL)
202f4df12cf4 Closes #348 'Conversation -> Add (for Chats) should move focus to the alias field.'
Sean Egan <seanegan@gmail.com>
parents: 17139
diff changeset
5819 gtk_widget_grab_focus(data->alias_entry);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5820
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5821 rowbox = gtk_hbox_new(FALSE, 5);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5822 gtk_box_pack_start(GTK_BOX(vbox), rowbox, FALSE, FALSE, 0);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5823
17688
486daeb90aa9 Add mnemonics to labels in Add Buddy and Add Chat dialogs, and put Account
Stu Tomlinson <stu@nosnilmot.com>
parents: 17674
diff changeset
5824 label = gtk_label_new_with_mnemonic(_("_Group:"));
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5825 gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5826 gtk_size_group_add_widget(data->sg, label);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5827 gtk_box_pack_start(GTK_BOX(rowbox), label, FALSE, FALSE, 0);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5828
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5829 data->group_combo = gtk_combo_new();
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5830 gtk_combo_set_popdown_strings(GTK_COMBO(data->group_combo), groups_tree());
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5831 gtk_box_pack_end(GTK_BOX(rowbox), data->group_combo, TRUE, TRUE, 0);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5832
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5833 if (group)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5834 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5835 gtk_entry_set_text(GTK_ENTRY(GTK_COMBO(data->group_combo)->entry),
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5836 group->name);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5837 }
17688
486daeb90aa9 Add mnemonics to labels in Add Buddy and Add Chat dialogs, and put Account
Stu Tomlinson <stu@nosnilmot.com>
parents: 17674
diff changeset
5838 gtk_label_set_mnemonic_widget(GTK_LABEL(label), GTK_COMBO(data->group_combo)->entry);
15507
311315e979f7 gtkutils changes
Sean Egan <seanegan@gmail.com>
parents: 15505
diff changeset
5839 pidgin_set_accessible_label (data->group_combo, label);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5840
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5841 g_signal_connect(G_OBJECT(data->window), "response",
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5842 G_CALLBACK(add_chat_resp_cb), data);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5843
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5844 gtk_widget_show_all(data->window);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5845 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5846
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5847 static void
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
5848 add_group_cb(PurpleConnection *gc, const char *group_name)
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
5849 {
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
5850 PurpleGroup *group;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5851
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5852 if ((group_name == NULL) || (*group_name == '\0'))
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5853 return;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5854
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
5855 group = purple_group_new(group_name);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
5856 purple_blist_add_group(group, NULL);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5857 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5858
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5859 static void
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
5860 pidgin_blist_request_add_group(void)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5861 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
5862 purple_request_input(NULL, _("Add Group"), NULL,
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5863 _("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
5864 NULL, FALSE, FALSE, NULL,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5865 _("Add"), G_CALLBACK(add_group_cb),
16442
08db93bbd798 Added account, who, and conversation parameters to the request API calls, and updated all code to match. I can't compile the Perl module, so I'd appreciate it if someone who knows it would verify that this doesn't break Perl.
Evan Schoenberg <evan.s@dreskin.net>
parents: 16275
diff changeset
5866 _("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
5867 NULL, NULL, 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
5868 NULL);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5869 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5870
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5871 void
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
5872 pidgin_blist_toggle_visibility()
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5873 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5874 if (gtkblist && gtkblist->window) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5875 if (GTK_WIDGET_VISIBLE(gtkblist->window)) {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
5876 purple_blist_set_visible(PIDGIN_WINDOW_ICONIFIED(gtkblist->window) || gtk_blist_obscured);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5877 } else {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
5878 purple_blist_set_visible(TRUE);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5879 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5880 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5881 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5882
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5883 void
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
5884 pidgin_blist_visibility_manager_add()
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5885 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5886 visibility_manager_count++;
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
5887 purple_debug_info("gtkblist", "added visibility manager: %d\n", visibility_manager_count);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5888 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5889
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5890 void
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
5891 pidgin_blist_visibility_manager_remove()
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5892 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5893 if (visibility_manager_count)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5894 visibility_manager_count--;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5895 if (!visibility_manager_count)
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
5896 purple_blist_set_visible(TRUE);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
5897 purple_debug_info("gtkblist", "removed visibility manager: %d\n", visibility_manager_count);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5898 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5899
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
5900 void pidgin_blist_add_alert(GtkWidget *widget)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5901 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5902 gtk_container_add(GTK_CONTAINER(gtkblist->scrollbook), widget);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5903 if (!GTK_WIDGET_HAS_FOCUS(gtkblist->window))
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
5904 pidgin_set_urgent(GTK_WINDOW(gtkblist->window), TRUE);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5905 }
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 void
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
5908 pidgin_blist_set_headline(const char *text, GdkPixbuf *pixbuf, GCallback callback,
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5909 gpointer user_data, GDestroyNotify destroy)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5910 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5911 /* Destroy any existing headline first */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5912 if (gtkblist->headline_destroy)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5913 gtkblist->headline_destroy(gtkblist->headline_data);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5914
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5915 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
5916 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
5917
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5918 gtkblist->headline_callback = callback;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5919 gtkblist->headline_data = user_data;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5920 gtkblist->headline_destroy = destroy;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5921 if (!GTK_WIDGET_HAS_FOCUS(gtkblist->window))
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
5922 pidgin_set_urgent(GTK_WINDOW(gtkblist->window), TRUE);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5923 gtk_widget_show_all(gtkblist->headline_hbox);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5924 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5925
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
5926 static PurpleBlistUiOps blist_ui_ops =
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5927 {
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
5928 pidgin_blist_new_list,
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
5929 pidgin_blist_new_node,
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
5930 pidgin_blist_show,
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
5931 pidgin_blist_update,
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
5932 pidgin_blist_remove,
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
5933 pidgin_blist_destroy,
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
5934 pidgin_blist_set_visible,
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
5935 pidgin_blist_request_add_buddy,
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
5936 pidgin_blist_request_add_chat,
16681
fbf111436896 Patch from John 'rekkanoryo' Bailey to add the padding struct members in pidgin
Gary Kramlich <grim@reaperworld.com>
parents: 16564
diff changeset
5937 pidgin_blist_request_add_group,
fbf111436896 Patch from John 'rekkanoryo' Bailey to add the padding struct members in pidgin
Gary Kramlich <grim@reaperworld.com>
parents: 16564
diff changeset
5938 NULL,
fbf111436896 Patch from John 'rekkanoryo' Bailey to add the padding struct members in pidgin
Gary Kramlich <grim@reaperworld.com>
parents: 16564
diff changeset
5939 NULL,
fbf111436896 Patch from John 'rekkanoryo' Bailey to add the padding struct members in pidgin
Gary Kramlich <grim@reaperworld.com>
parents: 16564
diff changeset
5940 NULL,
fbf111436896 Patch from John 'rekkanoryo' Bailey to add the padding struct members in pidgin
Gary Kramlich <grim@reaperworld.com>
parents: 16564
diff changeset
5941 NULL
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5942 };
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5943
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5944
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
5945 PurpleBlistUiOps *
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
5946 pidgin_blist_get_ui_ops(void)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5947 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5948 return &blist_ui_ops;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5949 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5950
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
5951 PidginBuddyList *pidgin_blist_get_default_gtk_blist()
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5952 {
15448
a75f1459b578 re-indentation.
Nathan Walp <nwalp@pidgin.im>
parents: 15444
diff changeset
5953 return gtkblist;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5954 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5955
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
5956 static void account_signon_cb(PurpleConnection *gc, gpointer z)
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
5957 {
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
5958 PurpleAccount *account = purple_connection_get_account(gc);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
5959 PurpleBlistNode *gnode, *cnode;
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
5960 for(gnode = purple_get_blist()->root; gnode; gnode = gnode->next)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5961 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
5962 if(!PURPLE_BLIST_NODE_IS_GROUP(gnode))
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5963 continue;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5964 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
5965 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
5966 PurpleChat *chat;
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
5967
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
5968 if(!PURPLE_BLIST_NODE_IS_CHAT(cnode))
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5969 continue;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5970
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
5971 chat = (PurpleChat *)cnode;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5972
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5973 if(chat->account != account)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5974 continue;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5975
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
5976 if(purple_blist_node_get_bool((PurpleBlistNode*)chat, "gtk-autojoin") ||
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
5977 (purple_blist_node_get_string((PurpleBlistNode*)chat,
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5978 "gtk-autojoin") != NULL))
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5979 serv_join_chat(gc, chat->components);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5980 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5981 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5982 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5983
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5984 void *
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
5985 pidgin_blist_get_handle() {
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5986 static int handle;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5987
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5988 return &handle;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5989 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5990
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
5991 static gboolean buddy_signonoff_timeout_cb(PurpleBuddy *buddy)
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
5992 {
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
5993 struct _pidgin_blist_node *gtknode = ((PurpleBlistNode*)buddy)->ui_data;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5994
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5995 gtknode->recent_signonoff = FALSE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5996 gtknode->recent_signonoff_timer = 0;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5997
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
5998 pidgin_blist_update(NULL, (PurpleBlistNode*)buddy);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5999
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6000 return FALSE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6001 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6002
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
6003 static void buddy_signonoff_cb(PurpleBuddy *buddy)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6004 {
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
6005 struct _pidgin_blist_node *gtknode;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6006
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
6007 if(!((PurpleBlistNode*)buddy)->ui_data) {
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
6008 pidgin_blist_new_node((PurpleBlistNode*)buddy);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
6009 }
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
6010
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
6011 gtknode = ((PurpleBlistNode*)buddy)->ui_data;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6012
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6013 gtknode->recent_signonoff = TRUE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6014
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6015 if(gtknode->recent_signonoff_timer > 0)
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
6016 purple_timeout_remove(gtknode->recent_signonoff_timer);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
6017 gtknode->recent_signonoff_timer = purple_timeout_add(10000,
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6018 (GSourceFunc)buddy_signonoff_timeout_cb, buddy);
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
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
6021 void pidgin_blist_init(void)
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
6022 {
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
6023 void *gtk_blist_handle = pidgin_blist_get_handle();
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6024
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
6025 purple_signal_connect(purple_connections_get_handle(), "signed-on",
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
6026 gtk_blist_handle, PURPLE_CALLBACK(account_signon_cb),
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6027 NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6028
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6029 /* 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
6030 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
6031 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
6032 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
6033 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
6034 purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/blist/show_offline_buddies", 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
6035 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
6036 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
6037 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
6038 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
6039 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
6040 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
6041 purple_prefs_add_int(PIDGIN_PREFS_ROOT "/blist/height", 405); /* 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
6042 purple_prefs_add_int(PIDGIN_PREFS_ROOT "/blist/tooltip_delay", 500);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6043
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6044 /* Register our signals */
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
6045 purple_signal_register(gtk_blist_handle, "gtkblist-hiding",
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
6046 purple_marshal_VOID__POINTER, NULL, 1,
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
6047 purple_value_new(PURPLE_TYPE_SUBTYPE,
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
6048 PURPLE_SUBTYPE_BLIST));
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
6049
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
6050 purple_signal_register(gtk_blist_handle, "gtkblist-unhiding",
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
6051 purple_marshal_VOID__POINTER, NULL, 1,
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
6052 purple_value_new(PURPLE_TYPE_SUBTYPE,
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
6053 PURPLE_SUBTYPE_BLIST));
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
6054
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
6055 purple_signal_register(gtk_blist_handle, "gtkblist-created",
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
6056 purple_marshal_VOID__POINTER, NULL, 1,
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
6057 purple_value_new(PURPLE_TYPE_SUBTYPE,
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
6058 PURPLE_SUBTYPE_BLIST));
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
6059
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
6060 purple_signal_register(gtk_blist_handle, "drawing-tooltip",
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
6061 purple_marshal_VOID__POINTER_POINTER_UINT, NULL, 3,
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
6062 purple_value_new(PURPLE_TYPE_SUBTYPE,
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
6063 PURPLE_SUBTYPE_BLIST_NODE),
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
6064 purple_value_new_outgoing(PURPLE_TYPE_BOXED, "GString *"),
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
6065 purple_value_new(PURPLE_TYPE_BOOLEAN));
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
6066
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
6067
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
6068 purple_signal_connect(purple_blist_get_handle(), "buddy-signed-on", gtk_blist_handle, PURPLE_CALLBACK(buddy_signonoff_cb), NULL);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
6069 purple_signal_connect(purple_blist_get_handle(), "buddy-signed-off", gtk_blist_handle, PURPLE_CALLBACK(buddy_signonoff_cb), NULL);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
6070 purple_signal_connect(purple_blist_get_handle(), "buddy-privacy-changed", gtk_blist_handle, PURPLE_CALLBACK(pidgin_blist_update_privacy_cb), NULL);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6071 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6072
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6073 void
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
6074 pidgin_blist_uninit(void) {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
6075 purple_signals_unregister_by_instance(pidgin_blist_get_handle());
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
6076 purple_signals_disconnect_by_handle(pidgin_blist_get_handle());
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6077 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6078
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 * Buddy List sorting functions *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6081 *********************************************************************/
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6082
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
6083 GList *pidgin_blist_get_sort_methods()
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
6084 {
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
6085 return pidgin_blist_sort_methods;
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
6086 }
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
6087
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
6088 void pidgin_blist_sort_method_reg(const char *id, const char *name, pidgin_blist_sort_function func)
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
6089 {
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
6090 struct pidgin_blist_sort_method *method = g_new0(struct pidgin_blist_sort_method, 1);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6091 method->id = g_strdup(id);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6092 method->name = g_strdup(name);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6093 method->func = func;
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
6094 pidgin_blist_sort_methods = g_list_append(pidgin_blist_sort_methods, method);
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
6095 pidgin_blist_update_sort_methods();
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
6096 }
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
6097
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
6098 void pidgin_blist_sort_method_unreg(const char *id){
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
6099 GList *l = pidgin_blist_sort_methods;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6100
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6101 while(l) {
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
6102 struct pidgin_blist_sort_method *method = l->data;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6103 if(!strcmp(method->id, id)) {
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
6104 pidgin_blist_sort_methods = g_list_delete_link(pidgin_blist_sort_methods, l);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6105 g_free(method->id);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6106 g_free(method->name);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6107 g_free(method);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6108 break;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6109 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6110 }
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
6111 pidgin_blist_update_sort_methods();
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
6112 }
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
6113
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
6114 void pidgin_blist_sort_method_set(const char *id){
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
6115 GList *l = pidgin_blist_sort_methods;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6116
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6117 if(!id)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6118 id = "none";
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6119
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
6120 while (l && strcmp(((struct pidgin_blist_sort_method*)l->data)->id, id))
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6121 l = l->next;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6122
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6123 if (l) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6124 current_sort_method = l->data;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6125 } else if (!current_sort_method) {
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
6126 pidgin_blist_sort_method_set("none");
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6127 return;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6128 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6129 if (!strcmp(id, "none")) {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
6130 redo_buddy_list(purple_get_blist(), TRUE, FALSE);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6131 } else {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
6132 redo_buddy_list(purple_get_blist(), FALSE, FALSE);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6133 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6134 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6135
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 ** Sort Methods
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6138 ******************************************/
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6139
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
6140 static void sort_method_none(PurpleBlistNode *node, PurpleBuddyList *blist, GtkTreeIter parent_iter, GtkTreeIter *cur, GtkTreeIter *iter)
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
6141 {
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
6142 PurpleBlistNode *sibling = node->prev;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6143 GtkTreeIter sibling_iter;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6144
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6145 if (cur != NULL) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6146 *iter = *cur;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6147 return;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6148 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6149
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6150 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
6151 sibling = sibling->prev;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6152 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6153
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6154 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
6155 node->parent ? &parent_iter : NULL,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6156 sibling ? &sibling_iter : NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6157 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6158
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6159 #if GTK_CHECK_VERSION(2,2,1)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6160
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
6161 static void sort_method_alphabetical(PurpleBlistNode *node, PurpleBuddyList *blist, GtkTreeIter groupiter, GtkTreeIter *cur, GtkTreeIter *iter)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6162 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6163 GtkTreeIter more_z;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6164
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6165 const char *my_name;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6166
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
6167 if(PURPLE_BLIST_NODE_IS_CONTACT(node)) {
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
6168 my_name = purple_contact_get_alias((PurpleContact*)node);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
6169 } else if(PURPLE_BLIST_NODE_IS_CHAT(node)) {
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
6170 my_name = purple_chat_get_name((PurpleChat*)node);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6171 } else {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6172 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
6173 return;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6174 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6175
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6176
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6177 if (!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
6178 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
6179 return;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6180 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6181
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6182 do {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6183 GValue val;
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
6184 PurpleBlistNode *n;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6185 const char *this_name;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6186 int cmp;
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 val.g_type = 0;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6189 gtk_tree_model_get_value (GTK_TREE_MODEL(gtkblist->treemodel), &more_z, NODE_COLUMN, &val);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6190 n = g_value_get_pointer(&val);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6191
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
6192 if(PURPLE_BLIST_NODE_IS_CONTACT(n)) {
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
6193 this_name = purple_contact_get_alias((PurpleContact*)n);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
6194 } else if(PURPLE_BLIST_NODE_IS_CHAT(n)) {
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
6195 this_name = purple_chat_get_name((PurpleChat*)n);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6196 } else {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6197 this_name = NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6198 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6199
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
6200 cmp = purple_utf8_strcasecmp(my_name, this_name);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6201
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6202 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
6203 if(cur) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6204 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
6205 *iter = *cur;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6206 return;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6207 } else {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6208 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
6209 &groupiter, &more_z);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6210 return;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6211 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6212 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6213 g_value_unset(&val);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6214 } 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
6215
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6216 if(cur) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6217 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
6218 *iter = *cur;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6219 return;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6220 } else {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6221 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
6222 return;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6223 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6224 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6225
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
6226 static void sort_method_status(PurpleBlistNode *node, PurpleBuddyList *blist, GtkTreeIter groupiter, GtkTreeIter *cur, GtkTreeIter *iter)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6227 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6228 GtkTreeIter more_z;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6229
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
6230 PurpleBuddy *my_buddy, *this_buddy;
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
6231
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
6232 if(PURPLE_BLIST_NODE_IS_CONTACT(node)) {
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
6233 my_buddy = purple_contact_get_priority_buddy((PurpleContact*)node);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
6234 } else if(PURPLE_BLIST_NODE_IS_CHAT(node)) {
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6235 if (cur != NULL) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6236 *iter = *cur;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6237 return;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6238 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6239
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6240 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
6241 return;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6242 } else {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6243 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
6244 return;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6245 }
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
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6248 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
6249 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
6250 return;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6251 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6252
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6253 do {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6254 GValue val;
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
6255 PurpleBlistNode *n;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6256 gint name_cmp;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6257 gint presence_cmp;
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 val.g_type = 0;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6260 gtk_tree_model_get_value (GTK_TREE_MODEL(gtkblist->treemodel), &more_z, NODE_COLUMN, &val);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6261 n = g_value_get_pointer(&val);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6262
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
6263 if(PURPLE_BLIST_NODE_IS_CONTACT(n)) {
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
6264 this_buddy = purple_contact_get_priority_buddy((PurpleContact*)n);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6265 } else {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6266 this_buddy = NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6267 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6268
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
6269 name_cmp = purple_utf8_strcasecmp(
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
6270 purple_contact_get_alias(purple_buddy_get_contact(my_buddy)),
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6271 (this_buddy
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
6272 ? purple_contact_get_alias(purple_buddy_get_contact(this_buddy))
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6273 : NULL));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6274
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
6275 presence_cmp = purple_presence_compare(
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
6276 purple_buddy_get_presence(my_buddy),
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
6277 this_buddy ? purple_buddy_get_presence(this_buddy) : NULL);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6278
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6279 if (this_buddy == NULL ||
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6280 (presence_cmp < 0 ||
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6281 (presence_cmp == 0 &&
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6282 (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
6283 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6284 if (cur != NULL)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6285 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6286 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
6287 *iter = *cur;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6288 return;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6289 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6290 else
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6291 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6292 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
6293 &groupiter, &more_z);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6294 return;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6295 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6296 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6297
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6298 g_value_unset(&val);
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 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
6301 &more_z));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6302
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6303 if (cur) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6304 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
6305 *iter = *cur;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6306 return;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6307 } else {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6308 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
6309 return;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6310 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6311 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6312
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
6313 static void sort_method_log(PurpleBlistNode *node, PurpleBuddyList *blist, GtkTreeIter groupiter, GtkTreeIter *cur, GtkTreeIter *iter)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6314 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6315 GtkTreeIter more_z;
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 int log_size = 0, this_log_size = 0;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6318 const char *buddy_name, *this_buddy_name;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6319
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6320 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
6321 *iter = *cur;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6322 return;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6323 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6324
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
6325 if(PURPLE_BLIST_NODE_IS_CONTACT(node)) {
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
6326 PurpleBlistNode *n;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6327 for (n = node->child; n; n = n->next)
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
6328 log_size += purple_log_get_total_size(PURPLE_LOG_IM, ((PurpleBuddy*)(n))->name, ((PurpleBuddy*)(n))->account);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
6329 buddy_name = purple_contact_get_alias((PurpleContact*)node);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
6330 } else if(PURPLE_BLIST_NODE_IS_CHAT(node)) {
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6331 /* 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
6332 * 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
6333 if (cur != NULL) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6334 *iter = *cur;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6335 return;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6336 }
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 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
6339 return;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6340 } else {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6341 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
6342 return;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6343 }
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
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6346 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
6347 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
6348 return;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6349 }
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 do {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6352 GValue val;
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
6353 PurpleBlistNode *n;
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
6354 PurpleBlistNode *n2;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6355 int cmp;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6356
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6357 val.g_type = 0;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6358 gtk_tree_model_get_value (GTK_TREE_MODEL(gtkblist->treemodel), &more_z, NODE_COLUMN, &val);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6359 n = g_value_get_pointer(&val);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6360 this_log_size = 0;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6361
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
6362 if(PURPLE_BLIST_NODE_IS_CONTACT(n)) {
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6363 for (n2 = n->child; n2; n2 = n2->next)
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
6364 this_log_size += purple_log_get_total_size(PURPLE_LOG_IM, ((PurpleBuddy*)(n2))->name, ((PurpleBuddy*)(n2))->account);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
6365 this_buddy_name = purple_contact_get_alias((PurpleContact*)n);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6366 } else {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6367 this_buddy_name = NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6368 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6369
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
6370 cmp = purple_utf8_strcasecmp(buddy_name, this_buddy_name);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
6371
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
6372 if (!PURPLE_BLIST_NODE_IS_CONTACT(n) || log_size > this_log_size ||
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6373 ((log_size == this_log_size) &&
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6374 (cmp < 0 || (cmp == 0 && node < n)))) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6375 if (cur != NULL) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6376 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
6377 *iter = *cur;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6378 return;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6379 } else {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6380 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
6381 &groupiter, &more_z);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6382 return;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6383 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6384 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6385 g_value_unset(&val);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6386 } 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
6387
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6388 if (cur != NULL) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6389 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
6390 *iter = *cur;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6391 return;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6392 } else {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6393 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
6394 return;
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
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6398 #endif
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6399
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6400 static void
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
6401 plugin_act(GtkObject *obj, PurplePluginAction *pam)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6402 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6403 if (pam && pam->callback)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6404 pam->callback(pam);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6405 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6406
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6407 static void
15980
f61113b26032 sf patch #1689182, from Will Thompson
Mark Doliner <mark@kingant.net>
parents: 15921
diff changeset
6408 build_plugin_actions(GtkWidget *menu, PurplePlugin *plugin,
f61113b26032 sf patch #1689182, from Will Thompson
Mark Doliner <mark@kingant.net>
parents: 15921
diff changeset
6409 gpointer context)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6410 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6411 GtkWidget *menuitem;
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
6412 PurplePluginAction *action = NULL;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6413 GList *actions, *l;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6414
15980
f61113b26032 sf patch #1689182, from Will Thompson
Mark Doliner <mark@kingant.net>
parents: 15921
diff changeset
6415 actions = PURPLE_PLUGIN_ACTIONS(plugin, context);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6416
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6417 for (l = actions; l != NULL; l = l->next)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6418 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6419 if (l->data)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6420 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
6421 action = (PurplePluginAction *) l->data;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6422 action->plugin = plugin;
15980
f61113b26032 sf patch #1689182, from Will Thompson
Mark Doliner <mark@kingant.net>
parents: 15921
diff changeset
6423 action->context = context;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6424
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6425 menuitem = gtk_menu_item_new_with_label(action->label);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6426 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
6427
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6428 g_signal_connect(G_OBJECT(menuitem), "activate",
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6429 G_CALLBACK(plugin_act), action);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6430 g_object_set_data_full(G_OBJECT(menuitem), "plugin_action",
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6431 action,
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
6432 (GDestroyNotify)purple_plugin_action_free);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6433 gtk_widget_show(menuitem);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6434 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6435 else
15507
311315e979f7 gtkutils changes
Sean Egan <seanegan@gmail.com>
parents: 15505
diff changeset
6436 pidgin_separator(menu);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6437 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6438
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6439 g_list_free(actions);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6440 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6441
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6442 static void
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6443 modify_account_cb(GtkWidget *widget, gpointer data)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6444 {
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
6445 pidgin_account_dialog_show(PIDGIN_MODIFY_ACCOUNT_DIALOG, data);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6446 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6447
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6448 static void
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6449 enable_account_cb(GtkCheckMenuItem *widget, gpointer data)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6450 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
6451 PurpleAccount *account = data;
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
6452 const PurpleSavedStatus *saved_status;
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
6453
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
6454 saved_status = purple_savedstatus_get_current();
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
6455 purple_savedstatus_activate_for_account(saved_status, account);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
6456
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
6457 purple_account_set_enabled(account, PIDGIN_UI, TRUE);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6458 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6459
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6460 static void
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6461 disable_account_cb(GtkCheckMenuItem *widget, gpointer data)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6462 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
6463 PurpleAccount *account = data;
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
6464
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
6465 purple_account_set_enabled(account, PIDGIN_UI, FALSE);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6466 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6467
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6468 void
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
6469 pidgin_blist_update_accounts_menu(void)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6470 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6471 GtkWidget *menuitem = NULL, *submenu = NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6472 GtkAccelGroup *accel_group = NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6473 GList *l = NULL, *accounts = NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6474 gboolean disabled_accounts = FALSE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6475
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6476 if (accountmenu == NULL)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6477 return;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6478
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6479 /* Clear the old Accounts menu */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6480 for (l = gtk_container_get_children(GTK_CONTAINER(accountmenu)); l; l = l->next) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6481 menuitem = l->data;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6482
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6483 if (menuitem != gtk_item_factory_get_widget(gtkblist->ift, N_("/Accounts/Add\\/Edit")))
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6484 gtk_widget_destroy(menuitem);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6485 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6486
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
6487 for (accounts = purple_accounts_get_all(); accounts; accounts = accounts->next) {
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6488 char *buf = NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6489 char *accel_path_buf = NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6490 GtkWidget *image = NULL;
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
6491 PurpleConnection *gc = NULL;
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
6492 PurpleAccount *account = NULL;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6493 GdkPixbuf *pixbuf = NULL;
15980
f61113b26032 sf patch #1689182, from Will Thompson
Mark Doliner <mark@kingant.net>
parents: 15921
diff changeset
6494 PurplePlugin *plugin = NULL;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6495
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6496 account = accounts->data;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6497 accel_group = gtk_menu_get_accel_group(GTK_MENU(accountmenu));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6498
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
6499 if(purple_account_get_enabled(account, PIDGIN_UI)) {
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
6500 buf = g_strconcat(purple_account_get_username(account), " (",
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
6501 purple_account_get_protocol_name(account), ")", NULL);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6502 menuitem = gtk_image_menu_item_new_with_label(buf);
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
6503 accel_path_buf = g_strconcat(N_("<PurpleMain>/Accounts/"), buf, NULL);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6504 g_free(buf);
15738
20225df32b7e Change some old, busted status icon stuff to use the new hotness
Sean Egan <seanegan@gmail.com>
parents: 15708
diff changeset
6505 pixbuf = pidgin_create_prpl_icon(account, PIDGIN_PRPL_ICON_SMALL);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6506 if (pixbuf != NULL)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6507 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
6508 if (!purple_account_is_connected(account))
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6509 gdk_pixbuf_saturate_and_pixelate(pixbuf, pixbuf,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6510 0.0, FALSE);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6511 image = gtk_image_new_from_pixbuf(pixbuf);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6512 g_object_unref(G_OBJECT(pixbuf));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6513 gtk_widget_show(image);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6514 gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(menuitem), image);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6515 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6516 gtk_menu_shell_append(GTK_MENU_SHELL(accountmenu), menuitem);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6517 gtk_widget_show(menuitem);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6518
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6519 submenu = gtk_menu_new();
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6520 gtk_menu_set_accel_group(GTK_MENU(submenu), accel_group);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6521 gtk_menu_set_accel_path(GTK_MENU(submenu), accel_path_buf);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6522 g_free(accel_path_buf);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6523 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
6524 gtk_widget_show(submenu);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6525
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6526
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6527 menuitem = gtk_menu_item_new_with_mnemonic(_("_Edit Account"));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6528 g_signal_connect(G_OBJECT(menuitem), "activate",
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6529 G_CALLBACK(modify_account_cb), account);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6530 gtk_menu_shell_append(GTK_MENU_SHELL(submenu), menuitem);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6531 gtk_widget_show(menuitem);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6532
15507
311315e979f7 gtkutils changes
Sean Egan <seanegan@gmail.com>
parents: 15505
diff changeset
6533 pidgin_separator(submenu);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6534
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
6535 gc = purple_account_get_connection(account);
15980
f61113b26032 sf patch #1689182, from Will Thompson
Mark Doliner <mark@kingant.net>
parents: 15921
diff changeset
6536 plugin = gc && PURPLE_CONNECTION_IS_CONNECTED(gc) ? gc->prpl : NULL;
f61113b26032 sf patch #1689182, from Will Thompson
Mark Doliner <mark@kingant.net>
parents: 15921
diff changeset
6537 if (plugin && PURPLE_PLUGIN_HAS_ACTIONS(plugin)) {
f61113b26032 sf patch #1689182, from Will Thompson
Mark Doliner <mark@kingant.net>
parents: 15921
diff changeset
6538 build_plugin_actions(submenu, plugin, gc);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6539 } else {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6540 menuitem = gtk_menu_item_new_with_label(_("No actions available"));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6541 gtk_menu_shell_append(GTK_MENU_SHELL(submenu), menuitem);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6542 gtk_widget_set_sensitive(menuitem, FALSE);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6543 gtk_widget_show(menuitem);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6544 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6545
15507
311315e979f7 gtkutils changes
Sean Egan <seanegan@gmail.com>
parents: 15505
diff changeset
6546 pidgin_separator(submenu);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6547
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6548 menuitem = gtk_menu_item_new_with_mnemonic(_("_Disable"));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6549 g_signal_connect(G_OBJECT(menuitem), "activate",
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6550 G_CALLBACK(disable_account_cb), account);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6551 gtk_menu_shell_append(GTK_MENU_SHELL(submenu), menuitem);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6552 gtk_widget_show(menuitem);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6553 } else {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6554 disabled_accounts = TRUE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6555 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6556 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6557
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6558 if(disabled_accounts) {
15507
311315e979f7 gtkutils changes
Sean Egan <seanegan@gmail.com>
parents: 15505
diff changeset
6559 pidgin_separator(accountmenu);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6560 menuitem = gtk_menu_item_new_with_label(_("Enable Account"));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6561 gtk_menu_shell_append(GTK_MENU_SHELL(accountmenu), menuitem);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6562 gtk_widget_show(menuitem);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6563
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6564 submenu = gtk_menu_new();
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6565 gtk_menu_set_accel_group(GTK_MENU(submenu), accel_group);
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
6566 gtk_menu_set_accel_path(GTK_MENU(submenu), N_("<PurpleMain>/Accounts/Enable Account"));
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6567 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
6568 gtk_widget_show(submenu);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6569
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
6570 for (accounts = purple_accounts_get_all(); accounts; accounts = accounts->next) {
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6571 char *buf = NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6572 GtkWidget *image = NULL;
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
6573 PurpleAccount *account = NULL;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6574 GdkPixbuf *pixbuf = NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6575
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6576 account = accounts->data;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6577
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
6578 if(!purple_account_get_enabled(account, PIDGIN_UI)) {
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6579
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6580 disabled_accounts = TRUE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6581
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
6582 buf = g_strconcat(purple_account_get_username(account), " (",
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
6583 purple_account_get_protocol_name(account), ")", NULL);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6584 menuitem = gtk_image_menu_item_new_with_label(buf);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6585 g_free(buf);
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
6586 pixbuf = pidgin_create_prpl_icon(account, PIDGIN_PRPL_ICON_SMALL);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6587 if (pixbuf != NULL)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6588 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
6589 if (!purple_account_is_connected(account))
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6590 gdk_pixbuf_saturate_and_pixelate(pixbuf, pixbuf, 0.0, FALSE);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6591 image = gtk_image_new_from_pixbuf(pixbuf);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6592 g_object_unref(G_OBJECT(pixbuf));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6593 gtk_widget_show(image);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6594 gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(menuitem), image);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6595 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6596 g_signal_connect(G_OBJECT(menuitem), "activate",
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6597 G_CALLBACK(enable_account_cb), account);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6598 gtk_menu_shell_append(GTK_MENU_SHELL(submenu), menuitem);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6599 gtk_widget_show(menuitem);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6600 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6601 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6602 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6603 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6604
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6605 static GList *plugin_submenus = NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6606
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6607 void
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
6608 pidgin_blist_update_plugin_actions(void)
15374
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 GtkWidget *menuitem, *submenu;
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
6611 PurplePlugin *plugin = NULL;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6612 GList *l;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6613 GtkAccelGroup *accel_group;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6614
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6615 GtkWidget *pluginmenu = gtk_item_factory_get_widget(gtkblist->ift, N_("/Tools"));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6616
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6617 g_return_if_fail(pluginmenu != NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6618
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6619 /* Remove old plugin action submenus from the Tools menu */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6620 for (l = plugin_submenus; l; l = l->next)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6621 gtk_widget_destroy(GTK_WIDGET(l->data));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6622 g_list_free(plugin_submenus);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6623 plugin_submenus = NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6624
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6625 accel_group = gtk_menu_get_accel_group(GTK_MENU(pluginmenu));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6626
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6627 /* Add a submenu for each plugin with custom actions */
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
6628 for (l = purple_plugins_get_loaded(); l; l = l->next) {
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6629 char *path;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6630
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
6631 plugin = (PurplePlugin *) l->data;
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
6632
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
6633 if (PURPLE_IS_PROTOCOL_PLUGIN(plugin))
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6634 continue;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6635
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
6636 if (!PURPLE_PLUGIN_HAS_ACTIONS(plugin))
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6637 continue;
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 menuitem = gtk_image_menu_item_new_with_label(_(plugin->info->name));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6640 gtk_menu_shell_append(GTK_MENU_SHELL(pluginmenu), menuitem);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6641 gtk_widget_show(menuitem);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6642
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6643 plugin_submenus = g_list_append(plugin_submenus, menuitem);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6644
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6645 submenu = gtk_menu_new();
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6646 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
6647 gtk_widget_show(submenu);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6648
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6649 gtk_menu_set_accel_group(GTK_MENU(submenu), accel_group);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6650 path = g_strdup_printf("%s/Tools/%s", gtkblist->ift->path, plugin->info->name);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6651 gtk_menu_set_accel_path(GTK_MENU(submenu), path);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6652 g_free(path);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6653
15980
f61113b26032 sf patch #1689182, from Will Thompson
Mark Doliner <mark@kingant.net>
parents: 15921
diff changeset
6654 build_plugin_actions(submenu, plugin, NULL);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6655 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6656 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6657
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6658 static void
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6659 sortmethod_act(GtkCheckMenuItem *checkmenuitem, char *id)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6660 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6661 if (gtk_check_menu_item_get_active(checkmenuitem))
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6662 {
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
6663 pidgin_set_cursor(gtkblist->window, GDK_WATCH);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6664 /* This is redundant. I think. */
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
6665 /* pidgin_blist_sort_method_set(id); */
16062
07554cc5d090 Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <stu@nosnilmot.com>
parents: 16010
diff changeset
6666 purple_prefs_set_string(PIDGIN_PREFS_ROOT "/blist/sort_type", id);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6667
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
6668 pidgin_clear_cursor(gtkblist->window);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6669 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6670 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6671
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6672 void
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
6673 pidgin_blist_update_sort_methods(void)
15374
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 GtkWidget *menuitem = NULL, *activeitem = NULL;
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
6676 PidginBlistSortMethod *method = NULL;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6677 GList *l;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6678 GSList *sl = NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6679 GtkWidget *sortmenu;
16062
07554cc5d090 Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <stu@nosnilmot.com>
parents: 16010
diff changeset
6680 const char *m = purple_prefs_get_string(PIDGIN_PREFS_ROOT "/blist/sort_type");
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6681
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6682 if ((gtkblist == NULL) || (gtkblist->ift == NULL))
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6683 return;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6684
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6685 sortmenu = gtk_item_factory_get_widget(gtkblist->ift, N_("/Buddies/Sort Buddies"));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6686
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6687 if (sortmenu == NULL)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6688 return;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6689
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6690 /* Clear the old menu */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6691 for (l = gtk_container_get_children(GTK_CONTAINER(sortmenu)); l; l = l->next) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6692 menuitem = l->data;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6693 gtk_widget_destroy(GTK_WIDGET(menuitem));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6694 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6695
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
6696 for (l = pidgin_blist_sort_methods; l; l = l->next) {
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15500
diff changeset
6697 method = (PidginBlistSortMethod *) l->data;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6698 menuitem = gtk_radio_menu_item_new_with_label(sl, _(method->name));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6699 if (!strcmp(m, method->id))
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6700 activeitem = menuitem;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6701 sl = gtk_radio_menu_item_get_group(GTK_RADIO_MENU_ITEM(menuitem));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6702 gtk_menu_shell_append(GTK_MENU_SHELL(sortmenu), menuitem);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6703 g_signal_connect(G_OBJECT(menuitem), "toggled",
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6704 G_CALLBACK(sortmethod_act), method->id);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6705 gtk_widget_show(menuitem);
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 if (activeitem)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6708 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(activeitem), TRUE);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6709 }