Mercurial > pidgin.yaz
annotate pidgin/gtkstatusbox.c @ 29531:33715feb7b8d
Add media_caps to PurpleBuddy structure and use it to determine the old caps
in purple_prpl_got_media_caps.
author | maiku@pidgin.im |
---|---|
date | Tue, 20 Oct 2009 21:00:23 +0000 |
parents | 2dcff225172e |
children | e3206d6da6c7 |
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 | 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 |
26613
b162300ab1e7
A patch from Arunan Balasubramaniam to use timeouts in seconds instead of
foss@abala.me
parents:
25430
diff
changeset
|
70 /* Timeout for typing notifications in seconds */ |
b162300ab1e7
A patch from Arunan Balasubramaniam to use timeouts in seconds instead of
foss@abala.me
parents:
25430
diff
changeset
|
71 #define TYPING_TIMEOUT 4 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
72 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
73 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
|
74 static void imhtml_format_changed_cb(GtkIMHtml *imhtml, GtkIMHtmlButtons buttons, void *data); |
15514 | 75 static void remove_typing_cb(PidginStatusBox *box); |
76 static void update_size (PidginStatusBox *box); | |
15823 | 77 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
|
78 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
|
79 |
15514 | 80 static void pidgin_status_box_pulse_typing(PidginStatusBox *status_box); |
81 static void pidgin_status_box_refresh(PidginStatusBox *status_box); | |
82 static void status_menu_refresh_iter(PidginStatusBox *status_box); | |
83 static void pidgin_status_box_regenerate(PidginStatusBox *status_box); | |
84 static void pidgin_status_box_changed(PidginStatusBox *box); | |
85 static void pidgin_status_box_size_request (GtkWidget *widget, GtkRequisition *requisition); | |
86 static void pidgin_status_box_size_allocate (GtkWidget *widget, GtkAllocation *allocation); | |
87 static gboolean pidgin_status_box_expose_event (GtkWidget *widget, GdkEventExpose *event); | |
88 static void pidgin_status_box_redisplay_buddy_icon(PidginStatusBox *status_box); | |
89 static void pidgin_status_box_forall (GtkContainer *container, gboolean include_internals, GtkCallback callback, gpointer callback_data); | |
90 static void pidgin_status_box_popup(PidginStatusBox *box); | |
91 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
|
92 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
93 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
|
94 static void icon_choose_cb(const char *filename, gpointer data); |
15514 | 95 static void remove_buddy_icon_cb(GtkWidget *w, PidginStatusBox *box); |
26968
1788bc69ba7b
A patch from nops to add a "Select Buddy Icon" (my term, the original patch
Richard Laager <rlaager@wiktel.com>
parents:
26911
diff
changeset
|
96 static void choose_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
|
97 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
98 enum { |
15514 | 99 /** A PidginStatusBoxItemType */ |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
100 TYPE_COLUMN, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
101 |
26723
b2b0bd2afcb2
Use stock id where possible.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26712
diff
changeset
|
102 /** This is the stock-id for the icon. */ |
b2b0bd2afcb2
Use stock id where possible.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26712
diff
changeset
|
103 ICON_STOCK_COLUMN, |
b2b0bd2afcb2
Use stock id where possible.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26712
diff
changeset
|
104 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
105 /** |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
106 * 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
|
107 * This column is visible. |
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 ICON_COLUMN, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
110 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
111 /** 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
|
112 TEXT_COLUMN, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
113 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
114 /** The plain-English title of this item */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
115 TITLE_COLUMN, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
116 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
117 /** A plain-English description of this item */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
118 DESC_COLUMN, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
119 |
16296
78f798d99d3a
Saved icon for saved statuses in statusbox
Sean Egan <seanegan@gmail.com>
parents:
16270
diff
changeset
|
120 /** |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
121 * 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
|
122 * this is the creation time. For PRIMITIVE types, |
15823 | 123 * this is the PurpleStatusPrimitive. |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
124 */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
125 DATA_COLUMN, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
126 |
16296
78f798d99d3a
Saved icon for saved statuses in statusbox
Sean Egan <seanegan@gmail.com>
parents:
16270
diff
changeset
|
127 /** |
21959
d3a4c98c01b7
Show the prpl icon in the account-specific statusboxes to avoid ambiguity.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21913
diff
changeset
|
128 * 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
|
129 * 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
|
130 * 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
|
131 * (GdkPixbuf) of the account. |
16296
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_COLUMN, |
78f798d99d3a
Saved icon for saved statuses in statusbox
Sean Egan <seanegan@gmail.com>
parents:
16270
diff
changeset
|
134 |
78f798d99d3a
Saved icon for saved statuses in statusbox
Sean Egan <seanegan@gmail.com>
parents:
16270
diff
changeset
|
135 /** |
78f798d99d3a
Saved icon for saved statuses in statusbox
Sean Egan <seanegan@gmail.com>
parents:
16270
diff
changeset
|
136 * 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
|
137 */ |
78f798d99d3a
Saved icon for saved statuses in statusbox
Sean Egan <seanegan@gmail.com>
parents:
16270
diff
changeset
|
138 EMBLEM_VISIBLE_COLUMN, |
78f798d99d3a
Saved icon for saved statuses in statusbox
Sean Egan <seanegan@gmail.com>
parents:
16270
diff
changeset
|
139 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
140 NUM_COLUMNS |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
141 }; |
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 enum { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
144 PROP_0, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
145 PROP_ACCOUNT, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
146 PROP_ICON_SEL, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
147 }; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
148 |
26799
12fdc06d73be
Use stock-ids for connecting/typing animations in the statusbox.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26786
diff
changeset
|
149 static char *typing_stock_ids[7] = { |
12fdc06d73be
Use stock-ids for connecting/typing animations in the statusbox.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26786
diff
changeset
|
150 PIDGIN_STOCK_ANIMATION_TYPING0, |
12fdc06d73be
Use stock-ids for connecting/typing animations in the statusbox.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26786
diff
changeset
|
151 PIDGIN_STOCK_ANIMATION_TYPING1, |
12fdc06d73be
Use stock-ids for connecting/typing animations in the statusbox.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26786
diff
changeset
|
152 PIDGIN_STOCK_ANIMATION_TYPING2, |
12fdc06d73be
Use stock-ids for connecting/typing animations in the statusbox.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26786
diff
changeset
|
153 PIDGIN_STOCK_ANIMATION_TYPING3, |
12fdc06d73be
Use stock-ids for connecting/typing animations in the statusbox.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26786
diff
changeset
|
154 PIDGIN_STOCK_ANIMATION_TYPING4, |
12fdc06d73be
Use stock-ids for connecting/typing animations in the statusbox.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26786
diff
changeset
|
155 NULL |
12fdc06d73be
Use stock-ids for connecting/typing animations in the statusbox.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26786
diff
changeset
|
156 }; |
12fdc06d73be
Use stock-ids for connecting/typing animations in the statusbox.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26786
diff
changeset
|
157 |
26801
882667b6794b
Use a all the icons hbons had created for 'connecting' animation.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26800
diff
changeset
|
158 static char *connecting_stock_ids[] = { |
26799
12fdc06d73be
Use stock-ids for connecting/typing animations in the statusbox.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26786
diff
changeset
|
159 PIDGIN_STOCK_ANIMATION_CONNECT0, |
12fdc06d73be
Use stock-ids for connecting/typing animations in the statusbox.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26786
diff
changeset
|
160 PIDGIN_STOCK_ANIMATION_CONNECT1, |
12fdc06d73be
Use stock-ids for connecting/typing animations in the statusbox.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26786
diff
changeset
|
161 PIDGIN_STOCK_ANIMATION_CONNECT2, |
12fdc06d73be
Use stock-ids for connecting/typing animations in the statusbox.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26786
diff
changeset
|
162 PIDGIN_STOCK_ANIMATION_CONNECT3, |
12fdc06d73be
Use stock-ids for connecting/typing animations in the statusbox.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26786
diff
changeset
|
163 PIDGIN_STOCK_ANIMATION_CONNECT4, |
12fdc06d73be
Use stock-ids for connecting/typing animations in the statusbox.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26786
diff
changeset
|
164 PIDGIN_STOCK_ANIMATION_CONNECT5, |
12fdc06d73be
Use stock-ids for connecting/typing animations in the statusbox.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26786
diff
changeset
|
165 PIDGIN_STOCK_ANIMATION_CONNECT6, |
12fdc06d73be
Use stock-ids for connecting/typing animations in the statusbox.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26786
diff
changeset
|
166 PIDGIN_STOCK_ANIMATION_CONNECT7, |
12fdc06d73be
Use stock-ids for connecting/typing animations in the statusbox.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26786
diff
changeset
|
167 PIDGIN_STOCK_ANIMATION_CONNECT8, |
26801
882667b6794b
Use a all the icons hbons had created for 'connecting' animation.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26800
diff
changeset
|
168 PIDGIN_STOCK_ANIMATION_CONNECT9, |
882667b6794b
Use a all the icons hbons had created for 'connecting' animation.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26800
diff
changeset
|
169 PIDGIN_STOCK_ANIMATION_CONNECT10, |
882667b6794b
Use a all the icons hbons had created for 'connecting' animation.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26800
diff
changeset
|
170 PIDGIN_STOCK_ANIMATION_CONNECT11, |
882667b6794b
Use a all the icons hbons had created for 'connecting' animation.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26800
diff
changeset
|
171 PIDGIN_STOCK_ANIMATION_CONNECT12, |
882667b6794b
Use a all the icons hbons had created for 'connecting' animation.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26800
diff
changeset
|
172 PIDGIN_STOCK_ANIMATION_CONNECT13, |
882667b6794b
Use a all the icons hbons had created for 'connecting' animation.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26800
diff
changeset
|
173 PIDGIN_STOCK_ANIMATION_CONNECT14, |
882667b6794b
Use a all the icons hbons had created for 'connecting' animation.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26800
diff
changeset
|
174 PIDGIN_STOCK_ANIMATION_CONNECT15, |
882667b6794b
Use a all the icons hbons had created for 'connecting' animation.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26800
diff
changeset
|
175 PIDGIN_STOCK_ANIMATION_CONNECT16, |
882667b6794b
Use a all the icons hbons had created for 'connecting' animation.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26800
diff
changeset
|
176 PIDGIN_STOCK_ANIMATION_CONNECT17, |
882667b6794b
Use a all the icons hbons had created for 'connecting' animation.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26800
diff
changeset
|
177 PIDGIN_STOCK_ANIMATION_CONNECT18, |
882667b6794b
Use a all the icons hbons had created for 'connecting' animation.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26800
diff
changeset
|
178 PIDGIN_STOCK_ANIMATION_CONNECT19, |
882667b6794b
Use a all the icons hbons had created for 'connecting' animation.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26800
diff
changeset
|
179 PIDGIN_STOCK_ANIMATION_CONNECT20, |
882667b6794b
Use a all the icons hbons had created for 'connecting' animation.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26800
diff
changeset
|
180 PIDGIN_STOCK_ANIMATION_CONNECT21, |
882667b6794b
Use a all the icons hbons had created for 'connecting' animation.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26800
diff
changeset
|
181 PIDGIN_STOCK_ANIMATION_CONNECT22, |
882667b6794b
Use a all the icons hbons had created for 'connecting' animation.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26800
diff
changeset
|
182 PIDGIN_STOCK_ANIMATION_CONNECT23, |
882667b6794b
Use a all the icons hbons had created for 'connecting' animation.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26800
diff
changeset
|
183 PIDGIN_STOCK_ANIMATION_CONNECT24, |
882667b6794b
Use a all the icons hbons had created for 'connecting' animation.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26800
diff
changeset
|
184 PIDGIN_STOCK_ANIMATION_CONNECT25, |
882667b6794b
Use a all the icons hbons had created for 'connecting' animation.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26800
diff
changeset
|
185 PIDGIN_STOCK_ANIMATION_CONNECT26, |
882667b6794b
Use a all the icons hbons had created for 'connecting' animation.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26800
diff
changeset
|
186 PIDGIN_STOCK_ANIMATION_CONNECT27, |
882667b6794b
Use a all the icons hbons had created for 'connecting' animation.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26800
diff
changeset
|
187 PIDGIN_STOCK_ANIMATION_CONNECT28, |
882667b6794b
Use a all the icons hbons had created for 'connecting' animation.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26800
diff
changeset
|
188 PIDGIN_STOCK_ANIMATION_CONNECT29, |
882667b6794b
Use a all the icons hbons had created for 'connecting' animation.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26800
diff
changeset
|
189 PIDGIN_STOCK_ANIMATION_CONNECT30, |
26799
12fdc06d73be
Use stock-ids for connecting/typing animations in the statusbox.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26786
diff
changeset
|
190 NULL |
12fdc06d73be
Use stock-ids for connecting/typing animations in the statusbox.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26786
diff
changeset
|
191 }; |
12fdc06d73be
Use stock-ids for connecting/typing animations in the statusbox.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26786
diff
changeset
|
192 |
26800
27213d7fc6e1
Don't expose the parent class.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26799
diff
changeset
|
193 static GtkContainerClass *parent_class = NULL; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
194 |
15514 | 195 static void pidgin_status_box_class_init (PidginStatusBoxClass *klass); |
196 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
|
197 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
198 GType |
15514 | 199 pidgin_status_box_get_type (void) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
200 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
201 static GType status_box_type = 0; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
202 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
203 if (!status_box_type) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
204 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
205 static const GTypeInfo status_box_info = |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
206 { |
15514 | 207 sizeof (PidginStatusBoxClass), |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
208 NULL, /* base_init */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
209 NULL, /* base_finalize */ |
15514 | 210 (GClassInitFunc) pidgin_status_box_class_init, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
211 NULL, /* class_finalize */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
212 NULL, /* class_data */ |
15514 | 213 sizeof (PidginStatusBox), |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
214 0, |
15514 | 215 (GInstanceInitFunc) pidgin_status_box_init, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
216 NULL /* value_table */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
217 }; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
218 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
219 status_box_type = g_type_register_static(GTK_TYPE_CONTAINER, |
15514 | 220 "PidginStatusBox", |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
221 &status_box_info, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
222 0); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
223 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
224 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
225 return status_box_type; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
226 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
227 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
228 static void |
15514 | 229 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
|
230 GValue *value, GParamSpec *psec) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
231 { |
15514 | 232 PidginStatusBox *statusbox = PIDGIN_STATUS_BOX(object); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
233 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
234 switch (param_id) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
235 case PROP_ACCOUNT: |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
236 g_value_set_pointer(value, statusbox->account); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
237 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
238 case PROP_ICON_SEL: |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
239 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
|
240 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
241 default: |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
242 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
|
243 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
244 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
245 } |
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 static void |
15823 | 248 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
|
249 { |
18118
ab6d2763b8d8
Re-fix the DBus list handling code by killing const GList* / const GSList*
Richard Laager <rlaager@wiktel.com>
parents:
18063
diff
changeset
|
250 GList *l; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
251 int status_no = -1; |
15823 | 252 const PurpleStatusType *statustype = NULL; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
253 const char *message; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
254 |
15823 | 255 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
|
256 (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
|
257 |
15823 | 258 for (l = purple_account_get_status_types(account); l != NULL; l = l->next) { |
259 PurpleStatusType *status_type = (PurpleStatusType *)l->data; | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
260 |
23273
74f1a07f452b
Don't include 'Listening to music' in the per-account statusbox.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23264
diff
changeset
|
261 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
|
262 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
|
263 continue; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
264 status_no++; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
265 if (statustype == status_type) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
266 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
267 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
268 |
26894
3c06cd0e1717
Avoid overwriting the PRIMARY clipboard when we select-on-focus the status text for easy editing. Fixes #8781.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
26801
diff
changeset
|
269 gtk_imhtml_set_populate_primary_clipboard( |
3c06cd0e1717
Avoid overwriting the PRIMARY clipboard when we select-on-focus the status text for easy editing. Fixes #8781.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
26801
diff
changeset
|
270 GTK_IMHTML(status_box->imhtml), TRUE); |
3c06cd0e1717
Avoid overwriting the PRIMARY clipboard when we select-on-focus the status text for easy editing. Fixes #8781.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
26801
diff
changeset
|
271 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
272 if (status_no != -1) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
273 GtkTreePath *path; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
274 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
|
275 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
|
276 if (status_box->active_row) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
277 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
|
278 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
|
279 gtk_tree_path_free(path); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
280 |
15823 | 281 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
|
282 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
283 if (!message || !*message) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
284 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
285 gtk_widget_hide_all(status_box->vbox); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
286 status_box->imhtml_visible = FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
287 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
288 else |
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 gtk_widget_show_all(status_box->vbox); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
291 status_box->imhtml_visible = TRUE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
292 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
|
293 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
|
294 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
|
295 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
296 gtk_widget_set_sensitive(GTK_WIDGET(status_box), TRUE); |
15514 | 297 pidgin_status_box_refresh(status_box); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
298 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
299 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
300 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
301 static void |
15823 | 302 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
|
303 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
304 if (status_box->account == account) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
305 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
|
306 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
|
307 status_menu_refresh_iter(status_box); |
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 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
310 static gboolean |
15514 | 311 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
|
312 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
313 if (event->button == 3) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
314 GtkWidget *menu_item; |
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 if (box->icon_box_menu) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
317 gtk_widget_destroy(box->icon_box_menu); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
318 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
319 box->icon_box_menu = gtk_menu_new(); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
320 |
26969
e1c2fe5b1026
Use GTK_STOCK_ADD for the Select Buddy Icon option.
Richard Laager <rlaager@wiktel.com>
parents:
26968
diff
changeset
|
321 menu_item = pidgin_new_item_from_stock(box->icon_box_menu, _("Select Buddy Icon"), GTK_STOCK_ADD, |
26968
1788bc69ba7b
A patch from nops to add a "Select Buddy Icon" (my term, the original patch
Richard Laager <rlaager@wiktel.com>
parents:
26911
diff
changeset
|
322 G_CALLBACK(choose_buddy_icon_cb), |
1788bc69ba7b
A patch from nops to add a "Select Buddy Icon" (my term, the original patch
Richard Laager <rlaager@wiktel.com>
parents:
26911
diff
changeset
|
323 box, 0, 0, NULL); |
1788bc69ba7b
A patch from nops to add a "Select Buddy Icon" (my term, the original patch
Richard Laager <rlaager@wiktel.com>
parents:
26911
diff
changeset
|
324 |
15507 | 325 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
|
326 G_CALLBACK(remove_buddy_icon_cb), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
327 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
|
328 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
|
329 gtk_widget_set_sensitive(menu_item, FALSE); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
330 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
331 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
|
332 event->button, event->time); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
333 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
334 } else { |
26968
1788bc69ba7b
A patch from nops to add a "Select Buddy Icon" (my term, the original patch
Richard Laager <rlaager@wiktel.com>
parents:
26911
diff
changeset
|
335 choose_buddy_icon_cb(widget, box); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
336 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
337 return FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
338 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
339 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
340 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
341 icon_box_dnd_cb(GtkWidget *widget, GdkDragContext *dc, gint x, gint y, |
15514 | 342 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
|
343 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
344 gchar *name = (gchar *)sd->data; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
345 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
346 if ((sd->length >= 0) && (sd->format == 8)) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
347 /* 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
|
348 * Let's do something with it */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
349 if (!g_ascii_strncasecmp(name, "file://", 7)) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
350 GError *converr = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
351 gchar *tmp, *rtmp; |
15938
d04878ce947b
Some pixmap path fixes and win32 fixes
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15880
diff
changeset
|
352 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
353 if(!(tmp = g_filename_from_uri(name, NULL, &converr))) { |
15823 | 354 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
|
355 (converr ? converr->message : |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
356 "g_filename_from_uri error")); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
357 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
358 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
359 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
|
360 *rtmp = '\0'; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
361 icon_choose_cb(tmp, box); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
362 g_free(tmp); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
363 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
364 gtk_drag_finish(dc, TRUE, FALSE, t); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
365 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
366 gtk_drag_finish(dc, FALSE, FALSE, t); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
367 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
368 |
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
|
369 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
|
370 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
|
371 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
|
372 { |
15880
80f999140126
Fix a compile warning so that statusbox_got_url() might actually work
Stu Tomlinson <stu@nosnilmot.com>
parents:
15871
diff
changeset
|
373 FILE *f; |
80f999140126
Fix a compile warning so that statusbox_got_url() might actually work
Stu Tomlinson <stu@nosnilmot.com>
parents:
15871
diff
changeset
|
374 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
|
375 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
|
376 |
15880
80f999140126
Fix a compile warning so that statusbox_got_url() might actually work
Stu Tomlinson <stu@nosnilmot.com>
parents:
15871
diff
changeset
|
377 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
|
378 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
|
379 |
15880
80f999140126
Fix a compile warning so that statusbox_got_url() might actually work
Stu Tomlinson <stu@nosnilmot.com>
parents:
15871
diff
changeset
|
380 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
|
381 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
|
382 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
|
383 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
|
384 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
|
385 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
|
386 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
|
387 return; |
85cda171621a
Part of a large patch from o_sukhodolsky to fix some build warnings.
Richard Laager <rlaager@wiktel.com>
parents:
22007
diff
changeset
|
388 } |
15880
80f999140126
Fix a compile warning so that statusbox_got_url() might actually work
Stu Tomlinson <stu@nosnilmot.com>
parents:
15871
diff
changeset
|
389 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
|
390 |
15880
80f999140126
Fix a compile warning so that statusbox_got_url() might actually work
Stu Tomlinson <stu@nosnilmot.com>
parents:
15871
diff
changeset
|
391 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
|
392 |
15880
80f999140126
Fix a compile warning so that statusbox_got_url() might actually work
Stu Tomlinson <stu@nosnilmot.com>
parents:
15871
diff
changeset
|
393 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
|
394 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
|
395 } |
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
|
396 |
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
|
397 |
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
|
398 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
|
399 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
|
400 { |
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
|
401 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
|
402 |
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
|
403 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
|
404 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
|
405 |
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
|
406 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
|
407 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
|
408 |
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
|
409 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
|
410 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
|
411 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
|
412 |
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
|
413 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
|
414 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
|
415 } |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
416 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
417 static gboolean |
15514 | 418 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
|
419 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
420 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
|
421 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
|
422 return FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
423 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
424 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
425 static gboolean |
15514 | 426 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
|
427 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
428 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
|
429 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
|
430 return FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
431 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
432 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
433 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
434 static const GtkTargetEntry dnd_targets[] = { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
435 {"text/plain", 0, 0}, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
436 {"text/uri-list", 0, 1}, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
437 {"STRING", 0, 2} |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
438 }; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
439 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
440 static void |
15514 | 441 setup_icon_box(PidginStatusBox *status_box) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
442 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
443 if (status_box->icon_box != NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
444 return; |
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 status_box->icon = gtk_image_new(); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
447 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
|
448 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
|
449 gtk_widget_show(status_box->icon_box); |
24231
1163d93da109
gtk_widget_set_tooltip_text() is GTK+ >= 2.12
Daniel Atallah <daniel.atallah@gmail.com>
parents:
24230
diff
changeset
|
450 |
1163d93da109
gtk_widget_set_tooltip_text() is GTK+ >= 2.12
Daniel Atallah <daniel.atallah@gmail.com>
parents:
24230
diff
changeset
|
451 #if GTK_CHECK_VERSION(2,12,0) |
24148 | 452 gtk_widget_set_tooltip_text(status_box->icon_box, |
453 status_box->account ? _("Click to change your buddyicon for this account.") : | |
454 _("Click to change your buddyicon for all accounts.")); | |
24231
1163d93da109
gtk_widget_set_tooltip_text() is GTK+ >= 2.12
Daniel Atallah <daniel.atallah@gmail.com>
parents:
24230
diff
changeset
|
455 #endif |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
456 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
457 if (status_box->account && |
15823 | 458 !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
|
459 { |
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
|
460 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
|
461 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
|
462 purple_imgstore_unref(img); |
15374
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 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
465 { |
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
|
466 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
|
467 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
|
468 |
28149
6e1a582ae629
statusbox: Avoid an assertion failure from ""
Paul Aurich <paul@darkrain42.org>
parents:
27223
diff
changeset
|
469 if (filename && *filename) |
25890
9c0337d4b878
Fix the crash/leaks in statusbox
Paul Aurich <paul@darkrain42.org>
parents:
24231
diff
changeset
|
470 img = purple_imgstore_new_from_file(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
|
471 |
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
|
472 pidgin_status_box_set_buddy_icon(status_box, img); |
25890
9c0337d4b878
Fix the crash/leaks in statusbox
Paul Aurich <paul@darkrain42.org>
parents:
24231
diff
changeset
|
473 if (img) |
9c0337d4b878
Fix the crash/leaks in statusbox
Paul Aurich <paul@darkrain42.org>
parents:
24231
diff
changeset
|
474 /* |
9c0337d4b878
Fix the crash/leaks in statusbox
Paul Aurich <paul@darkrain42.org>
parents:
24231
diff
changeset
|
475 * purple_imgstore_new gives us a reference and |
9c0337d4b878
Fix the crash/leaks in statusbox
Paul Aurich <paul@darkrain42.org>
parents:
24231
diff
changeset
|
476 * pidgin_status_box_set_buddy_icon also takes one. |
9c0337d4b878
Fix the crash/leaks in statusbox
Paul Aurich <paul@darkrain42.org>
parents:
24231
diff
changeset
|
477 */ |
9c0337d4b878
Fix the crash/leaks in statusbox
Paul Aurich <paul@darkrain42.org>
parents:
24231
diff
changeset
|
478 purple_imgstore_unref(img); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
479 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
480 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
481 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
|
482 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
|
483 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
484 /* Set up DND */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
485 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
|
486 GTK_DEST_DEFAULT_MOTION | |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
487 GTK_DEST_DEFAULT_DROP, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
488 dnd_targets, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
489 sizeof(dnd_targets) / sizeof(GtkTargetEntry), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
490 GDK_ACTION_COPY); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
491 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
492 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
|
493 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
|
494 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
|
495 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
|
496 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
497 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
|
498 gtk_widget_show(status_box->icon); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
499 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
500 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
501 static void |
15514 | 502 destroy_icon_box(PidginStatusBox *statusbox) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
503 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
504 if (statusbox->icon_box == NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
505 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
506 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
507 gtk_widget_destroy(statusbox->icon_box); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
508 gdk_cursor_unref(statusbox->hand_cursor); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
509 gdk_cursor_unref(statusbox->arrow_cursor); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
510 |
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
|
511 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
|
512 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
513 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
|
514 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
|
515 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
516 if (statusbox->buddy_icon_sel) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
517 gtk_widget_destroy(statusbox->buddy_icon_sel); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
518 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
519 if (statusbox->icon_box_menu) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
520 gtk_widget_destroy(statusbox->icon_box_menu); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
521 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
522 statusbox->icon = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
523 statusbox->icon_box = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
524 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
|
525 statusbox->buddy_icon_img = NULL; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
526 statusbox->buddy_icon = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
527 statusbox->buddy_icon_hover = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
528 statusbox->hand_cursor = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
529 statusbox->arrow_cursor = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
530 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
531 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
532 static void |
15514 | 533 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
|
534 const GValue *value, GParamSpec *pspec) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
535 { |
15514 | 536 PidginStatusBox *statusbox = PIDGIN_STATUS_BOX(object); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
537 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
538 switch (param_id) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
539 case PROP_ICON_SEL: |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
540 if (g_value_get_boolean(value)) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
541 if (statusbox->account) { |
15823 | 542 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
|
543 if (plug) { |
15823 | 544 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
|
545 if (prplinfo && prplinfo->icon_spec.format != NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
546 setup_icon_box(statusbox); |
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 } else { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
549 setup_icon_box(statusbox); |
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 } else { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
552 destroy_icon_box(statusbox); |
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 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
555 case PROP_ACCOUNT: |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
556 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
|
557 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
|
558 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
|
559 else |
a73acc0c4dc8
Ignore token_status_account on account-specific status boxes. This should
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22470
diff
changeset
|
560 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
|
561 |
15514 | 562 pidgin_status_box_regenerate(statusbox); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
563 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
564 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
565 default: |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
566 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
|
567 break; |
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 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
570 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
571 static void |
15514 | 572 pidgin_status_box_finalize(GObject *obj) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
573 { |
15514 | 574 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
|
575 int i; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
576 |
15823 | 577 purple_signals_disconnect_by_handle(statusbox); |
578 purple_prefs_disconnect_by_handle(statusbox); | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
579 |
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
|
580 destroy_icon_box(statusbox); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
581 |
22183
69ad31c9983d
Fix some small leaks when destroying a statusbox.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22102
diff
changeset
|
582 if (statusbox->active_row) |
69ad31c9983d
Fix some small leaks when destroying a statusbox.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22102
diff
changeset
|
583 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
|
584 |
69ad31c9983d
Fix some small leaks when destroying a statusbox.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22102
diff
changeset
|
585 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
|
586 if (statusbox->connecting_pixbufs[i] != NULL) |
26705
a3f7ade9e45b
Use g_object_ref/unref instead of the deprecated versions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26613
diff
changeset
|
587 g_object_unref(G_OBJECT(statusbox->connecting_pixbufs[i])); |
22183
69ad31c9983d
Fix some small leaks when destroying a statusbox.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22102
diff
changeset
|
588 } |
69ad31c9983d
Fix some small leaks when destroying a statusbox.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22102
diff
changeset
|
589 |
69ad31c9983d
Fix some small leaks when destroying a statusbox.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22102
diff
changeset
|
590 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
|
591 if (statusbox->typing_pixbufs[i] != NULL) |
26705
a3f7ade9e45b
Use g_object_ref/unref instead of the deprecated versions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26613
diff
changeset
|
592 g_object_unref(G_OBJECT(statusbox->typing_pixbufs[i])); |
22183
69ad31c9983d
Fix some small leaks when destroying a statusbox.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22102
diff
changeset
|
593 } |
69ad31c9983d
Fix some small leaks when destroying a statusbox.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22102
diff
changeset
|
594 |
22087
d943df776c09
It turns out the tree-models need to be unref'ed.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22007
diff
changeset
|
595 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
|
596 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
|
597 G_OBJECT_CLASS(parent_class)->finalize(obj); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
598 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
599 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
600 static GType |
15514 | 601 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
|
602 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
603 return GTK_TYPE_WIDGET; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
604 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
605 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
606 static void |
15514 | 607 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
|
608 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
609 GObjectClass *object_class; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
610 GtkWidgetClass *widget_class; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
611 GtkContainerClass *container_class = (GtkContainerClass*)klass; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
612 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
613 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
|
614 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
615 widget_class = (GtkWidgetClass*)klass; |
15514 | 616 widget_class->size_request = pidgin_status_box_size_request; |
617 widget_class->size_allocate = pidgin_status_box_size_allocate; | |
618 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
|
619 |
15514 | 620 container_class->child_type = pidgin_status_box_child_type; |
621 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
|
622 container_class->remove = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
623 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
624 object_class = (GObjectClass *)klass; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
625 |
15514 | 626 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
|
627 |
15514 | 628 object_class->get_property = pidgin_status_box_get_property; |
629 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
|
630 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
631 g_object_class_install_property(object_class, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
632 PROP_ACCOUNT, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
633 g_param_spec_pointer("account", |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
634 "Account", |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
635 "The account, or NULL for all accounts", |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
636 G_PARAM_READWRITE |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
637 ) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
638 ); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
639 g_object_class_install_property(object_class, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
640 PROP_ICON_SEL, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
641 g_param_spec_boolean("iconsel", |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
642 "Icon Selector", |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
643 "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
|
644 FALSE, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
645 G_PARAM_READWRITE |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
646 ) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
647 ); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
648 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
649 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
650 /** |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
651 * 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
|
652 * 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
|
653 * should modify status_box->store |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
654 */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
655 static void |
15514 | 656 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
|
657 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
658 GtkIconSize icon_size; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
659 GtkStyle *style; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
660 char aa_color[8]; |
15823 | 661 PurpleSavedStatus *saved_status; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
662 char *primary, *secondary, *text; |
26723
b2b0bd2afcb2
Use stock id where possible.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26712
diff
changeset
|
663 const char *stock = NULL; |
26799
12fdc06d73be
Use stock-ids for connecting/typing animations in the statusbox.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26786
diff
changeset
|
664 GdkPixbuf *emblem = NULL; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
665 GtkTreePath *path; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
666 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
|
667 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
|
668 |
15436 | 669 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
|
670 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
671 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
|
672 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
|
673 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
|
674 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
|
675 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
|
676 |
15823 | 677 saved_status = purple_savedstatus_get_current(); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
678 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
679 if (status_box->account || (status_box->token_status_account |
15823 | 680 && purple_savedstatus_is_transient(saved_status))) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
681 account_status = TRUE; |
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 /* Primary */ |
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 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
686 GtkTreeIter iter; |
15514 | 687 PidginStatusBoxItemType type; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
688 gpointer data; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
689 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
690 /* 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
|
691 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
|
692 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
|
693 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
694 gtk_tree_path_free(path); |
15938
d04878ce947b
Some pixmap path fixes and win32 fixes
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15880
diff
changeset
|
695 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
696 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
|
697 TYPE_COLUMN, &type, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
698 DATA_COLUMN, &data, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
699 -1); |
15514 | 700 if (type == PIDGIN_STATUS_BOX_TYPE_PRIMITIVE) |
15823 | 701 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
|
702 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
703 /* 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
|
704 primary = g_strdup("New status"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
705 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
706 else if (account_status) |
15823 | 707 primary = g_strdup(purple_status_get_name(purple_account_get_active_status(acct))); |
708 else if (purple_savedstatus_is_transient(saved_status)) | |
709 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
|
710 else |
15823 | 711 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
|
712 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
713 /* Secondary */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
714 if (status_box->typing != 0) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
715 secondary = g_strdup(_("Typing")); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
716 else if (status_box->connecting) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
717 secondary = g_strdup(_("Connecting")); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
718 else if (!status_box->network_available) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
719 secondary = g_strdup(_("Waiting for network connection")); |
15823 | 720 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
|
721 secondary = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
722 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
723 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
724 const char *message; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
725 char *tmp; |
15823 | 726 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
|
727 if (message != NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
728 { |
15823 | 729 tmp = purple_markup_strip_html(message); |
730 purple_util_chrreplace(tmp, '\n', ' '); | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
731 secondary = g_markup_escape_text(tmp, -1); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
732 g_free(tmp); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
733 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
734 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
735 secondary = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
736 } |
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 /* Pixbuf */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
739 if (status_box->typing != 0) |
26799
12fdc06d73be
Use stock-ids for connecting/typing animations in the statusbox.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26786
diff
changeset
|
740 stock = typing_stock_ids[status_box->typing_index]; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
741 else if (status_box->connecting) |
26799
12fdc06d73be
Use stock-ids for connecting/typing animations in the statusbox.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26786
diff
changeset
|
742 stock = connecting_stock_ids[status_box->connecting_index]; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
743 else |
15413 | 744 { |
15823 | 745 PurpleStatusType *status_type; |
746 PurpleStatusPrimitive prim; | |
15413 | 747 if (account_status) { |
26723
b2b0bd2afcb2
Use stock id where possible.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26712
diff
changeset
|
748 status_type = purple_status_get_type(purple_account_get_active_status(acct)); |
15823 | 749 prim = purple_status_type_get_primitive(status_type); |
15413 | 750 } else { |
26723
b2b0bd2afcb2
Use stock id where possible.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26712
diff
changeset
|
751 prim = purple_savedstatus_get_type(saved_status); |
15413 | 752 } |
753 | |
26725
0011cd06990a
Use stock-id in the status editor window too.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26724
diff
changeset
|
754 stock = pidgin_stock_id_from_status_primitive(prim); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
755 } |
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 if (status_box->account != NULL) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
758 text = g_strdup_printf("%s - <span size=\"smaller\" color=\"%s\">%s</span>", |
15823 | 759 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
|
760 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
|
761 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
|
762 } else if (secondary != NULL) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
763 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
|
764 primary, aa_color, secondary); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
765 } else { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
766 text = g_strdup(primary); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
767 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
768 g_free(primary); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
769 g_free(secondary); |
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 /* |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
772 * 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
|
773 * really need to be a list store?) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
774 */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
775 gtk_list_store_set(status_box->store, &(status_box->iter), |
26723
b2b0bd2afcb2
Use stock id where possible.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26712
diff
changeset
|
776 ICON_STOCK_COLUMN, (gpointer)stock, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
777 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
|
778 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
|
779 EMBLEM_VISIBLE_COLUMN, (emblem != NULL), |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
780 -1); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
781 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
|
782 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
|
783 g_object_unref(emblem); |
15374
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 /* 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
|
786 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
|
787 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
|
788 gtk_tree_path_free(path); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
789 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
790 update_size(status_box); |
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 |
15823 | 793 static PurpleStatusType * |
794 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
|
795 { |
18118
ab6d2763b8d8
Re-fix the DBus list handling code by killing const GList* / const GSList*
Richard Laager <rlaager@wiktel.com>
parents:
18063
diff
changeset
|
796 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
|
797 gint i; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
798 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
799 for (i = 0; l; l = l->next) { |
15823 | 800 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
|
801 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
|
802 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
|
803 continue; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
804 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
805 if (active == i) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
806 return status_type; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
807 i++; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
808 } |
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 return NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
811 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
812 |
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 * 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
|
815 * 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
|
816 * 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
|
817 * 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
|
818 * 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
|
819 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
820 * 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
|
821 * keyboard signals instead of the changed signal? |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
822 */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
823 static void |
15514 | 824 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
|
825 { |
15823 | 826 PurpleSavedStatus *saved_status; |
827 PurpleStatusPrimitive primitive; | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
828 gint index; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
829 const char *message; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
830 GtkTreePath *path = NULL; |
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 /* 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
|
833 if (status_box->account) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
834 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
835 |
15823 | 836 saved_status = purple_savedstatus_get_current(); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
837 |
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 * Suppress the "changed" signal because the status |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
840 * was changed programmatically. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
841 */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
842 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
|
843 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
844 /* |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
845 * If 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
|
846 * 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
|
847 */ |
15823 | 848 primitive = purple_savedstatus_get_type(saved_status); |
849 if (!status_box->token_status_account && purple_savedstatus_is_transient(saved_status) && | |
850 ((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
|
851 (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
|
852 (primitive == PURPLE_STATUS_UNAVAILABLE)) && |
15823 | 853 (!purple_savedstatus_has_substatuses(saved_status))) |
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 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
|
856 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
|
857 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
858 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
859 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
860 GtkTreeIter iter; |
15514 | 861 PidginStatusBoxItemType type; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
862 gpointer data; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
863 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
864 /* 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
|
865 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
|
866 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
867 do |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
868 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
869 gtk_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
|
870 TYPE_COLUMN, &type, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
871 DATA_COLUMN, &data, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
872 -1); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
873 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
874 /* 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
|
875 * saved statuses with substatuses for the enabled accounts */ |
15823 | 876 if (status_box->token_status_account && purple_savedstatus_is_transient(saved_status) |
15514 | 877 && 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
|
878 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
879 char *name; |
15823 | 880 const char *acct_status_name = purple_status_get_name( |
881 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
|
882 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
883 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
|
884 TEXT_COLUMN, &name, -1); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
885 |
15823 | 886 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
|
887 || !strcmp(name, acct_status_name)) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
888 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
889 /* Found! */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
890 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
|
891 g_free(name); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
892 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
893 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
894 g_free(name); |
15938
d04878ce947b
Some pixmap path fixes and win32 fixes
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15880
diff
changeset
|
895 |
15514 | 896 } else if ((type == PIDGIN_STATUS_BOX_TYPE_POPULAR) && |
15823 | 897 (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
|
898 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
899 /* Found! */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
900 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
|
901 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
902 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
903 } 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
|
904 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
905 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
906 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
907 if (status_box->active_row) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
908 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
|
909 if (path) { /* path should never be NULL */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
910 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
|
911 gtk_tree_path_free(path); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
912 } else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
913 status_box->active_row = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
914 |
15823 | 915 message = purple_savedstatus_get_message(saved_status); |
916 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
|
917 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
918 status_box->imhtml_visible = FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
919 gtk_widget_hide_all(status_box->vbox); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
920 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
921 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
922 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
923 status_box->imhtml_visible = TRUE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
924 gtk_widget_show_all(status_box->vbox); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
925 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
926 /* |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
927 * Suppress the "changed" signal because the status |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
928 * was changed programmatically. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
929 */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
930 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
|
931 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
932 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
|
933 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
|
934 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
|
935 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
|
936 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
937 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
938 update_size(status_box); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
939 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
940 /* Stop suppressing the "changed" signal. */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
941 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
|
942 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
943 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
944 static void |
15514 | 945 add_popular_statuses(PidginStatusBox *statusbox) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
946 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
947 GList *list, *cur; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
948 |
15823 | 949 list = purple_savedstatuses_get_popular(6); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
950 if (list == NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
951 /* 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
|
952 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
953 |
15514 | 954 pidgin_status_box_add_separator(statusbox); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
955 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
956 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
|
957 { |
15823 | 958 PurpleSavedStatus *saved = cur->data; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
959 const gchar *message; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
960 gchar *stripped = NULL; |
15823 | 961 PurpleStatusPrimitive prim; |
16426 | 962 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
|
963 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
964 /* Get an appropriate status icon */ |
15823 | 965 prim = purple_savedstatus_get_type(saved); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
966 |
15823 | 967 if (purple_savedstatus_is_transient(saved)) |
15374
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 * Transient statuses do not have a title, so the savedstatus |
15823 | 971 * 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
|
972 * 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
|
973 */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
974 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
975 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
976 { |
15823 | 977 message = purple_savedstatus_get_message(saved); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
978 if (message != NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
979 { |
15823 | 980 stripped = purple_markup_strip_html(message); |
981 purple_util_chrreplace(stripped, '\n', ' '); | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
982 } |
16296
78f798d99d3a
Saved icon for saved statuses in statusbox
Sean Egan <seanegan@gmail.com>
parents:
16270
diff
changeset
|
983 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
|
984 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
985 |
16296
78f798d99d3a
Saved icon for saved statuses in statusbox
Sean Egan <seanegan@gmail.com>
parents:
16270
diff
changeset
|
986 pidgin_status_box_add(statusbox, type, |
26724
0e85e5698db4
Use stock id everywhere!
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26723
diff
changeset
|
987 NULL, purple_savedstatus_get_title(saved), stripped, |
15823 | 988 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
|
989 g_free(stripped); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
990 } |
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 g_list_free(list); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
993 } |
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 /* 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
|
996 * 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
|
997 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
|
998 { |
15823 | 999 PurpleAccount *acct = NULL, *acct2; |
1000 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
|
1001 GList *s, *s1, *s2; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1002 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1003 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
|
1004 acct = tmp->data; |
15823 | 1005 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
|
1006 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
|
1007 acct2 = tmp2->data; |
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 /* Only actually look at the statuses if the accounts use the same prpl */ |
15823 | 1010 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
|
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 |
15823 | 1015 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
|
1016 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1017 s1 = s; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1018 while (s1 && s2) { |
15823 | 1019 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
|
1020 /* TODO: Are these enough to consider the statuses identical? */ |
15823 | 1021 if (purple_status_type_get_primitive(st1) != purple_status_type_get_primitive(st2) |
1022 || strcmp(purple_status_type_get_id(st1), purple_status_type_get_id(st2)) | |
1023 || 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
|
1024 acct = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1025 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1026 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1027 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1028 s1 = s1->next; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1029 s2 = s2->next; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1030 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1031 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1032 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
|
1033 acct = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1034 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1035 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1036 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1037 if (!acct) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1038 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1039 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1040 g_list_free(active_accts); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1041 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1042 return acct; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1043 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1044 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1045 static void |
15823 | 1046 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
|
1047 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1048 /* 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
|
1049 GList *l; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1050 |
15823 | 1051 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
|
1052 { |
15823 | 1053 PurpleStatusType *status_type = (PurpleStatusType *)l->data; |
1054 PurpleStatusPrimitive prim; | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1055 |
23273
74f1a07f452b
Don't include 'Listening to music' in the per-account statusbox.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23264
diff
changeset
|
1056 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
|
1057 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
|
1058 continue; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1059 |
23273
74f1a07f452b
Don't include 'Listening to music' in the per-account statusbox.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23264
diff
changeset
|
1060 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
|
1061 |
15514 | 1062 pidgin_status_box_add(PIDGIN_STATUS_BOX(status_box), |
26723
b2b0bd2afcb2
Use stock id where possible.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26712
diff
changeset
|
1063 PIDGIN_STATUS_BOX_TYPE_PRIMITIVE, NULL, |
15823 | 1064 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
|
1065 NULL, |
15823 | 1066 GINT_TO_POINTER(purple_status_type_get_primitive(status_type))); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1067 } |
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 |
18704
c77cf4e8eb65
disapproval of revision '947b20b6fc725a1f22dd7b7b23ebbaee89f0cfed'
Sean Egan <seanegan@gmail.com>
parents:
18270
diff
changeset
|
1070 static void |
c77cf4e8eb65
disapproval of revision '947b20b6fc725a1f22dd7b7b23ebbaee89f0cfed'
Sean Egan <seanegan@gmail.com>
parents:
18270
diff
changeset
|
1071 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
|
1072 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1073 GtkIconSize icon_size; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1074 |
15436 | 1075 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
|
1076 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1077 /* Unset the model while clearing it */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1078 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
|
1079 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
|
1080 /* 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
|
1081 * 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
|
1082 * if we do this here. */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1083 /* 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
|
1084 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1085 if (status_box->account == NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1086 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1087 /* 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
|
1088 * 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
|
1089 */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1090 if (status_box->token_status_account) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1091 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
|
1092 } else { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1093 /* Global */ |
26723
b2b0bd2afcb2
Use stock id where possible.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26712
diff
changeset
|
1094 pidgin_status_box_add(PIDGIN_STATUS_BOX(status_box), PIDGIN_STATUS_BOX_TYPE_PRIMITIVE, NULL, _("Available"), NULL, GINT_TO_POINTER(PURPLE_STATUS_AVAILABLE)); |
b2b0bd2afcb2
Use stock id where possible.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26712
diff
changeset
|
1095 pidgin_status_box_add(PIDGIN_STATUS_BOX(status_box), PIDGIN_STATUS_BOX_TYPE_PRIMITIVE, NULL, _("Away"), NULL, GINT_TO_POINTER(PURPLE_STATUS_AWAY)); |
b2b0bd2afcb2
Use stock id where possible.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26712
diff
changeset
|
1096 pidgin_status_box_add(PIDGIN_STATUS_BOX(status_box), PIDGIN_STATUS_BOX_TYPE_PRIMITIVE, NULL, _("Do not disturb"), NULL, GINT_TO_POINTER(PURPLE_STATUS_UNAVAILABLE)); |
b2b0bd2afcb2
Use stock id where possible.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26712
diff
changeset
|
1097 pidgin_status_box_add(PIDGIN_STATUS_BOX(status_box), PIDGIN_STATUS_BOX_TYPE_PRIMITIVE, NULL, _("Invisible"), NULL, GINT_TO_POINTER(PURPLE_STATUS_INVISIBLE)); |
b2b0bd2afcb2
Use stock id where possible.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26712
diff
changeset
|
1098 pidgin_status_box_add(PIDGIN_STATUS_BOX(status_box), PIDGIN_STATUS_BOX_TYPE_PRIMITIVE, NULL, _("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
|
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 | 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 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1107 status_menu_refresh_iter(status_box); |
15514 | 1108 pidgin_status_box_refresh(status_box); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1109 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1110 } else { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1111 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
|
1112 update_to_reflect_account_status(status_box, status_box->account, |
15823 | 1113 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
|
1114 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1115 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
|
1116 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
|
1117 } |
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 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
|
1120 { |
18704
c77cf4e8eb65
disapproval of revision '947b20b6fc725a1f22dd7b7b23ebbaee89f0cfed'
Sean Egan <seanegan@gmail.com>
parents:
18270
diff
changeset
|
1121 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
|
1122 return TRUE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1123 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1124 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1125 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
|
1126 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1127 if (event->direction == GDK_SCROLL_UP) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1128 gtk_imhtml_page_up(imhtml); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1129 else if (event->direction == GDK_SCROLL_DOWN) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1130 gtk_imhtml_page_down(imhtml); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1131 return TRUE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1132 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1133 |
21913
2a591a5b3322
Make some more event handlers return appropriate gboolean values. This turns
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21560
diff
changeset
|
1134 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
|
1135 { |
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
|
1136 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
|
1137 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1138 /* 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
|
1139 GtkWidget *top = gtk_widget_get_toplevel(w); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1140 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
|
1141 (event->state & GDK_SHIFT_MASK) ? |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1142 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
|
1143 return TRUE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1144 } |
22722
0ccc0e9ae565
Reset typing timeout if arrow keys are pressed when editing status
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22682
diff
changeset
|
1145 if (status_box->typing == 0) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1146 return FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1147 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1148 /* Reset the status if Escape was pressed */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1149 if (event->keyval == GDK_Escape) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1150 { |
26613
b162300ab1e7
A patch from Arunan Balasubramaniam to use timeouts in seconds instead of
foss@abala.me
parents:
25430
diff
changeset
|
1151 purple_timeout_remove(status_box->typing); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1152 status_box->typing = 0; |
26894
3c06cd0e1717
Avoid overwriting the PRIMARY clipboard when we select-on-focus the status text for easy editing. Fixes #8781.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
26801
diff
changeset
|
1153 gtk_imhtml_set_populate_primary_clipboard( |
3c06cd0e1717
Avoid overwriting the PRIMARY clipboard when we select-on-focus the status text for easy editing. Fixes #8781.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
26801
diff
changeset
|
1154 GTK_IMHTML(status_box->imhtml), TRUE); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1155 if (status_box->account != NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1156 update_to_reflect_account_status(status_box, status_box->account, |
15823 | 1157 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
|
1158 else { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1159 status_menu_refresh_iter(status_box); |
15514 | 1160 pidgin_status_box_refresh(status_box); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1161 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1162 return TRUE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1163 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1164 |
15514 | 1165 pidgin_status_box_pulse_typing(status_box); |
26613
b162300ab1e7
A patch from Arunan Balasubramaniam to use timeouts in seconds instead of
foss@abala.me
parents:
25430
diff
changeset
|
1166 purple_timeout_remove(status_box->typing); |
b162300ab1e7
A patch from Arunan Balasubramaniam to use timeouts in seconds instead of
foss@abala.me
parents:
25430
diff
changeset
|
1167 status_box->typing = purple_timeout_add_seconds(TYPING_TIMEOUT, (GSourceFunc)remove_typing_cb, status_box); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1168 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1169 return FALSE; |
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 |
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 | 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 | 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 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1186 static void |
15514 | 1187 cache_pixbufs(PidginStatusBox *status_box) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1188 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1189 GtkIconSize icon_size; |
22183
69ad31c9983d
Fix some small leaks when destroying a statusbox.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22102
diff
changeset
|
1190 int i; |
15938
d04878ce947b
Some pixmap path fixes and win32 fixes
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15880
diff
changeset
|
1191 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1192 g_object_set(G_OBJECT(status_box->icon_rend), "xpad", 3, NULL); |
15436 | 1193 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
|
1194 |
22183
69ad31c9983d
Fix some small leaks when destroying a statusbox.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22102
diff
changeset
|
1195 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
|
1196 if (status_box->connecting_pixbufs[i] != NULL) |
26712
38a5df43d525
Oops, I must have been tired. I only replaced the first occurrence of these
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26705
diff
changeset
|
1197 g_object_unref(G_OBJECT(status_box->connecting_pixbufs[i])); |
26799
12fdc06d73be
Use stock-ids for connecting/typing animations in the statusbox.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26786
diff
changeset
|
1198 if (connecting_stock_ids[i]) |
12fdc06d73be
Use stock-ids for connecting/typing animations in the statusbox.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26786
diff
changeset
|
1199 status_box->connecting_pixbufs[i] = gtk_widget_render_icon (GTK_WIDGET(status_box->vbox), |
12fdc06d73be
Use stock-ids for connecting/typing animations in the statusbox.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26786
diff
changeset
|
1200 connecting_stock_ids[i], icon_size, "PidginStatusBox"); |
12fdc06d73be
Use stock-ids for connecting/typing animations in the statusbox.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26786
diff
changeset
|
1201 else |
12fdc06d73be
Use stock-ids for connecting/typing animations in the statusbox.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26786
diff
changeset
|
1202 status_box->connecting_pixbufs[i] = NULL; |
22183
69ad31c9983d
Fix some small leaks when destroying a statusbox.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22102
diff
changeset
|
1203 } |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1204 status_box->connecting_index = 0; |
24148 | 1205 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1206 |
22183
69ad31c9983d
Fix some small leaks when destroying a statusbox.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22102
diff
changeset
|
1207 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
|
1208 if (status_box->typing_pixbufs[i] != NULL) |
26712
38a5df43d525
Oops, I must have been tired. I only replaced the first occurrence of these
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26705
diff
changeset
|
1209 g_object_unref(G_OBJECT(status_box->typing_pixbufs[i])); |
26799
12fdc06d73be
Use stock-ids for connecting/typing animations in the statusbox.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26786
diff
changeset
|
1210 if (typing_stock_ids[i]) |
12fdc06d73be
Use stock-ids for connecting/typing animations in the statusbox.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26786
diff
changeset
|
1211 status_box->typing_pixbufs[i] = gtk_widget_render_icon (GTK_WIDGET(status_box->vbox), |
12fdc06d73be
Use stock-ids for connecting/typing animations in the statusbox.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26786
diff
changeset
|
1212 typing_stock_ids[i], icon_size, "PidginStatusBox"); |
12fdc06d73be
Use stock-ids for connecting/typing animations in the statusbox.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26786
diff
changeset
|
1213 else |
12fdc06d73be
Use stock-ids for connecting/typing animations in the statusbox.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26786
diff
changeset
|
1214 status_box->typing_pixbufs[i] = NULL; |
22183
69ad31c9983d
Fix some small leaks when destroying a statusbox.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22102
diff
changeset
|
1215 } |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1216 status_box->typing_index = 0; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1217 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1218 |
22676
a73acc0c4dc8
Ignore token_status_account on account-specific status boxes. This should
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22470
diff
changeset
|
1219 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
|
1220 { |
15823 | 1221 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
|
1222 |
22676
a73acc0c4dc8
Ignore token_status_account on account-specific status boxes. This should
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22470
diff
changeset
|
1223 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
|
1224 return; |
a73acc0c4dc8
Ignore token_status_account on account-specific status boxes. This should
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22470
diff
changeset
|
1225 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1226 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
|
1227 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1228 /* Regenerate the list if it has changed */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1229 if (initial_token_acct != status_box->token_status_account) { |
15514 | 1230 pidgin_status_box_regenerate(status_box); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1231 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1232 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1233 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1234 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1235 static void |
15823 | 1236 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
|
1237 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1238 /* Make sure our current status is added to the list of popular statuses */ |
15514 | 1239 pidgin_status_box_regenerate(status_box); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1240 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1241 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1242 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
|
1243 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
|
1244 { |
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
|
1245 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
|
1246 } |
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
|
1247 |
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
|
1248 static void |
15823 | 1249 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
|
1250 gconstpointer value, gpointer data) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1251 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1252 #ifdef USE_GTKSPELL |
15514 | 1253 PidginStatusBox *status_box = (PidginStatusBox *)data; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1254 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1255 if (value) |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15493
diff
changeset
|
1256 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
|
1257 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1258 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1259 GtkSpell *spell; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1260 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
|
1261 gtkspell_detach(spell); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1262 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1263 #endif |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1264 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1265 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1266 #if 0 |
15514 | 1267 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
|
1268 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1269 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1270 if (event->button != 1) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1271 return FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1272 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
|
1273 if (!box->imhtml_visible) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1274 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
|
1275 return TRUE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1276 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1277 |
15514 | 1278 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
|
1279 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1280 if (event->button != 1) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1281 return FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1282 gtk_combo_box_popup(GTK_COMBO_BOX(box)); |
16345
6b4e778ee4b4
Death to // comments.
Richard Laager <rlaager@wiktel.com>
parents:
16323
diff
changeset
|
1283 /* Disabled until button_released_cb works */ |
6b4e778ee4b4
Death to // comments.
Richard Laager <rlaager@wiktel.com>
parents:
16323
diff
changeset
|
1284 #if 0 |
6b4e778ee4b4
Death to // comments.
Richard Laager <rlaager@wiktel.com>
parents:
16323
diff
changeset
|
1285 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
|
1286 #endif |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1287 return TRUE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1288 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1289 #endif |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1290 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1291 static void |
15514 | 1292 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
|
1293 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1294 GdkScreen *screen; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1295 gint monitor_num; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1296 GdkRectangle monitor; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1297 GtkRequisition popup_req; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1298 GtkPolicyType hpolicy, vpolicy; |
15938
d04878ce947b
Some pixmap path fixes and win32 fixes
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15880
diff
changeset
|
1299 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1300 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
|
1301 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1302 *x += GTK_WIDGET(status_box)->allocation.x; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1303 *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
|
1304 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1305 *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
|
1306 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1307 hpolicy = vpolicy = GTK_POLICY_NEVER; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1308 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
|
1309 hpolicy, vpolicy); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1310 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
|
1311 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1312 if (popup_req.width > *width) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1313 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1314 hpolicy = GTK_POLICY_ALWAYS; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1315 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
|
1316 hpolicy, vpolicy); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1317 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
|
1318 } |
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 *height = popup_req.height; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1321 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1322 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
|
1323 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
|
1324 GTK_WIDGET (status_box)->window); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1325 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
|
1326 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1327 if (*x < monitor.x) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1328 *x = monitor.x; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1329 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
|
1330 *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
|
1331 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1332 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
|
1333 *y += GTK_WIDGET(status_box)->allocation.height; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1334 else if (*y - *height >= monitor.y) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1335 *y -= *height; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1336 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
|
1337 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1338 *y += GTK_WIDGET(status_box)->allocation.height; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1339 *height = monitor.y + monitor.height - *y; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1340 } |
15938
d04878ce947b
Some pixmap path fixes and win32 fixes
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15880
diff
changeset
|
1341 else |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1342 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1343 *height = *y - monitor.y; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1344 *y = monitor.y; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1345 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1346 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1347 if (popup_req.height > *height) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1348 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1349 vpolicy = GTK_POLICY_ALWAYS; |
15938
d04878ce947b
Some pixmap path fixes and win32 fixes
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15880
diff
changeset
|
1350 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1351 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
|
1352 hpolicy, vpolicy); |
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 } |
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 gboolean |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1357 popup_grab_on_window (GdkWindow *window, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1358 guint32 activate_time, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1359 gboolean grab_keyboard) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1360 { |
29481
2dcff225172e
Start of killing off unneeded GTK_CHECK_VERSION checks in pidgin. Refs #10024
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28149
diff
changeset
|
1361 if ((gdk_pointer_grab (window, TRUE, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1362 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
|
1363 GDK_POINTER_MOTION_MASK, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1364 NULL, NULL, activate_time) == 0)) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1365 { |
29481
2dcff225172e
Start of killing off unneeded GTK_CHECK_VERSION checks in pidgin. Refs #10024
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28149
diff
changeset
|
1366 if (!grab_keyboard || gdk_keyboard_grab (window, TRUE, activate_time) == 0) |
2dcff225172e
Start of killing off unneeded GTK_CHECK_VERSION checks in pidgin. Refs #10024
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28149
diff
changeset
|
1367 return TRUE; |
2dcff225172e
Start of killing off unneeded GTK_CHECK_VERSION checks in pidgin. Refs #10024
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28149
diff
changeset
|
1368 else { |
2dcff225172e
Start of killing off unneeded GTK_CHECK_VERSION checks in pidgin. Refs #10024
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28149
diff
changeset
|
1369 gdk_display_pointer_ungrab (gdk_drawable_get_display (window), activate_time); |
2dcff225172e
Start of killing off unneeded GTK_CHECK_VERSION checks in pidgin. Refs #10024
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28149
diff
changeset
|
1370 return FALSE; |
2dcff225172e
Start of killing off unneeded GTK_CHECK_VERSION checks in pidgin. Refs #10024
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28149
diff
changeset
|
1371 } |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1372 } |
29481
2dcff225172e
Start of killing off unneeded GTK_CHECK_VERSION checks in pidgin. Refs #10024
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28149
diff
changeset
|
1373 |
2dcff225172e
Start of killing off unneeded GTK_CHECK_VERSION checks in pidgin. Refs #10024
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
28149
diff
changeset
|
1374 return FALSE; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1375 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1376 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1377 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1378 static void |
15514 | 1379 pidgin_status_box_popup(PidginStatusBox *box) |
15374
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 int width, height, x, y; |
15514 | 1382 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
|
1383 |
d04878ce947b
Some pixmap path fixes and win32 fixes
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15880
diff
changeset
|
1384 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
|
1385 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
|
1386 gtk_widget_show(box->popup_window); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1387 gtk_widget_grab_focus (box->tree_view); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1388 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
|
1389 GDK_CURRENT_TIME, TRUE)) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1390 gtk_widget_hide (box->popup_window); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1391 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1392 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1393 gtk_grab_add (box->popup_window); |
20322
aad0f10eb4dc
applied changes from 1bdf4754abed6b49eec400ecf415a9d557bc9834
Luke Schierer <lschiere@pidgin.im>
parents:
20074
diff
changeset
|
1394 /*box->popup_in_progress = TRUE;*/ |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1395 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
|
1396 TRUE); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1397 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1398 if (box->active_row) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1399 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
|
1400 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
|
1401 gtk_tree_path_free(path); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1402 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1403 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1404 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1405 static void |
20322
aad0f10eb4dc
applied changes from 1bdf4754abed6b49eec400ecf415a9d557bc9834
Luke Schierer <lschiere@pidgin.im>
parents:
20074
diff
changeset
|
1406 pidgin_status_box_popdown(PidginStatusBox *box) |
aad0f10eb4dc
applied changes from 1bdf4754abed6b49eec400ecf415a9d557bc9834
Luke Schierer <lschiere@pidgin.im>
parents:
20074
diff
changeset
|
1407 { |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1408 gtk_widget_hide(box->popup_window); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1409 box->popup_in_progress = FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1410 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
|
1411 FALSE); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1412 gtk_grab_remove (box->popup_window); |
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 |
20322
aad0f10eb4dc
applied changes from 1bdf4754abed6b49eec400ecf415a9d557bc9834
Luke Schierer <lschiere@pidgin.im>
parents:
20074
diff
changeset
|
1415 static gboolean |
aad0f10eb4dc
applied changes from 1bdf4754abed6b49eec400ecf415a9d557bc9834
Luke Schierer <lschiere@pidgin.im>
parents:
20074
diff
changeset
|
1416 toggle_key_press_cb(GtkWidget *widget, GdkEventKey *event, PidginStatusBox *box) |
aad0f10eb4dc
applied changes from 1bdf4754abed6b49eec400ecf415a9d557bc9834
Luke Schierer <lschiere@pidgin.im>
parents:
20074
diff
changeset
|
1417 { |
aad0f10eb4dc
applied changes from 1bdf4754abed6b49eec400ecf415a9d557bc9834
Luke Schierer <lschiere@pidgin.im>
parents:
20074
diff
changeset
|
1418 switch (event->keyval) { |
aad0f10eb4dc
applied changes from 1bdf4754abed6b49eec400ecf415a9d557bc9834
Luke Schierer <lschiere@pidgin.im>
parents:
20074
diff
changeset
|
1419 case GDK_Return: |
aad0f10eb4dc
applied changes from 1bdf4754abed6b49eec400ecf415a9d557bc9834
Luke Schierer <lschiere@pidgin.im>
parents:
20074
diff
changeset
|
1420 case GDK_KP_Enter: |
aad0f10eb4dc
applied changes from 1bdf4754abed6b49eec400ecf415a9d557bc9834
Luke Schierer <lschiere@pidgin.im>
parents:
20074
diff
changeset
|
1421 case GDK_KP_Space: |
aad0f10eb4dc
applied changes from 1bdf4754abed6b49eec400ecf415a9d557bc9834
Luke Schierer <lschiere@pidgin.im>
parents:
20074
diff
changeset
|
1422 case GDK_space: |
aad0f10eb4dc
applied changes from 1bdf4754abed6b49eec400ecf415a9d557bc9834
Luke Schierer <lschiere@pidgin.im>
parents:
20074
diff
changeset
|
1423 if (!box->popup_in_progress) { |
aad0f10eb4dc
applied changes from 1bdf4754abed6b49eec400ecf415a9d557bc9834
Luke Schierer <lschiere@pidgin.im>
parents:
20074
diff
changeset
|
1424 pidgin_status_box_popup (box); |
aad0f10eb4dc
applied changes from 1bdf4754abed6b49eec400ecf415a9d557bc9834
Luke Schierer <lschiere@pidgin.im>
parents:
20074
diff
changeset
|
1425 box->popup_in_progress = TRUE; |
aad0f10eb4dc
applied changes from 1bdf4754abed6b49eec400ecf415a9d557bc9834
Luke Schierer <lschiere@pidgin.im>
parents:
20074
diff
changeset
|
1426 } else { |
aad0f10eb4dc
applied changes from 1bdf4754abed6b49eec400ecf415a9d557bc9834
Luke Schierer <lschiere@pidgin.im>
parents:
20074
diff
changeset
|
1427 pidgin_status_box_popdown(box); |
aad0f10eb4dc
applied changes from 1bdf4754abed6b49eec400ecf415a9d557bc9834
Luke Schierer <lschiere@pidgin.im>
parents:
20074
diff
changeset
|
1428 } |
aad0f10eb4dc
applied changes from 1bdf4754abed6b49eec400ecf415a9d557bc9834
Luke Schierer <lschiere@pidgin.im>
parents:
20074
diff
changeset
|
1429 return TRUE; |
aad0f10eb4dc
applied changes from 1bdf4754abed6b49eec400ecf415a9d557bc9834
Luke Schierer <lschiere@pidgin.im>
parents:
20074
diff
changeset
|
1430 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
|
1431 return FALSE; |
20322
aad0f10eb4dc
applied changes from 1bdf4754abed6b49eec400ecf415a9d557bc9834
Luke Schierer <lschiere@pidgin.im>
parents:
20074
diff
changeset
|
1432 } |
aad0f10eb4dc
applied changes from 1bdf4754abed6b49eec400ecf415a9d557bc9834
Luke Schierer <lschiere@pidgin.im>
parents:
20074
diff
changeset
|
1433 } |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1434 |
20322
aad0f10eb4dc
applied changes from 1bdf4754abed6b49eec400ecf415a9d557bc9834
Luke Schierer <lschiere@pidgin.im>
parents:
20074
diff
changeset
|
1435 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
|
1436 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
|
1437 { |
20322
aad0f10eb4dc
applied changes from 1bdf4754abed6b49eec400ecf415a9d557bc9834
Luke Schierer <lschiere@pidgin.im>
parents:
20074
diff
changeset
|
1438 if (!box->popup_in_progress) |
aad0f10eb4dc
applied changes from 1bdf4754abed6b49eec400ecf415a9d557bc9834
Luke Schierer <lschiere@pidgin.im>
parents:
20074
diff
changeset
|
1439 pidgin_status_box_popup (box); |
aad0f10eb4dc
applied changes from 1bdf4754abed6b49eec400ecf415a9d557bc9834
Luke Schierer <lschiere@pidgin.im>
parents:
20074
diff
changeset
|
1440 else |
aad0f10eb4dc
applied changes from 1bdf4754abed6b49eec400ecf415a9d557bc9834
Luke Schierer <lschiere@pidgin.im>
parents:
20074
diff
changeset
|
1441 pidgin_status_box_popdown(box); |
aad0f10eb4dc
applied changes from 1bdf4754abed6b49eec400ecf415a9d557bc9834
Luke Schierer <lschiere@pidgin.im>
parents:
20074
diff
changeset
|
1442 return TRUE; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1443 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1444 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1445 static void |
15514 | 1446 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
|
1447 { |
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
|
1448 PurpleStoredImage *img = NULL; |
15374
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 if (box->account) { |
15823 | 1451 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
|
1452 if (plug) { |
15823 | 1453 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
|
1454 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
|
1455 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
|
1456 size_t len = 0; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1457 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
|
1458 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
|
1459 img = purple_buddy_icons_set_account_icon(box->account, data, len); |
25890
9c0337d4b878
Fix the crash/leaks in statusbox
Paul Aurich <paul@darkrain42.org>
parents:
24231
diff
changeset
|
1460 if (img) |
9c0337d4b878
Fix the crash/leaks in statusbox
Paul Aurich <paul@darkrain42.org>
parents:
24231
diff
changeset
|
1461 /* |
9c0337d4b878
Fix the crash/leaks in statusbox
Paul Aurich <paul@darkrain42.org>
parents:
24231
diff
changeset
|
1462 * set_account_icon doesn't give us a reference, but we |
9c0337d4b878
Fix the crash/leaks in statusbox
Paul Aurich <paul@darkrain42.org>
parents:
24231
diff
changeset
|
1463 * unref one below (for the other code path) |
9c0337d4b878
Fix the crash/leaks in statusbox
Paul Aurich <paul@darkrain42.org>
parents:
24231
diff
changeset
|
1464 */ |
9c0337d4b878
Fix the crash/leaks in statusbox
Paul Aurich <paul@darkrain42.org>
parents:
24231
diff
changeset
|
1465 purple_imgstore_ref(img); |
9c0337d4b878
Fix the crash/leaks in statusbox
Paul Aurich <paul@darkrain42.org>
parents:
24231
diff
changeset
|
1466 |
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
|
1467 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
|
1468 |
15823 | 1469 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
|
1470 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1471 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1472 } else { |
18063
926ccb104da0
disapproval of revision '1411afd7660760db59966c3a9f18e2adab8eb27e'
Richard Laager <rlaager@wiktel.com>
parents:
18058
diff
changeset
|
1473 GList *accounts; |
15823 | 1474 for (accounts = purple_accounts_get_all(); accounts != NULL; accounts = accounts->next) { |
1475 PurpleAccount *account = accounts->data; | |
1476 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
|
1477 if (plug) { |
15823 | 1478 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
|
1479 if (prplinfo != NULL && |
15823 | 1480 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
|
1481 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
|
1482 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
|
1483 size_t len = 0; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1484 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
|
1485 data = pidgin_convert_buddy_icon(plug, filename, &len); |
25890
9c0337d4b878
Fix the crash/leaks in statusbox
Paul Aurich <paul@darkrain42.org>
parents:
24231
diff
changeset
|
1486 purple_buddy_icons_set_account_icon(account, data, 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
|
1487 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
|
1488 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1489 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1490 } |
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
|
1491 |
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
|
1492 /* 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
|
1493 if (filename != NULL) |
25890
9c0337d4b878
Fix the crash/leaks in statusbox
Paul Aurich <paul@darkrain42.org>
parents:
24231
diff
changeset
|
1494 img = purple_imgstore_new_from_file(filename); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1495 } |
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
|
1496 |
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
|
1497 pidgin_status_box_set_buddy_icon(box, img); |
25890
9c0337d4b878
Fix the crash/leaks in statusbox
Paul Aurich <paul@darkrain42.org>
parents:
24231
diff
changeset
|
1498 if (img) |
9c0337d4b878
Fix the crash/leaks in statusbox
Paul Aurich <paul@darkrain42.org>
parents:
24231
diff
changeset
|
1499 purple_imgstore_unref(img); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1500 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1501 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1502 static void |
15514 | 1503 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
|
1504 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1505 if (box->account == NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1506 /* 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
|
1507 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
|
1508 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1509 buddy_icon_set_cb(NULL, box); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1510 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1511 gtk_widget_destroy(box->icon_box_menu); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1512 box->icon_box_menu = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1513 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1514 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1515 static void |
26968
1788bc69ba7b
A patch from nops to add a "Select Buddy Icon" (my term, the original patch
Richard Laager <rlaager@wiktel.com>
parents:
26911
diff
changeset
|
1516 choose_buddy_icon_cb(GtkWidget *w, PidginStatusBox *box) |
1788bc69ba7b
A patch from nops to add a "Select Buddy Icon" (my term, the original patch
Richard Laager <rlaager@wiktel.com>
parents:
26911
diff
changeset
|
1517 { |
1788bc69ba7b
A patch from nops to add a "Select Buddy Icon" (my term, the original patch
Richard Laager <rlaager@wiktel.com>
parents:
26911
diff
changeset
|
1518 if (box->buddy_icon_sel) { |
1788bc69ba7b
A patch from nops to add a "Select Buddy Icon" (my term, the original patch
Richard Laager <rlaager@wiktel.com>
parents:
26911
diff
changeset
|
1519 gtk_window_present(GTK_WINDOW(box->buddy_icon_sel)); |
1788bc69ba7b
A patch from nops to add a "Select Buddy Icon" (my term, the original patch
Richard Laager <rlaager@wiktel.com>
parents:
26911
diff
changeset
|
1520 } else { |
1788bc69ba7b
A patch from nops to add a "Select Buddy Icon" (my term, the original patch
Richard Laager <rlaager@wiktel.com>
parents:
26911
diff
changeset
|
1521 box->buddy_icon_sel = pidgin_buddy_icon_chooser_new(GTK_WINDOW(gtk_widget_get_toplevel(w)), icon_choose_cb, box); |
1788bc69ba7b
A patch from nops to add a "Select Buddy Icon" (my term, the original patch
Richard Laager <rlaager@wiktel.com>
parents:
26911
diff
changeset
|
1522 gtk_widget_show_all(box->buddy_icon_sel); |
1788bc69ba7b
A patch from nops to add a "Select Buddy Icon" (my term, the original patch
Richard Laager <rlaager@wiktel.com>
parents:
26911
diff
changeset
|
1523 } |
1788bc69ba7b
A patch from nops to add a "Select Buddy Icon" (my term, the original patch
Richard Laager <rlaager@wiktel.com>
parents:
26911
diff
changeset
|
1524 } |
1788bc69ba7b
A patch from nops to add a "Select Buddy Icon" (my term, the original patch
Richard Laager <rlaager@wiktel.com>
parents:
26911
diff
changeset
|
1525 |
1788bc69ba7b
A patch from nops to add a "Select Buddy Icon" (my term, the original patch
Richard Laager <rlaager@wiktel.com>
parents:
26911
diff
changeset
|
1526 static void |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1527 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
|
1528 { |
15514 | 1529 PidginStatusBox *box = data; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1530 if (filename) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1531 if (box->account == NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1532 /* 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
|
1533 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
|
1534 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1535 buddy_icon_set_cb(filename, box); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1536 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1537 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1538 box->buddy_icon_sel = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1539 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1540 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1541 static void |
15823 | 1542 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
|
1543 gconstpointer value, gpointer data) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1544 { |
15514 | 1545 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
|
1546 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1547 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1548 static void |
15514 | 1549 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
|
1550 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1551 if (status_box->active_row) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1552 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
|
1553 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1554 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
|
1555 pidgin_status_box_popdown (status_box); |
15514 | 1556 pidgin_status_box_changed(status_box); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1557 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1558 |
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
|
1559 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
|
1560 { |
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
|
1561 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
|
1562 |
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
|
1563 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
|
1564 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
|
1565 |
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
|
1566 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
|
1567 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
|
1568 } |
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
|
1569 |
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
|
1570 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
|
1571 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
|
1572 { |
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
|
1573 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
|
1574 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
|
1575 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
|
1576 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
|
1577 |
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
|
1578 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
|
1579 /* 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
|
1580 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
|
1581 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
|
1582 } |
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
|
1583 |
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
|
1584 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
|
1585 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
|
1586 |
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
|
1587 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
|
1588 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
|
1589 -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
|
1590 |
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
|
1591 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
|
1592 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
|
1593 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
|
1594 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
|
1595 |
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
|
1596 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
|
1597 |
21099
51cf02dbdb0e
disapproval of revision 'c484d979c4fda4433a9633ff8b69bd8a395c9479'
Richard Laager <rlaager@wiktel.com>
parents:
21095
diff
changeset
|
1598 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
|
1599 NULL, NULL, NULL, |
21099
51cf02dbdb0e
disapproval of revision 'c484d979c4fda4433a9633ff8b69bd8a395c9479'
Richard Laager <rlaager@wiktel.com>
parents:
21095
diff
changeset
|
1600 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
|
1601 _("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
|
1602 _("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
|
1603 |
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
|
1604 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
|
1605 |
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
|
1606 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
|
1607 } |
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
|
1608 |
15938
d04878ce947b
Some pixmap path fixes and win32 fixes
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15880
diff
changeset
|
1609 static gboolean |
d04878ce947b
Some pixmap path fixes and win32 fixes
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15880
diff
changeset
|
1610 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
|
1611 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1612 GtkTreePath *path = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1613 int ret; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1614 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
|
1615 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1616 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
|
1617 if (ewidget == status_box->toggle_button && |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1618 status_box->popup_in_progress && |
17038
2c5654d1a17a
disapproval of revision '105009e066f1bcaefb0af3bd1e17b7860bf12a57'
Daniel Atallah <daniel.atallah@gmail.com>
parents:
17037
diff
changeset
|
1619 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
|
1620 pidgin_status_box_popdown (status_box); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1621 return TRUE; |
19482
3b61b5279a56
Allow you to click on statusbox again and keep it open.
Sean Egan <seanegan@gmail.com>
parents:
19396
diff
changeset
|
1622 } else if (ewidget == status_box->toggle_button) { |
25415
584063555949
Remove trailing whitespace
Mark Doliner <mark@kingant.net>
parents:
24231
diff
changeset
|
1623 status_box->popup_in_progress = TRUE; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1624 } |
15938
d04878ce947b
Some pixmap path fixes and win32 fixes
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15880
diff
changeset
|
1625 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1626 /* 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
|
1627 if (ewidget != status_box->toggle_button) { |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15493
diff
changeset
|
1628 pidgin_status_box_popdown (status_box); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1629 return TRUE; |
19482
3b61b5279a56
Allow you to click on statusbox again and keep it open.
Sean Egan <seanegan@gmail.com>
parents:
19396
diff
changeset
|
1630 } |
15938
d04878ce947b
Some pixmap path fixes and win32 fixes
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15880
diff
changeset
|
1631 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1632 return FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1633 } |
15938
d04878ce947b
Some pixmap path fixes and win32 fixes
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15880
diff
changeset
|
1634 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1635 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
|
1636 event->x, event->y, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1637 &path, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1638 NULL, NULL, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1639 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1640 if (!ret) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1641 return TRUE; /* clicked outside window? */ |
15938
d04878ce947b
Some pixmap path fixes and win32 fixes
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15880
diff
changeset
|
1642 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1643 treeview_activate_current_selection(status_box, path); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1644 gtk_tree_path_free (path); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1645 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1646 return TRUE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1647 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1648 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1649 static gboolean |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1650 treeview_key_press_event(GtkWidget *widget, |
15514 | 1651 GdkEventKey *event, PidginStatusBox *box) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1652 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1653 if (box->popup_in_progress) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1654 if (event->keyval == GDK_Escape) { |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15493
diff
changeset
|
1655 pidgin_status_box_popdown(box); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1656 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
|
1657 } else { |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1658 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
|
1659 GtkTreeIter iter; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1660 GtkTreePath *path; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1661 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1662 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
|
1663 gboolean ret = TRUE; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1664 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
|
1665 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
|
1666 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
|
1667 } 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
|
1668 tree_view_delete_current_selection(box, path); |
18196
a4dee68e040f
Let non-delete keys operate.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
18193
diff
changeset
|
1669 } else |
a4dee68e040f
Let non-delete keys operate.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
18193
diff
changeset
|
1670 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
|
1671 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1672 gtk_tree_path_free (path); |
18196
a4dee68e040f
Let non-delete keys operate.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
18193
diff
changeset
|
1673 return ret; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1674 } |
25415
584063555949
Remove trailing whitespace
Mark Doliner <mark@kingant.net>
parents:
24231
diff
changeset
|
1675 } |
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 return FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1678 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1679 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1680 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
|
1681 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
|
1682 GtkWidget *widget) |
0ccc0e9ae565
Reset typing timeout if arrow keys are pressed when editing status
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22682
diff
changeset
|
1683 { |
0ccc0e9ae565
Reset typing timeout if arrow keys are pressed when editing status
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22682
diff
changeset
|
1684 /* 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
|
1685 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
|
1686 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
|
1687 return; |
0ccc0e9ae565
Reset typing timeout if arrow keys are pressed when editing status
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22682
diff
changeset
|
1688 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
|
1689 } |
0ccc0e9ae565
Reset typing timeout if arrow keys are pressed when editing status
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22682
diff
changeset
|
1690 |
0ccc0e9ae565
Reset typing timeout if arrow keys are pressed when editing status
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22682
diff
changeset
|
1691 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
|
1692 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
|
1693 { |
07aa8e4a262a
Arrow keys in status menu should skip separator lines. Closes #1360.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22835
diff
changeset
|
1694 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
|
1695 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
|
1696 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
|
1697 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
|
1698 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
|
1699 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
|
1700 |
07aa8e4a262a
Arrow keys in status menu should skip separator lines. Closes #1360.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22835
diff
changeset
|
1701 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
|
1702 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
|
1703 /* 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
|
1704 return; |
07aa8e4a262a
Arrow keys in status menu should skip separator lines. Closes #1360.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22835
diff
changeset
|
1705 } |
07aa8e4a262a
Arrow keys in status menu should skip separator lines. Closes #1360.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22835
diff
changeset
|
1706 } else { |
07aa8e4a262a
Arrow keys in status menu should skip separator lines. Closes #1360.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22835
diff
changeset
|
1707 /* 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
|
1708 return; |
07aa8e4a262a
Arrow keys in status menu should skip separator lines. Closes #1360.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22835
diff
changeset
|
1709 } |
07aa8e4a262a
Arrow keys in status menu should skip separator lines. Closes #1360.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22835
diff
changeset
|
1710 |
07aa8e4a262a
Arrow keys in status menu should skip separator lines. Closes #1360.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22835
diff
changeset
|
1711 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
|
1712 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
|
1713 /* 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
|
1714 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
|
1715 return; |
07aa8e4a262a
Arrow keys in status menu should skip separator lines. Closes #1360.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22835
diff
changeset
|
1716 } |
07aa8e4a262a
Arrow keys in status menu should skip separator lines. Closes #1360.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22835
diff
changeset
|
1717 |
07aa8e4a262a
Arrow keys in status menu should skip separator lines. Closes #1360.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22835
diff
changeset
|
1718 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
|
1719 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
|
1720 /* 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
|
1721 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
|
1722 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
|
1723 } 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
|
1724 /* 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
|
1725 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
|
1726 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
|
1727 } |
07aa8e4a262a
Arrow keys in status menu should skip separator lines. Closes #1360.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22835
diff
changeset
|
1728 |
07aa8e4a262a
Arrow keys in status menu should skip separator lines. Closes #1360.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22835
diff
changeset
|
1729 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
|
1730 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
|
1731 } |
07aa8e4a262a
Arrow keys in status menu should skip separator lines. Closes #1360.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22835
diff
changeset
|
1732 |
07aa8e4a262a
Arrow keys in status menu should skip separator lines. Closes #1360.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22835
diff
changeset
|
1733 static void |
15514 | 1734 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
|
1735 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1736 GtkCellRenderer *text_rend; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1737 GtkCellRenderer *icon_rend; |
16296
78f798d99d3a
Saved icon for saved statuses in statusbox
Sean Egan <seanegan@gmail.com>
parents:
16270
diff
changeset
|
1738 GtkCellRenderer *emblem_rend; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1739 GtkTextBuffer *buffer; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1740 GtkWidget *toplevel; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1741 GtkTreeSelection *sel; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1742 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1743 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
|
1744 status_box->imhtml_visible = FALSE; |
15823 | 1745 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
|
1746 status_box->connecting = FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1747 status_box->typing = 0; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1748 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
|
1749 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
|
1750 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
|
1751 status_box->vsep = gtk_vseparator_new(); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1752 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
|
1753 |
26723
b2b0bd2afcb2
Use stock id where possible.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26712
diff
changeset
|
1754 status_box->store = gtk_list_store_new(NUM_COLUMNS, G_TYPE_INT, G_TYPE_STRING, 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
|
1755 G_TYPE_STRING, G_TYPE_POINTER, GDK_TYPE_PIXBUF, G_TYPE_BOOLEAN); |
26723
b2b0bd2afcb2
Use stock id where possible.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26712
diff
changeset
|
1756 status_box->dropdown_store = gtk_list_store_new(NUM_COLUMNS, G_TYPE_INT, G_TYPE_STRING, GDK_TYPE_PIXBUF, G_TYPE_STRING, |
16296
78f798d99d3a
Saved icon for saved statuses in statusbox
Sean Egan <seanegan@gmail.com>
parents:
16270
diff
changeset
|
1757 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
|
1758 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1759 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
|
1760 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
|
1761 |
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
|
1762 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
|
1763 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1764 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
|
1765 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
|
1766 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
|
1767 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
|
1768 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
|
1769 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
|
1770 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1771 text_rend = gtk_cell_renderer_text_new(); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1772 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
|
1773 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
|
1774 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
|
1775 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1776 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
|
1777 if (GTK_IS_WINDOW (toplevel)) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1778 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
|
1779 GTK_WINDOW (toplevel)); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1780 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1781 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1782 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
|
1783 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
|
1784 GDK_WINDOW_TYPE_HINT_POPUP_MENU); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1785 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
|
1786 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
|
1787 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
|
1788 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
|
1789 GTK_SHADOW_ETCHED_IN); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1790 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
|
1791 status_box->popup_frame); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1792 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1793 gtk_widget_show (status_box->popup_frame); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1794 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1795 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
|
1796 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1797 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
|
1798 GTK_POLICY_NEVER, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1799 GTK_POLICY_NEVER); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1800 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
|
1801 GTK_SHADOW_NONE); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1802 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1803 gtk_widget_show (status_box->scrolled_window); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1804 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1805 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
|
1806 status_box->scrolled_window); |
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 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
|
1809 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
|
1810 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
|
1811 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
|
1812 FALSE); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1813 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
|
1814 TRUE); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1815 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
|
1816 GTK_TREE_MODEL(status_box->dropdown_store)); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1817 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
|
1818 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
|
1819 status_box->column); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1820 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
|
1821 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
|
1822 gtk_tree_view_column_pack_start(status_box->column, emblem_rend, FALSE); |
26799
12fdc06d73be
Use stock-ids for connecting/typing animations in the statusbox.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26786
diff
changeset
|
1823 gtk_tree_view_column_set_attributes(status_box->column, icon_rend, "stock-id", ICON_STOCK_COLUMN, NULL); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1824 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
|
1825 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
|
1826 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
|
1827 gtk_widget_show(status_box->tree_view); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1828 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
|
1829 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
|
1830 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
|
1831 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1832 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
|
1833 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1834 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
|
1835 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
|
1836 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
|
1837 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
|
1838 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
|
1839 gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(status_box->cell_view), emblem_rend, FALSE); |
26799
12fdc06d73be
Use stock-ids for connecting/typing animations in the statusbox.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26786
diff
changeset
|
1840 gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(status_box->cell_view), status_box->icon_rend, "stock-id", ICON_STOCK_COLUMN, NULL); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1841 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
|
1842 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
|
1843 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
|
1844 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1845 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
|
1846 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
|
1847 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
|
1848 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1849 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
|
1850 #if 0 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1851 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
|
1852 G_CALLBACK(button_pressed_cb), status_box); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1853 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
|
1854 G_CALLBACK(button_released_cb), status_box); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1855 #endif |
20322
aad0f10eb4dc
applied changes from 1bdf4754abed6b49eec400ecf415a9d557bc9834
Luke Schierer <lschiere@pidgin.im>
parents:
20074
diff
changeset
|
1856 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
|
1857 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
|
1858 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
|
1859 G_CALLBACK(toggled_cb), status_box); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1860 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
|
1861 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
|
1862 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
|
1863 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
|
1864 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
|
1865 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
|
1866 G_CALLBACK(imhtml_remove_focus), status_box); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1867 g_signal_connect_swapped(G_OBJECT(status_box->imhtml), "message_send", G_CALLBACK(remove_typing_cb), status_box); |
26895
5f9c475b57ca
Don't set the statusbox imhtml to be editable twice.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
26894
diff
changeset
|
1868 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1869 #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
|
1870 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
|
1871 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
|
1872 #endif |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1873 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
|
1874 gtk_widget_show_all(status_box->vbox); |
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_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
|
1877 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1878 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
|
1879 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1880 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
|
1881 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
|
1882 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
|
1883 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
|
1884 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
|
1885 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
|
1886 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
|
1887 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1888 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
|
1889 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1890 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
|
1891 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1892 cache_pixbufs(status_box); |
15514 | 1893 pidgin_status_box_regenerate(status_box); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1894 |
15823 | 1895 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
|
1896 status_box, |
15823 | 1897 PURPLE_CALLBACK(current_savedstatus_changed_cb), |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1898 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
|
1899 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
|
1900 "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
|
1901 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
|
1902 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
|
1903 "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
|
1904 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
|
1905 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
|
1906 "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
|
1907 PURPLE_CALLBACK(saved_status_updated_cb), status_box); |
15823 | 1908 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
|
1909 PURPLE_CALLBACK(account_enabled_cb), |
2c5654d1a17a
disapproval of revision '105009e066f1bcaefb0af3bd1e17b7860bf12a57'
Daniel Atallah <daniel.atallah@gmail.com>
parents:
17037
diff
changeset
|
1910 status_box); |
15823 | 1911 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
|
1912 PURPLE_CALLBACK(account_enabled_cb), |
2c5654d1a17a
disapproval of revision '105009e066f1bcaefb0af3bd1e17b7860bf12a57'
Daniel Atallah <daniel.atallah@gmail.com>
parents:
17037
diff
changeset
|
1913 status_box); |
15823 | 1914 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
|
1915 PURPLE_CALLBACK(account_status_changed_cb), |
2c5654d1a17a
disapproval of revision '105009e066f1bcaefb0af3bd1e17b7860bf12a57'
Daniel Atallah <daniel.atallah@gmail.com>
parents:
17037
diff
changeset
|
1916 status_box); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1917 |
16062
07554cc5d090
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <stu@nosnilmot.com>
parents:
15938
diff
changeset
|
1918 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
|
1919 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
|
1920 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
|
1921 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
|
1922 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
|
1923 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
|
1924 |
15374
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 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1927 static void |
15514 | 1928 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
|
1929 GtkRequisition *requisition) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1930 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1931 GtkRequisition box_req; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1932 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
|
1933 |
15514 | 1934 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
|
1935 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1936 /* Make this icon the same size as other buddy icons in the list; unless it already wants to be bigger */ |
15413 | 1937 requisition->height = MAX(requisition->height, 34); |
1938 requisition->height += border_width * 2; | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1939 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1940 /* If the gtkimhtml is visible, then add some additional padding */ |
15514 | 1941 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
|
1942 if (box_req.height > 1) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1943 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
|
1944 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1945 requisition->width = 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1946 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1947 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1948 /* From gnome-panel */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1949 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1950 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
|
1951 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1952 gint i, j; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1953 gint width, height, has_alpha, srcrowstride, destrowstride; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1954 guchar *target_pixels; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1955 guchar *original_pixels; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1956 guchar *pixsrc; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1957 guchar *pixdest; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1958 int val; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1959 guchar r,g,b; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1960 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1961 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
|
1962 width = gdk_pixbuf_get_width (src); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1963 height = gdk_pixbuf_get_height (src); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1964 srcrowstride = gdk_pixbuf_get_rowstride (src); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1965 destrowstride = gdk_pixbuf_get_rowstride (dest); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1966 target_pixels = gdk_pixbuf_get_pixels (dest); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1967 original_pixels = gdk_pixbuf_get_pixels (src); |
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 for (i = 0; i < height; i++) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1970 pixdest = target_pixels + i*destrowstride; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1971 pixsrc = original_pixels + i*srcrowstride; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1972 for (j = 0; j < width; j++) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1973 r = *(pixsrc++); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1974 g = *(pixsrc++); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1975 b = *(pixsrc++); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1976 val = r + shift; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1977 *(pixdest++) = CLAMP(val, 0, 255); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1978 val = g + shift; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1979 *(pixdest++) = CLAMP(val, 0, 255); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1980 val = b + shift; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1981 *(pixdest++) = CLAMP(val, 0, 255); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1982 if (has_alpha) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1983 *(pixdest++) = *(pixsrc++); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1984 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1985 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1986 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1987 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1988 static void |
15514 | 1989 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
|
1990 GtkAllocation *allocation) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1991 { |
15514 | 1992 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
|
1993 GtkRequisition req = {0,0}; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1994 GtkAllocation parent_alc, box_alc, icon_alc; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1995 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
|
1996 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1997 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
|
1998 /* 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
|
1999 |
15413 | 2000 req.height = MAX(req.height, 34); |
2001 req.height += border_width * 2; | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2002 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2003 box_alc = *allocation; |
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 box_alc.width -= (border_width * 2); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2006 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
|
2007 box_alc.x += border_width; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2008 box_alc.y += req.height + border_width; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2009 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
|
2010 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2011 parent_alc = *allocation; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2012 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
|
2013 parent_alc.width -= (border_width * 2); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2014 parent_alc.x += border_width; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2015 parent_alc.y += border_width; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2016 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2017 if (status_box->icon_box) |
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 parent_alc.width -= (parent_alc.height + border_width); |
15413 | 2020 icon_alc = parent_alc; |
16098 | 2021 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
|
2022 icon_alc.width = icon_alc.height; |
27222
e4421eaae7dd
Leave the icon always on the right (regardless of language direction).
Paul Aurich <paul@darkrain42.org>
parents:
27219
diff
changeset
|
2023 icon_alc.x = allocation->width - (icon_alc.width + border_width + 1); |
15413 | 2024 icon_alc.y += 1; |
15374
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 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
|
2027 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2028 status_box->icon_size = icon_alc.height; |
15514 | 2029 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
|
2030 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2031 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
|
2032 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2033 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
|
2034 widget->allocation = *allocation; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2035 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2036 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2037 static gboolean |
15514 | 2038 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
|
2039 GdkEventExpose *event) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2040 { |
15514 | 2041 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
|
2042 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
|
2043 gtk_container_propagate_expose(GTK_CONTAINER(widget), status_box->toggle_button, event); |
15413 | 2044 if (status_box->icon_box && status_box->icon_opaque) { |
2045 gtk_paint_box(widget->style, widget->window, GTK_STATE_NORMAL, GTK_SHADOW_OUT, NULL, | |
2046 status_box->icon_box, "button", status_box->icon_box->allocation.x-1, status_box->icon_box->allocation.y-1, | |
2047 34, 34); | |
15938
d04878ce947b
Some pixmap path fixes and win32 fixes
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15880
diff
changeset
|
2048 } |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2049 return FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2050 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2051 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2052 static void |
15514 | 2053 pidgin_status_box_forall(GtkContainer *container, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2054 gboolean include_internals, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2055 GtkCallback callback, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2056 gpointer callback_data) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2057 { |
15514 | 2058 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
|
2059 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2060 if (include_internals) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2061 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2062 (* callback) (status_box->vbox, callback_data); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2063 (* callback) (status_box->toggle_button, callback_data); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2064 (* callback) (status_box->arrow, callback_data); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2065 if (status_box->icon_box) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2066 (* callback) (status_box->icon_box, callback_data); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2067 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2068 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2069 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2070 GtkWidget * |
15514 | 2071 pidgin_status_box_new() |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2072 { |
15514 | 2073 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
|
2074 "iconsel", TRUE, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2075 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2076 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2077 GtkWidget * |
15823 | 2078 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
|
2079 { |
15514 | 2080 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
|
2081 "iconsel", TRUE, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2082 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2083 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2084 /** |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2085 * Add a row to the dropdown menu. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2086 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2087 * @param status_box The status box itself. |
15514 | 2088 * @param type A PidginStatusBoxItemType. |
26723
b2b0bd2afcb2
Use stock id where possible.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26712
diff
changeset
|
2089 * @param pixbuf The icon to associate with this row in the menu. The |
b2b0bd2afcb2
Use stock id where possible.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26712
diff
changeset
|
2090 * function will try to decide a pixbuf if none is given. |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2091 * @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
|
2092 * 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
|
2093 * the saved statuses, this is something like |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2094 * "My favorite away message!" This should be |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2095 * plaintext (non-markedup) (this function escapes it). |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2096 * @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
|
2097 * 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
|
2098 * 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
|
2099 * (non-markedup) (this function escapes it). |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2100 * @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
|
2101 * menu. For primitives this is the value of the |
15823 | 2102 * 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
|
2103 * creation timestamp. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2104 */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2105 void |
26723
b2b0bd2afcb2
Use stock id where possible.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26712
diff
changeset
|
2106 pidgin_status_box_add(PidginStatusBox *status_box, PidginStatusBoxItemType type, GdkPixbuf *pixbuf, |
b2b0bd2afcb2
Use stock id where possible.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26712
diff
changeset
|
2107 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
|
2108 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2109 GtkTreeIter iter; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2110 char *text; |
26723
b2b0bd2afcb2
Use stock id where possible.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26712
diff
changeset
|
2111 const char *stock = NULL; |
15374
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 if (desc == NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2114 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2115 text = g_markup_escape_text(title, -1); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2116 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2117 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2118 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2119 GtkStyle *style; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2120 char aa_color[8]; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2121 gchar *escaped_title, *escaped_desc; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2122 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2123 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
|
2124 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
|
2125 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
|
2126 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
|
2127 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
|
2128 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2129 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
|
2130 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
|
2131 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
|
2132 escaped_title, |
2c5654d1a17a
disapproval of revision '105009e066f1bcaefb0af3bd1e17b7860bf12a57'
Daniel Atallah <daniel.atallah@gmail.com>
parents:
17037
diff
changeset
|
2133 aa_color, escaped_desc); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2134 g_free(escaped_title); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2135 g_free(escaped_desc); |
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 |
26723
b2b0bd2afcb2
Use stock id where possible.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26712
diff
changeset
|
2138 if (!pixbuf) { |
26724
0e85e5698db4
Use stock id everywhere!
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26723
diff
changeset
|
2139 PurpleStatusPrimitive prim = PURPLE_STATUS_UNSET; |
26723
b2b0bd2afcb2
Use stock id where possible.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26712
diff
changeset
|
2140 if (type == PIDGIN_STATUS_BOX_TYPE_PRIMITIVE) { |
26724
0e85e5698db4
Use stock id everywhere!
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26723
diff
changeset
|
2141 prim = GPOINTER_TO_INT(data); |
0e85e5698db4
Use stock id everywhere!
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26723
diff
changeset
|
2142 } else if (type == PIDGIN_STATUS_BOX_TYPE_SAVED_POPULAR || |
0e85e5698db4
Use stock id everywhere!
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26723
diff
changeset
|
2143 type == PIDGIN_STATUS_BOX_TYPE_POPULAR) { |
0e85e5698db4
Use stock id everywhere!
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26723
diff
changeset
|
2144 PurpleSavedStatus *saved = purple_savedstatus_find_by_creation_time(GPOINTER_TO_INT(data)); |
0e85e5698db4
Use stock id everywhere!
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26723
diff
changeset
|
2145 if (saved) { |
0e85e5698db4
Use stock id everywhere!
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26723
diff
changeset
|
2146 prim = purple_savedstatus_get_type(saved); |
26723
b2b0bd2afcb2
Use stock id where possible.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26712
diff
changeset
|
2147 } |
b2b0bd2afcb2
Use stock id where possible.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26712
diff
changeset
|
2148 } |
26724
0e85e5698db4
Use stock id everywhere!
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26723
diff
changeset
|
2149 |
26726
18543445e929
Reduce code duplication.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26725
diff
changeset
|
2150 stock = pidgin_stock_id_from_status_primitive(prim); |
26723
b2b0bd2afcb2
Use stock id where possible.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26712
diff
changeset
|
2151 } |
b2b0bd2afcb2
Use stock id where possible.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26712
diff
changeset
|
2152 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2153 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
|
2154 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
|
2155 TYPE_COLUMN, type, |
26723
b2b0bd2afcb2
Use stock id where possible.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26712
diff
changeset
|
2156 ICON_STOCK_COLUMN, stock, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2157 TEXT_COLUMN, text, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2158 TITLE_COLUMN, title, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2159 DESC_COLUMN, desc, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2160 DATA_COLUMN, data, |
16296
78f798d99d3a
Saved icon for saved statuses in statusbox
Sean Egan <seanegan@gmail.com>
parents:
16270
diff
changeset
|
2161 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
|
2162 EMBLEM_COLUMN, GTK_STOCK_SAVE, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2163 -1); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2164 g_free(text); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2165 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2166 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2167 void |
15514 | 2168 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
|
2169 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2170 /* 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
|
2171 * gtk_combo_box_set_row_separator_func */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2172 GtkTreeIter iter; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2173 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2174 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
|
2175 gtk_list_store_set(status_box->dropdown_store, &iter, |
15514 | 2176 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
|
2177 -1); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2178 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2179 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2180 void |
15514 | 2181 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
|
2182 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2183 if (!status_box) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2184 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2185 status_box->network_available = available; |
15514 | 2186 pidgin_status_box_refresh(status_box); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2187 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2188 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2189 void |
15514 | 2190 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
|
2191 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2192 if (!status_box) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2193 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2194 status_box->connecting = connecting; |
15514 | 2195 pidgin_status_box_refresh(status_box); |
15374
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 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2198 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
|
2199 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
|
2200 { |
fb633ba3fb1e
This is Sadrul's status-rescale.patch from ticket #314. Luke said it
Richard Laager <rlaager@wiktel.com>
parents:
16483
diff
changeset
|
2201 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
|
2202 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
|
2203 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
|
2204 if (height > width) |
e7595d13fd63
Maintain aspect ratio on global icon selector. Fixes #454
Sean Egan <seanegan@gmail.com>
parents:
17149
diff
changeset
|
2205 w = width * h / height; |
e7595d13fd63
Maintain aspect ratio on global icon selector. Fixes #454
Sean Egan <seanegan@gmail.com>
parents:
17149
diff
changeset
|
2206 else if (width > height) |
e7595d13fd63
Maintain aspect ratio on global icon selector. Fixes #454
Sean Egan <seanegan@gmail.com>
parents:
17149
diff
changeset
|
2207 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
|
2208 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
|
2209 } |
fb633ba3fb1e
This is Sadrul's status-rescale.patch from ticket #314. Luke said it
Richard Laager <rlaager@wiktel.com>
parents:
16483
diff
changeset
|
2210 |
fb633ba3fb1e
This is Sadrul's status-rescale.patch from ticket #314. Luke said it
Richard Laager <rlaager@wiktel.com>
parents:
16483
diff
changeset
|
2211 static void |
15514 | 2212 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
|
2213 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2214 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2215 /* 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
|
2216 if (status_box->icon_size <= 0) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2217 return; |
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 if (status_box->buddy_icon) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2220 g_object_unref(status_box->buddy_icon); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2221 if (status_box->buddy_icon_hover) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2222 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
|
2223 status_box->buddy_icon = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2224 status_box->buddy_icon_hover = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2225 |
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
|
2226 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
|
2227 { |
27223
f55455c7ae27
Draw the user's buddy icon (in the status box) with curves, to match the buddy list icons.
Paul Aurich <paul@darkrain42.org>
parents:
27222
diff
changeset
|
2228 GdkPixbuf *buf, *scale; |
f55455c7ae27
Draw the user's buddy icon (in the status box) with curves, to match the buddy list icons.
Paul Aurich <paul@darkrain42.org>
parents:
27222
diff
changeset
|
2229 int scale_width, scale_height; |
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
|
2230 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
|
2231 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
|
2232 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
|
2233 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
|
2234 gdk_pixbuf_loader_close(loader, NULL); |
27223
f55455c7ae27
Draw the user's buddy icon (in the status box) with curves, to match the buddy list icons.
Paul Aurich <paul@darkrain42.org>
parents:
27222
diff
changeset
|
2235 buf = gdk_pixbuf_loader_get_pixbuf(loader); |
f55455c7ae27
Draw the user's buddy icon (in the status box) with curves, to match the buddy list icons.
Paul Aurich <paul@darkrain42.org>
parents:
27222
diff
changeset
|
2236 scale_width = gdk_pixbuf_get_width(buf); |
f55455c7ae27
Draw the user's buddy icon (in the status box) with curves, to match the buddy list icons.
Paul Aurich <paul@darkrain42.org>
parents:
27222
diff
changeset
|
2237 scale_height = gdk_pixbuf_get_height(buf); |
f55455c7ae27
Draw the user's buddy icon (in the status box) with curves, to match the buddy list icons.
Paul Aurich <paul@darkrain42.org>
parents:
27222
diff
changeset
|
2238 scale = gdk_pixbuf_new(GDK_COLORSPACE_RGB, TRUE, 8, scale_width, scale_height); |
f55455c7ae27
Draw the user's buddy icon (in the status box) with curves, to match the buddy list icons.
Paul Aurich <paul@darkrain42.org>
parents:
27222
diff
changeset
|
2239 gdk_pixbuf_fill(scale, 0x00000000); |
f55455c7ae27
Draw the user's buddy icon (in the status box) with curves, to match the buddy list icons.
Paul Aurich <paul@darkrain42.org>
parents:
27222
diff
changeset
|
2240 gdk_pixbuf_copy_area(buf, 0, 0, scale_width, scale_height, scale, 0, 0); |
f55455c7ae27
Draw the user's buddy icon (in the status box) with curves, to match the buddy list icons.
Paul Aurich <paul@darkrain42.org>
parents:
27222
diff
changeset
|
2241 if (pidgin_gdk_pixbuf_is_opaque(scale)) |
f55455c7ae27
Draw the user's buddy icon (in the status box) with curves, to match the buddy list icons.
Paul Aurich <paul@darkrain42.org>
parents:
27222
diff
changeset
|
2242 pidgin_gdk_pixbuf_make_round(scale); |
f55455c7ae27
Draw the user's buddy icon (in the status box) with curves, to match the buddy list icons.
Paul Aurich <paul@darkrain42.org>
parents:
27222
diff
changeset
|
2243 status_box->buddy_icon = scale; |
21055
a0b0f988667e
Fix some leaks caused by GdkPixbufLoaders not being disposed of.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20322
diff
changeset
|
2244 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
|
2245 } |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2246 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2247 if (status_box->buddy_icon == NULL) |
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 /* Show a placeholder icon */ |
16301
c5a8103aa9a4
New select-avatar image from hbons
Stu Tomlinson <stu@nosnilmot.com>
parents:
16296
diff
changeset
|
2250 GtkIconSize icon_size = gtk_icon_size_from_name(PIDGIN_ICON_SIZE_TANGO_SMALL); |
16270 | 2251 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
|
2252 PIDGIN_STOCK_TOOLBAR_SELECT_AVATAR, |
16270 | 2253 icon_size, "PidginStatusBox"); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2254 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2255 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2256 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
|
2257 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
|
2258 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
|
2259 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
|
2260 do_colorshift(status_box->buddy_icon_hover, status_box->buddy_icon_hover, 32); |
15413 | 2261 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
|
2262 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2263 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2264 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2265 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
|
2266 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
|
2267 { |
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
|
2268 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
|
2269 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
|
2270 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
|
2271 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
|
2272 |
15514 | 2273 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
|
2274 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2275 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2276 void |
15514 | 2277 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
|
2278 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2279 if (!status_box) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2280 return; |
26799
12fdc06d73be
Use stock-ids for connecting/typing animations in the statusbox.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26786
diff
changeset
|
2281 if (!connecting_stock_ids[++status_box->connecting_index]) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2282 status_box->connecting_index = 0; |
15514 | 2283 pidgin_status_box_refresh(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 static void |
15514 | 2287 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
|
2288 { |
26799
12fdc06d73be
Use stock-ids for connecting/typing animations in the statusbox.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26786
diff
changeset
|
2289 if (!typing_stock_ids[++status_box->typing_index]) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2290 status_box->typing_index = 0; |
15514 | 2291 pidgin_status_box_refresh(status_box); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2292 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2293 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2294 static gboolean |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2295 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
|
2296 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2297 if (one == NULL && two == NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2298 return FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2299 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2300 if (one == NULL || two == NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2301 return TRUE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2302 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2303 return (g_utf8_collate(one, two) != 0); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2304 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2305 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2306 static void |
15514 | 2307 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
|
2308 { |
15514 | 2309 PidginStatusBoxItemType type; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2310 gpointer data; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2311 gchar *title; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2312 GtkTreeIter iter; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2313 GtkTreePath *path; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2314 char *message; |
15823 | 2315 PurpleSavedStatus *saved_status = NULL; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2316 gboolean changed = TRUE; |
15938
d04878ce947b
Some pixmap path fixes and win32 fixes
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15880
diff
changeset
|
2317 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2318 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
|
2319 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
|
2320 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2321 gtk_tree_path_free(path); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2322 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2323 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
|
2324 TYPE_COLUMN, &type, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2325 DATA_COLUMN, &data, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2326 -1); |
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 /* |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2329 * 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
|
2330 * "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
|
2331 * Popular statuses are |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2332 * 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
|
2333 * accordingly by connecting to the savedstatus-changed |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2334 * 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
|
2335 */ |
15514 | 2336 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
|
2337 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2338 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2339 gtk_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
|
2340 TITLE_COLUMN, &title, -1); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2341 |
15514 | 2342 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
|
2343 if (!message || !*message) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2344 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2345 gtk_widget_hide_all(status_box->vbox); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2346 status_box->imhtml_visible = FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2347 if (message != NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2348 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2349 g_free(message); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2350 message = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2351 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2352 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2353 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2354 if (status_box->account == NULL) { |
15823 | 2355 PurpleStatusType *acct_status_type = NULL; |
2356 PurpleStatusPrimitive primitive = GPOINTER_TO_INT(data); | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2357 /* Global */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2358 /* 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
|
2359 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2360 /* Has the status really been changed? */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2361 if (status_box->token_status_account) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2362 gint active; |
15823 | 2363 PurpleStatus *status; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2364 const char *id = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2365 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
|
2366 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
|
2367 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2368 gtk_tree_path_free(path); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2369 |
15823 | 2370 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
|
2371 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2372 acct_status_type = find_status_type_by_index(status_box->token_status_account, active); |
15823 | 2373 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
|
2374 |
15823 | 2375 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
|
2376 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2377 /* Selected status and previous status is the same */ |
15823 | 2378 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
|
2379 { |
15823 | 2380 PurpleSavedStatus *ss = purple_savedstatus_get_current(); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2381 /* 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
|
2382 * 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
|
2383 * saved status that wasn't supported by this account */ |
15823 | 2384 if ((purple_savedstatus_get_type(ss) == primitive) |
2385 && purple_savedstatus_is_transient(ss) | |
2386 && purple_savedstatus_has_substatuses(ss)) | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2387 changed = FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2388 } |
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 } else { |
15823 | 2391 saved_status = purple_savedstatus_get_current(); |
2392 if (purple_savedstatus_get_type(saved_status) == primitive && | |
2393 !purple_savedstatus_has_substatuses(saved_status)) | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2394 { |
15823 | 2395 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
|
2396 changed = FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2397 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2398 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2399 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2400 if (changed) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2401 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2402 /* Manually find the appropriate transient acct */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2403 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
|
2404 GList *iter = purple_savedstatuses_get_all(); |
15823 | 2405 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
|
2406 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2407 for (; iter != NULL; iter = iter->next) { |
15823 | 2408 PurpleSavedStatus *ss = iter->data; |
2409 const char *ss_msg = purple_savedstatus_get_message(ss); | |
2410 if ((purple_savedstatus_get_type(ss) == primitive) && purple_savedstatus_is_transient(ss) && | |
2411 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
|
2412 !message_changed(ss_msg, message)) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2413 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2414 gboolean found = FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2415 /* 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
|
2416 for(tmp = active_accts; tmp != NULL; tmp = tmp->next) { |
15823 | 2417 PurpleAccount *acct = tmp->data; |
2418 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
|
2419 if (sub) { |
15823 | 2420 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
|
2421 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
|
2422 if (subtype_status_id && !strcmp(subtype_status_id, |
15823 | 2423 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
|
2424 found = TRUE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2425 } |
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 if (!found) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2428 continue; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2429 saved_status = ss; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2430 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2431 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2432 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2433 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2434 g_list_free(active_accts); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2435 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2436 } else { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2437 /* If we've used this type+message before, lookup the transient status */ |
15823 | 2438 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
|
2439 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2440 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2441 /* 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
|
2442 if (saved_status == NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2443 { |
15823 | 2444 saved_status = purple_savedstatus_new(NULL, primitive); |
2445 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
|
2446 if (status_box->token_status_account) { |
15823 | 2447 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
|
2448 for (tmp = active_accts; tmp != NULL; tmp = tmp->next) { |
15823 | 2449 purple_savedstatus_set_substatus(saved_status, |
2450 (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
|
2451 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2452 g_list_free(active_accts); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2453 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2454 } |
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 /* Set the status for each account */ |
15823 | 2457 purple_savedstatus_activate(saved_status); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2458 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2459 } else { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2460 /* Per-account */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2461 gint active; |
15823 | 2462 PurpleStatusType *status_type; |
2463 PurpleStatus *status; | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2464 const char *id = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2465 |
15823 | 2466 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
|
2467 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2468 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
|
2469 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2470 status_type = find_status_type_by_index(status_box->account, active); |
15823 | 2471 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
|
2472 |
15823 | 2473 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
|
2474 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2475 /* Selected status and previous status is the same */ |
15823 | 2476 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
|
2477 changed = FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2478 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2479 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2480 if (changed) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2481 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2482 if (message) |
15823 | 2483 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
|
2484 TRUE, "message", message, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2485 else |
15823 | 2486 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
|
2487 TRUE, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2488 |
15823 | 2489 saved_status = purple_savedstatus_get_current(); |
2490 if (purple_savedstatus_is_transient(saved_status)) | |
2491 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
|
2492 status_type, message); |
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 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2495 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2496 g_free(title); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2497 g_free(message); |
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 |
15514 | 2500 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
|
2501 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2502 GtkTextBuffer *buffer; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2503 GtkTextIter iter; |
25429
4c610616e018
Change the logic for breaking out of the while look to match the if
Mark Doliner <mark@kingant.net>
parents:
25428
diff
changeset
|
2504 int display_lines; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2505 int lines; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2506 GdkRectangle oneline; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2507 int height; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2508 int pad_top, pad_inside, pad_bottom; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2509 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2510 if (!status_box->imhtml_visible) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2511 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2512 if (status_box->vbox != NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2513 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
|
2514 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2515 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2516 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2517 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
|
2518 |
17149 | 2519 height = 0; |
25429
4c610616e018
Change the logic for breaking out of the while look to match the if
Mark Doliner <mark@kingant.net>
parents:
25428
diff
changeset
|
2520 display_lines = 1; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2521 gtk_text_buffer_get_start_iter(buffer, &iter); |
17149 | 2522 do { |
2523 gtk_text_view_get_iter_location(GTK_TEXT_VIEW(status_box->imhtml), &iter, &oneline); | |
2524 height += oneline.height; | |
25429
4c610616e018
Change the logic for breaking out of the while look to match the if
Mark Doliner <mark@kingant.net>
parents:
25428
diff
changeset
|
2525 display_lines++; |
4c610616e018
Change the logic for breaking out of the while look to match the if
Mark Doliner <mark@kingant.net>
parents:
25428
diff
changeset
|
2526 } while (display_lines <= 4 && |
4c610616e018
Change the logic for breaking out of the while look to match the if
Mark Doliner <mark@kingant.net>
parents:
25428
diff
changeset
|
2527 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
|
2528 |
25428
17168b8379f2
Fix a bug that's bothered me for a while. When pressing shift+enter in
Mark Doliner <mark@kingant.net>
parents:
25415
diff
changeset
|
2529 /* |
17168b8379f2
Fix a bug that's bothered me for a while. When pressing shift+enter in
Mark Doliner <mark@kingant.net>
parents:
25415
diff
changeset
|
2530 * This check fixes the case where the last character entered is a |
17168b8379f2
Fix a bug that's bothered me for a while. When pressing shift+enter in
Mark Doliner <mark@kingant.net>
parents:
25415
diff
changeset
|
2531 * newline (shift+return). For some reason the |
17168b8379f2
Fix a bug that's bothered me for a while. When pressing shift+enter in
Mark Doliner <mark@kingant.net>
parents:
25415
diff
changeset
|
2532 * gtk_text_view_forward_display_line() function doesn't treat this |
17168b8379f2
Fix a bug that's bothered me for a while. When pressing shift+enter in
Mark Doliner <mark@kingant.net>
parents:
25415
diff
changeset
|
2533 * like a new line, and so we think the input box only needs to be |
17168b8379f2
Fix a bug that's bothered me for a while. When pressing shift+enter in
Mark Doliner <mark@kingant.net>
parents:
25415
diff
changeset
|
2534 * two lines instead of three, for example. So we check if the |
17168b8379f2
Fix a bug that's bothered me for a while. When pressing shift+enter in
Mark Doliner <mark@kingant.net>
parents:
25415
diff
changeset
|
2535 * last character was a newline and add some extra height if so. |
17168b8379f2
Fix a bug that's bothered me for a while. When pressing shift+enter in
Mark Doliner <mark@kingant.net>
parents:
25415
diff
changeset
|
2536 */ |
25429
4c610616e018
Change the logic for breaking out of the while look to match the if
Mark Doliner <mark@kingant.net>
parents:
25428
diff
changeset
|
2537 if (display_lines <= 4 |
25428
17168b8379f2
Fix a bug that's bothered me for a while. When pressing shift+enter in
Mark Doliner <mark@kingant.net>
parents:
25415
diff
changeset
|
2538 && gtk_text_iter_backward_char(&iter) |
17168b8379f2
Fix a bug that's bothered me for a while. When pressing shift+enter in
Mark Doliner <mark@kingant.net>
parents:
25415
diff
changeset
|
2539 && gtk_text_iter_get_char(&iter) == '\n') |
17168b8379f2
Fix a bug that's bothered me for a while. When pressing shift+enter in
Mark Doliner <mark@kingant.net>
parents:
25415
diff
changeset
|
2540 { |
17168b8379f2
Fix a bug that's bothered me for a while. When pressing shift+enter in
Mark Doliner <mark@kingant.net>
parents:
25415
diff
changeset
|
2541 gtk_text_view_get_iter_location(GTK_TEXT_VIEW(status_box->imhtml), &iter, &oneline); |
17168b8379f2
Fix a bug that's bothered me for a while. When pressing shift+enter in
Mark Doliner <mark@kingant.net>
parents:
25415
diff
changeset
|
2542 height += oneline.height; |
25430
1442c0a54831
Increment display_lines here so that, for fonts where pixels_inside_wrap()
Mark Doliner <mark@kingant.net>
parents:
25429
diff
changeset
|
2543 display_lines++; |
25428
17168b8379f2
Fix a bug that's bothered me for a while. When pressing shift+enter in
Mark Doliner <mark@kingant.net>
parents:
25415
diff
changeset
|
2544 } |
15374
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 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
|
2547 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2548 /* Show a maximum of 4 lines */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2549 lines = MIN(lines, 4); |
25429
4c610616e018
Change the logic for breaking out of the while look to match the if
Mark Doliner <mark@kingant.net>
parents:
25428
diff
changeset
|
2550 display_lines = MIN(display_lines, 4); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2551 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2552 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
|
2553 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
|
2554 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
|
2555 |
17149 | 2556 height += (pad_top + pad_bottom) * lines; |
25429
4c610616e018
Change the logic for breaking out of the while look to match the if
Mark Doliner <mark@kingant.net>
parents:
25428
diff
changeset
|
2557 height += (pad_inside) * (display_lines - lines); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2558 |
15821 | 2559 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
|
2560 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2561 |
15514 | 2562 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
|
2563 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2564 if (status_box->typing == 0) |
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 /* 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
|
2567 status_menu_refresh_iter(status_box); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2568 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2569 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2570 |
26894
3c06cd0e1717
Avoid overwriting the PRIMARY clipboard when we select-on-focus the status text for easy editing. Fixes #8781.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
26801
diff
changeset
|
2571 gtk_imhtml_set_populate_primary_clipboard( |
3c06cd0e1717
Avoid overwriting the PRIMARY clipboard when we select-on-focus the status text for easy editing. Fixes #8781.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
26801
diff
changeset
|
2572 GTK_IMHTML(status_box->imhtml), TRUE); |
3c06cd0e1717
Avoid overwriting the PRIMARY clipboard when we select-on-focus the status text for easy editing. Fixes #8781.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
26801
diff
changeset
|
2573 |
26613
b162300ab1e7
A patch from Arunan Balasubramaniam to use timeouts in seconds instead of
foss@abala.me
parents:
25430
diff
changeset
|
2574 purple_timeout_remove(status_box->typing); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2575 status_box->typing = 0; |
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 activate_currently_selected_status(status_box); |
15514 | 2578 pidgin_status_box_refresh(status_box); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2579 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2580 |
15514 | 2581 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
|
2582 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2583 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
|
2584 GtkTreeIter iter; |
15514 | 2585 PidginStatusBoxItemType type; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2586 gpointer data; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2587 GList *accounts = NULL, *node; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2588 int active; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2589 |
15938
d04878ce947b
Some pixmap path fixes and win32 fixes
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15880
diff
changeset
|
2590 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2591 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
|
2592 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2593 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
|
2594 gtk_tree_path_free(path); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2595 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
|
2596 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2597 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
|
2598 TYPE_COLUMN, &type, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2599 DATA_COLUMN, &data, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2600 -1); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2601 if (status_box->typing != 0) |
26613
b162300ab1e7
A patch from Arunan Balasubramaniam to use timeouts in seconds instead of
foss@abala.me
parents:
25430
diff
changeset
|
2602 purple_timeout_remove(status_box->typing); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2603 status_box->typing = 0; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2604 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2605 if (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
|
2606 { |
16332
89328a54948b
For Luke. Fixes saved status selection
Sean Egan <seanegan@gmail.com>
parents:
16323
diff
changeset
|
2607 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
|
2608 { |
15823 | 2609 PurpleSavedStatus *saved; |
2610 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
|
2611 g_return_if_fail(saved != NULL); |
15823 | 2612 purple_savedstatus_activate(saved); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2613 return; |
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 |
15514 | 2616 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
|
2617 { |
15823 | 2618 PurpleSavedStatus *saved_status; |
2619 saved_status = purple_savedstatus_get_current(); | |
16119
e57d9d5e5c86
sf patch #1622581, from Greg Taeger
Mark Doliner <mark@kingant.net>
parents:
16098
diff
changeset
|
2620 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
|
2621 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
|
2622 pidgin_status_editor_show(FALSE, |
15823 | 2623 purple_savedstatus_is_transient(saved_status) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2624 ? saved_status : NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2625 status_menu_refresh_iter(status_box); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2626 return; |
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 | 2629 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
|
2630 { |
15501
d75099d2567e
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents:
15493
diff
changeset
|
2631 pidgin_status_window_show(); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2632 status_menu_refresh_iter(status_box); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2633 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2634 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2635 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2636 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2637 /* |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2638 * 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
|
2639 * 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
|
2640 * 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
|
2641 */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2642 if (status_box->account) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2643 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
|
2644 else |
15823 | 2645 accounts = purple_accounts_get_all_active(); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2646 status_box->imhtml_visible = FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2647 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
|
2648 { |
15823 | 2649 PurpleAccount *account; |
2650 PurpleStatusType *status_type; | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2651 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2652 account = node->data; |
15823 | 2653 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
|
2654 if ((status_type != NULL) && |
15823 | 2655 (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
|
2656 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2657 status_box->imhtml_visible = TRUE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2658 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2659 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2660 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2661 g_list_free(accounts); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2662 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2663 if (GTK_WIDGET_IS_SENSITIVE(GTK_WIDGET(status_box))) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2664 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2665 if (status_box->imhtml_visible) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2666 { |
24148 | 2667 GtkTextIter start, end; |
2668 GtkTextBuffer *buffer; | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2669 gtk_widget_show_all(status_box->vbox); |
26613
b162300ab1e7
A patch from Arunan Balasubramaniam to use timeouts in seconds instead of
foss@abala.me
parents:
25430
diff
changeset
|
2670 status_box->typing = purple_timeout_add_seconds(TYPING_TIMEOUT, (GSourceFunc)remove_typing_cb, status_box); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2671 gtk_widget_grab_focus(status_box->imhtml); |
24148 | 2672 buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(status_box->imhtml)); |
26894
3c06cd0e1717
Avoid overwriting the PRIMARY clipboard when we select-on-focus the status text for easy editing. Fixes #8781.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
26801
diff
changeset
|
2673 |
3c06cd0e1717
Avoid overwriting the PRIMARY clipboard when we select-on-focus the status text for easy editing. Fixes #8781.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
26801
diff
changeset
|
2674 gtk_imhtml_set_populate_primary_clipboard( |
3c06cd0e1717
Avoid overwriting the PRIMARY clipboard when we select-on-focus the status text for easy editing. Fixes #8781.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
26801
diff
changeset
|
2675 GTK_IMHTML(status_box->imhtml), FALSE); |
3c06cd0e1717
Avoid overwriting the PRIMARY clipboard when we select-on-focus the status text for easy editing. Fixes #8781.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
26801
diff
changeset
|
2676 |
24148 | 2677 gtk_text_buffer_get_bounds(buffer, &start, &end); |
2678 gtk_text_buffer_move_mark(buffer, gtk_text_buffer_get_mark(buffer, "insert"), &end); | |
2679 gtk_text_buffer_move_mark(buffer, gtk_text_buffer_get_mark(buffer, "selection_bound"), &start); | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2680 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2681 else |
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 gtk_widget_hide_all(status_box->vbox); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2684 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
|
2685 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2686 } |
15514 | 2687 pidgin_status_box_refresh(status_box); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2688 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2689 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2690 static gint |
15823 | 2691 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
|
2692 { |
19333
5e39506a0e3b
Select the correct item in the dropdown when using a transient status.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
18704
diff
changeset
|
2693 gint index = -1; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2694 |
15823 | 2695 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
|
2696 { |
19333
5e39506a0e3b
Select the correct item in the dropdown when using a transient status.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
18704
diff
changeset
|
2697 /* 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
|
2698 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
|
2699 index++; |
5e39506a0e3b
Select the correct item in the dropdown when using a transient status.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
18704
diff
changeset
|
2700 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
|
2701 index++; |
5e39506a0e3b
Select the correct item in the dropdown when using a transient status.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
18704
diff
changeset
|
2702 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
|
2703 index++; |
15823 | 2704 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
|
2705 index++; |
5e39506a0e3b
Select the correct item in the dropdown when using a transient status.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
18704
diff
changeset
|
2706 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
|
2707 index++; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2708 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2709 default: |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2710 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2711 } |
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 return index; |
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 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2716 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
|
2717 { |
15514 | 2718 PidginStatusBox *status_box = (PidginStatusBox*)data; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2719 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
|
2720 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2721 if (status_box->typing != 0) { |
15514 | 2722 pidgin_status_box_pulse_typing(status_box); |
26613
b162300ab1e7
A patch from Arunan Balasubramaniam to use timeouts in seconds instead of
foss@abala.me
parents:
25430
diff
changeset
|
2723 purple_timeout_remove(status_box->typing); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2724 } |
26613
b162300ab1e7
A patch from Arunan Balasubramaniam to use timeouts in seconds instead of
foss@abala.me
parents:
25430
diff
changeset
|
2725 status_box->typing = purple_timeout_add_seconds(TYPING_TIMEOUT, (GSourceFunc)remove_typing_cb, status_box); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2726 } |
15514 | 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 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
|
2731 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2732 imhtml_changed_cb(NULL, data); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2733 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2734 |
15514 | 2735 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
|
2736 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2737 if (status_box->imhtml_visible) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2738 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
|
2739 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2740 return NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2741 } |