annotate pidgin/gtkstatusbox.c @ 24019:147ada94a1d8

2008.08.16 - ccpaging <ecc_hy(at)hotmail.com> * Rename group to room. If you used pidginqq before, this may create a new room with same title, you may delete old one * Replace purple_debug with purple_debug_info, purple_debug_warning, purple_debug_error * Add server notice and server new, and two options to turn on/off * Minor modify for reducing transaction's debug infor * Minor modifies for system notice and QQ news. * Add 4 new strings need translate compare with p10.
author SHiNE CsyFeK <csyfek@gmail.com>
date Thu, 11 Sep 2008 13:25:07 +0000
parents 3ab88169a2c2
children 1c45897c79fc
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 gtkstatusbox.c GTK+ Status Selection Widget
16193
247e421c4fa6 Rename the Doxygen group from gtkui to pidgin.
Richard Laager <rlaager@wiktel.com>
parents: 16119
diff changeset
3 * @ingroup pidgin
20074
6bf32c9e15a7 remove gpl boilerplate from doxygen docs
Sean Egan <seanegan@gmail.com>
parents: 19680
diff changeset
4 */
6bf32c9e15a7 remove gpl boilerplate from doxygen docs
Sean Egan <seanegan@gmail.com>
parents: 19680
diff changeset
5
6bf32c9e15a7 remove gpl boilerplate from doxygen docs
Sean Egan <seanegan@gmail.com>
parents: 19680
diff changeset
6 /* pidgin
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
7 *
15871
66dff3dfdea6 Re-sed the copyright notices so they don't all talk about Purple.
Richard Laager <rlaager@wiktel.com>
parents: 15824
diff changeset
8 * Pidgin is the legal property of its developers, whose names are too numerous
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
9 * to list here. Please refer to the COPYRIGHT file distributed with this
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
10 * source distribution.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
11 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
12 * This program is free software; you can redistribute it and/or modify
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
13 * it under the terms of the GNU General Public License as published by
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
14 * the Free Software Foundation; either version 2 of the License, or
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
15 * (at your option) any later version.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
16 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
17 * This program is distributed in the hope that it will be useful,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
20 * GNU General Public License for more details.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
21 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
22 * You should have received a copy of the GNU General Public License
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
23 * along with this program; if not, write to the Free Software
19680
44b4e8bd759b The FSF changed its address a while ago; our files were out of date.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 19482
diff changeset
24 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
25 */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
26
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
27 /*
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
28 * The status box is made up of two main pieces:
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
29 * - The box that displays the current status, which is made
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
30 * of a GtkListStore ("status_box->store") and GtkCellView
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
31 * ("status_box->cell_view"). There is always exactly 1 row
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
32 * in this list store. Only the TYPE_ICON and TYPE_TEXT
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
33 * columns are used in this list store.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
34 * - The dropdown menu that lets users select a status, which
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
35 * is made of a GtkComboBox ("status_box") and GtkListStore
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
36 * ("status_box->dropdown_store"). This dropdown is shown
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
37 * when the user clicks on the box that displays the current
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
38 * status. This list store contains one row for Available,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
39 * one row for Away, etc., a few rows for popular statuses,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
40 * and the "New..." and "Saved..." options.
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
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
43 #include <gdk/gdkkeysyms.h>
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
44
18210
b8572b937c09 #include reorganizations to allow compiling with glib < 2.8 using the
Stu Tomlinson <stu@nosnilmot.com>
parents: 18198
diff changeset
45 #include "internal.h"
b8572b937c09 #include reorganizations to allow compiling with glib < 2.8 using the
Stu Tomlinson <stu@nosnilmot.com>
parents: 18198
diff changeset
46
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
47 #include "account.h"
16390
4fc51a87ce42 Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents: 16381
diff changeset
48 #include "buddyicon.h"
15824
ed80ec6be33c who knew that --disable-plugins still worked?! Also, some completely untested support for aim:buddyicon, which I'll look at more tomorrow
Sean Egan <seanegan@gmail.com>
parents: 15823
diff changeset
49 #include "core.h"
16390
4fc51a87ce42 Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents: 16381
diff changeset
50 #include "imgstore.h"
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
51 #include "network.h"
18111
02f39842d28b fixes #590 by allowing one to use the delete key to delete transient status,
Ka-Hing Cheung <khc@hxbc.us>
parents: 18058
diff changeset
52 #include "request.h"
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
53 #include "savedstatuses.h"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
54 #include "status.h"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
55 #include "debug.h"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
56
15514
535f002e7b0f More pidgin changes
Sean Egan <seanegan@gmail.com>
parents: 15507
diff changeset
57 #include "pidgin.h"
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
58 #include "gtksavedstatuses.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
59 #include "pidginstock.h"
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
60 #include "gtkstatusbox.h"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
61 #include "gtkutils.h"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
62
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
63 #ifdef USE_GTKSPELL
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
64 # include <gtkspell/gtkspell.h>
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
65 # ifdef _WIN32
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
66 # include "wspell.h"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
67 # endif
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
68 #endif
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 #define TYPING_TIMEOUT 4000
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
71
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
72 static void imhtml_changed_cb(GtkTextBuffer *buffer, void *data);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
73 static void imhtml_format_changed_cb(GtkIMHtml *imhtml, GtkIMHtmlButtons buttons, void *data);
15514
535f002e7b0f More pidgin changes
Sean Egan <seanegan@gmail.com>
parents: 15507
diff changeset
74 static void remove_typing_cb(PidginStatusBox *box);
535f002e7b0f More pidgin changes
Sean Egan <seanegan@gmail.com>
parents: 15507
diff changeset
75 static void update_size (PidginStatusBox *box);
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
76 static gint get_statusbox_index(PidginStatusBox *box, PurpleSavedStatus *saved_status);
22676
a73acc0c4dc8 Ignore token_status_account on account-specific status boxes. This should
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 22470
diff changeset
77 static PurpleAccount* check_active_accounts_for_identical_statuses(void);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
78
15514
535f002e7b0f More pidgin changes
Sean Egan <seanegan@gmail.com>
parents: 15507
diff changeset
79 static void pidgin_status_box_pulse_typing(PidginStatusBox *status_box);
535f002e7b0f More pidgin changes
Sean Egan <seanegan@gmail.com>
parents: 15507
diff changeset
80 static void pidgin_status_box_refresh(PidginStatusBox *status_box);
535f002e7b0f More pidgin changes
Sean Egan <seanegan@gmail.com>
parents: 15507
diff changeset
81 static void status_menu_refresh_iter(PidginStatusBox *status_box);
535f002e7b0f More pidgin changes
Sean Egan <seanegan@gmail.com>
parents: 15507
diff changeset
82 static void pidgin_status_box_regenerate(PidginStatusBox *status_box);
535f002e7b0f More pidgin changes
Sean Egan <seanegan@gmail.com>
parents: 15507
diff changeset
83 static void pidgin_status_box_changed(PidginStatusBox *box);
535f002e7b0f More pidgin changes
Sean Egan <seanegan@gmail.com>
parents: 15507
diff changeset
84 static void pidgin_status_box_size_request (GtkWidget *widget, GtkRequisition *requisition);
535f002e7b0f More pidgin changes
Sean Egan <seanegan@gmail.com>
parents: 15507
diff changeset
85 static void pidgin_status_box_size_allocate (GtkWidget *widget, GtkAllocation *allocation);
535f002e7b0f More pidgin changes
Sean Egan <seanegan@gmail.com>
parents: 15507
diff changeset
86 static gboolean pidgin_status_box_expose_event (GtkWidget *widget, GdkEventExpose *event);
535f002e7b0f More pidgin changes
Sean Egan <seanegan@gmail.com>
parents: 15507
diff changeset
87 static void pidgin_status_box_redisplay_buddy_icon(PidginStatusBox *status_box);
535f002e7b0f More pidgin changes
Sean Egan <seanegan@gmail.com>
parents: 15507
diff changeset
88 static void pidgin_status_box_forall (GtkContainer *container, gboolean include_internals, GtkCallback callback, gpointer callback_data);
535f002e7b0f More pidgin changes
Sean Egan <seanegan@gmail.com>
parents: 15507
diff changeset
89 static void pidgin_status_box_popup(PidginStatusBox *box);
535f002e7b0f More pidgin changes
Sean Egan <seanegan@gmail.com>
parents: 15507
diff changeset
90 static void pidgin_status_box_popdown(PidginStatusBox *box);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
91
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
92 static void do_colorshift (GdkPixbuf *dest, GdkPixbuf *src, int shift);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
93 static void icon_choose_cb(const char *filename, gpointer data);
15514
535f002e7b0f More pidgin changes
Sean Egan <seanegan@gmail.com>
parents: 15507
diff changeset
94 static void remove_buddy_icon_cb(GtkWidget *w, PidginStatusBox *box);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
95
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
96 enum {
15514
535f002e7b0f More pidgin changes
Sean Egan <seanegan@gmail.com>
parents: 15507
diff changeset
97 /** A PidginStatusBoxItemType */
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
98 TYPE_COLUMN,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
99
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
100 /**
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
101 * This is a GdkPixbuf (the other columns are strings).
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
102 * This column is visible.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
103 */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
104 ICON_COLUMN,
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 /** The text displayed on the status box. This column is visible. */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
107 TEXT_COLUMN,
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 /** The plain-English title of this item */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
110 TITLE_COLUMN,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
111
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
112 /** A plain-English description of this item */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
113 DESC_COLUMN,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
114
16296
78f798d99d3a Saved icon for saved statuses in statusbox
Sean Egan <seanegan@gmail.com>
parents: 16270
diff changeset
115 /**
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
116 * This value depends on TYPE_COLUMN. For POPULAR types,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
117 * this is the creation time. For PRIMITIVE types,
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
118 * this is the PurpleStatusPrimitive.
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
119 */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
120 DATA_COLUMN,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
121
16296
78f798d99d3a Saved icon for saved statuses in statusbox
Sean Egan <seanegan@gmail.com>
parents: 16270
diff changeset
122 /**
21959
d3a4c98c01b7 Show the prpl icon in the account-specific statusboxes to avoid ambiguity.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 21913
diff changeset
123 * This column stores the GdkPixbuf for the status emblem. Currently only 'saved' is stored.
d3a4c98c01b7 Show the prpl icon in the account-specific statusboxes to avoid ambiguity.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 21913
diff changeset
124 * In the GtkTreeModel for the dropdown, this is the stock-id (gchararray), and for the
d3a4c98c01b7 Show the prpl icon in the account-specific statusboxes to avoid ambiguity.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 21913
diff changeset
125 * GtkTreeModel for the cell_view (for the account-specific statusbox), this is the prpl-icon
d3a4c98c01b7 Show the prpl icon in the account-specific statusboxes to avoid ambiguity.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 21913
diff changeset
126 * (GdkPixbuf) of the account.
16296
78f798d99d3a Saved icon for saved statuses in statusbox
Sean Egan <seanegan@gmail.com>
parents: 16270
diff changeset
127 */
78f798d99d3a Saved icon for saved statuses in statusbox
Sean Egan <seanegan@gmail.com>
parents: 16270
diff changeset
128 EMBLEM_COLUMN,
78f798d99d3a Saved icon for saved statuses in statusbox
Sean Egan <seanegan@gmail.com>
parents: 16270
diff changeset
129
78f798d99d3a Saved icon for saved statuses in statusbox
Sean Egan <seanegan@gmail.com>
parents: 16270
diff changeset
130 /**
78f798d99d3a Saved icon for saved statuses in statusbox
Sean Egan <seanegan@gmail.com>
parents: 16270
diff changeset
131 * This column stores whether to show the emblem.
78f798d99d3a Saved icon for saved statuses in statusbox
Sean Egan <seanegan@gmail.com>
parents: 16270
diff changeset
132 */
78f798d99d3a Saved icon for saved statuses in statusbox
Sean Egan <seanegan@gmail.com>
parents: 16270
diff changeset
133 EMBLEM_VISIBLE_COLUMN,
78f798d99d3a Saved icon for saved statuses in statusbox
Sean Egan <seanegan@gmail.com>
parents: 16270
diff changeset
134
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
135 NUM_COLUMNS
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
136 };
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
137
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
138 enum {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
139 PROP_0,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
140 PROP_ACCOUNT,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
141 PROP_ICON_SEL,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
142 };
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
143
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
144 GtkContainerClass *parent_class = NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
145
15514
535f002e7b0f More pidgin changes
Sean Egan <seanegan@gmail.com>
parents: 15507
diff changeset
146 static void pidgin_status_box_class_init (PidginStatusBoxClass *klass);
535f002e7b0f More pidgin changes
Sean Egan <seanegan@gmail.com>
parents: 15507
diff changeset
147 static void pidgin_status_box_init (PidginStatusBox *status_box);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
148
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
149 GType
15514
535f002e7b0f More pidgin changes
Sean Egan <seanegan@gmail.com>
parents: 15507
diff changeset
150 pidgin_status_box_get_type (void)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
151 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
152 static GType status_box_type = 0;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
153
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
154 if (!status_box_type)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
155 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
156 static const GTypeInfo status_box_info =
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
157 {
15514
535f002e7b0f More pidgin changes
Sean Egan <seanegan@gmail.com>
parents: 15507
diff changeset
158 sizeof (PidginStatusBoxClass),
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
159 NULL, /* base_init */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
160 NULL, /* base_finalize */
15514
535f002e7b0f More pidgin changes
Sean Egan <seanegan@gmail.com>
parents: 15507
diff changeset
161 (GClassInitFunc) pidgin_status_box_class_init,
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
162 NULL, /* class_finalize */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
163 NULL, /* class_data */
15514
535f002e7b0f More pidgin changes
Sean Egan <seanegan@gmail.com>
parents: 15507
diff changeset
164 sizeof (PidginStatusBox),
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
165 0,
15514
535f002e7b0f More pidgin changes
Sean Egan <seanegan@gmail.com>
parents: 15507
diff changeset
166 (GInstanceInitFunc) pidgin_status_box_init,
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
167 NULL /* value_table */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
168 };
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
169
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
170 status_box_type = g_type_register_static(GTK_TYPE_CONTAINER,
15514
535f002e7b0f More pidgin changes
Sean Egan <seanegan@gmail.com>
parents: 15507
diff changeset
171 "PidginStatusBox",
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
172 &status_box_info,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
173 0);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
174 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
175
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
176 return status_box_type;
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
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
179 static void
15514
535f002e7b0f More pidgin changes
Sean Egan <seanegan@gmail.com>
parents: 15507
diff changeset
180 pidgin_status_box_get_property(GObject *object, guint param_id,
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
181 GValue *value, GParamSpec *psec)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
182 {
15514
535f002e7b0f More pidgin changes
Sean Egan <seanegan@gmail.com>
parents: 15507
diff changeset
183 PidginStatusBox *statusbox = PIDGIN_STATUS_BOX(object);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
184
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
185 switch (param_id) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
186 case PROP_ACCOUNT:
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
187 g_value_set_pointer(value, statusbox->account);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
188 break;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
189 case PROP_ICON_SEL:
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
190 g_value_set_boolean(value, statusbox->icon_box != NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
191 break;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
192 default:
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
193 G_OBJECT_WARN_INVALID_PROPERTY_ID(object, param_id, psec);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
194 break;
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 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
197
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
198 static void
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
199 update_to_reflect_account_status(PidginStatusBox *status_box, PurpleAccount *account, PurpleStatus *newstatus)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
200 {
18118
ab6d2763b8d8 Re-fix the DBus list handling code by killing const GList* / const GSList*
Richard Laager <rlaager@wiktel.com>
parents: 18063
diff changeset
201 GList *l;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
202 int status_no = -1;
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
203 const PurpleStatusType *statustype = NULL;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
204 const char *message;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
205
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
206 statustype = purple_status_type_find_with_id((GList *)purple_account_get_status_types(account),
17038
2c5654d1a17a disapproval of revision '105009e066f1bcaefb0af3bd1e17b7860bf12a57'
Daniel Atallah <daniel.atallah@gmail.com>
parents: 17037
diff changeset
207 (char *)purple_status_type_get_id(purple_status_get_type(newstatus)));
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
208
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
209 for (l = purple_account_get_status_types(account); l != NULL; l = l->next) {
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
210 PurpleStatusType *status_type = (PurpleStatusType *)l->data;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
211
23273
74f1a07f452b Don't include 'Listening to music' in the per-account statusbox.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 23264
diff changeset
212 if (!purple_status_type_is_user_settable(status_type) ||
74f1a07f452b Don't include 'Listening to music' in the per-account statusbox.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 23264
diff changeset
213 purple_status_type_is_independent(status_type))
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
214 continue;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
215 status_no++;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
216 if (statustype == status_type)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
217 break;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
218 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
219
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
220 if (status_no != -1) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
221 GtkTreePath *path;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
222 gtk_widget_set_sensitive(GTK_WIDGET(status_box), FALSE);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
223 path = gtk_tree_path_new_from_indices(status_no, -1);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
224 if (status_box->active_row)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
225 gtk_tree_row_reference_free(status_box->active_row);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
226 status_box->active_row = gtk_tree_row_reference_new(GTK_TREE_MODEL(status_box->dropdown_store), path);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
227 gtk_tree_path_free(path);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
228
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
229 message = purple_status_get_attr_string(newstatus, "message");
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
230
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
231 if (!message || !*message)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
232 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
233 gtk_widget_hide_all(status_box->vbox);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
234 status_box->imhtml_visible = FALSE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
235 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
236 else
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
237 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
238 gtk_widget_show_all(status_box->vbox);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
239 status_box->imhtml_visible = TRUE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
240 gtk_imhtml_clear(GTK_IMHTML(status_box->imhtml));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
241 gtk_imhtml_clear_formatting(GTK_IMHTML(status_box->imhtml));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
242 gtk_imhtml_append_text(GTK_IMHTML(status_box->imhtml), message, 0);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
243 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
244 gtk_widget_set_sensitive(GTK_WIDGET(status_box), TRUE);
15514
535f002e7b0f More pidgin changes
Sean Egan <seanegan@gmail.com>
parents: 15507
diff changeset
245 pidgin_status_box_refresh(status_box);
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 }
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 static void
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
250 account_status_changed_cb(PurpleAccount *account, PurpleStatus *oldstatus, PurpleStatus *newstatus, PidginStatusBox *status_box)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
251 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
252 if (status_box->account == account)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
253 update_to_reflect_account_status(status_box, account, newstatus);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
254 else if (status_box->token_status_account == account)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
255 status_menu_refresh_iter(status_box);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
256 }
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 static gboolean
15514
535f002e7b0f More pidgin changes
Sean Egan <seanegan@gmail.com>
parents: 15507
diff changeset
259 icon_box_press_cb(GtkWidget *widget, GdkEventButton *event, PidginStatusBox *box)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
260 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
261 if (event->button == 3) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
262 GtkWidget *menu_item;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
263
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
264 if (box->icon_box_menu)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
265 gtk_widget_destroy(box->icon_box_menu);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
266
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
267 box->icon_box_menu = gtk_menu_new();
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
268
15507
311315e979f7 gtkutils changes
Sean Egan <seanegan@gmail.com>
parents: 15501
diff changeset
269 menu_item = pidgin_new_item_from_stock(box->icon_box_menu, _("Remove"), GTK_STOCK_REMOVE,
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
270 G_CALLBACK(remove_buddy_icon_cb),
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
271 box, 0, 0, NULL);
16062
07554cc5d090 Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <stu@nosnilmot.com>
parents: 15938
diff changeset
272 if (purple_prefs_get_path(PIDGIN_PREFS_ROOT "/accounts/buddyicon") == NULL)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
273 gtk_widget_set_sensitive(menu_item, FALSE);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
274
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
275 gtk_menu_popup(GTK_MENU(box->icon_box_menu), NULL, NULL, NULL, NULL,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
276 event->button, event->time);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
277
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
278 } else {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
279 if (box->buddy_icon_sel) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
280 gtk_window_present(GTK_WINDOW(box->buddy_icon_sel));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
281 return FALSE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
282 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
283
21267
83b9a8201cbd Patch from Gabriel Schulhof to transiate yet another window.
Gabriel Schulhof <nix@go-nix.ca>
parents: 21095
diff changeset
284 box->buddy_icon_sel = pidgin_buddy_icon_chooser_new(GTK_WINDOW(gtk_widget_get_toplevel(widget)), icon_choose_cb, box);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
285 gtk_widget_show_all(box->buddy_icon_sel);
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 return FALSE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
288 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
289
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
290 static void
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
291 icon_box_dnd_cb(GtkWidget *widget, GdkDragContext *dc, gint x, gint y,
15514
535f002e7b0f More pidgin changes
Sean Egan <seanegan@gmail.com>
parents: 15507
diff changeset
292 GtkSelectionData *sd, guint info, guint t, PidginStatusBox *box)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
293 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
294 gchar *name = (gchar *)sd->data;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
295
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
296 if ((sd->length >= 0) && (sd->format == 8)) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
297 /* Well, it looks like the drag event was cool.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
298 * Let's do something with it */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
299 if (!g_ascii_strncasecmp(name, "file://", 7)) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
300 GError *converr = NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
301 gchar *tmp, *rtmp;
15938
d04878ce947b Some pixmap path fixes and win32 fixes
Daniel Atallah <daniel.atallah@gmail.com>
parents: 15880
diff changeset
302
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
303 if(!(tmp = g_filename_from_uri(name, NULL, &converr))) {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
304 purple_debug(PURPLE_DEBUG_ERROR, "buddyicon", "%s\n",
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
305 (converr ? converr->message :
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
306 "g_filename_from_uri error"));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
307 return;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
308 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
309 if ((rtmp = strchr(tmp, '\r')) || (rtmp = strchr(tmp, '\n')))
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
310 *rtmp = '\0';
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
311 icon_choose_cb(tmp, box);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
312 g_free(tmp);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
313 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
314 gtk_drag_finish(dc, TRUE, FALSE, t);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
315 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
316 gtk_drag_finish(dc, FALSE, FALSE, t);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
317 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
318
15824
ed80ec6be33c who knew that --disable-plugins still worked?! Also, some completely untested support for aim:buddyicon, which I'll look at more tomorrow
Sean Egan <seanegan@gmail.com>
parents: 15823
diff changeset
319 static void
ed80ec6be33c who knew that --disable-plugins still worked?! Also, some completely untested support for aim:buddyicon, which I'll look at more tomorrow
Sean Egan <seanegan@gmail.com>
parents: 15823
diff changeset
320 statusbox_got_url(PurpleUtilFetchUrlData *url_data, gpointer user_data,
15880
80f999140126 Fix a compile warning so that statusbox_got_url() might actually work
Stu Tomlinson <stu@nosnilmot.com>
parents: 15871
diff changeset
321 const gchar *themedata, size_t len, const gchar *error_message)
15824
ed80ec6be33c who knew that --disable-plugins still worked?! Also, some completely untested support for aim:buddyicon, which I'll look at more tomorrow
Sean Egan <seanegan@gmail.com>
parents: 15823
diff changeset
322 {
15880
80f999140126 Fix a compile warning so that statusbox_got_url() might actually work
Stu Tomlinson <stu@nosnilmot.com>
parents: 15871
diff changeset
323 FILE *f;
80f999140126 Fix a compile warning so that statusbox_got_url() might actually work
Stu Tomlinson <stu@nosnilmot.com>
parents: 15871
diff changeset
324 gchar *path;
22071
85cda171621a Part of a large patch from o_sukhodolsky to fix some build warnings.
Richard Laager <rlaager@wiktel.com>
parents: 22007
diff changeset
325 size_t wc;
15824
ed80ec6be33c who knew that --disable-plugins still worked?! Also, some completely untested support for aim:buddyicon, which I'll look at more tomorrow
Sean Egan <seanegan@gmail.com>
parents: 15823
diff changeset
326
15880
80f999140126 Fix a compile warning so that statusbox_got_url() might actually work
Stu Tomlinson <stu@nosnilmot.com>
parents: 15871
diff changeset
327 if ((error_message != NULL) || (len == 0))
80f999140126 Fix a compile warning so that statusbox_got_url() might actually work
Stu Tomlinson <stu@nosnilmot.com>
parents: 15871
diff changeset
328 return;
15824
ed80ec6be33c who knew that --disable-plugins still worked?! Also, some completely untested support for aim:buddyicon, which I'll look at more tomorrow
Sean Egan <seanegan@gmail.com>
parents: 15823
diff changeset
329
15880
80f999140126 Fix a compile warning so that statusbox_got_url() might actually work
Stu Tomlinson <stu@nosnilmot.com>
parents: 15871
diff changeset
330 f = purple_mkstemp(&path, TRUE);
22071
85cda171621a Part of a large patch from o_sukhodolsky to fix some build warnings.
Richard Laager <rlaager@wiktel.com>
parents: 22007
diff changeset
331 wc = fwrite(themedata, len, 1, f);
85cda171621a Part of a large patch from o_sukhodolsky to fix some build warnings.
Richard Laager <rlaager@wiktel.com>
parents: 22007
diff changeset
332 if (wc != 1) {
85cda171621a Part of a large patch from o_sukhodolsky to fix some build warnings.
Richard Laager <rlaager@wiktel.com>
parents: 22007
diff changeset
333 purple_debug_warning("theme_got_url", "Unable to write theme data.\n");
85cda171621a Part of a large patch from o_sukhodolsky to fix some build warnings.
Richard Laager <rlaager@wiktel.com>
parents: 22007
diff changeset
334 fclose(f);
85cda171621a Part of a large patch from o_sukhodolsky to fix some build warnings.
Richard Laager <rlaager@wiktel.com>
parents: 22007
diff changeset
335 g_unlink(path);
85cda171621a Part of a large patch from o_sukhodolsky to fix some build warnings.
Richard Laager <rlaager@wiktel.com>
parents: 22007
diff changeset
336 g_free(path);
85cda171621a Part of a large patch from o_sukhodolsky to fix some build warnings.
Richard Laager <rlaager@wiktel.com>
parents: 22007
diff changeset
337 return;
85cda171621a Part of a large patch from o_sukhodolsky to fix some build warnings.
Richard Laager <rlaager@wiktel.com>
parents: 22007
diff changeset
338 }
15880
80f999140126 Fix a compile warning so that statusbox_got_url() might actually work
Stu Tomlinson <stu@nosnilmot.com>
parents: 15871
diff changeset
339 fclose(f);
15824
ed80ec6be33c who knew that --disable-plugins still worked?! Also, some completely untested support for aim:buddyicon, which I'll look at more tomorrow
Sean Egan <seanegan@gmail.com>
parents: 15823
diff changeset
340
15880
80f999140126 Fix a compile warning so that statusbox_got_url() might actually work
Stu Tomlinson <stu@nosnilmot.com>
parents: 15871
diff changeset
341 icon_choose_cb(path, user_data);
15824
ed80ec6be33c who knew that --disable-plugins still worked?! Also, some completely untested support for aim:buddyicon, which I'll look at more tomorrow
Sean Egan <seanegan@gmail.com>
parents: 15823
diff changeset
342
15880
80f999140126 Fix a compile warning so that statusbox_got_url() might actually work
Stu Tomlinson <stu@nosnilmot.com>
parents: 15871
diff changeset
343 g_unlink(path);
80f999140126 Fix a compile warning so that statusbox_got_url() might actually work
Stu Tomlinson <stu@nosnilmot.com>
parents: 15871
diff changeset
344 g_free(path);
15824
ed80ec6be33c who knew that --disable-plugins still worked?! Also, some completely untested support for aim:buddyicon, which I'll look at more tomorrow
Sean Egan <seanegan@gmail.com>
parents: 15823
diff changeset
345 }
ed80ec6be33c who knew that --disable-plugins still worked?! Also, some completely untested support for aim:buddyicon, which I'll look at more tomorrow
Sean Egan <seanegan@gmail.com>
parents: 15823
diff changeset
346
ed80ec6be33c who knew that --disable-plugins still worked?! Also, some completely untested support for aim:buddyicon, which I'll look at more tomorrow
Sean Egan <seanegan@gmail.com>
parents: 15823
diff changeset
347
ed80ec6be33c who knew that --disable-plugins still worked?! Also, some completely untested support for aim:buddyicon, which I'll look at more tomorrow
Sean Egan <seanegan@gmail.com>
parents: 15823
diff changeset
348 static gboolean
ed80ec6be33c who knew that --disable-plugins still worked?! Also, some completely untested support for aim:buddyicon, which I'll look at more tomorrow
Sean Egan <seanegan@gmail.com>
parents: 15823
diff changeset
349 statusbox_uri_handler(const char *proto, const char *cmd, GHashTable *params, void *data)
ed80ec6be33c who knew that --disable-plugins still worked?! Also, some completely untested support for aim:buddyicon, which I'll look at more tomorrow
Sean Egan <seanegan@gmail.com>
parents: 15823
diff changeset
350 {
ed80ec6be33c who knew that --disable-plugins still worked?! Also, some completely untested support for aim:buddyicon, which I'll look at more tomorrow
Sean Egan <seanegan@gmail.com>
parents: 15823
diff changeset
351 const char *src;
15880
80f999140126 Fix a compile warning so that statusbox_got_url() might actually work
Stu Tomlinson <stu@nosnilmot.com>
parents: 15871
diff changeset
352
15824
ed80ec6be33c who knew that --disable-plugins still worked?! Also, some completely untested support for aim:buddyicon, which I'll look at more tomorrow
Sean Egan <seanegan@gmail.com>
parents: 15823
diff changeset
353 if (g_ascii_strcasecmp(proto, "aim"))
ed80ec6be33c who knew that --disable-plugins still worked?! Also, some completely untested support for aim:buddyicon, which I'll look at more tomorrow
Sean Egan <seanegan@gmail.com>
parents: 15823
diff changeset
354 return FALSE;
ed80ec6be33c who knew that --disable-plugins still worked?! Also, some completely untested support for aim:buddyicon, which I'll look at more tomorrow
Sean Egan <seanegan@gmail.com>
parents: 15823
diff changeset
355
ed80ec6be33c who knew that --disable-plugins still worked?! Also, some completely untested support for aim:buddyicon, which I'll look at more tomorrow
Sean Egan <seanegan@gmail.com>
parents: 15823
diff changeset
356 if (g_ascii_strcasecmp(cmd, "buddyicon"))
ed80ec6be33c who knew that --disable-plugins still worked?! Also, some completely untested support for aim:buddyicon, which I'll look at more tomorrow
Sean Egan <seanegan@gmail.com>
parents: 15823
diff changeset
357 return FALSE;
ed80ec6be33c who knew that --disable-plugins still worked?! Also, some completely untested support for aim:buddyicon, which I'll look at more tomorrow
Sean Egan <seanegan@gmail.com>
parents: 15823
diff changeset
358
ed80ec6be33c who knew that --disable-plugins still worked?! Also, some completely untested support for aim:buddyicon, which I'll look at more tomorrow
Sean Egan <seanegan@gmail.com>
parents: 15823
diff changeset
359 src = g_hash_table_lookup(params, "account");
ed80ec6be33c who knew that --disable-plugins still worked?! Also, some completely untested support for aim:buddyicon, which I'll look at more tomorrow
Sean Egan <seanegan@gmail.com>
parents: 15823
diff changeset
360 if (src == NULL)
ed80ec6be33c who knew that --disable-plugins still worked?! Also, some completely untested support for aim:buddyicon, which I'll look at more tomorrow
Sean Egan <seanegan@gmail.com>
parents: 15823
diff changeset
361 return FALSE;
ed80ec6be33c who knew that --disable-plugins still worked?! Also, some completely untested support for aim:buddyicon, which I'll look at more tomorrow
Sean Egan <seanegan@gmail.com>
parents: 15823
diff changeset
362
ed80ec6be33c who knew that --disable-plugins still worked?! Also, some completely untested support for aim:buddyicon, which I'll look at more tomorrow
Sean Egan <seanegan@gmail.com>
parents: 15823
diff changeset
363 purple_util_fetch_url(src, TRUE, NULL, FALSE, statusbox_got_url, data);
ed80ec6be33c who knew that --disable-plugins still worked?! Also, some completely untested support for aim:buddyicon, which I'll look at more tomorrow
Sean Egan <seanegan@gmail.com>
parents: 15823
diff changeset
364 return TRUE;
ed80ec6be33c who knew that --disable-plugins still worked?! Also, some completely untested support for aim:buddyicon, which I'll look at more tomorrow
Sean Egan <seanegan@gmail.com>
parents: 15823
diff changeset
365 }
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
366
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
367 static gboolean
15514
535f002e7b0f More pidgin changes
Sean Egan <seanegan@gmail.com>
parents: 15507
diff changeset
368 icon_box_enter_cb(GtkWidget *widget, GdkEventCrossing *event, PidginStatusBox *box)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
369 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
370 gdk_window_set_cursor(widget->window, box->hand_cursor);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
371 gtk_image_set_from_pixbuf(GTK_IMAGE(box->icon), box->buddy_icon_hover);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
372 return FALSE;
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
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
375 static gboolean
15514
535f002e7b0f More pidgin changes
Sean Egan <seanegan@gmail.com>
parents: 15507
diff changeset
376 icon_box_leave_cb(GtkWidget *widget, GdkEventCrossing *event, PidginStatusBox *box)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
377 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
378 gdk_window_set_cursor(widget->window, box->arrow_cursor);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
379 gtk_image_set_from_pixbuf(GTK_IMAGE(box->icon), box->buddy_icon) ;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
380 return FALSE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
381 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
382
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
383
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
384 static const GtkTargetEntry dnd_targets[] = {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
385 {"text/plain", 0, 0},
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
386 {"text/uri-list", 0, 1},
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
387 {"STRING", 0, 2}
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 static void
15514
535f002e7b0f More pidgin changes
Sean Egan <seanegan@gmail.com>
parents: 15507
diff changeset
391 setup_icon_box(PidginStatusBox *status_box)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
392 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
393 if (status_box->icon_box != NULL)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
394 return;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
395
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
396 status_box->icon = gtk_image_new();
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
397 status_box->icon_box = gtk_event_box_new();
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
398 gtk_widget_set_parent(status_box->icon_box, GTK_WIDGET(status_box));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
399 gtk_widget_show(status_box->icon_box);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
400
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
401 if (status_box->account &&
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
402 !purple_account_get_bool(status_box->account, "use-global-buddyicon", TRUE))
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
403 {
16390
4fc51a87ce42 Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents: 16381
diff changeset
404 PurpleStoredImage *img = purple_buddy_icons_find_account_icon(status_box->account);
4fc51a87ce42 Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents: 16381
diff changeset
405 pidgin_status_box_set_buddy_icon(status_box, img);
4fc51a87ce42 Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents: 16381
diff changeset
406 purple_imgstore_unref(img);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
407 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
408 else
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
409 {
16390
4fc51a87ce42 Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents: 16381
diff changeset
410 const char *filename = purple_prefs_get_path(PIDGIN_PREFS_ROOT "/accounts/buddyicon");
4fc51a87ce42 Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents: 16381
diff changeset
411 PurpleStoredImage *img = NULL;
4fc51a87ce42 Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents: 16381
diff changeset
412
4fc51a87ce42 Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents: 16381
diff changeset
413 if (filename != NULL)
4fc51a87ce42 Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents: 16381
diff changeset
414 {
4fc51a87ce42 Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents: 16381
diff changeset
415 gchar *contents;
4fc51a87ce42 Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents: 16381
diff changeset
416 gsize size;
4fc51a87ce42 Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents: 16381
diff changeset
417 if (g_file_get_contents(filename, &contents, &size, NULL))
4fc51a87ce42 Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents: 16381
diff changeset
418 {
4fc51a87ce42 Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents: 16381
diff changeset
419 img = purple_imgstore_add(contents, size, filename);
4fc51a87ce42 Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents: 16381
diff changeset
420 }
4fc51a87ce42 Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents: 16381
diff changeset
421 }
4fc51a87ce42 Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents: 16381
diff changeset
422
4fc51a87ce42 Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents: 16381
diff changeset
423 pidgin_status_box_set_buddy_icon(status_box, img);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
424 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
425
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
426 status_box->hand_cursor = gdk_cursor_new (GDK_HAND2);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
427 status_box->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
428
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
429 /* Set up DND */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
430 gtk_drag_dest_set(status_box->icon_box,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
431 GTK_DEST_DEFAULT_MOTION |
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
432 GTK_DEST_DEFAULT_DROP,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
433 dnd_targets,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
434 sizeof(dnd_targets) / sizeof(GtkTargetEntry),
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
435 GDK_ACTION_COPY);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
436
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
437 g_signal_connect(G_OBJECT(status_box->icon_box), "drag_data_received", G_CALLBACK(icon_box_dnd_cb), status_box);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
438 g_signal_connect(G_OBJECT(status_box->icon_box), "enter-notify-event", G_CALLBACK(icon_box_enter_cb), status_box);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
439 g_signal_connect(G_OBJECT(status_box->icon_box), "leave-notify-event", G_CALLBACK(icon_box_leave_cb), status_box);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
440 g_signal_connect(G_OBJECT(status_box->icon_box), "button-press-event", G_CALLBACK(icon_box_press_cb), status_box);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
441
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
442 gtk_container_add(GTK_CONTAINER(status_box->icon_box), status_box->icon);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
443 gtk_widget_show(status_box->icon);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
444 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
445
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
446 static void
15514
535f002e7b0f More pidgin changes
Sean Egan <seanegan@gmail.com>
parents: 15507
diff changeset
447 destroy_icon_box(PidginStatusBox *statusbox)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
448 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
449 if (statusbox->icon_box == NULL)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
450 return;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
451
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
452 gtk_widget_destroy(statusbox->icon_box);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
453 gdk_cursor_unref(statusbox->hand_cursor);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
454 gdk_cursor_unref(statusbox->arrow_cursor);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
455
16390
4fc51a87ce42 Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents: 16381
diff changeset
456 purple_imgstore_unref(statusbox->buddy_icon_img);
4fc51a87ce42 Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents: 16381
diff changeset
457
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
458 g_object_unref(G_OBJECT(statusbox->buddy_icon));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
459 g_object_unref(G_OBJECT(statusbox->buddy_icon_hover));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
460
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
461 if (statusbox->buddy_icon_sel)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
462 gtk_widget_destroy(statusbox->buddy_icon_sel);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
463
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
464 if (statusbox->icon_box_menu)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
465 gtk_widget_destroy(statusbox->icon_box_menu);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
466
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
467 statusbox->icon = NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
468 statusbox->icon_box = NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
469 statusbox->icon_box_menu = NULL;
16390
4fc51a87ce42 Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents: 16381
diff changeset
470 statusbox->buddy_icon_img = NULL;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
471 statusbox->buddy_icon = NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
472 statusbox->buddy_icon_hover = NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
473 statusbox->hand_cursor = NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
474 statusbox->arrow_cursor = NULL;
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
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
477 static void
15514
535f002e7b0f More pidgin changes
Sean Egan <seanegan@gmail.com>
parents: 15507
diff changeset
478 pidgin_status_box_set_property(GObject *object, guint param_id,
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
479 const GValue *value, GParamSpec *pspec)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
480 {
15514
535f002e7b0f More pidgin changes
Sean Egan <seanegan@gmail.com>
parents: 15507
diff changeset
481 PidginStatusBox *statusbox = PIDGIN_STATUS_BOX(object);
15374
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 switch (param_id) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
484 case PROP_ICON_SEL:
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
485 if (g_value_get_boolean(value)) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
486 if (statusbox->account) {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
487 PurplePlugin *plug = purple_plugins_find_with_id(purple_account_get_protocol_id(statusbox->account));
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
488 if (plug) {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
489 PurplePluginProtocolInfo *prplinfo = PURPLE_PLUGIN_PROTOCOL_INFO(plug);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
490 if (prplinfo && prplinfo->icon_spec.format != NULL)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
491 setup_icon_box(statusbox);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
492 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
493 } else {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
494 setup_icon_box(statusbox);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
495 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
496 } else {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
497 destroy_icon_box(statusbox);
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 break;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
500 case PROP_ACCOUNT:
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
501 statusbox->account = g_value_get_pointer(value);
22676
a73acc0c4dc8 Ignore token_status_account on account-specific status boxes. This should
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 22470
diff changeset
502 if (statusbox->account)
a73acc0c4dc8 Ignore token_status_account on account-specific status boxes. This should
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 22470
diff changeset
503 statusbox->token_status_account = NULL;
a73acc0c4dc8 Ignore token_status_account on account-specific status boxes. This should
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 22470
diff changeset
504 else
a73acc0c4dc8 Ignore token_status_account on account-specific status boxes. This should
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 22470
diff changeset
505 statusbox->token_status_account = check_active_accounts_for_identical_statuses();
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
506
15514
535f002e7b0f More pidgin changes
Sean Egan <seanegan@gmail.com>
parents: 15507
diff changeset
507 pidgin_status_box_regenerate(statusbox);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
508
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
509 break;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
510 default:
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
511 G_OBJECT_WARN_INVALID_PROPERTY_ID(object, param_id, pspec);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
512 break;
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
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
516 static void
15514
535f002e7b0f More pidgin changes
Sean Egan <seanegan@gmail.com>
parents: 15507
diff changeset
517 pidgin_status_box_finalize(GObject *obj)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
518 {
15514
535f002e7b0f More pidgin changes
Sean Egan <seanegan@gmail.com>
parents: 15507
diff changeset
519 PidginStatusBox *statusbox = PIDGIN_STATUS_BOX(obj);
22183
69ad31c9983d Fix some small leaks when destroying a statusbox.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 22102
diff changeset
520 int i;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
521
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
522 purple_signals_disconnect_by_handle(statusbox);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
523 purple_prefs_disconnect_by_handle(statusbox);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
524
22088
51d6ae399919 Destroy the icon box only when there's one. This gets rid of a runtime warning for statusboxes without a buddy-icon selector (e.g., for an IRC account).
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 22087
diff changeset
525 destroy_icon_box(statusbox);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
526
22183
69ad31c9983d Fix some small leaks when destroying a statusbox.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 22102
diff changeset
527 if (statusbox->active_row)
69ad31c9983d Fix some small leaks when destroying a statusbox.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 22102
diff changeset
528 gtk_tree_row_reference_free(statusbox->active_row);
69ad31c9983d Fix some small leaks when destroying a statusbox.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 22102
diff changeset
529
69ad31c9983d Fix some small leaks when destroying a statusbox.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 22102
diff changeset
530 for (i = 0; i < G_N_ELEMENTS(statusbox->connecting_pixbufs); i++) {
69ad31c9983d Fix some small leaks when destroying a statusbox.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 22102
diff changeset
531 if (statusbox->connecting_pixbufs[i] != NULL)
69ad31c9983d Fix some small leaks when destroying a statusbox.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 22102
diff changeset
532 gdk_pixbuf_unref(statusbox->connecting_pixbufs[i]);
69ad31c9983d Fix some small leaks when destroying a statusbox.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 22102
diff changeset
533 }
69ad31c9983d Fix some small leaks when destroying a statusbox.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 22102
diff changeset
534
69ad31c9983d Fix some small leaks when destroying a statusbox.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 22102
diff changeset
535 for (i = 0; i < G_N_ELEMENTS(statusbox->typing_pixbufs); i++) {
69ad31c9983d Fix some small leaks when destroying a statusbox.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 22102
diff changeset
536 if (statusbox->typing_pixbufs[i] != NULL)
69ad31c9983d Fix some small leaks when destroying a statusbox.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 22102
diff changeset
537 gdk_pixbuf_unref(statusbox->typing_pixbufs[i]);
69ad31c9983d Fix some small leaks when destroying a statusbox.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 22102
diff changeset
538 }
69ad31c9983d Fix some small leaks when destroying a statusbox.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 22102
diff changeset
539
22087
d943df776c09 It turns out the tree-models need to be unref'ed.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 22007
diff changeset
540 g_object_unref(G_OBJECT(statusbox->store));
d943df776c09 It turns out the tree-models need to be unref'ed.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 22007
diff changeset
541 g_object_unref(G_OBJECT(statusbox->dropdown_store));
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
542 G_OBJECT_CLASS(parent_class)->finalize(obj);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
543 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
544
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
545 static GType
15514
535f002e7b0f More pidgin changes
Sean Egan <seanegan@gmail.com>
parents: 15507
diff changeset
546 pidgin_status_box_child_type (GtkContainer *container)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
547 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
548 return GTK_TYPE_WIDGET;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
549 }
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 static void
15514
535f002e7b0f More pidgin changes
Sean Egan <seanegan@gmail.com>
parents: 15507
diff changeset
552 pidgin_status_box_class_init (PidginStatusBoxClass *klass)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
553 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
554 GObjectClass *object_class;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
555 GtkWidgetClass *widget_class;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
556 GtkContainerClass *container_class = (GtkContainerClass*)klass;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
557
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
558 parent_class = g_type_class_peek_parent(klass);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
559
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
560 widget_class = (GtkWidgetClass*)klass;
15514
535f002e7b0f More pidgin changes
Sean Egan <seanegan@gmail.com>
parents: 15507
diff changeset
561 widget_class->size_request = pidgin_status_box_size_request;
535f002e7b0f More pidgin changes
Sean Egan <seanegan@gmail.com>
parents: 15507
diff changeset
562 widget_class->size_allocate = pidgin_status_box_size_allocate;
535f002e7b0f More pidgin changes
Sean Egan <seanegan@gmail.com>
parents: 15507
diff changeset
563 widget_class->expose_event = pidgin_status_box_expose_event;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
564
15514
535f002e7b0f More pidgin changes
Sean Egan <seanegan@gmail.com>
parents: 15507
diff changeset
565 container_class->child_type = pidgin_status_box_child_type;
535f002e7b0f More pidgin changes
Sean Egan <seanegan@gmail.com>
parents: 15507
diff changeset
566 container_class->forall = pidgin_status_box_forall;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
567 container_class->remove = NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
568
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
569 object_class = (GObjectClass *)klass;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
570
15514
535f002e7b0f More pidgin changes
Sean Egan <seanegan@gmail.com>
parents: 15507
diff changeset
571 object_class->finalize = pidgin_status_box_finalize;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
572
15514
535f002e7b0f More pidgin changes
Sean Egan <seanegan@gmail.com>
parents: 15507
diff changeset
573 object_class->get_property = pidgin_status_box_get_property;
535f002e7b0f More pidgin changes
Sean Egan <seanegan@gmail.com>
parents: 15507
diff changeset
574 object_class->set_property = pidgin_status_box_set_property;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
575
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
576 g_object_class_install_property(object_class,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
577 PROP_ACCOUNT,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
578 g_param_spec_pointer("account",
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
579 "Account",
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
580 "The account, or NULL for all accounts",
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
581 G_PARAM_READWRITE
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
582 )
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
583 );
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
584 g_object_class_install_property(object_class,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
585 PROP_ICON_SEL,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
586 g_param_spec_boolean("iconsel",
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
587 "Icon Selector",
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
588 "Whether the icon selector should be displayed or not.",
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
589 FALSE,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
590 G_PARAM_READWRITE
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
591 )
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
592 );
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
593 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
594
16255
4e01fc165b28 use the invisible icon
Richard Nelson <wabz@pidgin.im>
parents: 16235
diff changeset
595 static GdkPixbuf *
4e01fc165b28 use the invisible icon
Richard Nelson <wabz@pidgin.im>
parents: 16235
diff changeset
596 pidgin_status_box_get_pixbuf(PidginStatusBox *status_box, PurpleStatusPrimitive prim)
4e01fc165b28 use the invisible icon
Richard Nelson <wabz@pidgin.im>
parents: 16235
diff changeset
597 {
4e01fc165b28 use the invisible icon
Richard Nelson <wabz@pidgin.im>
parents: 16235
diff changeset
598 GdkPixbuf *pixbuf;
4e01fc165b28 use the invisible icon
Richard Nelson <wabz@pidgin.im>
parents: 16235
diff changeset
599 GtkIconSize icon_size = gtk_icon_size_from_name(PIDGIN_ICON_SIZE_TANGO_EXTRA_SMALL);
4e01fc165b28 use the invisible icon
Richard Nelson <wabz@pidgin.im>
parents: 16235
diff changeset
600 if (prim == PURPLE_STATUS_UNAVAILABLE)
4e01fc165b28 use the invisible icon
Richard Nelson <wabz@pidgin.im>
parents: 16235
diff changeset
601 pixbuf = gtk_widget_render_icon (GTK_WIDGET(status_box), PIDGIN_STOCK_STATUS_BUSY,
4e01fc165b28 use the invisible icon
Richard Nelson <wabz@pidgin.im>
parents: 16235
diff changeset
602 icon_size, "PidginStatusBox");
4e01fc165b28 use the invisible icon
Richard Nelson <wabz@pidgin.im>
parents: 16235
diff changeset
603 else if (prim == PURPLE_STATUS_AWAY)
4e01fc165b28 use the invisible icon
Richard Nelson <wabz@pidgin.im>
parents: 16235
diff changeset
604 pixbuf = gtk_widget_render_icon (GTK_WIDGET(status_box), PIDGIN_STOCK_STATUS_AWAY,
4e01fc165b28 use the invisible icon
Richard Nelson <wabz@pidgin.im>
parents: 16235
diff changeset
605 icon_size, "PidginStatusBox");
4e01fc165b28 use the invisible icon
Richard Nelson <wabz@pidgin.im>
parents: 16235
diff changeset
606 else if (prim == PURPLE_STATUS_EXTENDED_AWAY)
4e01fc165b28 use the invisible icon
Richard Nelson <wabz@pidgin.im>
parents: 16235
diff changeset
607 pixbuf = gtk_widget_render_icon (GTK_WIDGET(status_box), PIDGIN_STOCK_STATUS_XA,
4e01fc165b28 use the invisible icon
Richard Nelson <wabz@pidgin.im>
parents: 16235
diff changeset
608 icon_size, "PidginStatusBox");
4e01fc165b28 use the invisible icon
Richard Nelson <wabz@pidgin.im>
parents: 16235
diff changeset
609 else if (prim == PURPLE_STATUS_INVISIBLE)
4e01fc165b28 use the invisible icon
Richard Nelson <wabz@pidgin.im>
parents: 16235
diff changeset
610 pixbuf = gtk_widget_render_icon (GTK_WIDGET(status_box), PIDGIN_STOCK_STATUS_INVISIBLE,
4e01fc165b28 use the invisible icon
Richard Nelson <wabz@pidgin.im>
parents: 16235
diff changeset
611 icon_size, "PidginStatusBox");
4e01fc165b28 use the invisible icon
Richard Nelson <wabz@pidgin.im>
parents: 16235
diff changeset
612 else if (prim == PURPLE_STATUS_OFFLINE)
4e01fc165b28 use the invisible icon
Richard Nelson <wabz@pidgin.im>
parents: 16235
diff changeset
613 pixbuf = gtk_widget_render_icon (GTK_WIDGET(status_box), PIDGIN_STOCK_STATUS_OFFLINE,
4e01fc165b28 use the invisible icon
Richard Nelson <wabz@pidgin.im>
parents: 16235
diff changeset
614 icon_size, "PidginStatusBox");
4e01fc165b28 use the invisible icon
Richard Nelson <wabz@pidgin.im>
parents: 16235
diff changeset
615 else
4e01fc165b28 use the invisible icon
Richard Nelson <wabz@pidgin.im>
parents: 16235
diff changeset
616 pixbuf = gtk_widget_render_icon (GTK_WIDGET(status_box), PIDGIN_STOCK_STATUS_AVAILABLE,
4e01fc165b28 use the invisible icon
Richard Nelson <wabz@pidgin.im>
parents: 16235
diff changeset
617 icon_size, "PidginStatusBox");
4e01fc165b28 use the invisible icon
Richard Nelson <wabz@pidgin.im>
parents: 16235
diff changeset
618 return pixbuf;
4e01fc165b28 use the invisible icon
Richard Nelson <wabz@pidgin.im>
parents: 16235
diff changeset
619 }
4e01fc165b28 use the invisible icon
Richard Nelson <wabz@pidgin.im>
parents: 16235
diff changeset
620
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
621 /**
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
622 * This updates the text displayed on the status box so that it shows
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
623 * the current status. This is the only function in this file that
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
624 * should modify status_box->store
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
625 */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
626 static void
15514
535f002e7b0f More pidgin changes
Sean Egan <seanegan@gmail.com>
parents: 15507
diff changeset
627 pidgin_status_box_refresh(PidginStatusBox *status_box)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
628 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
629 GtkIconSize icon_size;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
630 GtkStyle *style;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
631 char aa_color[8];
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
632 PurpleSavedStatus *saved_status;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
633 char *primary, *secondary, *text;
21959
d3a4c98c01b7 Show the prpl icon in the account-specific statusboxes to avoid ambiguity.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 21913
diff changeset
634 GdkPixbuf *pixbuf, *emblem = NULL;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
635 GtkTreePath *path;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
636 gboolean account_status = FALSE;
22676
a73acc0c4dc8 Ignore token_status_account on account-specific status boxes. This should
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 22470
diff changeset
637 PurpleAccount *acct = (status_box->account) ? status_box->account : status_box->token_status_account;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
638
15436
9c0cf4db1f4d Dialog icon changes
Sean Egan <seanegan@gmail.com>
parents: 15413
diff changeset
639 icon_size = gtk_icon_size_from_name(PIDGIN_ICON_SIZE_TANGO_EXTRA_SMALL);
15938
d04878ce947b Some pixmap path fixes and win32 fixes
Daniel Atallah <daniel.atallah@gmail.com>
parents: 15880
diff changeset
640
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
641 style = gtk_widget_get_style(GTK_WIDGET(status_box));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
642 snprintf(aa_color, sizeof(aa_color), "#%02x%02x%02x",
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
643 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
644 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
645 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
646
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
647 saved_status = purple_savedstatus_get_current();
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
648
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
649 if (status_box->account || (status_box->token_status_account
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
650 && purple_savedstatus_is_transient(saved_status)))
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
651 account_status = TRUE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
652
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
653 /* Primary */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
654 if (status_box->typing != 0)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
655 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
656 GtkTreeIter iter;
15514
535f002e7b0f More pidgin changes
Sean Egan <seanegan@gmail.com>
parents: 15507
diff changeset
657 PidginStatusBoxItemType type;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
658 gpointer data;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
659
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
660 /* Primary (get the status selected in the dropdown) */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
661 path = gtk_tree_row_reference_get_path(status_box->active_row);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
662 if (!gtk_tree_model_get_iter (GTK_TREE_MODEL(status_box->dropdown_store), &iter, path))
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
663 return;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
664 gtk_tree_path_free(path);
15938
d04878ce947b Some pixmap path fixes and win32 fixes
Daniel Atallah <daniel.atallah@gmail.com>
parents: 15880
diff changeset
665
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
666 gtk_tree_model_get(GTK_TREE_MODEL(status_box->dropdown_store), &iter,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
667 TYPE_COLUMN, &type,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
668 DATA_COLUMN, &data,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
669 -1);
15514
535f002e7b0f More pidgin changes
Sean Egan <seanegan@gmail.com>
parents: 15507
diff changeset
670 if (type == PIDGIN_STATUS_BOX_TYPE_PRIMITIVE)
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
671 primary = g_strdup(purple_primitive_get_name_from_type(GPOINTER_TO_INT(data)));
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
672 else
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
673 /* This should never happen, but just in case... */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
674 primary = g_strdup("New status");
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
675 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
676 else if (account_status)
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
677 primary = g_strdup(purple_status_get_name(purple_account_get_active_status(acct)));
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
678 else if (purple_savedstatus_is_transient(saved_status))
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
679 primary = g_strdup(purple_primitive_get_name_from_type(purple_savedstatus_get_type(saved_status)));
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
680 else
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
681 primary = g_markup_escape_text(purple_savedstatus_get_title(saved_status), -1);
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 /* Secondary */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
684 if (status_box->typing != 0)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
685 secondary = g_strdup(_("Typing"));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
686 else if (status_box->connecting)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
687 secondary = g_strdup(_("Connecting"));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
688 else if (!status_box->network_available)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
689 secondary = g_strdup(_("Waiting for network connection"));
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
690 else if (purple_savedstatus_is_transient(saved_status))
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
691 secondary = NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
692 else
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
693 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
694 const char *message;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
695 char *tmp;
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
696 message = purple_savedstatus_get_message(saved_status);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
697 if (message != NULL)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
698 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
699 tmp = purple_markup_strip_html(message);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
700 purple_util_chrreplace(tmp, '\n', ' ');
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
701 secondary = g_markup_escape_text(tmp, -1);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
702 g_free(tmp);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
703 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
704 else
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
705 secondary = NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
706 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
707
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
708 /* Pixbuf */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
709 if (status_box->typing != 0)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
710 pixbuf = status_box->typing_pixbufs[status_box->typing_index];
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
711 else if (status_box->connecting)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
712 pixbuf = status_box->connecting_pixbufs[status_box->connecting_index];
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
713 else
15413
e6b40365930c More statusbox tweaks:
Sean Egan <seanegan@gmail.com>
parents: 15401
diff changeset
714 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
715 PurpleStatusType *status_type;
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
716 PurpleStatusPrimitive prim;
15413
e6b40365930c More statusbox tweaks:
Sean Egan <seanegan@gmail.com>
parents: 15401
diff changeset
717 if (account_status) {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
718 status_type = purple_status_get_type(purple_account_get_active_status(acct));
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
719 prim = purple_status_type_get_primitive(status_type);
15413
e6b40365930c More statusbox tweaks:
Sean Egan <seanegan@gmail.com>
parents: 15401
diff changeset
720 } else {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
721 prim = purple_savedstatus_get_type(saved_status);
15413
e6b40365930c More statusbox tweaks:
Sean Egan <seanegan@gmail.com>
parents: 15401
diff changeset
722 }
e6b40365930c More statusbox tweaks:
Sean Egan <seanegan@gmail.com>
parents: 15401
diff changeset
723
16255
4e01fc165b28 use the invisible icon
Richard Nelson <wabz@pidgin.im>
parents: 16235
diff changeset
724 pixbuf = pidgin_status_box_get_pixbuf(status_box, prim);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
725 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
726
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
727 if (status_box->account != NULL) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
728 text = g_strdup_printf("%s - <span size=\"smaller\" color=\"%s\">%s</span>",
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
729 purple_account_get_username(status_box->account),
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
730 aa_color, secondary ? secondary : primary);
21959
d3a4c98c01b7 Show the prpl icon in the account-specific statusboxes to avoid ambiguity.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 21913
diff changeset
731 emblem = pidgin_create_prpl_icon(status_box->account, PIDGIN_PRPL_ICON_SMALL);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
732 } else if (secondary != NULL) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
733 text = g_strdup_printf("%s<span size=\"smaller\" color=\"%s\"> - %s</span>",
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
734 primary, aa_color, secondary);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
735 } else {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
736 text = g_strdup(primary);
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 g_free(primary);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
739 g_free(secondary);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
740
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
741 /*
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
742 * Only two columns are used in this list store (does it
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
743 * really need to be a list store?)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
744 */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
745 gtk_list_store_set(status_box->store, &(status_box->iter),
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
746 ICON_COLUMN, pixbuf,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
747 TEXT_COLUMN, text,
21959
d3a4c98c01b7 Show the prpl icon in the account-specific statusboxes to avoid ambiguity.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 21913
diff changeset
748 EMBLEM_COLUMN, emblem,
d3a4c98c01b7 Show the prpl icon in the account-specific statusboxes to avoid ambiguity.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 21913
diff changeset
749 EMBLEM_VISIBLE_COLUMN, (emblem != NULL),
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
750 -1);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
751 if ((status_box->typing == 0) && (!status_box->connecting))
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
752 g_object_unref(pixbuf);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
753 g_free(text);
21959
d3a4c98c01b7 Show the prpl icon in the account-specific statusboxes to avoid ambiguity.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 21913
diff changeset
754 if (emblem)
d3a4c98c01b7 Show the prpl icon in the account-specific statusboxes to avoid ambiguity.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 21913
diff changeset
755 g_object_unref(emblem);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
756
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
757 /* Make sure to activate the only row in the tree view */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
758 path = gtk_tree_path_new_from_string("0");
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
759 gtk_cell_view_set_displayed_row(GTK_CELL_VIEW(status_box->cell_view), path);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
760 gtk_tree_path_free(path);
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 update_size(status_box);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
763 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
764
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
765 static PurpleStatusType *
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
766 find_status_type_by_index(const PurpleAccount *account, gint active)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
767 {
18118
ab6d2763b8d8 Re-fix the DBus list handling code by killing const GList* / const GSList*
Richard Laager <rlaager@wiktel.com>
parents: 18063
diff changeset
768 GList *l = purple_account_get_status_types(account);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
769 gint i;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
770
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
771 for (i = 0; l; l = l->next) {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
772 PurpleStatusType *status_type = l->data;
23273
74f1a07f452b Don't include 'Listening to music' in the per-account statusbox.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 23264
diff changeset
773 if (!purple_status_type_is_user_settable(status_type) ||
74f1a07f452b Don't include 'Listening to music' in the per-account statusbox.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 23264
diff changeset
774 purple_status_type_is_independent(status_type))
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
775 continue;
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 if (active == i)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
778 return status_type;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
779 i++;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
780 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
781
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
782 return NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
783 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
784
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 * This updates the GtkTreeView so that it correctly shows the state
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
787 * we are currently using. It is used when the current state is
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
788 * updated from somewhere other than the GtkStatusBox (from a plugin,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
789 * or when signing on with the "-n" option, for example). It is
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
790 * also used when the user selects the "New..." option.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
791 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
792 * Maybe we could accomplish this by triggering off the mouse and
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
793 * keyboard signals instead of the changed signal?
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
794 */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
795 static void
15514
535f002e7b0f More pidgin changes
Sean Egan <seanegan@gmail.com>
parents: 15507
diff changeset
796 status_menu_refresh_iter(PidginStatusBox *status_box)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
797 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
798 PurpleSavedStatus *saved_status;
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
799 PurpleStatusPrimitive primitive;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
800 gint index;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
801 const char *message;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
802 GtkTreePath *path = NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
803
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
804 /* this function is inappropriate for ones with accounts */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
805 if (status_box->account)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
806 return;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
807
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
808 saved_status = purple_savedstatus_get_current();
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
809
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 * Suppress the "changed" signal because the status
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
812 * was changed programmatically.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
813 */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
814 gtk_widget_set_sensitive(GTK_WIDGET(status_box), FALSE);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
815
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
816 /*
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
817 * If there is a token-account, then select the primitive from the
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
818 * dropdown using a loop. Otherwise select from the default list.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
819 */
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
820 primitive = purple_savedstatus_get_type(saved_status);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
821 if (!status_box->token_status_account && purple_savedstatus_is_transient(saved_status) &&
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
822 ((primitive == PURPLE_STATUS_AVAILABLE) || (primitive == PURPLE_STATUS_AWAY) ||
19333
5e39506a0e3b Select the correct item in the dropdown when using a transient status.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18704
diff changeset
823 (primitive == PURPLE_STATUS_INVISIBLE) || (primitive == PURPLE_STATUS_OFFLINE) ||
5e39506a0e3b Select the correct item in the dropdown when using a transient status.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18704
diff changeset
824 (primitive == PURPLE_STATUS_UNAVAILABLE)) &&
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
825 (!purple_savedstatus_has_substatuses(saved_status)))
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
826 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
827 index = get_statusbox_index(status_box, saved_status);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
828 path = gtk_tree_path_new_from_indices(index, -1);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
829 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
830 else
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
831 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
832 GtkTreeIter iter;
15514
535f002e7b0f More pidgin changes
Sean Egan <seanegan@gmail.com>
parents: 15507
diff changeset
833 PidginStatusBoxItemType type;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
834 gpointer data;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
835
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
836 /* If this saved status is in the list store, then set it as the active item */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
837 if (gtk_tree_model_get_iter_first(GTK_TREE_MODEL(status_box->dropdown_store), &iter))
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
838 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
839 do
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 gtk_tree_model_get(GTK_TREE_MODEL(status_box->dropdown_store), &iter,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
842 TYPE_COLUMN, &type,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
843 DATA_COLUMN, &data,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
844 -1);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
845
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
846 /* This is a special case because Primitives for the token_status_account are actually
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
847 * saved statuses with substatuses for the enabled accounts */
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
848 if (status_box->token_status_account && purple_savedstatus_is_transient(saved_status)
15514
535f002e7b0f More pidgin changes
Sean Egan <seanegan@gmail.com>
parents: 15507
diff changeset
849 && type == PIDGIN_STATUS_BOX_TYPE_PRIMITIVE && primitive == GPOINTER_TO_INT(data))
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
850 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
851 char *name;
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
852 const char *acct_status_name = purple_status_get_name(
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
853 purple_account_get_active_status(status_box->token_status_account));
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
854
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
855 gtk_tree_model_get(GTK_TREE_MODEL(status_box->dropdown_store), &iter,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
856 TEXT_COLUMN, &name, -1);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
857
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
858 if (!purple_savedstatus_has_substatuses(saved_status)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
859 || !strcmp(name, acct_status_name))
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
860 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
861 /* Found! */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
862 path = gtk_tree_model_get_path(GTK_TREE_MODEL(status_box->dropdown_store), &iter);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
863 g_free(name);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
864 break;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
865 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
866 g_free(name);
15938
d04878ce947b Some pixmap path fixes and win32 fixes
Daniel Atallah <daniel.atallah@gmail.com>
parents: 15880
diff changeset
867
15514
535f002e7b0f More pidgin changes
Sean Egan <seanegan@gmail.com>
parents: 15507
diff changeset
868 } else if ((type == PIDGIN_STATUS_BOX_TYPE_POPULAR) &&
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
869 (GPOINTER_TO_INT(data) == purple_savedstatus_get_creation_time(saved_status)))
15374
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 /* Found! */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
872 path = gtk_tree_model_get_path(GTK_TREE_MODEL(status_box->dropdown_store), &iter);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
873 break;
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 } while (gtk_tree_model_iter_next(GTK_TREE_MODEL(status_box->dropdown_store), &iter));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
876 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
877 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
878
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
879 if (status_box->active_row)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
880 gtk_tree_row_reference_free(status_box->active_row);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
881 if (path) { /* path should never be NULL */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
882 status_box->active_row = gtk_tree_row_reference_new(GTK_TREE_MODEL(status_box->dropdown_store), path);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
883 gtk_tree_path_free(path);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
884 } else
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
885 status_box->active_row = NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
886
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
887 message = purple_savedstatus_get_message(saved_status);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
888 if (!purple_savedstatus_is_transient(saved_status) || !message || !*message)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
889 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
890 status_box->imhtml_visible = FALSE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
891 gtk_widget_hide_all(status_box->vbox);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
892 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
893 else
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 status_box->imhtml_visible = TRUE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
896 gtk_widget_show_all(status_box->vbox);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
897
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 * Suppress the "changed" signal because the status
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
900 * was changed programmatically.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
901 */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
902 gtk_widget_set_sensitive(GTK_WIDGET(status_box->imhtml), FALSE);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
903
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
904 gtk_imhtml_clear(GTK_IMHTML(status_box->imhtml));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
905 gtk_imhtml_clear_formatting(GTK_IMHTML(status_box->imhtml));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
906 gtk_imhtml_append_text(GTK_IMHTML(status_box->imhtml), message, 0);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
907 gtk_widget_set_sensitive(GTK_WIDGET(status_box->imhtml), TRUE);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
908 }
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 update_size(status_box);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
911
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
912 /* Stop suppressing the "changed" signal. */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
913 gtk_widget_set_sensitive(GTK_WIDGET(status_box), TRUE);
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
15514
535f002e7b0f More pidgin changes
Sean Egan <seanegan@gmail.com>
parents: 15507
diff changeset
917 add_popular_statuses(PidginStatusBox *statusbox)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
918 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
919 GList *list, *cur;
15593
0a5823d45398 Fix a few small compile warnings:
Mark Doliner <mark@kingant.net>
parents: 15514
diff changeset
920 GdkPixbuf *pixbuf;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
921
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
922 list = purple_savedstatuses_get_popular(6);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
923 if (list == NULL)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
924 /* Odd... oh well, nothing we can do about it. */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
925 return;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
926
15514
535f002e7b0f More pidgin changes
Sean Egan <seanegan@gmail.com>
parents: 15507
diff changeset
927 pidgin_status_box_add_separator(statusbox);
15374
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 for (cur = list; cur != NULL; cur = cur->next)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
930 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
931 PurpleSavedStatus *saved = cur->data;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
932 const gchar *message;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
933 gchar *stripped = NULL;
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
934 PurpleStatusPrimitive prim;
16426
0fb719b5dc0e fixes #280
Sean Egan <seanegan@gmail.com>
parents: 16346
diff changeset
935 PidginStatusBoxItemType type = PIDGIN_STATUS_BOX_TYPE_POPULAR;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
936
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
937 /* Get an appropriate status icon */
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
938 prim = purple_savedstatus_get_type(saved);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
939
16255
4e01fc165b28 use the invisible icon
Richard Nelson <wabz@pidgin.im>
parents: 16235
diff changeset
940
4e01fc165b28 use the invisible icon
Richard Nelson <wabz@pidgin.im>
parents: 16235
diff changeset
941 pixbuf = pidgin_status_box_get_pixbuf(statusbox, prim);
15593
0a5823d45398 Fix a few small compile warnings:
Mark Doliner <mark@kingant.net>
parents: 15514
diff changeset
942
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
943 if (purple_savedstatus_is_transient(saved))
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
944 {
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 * Transient statuses do not have a title, so the savedstatus
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
947 * API returns the message when purple_savedstatus_get_title() is
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
948 * called, so we don't need to get the message a second time.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
949 */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
950 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
951 else
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
952 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
953 message = purple_savedstatus_get_message(saved);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
954 if (message != NULL)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
955 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
956 stripped = purple_markup_strip_html(message);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
957 purple_util_chrreplace(stripped, '\n', ' ');
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
958 }
16296
78f798d99d3a Saved icon for saved statuses in statusbox
Sean Egan <seanegan@gmail.com>
parents: 16270
diff changeset
959 type = PIDGIN_STATUS_BOX_TYPE_SAVED_POPULAR;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
960 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
961
16296
78f798d99d3a Saved icon for saved statuses in statusbox
Sean Egan <seanegan@gmail.com>
parents: 16270
diff changeset
962 pidgin_status_box_add(statusbox, type,
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
963 pixbuf, purple_savedstatus_get_title(saved), stripped,
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
964 GINT_TO_POINTER(purple_savedstatus_get_creation_time(saved)));
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
965 g_free(stripped);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
966 if (pixbuf != NULL)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
967 g_object_unref(G_OBJECT(pixbuf));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
968 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
969
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
970 g_list_free(list);
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
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
973 /* This returns NULL if the active accounts don't have identical
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
974 * statuses and a token account if they do */
22007
c38d72677c8a Probe for -Wstrict-prototypes to get some more warnings. I then cleaned up
Richard Laager <rlaager@wiktel.com>
parents: 21959
diff changeset
975 static PurpleAccount* check_active_accounts_for_identical_statuses(void)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
976 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
977 PurpleAccount *acct = NULL, *acct2;
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
978 GList *tmp, *tmp2, *active_accts = purple_accounts_get_all_active();
18118
ab6d2763b8d8 Re-fix the DBus list handling code by killing const GList* / const GSList*
Richard Laager <rlaager@wiktel.com>
parents: 18063
diff changeset
979 GList *s, *s1, *s2;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
980
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
981 for (tmp = active_accts; tmp; tmp = tmp->next) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
982 acct = tmp->data;
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
983 s = purple_account_get_status_types(acct);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
984 for (tmp2 = tmp->next; tmp2; tmp2 = tmp2->next) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
985 acct2 = tmp2->data;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
986
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
987 /* Only actually look at the statuses if the accounts use the same prpl */
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
988 if (strcmp(purple_account_get_protocol_id(acct), purple_account_get_protocol_id(acct2))) {
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
989 acct = NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
990 break;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
991 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
992
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
993 s2 = purple_account_get_status_types(acct2);
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 s1 = s;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
996 while (s1 && s2) {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
997 PurpleStatusType *st1 = s1->data, *st2 = s2->data;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
998 /* TODO: Are these enough to consider the statuses identical? */
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
999 if (purple_status_type_get_primitive(st1) != purple_status_type_get_primitive(st2)
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1000 || strcmp(purple_status_type_get_id(st1), purple_status_type_get_id(st2))
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1001 || strcmp(purple_status_type_get_name(st1), purple_status_type_get_name(st2))) {
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1002 acct = NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1003 break;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1004 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1005
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1006 s1 = s1->next;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1007 s2 = s2->next;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1008 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1009
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1010 if (s1 != s2) {/* Will both be NULL if matched */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1011 acct = NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1012 break;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1013 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1014 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1015 if (!acct)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1016 break;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1017 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1018 g_list_free(active_accts);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1019
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1020 return acct;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1021 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1022
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1023 static void
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1024 add_account_statuses(PidginStatusBox *status_box, PurpleAccount *account)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1025 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1026 /* Per-account */
18118
ab6d2763b8d8 Re-fix the DBus list handling code by killing const GList* / const GSList*
Richard Laager <rlaager@wiktel.com>
parents: 18063
diff changeset
1027 GList *l;
15413
e6b40365930c More statusbox tweaks:
Sean Egan <seanegan@gmail.com>
parents: 15401
diff changeset
1028 GdkPixbuf *pixbuf;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1029
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1030 for (l = purple_account_get_status_types(account); l != NULL; l = l->next)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1031 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1032 PurpleStatusType *status_type = (PurpleStatusType *)l->data;
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1033 PurpleStatusPrimitive prim;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1034
23273
74f1a07f452b Don't include 'Listening to music' in the per-account statusbox.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 23264
diff changeset
1035 if (!purple_status_type_is_user_settable(status_type) ||
74f1a07f452b Don't include 'Listening to music' in the per-account statusbox.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 23264
diff changeset
1036 purple_status_type_is_independent(status_type))
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1037 continue;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1038
23273
74f1a07f452b Don't include 'Listening to music' in the per-account statusbox.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 23264
diff changeset
1039 prim = purple_status_type_get_primitive(status_type);
74f1a07f452b Don't include 'Listening to music' in the per-account statusbox.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 23264
diff changeset
1040
74f1a07f452b Don't include 'Listening to music' in the per-account statusbox.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 23264
diff changeset
1041 pixbuf = pidgin_status_box_get_pixbuf(status_box, prim);
15413
e6b40365930c More statusbox tweaks:
Sean Egan <seanegan@gmail.com>
parents: 15401
diff changeset
1042
15514
535f002e7b0f More pidgin changes
Sean Egan <seanegan@gmail.com>
parents: 15507
diff changeset
1043 pidgin_status_box_add(PIDGIN_STATUS_BOX(status_box),
535f002e7b0f More pidgin changes
Sean Egan <seanegan@gmail.com>
parents: 15507
diff changeset
1044 PIDGIN_STATUS_BOX_TYPE_PRIMITIVE, pixbuf,
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1045 purple_status_type_get_name(status_type),
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1046 NULL,
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1047 GINT_TO_POINTER(purple_status_type_get_primitive(status_type)));
15413
e6b40365930c More statusbox tweaks:
Sean Egan <seanegan@gmail.com>
parents: 15401
diff changeset
1048 if (pixbuf != NULL)
e6b40365930c More statusbox tweaks:
Sean Egan <seanegan@gmail.com>
parents: 15401
diff changeset
1049 g_object_unref(pixbuf);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1050 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1051 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1052
18704
c77cf4e8eb65 disapproval of revision '947b20b6fc725a1f22dd7b7b23ebbaee89f0cfed'
Sean Egan <seanegan@gmail.com>
parents: 18270
diff changeset
1053 static void
c77cf4e8eb65 disapproval of revision '947b20b6fc725a1f22dd7b7b23ebbaee89f0cfed'
Sean Egan <seanegan@gmail.com>
parents: 18270
diff changeset
1054 pidgin_status_box_regenerate(PidginStatusBox *status_box)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1055 {
18225
4b5fed5cb038 Add UNAVAILABLE to statusbox defaults (as it's probably used more than invisible is) and rename it to 'do not disturb,' which I think it a better name for it. Agreed?
Sean Egan <seanegan@gmail.com>
parents: 18210
diff changeset
1056 GdkPixbuf *pixbuf, *pixbuf2, *pixbuf3, *pixbuf4, *pixbuf5;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1057 GtkIconSize icon_size;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1058
15436
9c0cf4db1f4d Dialog icon changes
Sean Egan <seanegan@gmail.com>
parents: 15413
diff changeset
1059 icon_size = 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
1060
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1061 /* Unset the model while clearing it */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1062 gtk_tree_view_set_model(GTK_TREE_VIEW(status_box->tree_view), NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1063 gtk_list_store_clear(status_box->dropdown_store);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1064 /* Don't set the model until the new statuses have been added to the box.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1065 * What is presumably a bug in Gtk < 2.4 causes things to get all confused
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1066 * if we do this here. */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1067 /* gtk_combo_box_set_model(GTK_COMBO_BOX(status_box), GTK_TREE_MODEL(status_box->dropdown_store)); */
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 if (status_box->account == NULL)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1070 {
15436
9c0cf4db1f4d Dialog icon changes
Sean Egan <seanegan@gmail.com>
parents: 15413
diff changeset
1071 pixbuf = gtk_widget_render_icon (GTK_WIDGET(status_box->vbox), PIDGIN_STOCK_STATUS_AVAILABLE,
15514
535f002e7b0f More pidgin changes
Sean Egan <seanegan@gmail.com>
parents: 15507
diff changeset
1072 icon_size, "PidginStatusBox");
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1073 /* Do all the currently enabled accounts have the same statuses?
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1074 * If so, display them instead of our global list.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1075 */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1076 if (status_box->token_status_account) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1077 add_account_statuses(status_box, status_box->token_status_account);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1078 } else {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1079 /* Global */
15436
9c0cf4db1f4d Dialog icon changes
Sean Egan <seanegan@gmail.com>
parents: 15413
diff changeset
1080 pixbuf2 = gtk_widget_render_icon (GTK_WIDGET(status_box->vbox), PIDGIN_STOCK_STATUS_AWAY,
9c0cf4db1f4d Dialog icon changes
Sean Egan <seanegan@gmail.com>
parents: 15413
diff changeset
1081 icon_size, "PidginStatusBox");
9c0cf4db1f4d Dialog icon changes
Sean Egan <seanegan@gmail.com>
parents: 15413
diff changeset
1082 pixbuf3 = gtk_widget_render_icon (GTK_WIDGET(status_box->vbox), PIDGIN_STOCK_STATUS_OFFLINE,
9c0cf4db1f4d Dialog icon changes
Sean Egan <seanegan@gmail.com>
parents: 15413
diff changeset
1083 icon_size, "PidginStatusBox");
16235
fde43bac6f23 more icon updates
Sean Egan <seanegan@gmail.com>
parents: 16193
diff changeset
1084 pixbuf4 = gtk_widget_render_icon (GTK_WIDGET(status_box->vbox), PIDGIN_STOCK_STATUS_INVISIBLE,
15436
9c0cf4db1f4d Dialog icon changes
Sean Egan <seanegan@gmail.com>
parents: 15413
diff changeset
1085 icon_size, "PidginStatusBox");
18225
4b5fed5cb038 Add UNAVAILABLE to statusbox defaults (as it's probably used more than invisible is) and rename it to 'do not disturb,' which I think it a better name for it. Agreed?
Sean Egan <seanegan@gmail.com>
parents: 18210
diff changeset
1086 pixbuf5 = gtk_widget_render_icon (GTK_WIDGET(status_box->vbox), PIDGIN_STOCK_STATUS_BUSY,
4b5fed5cb038 Add UNAVAILABLE to statusbox defaults (as it's probably used more than invisible is) and rename it to 'do not disturb,' which I think it a better name for it. Agreed?
Sean Egan <seanegan@gmail.com>
parents: 18210
diff changeset
1087 icon_size, "PidginStatusBox");
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1088
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1089 pidgin_status_box_add(PIDGIN_STATUS_BOX(status_box), PIDGIN_STATUS_BOX_TYPE_PRIMITIVE, pixbuf, _("Available"), NULL, GINT_TO_POINTER(PURPLE_STATUS_AVAILABLE));
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1090 pidgin_status_box_add(PIDGIN_STATUS_BOX(status_box), PIDGIN_STATUS_BOX_TYPE_PRIMITIVE, pixbuf2, _("Away"), NULL, GINT_TO_POINTER(PURPLE_STATUS_AWAY));
18225
4b5fed5cb038 Add UNAVAILABLE to statusbox defaults (as it's probably used more than invisible is) and rename it to 'do not disturb,' which I think it a better name for it. Agreed?
Sean Egan <seanegan@gmail.com>
parents: 18210
diff changeset
1091 pidgin_status_box_add(PIDGIN_STATUS_BOX(status_box), PIDGIN_STATUS_BOX_TYPE_PRIMITIVE, pixbuf5, _("Do not disturb"), NULL, GINT_TO_POINTER(PURPLE_STATUS_UNAVAILABLE));
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1092 pidgin_status_box_add(PIDGIN_STATUS_BOX(status_box), PIDGIN_STATUS_BOX_TYPE_PRIMITIVE, pixbuf4, _("Invisible"), NULL, GINT_TO_POINTER(PURPLE_STATUS_INVISIBLE));
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1093 pidgin_status_box_add(PIDGIN_STATUS_BOX(status_box), PIDGIN_STATUS_BOX_TYPE_PRIMITIVE, pixbuf3, _("Offline"), NULL, GINT_TO_POINTER(PURPLE_STATUS_OFFLINE));
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1094
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1095 if (pixbuf2) g_object_unref(G_OBJECT(pixbuf2));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1096 if (pixbuf3) g_object_unref(G_OBJECT(pixbuf3));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1097 if (pixbuf4) g_object_unref(G_OBJECT(pixbuf4));
18225
4b5fed5cb038 Add UNAVAILABLE to statusbox defaults (as it's probably used more than invisible is) and rename it to 'do not disturb,' which I think it a better name for it. Agreed?
Sean Egan <seanegan@gmail.com>
parents: 18210
diff changeset
1098 if (pixbuf5) g_object_unref(G_OBJECT(pixbuf5));
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1099 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1100
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1101 add_popular_statuses(status_box);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1102
15514
535f002e7b0f More pidgin changes
Sean Egan <seanegan@gmail.com>
parents: 15507
diff changeset
1103 pidgin_status_box_add_separator(PIDGIN_STATUS_BOX(status_box));
21166
cd0486d8caa8 In an email to the Pidgin devel mailing list on 3 Nov 2007, Ethan
Mark Doliner <mark@kingant.net>
parents: 21055
diff changeset
1104 pidgin_status_box_add(PIDGIN_STATUS_BOX(status_box), PIDGIN_STATUS_BOX_TYPE_CUSTOM, NULL, _("New status..."), NULL, NULL);
cd0486d8caa8 In an email to the Pidgin devel mailing list on 3 Nov 2007, Ethan
Mark Doliner <mark@kingant.net>
parents: 21055
diff changeset
1105 pidgin_status_box_add(PIDGIN_STATUS_BOX(status_box), PIDGIN_STATUS_BOX_TYPE_SAVED, NULL, _("Saved statuses..."), NULL, NULL);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1106 if (pixbuf) g_object_unref(G_OBJECT(pixbuf));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1107
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1108 status_menu_refresh_iter(status_box);
15514
535f002e7b0f More pidgin changes
Sean Egan <seanegan@gmail.com>
parents: 15507
diff changeset
1109 pidgin_status_box_refresh(status_box);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1110
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1111 } else {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1112 add_account_statuses(status_box, status_box->account);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1113 update_to_reflect_account_status(status_box, status_box->account,
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1114 purple_account_get_active_status(status_box->account));
15374
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 gtk_tree_view_set_model(GTK_TREE_VIEW(status_box->tree_view), GTK_TREE_MODEL(status_box->dropdown_store));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1117 gtk_tree_view_set_search_column(GTK_TREE_VIEW(status_box->tree_view), TEXT_COLUMN);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1118 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1119
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1120 static gboolean combo_box_scroll_event_cb(GtkWidget *w, GdkEventScroll *event, GtkIMHtml *imhtml)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1121 {
18704
c77cf4e8eb65 disapproval of revision '947b20b6fc725a1f22dd7b7b23ebbaee89f0cfed'
Sean Egan <seanegan@gmail.com>
parents: 18270
diff changeset
1122 pidgin_status_box_popup(PIDGIN_STATUS_BOX(w));
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1123 return TRUE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1124 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1125
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1126 static gboolean imhtml_scroll_event_cb(GtkWidget *w, GdkEventScroll *event, GtkIMHtml *imhtml)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1127 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1128 if (event->direction == GDK_SCROLL_UP)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1129 gtk_imhtml_page_up(imhtml);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1130 else if (event->direction == GDK_SCROLL_DOWN)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1131 gtk_imhtml_page_down(imhtml);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1132 return TRUE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1133 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1134
21913
2a591a5b3322 Make some more event handlers return appropriate gboolean values. This turns
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 21560
diff changeset
1135 static gboolean imhtml_remove_focus(GtkWidget *w, GdkEventKey *event, PidginStatusBox *status_box)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1136 {
22835
f28047b68678 Patch from QuLogic to fix tab-navigation in the statusbox. And a few
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 22722
diff changeset
1137 if (event->keyval == GDK_Tab || event->keyval == GDK_KP_Tab || event->keyval == GDK_ISO_Left_Tab)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1138 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1139 /* If last inserted character is a tab, then remove the focus from here */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1140 GtkWidget *top = gtk_widget_get_toplevel(w);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1141 g_signal_emit_by_name(G_OBJECT(top), "move_focus",
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1142 (event->state & GDK_SHIFT_MASK) ?
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1143 GTK_DIR_TAB_BACKWARD: GTK_DIR_TAB_FORWARD);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1144 return TRUE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1145 }
22722
0ccc0e9ae565 Reset typing timeout if arrow keys are pressed when editing status
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 22682
diff changeset
1146 if (status_box->typing == 0)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1147 return FALSE;
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 /* Reset the status if Escape was pressed */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1150 if (event->keyval == GDK_Escape)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1151 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1152 g_source_remove(status_box->typing);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1153 status_box->typing = 0;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1154 if (status_box->account != NULL)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1155 update_to_reflect_account_status(status_box, status_box->account,
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1156 purple_account_get_active_status(status_box->account));
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1157 else {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1158 status_menu_refresh_iter(status_box);
15514
535f002e7b0f More pidgin changes
Sean Egan <seanegan@gmail.com>
parents: 15507
diff changeset
1159 pidgin_status_box_refresh(status_box);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1160 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1161 return TRUE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1162 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1163
15514
535f002e7b0f More pidgin changes
Sean Egan <seanegan@gmail.com>
parents: 15507
diff changeset
1164 pidgin_status_box_pulse_typing(status_box);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1165 g_source_remove(status_box->typing);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1166 status_box->typing = g_timeout_add(TYPING_TIMEOUT, (GSourceFunc)remove_typing_cb, status_box);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1167
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1168 return FALSE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1169 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1170
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1171 #if GTK_CHECK_VERSION(2,6,0)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1172 static gboolean
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1173 dropdown_store_row_separator_func(GtkTreeModel *model,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1174 GtkTreeIter *iter, gpointer data)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1175 {
15514
535f002e7b0f More pidgin changes
Sean Egan <seanegan@gmail.com>
parents: 15507
diff changeset
1176 PidginStatusBoxItemType type;
15374
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 gtk_tree_model_get(model, iter, TYPE_COLUMN, &type, -1);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1179
15514
535f002e7b0f More pidgin changes
Sean Egan <seanegan@gmail.com>
parents: 15507
diff changeset
1180 if (type == PIDGIN_STATUS_BOX_TYPE_SEPARATOR)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1181 return TRUE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1182
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1183 return FALSE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1184 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1185 #endif
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1186
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1187 static void
15514
535f002e7b0f More pidgin changes
Sean Egan <seanegan@gmail.com>
parents: 15507
diff changeset
1188 cache_pixbufs(PidginStatusBox *status_box)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1189 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1190 GtkIconSize icon_size;
22183
69ad31c9983d Fix some small leaks when destroying a statusbox.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 22102
diff changeset
1191 int i;
15938
d04878ce947b Some pixmap path fixes and win32 fixes
Daniel Atallah <daniel.atallah@gmail.com>
parents: 15880
diff changeset
1192
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1193 g_object_set(G_OBJECT(status_box->icon_rend), "xpad", 3, NULL);
15436
9c0cf4db1f4d Dialog icon changes
Sean Egan <seanegan@gmail.com>
parents: 15413
diff changeset
1194 icon_size = 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
1195
22183
69ad31c9983d Fix some small leaks when destroying a statusbox.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 22102
diff changeset
1196 for (i = 0; i < G_N_ELEMENTS(status_box->connecting_pixbufs); i++) {
69ad31c9983d Fix some small leaks when destroying a statusbox.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 22102
diff changeset
1197 if (status_box->connecting_pixbufs[i] != NULL)
69ad31c9983d Fix some small leaks when destroying a statusbox.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 22102
diff changeset
1198 gdk_pixbuf_unref(status_box->connecting_pixbufs[i]);
69ad31c9983d Fix some small leaks when destroying a statusbox.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 22102
diff changeset
1199 }
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1200
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1201 status_box->connecting_index = 0;
15455
3b45081f6183 Finish converting the statusbox. Note the connecting and animation icons are too large. I put out a request to Hylke.
Sean Egan <seanegan@gmail.com>
parents: 15436
diff changeset
1202 status_box->connecting_pixbufs[0] = gtk_widget_render_icon (GTK_WIDGET(status_box->vbox), PIDGIN_STOCK_ANIMATION_CONNECT0,
3b45081f6183 Finish converting the statusbox. Note the connecting and animation icons are too large. I put out a request to Hylke.
Sean Egan <seanegan@gmail.com>
parents: 15436
diff changeset
1203 icon_size, "PidginStatusBox");
3b45081f6183 Finish converting the statusbox. Note the connecting and animation icons are too large. I put out a request to Hylke.
Sean Egan <seanegan@gmail.com>
parents: 15436
diff changeset
1204 status_box->connecting_pixbufs[1] = gtk_widget_render_icon (GTK_WIDGET(status_box->vbox), PIDGIN_STOCK_ANIMATION_CONNECT1,
3b45081f6183 Finish converting the statusbox. Note the connecting and animation icons are too large. I put out a request to Hylke.
Sean Egan <seanegan@gmail.com>
parents: 15436
diff changeset
1205 icon_size, "PidginStatusBox");
3b45081f6183 Finish converting the statusbox. Note the connecting and animation icons are too large. I put out a request to Hylke.
Sean Egan <seanegan@gmail.com>
parents: 15436
diff changeset
1206 status_box->connecting_pixbufs[2] = gtk_widget_render_icon (GTK_WIDGET(status_box->vbox), PIDGIN_STOCK_ANIMATION_CONNECT2,
3b45081f6183 Finish converting the statusbox. Note the connecting and animation icons are too large. I put out a request to Hylke.
Sean Egan <seanegan@gmail.com>
parents: 15436
diff changeset
1207 icon_size, "PidginStatusBox");
3b45081f6183 Finish converting the statusbox. Note the connecting and animation icons are too large. I put out a request to Hylke.
Sean Egan <seanegan@gmail.com>
parents: 15436
diff changeset
1208 status_box->connecting_pixbufs[3] = gtk_widget_render_icon (GTK_WIDGET(status_box->vbox), PIDGIN_STOCK_ANIMATION_CONNECT3,
3b45081f6183 Finish converting the statusbox. Note the connecting and animation icons are too large. I put out a request to Hylke.
Sean Egan <seanegan@gmail.com>
parents: 15436
diff changeset
1209 icon_size, "PidginStatusBox");
15675
9195abe409de throbber for a connecting icon
Sean Egan <seanegan@gmail.com>
parents: 15669
diff changeset
1210 status_box->connecting_pixbufs[4] = gtk_widget_render_icon (GTK_WIDGET(status_box->vbox), PIDGIN_STOCK_ANIMATION_CONNECT4,
9195abe409de throbber for a connecting icon
Sean Egan <seanegan@gmail.com>
parents: 15669
diff changeset
1211 icon_size, "PidginStatusBox");
9195abe409de throbber for a connecting icon
Sean Egan <seanegan@gmail.com>
parents: 15669
diff changeset
1212 status_box->connecting_pixbufs[5] = gtk_widget_render_icon (GTK_WIDGET(status_box->vbox), PIDGIN_STOCK_ANIMATION_CONNECT5,
9195abe409de throbber for a connecting icon
Sean Egan <seanegan@gmail.com>
parents: 15669
diff changeset
1213 icon_size, "PidginStatusBox");
9195abe409de throbber for a connecting icon
Sean Egan <seanegan@gmail.com>
parents: 15669
diff changeset
1214 status_box->connecting_pixbufs[6] = gtk_widget_render_icon (GTK_WIDGET(status_box->vbox), PIDGIN_STOCK_ANIMATION_CONNECT6,
9195abe409de throbber for a connecting icon
Sean Egan <seanegan@gmail.com>
parents: 15669
diff changeset
1215 icon_size, "PidginStatusBox");
9195abe409de throbber for a connecting icon
Sean Egan <seanegan@gmail.com>
parents: 15669
diff changeset
1216 status_box->connecting_pixbufs[7] = gtk_widget_render_icon (GTK_WIDGET(status_box->vbox), PIDGIN_STOCK_ANIMATION_CONNECT7,
9195abe409de throbber for a connecting icon
Sean Egan <seanegan@gmail.com>
parents: 15669
diff changeset
1217 icon_size, "PidginStatusBox");
9195abe409de throbber for a connecting icon
Sean Egan <seanegan@gmail.com>
parents: 15669
diff changeset
1218 status_box->connecting_pixbufs[8] = gtk_widget_render_icon (GTK_WIDGET(status_box->vbox), PIDGIN_STOCK_ANIMATION_CONNECT8,
9195abe409de throbber for a connecting icon
Sean Egan <seanegan@gmail.com>
parents: 15669
diff changeset
1219 icon_size, "PidginStatusBox");
23881
a0ea445b99de Throbber test.
Hylke Bons <hylkebons@gmail.com>
parents: 23273
diff changeset
1220 status_box->connecting_pixbufs[9] = gtk_widget_render_icon (GTK_WIDGET(status_box->vbox), PIDGIN_STOCK_ANIMATION_CONNECT9,
a0ea445b99de Throbber test.
Hylke Bons <hylkebons@gmail.com>
parents: 23273
diff changeset
1221 icon_size, "PidginStatusBox");
a0ea445b99de Throbber test.
Hylke Bons <hylkebons@gmail.com>
parents: 23273
diff changeset
1222 status_box->connecting_pixbufs[10] = gtk_widget_render_icon (GTK_WIDGET(status_box->vbox), PIDGIN_STOCK_ANIMATION_CONNECT10,
a0ea445b99de Throbber test.
Hylke Bons <hylkebons@gmail.com>
parents: 23273
diff changeset
1223 icon_size, "PidginStatusBox");
a0ea445b99de Throbber test.
Hylke Bons <hylkebons@gmail.com>
parents: 23273
diff changeset
1224 status_box->connecting_pixbufs[11] = gtk_widget_render_icon (GTK_WIDGET(status_box->vbox), PIDGIN_STOCK_ANIMATION_CONNECT11,
a0ea445b99de Throbber test.
Hylke Bons <hylkebons@gmail.com>
parents: 23273
diff changeset
1225 icon_size, "PidginStatusBox");
a0ea445b99de Throbber test.
Hylke Bons <hylkebons@gmail.com>
parents: 23273
diff changeset
1226 status_box->connecting_pixbufs[12] = gtk_widget_render_icon (GTK_WIDGET(status_box->vbox), PIDGIN_STOCK_ANIMATION_CONNECT12,
a0ea445b99de Throbber test.
Hylke Bons <hylkebons@gmail.com>
parents: 23273
diff changeset
1227 icon_size, "PidginStatusBox");
a0ea445b99de Throbber test.
Hylke Bons <hylkebons@gmail.com>
parents: 23273
diff changeset
1228 status_box->connecting_pixbufs[13] = gtk_widget_render_icon (GTK_WIDGET(status_box->vbox), PIDGIN_STOCK_ANIMATION_CONNECT13,
a0ea445b99de Throbber test.
Hylke Bons <hylkebons@gmail.com>
parents: 23273
diff changeset
1229 icon_size, "PidginStatusBox");
a0ea445b99de Throbber test.
Hylke Bons <hylkebons@gmail.com>
parents: 23273
diff changeset
1230 status_box->connecting_pixbufs[14] = gtk_widget_render_icon (GTK_WIDGET(status_box->vbox), PIDGIN_STOCK_ANIMATION_CONNECT14,
a0ea445b99de Throbber test.
Hylke Bons <hylkebons@gmail.com>
parents: 23273
diff changeset
1231 icon_size, "PidginStatusBox");
a0ea445b99de Throbber test.
Hylke Bons <hylkebons@gmail.com>
parents: 23273
diff changeset
1232 status_box->connecting_pixbufs[15] = gtk_widget_render_icon (GTK_WIDGET(status_box->vbox), PIDGIN_STOCK_ANIMATION_CONNECT15,
a0ea445b99de Throbber test.
Hylke Bons <hylkebons@gmail.com>
parents: 23273
diff changeset
1233 icon_size, "PidginStatusBox");
a0ea445b99de Throbber test.
Hylke Bons <hylkebons@gmail.com>
parents: 23273
diff changeset
1234 status_box->connecting_pixbufs[16] = gtk_widget_render_icon (GTK_WIDGET(status_box->vbox), PIDGIN_STOCK_ANIMATION_CONNECT16,
a0ea445b99de Throbber test.
Hylke Bons <hylkebons@gmail.com>
parents: 23273
diff changeset
1235 icon_size, "PidginStatusBox");
a0ea445b99de Throbber test.
Hylke Bons <hylkebons@gmail.com>
parents: 23273
diff changeset
1236 status_box->connecting_pixbufs[17] = gtk_widget_render_icon (GTK_WIDGET(status_box->vbox), PIDGIN_STOCK_ANIMATION_CONNECT17,
a0ea445b99de Throbber test.
Hylke Bons <hylkebons@gmail.com>
parents: 23273
diff changeset
1237 icon_size, "PidginStatusBox");
a0ea445b99de Throbber test.
Hylke Bons <hylkebons@gmail.com>
parents: 23273
diff changeset
1238 status_box->connecting_pixbufs[18] = gtk_widget_render_icon (GTK_WIDGET(status_box->vbox), PIDGIN_STOCK_ANIMATION_CONNECT18,
a0ea445b99de Throbber test.
Hylke Bons <hylkebons@gmail.com>
parents: 23273
diff changeset
1239 icon_size, "PidginStatusBox");
a0ea445b99de Throbber test.
Hylke Bons <hylkebons@gmail.com>
parents: 23273
diff changeset
1240 status_box->connecting_pixbufs[19] = gtk_widget_render_icon (GTK_WIDGET(status_box->vbox), PIDGIN_STOCK_ANIMATION_CONNECT19,
a0ea445b99de Throbber test.
Hylke Bons <hylkebons@gmail.com>
parents: 23273
diff changeset
1241 icon_size, "PidginStatusBox");
a0ea445b99de Throbber test.
Hylke Bons <hylkebons@gmail.com>
parents: 23273
diff changeset
1242 status_box->connecting_pixbufs[20] = gtk_widget_render_icon (GTK_WIDGET(status_box->vbox), PIDGIN_STOCK_ANIMATION_CONNECT20,
a0ea445b99de Throbber test.
Hylke Bons <hylkebons@gmail.com>
parents: 23273
diff changeset
1243 icon_size, "PidginStatusBox");
a0ea445b99de Throbber test.
Hylke Bons <hylkebons@gmail.com>
parents: 23273
diff changeset
1244 status_box->connecting_pixbufs[21] = gtk_widget_render_icon (GTK_WIDGET(status_box->vbox), PIDGIN_STOCK_ANIMATION_CONNECT21,
a0ea445b99de Throbber test.
Hylke Bons <hylkebons@gmail.com>
parents: 23273
diff changeset
1245 icon_size, "PidginStatusBox");
a0ea445b99de Throbber test.
Hylke Bons <hylkebons@gmail.com>
parents: 23273
diff changeset
1246 status_box->connecting_pixbufs[22] = gtk_widget_render_icon (GTK_WIDGET(status_box->vbox), PIDGIN_STOCK_ANIMATION_CONNECT22,
a0ea445b99de Throbber test.
Hylke Bons <hylkebons@gmail.com>
parents: 23273
diff changeset
1247 icon_size, "PidginStatusBox");
a0ea445b99de Throbber test.
Hylke Bons <hylkebons@gmail.com>
parents: 23273
diff changeset
1248 status_box->connecting_pixbufs[23] = gtk_widget_render_icon (GTK_WIDGET(status_box->vbox), PIDGIN_STOCK_ANIMATION_CONNECT23,
a0ea445b99de Throbber test.
Hylke Bons <hylkebons@gmail.com>
parents: 23273
diff changeset
1249 icon_size, "PidginStatusBox");
a0ea445b99de Throbber test.
Hylke Bons <hylkebons@gmail.com>
parents: 23273
diff changeset
1250 status_box->connecting_pixbufs[24] = gtk_widget_render_icon (GTK_WIDGET(status_box->vbox), PIDGIN_STOCK_ANIMATION_CONNECT24,
a0ea445b99de Throbber test.
Hylke Bons <hylkebons@gmail.com>
parents: 23273
diff changeset
1251 icon_size, "PidginStatusBox");
a0ea445b99de Throbber test.
Hylke Bons <hylkebons@gmail.com>
parents: 23273
diff changeset
1252 status_box->connecting_pixbufs[25] = gtk_widget_render_icon (GTK_WIDGET(status_box->vbox), PIDGIN_STOCK_ANIMATION_CONNECT25,
a0ea445b99de Throbber test.
Hylke Bons <hylkebons@gmail.com>
parents: 23273
diff changeset
1253 icon_size, "PidginStatusBox");
a0ea445b99de Throbber test.
Hylke Bons <hylkebons@gmail.com>
parents: 23273
diff changeset
1254 status_box->connecting_pixbufs[26] = gtk_widget_render_icon (GTK_WIDGET(status_box->vbox), PIDGIN_STOCK_ANIMATION_CONNECT26,
a0ea445b99de Throbber test.
Hylke Bons <hylkebons@gmail.com>
parents: 23273
diff changeset
1255 icon_size, "PidginStatusBox");
a0ea445b99de Throbber test.
Hylke Bons <hylkebons@gmail.com>
parents: 23273
diff changeset
1256 status_box->connecting_pixbufs[27] = gtk_widget_render_icon (GTK_WIDGET(status_box->vbox), PIDGIN_STOCK_ANIMATION_CONNECT27,
a0ea445b99de Throbber test.
Hylke Bons <hylkebons@gmail.com>
parents: 23273
diff changeset
1257 icon_size, "PidginStatusBox");
a0ea445b99de Throbber test.
Hylke Bons <hylkebons@gmail.com>
parents: 23273
diff changeset
1258 status_box->connecting_pixbufs[28] = gtk_widget_render_icon (GTK_WIDGET(status_box->vbox), PIDGIN_STOCK_ANIMATION_CONNECT28,
a0ea445b99de Throbber test.
Hylke Bons <hylkebons@gmail.com>
parents: 23273
diff changeset
1259 icon_size, "PidginStatusBox");
a0ea445b99de Throbber test.
Hylke Bons <hylkebons@gmail.com>
parents: 23273
diff changeset
1260 status_box->connecting_pixbufs[29] = gtk_widget_render_icon (GTK_WIDGET(status_box->vbox), PIDGIN_STOCK_ANIMATION_CONNECT29,
a0ea445b99de Throbber test.
Hylke Bons <hylkebons@gmail.com>
parents: 23273
diff changeset
1261 icon_size, "PidginStatusBox");
a0ea445b99de Throbber test.
Hylke Bons <hylkebons@gmail.com>
parents: 23273
diff changeset
1262 status_box->connecting_pixbufs[30] = gtk_widget_render_icon (GTK_WIDGET(status_box->vbox), PIDGIN_STOCK_ANIMATION_CONNECT30,
a0ea445b99de Throbber test.
Hylke Bons <hylkebons@gmail.com>
parents: 23273
diff changeset
1263 icon_size, "PidginStatusBox");
a0ea445b99de Throbber test.
Hylke Bons <hylkebons@gmail.com>
parents: 23273
diff changeset
1264
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1265
22183
69ad31c9983d Fix some small leaks when destroying a statusbox.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 22102
diff changeset
1266 for (i = 0; i < G_N_ELEMENTS(status_box->typing_pixbufs); i++) {
69ad31c9983d Fix some small leaks when destroying a statusbox.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 22102
diff changeset
1267 if (status_box->typing_pixbufs[i] != NULL)
69ad31c9983d Fix some small leaks when destroying a statusbox.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 22102
diff changeset
1268 gdk_pixbuf_unref(status_box->typing_pixbufs[i]);
69ad31c9983d Fix some small leaks when destroying a statusbox.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 22102
diff changeset
1269 }
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1270
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1271 status_box->typing_index = 0;
15455
3b45081f6183 Finish converting the statusbox. Note the connecting and animation icons are too large. I put out a request to Hylke.
Sean Egan <seanegan@gmail.com>
parents: 15436
diff changeset
1272 status_box->typing_pixbufs[0] = gtk_widget_render_icon (GTK_WIDGET(status_box->vbox), PIDGIN_STOCK_ANIMATION_TYPING0,
3b45081f6183 Finish converting the statusbox. Note the connecting and animation icons are too large. I put out a request to Hylke.
Sean Egan <seanegan@gmail.com>
parents: 15436
diff changeset
1273 icon_size, "PidginStatusBox");
3b45081f6183 Finish converting the statusbox. Note the connecting and animation icons are too large. I put out a request to Hylke.
Sean Egan <seanegan@gmail.com>
parents: 15436
diff changeset
1274 status_box->typing_pixbufs[1] = gtk_widget_render_icon (GTK_WIDGET(status_box->vbox), PIDGIN_STOCK_ANIMATION_TYPING1,
3b45081f6183 Finish converting the statusbox. Note the connecting and animation icons are too large. I put out a request to Hylke.
Sean Egan <seanegan@gmail.com>
parents: 15436
diff changeset
1275 icon_size, "PidginStatusBox");
3b45081f6183 Finish converting the statusbox. Note the connecting and animation icons are too large. I put out a request to Hylke.
Sean Egan <seanegan@gmail.com>
parents: 15436
diff changeset
1276 status_box->typing_pixbufs[2] = gtk_widget_render_icon (GTK_WIDGET(status_box->vbox), PIDGIN_STOCK_ANIMATION_TYPING2,
3b45081f6183 Finish converting the statusbox. Note the connecting and animation icons are too large. I put out a request to Hylke.
Sean Egan <seanegan@gmail.com>
parents: 15436
diff changeset
1277 icon_size, "PidginStatusBox");
3b45081f6183 Finish converting the statusbox. Note the connecting and animation icons are too large. I put out a request to Hylke.
Sean Egan <seanegan@gmail.com>
parents: 15436
diff changeset
1278 status_box->typing_pixbufs[3] = gtk_widget_render_icon (GTK_WIDGET(status_box->vbox), PIDGIN_STOCK_ANIMATION_TYPING3,
3b45081f6183 Finish converting the statusbox. Note the connecting and animation icons are too large. I put out a request to Hylke.
Sean Egan <seanegan@gmail.com>
parents: 15436
diff changeset
1279 icon_size, "PidginStatusBox");
15669
603488306e23 more icon updates.
Sean Egan <seanegan@gmail.com>
parents: 15593
diff changeset
1280 status_box->typing_pixbufs[4] = gtk_widget_render_icon (GTK_WIDGET(status_box->vbox), PIDGIN_STOCK_ANIMATION_TYPING4,
603488306e23 more icon updates.
Sean Egan <seanegan@gmail.com>
parents: 15593
diff changeset
1281 icon_size, "PidginStatusBox");
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1282 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1283
22676
a73acc0c4dc8 Ignore token_status_account on account-specific status boxes. This should
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 22470
diff changeset
1284 static void account_enabled_cb(PurpleAccount *acct, PidginStatusBox *status_box)
a73acc0c4dc8 Ignore token_status_account on account-specific status boxes. This should
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 22470
diff changeset
1285 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1286 PurpleAccount *initial_token_acct = status_box->token_status_account;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1287
22676
a73acc0c4dc8 Ignore token_status_account on account-specific status boxes. This should
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 22470
diff changeset
1288 if (status_box->account)
a73acc0c4dc8 Ignore token_status_account on account-specific status boxes. This should
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 22470
diff changeset
1289 return;
a73acc0c4dc8 Ignore token_status_account on account-specific status boxes. This should
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 22470
diff changeset
1290
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1291 status_box->token_status_account = check_active_accounts_for_identical_statuses();
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 /* Regenerate the list if it has changed */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1294 if (initial_token_acct != status_box->token_status_account) {
15514
535f002e7b0f More pidgin changes
Sean Egan <seanegan@gmail.com>
parents: 15507
diff changeset
1295 pidgin_status_box_regenerate(status_box);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1296 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1297
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1298 }
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 static void
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1301 current_savedstatus_changed_cb(PurpleSavedStatus *now, PurpleSavedStatus *old, PidginStatusBox *status_box)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1302 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1303 /* Make sure our current status is added to the list of popular statuses */
15514
535f002e7b0f More pidgin changes
Sean Egan <seanegan@gmail.com>
parents: 15507
diff changeset
1304 pidgin_status_box_regenerate(status_box);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1305 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1306
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1307 static void
18111
02f39842d28b fixes #590 by allowing one to use the delete key to delete transient status,
Ka-Hing Cheung <khc@hxbc.us>
parents: 18058
diff changeset
1308 saved_status_updated_cb(PurpleSavedStatus *status, PidginStatusBox *status_box)
02f39842d28b fixes #590 by allowing one to use the delete key to delete transient status,
Ka-Hing Cheung <khc@hxbc.us>
parents: 18058
diff changeset
1309 {
02f39842d28b fixes #590 by allowing one to use the delete key to delete transient status,
Ka-Hing Cheung <khc@hxbc.us>
parents: 18058
diff changeset
1310 pidgin_status_box_regenerate(status_box);
02f39842d28b fixes #590 by allowing one to use the delete key to delete transient status,
Ka-Hing Cheung <khc@hxbc.us>
parents: 18058
diff changeset
1311 }
02f39842d28b fixes #590 by allowing one to use the delete key to delete transient status,
Ka-Hing Cheung <khc@hxbc.us>
parents: 18058
diff changeset
1312
02f39842d28b fixes #590 by allowing one to use the delete key to delete transient status,
Ka-Hing Cheung <khc@hxbc.us>
parents: 18058
diff changeset
1313 static void
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1314 spellcheck_prefs_cb(const char *name, PurplePrefType type,
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1315 gconstpointer value, gpointer data)
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 #ifdef USE_GTKSPELL
15514
535f002e7b0f More pidgin changes
Sean Egan <seanegan@gmail.com>
parents: 15507
diff changeset
1318 PidginStatusBox *status_box = (PidginStatusBox *)data;
15374
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 if (value)
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15493
diff changeset
1321 pidgin_setup_gtkspell(GTK_TEXT_VIEW(status_box->imhtml));
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1322 else
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1323 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1324 GtkSpell *spell;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1325 spell = gtkspell_get_from_text_view(GTK_TEXT_VIEW(status_box->imhtml));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1326 gtkspell_detach(spell);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1327 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1328 #endif
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1329 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1330
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1331 #if 0
15514
535f002e7b0f More pidgin changes
Sean Egan <seanegan@gmail.com>
parents: 15507
diff changeset
1332 static gboolean button_released_cb(GtkWidget *widget, GdkEventButton *event, PidginStatusBox *box)
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
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1335 if (event->button != 1)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1336 return FALSE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1337 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(box->toggle_button), FALSE);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1338 if (!box->imhtml_visible)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1339 g_signal_emit_by_name(G_OBJECT(box), "changed", NULL, NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1340 return TRUE;
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
15514
535f002e7b0f More pidgin changes
Sean Egan <seanegan@gmail.com>
parents: 15507
diff changeset
1343 static gboolean button_pressed_cb(GtkWidget *widget, GdkEventButton *event, PidginStatusBox *box)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1344 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1345 if (event->button != 1)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1346 return FALSE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1347 gtk_combo_box_popup(GTK_COMBO_BOX(box));
16345
6b4e778ee4b4 Death to // comments.
Richard Laager <rlaager@wiktel.com>
parents: 16323
diff changeset
1348 /* Disabled until button_released_cb works */
6b4e778ee4b4 Death to // comments.
Richard Laager <rlaager@wiktel.com>
parents: 16323
diff changeset
1349 #if 0
6b4e778ee4b4 Death to // comments.
Richard Laager <rlaager@wiktel.com>
parents: 16323
diff changeset
1350 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(box->toggle_button), TRUE);
6b4e778ee4b4 Death to // comments.
Richard Laager <rlaager@wiktel.com>
parents: 16323
diff changeset
1351 #endif
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1352 return TRUE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1353 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1354 #endif
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 static void
15514
535f002e7b0f More pidgin changes
Sean Egan <seanegan@gmail.com>
parents: 15507
diff changeset
1357 pidgin_status_box_list_position (PidginStatusBox *status_box, int *x, int *y, int *width, int *height)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1358 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1359 #if GTK_CHECK_VERSION(2,2,0)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1360 GdkScreen *screen;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1361 gint monitor_num;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1362 GdkRectangle monitor;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1363 #endif
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1364 GtkRequisition popup_req;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1365 GtkPolicyType hpolicy, vpolicy;
15938
d04878ce947b Some pixmap path fixes and win32 fixes
Daniel Atallah <daniel.atallah@gmail.com>
parents: 15880
diff changeset
1366
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1367 gdk_window_get_origin (GTK_WIDGET(status_box)->window, x, y);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1368
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1369 *x += GTK_WIDGET(status_box)->allocation.x;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1370 *y += GTK_WIDGET(status_box)->allocation.y;
15938
d04878ce947b Some pixmap path fixes and win32 fixes
Daniel Atallah <daniel.atallah@gmail.com>
parents: 15880
diff changeset
1371
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1372 *width = GTK_WIDGET(status_box)->allocation.width;
15938
d04878ce947b Some pixmap path fixes and win32 fixes
Daniel Atallah <daniel.atallah@gmail.com>
parents: 15880
diff changeset
1373
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1374 hpolicy = vpolicy = GTK_POLICY_NEVER;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1375 gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (status_box->scrolled_window),
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1376 hpolicy, vpolicy);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1377 gtk_widget_size_request (status_box->popup_frame, &popup_req);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1378
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1379 if (popup_req.width > *width)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1380 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1381 hpolicy = GTK_POLICY_ALWAYS;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1382 gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (status_box->scrolled_window),
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1383 hpolicy, vpolicy);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1384 gtk_widget_size_request (status_box->popup_frame, &popup_req);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1385 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1386
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1387 *height = popup_req.height;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1388
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1389 #if GTK_CHECK_VERSION(2,2,0)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1390 screen = gtk_widget_get_screen (GTK_WIDGET (status_box));
15938
d04878ce947b Some pixmap path fixes and win32 fixes
Daniel Atallah <daniel.atallah@gmail.com>
parents: 15880
diff changeset
1391 monitor_num = gdk_screen_get_monitor_at_window (screen,
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1392 GTK_WIDGET (status_box)->window);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1393 gdk_screen_get_monitor_geometry (screen, monitor_num, &monitor);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1394
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1395 if (*x < monitor.x)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1396 *x = monitor.x;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1397 else if (*x + *width > monitor.x + monitor.width)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1398 *x = monitor.x + monitor.width - *width;
15938
d04878ce947b Some pixmap path fixes and win32 fixes
Daniel Atallah <daniel.atallah@gmail.com>
parents: 15880
diff changeset
1399
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1400 if (*y + GTK_WIDGET(status_box)->allocation.height + *height <= monitor.y + monitor.height)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1401 *y += GTK_WIDGET(status_box)->allocation.height;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1402 else if (*y - *height >= monitor.y)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1403 *y -= *height;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1404 else if (monitor.y + monitor.height - (*y + GTK_WIDGET(status_box)->allocation.height) > *y - monitor.y)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1405 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1406 *y += GTK_WIDGET(status_box)->allocation.height;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1407 *height = monitor.y + monitor.height - *y;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1408 }
15938
d04878ce947b Some pixmap path fixes and win32 fixes
Daniel Atallah <daniel.atallah@gmail.com>
parents: 15880
diff changeset
1409 else
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1410 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1411 *height = *y - monitor.y;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1412 *y = monitor.y;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1413 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1414
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1415 if (popup_req.height > *height)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1416 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1417 vpolicy = GTK_POLICY_ALWAYS;
15938
d04878ce947b Some pixmap path fixes and win32 fixes
Daniel Atallah <daniel.atallah@gmail.com>
parents: 15880
diff changeset
1418
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1419 gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (status_box->scrolled_window),
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1420 hpolicy, vpolicy);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1421 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1422 #endif
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1423 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1424
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1425 static gboolean
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1426 popup_grab_on_window (GdkWindow *window,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1427 guint32 activate_time,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1428 gboolean grab_keyboard)
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 if ((gdk_pointer_grab (window, TRUE,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1431 GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK |
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1432 GDK_POINTER_MOTION_MASK,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1433 NULL, NULL, activate_time) == 0))
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1434 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1435 if (!grab_keyboard ||
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1436 gdk_keyboard_grab (window, TRUE,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1437 activate_time) == 0)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1438 return TRUE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1439 else
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1440 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1441 #if GTK_CHECK_VERSION(2,2,0)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1442 gdk_display_pointer_ungrab (gdk_drawable_get_display (window),
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1443 activate_time);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1444 #else
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1445 gdk_pointer_ungrab(activate_time);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1446 gdk_keyboard_ungrab(activate_time);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1447 #endif
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1448 return FALSE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1449 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1450 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1451
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1452 return FALSE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1453 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1454
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1455
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1456 static void
15514
535f002e7b0f More pidgin changes
Sean Egan <seanegan@gmail.com>
parents: 15507
diff changeset
1457 pidgin_status_box_popup(PidginStatusBox *box)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1458 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1459 int width, height, x, y;
15514
535f002e7b0f More pidgin changes
Sean Egan <seanegan@gmail.com>
parents: 15507
diff changeset
1460 pidgin_status_box_list_position (box, &x, &y, &width, &height);
15938
d04878ce947b Some pixmap path fixes and win32 fixes
Daniel Atallah <daniel.atallah@gmail.com>
parents: 15880
diff changeset
1461
d04878ce947b Some pixmap path fixes and win32 fixes
Daniel Atallah <daniel.atallah@gmail.com>
parents: 15880
diff changeset
1462 gtk_widget_set_size_request (box->popup_window, width, height);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1463 gtk_window_move (GTK_WINDOW (box->popup_window), x, y);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1464 gtk_widget_show(box->popup_window);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1465 gtk_widget_grab_focus (box->tree_view);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1466 if (!popup_grab_on_window (box->popup_window->window,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1467 GDK_CURRENT_TIME, TRUE)) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1468 gtk_widget_hide (box->popup_window);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1469 return;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1470 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1471 gtk_grab_add (box->popup_window);
20322
aad0f10eb4dc applied changes from 1bdf4754abed6b49eec400ecf415a9d557bc9834
Luke Schierer <lschiere@pidgin.im>
parents: 20074
diff changeset
1472 /*box->popup_in_progress = TRUE;*/
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1473 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (box->toggle_button),
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1474 TRUE);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1475
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1476 if (box->active_row) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1477 GtkTreePath *path = gtk_tree_row_reference_get_path(box->active_row);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1478 gtk_tree_view_set_cursor(GTK_TREE_VIEW(box->tree_view), path, NULL, FALSE);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1479 gtk_tree_path_free(path);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1480 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1481 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1482
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1483 static void
20322
aad0f10eb4dc applied changes from 1bdf4754abed6b49eec400ecf415a9d557bc9834
Luke Schierer <lschiere@pidgin.im>
parents: 20074
diff changeset
1484 pidgin_status_box_popdown(PidginStatusBox *box)
aad0f10eb4dc applied changes from 1bdf4754abed6b49eec400ecf415a9d557bc9834
Luke Schierer <lschiere@pidgin.im>
parents: 20074
diff changeset
1485 {
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1486 gtk_widget_hide(box->popup_window);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1487 box->popup_in_progress = FALSE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1488 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (box->toggle_button),
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1489 FALSE);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1490 gtk_grab_remove (box->popup_window);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1491 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1492
20322
aad0f10eb4dc applied changes from 1bdf4754abed6b49eec400ecf415a9d557bc9834
Luke Schierer <lschiere@pidgin.im>
parents: 20074
diff changeset
1493 static gboolean
aad0f10eb4dc applied changes from 1bdf4754abed6b49eec400ecf415a9d557bc9834
Luke Schierer <lschiere@pidgin.im>
parents: 20074
diff changeset
1494 toggle_key_press_cb(GtkWidget *widget, GdkEventKey *event, PidginStatusBox *box)
aad0f10eb4dc applied changes from 1bdf4754abed6b49eec400ecf415a9d557bc9834
Luke Schierer <lschiere@pidgin.im>
parents: 20074
diff changeset
1495 {
aad0f10eb4dc applied changes from 1bdf4754abed6b49eec400ecf415a9d557bc9834
Luke Schierer <lschiere@pidgin.im>
parents: 20074
diff changeset
1496 switch (event->keyval) {
aad0f10eb4dc applied changes from 1bdf4754abed6b49eec400ecf415a9d557bc9834
Luke Schierer <lschiere@pidgin.im>
parents: 20074
diff changeset
1497 case GDK_Return:
aad0f10eb4dc applied changes from 1bdf4754abed6b49eec400ecf415a9d557bc9834
Luke Schierer <lschiere@pidgin.im>
parents: 20074
diff changeset
1498 case GDK_KP_Enter:
aad0f10eb4dc applied changes from 1bdf4754abed6b49eec400ecf415a9d557bc9834
Luke Schierer <lschiere@pidgin.im>
parents: 20074
diff changeset
1499 case GDK_KP_Space:
aad0f10eb4dc applied changes from 1bdf4754abed6b49eec400ecf415a9d557bc9834
Luke Schierer <lschiere@pidgin.im>
parents: 20074
diff changeset
1500 case GDK_space:
aad0f10eb4dc applied changes from 1bdf4754abed6b49eec400ecf415a9d557bc9834
Luke Schierer <lschiere@pidgin.im>
parents: 20074
diff changeset
1501 if (!box->popup_in_progress) {
aad0f10eb4dc applied changes from 1bdf4754abed6b49eec400ecf415a9d557bc9834
Luke Schierer <lschiere@pidgin.im>
parents: 20074
diff changeset
1502 pidgin_status_box_popup (box);
aad0f10eb4dc applied changes from 1bdf4754abed6b49eec400ecf415a9d557bc9834
Luke Schierer <lschiere@pidgin.im>
parents: 20074
diff changeset
1503 box->popup_in_progress = TRUE;
aad0f10eb4dc applied changes from 1bdf4754abed6b49eec400ecf415a9d557bc9834
Luke Schierer <lschiere@pidgin.im>
parents: 20074
diff changeset
1504 } else {
aad0f10eb4dc applied changes from 1bdf4754abed6b49eec400ecf415a9d557bc9834
Luke Schierer <lschiere@pidgin.im>
parents: 20074
diff changeset
1505 pidgin_status_box_popdown(box);
aad0f10eb4dc applied changes from 1bdf4754abed6b49eec400ecf415a9d557bc9834
Luke Schierer <lschiere@pidgin.im>
parents: 20074
diff changeset
1506 }
aad0f10eb4dc applied changes from 1bdf4754abed6b49eec400ecf415a9d557bc9834
Luke Schierer <lschiere@pidgin.im>
parents: 20074
diff changeset
1507 return TRUE;
aad0f10eb4dc applied changes from 1bdf4754abed6b49eec400ecf415a9d557bc9834
Luke Schierer <lschiere@pidgin.im>
parents: 20074
diff changeset
1508 default:
22835
f28047b68678 Patch from QuLogic to fix tab-navigation in the statusbox. And a few
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 22722
diff changeset
1509 return FALSE;
20322
aad0f10eb4dc applied changes from 1bdf4754abed6b49eec400ecf415a9d557bc9834
Luke Schierer <lschiere@pidgin.im>
parents: 20074
diff changeset
1510 }
aad0f10eb4dc applied changes from 1bdf4754abed6b49eec400ecf415a9d557bc9834
Luke Schierer <lschiere@pidgin.im>
parents: 20074
diff changeset
1511 }
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1512
20322
aad0f10eb4dc applied changes from 1bdf4754abed6b49eec400ecf415a9d557bc9834
Luke Schierer <lschiere@pidgin.im>
parents: 20074
diff changeset
1513 static gboolean
19396
52c503319f56 Bring up statusbox menu on button-down instead of button-up. Fixes #1437
Sean Egan <seanegan@gmail.com>
parents: 19333
diff changeset
1514 toggled_cb(GtkWidget *widget, GdkEventButton *event, PidginStatusBox *box)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1515 {
20322
aad0f10eb4dc applied changes from 1bdf4754abed6b49eec400ecf415a9d557bc9834
Luke Schierer <lschiere@pidgin.im>
parents: 20074
diff changeset
1516 if (!box->popup_in_progress)
aad0f10eb4dc applied changes from 1bdf4754abed6b49eec400ecf415a9d557bc9834
Luke Schierer <lschiere@pidgin.im>
parents: 20074
diff changeset
1517 pidgin_status_box_popup (box);
aad0f10eb4dc applied changes from 1bdf4754abed6b49eec400ecf415a9d557bc9834
Luke Schierer <lschiere@pidgin.im>
parents: 20074
diff changeset
1518 else
aad0f10eb4dc applied changes from 1bdf4754abed6b49eec400ecf415a9d557bc9834
Luke Schierer <lschiere@pidgin.im>
parents: 20074
diff changeset
1519 pidgin_status_box_popdown(box);
aad0f10eb4dc applied changes from 1bdf4754abed6b49eec400ecf415a9d557bc9834
Luke Schierer <lschiere@pidgin.im>
parents: 20074
diff changeset
1520 return TRUE;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1521 }
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 static void
15514
535f002e7b0f More pidgin changes
Sean Egan <seanegan@gmail.com>
parents: 15507
diff changeset
1524 buddy_icon_set_cb(const char *filename, PidginStatusBox *box)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1525 {
16390
4fc51a87ce42 Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents: 16381
diff changeset
1526 PurpleStoredImage *img = NULL;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1527
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1528 if (box->account) {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1529 PurplePlugin *plug = purple_find_prpl(purple_account_get_protocol_id(box->account));
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1530 if (plug) {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1531 PurplePluginProtocolInfo *prplinfo = PURPLE_PLUGIN_PROTOCOL_INFO(plug);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1532 if (prplinfo && prplinfo->icon_spec.format) {
16390
4fc51a87ce42 Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents: 16381
diff changeset
1533 gpointer data = NULL;
4fc51a87ce42 Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents: 16381
diff changeset
1534 size_t len = 0;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1535 if (filename)
16390
4fc51a87ce42 Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents: 16381
diff changeset
1536 data = pidgin_convert_buddy_icon(plug, filename, &len);
4fc51a87ce42 Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents: 16381
diff changeset
1537 img = purple_buddy_icons_set_account_icon(box->account, data, len);
4fc51a87ce42 Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents: 16381
diff changeset
1538 purple_account_set_buddy_icon_path(box->account, filename);
4fc51a87ce42 Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents: 16381
diff changeset
1539
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1540 purple_account_set_bool(box->account, "use-global-buddyicon", (filename != NULL));
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1541 }
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 } else {
18063
926ccb104da0 disapproval of revision '1411afd7660760db59966c3a9f18e2adab8eb27e'
Richard Laager <rlaager@wiktel.com>
parents: 18058
diff changeset
1544 GList *accounts;
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1545 for (accounts = purple_accounts_get_all(); accounts != NULL; accounts = accounts->next) {
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1546 PurpleAccount *account = accounts->data;
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1547 PurplePlugin *plug = 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
1548 if (plug) {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1549 PurplePluginProtocolInfo *prplinfo = PURPLE_PLUGIN_PROTOCOL_INFO(plug);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1550 if (prplinfo != NULL &&
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1551 purple_account_get_bool(account, "use-global-buddyicon", TRUE) &&
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1552 prplinfo->icon_spec.format) {
16390
4fc51a87ce42 Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents: 16381
diff changeset
1553 gpointer data = NULL;
4fc51a87ce42 Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents: 16381
diff changeset
1554 size_t len = 0;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1555 if (filename)
16390
4fc51a87ce42 Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents: 16381
diff changeset
1556 data = pidgin_convert_buddy_icon(plug, filename, &len);
16658
c737c683c563 This seems to fix a problem with the global status selector, and some
Mark Doliner <mark@kingant.net>
parents: 16652
diff changeset
1557 img = purple_buddy_icons_set_account_icon(account, data, len);
c737c683c563 This seems to fix a problem with the global status selector, and some
Mark Doliner <mark@kingant.net>
parents: 16652
diff changeset
1558 purple_account_set_buddy_icon_path(account, filename);
15374
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 }
16690
7fad94837f9e Make the icon show up when you change the global buddy icon pref, even if all the accounts have per-account icons.
Kevin Stange <kevin@simguy.net>
parents: 16689
diff changeset
1562
7fad94837f9e Make the icon show up when you change the global buddy icon pref, even if all the accounts have per-account icons.
Kevin Stange <kevin@simguy.net>
parents: 16689
diff changeset
1563 /* Even if no accounts were processed, load the icon that was set. */
7fad94837f9e Make the icon show up when you change the global buddy icon pref, even if all the accounts have per-account icons.
Kevin Stange <kevin@simguy.net>
parents: 16689
diff changeset
1564 if (filename != NULL)
7fad94837f9e Make the icon show up when you change the global buddy icon pref, even if all the accounts have per-account icons.
Kevin Stange <kevin@simguy.net>
parents: 16689
diff changeset
1565 {
7fad94837f9e Make the icon show up when you change the global buddy icon pref, even if all the accounts have per-account icons.
Kevin Stange <kevin@simguy.net>
parents: 16689
diff changeset
1566 gchar *contents;
7fad94837f9e Make the icon show up when you change the global buddy icon pref, even if all the accounts have per-account icons.
Kevin Stange <kevin@simguy.net>
parents: 16689
diff changeset
1567 gsize size;
7fad94837f9e Make the icon show up when you change the global buddy icon pref, even if all the accounts have per-account icons.
Kevin Stange <kevin@simguy.net>
parents: 16689
diff changeset
1568 if (g_file_get_contents(filename, &contents, &size, NULL))
7fad94837f9e Make the icon show up when you change the global buddy icon pref, even if all the accounts have per-account icons.
Kevin Stange <kevin@simguy.net>
parents: 16689
diff changeset
1569 {
7fad94837f9e Make the icon show up when you change the global buddy icon pref, even if all the accounts have per-account icons.
Kevin Stange <kevin@simguy.net>
parents: 16689
diff changeset
1570 img = purple_imgstore_add(contents, size, filename);
7fad94837f9e Make the icon show up when you change the global buddy icon pref, even if all the accounts have per-account icons.
Kevin Stange <kevin@simguy.net>
parents: 16689
diff changeset
1571 }
7fad94837f9e Make the icon show up when you change the global buddy icon pref, even if all the accounts have per-account icons.
Kevin Stange <kevin@simguy.net>
parents: 16689
diff changeset
1572 }
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1573 }
16390
4fc51a87ce42 Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents: 16381
diff changeset
1574
4fc51a87ce42 Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents: 16381
diff changeset
1575 pidgin_status_box_set_buddy_icon(box, img);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1576 }
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 static void
15514
535f002e7b0f More pidgin changes
Sean Egan <seanegan@gmail.com>
parents: 15507
diff changeset
1579 remove_buddy_icon_cb(GtkWidget *w, PidginStatusBox *box)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1580 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1581 if (box->account == NULL)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1582 /* The pref-connect callback does the actual work */
16062
07554cc5d090 Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <stu@nosnilmot.com>
parents: 15938
diff changeset
1583 purple_prefs_set_path(PIDGIN_PREFS_ROOT "/accounts/buddyicon", NULL);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1584 else
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1585 buddy_icon_set_cb(NULL, box);
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 gtk_widget_destroy(box->icon_box_menu);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1588 box->icon_box_menu = NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1589 }
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 static void
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1592 icon_choose_cb(const char *filename, gpointer data)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1593 {
15514
535f002e7b0f More pidgin changes
Sean Egan <seanegan@gmail.com>
parents: 15507
diff changeset
1594 PidginStatusBox *box = data;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1595 if (filename) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1596 if (box->account == NULL)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1597 /* The pref-connect callback does the actual work */
16062
07554cc5d090 Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <stu@nosnilmot.com>
parents: 15938
diff changeset
1598 purple_prefs_set_path(PIDGIN_PREFS_ROOT "/accounts/buddyicon", filename);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1599 else
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1600 buddy_icon_set_cb(filename, box);
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
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1603 box->buddy_icon_sel = NULL;
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 static void
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1607 update_buddyicon_cb(const char *name, PurplePrefType type,
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1608 gconstpointer value, gpointer data)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1609 {
15514
535f002e7b0f More pidgin changes
Sean Egan <seanegan@gmail.com>
parents: 15507
diff changeset
1610 buddy_icon_set_cb(value, (PidginStatusBox*) data);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1611 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1612
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1613 static void
15514
535f002e7b0f More pidgin changes
Sean Egan <seanegan@gmail.com>
parents: 15507
diff changeset
1614 treeview_activate_current_selection(PidginStatusBox *status_box, GtkTreePath *path)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1615 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1616 if (status_box->active_row)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1617 gtk_tree_row_reference_free(status_box->active_row);
15938
d04878ce947b Some pixmap path fixes and win32 fixes
Daniel Atallah <daniel.atallah@gmail.com>
parents: 15880
diff changeset
1618
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1619 status_box->active_row = gtk_tree_row_reference_new(GTK_TREE_MODEL(status_box->dropdown_store), path);
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15493
diff changeset
1620 pidgin_status_box_popdown (status_box);
15514
535f002e7b0f More pidgin changes
Sean Egan <seanegan@gmail.com>
parents: 15507
diff changeset
1621 pidgin_status_box_changed(status_box);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1622 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1623
18111
02f39842d28b fixes #590 by allowing one to use the delete key to delete transient status,
Ka-Hing Cheung <khc@hxbc.us>
parents: 18058
diff changeset
1624 static void tree_view_delete_current_selection_cb(gpointer data)
02f39842d28b fixes #590 by allowing one to use the delete key to delete transient status,
Ka-Hing Cheung <khc@hxbc.us>
parents: 18058
diff changeset
1625 {
02f39842d28b fixes #590 by allowing one to use the delete key to delete transient status,
Ka-Hing Cheung <khc@hxbc.us>
parents: 18058
diff changeset
1626 PurpleSavedStatus *saved;
02f39842d28b fixes #590 by allowing one to use the delete key to delete transient status,
Ka-Hing Cheung <khc@hxbc.us>
parents: 18058
diff changeset
1627
02f39842d28b fixes #590 by allowing one to use the delete key to delete transient status,
Ka-Hing Cheung <khc@hxbc.us>
parents: 18058
diff changeset
1628 saved = purple_savedstatus_find_by_creation_time(GPOINTER_TO_INT(data));
02f39842d28b fixes #590 by allowing one to use the delete key to delete transient status,
Ka-Hing Cheung <khc@hxbc.us>
parents: 18058
diff changeset
1629 g_return_if_fail(saved != NULL);
02f39842d28b fixes #590 by allowing one to use the delete key to delete transient status,
Ka-Hing Cheung <khc@hxbc.us>
parents: 18058
diff changeset
1630
02f39842d28b fixes #590 by allowing one to use the delete key to delete transient status,
Ka-Hing Cheung <khc@hxbc.us>
parents: 18058
diff changeset
1631 if (purple_savedstatus_get_current() != saved)
02f39842d28b fixes #590 by allowing one to use the delete key to delete transient status,
Ka-Hing Cheung <khc@hxbc.us>
parents: 18058
diff changeset
1632 purple_savedstatus_delete_by_status(saved);
02f39842d28b fixes #590 by allowing one to use the delete key to delete transient status,
Ka-Hing Cheung <khc@hxbc.us>
parents: 18058
diff changeset
1633 }
02f39842d28b fixes #590 by allowing one to use the delete key to delete transient status,
Ka-Hing Cheung <khc@hxbc.us>
parents: 18058
diff changeset
1634
02f39842d28b fixes #590 by allowing one to use the delete key to delete transient status,
Ka-Hing Cheung <khc@hxbc.us>
parents: 18058
diff changeset
1635 static void
02f39842d28b fixes #590 by allowing one to use the delete key to delete transient status,
Ka-Hing Cheung <khc@hxbc.us>
parents: 18058
diff changeset
1636 tree_view_delete_current_selection(PidginStatusBox *status_box, GtkTreePath *path)
02f39842d28b fixes #590 by allowing one to use the delete key to delete transient status,
Ka-Hing Cheung <khc@hxbc.us>
parents: 18058
diff changeset
1637 {
02f39842d28b fixes #590 by allowing one to use the delete key to delete transient status,
Ka-Hing Cheung <khc@hxbc.us>
parents: 18058
diff changeset
1638 GtkTreeIter iter;
02f39842d28b fixes #590 by allowing one to use the delete key to delete transient status,
Ka-Hing Cheung <khc@hxbc.us>
parents: 18058
diff changeset
1639 gpointer data;
02f39842d28b fixes #590 by allowing one to use the delete key to delete transient status,
Ka-Hing Cheung <khc@hxbc.us>
parents: 18058
diff changeset
1640 PurpleSavedStatus *saved;
02f39842d28b fixes #590 by allowing one to use the delete key to delete transient status,
Ka-Hing Cheung <khc@hxbc.us>
parents: 18058
diff changeset
1641 gchar *msg;
02f39842d28b fixes #590 by allowing one to use the delete key to delete transient status,
Ka-Hing Cheung <khc@hxbc.us>
parents: 18058
diff changeset
1642
02f39842d28b fixes #590 by allowing one to use the delete key to delete transient status,
Ka-Hing Cheung <khc@hxbc.us>
parents: 18058
diff changeset
1643 if (status_box->active_row) {
02f39842d28b fixes #590 by allowing one to use the delete key to delete transient status,
Ka-Hing Cheung <khc@hxbc.us>
parents: 18058
diff changeset
1644 /* don't delete active status */
02f39842d28b fixes #590 by allowing one to use the delete key to delete transient status,
Ka-Hing Cheung <khc@hxbc.us>
parents: 18058
diff changeset
1645 if (gtk_tree_path_compare(path, gtk_tree_row_reference_get_path(status_box->active_row)) == 0)
02f39842d28b fixes #590 by allowing one to use the delete key to delete transient status,
Ka-Hing Cheung <khc@hxbc.us>
parents: 18058
diff changeset
1646 return;
02f39842d28b fixes #590 by allowing one to use the delete key to delete transient status,
Ka-Hing Cheung <khc@hxbc.us>
parents: 18058
diff changeset
1647 }
02f39842d28b fixes #590 by allowing one to use the delete key to delete transient status,
Ka-Hing Cheung <khc@hxbc.us>
parents: 18058
diff changeset
1648
02f39842d28b fixes #590 by allowing one to use the delete key to delete transient status,
Ka-Hing Cheung <khc@hxbc.us>
parents: 18058
diff changeset
1649 if (!gtk_tree_model_get_iter (GTK_TREE_MODEL(status_box->dropdown_store), &iter, path))
02f39842d28b fixes #590 by allowing one to use the delete key to delete transient status,
Ka-Hing Cheung <khc@hxbc.us>
parents: 18058
diff changeset
1650 return;
02f39842d28b fixes #590 by allowing one to use the delete key to delete transient status,
Ka-Hing Cheung <khc@hxbc.us>
parents: 18058
diff changeset
1651
02f39842d28b fixes #590 by allowing one to use the delete key to delete transient status,
Ka-Hing Cheung <khc@hxbc.us>
parents: 18058
diff changeset
1652 gtk_tree_model_get(GTK_TREE_MODEL(status_box->dropdown_store), &iter,
02f39842d28b fixes #590 by allowing one to use the delete key to delete transient status,
Ka-Hing Cheung <khc@hxbc.us>
parents: 18058
diff changeset
1653 DATA_COLUMN, &data,
02f39842d28b fixes #590 by allowing one to use the delete key to delete transient status,
Ka-Hing Cheung <khc@hxbc.us>
parents: 18058
diff changeset
1654 -1);
02f39842d28b fixes #590 by allowing one to use the delete key to delete transient status,
Ka-Hing Cheung <khc@hxbc.us>
parents: 18058
diff changeset
1655
02f39842d28b fixes #590 by allowing one to use the delete key to delete transient status,
Ka-Hing Cheung <khc@hxbc.us>
parents: 18058
diff changeset
1656 saved = purple_savedstatus_find_by_creation_time(GPOINTER_TO_INT(data));
02f39842d28b fixes #590 by allowing one to use the delete key to delete transient status,
Ka-Hing Cheung <khc@hxbc.us>
parents: 18058
diff changeset
1657 g_return_if_fail(saved != NULL);
02f39842d28b fixes #590 by allowing one to use the delete key to delete transient status,
Ka-Hing Cheung <khc@hxbc.us>
parents: 18058
diff changeset
1658 if (saved == purple_savedstatus_get_current())
02f39842d28b fixes #590 by allowing one to use the delete key to delete transient status,
Ka-Hing Cheung <khc@hxbc.us>
parents: 18058
diff changeset
1659 return;
02f39842d28b fixes #590 by allowing one to use the delete key to delete transient status,
Ka-Hing Cheung <khc@hxbc.us>
parents: 18058
diff changeset
1660
02f39842d28b fixes #590 by allowing one to use the delete key to delete transient status,
Ka-Hing Cheung <khc@hxbc.us>
parents: 18058
diff changeset
1661 msg = g_strdup_printf(_("Are you sure you want to delete %s?"), purple_savedstatus_get_title(saved));
02f39842d28b fixes #590 by allowing one to use the delete key to delete transient status,
Ka-Hing Cheung <khc@hxbc.us>
parents: 18058
diff changeset
1662
21099
51cf02dbdb0e disapproval of revision 'c484d979c4fda4433a9633ff8b69bd8a395c9479'
Richard Laager <rlaager@wiktel.com>
parents: 21095
diff changeset
1663 purple_request_action(saved, NULL, msg, NULL, 0,
18111
02f39842d28b fixes #590 by allowing one to use the delete key to delete transient status,
Ka-Hing Cheung <khc@hxbc.us>
parents: 18058
diff changeset
1664 NULL, NULL, NULL,
21099
51cf02dbdb0e disapproval of revision 'c484d979c4fda4433a9633ff8b69bd8a395c9479'
Richard Laager <rlaager@wiktel.com>
parents: 21095
diff changeset
1665 data, 2,
18111
02f39842d28b fixes #590 by allowing one to use the delete key to delete transient status,
Ka-Hing Cheung <khc@hxbc.us>
parents: 18058
diff changeset
1666 _("Delete"), tree_view_delete_current_selection_cb,
02f39842d28b fixes #590 by allowing one to use the delete key to delete transient status,
Ka-Hing Cheung <khc@hxbc.us>
parents: 18058
diff changeset
1667 _("Cancel"), NULL);
02f39842d28b fixes #590 by allowing one to use the delete key to delete transient status,
Ka-Hing Cheung <khc@hxbc.us>
parents: 18058
diff changeset
1668
02f39842d28b fixes #590 by allowing one to use the delete key to delete transient status,
Ka-Hing Cheung <khc@hxbc.us>
parents: 18058
diff changeset
1669 g_free(msg);
02f39842d28b fixes #590 by allowing one to use the delete key to delete transient status,
Ka-Hing Cheung <khc@hxbc.us>
parents: 18058
diff changeset
1670
02f39842d28b fixes #590 by allowing one to use the delete key to delete transient status,
Ka-Hing Cheung <khc@hxbc.us>
parents: 18058
diff changeset
1671 pidgin_status_box_popdown(status_box);
02f39842d28b fixes #590 by allowing one to use the delete key to delete transient status,
Ka-Hing Cheung <khc@hxbc.us>
parents: 18058
diff changeset
1672 }
02f39842d28b fixes #590 by allowing one to use the delete key to delete transient status,
Ka-Hing Cheung <khc@hxbc.us>
parents: 18058
diff changeset
1673
15938
d04878ce947b Some pixmap path fixes and win32 fixes
Daniel Atallah <daniel.atallah@gmail.com>
parents: 15880
diff changeset
1674 static gboolean
d04878ce947b Some pixmap path fixes and win32 fixes
Daniel Atallah <daniel.atallah@gmail.com>
parents: 15880
diff changeset
1675 treeview_button_release_cb(GtkWidget *widget, GdkEventButton *event, PidginStatusBox *status_box)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1676 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1677 GtkTreePath *path = NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1678 int ret;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1679 GtkWidget *ewidget = gtk_get_event_widget ((GdkEvent *)event);
15938
d04878ce947b Some pixmap path fixes and win32 fixes
Daniel Atallah <daniel.atallah@gmail.com>
parents: 15880
diff changeset
1680
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1681 if (ewidget != status_box->tree_view) {
15938
d04878ce947b Some pixmap path fixes and win32 fixes
Daniel Atallah <daniel.atallah@gmail.com>
parents: 15880
diff changeset
1682 if (ewidget == status_box->toggle_button &&
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1683 status_box->popup_in_progress &&
17038
2c5654d1a17a disapproval of revision '105009e066f1bcaefb0af3bd1e17b7860bf12a57'
Daniel Atallah <daniel.atallah@gmail.com>
parents: 17037
diff changeset
1684 gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (status_box->toggle_button))) {
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15493
diff changeset
1685 pidgin_status_box_popdown (status_box);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1686 return TRUE;
19482
3b61b5279a56 Allow you to click on statusbox again and keep it open.
Sean Egan <seanegan@gmail.com>
parents: 19396
diff changeset
1687 } else if (ewidget == status_box->toggle_button) {
3b61b5279a56 Allow you to click on statusbox again and keep it open.
Sean Egan <seanegan@gmail.com>
parents: 19396
diff changeset
1688 status_box->popup_in_progress = TRUE;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1689 }
15938
d04878ce947b Some pixmap path fixes and win32 fixes
Daniel Atallah <daniel.atallah@gmail.com>
parents: 15880
diff changeset
1690
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1691 /* released outside treeview */
19482
3b61b5279a56 Allow you to click on statusbox again and keep it open.
Sean Egan <seanegan@gmail.com>
parents: 19396
diff changeset
1692 if (ewidget != status_box->toggle_button) {
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15493
diff changeset
1693 pidgin_status_box_popdown (status_box);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1694 return TRUE;
19482
3b61b5279a56 Allow you to click on statusbox again and keep it open.
Sean Egan <seanegan@gmail.com>
parents: 19396
diff changeset
1695 }
15938
d04878ce947b Some pixmap path fixes and win32 fixes
Daniel Atallah <daniel.atallah@gmail.com>
parents: 15880
diff changeset
1696
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1697 return FALSE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1698 }
15938
d04878ce947b Some pixmap path fixes and win32 fixes
Daniel Atallah <daniel.atallah@gmail.com>
parents: 15880
diff changeset
1699
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1700 ret = gtk_tree_view_get_path_at_pos (GTK_TREE_VIEW (status_box->tree_view),
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1701 event->x, event->y,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1702 &path,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1703 NULL, NULL, NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1704
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1705 if (!ret)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1706 return TRUE; /* clicked outside window? */
15938
d04878ce947b Some pixmap path fixes and win32 fixes
Daniel Atallah <daniel.atallah@gmail.com>
parents: 15880
diff changeset
1707
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1708 treeview_activate_current_selection(status_box, path);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1709 gtk_tree_path_free (path);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1710
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1711 return TRUE;
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
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1714 static gboolean
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1715 treeview_key_press_event(GtkWidget *widget,
15514
535f002e7b0f More pidgin changes
Sean Egan <seanegan@gmail.com>
parents: 15507
diff changeset
1716 GdkEventKey *event, PidginStatusBox *box)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1717 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1718 if (box->popup_in_progress) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1719 if (event->keyval == GDK_Escape) {
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15493
diff changeset
1720 pidgin_status_box_popdown(box);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1721 return TRUE;
18111
02f39842d28b fixes #590 by allowing one to use the delete key to delete transient status,
Ka-Hing Cheung <khc@hxbc.us>
parents: 18058
diff changeset
1722 } else {
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1723 GtkTreeSelection *sel = gtk_tree_view_get_selection(GTK_TREE_VIEW(box->tree_view));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1724 GtkTreeIter iter;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1725 GtkTreePath *path;
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 if (gtk_tree_selection_get_selected(sel, NULL, &iter)) {
18196
a4dee68e040f Let non-delete keys operate.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18193
diff changeset
1728 gboolean ret = TRUE;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1729 path = gtk_tree_model_get_path(GTK_TREE_MODEL(box->dropdown_store), &iter);
18111
02f39842d28b fixes #590 by allowing one to use the delete key to delete transient status,
Ka-Hing Cheung <khc@hxbc.us>
parents: 18058
diff changeset
1730 if (event->keyval == GDK_Return) {
02f39842d28b fixes #590 by allowing one to use the delete key to delete transient status,
Ka-Hing Cheung <khc@hxbc.us>
parents: 18058
diff changeset
1731 treeview_activate_current_selection(box, path);
02f39842d28b fixes #590 by allowing one to use the delete key to delete transient status,
Ka-Hing Cheung <khc@hxbc.us>
parents: 18058
diff changeset
1732 } else if (event->keyval == GDK_Delete) {
02f39842d28b fixes #590 by allowing one to use the delete key to delete transient status,
Ka-Hing Cheung <khc@hxbc.us>
parents: 18058
diff changeset
1733 tree_view_delete_current_selection(box, path);
18196
a4dee68e040f Let non-delete keys operate.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18193
diff changeset
1734 } else
a4dee68e040f Let non-delete keys operate.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18193
diff changeset
1735 ret = FALSE;
18111
02f39842d28b fixes #590 by allowing one to use the delete key to delete transient status,
Ka-Hing Cheung <khc@hxbc.us>
parents: 18058
diff changeset
1736
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1737 gtk_tree_path_free (path);
18196
a4dee68e040f Let non-delete keys operate.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18193
diff changeset
1738 return ret;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1739 }
18111
02f39842d28b fixes #590 by allowing one to use the delete key to delete transient status,
Ka-Hing Cheung <khc@hxbc.us>
parents: 18058
diff changeset
1740 }
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1741 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1742 return FALSE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1743 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1744
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1745 static void
22722
0ccc0e9ae565 Reset typing timeout if arrow keys are pressed when editing status
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 22682
diff changeset
1746 imhtml_cursor_moved_cb(gpointer data, GtkMovementStep step, gint count, gboolean extend,
0ccc0e9ae565 Reset typing timeout if arrow keys are pressed when editing status
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 22682
diff changeset
1747 GtkWidget *widget)
0ccc0e9ae565 Reset typing timeout if arrow keys are pressed when editing status
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 22682
diff changeset
1748 {
0ccc0e9ae565 Reset typing timeout if arrow keys are pressed when editing status
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 22682
diff changeset
1749 /* Restart the typing timeout if arrow keys are pressed while editing the message */
0ccc0e9ae565 Reset typing timeout if arrow keys are pressed when editing status
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 22682
diff changeset
1750 PidginStatusBox *status_box = data;
0ccc0e9ae565 Reset typing timeout if arrow keys are pressed when editing status
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 22682
diff changeset
1751 if (status_box->typing == 0)
0ccc0e9ae565 Reset typing timeout if arrow keys are pressed when editing status
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 22682
diff changeset
1752 return;
0ccc0e9ae565 Reset typing timeout if arrow keys are pressed when editing status
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 22682
diff changeset
1753 imhtml_changed_cb(NULL, status_box);
0ccc0e9ae565 Reset typing timeout if arrow keys are pressed when editing status
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 22682
diff changeset
1754 }
0ccc0e9ae565 Reset typing timeout if arrow keys are pressed when editing status
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 22682
diff changeset
1755
0ccc0e9ae565 Reset typing timeout if arrow keys are pressed when editing status
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 22682
diff changeset
1756 static void
23264
07aa8e4a262a Arrow keys in status menu should skip separator lines. Closes #1360.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 22835
diff changeset
1757 treeview_cursor_changed_cb(GtkTreeView *treeview, gpointer data)
07aa8e4a262a Arrow keys in status menu should skip separator lines. Closes #1360.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 22835
diff changeset
1758 {
07aa8e4a262a Arrow keys in status menu should skip separator lines. Closes #1360.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 22835
diff changeset
1759 GtkTreeSelection *sel = gtk_tree_view_get_selection (treeview);
07aa8e4a262a Arrow keys in status menu should skip separator lines. Closes #1360.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 22835
diff changeset
1760 GtkTreeModel *model = GTK_TREE_MODEL (data);
07aa8e4a262a Arrow keys in status menu should skip separator lines. Closes #1360.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 22835
diff changeset
1761 GtkTreeIter iter;
07aa8e4a262a Arrow keys in status menu should skip separator lines. Closes #1360.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 22835
diff changeset
1762 GtkTreePath *cursor;
07aa8e4a262a Arrow keys in status menu should skip separator lines. Closes #1360.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 22835
diff changeset
1763 GtkTreePath *selection;
07aa8e4a262a Arrow keys in status menu should skip separator lines. Closes #1360.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 22835
diff changeset
1764 gint cmp;
07aa8e4a262a Arrow keys in status menu should skip separator lines. Closes #1360.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 22835
diff changeset
1765
07aa8e4a262a Arrow keys in status menu should skip separator lines. Closes #1360.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 22835
diff changeset
1766 if (gtk_tree_selection_get_selected (sel, NULL, &iter)) {
07aa8e4a262a Arrow keys in status menu should skip separator lines. Closes #1360.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 22835
diff changeset
1767 if ((selection = gtk_tree_model_get_path (model, &iter)) == NULL) {
07aa8e4a262a Arrow keys in status menu should skip separator lines. Closes #1360.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 22835
diff changeset
1768 /* Shouldn't happen, but ignore anyway */
07aa8e4a262a Arrow keys in status menu should skip separator lines. Closes #1360.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 22835
diff changeset
1769 return;
07aa8e4a262a Arrow keys in status menu should skip separator lines. Closes #1360.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 22835
diff changeset
1770 }
07aa8e4a262a Arrow keys in status menu should skip separator lines. Closes #1360.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 22835
diff changeset
1771 } else {
07aa8e4a262a Arrow keys in status menu should skip separator lines. Closes #1360.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 22835
diff changeset
1772 /* I don't think this can happen, but we'll just ignore it */
07aa8e4a262a Arrow keys in status menu should skip separator lines. Closes #1360.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 22835
diff changeset
1773 return;
07aa8e4a262a Arrow keys in status menu should skip separator lines. Closes #1360.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 22835
diff changeset
1774 }
07aa8e4a262a Arrow keys in status menu should skip separator lines. Closes #1360.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 22835
diff changeset
1775
07aa8e4a262a Arrow keys in status menu should skip separator lines. Closes #1360.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 22835
diff changeset
1776 gtk_tree_view_get_cursor (treeview, &cursor, NULL);
07aa8e4a262a Arrow keys in status menu should skip separator lines. Closes #1360.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 22835
diff changeset
1777 if (cursor == NULL) {
07aa8e4a262a Arrow keys in status menu should skip separator lines. Closes #1360.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 22835
diff changeset
1778 /* Probably won't happen in a 'cursor-changed' event? */
07aa8e4a262a Arrow keys in status menu should skip separator lines. Closes #1360.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 22835
diff changeset
1779 gtk_tree_path_free (selection);
07aa8e4a262a Arrow keys in status menu should skip separator lines. Closes #1360.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 22835
diff changeset
1780 return;
07aa8e4a262a Arrow keys in status menu should skip separator lines. Closes #1360.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 22835
diff changeset
1781 }
07aa8e4a262a Arrow keys in status menu should skip separator lines. Closes #1360.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 22835
diff changeset
1782
07aa8e4a262a Arrow keys in status menu should skip separator lines. Closes #1360.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 22835
diff changeset
1783 cmp = gtk_tree_path_compare (cursor, selection);
07aa8e4a262a Arrow keys in status menu should skip separator lines. Closes #1360.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 22835
diff changeset
1784 if (cmp < 0) {
07aa8e4a262a Arrow keys in status menu should skip separator lines. Closes #1360.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 22835
diff changeset
1785 /* The cursor moved up without moving the selection, so move it up again */
07aa8e4a262a Arrow keys in status menu should skip separator lines. Closes #1360.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 22835
diff changeset
1786 gtk_tree_path_prev (cursor);
07aa8e4a262a Arrow keys in status menu should skip separator lines. Closes #1360.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 22835
diff changeset
1787 gtk_tree_view_set_cursor (treeview, cursor, NULL, FALSE);
07aa8e4a262a Arrow keys in status menu should skip separator lines. Closes #1360.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 22835
diff changeset
1788 } else if (cmp > 0) {
07aa8e4a262a Arrow keys in status menu should skip separator lines. Closes #1360.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 22835
diff changeset
1789 /* The cursor moved down without moving the selection, so move it down again */
07aa8e4a262a Arrow keys in status menu should skip separator lines. Closes #1360.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 22835
diff changeset
1790 gtk_tree_path_next (cursor);
07aa8e4a262a Arrow keys in status menu should skip separator lines. Closes #1360.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 22835
diff changeset
1791 gtk_tree_view_set_cursor (treeview, cursor, NULL, FALSE);
07aa8e4a262a Arrow keys in status menu should skip separator lines. Closes #1360.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 22835
diff changeset
1792 }
07aa8e4a262a Arrow keys in status menu should skip separator lines. Closes #1360.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 22835
diff changeset
1793
07aa8e4a262a Arrow keys in status menu should skip separator lines. Closes #1360.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 22835
diff changeset
1794 gtk_tree_path_free (selection);
07aa8e4a262a Arrow keys in status menu should skip separator lines. Closes #1360.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 22835
diff changeset
1795 gtk_tree_path_free (cursor);
07aa8e4a262a Arrow keys in status menu should skip separator lines. Closes #1360.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 22835
diff changeset
1796 }
07aa8e4a262a Arrow keys in status menu should skip separator lines. Closes #1360.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 22835
diff changeset
1797
07aa8e4a262a Arrow keys in status menu should skip separator lines. Closes #1360.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 22835
diff changeset
1798 static void
15514
535f002e7b0f More pidgin changes
Sean Egan <seanegan@gmail.com>
parents: 15507
diff changeset
1799 pidgin_status_box_init (PidginStatusBox *status_box)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1800 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1801 GtkCellRenderer *text_rend;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1802 GtkCellRenderer *icon_rend;
16296
78f798d99d3a Saved icon for saved statuses in statusbox
Sean Egan <seanegan@gmail.com>
parents: 16270
diff changeset
1803 GtkCellRenderer *emblem_rend;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1804 GtkTextBuffer *buffer;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1805 GtkWidget *toplevel;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1806 GtkTreeSelection *sel;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1807
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1808 GTK_WIDGET_SET_FLAGS (status_box, GTK_NO_WINDOW);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1809 status_box->imhtml_visible = FALSE;
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1810 status_box->network_available = purple_network_is_available();
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1811 status_box->connecting = FALSE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1812 status_box->typing = 0;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1813 status_box->toggle_button = gtk_toggle_button_new();
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1814 status_box->hbox = gtk_hbox_new(FALSE, 6);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1815 status_box->cell_view = gtk_cell_view_new();
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1816 status_box->vsep = gtk_vseparator_new();
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1817 status_box->arrow = gtk_arrow_new (GTK_ARROW_DOWN, GTK_SHADOW_NONE);
15938
d04878ce947b Some pixmap path fixes and win32 fixes
Daniel Atallah <daniel.atallah@gmail.com>
parents: 15880
diff changeset
1818
16296
78f798d99d3a Saved icon for saved statuses in statusbox
Sean Egan <seanegan@gmail.com>
parents: 16270
diff changeset
1819 status_box->store = gtk_list_store_new(NUM_COLUMNS, G_TYPE_INT, GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_STRING,
21959
d3a4c98c01b7 Show the prpl icon in the account-specific statusboxes to avoid ambiguity.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 21913
diff changeset
1820 G_TYPE_STRING, G_TYPE_POINTER, GDK_TYPE_PIXBUF, G_TYPE_BOOLEAN);
16296
78f798d99d3a Saved icon for saved statuses in statusbox
Sean Egan <seanegan@gmail.com>
parents: 16270
diff changeset
1821 status_box->dropdown_store = gtk_list_store_new(NUM_COLUMNS, G_TYPE_INT, GDK_TYPE_PIXBUF, G_TYPE_STRING,
78f798d99d3a Saved icon for saved statuses in statusbox
Sean Egan <seanegan@gmail.com>
parents: 16270
diff changeset
1822 G_TYPE_STRING, G_TYPE_STRING, G_TYPE_POINTER, G_TYPE_STRING, G_TYPE_BOOLEAN);
78f798d99d3a Saved icon for saved statuses in statusbox
Sean Egan <seanegan@gmail.com>
parents: 16270
diff changeset
1823
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1824 gtk_cell_view_set_model(GTK_CELL_VIEW(status_box->cell_view), GTK_TREE_MODEL(status_box->store));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1825 gtk_list_store_append(status_box->store, &(status_box->iter));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1826
22682
72141dd0f8c0 Give a name to the statusbox button so that it can be accessible by
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 22676
diff changeset
1827 atk_object_set_name(gtk_widget_get_accessible(status_box->toggle_button), _("Status Selector"));
72141dd0f8c0 Give a name to the statusbox button so that it can be accessible by
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 22676
diff changeset
1828
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1829 gtk_container_add(GTK_CONTAINER(status_box->toggle_button), status_box->hbox);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1830 gtk_box_pack_start(GTK_BOX(status_box->hbox), status_box->cell_view, TRUE, TRUE, 0);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1831 gtk_box_pack_start(GTK_BOX(status_box->hbox), status_box->vsep, FALSE, FALSE, 0);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1832 gtk_box_pack_start(GTK_BOX(status_box->hbox), status_box->arrow, FALSE, FALSE, 0);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1833 gtk_widget_show_all(status_box->toggle_button);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1834 #if GTK_CHECK_VERSION(2,4,0)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1835 gtk_button_set_focus_on_click(GTK_BUTTON(status_box->toggle_button), FALSE);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1836 #endif
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1837
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1838 text_rend = gtk_cell_renderer_text_new();
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1839 icon_rend = gtk_cell_renderer_pixbuf_new();
16296
78f798d99d3a Saved icon for saved statuses in statusbox
Sean Egan <seanegan@gmail.com>
parents: 16270
diff changeset
1840 emblem_rend = gtk_cell_renderer_pixbuf_new();
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1841 status_box->popup_window = gtk_window_new (GTK_WINDOW_POPUP);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1842
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1843 toplevel = gtk_widget_get_toplevel (GTK_WIDGET (status_box));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1844 if (GTK_IS_WINDOW (toplevel)) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1845 gtk_window_set_transient_for (GTK_WINDOW (status_box->popup_window),
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1846 GTK_WINDOW (toplevel));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1847 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1848
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1849 gtk_window_set_resizable (GTK_WINDOW (status_box->popup_window), FALSE);
22470
d5d95a852a1c Danny Baumann pointed out that the status box menu should have the appropriate
Will Thompson <will.thompson@collabora.co.uk>
parents: 22183
diff changeset
1850 #if GTK_CHECK_VERSION(2,10,0)
d5d95a852a1c Danny Baumann pointed out that the status box menu should have the appropriate
Will Thompson <will.thompson@collabora.co.uk>
parents: 22183
diff changeset
1851 gtk_window_set_type_hint (GTK_WINDOW (status_box->popup_window),
d5d95a852a1c Danny Baumann pointed out that the status box menu should have the appropriate
Will Thompson <will.thompson@collabora.co.uk>
parents: 22183
diff changeset
1852 GDK_WINDOW_TYPE_HINT_POPUP_MENU);
d5d95a852a1c Danny Baumann pointed out that the status box menu should have the appropriate
Will Thompson <will.thompson@collabora.co.uk>
parents: 22183
diff changeset
1853 #endif
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1854 #if GTK_CHECK_VERSION(2,2,0)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1855 gtk_window_set_screen (GTK_WINDOW (status_box->popup_window),
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1856 gtk_widget_get_screen (GTK_WIDGET (status_box)));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1857 #endif
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1858 status_box->popup_frame = gtk_frame_new (NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1859 gtk_frame_set_shadow_type (GTK_FRAME (status_box->popup_frame),
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1860 GTK_SHADOW_ETCHED_IN);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1861 gtk_container_add (GTK_CONTAINER (status_box->popup_window),
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1862 status_box->popup_frame);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1863
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1864 gtk_widget_show (status_box->popup_frame);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1865
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1866 status_box->scrolled_window = gtk_scrolled_window_new (NULL, NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1867
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1868 gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (status_box->scrolled_window),
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1869 GTK_POLICY_NEVER,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1870 GTK_POLICY_NEVER);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1871 gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (status_box->scrolled_window),
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1872 GTK_SHADOW_NONE);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1873
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1874 gtk_widget_show (status_box->scrolled_window);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1875
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1876 gtk_container_add (GTK_CONTAINER (status_box->popup_frame),
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1877 status_box->scrolled_window);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1878
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1879 status_box->tree_view = gtk_tree_view_new ();
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1880 sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (status_box->tree_view));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1881 gtk_tree_selection_set_mode (sel, GTK_SELECTION_BROWSE);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1882 gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (status_box->tree_view),
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1883 FALSE);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1884 #if GTK_CHECK_VERSION(2,6,0)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1885 gtk_tree_view_set_hover_selection (GTK_TREE_VIEW (status_box->tree_view),
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1886 TRUE);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1887 #endif
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1888 gtk_tree_view_set_model (GTK_TREE_VIEW (status_box->tree_view),
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1889 GTK_TREE_MODEL(status_box->dropdown_store));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1890 status_box->column = gtk_tree_view_column_new ();
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1891 gtk_tree_view_append_column (GTK_TREE_VIEW (status_box->tree_view),
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1892 status_box->column);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1893 gtk_tree_view_column_pack_start(status_box->column, icon_rend, FALSE);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1894 gtk_tree_view_column_pack_start(status_box->column, text_rend, TRUE);
16296
78f798d99d3a Saved icon for saved statuses in statusbox
Sean Egan <seanegan@gmail.com>
parents: 16270
diff changeset
1895 gtk_tree_view_column_pack_start(status_box->column, emblem_rend, FALSE);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1896 gtk_tree_view_column_set_attributes(status_box->column, icon_rend, "pixbuf", ICON_COLUMN, NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1897 gtk_tree_view_column_set_attributes(status_box->column, text_rend, "markup", TEXT_COLUMN, NULL);
16296
78f798d99d3a Saved icon for saved statuses in statusbox
Sean Egan <seanegan@gmail.com>
parents: 16270
diff changeset
1898 gtk_tree_view_column_set_attributes(status_box->column, emblem_rend, "stock-id", EMBLEM_COLUMN, "visible", EMBLEM_VISIBLE_COLUMN, NULL);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1899 gtk_container_add(GTK_CONTAINER(status_box->scrolled_window), status_box->tree_view);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1900 gtk_widget_show(status_box->tree_view);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1901 gtk_tree_view_set_search_column(GTK_TREE_VIEW(status_box->tree_view), TEXT_COLUMN);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1902 gtk_tree_view_set_search_equal_func(GTK_TREE_VIEW(status_box->tree_view),
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15493
diff changeset
1903 pidgin_tree_view_search_equal_func, NULL, NULL);
15938
d04878ce947b Some pixmap path fixes and win32 fixes
Daniel Atallah <daniel.atallah@gmail.com>
parents: 15880
diff changeset
1904
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1905 #if GTK_CHECK_VERSION(2, 6, 0)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1906 g_object_set(text_rend, "ellipsize", PANGO_ELLIPSIZE_END, NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1907 #endif
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1908
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1909 status_box->icon_rend = gtk_cell_renderer_pixbuf_new();
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1910 status_box->text_rend = gtk_cell_renderer_text_new();
21959
d3a4c98c01b7 Show the prpl icon in the account-specific statusboxes to avoid ambiguity.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 21913
diff changeset
1911 emblem_rend = gtk_cell_renderer_pixbuf_new();
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1912 gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(status_box->cell_view), status_box->icon_rend, FALSE);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1913 gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(status_box->cell_view), status_box->text_rend, TRUE);
21959
d3a4c98c01b7 Show the prpl icon in the account-specific statusboxes to avoid ambiguity.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 21913
diff changeset
1914 gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(status_box->cell_view), emblem_rend, FALSE);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1915 gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(status_box->cell_view), status_box->icon_rend, "pixbuf", ICON_COLUMN, NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1916 gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(status_box->cell_view), status_box->text_rend, "markup", TEXT_COLUMN, NULL);
21959
d3a4c98c01b7 Show the prpl icon in the account-specific statusboxes to avoid ambiguity.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 21913
diff changeset
1917 gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(status_box->cell_view), emblem_rend, "pixbuf", EMBLEM_COLUMN, "visible", EMBLEM_VISIBLE_COLUMN, NULL);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1918 #if GTK_CHECK_VERSION(2, 6, 0)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1919 g_object_set(status_box->text_rend, "ellipsize", PANGO_ELLIPSIZE_END, NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1920 #endif
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1921
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1922 status_box->vbox = gtk_vbox_new(0, FALSE);
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15493
diff changeset
1923 status_box->sw = pidgin_create_imhtml(FALSE, &status_box->imhtml, NULL, NULL);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1924 gtk_imhtml_set_editable(GTK_IMHTML(status_box->imhtml), TRUE);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1925
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1926 buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(status_box->imhtml));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1927 #if 0
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1928 g_signal_connect(G_OBJECT(status_box->toggle_button), "button-press-event",
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1929 G_CALLBACK(button_pressed_cb), status_box);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1930 g_signal_connect(G_OBJECT(status_box->toggle_button), "button-release-event",
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1931 G_CALLBACK(button_released_cb), status_box);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1932 #endif
20322
aad0f10eb4dc applied changes from 1bdf4754abed6b49eec400ecf415a9d557bc9834
Luke Schierer <lschiere@pidgin.im>
parents: 20074
diff changeset
1933 g_signal_connect(G_OBJECT(status_box->toggle_button), "key-press-event",
aad0f10eb4dc applied changes from 1bdf4754abed6b49eec400ecf415a9d557bc9834
Luke Schierer <lschiere@pidgin.im>
parents: 20074
diff changeset
1934 G_CALLBACK(toggle_key_press_cb), status_box);
19396
52c503319f56 Bring up statusbox menu on button-down instead of button-up. Fixes #1437
Sean Egan <seanegan@gmail.com>
parents: 19333
diff changeset
1935 g_signal_connect(G_OBJECT(status_box->toggle_button), "button-press-event",
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1936 G_CALLBACK(toggled_cb), status_box);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1937 g_signal_connect(G_OBJECT(buffer), "changed", G_CALLBACK(imhtml_changed_cb), status_box);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1938 g_signal_connect(G_OBJECT(status_box->imhtml), "format_function_toggle",
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1939 G_CALLBACK(imhtml_format_changed_cb), status_box);
22722
0ccc0e9ae565 Reset typing timeout if arrow keys are pressed when editing status
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 22682
diff changeset
1940 g_signal_connect_swapped(G_OBJECT(status_box->imhtml), "move_cursor",
0ccc0e9ae565 Reset typing timeout if arrow keys are pressed when editing status
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 22682
diff changeset
1941 G_CALLBACK(imhtml_cursor_moved_cb), status_box);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1942 g_signal_connect(G_OBJECT(status_box->imhtml), "key_press_event",
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1943 G_CALLBACK(imhtml_remove_focus), status_box);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1944 g_signal_connect_swapped(G_OBJECT(status_box->imhtml), "message_send", G_CALLBACK(remove_typing_cb), status_box);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1945 gtk_imhtml_set_editable(GTK_IMHTML(status_box->imhtml), TRUE);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1946 #ifdef USE_GTKSPELL
16062
07554cc5d090 Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <stu@nosnilmot.com>
parents: 15938
diff changeset
1947 if (purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/conversations/spellcheck"))
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15493
diff changeset
1948 pidgin_setup_gtkspell(GTK_TEXT_VIEW(status_box->imhtml));
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1949 #endif
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1950 gtk_widget_set_parent(status_box->vbox, GTK_WIDGET(status_box));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1951 gtk_widget_show_all(status_box->vbox);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1952
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1953 gtk_widget_set_parent(status_box->toggle_button, GTK_WIDGET(status_box));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1954
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1955 gtk_box_pack_start(GTK_BOX(status_box->vbox), status_box->sw, TRUE, TRUE, 0);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1956
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1957 g_signal_connect(G_OBJECT(status_box), "scroll_event", G_CALLBACK(combo_box_scroll_event_cb), NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1958 g_signal_connect(G_OBJECT(status_box->imhtml), "scroll_event",
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1959 G_CALLBACK(imhtml_scroll_event_cb), status_box->imhtml);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1960 g_signal_connect(G_OBJECT(status_box->popup_window), "button_release_event", G_CALLBACK(treeview_button_release_cb), status_box);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1961 g_signal_connect(G_OBJECT(status_box->popup_window), "key_press_event", G_CALLBACK(treeview_key_press_event), status_box);
23264
07aa8e4a262a Arrow keys in status menu should skip separator lines. Closes #1360.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 22835
diff changeset
1962 g_signal_connect(G_OBJECT(status_box->tree_view), "cursor-changed",
07aa8e4a262a Arrow keys in status menu should skip separator lines. Closes #1360.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 22835
diff changeset
1963 G_CALLBACK(treeview_cursor_changed_cb), status_box->dropdown_store);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1964
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1965 #if GTK_CHECK_VERSION(2,6,0)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1966 gtk_tree_view_set_row_separator_func(GTK_TREE_VIEW(status_box->tree_view), dropdown_store_row_separator_func, NULL, NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1967 #endif
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1968
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1969 status_box->token_status_account = check_active_accounts_for_identical_statuses();
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1970
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1971 cache_pixbufs(status_box);
15514
535f002e7b0f More pidgin changes
Sean Egan <seanegan@gmail.com>
parents: 15507
diff changeset
1972 pidgin_status_box_regenerate(status_box);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1973
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1974 purple_signal_connect(purple_savedstatuses_get_handle(), "savedstatus-changed",
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1975 status_box,
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1976 PURPLE_CALLBACK(current_savedstatus_changed_cb),
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1977 status_box);
18111
02f39842d28b fixes #590 by allowing one to use the delete key to delete transient status,
Ka-Hing Cheung <khc@hxbc.us>
parents: 18058
diff changeset
1978 purple_signal_connect(purple_savedstatuses_get_handle(),
02f39842d28b fixes #590 by allowing one to use the delete key to delete transient status,
Ka-Hing Cheung <khc@hxbc.us>
parents: 18058
diff changeset
1979 "savedstatus-added", status_box,
02f39842d28b fixes #590 by allowing one to use the delete key to delete transient status,
Ka-Hing Cheung <khc@hxbc.us>
parents: 18058
diff changeset
1980 PURPLE_CALLBACK(saved_status_updated_cb), status_box);
02f39842d28b fixes #590 by allowing one to use the delete key to delete transient status,
Ka-Hing Cheung <khc@hxbc.us>
parents: 18058
diff changeset
1981 purple_signal_connect(purple_savedstatuses_get_handle(),
02f39842d28b fixes #590 by allowing one to use the delete key to delete transient status,
Ka-Hing Cheung <khc@hxbc.us>
parents: 18058
diff changeset
1982 "savedstatus-deleted", status_box,
02f39842d28b fixes #590 by allowing one to use the delete key to delete transient status,
Ka-Hing Cheung <khc@hxbc.us>
parents: 18058
diff changeset
1983 PURPLE_CALLBACK(saved_status_updated_cb), status_box);
02f39842d28b fixes #590 by allowing one to use the delete key to delete transient status,
Ka-Hing Cheung <khc@hxbc.us>
parents: 18058
diff changeset
1984 purple_signal_connect(purple_savedstatuses_get_handle(),
02f39842d28b fixes #590 by allowing one to use the delete key to delete transient status,
Ka-Hing Cheung <khc@hxbc.us>
parents: 18058
diff changeset
1985 "savedstatus-modified", status_box,
02f39842d28b fixes #590 by allowing one to use the delete key to delete transient status,
Ka-Hing Cheung <khc@hxbc.us>
parents: 18058
diff changeset
1986 PURPLE_CALLBACK(saved_status_updated_cb), status_box);
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1987 purple_signal_connect(purple_accounts_get_handle(), "account-enabled", status_box,
17038
2c5654d1a17a disapproval of revision '105009e066f1bcaefb0af3bd1e17b7860bf12a57'
Daniel Atallah <daniel.atallah@gmail.com>
parents: 17037
diff changeset
1988 PURPLE_CALLBACK(account_enabled_cb),
2c5654d1a17a disapproval of revision '105009e066f1bcaefb0af3bd1e17b7860bf12a57'
Daniel Atallah <daniel.atallah@gmail.com>
parents: 17037
diff changeset
1989 status_box);
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1990 purple_signal_connect(purple_accounts_get_handle(), "account-disabled", status_box,
17038
2c5654d1a17a disapproval of revision '105009e066f1bcaefb0af3bd1e17b7860bf12a57'
Daniel Atallah <daniel.atallah@gmail.com>
parents: 17037
diff changeset
1991 PURPLE_CALLBACK(account_enabled_cb),
2c5654d1a17a disapproval of revision '105009e066f1bcaefb0af3bd1e17b7860bf12a57'
Daniel Atallah <daniel.atallah@gmail.com>
parents: 17037
diff changeset
1992 status_box);
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
1993 purple_signal_connect(purple_accounts_get_handle(), "account-status-changed", status_box,
17038
2c5654d1a17a disapproval of revision '105009e066f1bcaefb0af3bd1e17b7860bf12a57'
Daniel Atallah <daniel.atallah@gmail.com>
parents: 17037
diff changeset
1994 PURPLE_CALLBACK(account_status_changed_cb),
2c5654d1a17a disapproval of revision '105009e066f1bcaefb0af3bd1e17b7860bf12a57'
Daniel Atallah <daniel.atallah@gmail.com>
parents: 17037
diff changeset
1995 status_box);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1996
16062
07554cc5d090 Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <stu@nosnilmot.com>
parents: 15938
diff changeset
1997 purple_prefs_connect_callback(status_box, PIDGIN_PREFS_ROOT "/conversations/spellcheck",
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1998 spellcheck_prefs_cb, status_box);
16062
07554cc5d090 Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <stu@nosnilmot.com>
parents: 15938
diff changeset
1999 purple_prefs_connect_callback(status_box, PIDGIN_PREFS_ROOT "/accounts/buddyicon",
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2000 update_buddyicon_cb, status_box);
15824
ed80ec6be33c who knew that --disable-plugins still worked?! Also, some completely untested support for aim:buddyicon, which I'll look at more tomorrow
Sean Egan <seanegan@gmail.com>
parents: 15823
diff changeset
2001 purple_signal_connect(purple_get_core(), "uri-handler", status_box,
ed80ec6be33c who knew that --disable-plugins still worked?! Also, some completely untested support for aim:buddyicon, which I'll look at more tomorrow
Sean Egan <seanegan@gmail.com>
parents: 15823
diff changeset
2002 PURPLE_CALLBACK(statusbox_uri_handler), status_box);
ed80ec6be33c who knew that --disable-plugins still worked?! Also, some completely untested support for aim:buddyicon, which I'll look at more tomorrow
Sean Egan <seanegan@gmail.com>
parents: 15823
diff changeset
2003
15374
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 static void
15514
535f002e7b0f More pidgin changes
Sean Egan <seanegan@gmail.com>
parents: 15507
diff changeset
2007 pidgin_status_box_size_request(GtkWidget *widget,
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2008 GtkRequisition *requisition)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2009 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2010 GtkRequisition box_req;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2011 gint border_width = GTK_CONTAINER (widget)->border_width;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2012
15514
535f002e7b0f More pidgin changes
Sean Egan <seanegan@gmail.com>
parents: 15507
diff changeset
2013 gtk_widget_size_request(PIDGIN_STATUS_BOX(widget)->toggle_button, requisition);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2014
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2015 /* Make this icon the same size as other buddy icons in the list; unless it already wants to be bigger */
15413
e6b40365930c More statusbox tweaks:
Sean Egan <seanegan@gmail.com>
parents: 15401
diff changeset
2016 requisition->height = MAX(requisition->height, 34);
e6b40365930c More statusbox tweaks:
Sean Egan <seanegan@gmail.com>
parents: 15401
diff changeset
2017 requisition->height += border_width * 2;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2018
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2019 /* If the gtkimhtml is visible, then add some additional padding */
15514
535f002e7b0f More pidgin changes
Sean Egan <seanegan@gmail.com>
parents: 15507
diff changeset
2020 gtk_widget_size_request(PIDGIN_STATUS_BOX(widget)->vbox, &box_req);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2021 if (box_req.height > 1)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2022 requisition->height += box_req.height + border_width * 2;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2023
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2024 requisition->width = 1;
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
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2027 /* From gnome-panel */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2028 static void
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2029 do_colorshift (GdkPixbuf *dest, GdkPixbuf *src, int shift)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2030 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2031 gint i, j;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2032 gint width, height, has_alpha, srcrowstride, destrowstride;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2033 guchar *target_pixels;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2034 guchar *original_pixels;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2035 guchar *pixsrc;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2036 guchar *pixdest;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2037 int val;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2038 guchar r,g,b;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2039
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2040 has_alpha = gdk_pixbuf_get_has_alpha (src);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2041 width = gdk_pixbuf_get_width (src);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2042 height = gdk_pixbuf_get_height (src);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2043 srcrowstride = gdk_pixbuf_get_rowstride (src);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2044 destrowstride = gdk_pixbuf_get_rowstride (dest);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2045 target_pixels = gdk_pixbuf_get_pixels (dest);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2046 original_pixels = gdk_pixbuf_get_pixels (src);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2047
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2048 for (i = 0; i < height; i++) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2049 pixdest = target_pixels + i*destrowstride;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2050 pixsrc = original_pixels + i*srcrowstride;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2051 for (j = 0; j < width; j++) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2052 r = *(pixsrc++);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2053 g = *(pixsrc++);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2054 b = *(pixsrc++);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2055 val = r + shift;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2056 *(pixdest++) = CLAMP(val, 0, 255);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2057 val = g + shift;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2058 *(pixdest++) = CLAMP(val, 0, 255);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2059 val = b + shift;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2060 *(pixdest++) = CLAMP(val, 0, 255);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2061 if (has_alpha)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2062 *(pixdest++) = *(pixsrc++);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2063 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2064 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2065 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2066
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2067 static void
15514
535f002e7b0f More pidgin changes
Sean Egan <seanegan@gmail.com>
parents: 15507
diff changeset
2068 pidgin_status_box_size_allocate(GtkWidget *widget,
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2069 GtkAllocation *allocation)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2070 {
15514
535f002e7b0f More pidgin changes
Sean Egan <seanegan@gmail.com>
parents: 15507
diff changeset
2071 PidginStatusBox *status_box = PIDGIN_STATUS_BOX(widget);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2072 GtkRequisition req = {0,0};
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2073 GtkAllocation parent_alc, box_alc, icon_alc;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2074 gint border_width = GTK_CONTAINER (widget)->border_width;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2075
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2076 gtk_widget_size_request(status_box->toggle_button, &req);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2077 /* Make this icon the same size as other buddy icons in the list; unless it already wants to be bigger */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2078
15413
e6b40365930c More statusbox tweaks:
Sean Egan <seanegan@gmail.com>
parents: 15401
diff changeset
2079 req.height = MAX(req.height, 34);
e6b40365930c More statusbox tweaks:
Sean Egan <seanegan@gmail.com>
parents: 15401
diff changeset
2080 req.height += border_width * 2;
15374
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 box_alc = *allocation;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2083
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2084 box_alc.width -= (border_width * 2);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2085 box_alc.height = MAX(1, ((allocation->height - req.height) - (border_width*2)));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2086 box_alc.x += border_width;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2087 box_alc.y += req.height + border_width;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2088 gtk_widget_size_allocate(status_box->vbox, &box_alc);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2089
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2090 parent_alc = *allocation;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2091 parent_alc.height = MAX(1,req.height - (border_width *2));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2092 parent_alc.width -= (border_width * 2);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2093 parent_alc.x += border_width;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2094 parent_alc.y += border_width;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2095
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2096 if (status_box->icon_box)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2097 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2098 GtkTextDirection dir = gtk_widget_get_direction(widget);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2099 parent_alc.width -= (parent_alc.height + border_width);
15413
e6b40365930c More statusbox tweaks:
Sean Egan <seanegan@gmail.com>
parents: 15401
diff changeset
2100 icon_alc = parent_alc;
16098
634b96915d2e Death to Binreloc\!
Sean Egan <seanegan@gmail.com>
parents: 16062
diff changeset
2101 icon_alc.height = MAX(1, icon_alc.height) - 2;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2102 icon_alc.width = icon_alc.height;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2103 if (dir == GTK_TEXT_DIR_RTL) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2104 icon_alc.x = parent_alc.x;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2105 parent_alc.x += icon_alc.width + border_width;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2106 } else {
15413
e6b40365930c More statusbox tweaks:
Sean Egan <seanegan@gmail.com>
parents: 15401
diff changeset
2107 icon_alc.x = allocation->width - (icon_alc.width + border_width + 1);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2108 }
15413
e6b40365930c More statusbox tweaks:
Sean Egan <seanegan@gmail.com>
parents: 15401
diff changeset
2109 icon_alc.y += 1;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2110
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2111 if (status_box->icon_size != icon_alc.height)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2112 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2113 status_box->icon_size = icon_alc.height;
15514
535f002e7b0f More pidgin changes
Sean Egan <seanegan@gmail.com>
parents: 15507
diff changeset
2114 pidgin_status_box_redisplay_buddy_icon(status_box);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2115 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2116 gtk_widget_size_allocate(status_box->icon_box, &icon_alc);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2117 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2118 gtk_widget_size_allocate(status_box->toggle_button, &parent_alc);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2119 widget->allocation = *allocation;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2120 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2121
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2122 static gboolean
15514
535f002e7b0f More pidgin changes
Sean Egan <seanegan@gmail.com>
parents: 15507
diff changeset
2123 pidgin_status_box_expose_event(GtkWidget *widget,
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2124 GdkEventExpose *event)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2125 {
15514
535f002e7b0f More pidgin changes
Sean Egan <seanegan@gmail.com>
parents: 15507
diff changeset
2126 PidginStatusBox *status_box = PIDGIN_STATUS_BOX(widget);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2127 gtk_container_propagate_expose(GTK_CONTAINER(widget), status_box->vbox, event);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2128 gtk_container_propagate_expose(GTK_CONTAINER(widget), status_box->toggle_button, event);
15413
e6b40365930c More statusbox tweaks:
Sean Egan <seanegan@gmail.com>
parents: 15401
diff changeset
2129 if (status_box->icon_box && status_box->icon_opaque) {
e6b40365930c More statusbox tweaks:
Sean Egan <seanegan@gmail.com>
parents: 15401
diff changeset
2130 gtk_paint_box(widget->style, widget->window, GTK_STATE_NORMAL, GTK_SHADOW_OUT, NULL,
e6b40365930c More statusbox tweaks:
Sean Egan <seanegan@gmail.com>
parents: 15401
diff changeset
2131 status_box->icon_box, "button", status_box->icon_box->allocation.x-1, status_box->icon_box->allocation.y-1,
e6b40365930c More statusbox tweaks:
Sean Egan <seanegan@gmail.com>
parents: 15401
diff changeset
2132 34, 34);
15938
d04878ce947b Some pixmap path fixes and win32 fixes
Daniel Atallah <daniel.atallah@gmail.com>
parents: 15880
diff changeset
2133 }
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2134 return FALSE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2135 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2136
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2137 static void
15514
535f002e7b0f More pidgin changes
Sean Egan <seanegan@gmail.com>
parents: 15507
diff changeset
2138 pidgin_status_box_forall(GtkContainer *container,
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2139 gboolean include_internals,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2140 GtkCallback callback,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2141 gpointer callback_data)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2142 {
15514
535f002e7b0f More pidgin changes
Sean Egan <seanegan@gmail.com>
parents: 15507
diff changeset
2143 PidginStatusBox *status_box = PIDGIN_STATUS_BOX (container);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2144
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2145 if (include_internals)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2146 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2147 (* callback) (status_box->vbox, callback_data);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2148 (* callback) (status_box->toggle_button, callback_data);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2149 (* callback) (status_box->arrow, callback_data);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2150 if (status_box->icon_box)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2151 (* callback) (status_box->icon_box, callback_data);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2152 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2153 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2154
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2155 GtkWidget *
15514
535f002e7b0f More pidgin changes
Sean Egan <seanegan@gmail.com>
parents: 15507
diff changeset
2156 pidgin_status_box_new()
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2157 {
15514
535f002e7b0f More pidgin changes
Sean Egan <seanegan@gmail.com>
parents: 15507
diff changeset
2158 return g_object_new(PIDGIN_TYPE_STATUS_BOX, "account", NULL,
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2159 "iconsel", TRUE, NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2160 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2161
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2162 GtkWidget *
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
2163 pidgin_status_box_new_with_account(PurpleAccount *account)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2164 {
15514
535f002e7b0f More pidgin changes
Sean Egan <seanegan@gmail.com>
parents: 15507
diff changeset
2165 return g_object_new(PIDGIN_TYPE_STATUS_BOX, "account", account,
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2166 "iconsel", TRUE, NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2167 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2168
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2169 /**
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2170 * Add a row to the dropdown menu.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2171 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2172 * @param status_box The status box itself.
15514
535f002e7b0f More pidgin changes
Sean Egan <seanegan@gmail.com>
parents: 15507
diff changeset
2173 * @param type A PidginStatusBoxItemType.
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2174 * @param pixbuf The icon to associate with this row in the menu.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2175 * @param title The title of this item. For the primitive entries,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2176 * this is something like "Available" or "Away." For
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2177 * the saved statuses, this is something like
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2178 * "My favorite away message!" This should be
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2179 * plaintext (non-markedup) (this function escapes it).
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2180 * @param desc The secondary text for this item. This will be
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2181 * placed on the row below the title, in a dimmer
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2182 * font (generally gray). This text should be plaintext
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2183 * (non-markedup) (this function escapes it).
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2184 * @param data Data to be associated with this row in the dropdown
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2185 * menu. For primitives this is the value of the
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
2186 * PurpleStatusPrimitive. For saved statuses this is the
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2187 * creation timestamp.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2188 */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2189 void
15514
535f002e7b0f More pidgin changes
Sean Egan <seanegan@gmail.com>
parents: 15507
diff changeset
2190 pidgin_status_box_add(PidginStatusBox *status_box, PidginStatusBoxItemType type, GdkPixbuf *pixbuf, const char *title, const char *desc, gpointer data)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2191 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2192 GtkTreeIter iter;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2193 char *text;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2194
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2195 if (desc == NULL)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2196 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2197 text = g_markup_escape_text(title, -1);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2198 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2199 else
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2200 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2201 GtkStyle *style;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2202 char aa_color[8];
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2203 gchar *escaped_title, *escaped_desc;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2204
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2205 style = gtk_widget_get_style(GTK_WIDGET(status_box));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2206 snprintf(aa_color, sizeof(aa_color), "#%02x%02x%02x",
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2207 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
2208 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
2209 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
2210
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2211 escaped_title = g_markup_escape_text(title, -1);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2212 escaped_desc = g_markup_escape_text(desc, -1);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2213 text = g_strdup_printf("%s - <span color=\"%s\" size=\"smaller\">%s</span>",
17038
2c5654d1a17a disapproval of revision '105009e066f1bcaefb0af3bd1e17b7860bf12a57'
Daniel Atallah <daniel.atallah@gmail.com>
parents: 17037
diff changeset
2214 escaped_title,
2c5654d1a17a disapproval of revision '105009e066f1bcaefb0af3bd1e17b7860bf12a57'
Daniel Atallah <daniel.atallah@gmail.com>
parents: 17037
diff changeset
2215 aa_color, escaped_desc);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2216 g_free(escaped_title);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2217 g_free(escaped_desc);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2218 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2219
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2220 gtk_list_store_append(status_box->dropdown_store, &iter);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2221 gtk_list_store_set(status_box->dropdown_store, &iter,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2222 TYPE_COLUMN, type,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2223 ICON_COLUMN, pixbuf,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2224 TEXT_COLUMN, text,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2225 TITLE_COLUMN, title,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2226 DESC_COLUMN, desc,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2227 DATA_COLUMN, data,
16296
78f798d99d3a Saved icon for saved statuses in statusbox
Sean Egan <seanegan@gmail.com>
parents: 16270
diff changeset
2228 EMBLEM_VISIBLE_COLUMN, type == PIDGIN_STATUS_BOX_TYPE_SAVED_POPULAR,
78f798d99d3a Saved icon for saved statuses in statusbox
Sean Egan <seanegan@gmail.com>
parents: 16270
diff changeset
2229 EMBLEM_COLUMN, GTK_STOCK_SAVE,
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2230 -1);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2231 g_free(text);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2232 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2233
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2234 void
15514
535f002e7b0f More pidgin changes
Sean Egan <seanegan@gmail.com>
parents: 15507
diff changeset
2235 pidgin_status_box_add_separator(PidginStatusBox *status_box)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2236 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2237 /* Don't do anything unless GTK actually supports
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2238 * gtk_combo_box_set_row_separator_func */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2239 #if GTK_CHECK_VERSION(2,6,0)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2240 GtkTreeIter iter;
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 gtk_list_store_append(status_box->dropdown_store, &iter);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2243 gtk_list_store_set(status_box->dropdown_store, &iter,
15514
535f002e7b0f More pidgin changes
Sean Egan <seanegan@gmail.com>
parents: 15507
diff changeset
2244 TYPE_COLUMN, PIDGIN_STATUS_BOX_TYPE_SEPARATOR,
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2245 -1);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2246 #endif
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2247 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2248
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2249 void
15514
535f002e7b0f More pidgin changes
Sean Egan <seanegan@gmail.com>
parents: 15507
diff changeset
2250 pidgin_status_box_set_network_available(PidginStatusBox *status_box, gboolean available)
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 (!status_box)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2253 return;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2254 status_box->network_available = available;
15514
535f002e7b0f More pidgin changes
Sean Egan <seanegan@gmail.com>
parents: 15507
diff changeset
2255 pidgin_status_box_refresh(status_box);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2256 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2257
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2258 void
15514
535f002e7b0f More pidgin changes
Sean Egan <seanegan@gmail.com>
parents: 15507
diff changeset
2259 pidgin_status_box_set_connecting(PidginStatusBox *status_box, gboolean connecting)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2260 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2261 if (!status_box)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2262 return;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2263 status_box->connecting = connecting;
15514
535f002e7b0f More pidgin changes
Sean Egan <seanegan@gmail.com>
parents: 15507
diff changeset
2264 pidgin_status_box_refresh(status_box);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2265 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2266
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2267 static void
16563
fb633ba3fb1e This is Sadrul's status-rescale.patch from ticket #314. Luke said it
Richard Laager <rlaager@wiktel.com>
parents: 16483
diff changeset
2268 pixbuf_size_prepared_cb(GdkPixbufLoader *loader, int width, int height, gpointer data)
fb633ba3fb1e This is Sadrul's status-rescale.patch from ticket #314. Luke said it
Richard Laager <rlaager@wiktel.com>
parents: 16483
diff changeset
2269 {
fb633ba3fb1e This is Sadrul's status-rescale.patch from ticket #314. Luke said it
Richard Laager <rlaager@wiktel.com>
parents: 16483
diff changeset
2270 #if GTK_CHECK_VERSION(2,2,0)
fb633ba3fb1e This is Sadrul's status-rescale.patch from ticket #314. Luke said it
Richard Laager <rlaager@wiktel.com>
parents: 16483
diff changeset
2271 int w, h;
fb633ba3fb1e This is Sadrul's status-rescale.patch from ticket #314. Luke said it
Richard Laager <rlaager@wiktel.com>
parents: 16483
diff changeset
2272 GtkIconSize icon_size = gtk_icon_size_from_name(PIDGIN_ICON_SIZE_TANGO_MEDIUM);
fb633ba3fb1e This is Sadrul's status-rescale.patch from ticket #314. Luke said it
Richard Laager <rlaager@wiktel.com>
parents: 16483
diff changeset
2273 gtk_icon_size_lookup(icon_size, &w, &h);
17492
e7595d13fd63 Maintain aspect ratio on global icon selector. Fixes #454
Sean Egan <seanegan@gmail.com>
parents: 17149
diff changeset
2274 if (height > width)
e7595d13fd63 Maintain aspect ratio on global icon selector. Fixes #454
Sean Egan <seanegan@gmail.com>
parents: 17149
diff changeset
2275 w = width * h / height;
e7595d13fd63 Maintain aspect ratio on global icon selector. Fixes #454
Sean Egan <seanegan@gmail.com>
parents: 17149
diff changeset
2276 else if (width > height)
e7595d13fd63 Maintain aspect ratio on global icon selector. Fixes #454
Sean Egan <seanegan@gmail.com>
parents: 17149
diff changeset
2277 h = height * w / width;
16563
fb633ba3fb1e This is Sadrul's status-rescale.patch from ticket #314. Luke said it
Richard Laager <rlaager@wiktel.com>
parents: 16483
diff changeset
2278 gdk_pixbuf_loader_set_size(loader, w, h);
fb633ba3fb1e This is Sadrul's status-rescale.patch from ticket #314. Luke said it
Richard Laager <rlaager@wiktel.com>
parents: 16483
diff changeset
2279 #endif
fb633ba3fb1e This is Sadrul's status-rescale.patch from ticket #314. Luke said it
Richard Laager <rlaager@wiktel.com>
parents: 16483
diff changeset
2280 }
fb633ba3fb1e This is Sadrul's status-rescale.patch from ticket #314. Luke said it
Richard Laager <rlaager@wiktel.com>
parents: 16483
diff changeset
2281
fb633ba3fb1e This is Sadrul's status-rescale.patch from ticket #314. Luke said it
Richard Laager <rlaager@wiktel.com>
parents: 16483
diff changeset
2282 static void
15514
535f002e7b0f More pidgin changes
Sean Egan <seanegan@gmail.com>
parents: 15507
diff changeset
2283 pidgin_status_box_redisplay_buddy_icon(PidginStatusBox *status_box)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2284 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2285
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2286 /* This is sometimes called before the box is shown, and we will not have a size */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2287 if (status_box->icon_size <= 0)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2288 return;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2289
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2290 if (status_box->buddy_icon)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2291 g_object_unref(status_box->buddy_icon);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2292 if (status_box->buddy_icon_hover)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2293 g_object_unref(status_box->buddy_icon_hover);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2294 status_box->buddy_icon = NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2295 status_box->buddy_icon_hover = NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2296
16390
4fc51a87ce42 Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents: 16381
diff changeset
2297 if (status_box->buddy_icon_img != NULL)
4fc51a87ce42 Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents: 16381
diff changeset
2298 {
4fc51a87ce42 Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents: 16381
diff changeset
2299 GdkPixbufLoader *loader = gdk_pixbuf_loader_new();
16563
fb633ba3fb1e This is Sadrul's status-rescale.patch from ticket #314. Luke said it
Richard Laager <rlaager@wiktel.com>
parents: 16483
diff changeset
2300 g_signal_connect(G_OBJECT(loader), "size-prepared", G_CALLBACK(pixbuf_size_prepared_cb), NULL);
16390
4fc51a87ce42 Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents: 16381
diff changeset
2301 gdk_pixbuf_loader_write(loader, purple_imgstore_get_data(status_box->buddy_icon_img),
4fc51a87ce42 Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents: 16381
diff changeset
2302 purple_imgstore_get_size(status_box->buddy_icon_img), NULL);
4fc51a87ce42 Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents: 16381
diff changeset
2303 gdk_pixbuf_loader_close(loader, NULL);
4fc51a87ce42 Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents: 16381
diff changeset
2304 status_box->buddy_icon = gdk_pixbuf_loader_get_pixbuf(loader);
21055
a0b0f988667e Fix some leaks caused by GdkPixbufLoaders not being disposed of.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 20322
diff changeset
2305 if (status_box->buddy_icon)
a0b0f988667e Fix some leaks caused by GdkPixbufLoaders not being disposed of.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 20322
diff changeset
2306 g_object_ref(status_box->buddy_icon);
a0b0f988667e Fix some leaks caused by GdkPixbufLoaders not being disposed of.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 20322
diff changeset
2307 g_object_unref(loader);
16390
4fc51a87ce42 Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents: 16381
diff changeset
2308 }
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2309
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2310 if (status_box->buddy_icon == NULL)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2311 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2312 /* Show a placeholder icon */
16301
c5a8103aa9a4 New select-avatar image from hbons
Stu Tomlinson <stu@nosnilmot.com>
parents: 16296
diff changeset
2313 GtkIconSize icon_size = gtk_icon_size_from_name(PIDGIN_ICON_SIZE_TANGO_SMALL);
16270
ae8a326b091f References #219
Stu Tomlinson <stu@nosnilmot.com>
parents: 16255
diff changeset
2314 status_box->buddy_icon = gtk_widget_render_icon(GTK_WIDGET(status_box),
16301
c5a8103aa9a4 New select-avatar image from hbons
Stu Tomlinson <stu@nosnilmot.com>
parents: 16296
diff changeset
2315 PIDGIN_STOCK_TOOLBAR_SELECT_AVATAR,
16270
ae8a326b091f References #219
Stu Tomlinson <stu@nosnilmot.com>
parents: 16255
diff changeset
2316 icon_size, "PidginStatusBox");
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2317 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2318
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2319 if (status_box->buddy_icon != NULL) {
16563
fb633ba3fb1e This is Sadrul's status-rescale.patch from ticket #314. Luke said it
Richard Laager <rlaager@wiktel.com>
parents: 16483
diff changeset
2320 status_box->icon_opaque = pidgin_gdk_pixbuf_is_opaque(status_box->buddy_icon);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2321 gtk_image_set_from_pixbuf(GTK_IMAGE(status_box->icon), status_box->buddy_icon);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2322 status_box->buddy_icon_hover = gdk_pixbuf_copy(status_box->buddy_icon);
15397
a8ee645e7fb4 A lot of status icon changes:
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2323 do_colorshift(status_box->buddy_icon_hover, status_box->buddy_icon_hover, 32);
15413
e6b40365930c More statusbox tweaks:
Sean Egan <seanegan@gmail.com>
parents: 15401
diff changeset
2324 gtk_widget_queue_resize(GTK_WIDGET(status_box));
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2325 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2326 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2327
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2328 void
16390
4fc51a87ce42 Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents: 16381
diff changeset
2329 pidgin_status_box_set_buddy_icon(PidginStatusBox *status_box, PurpleStoredImage *img)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2330 {
16390
4fc51a87ce42 Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents: 16381
diff changeset
2331 purple_imgstore_unref(status_box->buddy_icon_img);
16652
174d73c90036 Only attempt to ref the statusbox icon image if it's actually set
Mark Doliner <mark@kingant.net>
parents: 16627
diff changeset
2332 status_box->buddy_icon_img = img;
174d73c90036 Only attempt to ref the statusbox icon image if it's actually set
Mark Doliner <mark@kingant.net>
parents: 16627
diff changeset
2333 if (status_box->buddy_icon_img != NULL)
174d73c90036 Only attempt to ref the statusbox icon image if it's actually set
Mark Doliner <mark@kingant.net>
parents: 16627
diff changeset
2334 purple_imgstore_ref(status_box->buddy_icon_img);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2335
15514
535f002e7b0f More pidgin changes
Sean Egan <seanegan@gmail.com>
parents: 15507
diff changeset
2336 pidgin_status_box_redisplay_buddy_icon(status_box);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2337 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2338
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2339 void
15514
535f002e7b0f More pidgin changes
Sean Egan <seanegan@gmail.com>
parents: 15507
diff changeset
2340 pidgin_status_box_pulse_connecting(PidginStatusBox *status_box)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2341 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2342 if (!status_box)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2343 return;
15675
9195abe409de throbber for a connecting icon
Sean Egan <seanegan@gmail.com>
parents: 15669
diff changeset
2344 if (status_box->connecting_index == 8)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2345 status_box->connecting_index = 0;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2346 else
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2347 status_box->connecting_index++;
15514
535f002e7b0f More pidgin changes
Sean Egan <seanegan@gmail.com>
parents: 15507
diff changeset
2348 pidgin_status_box_refresh(status_box);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2349 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2350
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2351 static void
15514
535f002e7b0f More pidgin changes
Sean Egan <seanegan@gmail.com>
parents: 15507
diff changeset
2352 pidgin_status_box_pulse_typing(PidginStatusBox *status_box)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2353 {
15669
603488306e23 more icon updates.
Sean Egan <seanegan@gmail.com>
parents: 15593
diff changeset
2354 if (status_box->typing_index == 4)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2355 status_box->typing_index = 0;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2356 else
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2357 status_box->typing_index++;
15514
535f002e7b0f More pidgin changes
Sean Egan <seanegan@gmail.com>
parents: 15507
diff changeset
2358 pidgin_status_box_refresh(status_box);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2359 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2360
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2361 static gboolean
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2362 message_changed(const char *one, const char *two)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2363 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2364 if (one == NULL && two == NULL)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2365 return FALSE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2366
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2367 if (one == NULL || two == NULL)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2368 return TRUE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2369
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2370 return (g_utf8_collate(one, two) != 0);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2371 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2372
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2373 static void
15514
535f002e7b0f More pidgin changes
Sean Egan <seanegan@gmail.com>
parents: 15507
diff changeset
2374 activate_currently_selected_status(PidginStatusBox *status_box)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2375 {
15514
535f002e7b0f More pidgin changes
Sean Egan <seanegan@gmail.com>
parents: 15507
diff changeset
2376 PidginStatusBoxItemType type;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2377 gpointer data;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2378 gchar *title;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2379 GtkTreeIter iter;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2380 GtkTreePath *path;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2381 char *message;
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
2382 PurpleSavedStatus *saved_status = NULL;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2383 gboolean changed = TRUE;
15938
d04878ce947b Some pixmap path fixes and win32 fixes
Daniel Atallah <daniel.atallah@gmail.com>
parents: 15880
diff changeset
2384
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2385 path = gtk_tree_row_reference_get_path(status_box->active_row);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2386 if (!gtk_tree_model_get_iter (GTK_TREE_MODEL(status_box->dropdown_store), &iter, path))
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2387 return;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2388 gtk_tree_path_free(path);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2389
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2390 gtk_tree_model_get(GTK_TREE_MODEL(status_box->dropdown_store), &iter,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2391 TYPE_COLUMN, &type,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2392 DATA_COLUMN, &data,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2393 -1);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2394
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2395 /*
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2396 * If the currently selected status is "New..." or
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2397 * "Saved..." or a popular status then do nothing.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2398 * Popular statuses are
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2399 * activated elsewhere, and we update the status_box
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2400 * accordingly by connecting to the savedstatus-changed
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2401 * signal and then calling status_menu_refresh_iter()
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2402 */
15514
535f002e7b0f More pidgin changes
Sean Egan <seanegan@gmail.com>
parents: 15507
diff changeset
2403 if (type != PIDGIN_STATUS_BOX_TYPE_PRIMITIVE)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2404 return;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2405
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2406 gtk_tree_model_get(GTK_TREE_MODEL(status_box->dropdown_store), &iter,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2407 TITLE_COLUMN, &title, -1);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2408
15514
535f002e7b0f More pidgin changes
Sean Egan <seanegan@gmail.com>
parents: 15507
diff changeset
2409 message = pidgin_status_box_get_message(status_box);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2410 if (!message || !*message)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2411 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2412 gtk_widget_hide_all(status_box->vbox);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2413 status_box->imhtml_visible = FALSE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2414 if (message != NULL)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2415 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2416 g_free(message);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2417 message = NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2418 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2419 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2420
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2421 if (status_box->account == NULL) {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
2422 PurpleStatusType *acct_status_type = NULL;
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
2423 PurpleStatusPrimitive primitive = GPOINTER_TO_INT(data);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2424 /* Global */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2425 /* Save the newly selected status to prefs.xml and status.xml */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2426
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2427 /* Has the status really been changed? */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2428 if (status_box->token_status_account) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2429 gint active;
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
2430 PurpleStatus *status;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2431 const char *id = NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2432 GtkTreePath *path = gtk_tree_row_reference_get_path(status_box->active_row);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2433 active = gtk_tree_path_get_indices(path)[0];
15938
d04878ce947b Some pixmap path fixes and win32 fixes
Daniel Atallah <daniel.atallah@gmail.com>
parents: 15880
diff changeset
2434
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2435 gtk_tree_path_free(path);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2436
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
2437 status = purple_account_get_active_status(status_box->token_status_account);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2438
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2439 acct_status_type = find_status_type_by_index(status_box->token_status_account, active);
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
2440 id = purple_status_type_get_id(acct_status_type);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2441
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
2442 if (strncmp(id, purple_status_get_id(status), strlen(id)) == 0)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2443 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2444 /* Selected status and previous status is the same */
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
2445 if (!message_changed(message, purple_status_get_attr_string(status, "message")))
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2446 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
2447 PurpleSavedStatus *ss = purple_savedstatus_get_current();
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2448 /* Make sure that statusbox displays the correct thing.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2449 * It can get messed up if the previous selection was a
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2450 * saved status that wasn't supported by this account */
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
2451 if ((purple_savedstatus_get_type(ss) == primitive)
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
2452 && purple_savedstatus_is_transient(ss)
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
2453 && purple_savedstatus_has_substatuses(ss))
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2454 changed = FALSE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2455 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2456 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2457 } else {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
2458 saved_status = purple_savedstatus_get_current();
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
2459 if (purple_savedstatus_get_type(saved_status) == primitive &&
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
2460 !purple_savedstatus_has_substatuses(saved_status))
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2461 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
2462 if (!message_changed(purple_savedstatus_get_message(saved_status), message))
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2463 changed = FALSE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2464 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2465 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2466
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2467 if (changed)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2468 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2469 /* Manually find the appropriate transient acct */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2470 if (status_box->token_status_account) {
18118
ab6d2763b8d8 Re-fix the DBus list handling code by killing const GList* / const GSList*
Richard Laager <rlaager@wiktel.com>
parents: 18063
diff changeset
2471 GList *iter = purple_savedstatuses_get_all();
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
2472 GList *tmp, *active_accts = purple_accounts_get_all_active();
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2473
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2474 for (; iter != NULL; iter = iter->next) {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
2475 PurpleSavedStatus *ss = iter->data;
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
2476 const char *ss_msg = purple_savedstatus_get_message(ss);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
2477 if ((purple_savedstatus_get_type(ss) == primitive) && purple_savedstatus_is_transient(ss) &&
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
2478 purple_savedstatus_has_substatuses(ss) && /* Must have substatuses */
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2479 !message_changed(ss_msg, message))
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2480 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2481 gboolean found = FALSE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2482 /* The currently enabled accounts must have substatuses for all the active accts */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2483 for(tmp = active_accts; tmp != NULL; tmp = tmp->next) {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
2484 PurpleAccount *acct = tmp->data;
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
2485 PurpleSavedStatusSub *sub = purple_savedstatus_get_substatus(ss, acct);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2486 if (sub) {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
2487 const PurpleStatusType *sub_type = purple_savedstatus_substatus_get_type(sub);
16627
2a12915d957a Fedora bug/patch https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=234399
Stu Tomlinson <stu@nosnilmot.com>
parents: 16563
diff changeset
2488 const char *subtype_status_id = purple_status_type_get_id(sub_type);
2a12915d957a Fedora bug/patch https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=234399
Stu Tomlinson <stu@nosnilmot.com>
parents: 16563
diff changeset
2489 if (subtype_status_id && !strcmp(subtype_status_id,
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
2490 purple_status_type_get_id(acct_status_type)))
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2491 found = TRUE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2492 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2493 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2494 if (!found)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2495 continue;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2496 saved_status = ss;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2497 break;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2498 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2499 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2500
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2501 g_list_free(active_accts);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2502
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2503 } else {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2504 /* If we've used this type+message before, lookup the transient status */
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
2505 saved_status = purple_savedstatus_find_transient_by_type_and_message(primitive, message);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2506 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2507
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2508 /* If this type+message is unique then create a new transient saved status */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2509 if (saved_status == NULL)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2510 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
2511 saved_status = purple_savedstatus_new(NULL, primitive);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
2512 purple_savedstatus_set_message(saved_status, message);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2513 if (status_box->token_status_account) {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
2514 GList *tmp, *active_accts = purple_accounts_get_all_active();
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2515 for (tmp = active_accts; tmp != NULL; tmp = tmp->next) {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
2516 purple_savedstatus_set_substatus(saved_status,
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
2517 (PurpleAccount*) tmp->data, acct_status_type, message);
15374
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 g_list_free(active_accts);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2520 }
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
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2523 /* Set the status for each account */
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
2524 purple_savedstatus_activate(saved_status);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2525 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2526 } else {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2527 /* Per-account */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2528 gint active;
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
2529 PurpleStatusType *status_type;
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
2530 PurpleStatus *status;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2531 const char *id = NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2532
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
2533 status = purple_account_get_active_status(status_box->account);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2534
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2535 active = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(status_box), "active"));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2536
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2537 status_type = find_status_type_by_index(status_box->account, active);
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
2538 id = purple_status_type_get_id(status_type);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2539
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
2540 if (strncmp(id, purple_status_get_id(status), strlen(id)) == 0)
15374
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 /* Selected status and previous status is the same */
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
2543 if (!message_changed(message, purple_status_get_attr_string(status, "message")))
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2544 changed = FALSE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2545 }
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 if (changed)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2548 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2549 if (message)
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
2550 purple_account_set_status(status_box->account, id,
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2551 TRUE, "message", message, NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2552 else
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
2553 purple_account_set_status(status_box->account, id,
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2554 TRUE, NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2555
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
2556 saved_status = purple_savedstatus_get_current();
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
2557 if (purple_savedstatus_is_transient(saved_status))
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
2558 purple_savedstatus_set_substatus(saved_status, status_box->account,
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2559 status_type, message);
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 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2562
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2563 g_free(title);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2564 g_free(message);
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
15514
535f002e7b0f More pidgin changes
Sean Egan <seanegan@gmail.com>
parents: 15507
diff changeset
2567 static void update_size(PidginStatusBox *status_box)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2568 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2569 GtkTextBuffer *buffer;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2570 GtkTextIter iter;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2571 int wrapped_lines;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2572 int lines;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2573 GdkRectangle oneline;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2574 int height;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2575 int pad_top, pad_inside, pad_bottom;
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 if (!status_box->imhtml_visible)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2578 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2579 if (status_box->vbox != NULL)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2580 gtk_widget_set_size_request(status_box->vbox, -1, -1);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2581 return;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2582 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2583
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2584 buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(status_box->imhtml));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2585
17149
7f00fb7f18b5 Fix #1100.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 17038
diff changeset
2586 height = 0;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2587 wrapped_lines = 1;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2588 gtk_text_buffer_get_start_iter(buffer, &iter);
17149
7f00fb7f18b5 Fix #1100.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 17038
diff changeset
2589 do {
7f00fb7f18b5 Fix #1100.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 17038
diff changeset
2590 gtk_text_view_get_iter_location(GTK_TEXT_VIEW(status_box->imhtml), &iter, &oneline);
7f00fb7f18b5 Fix #1100.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 17038
diff changeset
2591 height += oneline.height;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2592 wrapped_lines++;
17149
7f00fb7f18b5 Fix #1100.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 17038
diff changeset
2593 if (wrapped_lines > 4)
7f00fb7f18b5 Fix #1100.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 17038
diff changeset
2594 break;
7f00fb7f18b5 Fix #1100.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 17038
diff changeset
2595 } while (gtk_text_view_forward_display_line(GTK_TEXT_VIEW(status_box->imhtml), &iter));
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2596
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2597 lines = gtk_text_buffer_get_line_count(buffer);
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 /* Show a maximum of 4 lines */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2600 lines = MIN(lines, 4);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2601 wrapped_lines = MIN(wrapped_lines, 4);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2602
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2603 pad_top = gtk_text_view_get_pixels_above_lines(GTK_TEXT_VIEW(status_box->imhtml));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2604 pad_bottom = gtk_text_view_get_pixels_below_lines(GTK_TEXT_VIEW(status_box->imhtml));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2605 pad_inside = gtk_text_view_get_pixels_inside_wrap(GTK_TEXT_VIEW(status_box->imhtml));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2606
17149
7f00fb7f18b5 Fix #1100.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 17038
diff changeset
2607 height += (pad_top + pad_bottom) * lines;
7f00fb7f18b5 Fix #1100.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 17038
diff changeset
2608 height += (pad_inside) * (wrapped_lines - lines);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2609
15821
cebfc6af3eb5 More Gaim to Pidgin stuff
Sean Egan <seanegan@gmail.com>
parents: 15675
diff changeset
2610 gtk_widget_set_size_request(status_box->vbox, -1, height + PIDGIN_HIG_BOX_SPACE);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2611 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2612
15514
535f002e7b0f More pidgin changes
Sean Egan <seanegan@gmail.com>
parents: 15507
diff changeset
2613 static void remove_typing_cb(PidginStatusBox *status_box)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2614 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2615 if (status_box->typing == 0)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2616 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2617 /* Nothing has changed, so we don't need to do anything */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2618 status_menu_refresh_iter(status_box);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2619 return;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2620 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2621
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2622 g_source_remove(status_box->typing);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2623 status_box->typing = 0;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2624
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2625 activate_currently_selected_status(status_box);
15514
535f002e7b0f More pidgin changes
Sean Egan <seanegan@gmail.com>
parents: 15507
diff changeset
2626 pidgin_status_box_refresh(status_box);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2627 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2628
15514
535f002e7b0f More pidgin changes
Sean Egan <seanegan@gmail.com>
parents: 15507
diff changeset
2629 static void pidgin_status_box_changed(PidginStatusBox *status_box)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2630 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2631 GtkTreePath *path = gtk_tree_row_reference_get_path(status_box->active_row);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2632 GtkTreeIter iter;
15514
535f002e7b0f More pidgin changes
Sean Egan <seanegan@gmail.com>
parents: 15507
diff changeset
2633 PidginStatusBoxItemType type;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2634 gpointer data;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2635 GList *accounts = NULL, *node;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2636 int active;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2637
15938
d04878ce947b Some pixmap path fixes and win32 fixes
Daniel Atallah <daniel.atallah@gmail.com>
parents: 15880
diff changeset
2638
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2639 if (!gtk_tree_model_get_iter (GTK_TREE_MODEL(status_box->dropdown_store), &iter, path))
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2640 return;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2641 active = gtk_tree_path_get_indices(path)[0];
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2642 gtk_tree_path_free(path);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2643 g_object_set_data(G_OBJECT(status_box), "active", GINT_TO_POINTER(active));
15938
d04878ce947b Some pixmap path fixes and win32 fixes
Daniel Atallah <daniel.atallah@gmail.com>
parents: 15880
diff changeset
2644
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2645 gtk_tree_model_get(GTK_TREE_MODEL(status_box->dropdown_store), &iter,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2646 TYPE_COLUMN, &type,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2647 DATA_COLUMN, &data,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2648 -1);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2649 if (status_box->typing != 0)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2650 g_source_remove(status_box->typing);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2651 status_box->typing = 0;
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 if (GTK_WIDGET_IS_SENSITIVE(GTK_WIDGET(status_box)))
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2654 {
16332
89328a54948b For Luke. Fixes saved status selection
Sean Egan <seanegan@gmail.com>
parents: 16323
diff changeset
2655 if (type == PIDGIN_STATUS_BOX_TYPE_POPULAR || type == PIDGIN_STATUS_BOX_TYPE_SAVED_POPULAR)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2656 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
2657 PurpleSavedStatus *saved;
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
2658 saved = purple_savedstatus_find_by_creation_time(GPOINTER_TO_INT(data));
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2659 g_return_if_fail(saved != NULL);
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
2660 purple_savedstatus_activate(saved);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2661 return;
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
15514
535f002e7b0f More pidgin changes
Sean Egan <seanegan@gmail.com>
parents: 15507
diff changeset
2664 if (type == PIDGIN_STATUS_BOX_TYPE_CUSTOM)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2665 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
2666 PurpleSavedStatus *saved_status;
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
2667 saved_status = purple_savedstatus_get_current();
16119
e57d9d5e5c86 sf patch #1622581, from Greg Taeger
Mark Doliner <mark@kingant.net>
parents: 16098
diff changeset
2668 if (purple_savedstatus_get_type(saved_status) == PURPLE_STATUS_AVAILABLE)
e57d9d5e5c86 sf patch #1622581, from Greg Taeger
Mark Doliner <mark@kingant.net>
parents: 16098
diff changeset
2669 saved_status = purple_savedstatus_new(NULL, PURPLE_STATUS_AWAY);
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15493
diff changeset
2670 pidgin_status_editor_show(FALSE,
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
2671 purple_savedstatus_is_transient(saved_status)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2672 ? saved_status : NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2673 status_menu_refresh_iter(status_box);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2674 return;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2675 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2676
15514
535f002e7b0f More pidgin changes
Sean Egan <seanegan@gmail.com>
parents: 15507
diff changeset
2677 if (type == PIDGIN_STATUS_BOX_TYPE_SAVED)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2678 {
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15493
diff changeset
2679 pidgin_status_window_show();
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2680 status_menu_refresh_iter(status_box);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2681 return;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2682 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2683 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2684
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2685 /*
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2686 * Show the message box whenever the primitive allows for a
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2687 * message attribute on any protocol that is enabled,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2688 * or our protocol, if we have account set
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2689 */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2690 if (status_box->account)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2691 accounts = g_list_prepend(accounts, status_box->account);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2692 else
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
2693 accounts = purple_accounts_get_all_active();
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2694 status_box->imhtml_visible = FALSE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2695 for (node = accounts; node != NULL; node = node->next)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2696 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
2697 PurpleAccount *account;
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
2698 PurpleStatusType *status_type;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2699
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2700 account = node->data;
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
2701 status_type = purple_account_get_status_type_with_primitive(account, GPOINTER_TO_INT(data));
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2702 if ((status_type != NULL) &&
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
2703 (purple_status_type_get_attr(status_type, "message") != NULL))
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2704 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2705 status_box->imhtml_visible = TRUE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2706 break;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2707 }
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 g_list_free(accounts);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2710
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2711 if (GTK_WIDGET_IS_SENSITIVE(GTK_WIDGET(status_box)))
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2712 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2713 if (status_box->imhtml_visible)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2714 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2715 gtk_widget_show_all(status_box->vbox);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2716 status_box->typing = g_timeout_add(TYPING_TIMEOUT, (GSourceFunc)remove_typing_cb, status_box);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2717 gtk_widget_grab_focus(status_box->imhtml);
24015
3ab88169a2c2 Provide a preference to allow users to keep their status message when
Richard Laager <rlaager@wiktel.com>
parents: 23881
diff changeset
2718 if (!purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/status/keep_status_message"))
3ab88169a2c2 Provide a preference to allow users to keep their status message when
Richard Laager <rlaager@wiktel.com>
parents: 23881
diff changeset
2719 gtk_imhtml_clear(GTK_IMHTML(status_box->imhtml));
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2720 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2721 else
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2722 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2723 gtk_widget_hide_all(status_box->vbox);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2724 activate_currently_selected_status(status_box); /* This is where we actually set the status */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2725 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2726 }
15514
535f002e7b0f More pidgin changes
Sean Egan <seanegan@gmail.com>
parents: 15507
diff changeset
2727 pidgin_status_box_refresh(status_box);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2728 }
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 static gint
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
2731 get_statusbox_index(PidginStatusBox *box, PurpleSavedStatus *saved_status)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2732 {
19333
5e39506a0e3b Select the correct item in the dropdown when using a transient status.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18704
diff changeset
2733 gint index = -1;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2734
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
2735 switch (purple_savedstatus_get_type(saved_status))
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2736 {
19333
5e39506a0e3b Select the correct item in the dropdown when using a transient status.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18704
diff changeset
2737 /* In reverse order */
5e39506a0e3b Select the correct item in the dropdown when using a transient status.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18704
diff changeset
2738 case PURPLE_STATUS_OFFLINE:
5e39506a0e3b Select the correct item in the dropdown when using a transient status.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18704
diff changeset
2739 index++;
5e39506a0e3b Select the correct item in the dropdown when using a transient status.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18704
diff changeset
2740 case PURPLE_STATUS_INVISIBLE:
5e39506a0e3b Select the correct item in the dropdown when using a transient status.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18704
diff changeset
2741 index++;
5e39506a0e3b Select the correct item in the dropdown when using a transient status.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18704
diff changeset
2742 case PURPLE_STATUS_UNAVAILABLE:
5e39506a0e3b Select the correct item in the dropdown when using a transient status.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18704
diff changeset
2743 index++;
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15822
diff changeset
2744 case PURPLE_STATUS_AWAY:
19333
5e39506a0e3b Select the correct item in the dropdown when using a transient status.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18704
diff changeset
2745 index++;
5e39506a0e3b Select the correct item in the dropdown when using a transient status.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18704
diff changeset
2746 case PURPLE_STATUS_AVAILABLE:
5e39506a0e3b Select the correct item in the dropdown when using a transient status.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18704
diff changeset
2747 index++;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2748 break;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2749 default:
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2750 break;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2751 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2752
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2753 return index;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2754 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2755
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2756 static void imhtml_changed_cb(GtkTextBuffer *buffer, void *data)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2757 {
15514
535f002e7b0f More pidgin changes
Sean Egan <seanegan@gmail.com>
parents: 15507
diff changeset
2758 PidginStatusBox *status_box = (PidginStatusBox*)data;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2759 if (GTK_WIDGET_IS_SENSITIVE(GTK_WIDGET(status_box)))
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 if (status_box->typing != 0) {
15514
535f002e7b0f More pidgin changes
Sean Egan <seanegan@gmail.com>
parents: 15507
diff changeset
2762 pidgin_status_box_pulse_typing(status_box);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2763 g_source_remove(status_box->typing);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2764 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2765 status_box->typing = g_timeout_add(TYPING_TIMEOUT, (GSourceFunc)remove_typing_cb, status_box);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2766 }
15514
535f002e7b0f More pidgin changes
Sean Egan <seanegan@gmail.com>
parents: 15507
diff changeset
2767 pidgin_status_box_refresh(status_box);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2768 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2769
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2770 static void imhtml_format_changed_cb(GtkIMHtml *imhtml, GtkIMHtmlButtons buttons, void *data)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2771 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2772 imhtml_changed_cb(NULL, data);
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
15514
535f002e7b0f More pidgin changes
Sean Egan <seanegan@gmail.com>
parents: 15507
diff changeset
2775 char *pidgin_status_box_get_message(PidginStatusBox *status_box)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2776 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2777 if (status_box->imhtml_visible)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2778 return gtk_imhtml_get_markup(GTK_IMHTML(status_box->imhtml));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2779 else
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2780 return NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2781 }