Thu, 09 Nov 2017 17:31:16 +0000
Fixes #15687 by registering for chat-joined for chats (instead of
conversation-created) as persistent chats can be re-joined after
re-connection.
| 5032 | 1 | /** |
|
5864
86822afeeab0
[gaim-migrate @ 6295]
Christian Hammond <chipx86@chipx86.com>
parents:
5857
diff
changeset
|
2 | * @file gtkpounce.c GTK+ Buddy Pounce API |
|
16254
eeb2bba4dc94
Rename the Doxygen group from gtkui to pidgin.
Richard Laager <rlaager@pidgin.im>
parents:
16123
diff
changeset
|
3 | * @ingroup pidgin |
|
20147
66f05a854eee
applied changes from 8a731bbd0197fbcc91a705c2d8f528154216defa
Richard Laager <rlaager@pidgin.im>
parents:
19859
diff
changeset
|
4 | */ |
|
66f05a854eee
applied changes from 8a731bbd0197fbcc91a705c2d8f528154216defa
Richard Laager <rlaager@pidgin.im>
parents:
19859
diff
changeset
|
5 | |
|
66f05a854eee
applied changes from 8a731bbd0197fbcc91a705c2d8f528154216defa
Richard Laager <rlaager@pidgin.im>
parents:
19859
diff
changeset
|
6 | /* pidgin |
| 5032 | 7 | * |
|
15931
716b5fac1895
Re-sed the copyright notices so they don't all talk about Purple.
Richard Laager <rlaager@pidgin.im>
parents:
15884
diff
changeset
|
8 | * Pidgin is the legal property of its developers, whose names are too numerous |
| 8046 | 9 | * to list here. Please refer to the COPYRIGHT file distributed with this |
| 10 | * source distribution. | |
|
7035
76bca80cd91d
[gaim-migrate @ 7598]
Christian Hammond <chipx86@chipx86.com>
parents:
6982
diff
changeset
|
11 | * |
| 5032 | 12 | * This program is free software; you can redistribute it and/or modify |
| 13 | * it under the terms of the GNU General Public License as published by | |
| 14 | * the Free Software Foundation; either version 2 of the License, or | |
| 15 | * (at your option) any later version. | |
| 16 | * | |
| 17 | * This program is distributed in the hope that it will be useful, | |
| 18 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 20 | * GNU General Public License for more details. | |
| 21 | * | |
| 22 | * You should have received a copy of the GNU General Public License | |
| 23 | * along with this program; if not, write to the Free Software | |
|
19859
71d37b57eff2
The FSF changed its address a while ago; our files were out of date.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
19786
diff
changeset
|
24 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA |
| 5032 | 25 | * |
| 26 | */ | |
| 9791 | 27 | #include "internal.h" |
| 15577 | 28 | #include "pidgin.h" |
|
5872
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5866
diff
changeset
|
29 | |
| 8235 | 30 | #include "account.h" |
|
5872
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5866
diff
changeset
|
31 | #include "conversation.h" |
|
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5866
diff
changeset
|
32 | #include "debug.h" |
|
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5866
diff
changeset
|
33 | #include "prpl.h" |
|
9505
6120a3cb8af7
[gaim-migrate @ 10332]
Mark Doliner <markdoliner@pidgin.im>
parents:
9206
diff
changeset
|
34 | #include "request.h" |
|
5872
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5866
diff
changeset
|
35 | #include "server.h" |
|
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5866
diff
changeset
|
36 | #include "sound.h" |
|
9709
2e73f176cc80
[gaim-migrate @ 10570]
Mark Doliner <markdoliner@pidgin.im>
parents:
9699
diff
changeset
|
37 | #include "util.h" |
|
5872
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5866
diff
changeset
|
38 | |
|
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5866
diff
changeset
|
39 | #include "gtkblist.h" |
|
9709
2e73f176cc80
[gaim-migrate @ 10570]
Mark Doliner <markdoliner@pidgin.im>
parents:
9699
diff
changeset
|
40 | #include "gtkdialogs.h" |
|
17388
8be39f0de528
Allow formatted text in the pounce dialog. Also, use the same code to
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16490
diff
changeset
|
41 | #include "gtkimhtml.h" |
| 5032 | 42 | #include "gtkpounce.h" |
|
26467
ca1524dbcbf0
A patch from Jorge VillaseƱor which makes all pounces share a single window.
Kevin Stange <kstange@pidgin.im>
parents:
25909
diff
changeset
|
43 | #include "gtknotify.h" |
|
15883
969b74a3e27a
According to etags, pidgin/ should be completely clean of references to 'gaim' as a client
Sean Egan <seanegan@pidgin.im>
parents:
15882
diff
changeset
|
44 | #include "pidginstock.h" |
|
5872
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5866
diff
changeset
|
45 | #include "gtkutils.h" |
|
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5866
diff
changeset
|
46 | |
| 12136 | 47 | /** |
| 48 | * These are used for the GtkTreeView when you're scrolling through | |
| 49 | * all your saved pounces. | |
| 50 | */ | |
| 51 | enum | |
| 52 | { | |
| 15884 | 53 | /* Hidden column containing the PurplePounce */ |
| 12136 | 54 | POUNCES_MANAGER_COLUMN_POUNCE, |
| 55 | POUNCES_MANAGER_COLUMN_ICON, | |
| 56 | POUNCES_MANAGER_COLUMN_TARGET, | |
| 57 | POUNCES_MANAGER_COLUMN_ACCOUNT, | |
|
12193
243b18a880ba
[gaim-migrate @ 14495]
Richard Laager <rlaager@pidgin.im>
parents:
12192
diff
changeset
|
58 | POUNCES_MANAGER_COLUMN_RECURRING, |
| 12136 | 59 | POUNCES_MANAGER_NUM_COLUMNS |
| 60 | }; | |
| 61 | ||
|
5857
52cff8a95261
[gaim-migrate @ 6288]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
62 | typedef struct |
| 5032 | 63 | { |
| 64 | /* Pounce data */ | |
| 15884 | 65 | PurplePounce *pounce; |
| 66 | PurpleAccount *account; | |
| 5032 | 67 | |
| 68 | /* The window */ | |
| 69 | GtkWidget *window; | |
| 70 | ||
| 12694 | 71 | /* Pounce on Whom */ |
| 5032 | 72 | GtkWidget *account_menu; |
| 73 | GtkWidget *buddy_entry; | |
| 74 | ||
| 12694 | 75 | /* Pounce options */ |
| 76 | GtkWidget *on_away; | |
| 77 | ||
| 78 | /* Pounce When Buddy... */ | |
| 5032 | 79 | GtkWidget *signon; |
| 80 | GtkWidget *signoff; | |
| 81 | GtkWidget *away; | |
| 82 | GtkWidget *away_return; | |
| 83 | GtkWidget *idle; | |
| 84 | GtkWidget *idle_return; | |
| 85 | GtkWidget *typing; | |
|
13844
835b8f7b3d1d
[gaim-migrate @ 16295]
Mark Doliner <markdoliner@pidgin.im>
parents:
13775
diff
changeset
|
86 | GtkWidget *typed; |
| 5032 | 87 | GtkWidget *stop_typing; |
| 12694 | 88 | GtkWidget *message_recv; |
| 5032 | 89 | |
| 12694 | 90 | /* Action */ |
| 5032 | 91 | GtkWidget *open_win; |
| 92 | GtkWidget *popup; | |
| 12934 | 93 | GtkWidget *popup_entry; |
| 5032 | 94 | GtkWidget *send_msg; |
| 95 | GtkWidget *send_msg_entry; | |
| 96 | GtkWidget *exec_cmd; | |
| 97 | GtkWidget *exec_cmd_entry; | |
| 5319 | 98 | GtkWidget *exec_cmd_browse; |
| 5032 | 99 | GtkWidget *play_sound; |
| 100 | GtkWidget *play_sound_entry; | |
| 5319 | 101 | GtkWidget *play_sound_browse; |
| 102 | GtkWidget *play_sound_test; | |
|
23260
56fda1590379
Make it more obvious that there is a default buddy pounce sound, and
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22214
diff
changeset
|
103 | GtkWidget *play_sound_reset; |
|
7035
76bca80cd91d
[gaim-migrate @ 7598]
Christian Hammond <chipx86@chipx86.com>
parents:
6982
diff
changeset
|
104 | |
| 5032 | 105 | GtkWidget *save_pounce; |
|
5857
52cff8a95261
[gaim-migrate @ 6288]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
106 | |
|
5876
c12b198bde14
[gaim-migrate @ 6308]
Christian Hammond <chipx86@chipx86.com>
parents:
5875
diff
changeset
|
107 | /* Buttons */ |
|
c12b198bde14
[gaim-migrate @ 6308]
Christian Hammond <chipx86@chipx86.com>
parents:
5875
diff
changeset
|
108 | GtkWidget *save_button; |
|
c12b198bde14
[gaim-migrate @ 6308]
Christian Hammond <chipx86@chipx86.com>
parents:
5875
diff
changeset
|
109 | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15496
diff
changeset
|
110 | } PidginPounceDialog; |
| 5032 | 111 | |
| 12136 | 112 | typedef struct |
| 113 | { | |
| 114 | GtkWidget *window; | |
| 115 | GtkListStore *model; | |
| 116 | GtkWidget *treeview; | |
| 117 | GtkWidget *modify_button; | |
| 118 | GtkWidget *delete_button; | |
| 119 | } PouncesManager; | |
| 120 | ||
| 121 | static PouncesManager *pounces_manager = NULL; | |
| 122 | ||
| 5032 | 123 | /************************************************************************** |
| 124 | * Callbacks | |
| 125 | **************************************************************************/ | |
| 126 | static gint | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15496
diff
changeset
|
127 | delete_win_cb(GtkWidget *w, GdkEventAny *e, PidginPounceDialog *dialog) |
| 5032 | 128 | { |
| 129 | gtk_widget_destroy(dialog->window); | |
| 130 | g_free(dialog); | |
| 131 | ||
| 132 | return TRUE; | |
| 133 | } | |
| 134 | ||
| 135 | static void | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15496
diff
changeset
|
136 | cancel_cb(GtkWidget *w, PidginPounceDialog *dialog) |
| 5032 | 137 | { |
| 138 | delete_win_cb(NULL, NULL, dialog); | |
| 139 | } | |
| 140 | ||
| 5319 | 141 | static void |
|
9505
6120a3cb8af7
[gaim-migrate @ 10332]
Mark Doliner <markdoliner@pidgin.im>
parents:
9206
diff
changeset
|
142 | pounce_update_entry_fields(void *user_data, const char *filename) |
| 5319 | 143 | { |
|
9505
6120a3cb8af7
[gaim-migrate @ 10332]
Mark Doliner <markdoliner@pidgin.im>
parents:
9206
diff
changeset
|
144 | GtkWidget *entry = (GtkWidget *)user_data; |
|
5857
52cff8a95261
[gaim-migrate @ 6288]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
145 | |
|
9505
6120a3cb8af7
[gaim-migrate @ 10332]
Mark Doliner <markdoliner@pidgin.im>
parents:
9206
diff
changeset
|
146 | gtk_entry_set_text(GTK_ENTRY(entry), filename); |
| 5319 | 147 | } |
| 148 | ||
| 149 | static void | |
|
9505
6120a3cb8af7
[gaim-migrate @ 10332]
Mark Doliner <markdoliner@pidgin.im>
parents:
9206
diff
changeset
|
150 | filesel(GtkWidget *widget, gpointer data) |
| 5319 | 151 | { |
| 152 | GtkWidget *entry; | |
|
9505
6120a3cb8af7
[gaim-migrate @ 10332]
Mark Doliner <markdoliner@pidgin.im>
parents:
9206
diff
changeset
|
153 | const gchar *name; |
|
7035
76bca80cd91d
[gaim-migrate @ 7598]
Christian Hammond <chipx86@chipx86.com>
parents:
6982
diff
changeset
|
154 | |
|
76bca80cd91d
[gaim-migrate @ 7598]
Christian Hammond <chipx86@chipx86.com>
parents:
6982
diff
changeset
|
155 | entry = (GtkWidget *)data; |
|
9505
6120a3cb8af7
[gaim-migrate @ 10332]
Mark Doliner <markdoliner@pidgin.im>
parents:
9206
diff
changeset
|
156 | name = gtk_entry_get_text(GTK_ENTRY(entry)); |
|
5857
52cff8a95261
[gaim-migrate @ 6288]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
157 | |
|
21175
c6d76b49c206
disapproval of revision '8ba833993a115415727bb1b70362e0bd1603c169'
Richard Laager <rlaager@pidgin.im>
parents:
21174
diff
changeset
|
158 | purple_request_file(entry, _("Select a file"), name, FALSE, |
|
16490
68c22924d66b
Added account, who, and conversation parameters to the request API calls, and updated all code to match. I can't compile the Perl module, so I'd appreciate it if someone who knows it would verify that this doesn't break Perl.
Evan Schoenberg <evands@pidgin.im>
parents:
16254
diff
changeset
|
159 | G_CALLBACK(pounce_update_entry_fields), NULL, |
|
68c22924d66b
Added account, who, and conversation parameters to the request API calls, and updated all code to match. I can't compile the Perl module, so I'd appreciate it if someone who knows it would verify that this doesn't break Perl.
Evan Schoenberg <evands@pidgin.im>
parents:
16254
diff
changeset
|
160 | NULL, NULL, NULL, |
|
21175
c6d76b49c206
disapproval of revision '8ba833993a115415727bb1b70362e0bd1603c169'
Richard Laager <rlaager@pidgin.im>
parents:
21174
diff
changeset
|
161 | entry); |
|
15319
f8f83efdc3a6
[gaim-migrate @ 18047]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15315
diff
changeset
|
162 | g_signal_connect_swapped(G_OBJECT(entry), "destroy", |
| 15884 | 163 | G_CALLBACK(purple_request_close_with_handle), entry); |
| 5319 | 164 | } |
| 165 | ||
| 166 | static void | |
|
5857
52cff8a95261
[gaim-migrate @ 6288]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
167 | pounce_test_sound(GtkWidget *w, GtkWidget *entry) |
| 5319 | 168 | { |
| 169 | const char *filename; | |
|
23260
56fda1590379
Make it more obvious that there is a default buddy pounce sound, and
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22214
diff
changeset
|
170 | gboolean temp_mute; |
|
56fda1590379
Make it more obvious that there is a default buddy pounce sound, and
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22214
diff
changeset
|
171 | |
|
56fda1590379
Make it more obvious that there is a default buddy pounce sound, and
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22214
diff
changeset
|
172 | temp_mute = purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/sound/mute"); |
|
56fda1590379
Make it more obvious that there is a default buddy pounce sound, and
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22214
diff
changeset
|
173 | |
|
56fda1590379
Make it more obvious that there is a default buddy pounce sound, and
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22214
diff
changeset
|
174 | if (temp_mute) purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/sound/mute", FALSE); |
| 5319 | 175 | |
| 176 | filename = gtk_entry_get_text(GTK_ENTRY(entry)); | |
|
5857
52cff8a95261
[gaim-migrate @ 6288]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
177 | |
|
38259
c593fc9f5438
Replace strcmp() with purple_strequal()
qarkai <qarkai@gmail.com>
parents:
38258
diff
changeset
|
178 | if (filename != NULL && *filename != '\0' && !purple_strequal(filename, _("(default)"))) |
| 15884 | 179 | purple_sound_play_file(filename, NULL); |
| 5319 | 180 | else |
| 15884 | 181 | purple_sound_play_event(PURPLE_SOUND_POUNCE_DEFAULT, NULL); |
|
23260
56fda1590379
Make it more obvious that there is a default buddy pounce sound, and
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22214
diff
changeset
|
182 | |
|
56fda1590379
Make it more obvious that there is a default buddy pounce sound, and
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22214
diff
changeset
|
183 | if (temp_mute) purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/sound/mute", TRUE); |
|
56fda1590379
Make it more obvious that there is a default buddy pounce sound, and
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22214
diff
changeset
|
184 | } |
|
56fda1590379
Make it more obvious that there is a default buddy pounce sound, and
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22214
diff
changeset
|
185 | |
|
56fda1590379
Make it more obvious that there is a default buddy pounce sound, and
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22214
diff
changeset
|
186 | static void |
|
56fda1590379
Make it more obvious that there is a default buddy pounce sound, and
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22214
diff
changeset
|
187 | pounce_reset_sound(GtkWidget *w, GtkWidget *entry) |
|
56fda1590379
Make it more obvious that there is a default buddy pounce sound, and
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22214
diff
changeset
|
188 | { |
|
56fda1590379
Make it more obvious that there is a default buddy pounce sound, and
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22214
diff
changeset
|
189 | gtk_entry_set_text(GTK_ENTRY(entry), _("(default)")); |
| 5319 | 190 | } |
| 5032 | 191 | |
| 192 | static void | |
| 15884 | 193 | add_pounce_to_treeview(GtkListStore *model, PurplePounce *pounce) |
| 12136 | 194 | { |
| 195 | GtkTreeIter iter; | |
| 15884 | 196 | PurpleAccount *account; |
|
12193
243b18a880ba
[gaim-migrate @ 14495]
Richard Laager <rlaager@pidgin.im>
parents:
12192
diff
changeset
|
197 | gboolean recurring; |
| 12136 | 198 | const char *pouncer; |
| 199 | const char *pouncee; | |
|
13091
b5ed878998dd
[gaim-migrate @ 15452]
Mark Doliner <markdoliner@pidgin.im>
parents:
13033
diff
changeset
|
200 | GdkPixbuf *pixbuf; |
| 12136 | 201 | |
| 15884 | 202 | account = purple_pounce_get_pouncer(pounce); |
| 12136 | 203 | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15496
diff
changeset
|
204 | pixbuf = pidgin_create_prpl_icon(account, PIDGIN_PRPL_ICON_MEDIUM); |
| 12136 | 205 | |
| 15884 | 206 | pouncer = purple_account_get_username(account); |
| 207 | pouncee = purple_pounce_get_pouncee(pounce); | |
| 208 | recurring = purple_pounce_get_save(pounce); | |
| 12136 | 209 | |
| 210 | gtk_list_store_append(model, &iter); | |
| 211 | gtk_list_store_set(model, &iter, | |
| 212 | POUNCES_MANAGER_COLUMN_POUNCE, pounce, | |
|
13091
b5ed878998dd
[gaim-migrate @ 15452]
Mark Doliner <markdoliner@pidgin.im>
parents:
13033
diff
changeset
|
213 | POUNCES_MANAGER_COLUMN_ICON, pixbuf, |
| 12136 | 214 | POUNCES_MANAGER_COLUMN_TARGET, pouncee, |
| 215 | POUNCES_MANAGER_COLUMN_ACCOUNT, pouncer, | |
|
12193
243b18a880ba
[gaim-migrate @ 14495]
Richard Laager <rlaager@pidgin.im>
parents:
12192
diff
changeset
|
216 | POUNCES_MANAGER_COLUMN_RECURRING, recurring, |
| 12136 | 217 | -1); |
|
13091
b5ed878998dd
[gaim-migrate @ 15452]
Mark Doliner <markdoliner@pidgin.im>
parents:
13033
diff
changeset
|
218 | |
|
b5ed878998dd
[gaim-migrate @ 15452]
Mark Doliner <markdoliner@pidgin.im>
parents:
13033
diff
changeset
|
219 | if (pixbuf != NULL) |
|
b5ed878998dd
[gaim-migrate @ 15452]
Mark Doliner <markdoliner@pidgin.im>
parents:
13033
diff
changeset
|
220 | g_object_unref(pixbuf); |
| 12136 | 221 | } |
| 222 | ||
| 223 | static void | |
| 224 | populate_pounces_list(PouncesManager *dialog) | |
| 225 | { | |
|
18190
bcf28ef7e8ff
Re-fix the DBus list handling code by killing const GList* / const GSList*
Richard Laager <rlaager@pidgin.im>
parents:
18186
diff
changeset
|
226 | GList *pounces; |
| 12136 | 227 | |
| 228 | gtk_list_store_clear(dialog->model); | |
| 229 | ||
|
18209
5f63822878eb
Fix #1574. (Pidgin and Finch show each other's pounces, interact in
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18193
diff
changeset
|
230 | for (pounces = purple_pounces_get_all_for_ui(PIDGIN_UI); pounces != NULL; |
|
5f63822878eb
Fix #1574. (Pidgin and Finch show each other's pounces, interact in
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18193
diff
changeset
|
231 | pounces = g_list_delete_link(pounces, pounces)) |
| 12136 | 232 | { |
| 233 | add_pounce_to_treeview(dialog->model, pounces->data); | |
| 234 | } | |
| 235 | } | |
| 236 | ||
| 237 | static void | |
| 238 | update_pounces(void) | |
| 239 | { | |
| 240 | /* Rebuild the pounces list if the pounces manager is open */ | |
| 241 | if (pounces_manager != NULL) | |
| 242 | { | |
| 243 | populate_pounces_list(pounces_manager); | |
| 244 | } | |
| 245 | } | |
| 246 | ||
| 247 | static void | |
| 15884 | 248 | signed_on_off_cb(PurpleConnection *gc, gpointer user_data) |
| 12136 | 249 | { |
| 250 | update_pounces(); | |
| 251 | } | |
| 252 | ||
| 253 | static void | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15496
diff
changeset
|
254 | save_pounce_cb(GtkWidget *w, PidginPounceDialog *dialog) |
| 5032 | 255 | { |
| 256 | const char *name; | |
|
17388
8be39f0de528
Allow formatted text in the pounce dialog. Also, use the same code to
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16490
diff
changeset
|
257 | const char *command, *sound, *reason; |
|
8be39f0de528
Allow formatted text in the pounce dialog. Also, use the same code to
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16490
diff
changeset
|
258 | char *message; |
| 15884 | 259 | PurplePounceEvent events = PURPLE_POUNCE_NONE; |
| 260 | PurplePounceOption options = PURPLE_POUNCE_OPTION_NONE; | |
| 5032 | 261 | |
| 262 | name = gtk_entry_get_text(GTK_ENTRY(dialog->buddy_entry)); | |
| 263 | ||
|
9206
57a4db675f8d
[gaim-migrate @ 10001]
Christian Hammond <chipx86@chipx86.com>
parents:
9205
diff
changeset
|
264 | if (*name == '\0') |
|
57a4db675f8d
[gaim-migrate @ 10001]
Christian Hammond <chipx86@chipx86.com>
parents:
9205
diff
changeset
|
265 | { |
| 15884 | 266 | purple_notify_error(NULL, NULL, |
|
5436
a0e0bacaa196
[gaim-migrate @ 5818]
Christian Hammond <chipx86@chipx86.com>
parents:
5319
diff
changeset
|
267 | _("Please enter a buddy to pounce."), NULL); |
| 5032 | 268 | return; |
| 269 | } | |
| 270 | ||
| 12694 | 271 | /* Options */ |
| 272 | if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(dialog->on_away))) | |
| 15884 | 273 | options |= PURPLE_POUNCE_OPTION_AWAY; |
| 12694 | 274 | |
| 5032 | 275 | /* Events */ |
| 276 | if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(dialog->signon))) | |
| 15884 | 277 | events |= PURPLE_POUNCE_SIGNON; |
| 5032 | 278 | |
| 279 | if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(dialog->signoff))) | |
| 15884 | 280 | events |= PURPLE_POUNCE_SIGNOFF; |
| 5032 | 281 | |
| 282 | if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(dialog->away))) | |
| 15884 | 283 | events |= PURPLE_POUNCE_AWAY; |
| 5032 | 284 | |
| 285 | if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(dialog->away_return))) | |
| 15884 | 286 | events |= PURPLE_POUNCE_AWAY_RETURN; |
| 5032 | 287 | |
| 288 | if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(dialog->idle))) | |
| 15884 | 289 | events |= PURPLE_POUNCE_IDLE; |
| 5032 | 290 | |
| 291 | if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(dialog->idle_return))) | |
| 15884 | 292 | events |= PURPLE_POUNCE_IDLE_RETURN; |
| 5032 | 293 | |
| 294 | if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(dialog->typing))) | |
| 15884 | 295 | events |= PURPLE_POUNCE_TYPING; |
| 5032 | 296 | |
|
13844
835b8f7b3d1d
[gaim-migrate @ 16295]
Mark Doliner <markdoliner@pidgin.im>
parents:
13775
diff
changeset
|
297 | if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(dialog->typed))) |
| 15884 | 298 | events |= PURPLE_POUNCE_TYPED; |
|
13844
835b8f7b3d1d
[gaim-migrate @ 16295]
Mark Doliner <markdoliner@pidgin.im>
parents:
13775
diff
changeset
|
299 | |
| 5032 | 300 | if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(dialog->stop_typing))) |
| 15884 | 301 | events |= PURPLE_POUNCE_TYPING_STOPPED; |
| 5032 | 302 | |
| 12694 | 303 | if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(dialog->message_recv))) |
| 15884 | 304 | events |= PURPLE_POUNCE_MESSAGE_RECEIVED; |
| 12694 | 305 | |
| 5032 | 306 | /* Data fields */ |
|
17388
8be39f0de528
Allow formatted text in the pounce dialog. Also, use the same code to
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16490
diff
changeset
|
307 | message = gtk_imhtml_get_markup(GTK_IMHTML(dialog->send_msg_entry)); |
| 5032 | 308 | command = gtk_entry_get_text(GTK_ENTRY(dialog->exec_cmd_entry)); |
| 309 | sound = gtk_entry_get_text(GTK_ENTRY(dialog->play_sound_entry)); | |
| 12934 | 310 | reason = gtk_entry_get_text(GTK_ENTRY(dialog->popup_entry)); |
| 5032 | 311 | |
| 12934 | 312 | if (*reason == '\0') reason = NULL; |
|
17388
8be39f0de528
Allow formatted text in the pounce dialog. Also, use the same code to
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16490
diff
changeset
|
313 | if (*message == '\0') { |
|
8be39f0de528
Allow formatted text in the pounce dialog. Also, use the same code to
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16490
diff
changeset
|
314 | g_free(message); |
|
8be39f0de528
Allow formatted text in the pounce dialog. Also, use the same code to
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16490
diff
changeset
|
315 | message = NULL; |
|
8be39f0de528
Allow formatted text in the pounce dialog. Also, use the same code to
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16490
diff
changeset
|
316 | } |
| 5032 | 317 | if (*command == '\0') command = NULL; |
|
38258
9a6551eba09c
Replace !strcmp() with purple_strequal()
qarkai <qarkai@gmail.com>
parents:
33794
diff
changeset
|
318 | if (*sound == '\0' || purple_strequal(sound, _("(default)"))) sound = NULL; |
| 5032 | 319 | |
|
20168
5d2fb40e4cdf
If a pounce has been deleted or triggered while we're editing it, make a new one when saving instead of crashing. Fixes #3326
Daniel Atallah <datallah@pidgin.im>
parents:
20147
diff
changeset
|
320 | /* If the pounce has already been triggered, let's pretend it is a new one */ |
|
5d2fb40e4cdf
If a pounce has been deleted or triggered while we're editing it, make a new one when saving instead of crashing. Fixes #3326
Daniel Atallah <datallah@pidgin.im>
parents:
20147
diff
changeset
|
321 | if (dialog->pounce != NULL |
|
5d2fb40e4cdf
If a pounce has been deleted or triggered while we're editing it, make a new one when saving instead of crashing. Fixes #3326
Daniel Atallah <datallah@pidgin.im>
parents:
20147
diff
changeset
|
322 | && g_list_find(purple_pounces_get_all(), dialog->pounce) == NULL) { |
|
5d2fb40e4cdf
If a pounce has been deleted or triggered while we're editing it, make a new one when saving instead of crashing. Fixes #3326
Daniel Atallah <datallah@pidgin.im>
parents:
20147
diff
changeset
|
323 | purple_debug_info("gtkpounce", "Saving pounce that no longer exists; creating new pounce.\n"); |
|
5d2fb40e4cdf
If a pounce has been deleted or triggered while we're editing it, make a new one when saving instead of crashing. Fixes #3326
Daniel Atallah <datallah@pidgin.im>
parents:
20147
diff
changeset
|
324 | dialog->pounce = NULL; |
|
5d2fb40e4cdf
If a pounce has been deleted or triggered while we're editing it, make a new one when saving instead of crashing. Fixes #3326
Daniel Atallah <datallah@pidgin.im>
parents:
20147
diff
changeset
|
325 | } |
|
5d2fb40e4cdf
If a pounce has been deleted or triggered while we're editing it, make a new one when saving instead of crashing. Fixes #3326
Daniel Atallah <datallah@pidgin.im>
parents:
20147
diff
changeset
|
326 | |
|
9205
8c4dbbe6386f
[gaim-migrate @ 10000]
Christian Hammond <chipx86@chipx86.com>
parents:
9191
diff
changeset
|
327 | if (dialog->pounce == NULL) |
|
8c4dbbe6386f
[gaim-migrate @ 10000]
Christian Hammond <chipx86@chipx86.com>
parents:
9191
diff
changeset
|
328 | { |
| 15884 | 329 | dialog->pounce = purple_pounce_new(PIDGIN_UI, dialog->account, |
| 12694 | 330 | name, events, options); |
| 5032 | 331 | } |
|
5864
86822afeeab0
[gaim-migrate @ 6295]
Christian Hammond <chipx86@chipx86.com>
parents:
5857
diff
changeset
|
332 | else { |
| 15884 | 333 | purple_pounce_set_events(dialog->pounce, events); |
| 334 | purple_pounce_set_options(dialog->pounce, options); | |
| 335 | purple_pounce_set_pouncer(dialog->pounce, dialog->account); | |
| 336 | purple_pounce_set_pouncee(dialog->pounce, name); | |
| 5032 | 337 | } |
| 338 | ||
|
9206
57a4db675f8d
[gaim-migrate @ 10001]
Christian Hammond <chipx86@chipx86.com>
parents:
9205
diff
changeset
|
339 | /* Actions */ |
| 15884 | 340 | purple_pounce_action_set_enabled(dialog->pounce, "open-window", |
|
5864
86822afeeab0
[gaim-migrate @ 6295]
Christian Hammond <chipx86@chipx86.com>
parents:
5857
diff
changeset
|
341 | gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(dialog->open_win))); |
| 15884 | 342 | purple_pounce_action_set_enabled(dialog->pounce, "popup-notify", |
|
5864
86822afeeab0
[gaim-migrate @ 6295]
Christian Hammond <chipx86@chipx86.com>
parents:
5857
diff
changeset
|
343 | gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(dialog->popup))); |
| 15884 | 344 | purple_pounce_action_set_enabled(dialog->pounce, "send-message", |
|
5864
86822afeeab0
[gaim-migrate @ 6295]
Christian Hammond <chipx86@chipx86.com>
parents:
5857
diff
changeset
|
345 | gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(dialog->send_msg))); |
| 15884 | 346 | purple_pounce_action_set_enabled(dialog->pounce, "execute-command", |
|
5864
86822afeeab0
[gaim-migrate @ 6295]
Christian Hammond <chipx86@chipx86.com>
parents:
5857
diff
changeset
|
347 | gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(dialog->exec_cmd))); |
| 15884 | 348 | purple_pounce_action_set_enabled(dialog->pounce, "play-sound", |
|
5864
86822afeeab0
[gaim-migrate @ 6295]
Christian Hammond <chipx86@chipx86.com>
parents:
5857
diff
changeset
|
349 | gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(dialog->play_sound))); |
|
86822afeeab0
[gaim-migrate @ 6295]
Christian Hammond <chipx86@chipx86.com>
parents:
5857
diff
changeset
|
350 | |
| 15884 | 351 | purple_pounce_action_set_attribute(dialog->pounce, "send-message", |
|
5864
86822afeeab0
[gaim-migrate @ 6295]
Christian Hammond <chipx86@chipx86.com>
parents:
5857
diff
changeset
|
352 | "message", message); |
| 15884 | 353 | purple_pounce_action_set_attribute(dialog->pounce, "execute-command", |
|
5864
86822afeeab0
[gaim-migrate @ 6295]
Christian Hammond <chipx86@chipx86.com>
parents:
5857
diff
changeset
|
354 | "command", command); |
| 15884 | 355 | purple_pounce_action_set_attribute(dialog->pounce, "play-sound", |
|
5864
86822afeeab0
[gaim-migrate @ 6295]
Christian Hammond <chipx86@chipx86.com>
parents:
5857
diff
changeset
|
356 | "filename", sound); |
| 15884 | 357 | purple_pounce_action_set_attribute(dialog->pounce, "popup-notify", |
| 12934 | 358 | "reason", reason); |
|
5864
86822afeeab0
[gaim-migrate @ 6295]
Christian Hammond <chipx86@chipx86.com>
parents:
5857
diff
changeset
|
359 | |
|
9206
57a4db675f8d
[gaim-migrate @ 10001]
Christian Hammond <chipx86@chipx86.com>
parents:
9205
diff
changeset
|
360 | /* Set the defaults for next time. */ |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
361 | purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/pounces/default_actions/open-window", |
|
9206
57a4db675f8d
[gaim-migrate @ 10001]
Christian Hammond <chipx86@chipx86.com>
parents:
9205
diff
changeset
|
362 | gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(dialog->open_win))); |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
363 | purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/pounces/default_actions/popup-notify", |
|
9206
57a4db675f8d
[gaim-migrate @ 10001]
Christian Hammond <chipx86@chipx86.com>
parents:
9205
diff
changeset
|
364 | gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(dialog->popup))); |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
365 | purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/pounces/default_actions/send-message", |
|
9206
57a4db675f8d
[gaim-migrate @ 10001]
Christian Hammond <chipx86@chipx86.com>
parents:
9205
diff
changeset
|
366 | gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(dialog->send_msg))); |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
367 | purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/pounces/default_actions/execute-command", |
|
9206
57a4db675f8d
[gaim-migrate @ 10001]
Christian Hammond <chipx86@chipx86.com>
parents:
9205
diff
changeset
|
368 | gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(dialog->exec_cmd))); |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
369 | purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/pounces/default_actions/play-sound", |
|
9206
57a4db675f8d
[gaim-migrate @ 10001]
Christian Hammond <chipx86@chipx86.com>
parents:
9205
diff
changeset
|
370 | gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(dialog->play_sound))); |
|
57a4db675f8d
[gaim-migrate @ 10001]
Christian Hammond <chipx86@chipx86.com>
parents:
9205
diff
changeset
|
371 | |
| 15884 | 372 | purple_pounce_set_save(dialog->pounce, |
|
5864
86822afeeab0
[gaim-migrate @ 6295]
Christian Hammond <chipx86@chipx86.com>
parents:
5857
diff
changeset
|
373 | gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(dialog->save_pounce))); |
|
86822afeeab0
[gaim-migrate @ 6295]
Christian Hammond <chipx86@chipx86.com>
parents:
5857
diff
changeset
|
374 | |
| 12136 | 375 | update_pounces(); |
|
17388
8be39f0de528
Allow formatted text in the pounce dialog. Also, use the same code to
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16490
diff
changeset
|
376 | g_free(message); |
| 5032 | 377 | |
| 12136 | 378 | delete_win_cb(NULL, NULL, dialog); |
| 5032 | 379 | } |
| 380 | ||
| 5054 | 381 | static void |
| 15884 | 382 | pounce_choose_cb(GtkWidget *item, PurpleAccount *account, |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15496
diff
changeset
|
383 | PidginPounceDialog *dialog) |
| 5032 | 384 | { |
|
5877
37695b88b248
[gaim-migrate @ 6309]
Christian Hammond <chipx86@chipx86.com>
parents:
5876
diff
changeset
|
385 | dialog->account = account; |
| 5032 | 386 | } |
| 387 | ||
|
5876
c12b198bde14
[gaim-migrate @ 6308]
Christian Hammond <chipx86@chipx86.com>
parents:
5875
diff
changeset
|
388 | static void |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15496
diff
changeset
|
389 | buddy_changed_cb(GtkEntry *entry, PidginPounceDialog *dialog) |
|
5876
c12b198bde14
[gaim-migrate @ 6308]
Christian Hammond <chipx86@chipx86.com>
parents:
5875
diff
changeset
|
390 | { |
|
c12b198bde14
[gaim-migrate @ 6308]
Christian Hammond <chipx86@chipx86.com>
parents:
5875
diff
changeset
|
391 | if (dialog->save_button == NULL) |
|
c12b198bde14
[gaim-migrate @ 6308]
Christian Hammond <chipx86@chipx86.com>
parents:
5875
diff
changeset
|
392 | return; |
|
c12b198bde14
[gaim-migrate @ 6308]
Christian Hammond <chipx86@chipx86.com>
parents:
5875
diff
changeset
|
393 | |
|
c12b198bde14
[gaim-migrate @ 6308]
Christian Hammond <chipx86@chipx86.com>
parents:
5875
diff
changeset
|
394 | gtk_widget_set_sensitive(dialog->save_button, |
|
9205
8c4dbbe6386f
[gaim-migrate @ 10000]
Christian Hammond <chipx86@chipx86.com>
parents:
9191
diff
changeset
|
395 | *gtk_entry_get_text(entry) != '\0'); |
|
5876
c12b198bde14
[gaim-migrate @ 6308]
Christian Hammond <chipx86@chipx86.com>
parents:
5875
diff
changeset
|
396 | } |
|
c12b198bde14
[gaim-migrate @ 6308]
Christian Hammond <chipx86@chipx86.com>
parents:
5875
diff
changeset
|
397 | |
|
8803
79bc4ecbcac7
[gaim-migrate @ 9565]
Christian Hammond <chipx86@chipx86.com>
parents:
8259
diff
changeset
|
398 | static void |
| 12694 | 399 | message_recv_toggle(GtkButton *message_recv, GtkWidget *send_msg) |
| 400 | { | |
| 401 | gboolean active = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(message_recv)); | |
| 402 | ||
| 403 | gtk_widget_set_sensitive(send_msg, !active); | |
| 404 | if (active) | |
| 405 | gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(send_msg), FALSE); | |
| 406 | } | |
| 407 | ||
| 408 | static void | |
|
8803
79bc4ecbcac7
[gaim-migrate @ 9565]
Christian Hammond <chipx86@chipx86.com>
parents:
8259
diff
changeset
|
409 | pounce_dnd_recv(GtkWidget *widget, GdkDragContext *dc, gint x, gint y, |
|
79bc4ecbcac7
[gaim-migrate @ 9565]
Christian Hammond <chipx86@chipx86.com>
parents:
8259
diff
changeset
|
410 | GtkSelectionData *sd, guint info, guint t, gpointer data) |
|
79bc4ecbcac7
[gaim-migrate @ 9565]
Christian Hammond <chipx86@chipx86.com>
parents:
8259
diff
changeset
|
411 | { |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15496
diff
changeset
|
412 | PidginPounceDialog *dialog; |
|
8803
79bc4ecbcac7
[gaim-migrate @ 9565]
Christian Hammond <chipx86@chipx86.com>
parents:
8259
diff
changeset
|
413 | |
| 15884 | 414 | if (sd->target == gdk_atom_intern("PURPLE_BLIST_NODE", FALSE)) |
|
8803
79bc4ecbcac7
[gaim-migrate @ 9565]
Christian Hammond <chipx86@chipx86.com>
parents:
8259
diff
changeset
|
415 | { |
| 15884 | 416 | PurpleBlistNode *node = NULL; |
| 417 | PurpleBuddy *buddy; | |
|
8803
79bc4ecbcac7
[gaim-migrate @ 9565]
Christian Hammond <chipx86@chipx86.com>
parents:
8259
diff
changeset
|
418 | |
|
79bc4ecbcac7
[gaim-migrate @ 9565]
Christian Hammond <chipx86@chipx86.com>
parents:
8259
diff
changeset
|
419 | memcpy(&node, sd->data, sizeof(node)); |
|
79bc4ecbcac7
[gaim-migrate @ 9565]
Christian Hammond <chipx86@chipx86.com>
parents:
8259
diff
changeset
|
420 | |
| 15884 | 421 | if (PURPLE_BLIST_NODE_IS_CONTACT(node)) |
| 422 | buddy = purple_contact_get_priority_buddy((PurpleContact *)node); | |
| 423 | else if (PURPLE_BLIST_NODE_IS_BUDDY(node)) | |
| 424 | buddy = (PurpleBuddy *)node; | |
|
8803
79bc4ecbcac7
[gaim-migrate @ 9565]
Christian Hammond <chipx86@chipx86.com>
parents:
8259
diff
changeset
|
425 | else |
|
79bc4ecbcac7
[gaim-migrate @ 9565]
Christian Hammond <chipx86@chipx86.com>
parents:
8259
diff
changeset
|
426 | return; |
|
79bc4ecbcac7
[gaim-migrate @ 9565]
Christian Hammond <chipx86@chipx86.com>
parents:
8259
diff
changeset
|
427 | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15496
diff
changeset
|
428 | dialog = (PidginPounceDialog *)data; |
|
8803
79bc4ecbcac7
[gaim-migrate @ 9565]
Christian Hammond <chipx86@chipx86.com>
parents:
8259
diff
changeset
|
429 | |
|
79bc4ecbcac7
[gaim-migrate @ 9565]
Christian Hammond <chipx86@chipx86.com>
parents:
8259
diff
changeset
|
430 | gtk_entry_set_text(GTK_ENTRY(dialog->buddy_entry), buddy->name); |
|
9910
7b4465b92411
[gaim-migrate @ 10802]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9791
diff
changeset
|
431 | dialog->account = buddy->account; |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15496
diff
changeset
|
432 | pidgin_account_option_menu_set_selected(dialog->account_menu, buddy->account); |
|
8803
79bc4ecbcac7
[gaim-migrate @ 9565]
Christian Hammond <chipx86@chipx86.com>
parents:
8259
diff
changeset
|
433 | |
|
79bc4ecbcac7
[gaim-migrate @ 9565]
Christian Hammond <chipx86@chipx86.com>
parents:
8259
diff
changeset
|
434 | gtk_drag_finish(dc, TRUE, (dc->action == GDK_ACTION_MOVE), t); |
|
79bc4ecbcac7
[gaim-migrate @ 9565]
Christian Hammond <chipx86@chipx86.com>
parents:
8259
diff
changeset
|
435 | } |
|
79bc4ecbcac7
[gaim-migrate @ 9565]
Christian Hammond <chipx86@chipx86.com>
parents:
8259
diff
changeset
|
436 | else if (sd->target == gdk_atom_intern("application/x-im-contact", FALSE)) |
|
79bc4ecbcac7
[gaim-migrate @ 9565]
Christian Hammond <chipx86@chipx86.com>
parents:
8259
diff
changeset
|
437 | { |
|
79bc4ecbcac7
[gaim-migrate @ 9565]
Christian Hammond <chipx86@chipx86.com>
parents:
8259
diff
changeset
|
438 | char *protocol = NULL; |
|
79bc4ecbcac7
[gaim-migrate @ 9565]
Christian Hammond <chipx86@chipx86.com>
parents:
8259
diff
changeset
|
439 | char *username = NULL; |
| 15884 | 440 | PurpleAccount *account; |
|
8803
79bc4ecbcac7
[gaim-migrate @ 9565]
Christian Hammond <chipx86@chipx86.com>
parents:
8259
diff
changeset
|
441 | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15496
diff
changeset
|
442 | if (pidgin_parse_x_im_contact((const char *)sd->data, FALSE, &account, |
|
8803
79bc4ecbcac7
[gaim-migrate @ 9565]
Christian Hammond <chipx86@chipx86.com>
parents:
8259
diff
changeset
|
443 | &protocol, &username, NULL)) |
|
79bc4ecbcac7
[gaim-migrate @ 9565]
Christian Hammond <chipx86@chipx86.com>
parents:
8259
diff
changeset
|
444 | { |
|
79bc4ecbcac7
[gaim-migrate @ 9565]
Christian Hammond <chipx86@chipx86.com>
parents:
8259
diff
changeset
|
445 | if (account == NULL) |
|
79bc4ecbcac7
[gaim-migrate @ 9565]
Christian Hammond <chipx86@chipx86.com>
parents:
8259
diff
changeset
|
446 | { |
| 15884 | 447 | purple_notify_error(NULL, NULL, |
|
8803
79bc4ecbcac7
[gaim-migrate @ 9565]
Christian Hammond <chipx86@chipx86.com>
parents:
8259
diff
changeset
|
448 | _("You are not currently signed on with an account that " |
|
79bc4ecbcac7
[gaim-migrate @ 9565]
Christian Hammond <chipx86@chipx86.com>
parents:
8259
diff
changeset
|
449 | "can add that buddy."), NULL); |
|
79bc4ecbcac7
[gaim-migrate @ 9565]
Christian Hammond <chipx86@chipx86.com>
parents:
8259
diff
changeset
|
450 | } |
|
79bc4ecbcac7
[gaim-migrate @ 9565]
Christian Hammond <chipx86@chipx86.com>
parents:
8259
diff
changeset
|
451 | else |
|
79bc4ecbcac7
[gaim-migrate @ 9565]
Christian Hammond <chipx86@chipx86.com>
parents:
8259
diff
changeset
|
452 | { |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15496
diff
changeset
|
453 | dialog = (PidginPounceDialog *)data; |
|
8803
79bc4ecbcac7
[gaim-migrate @ 9565]
Christian Hammond <chipx86@chipx86.com>
parents:
8259
diff
changeset
|
454 | |
|
79bc4ecbcac7
[gaim-migrate @ 9565]
Christian Hammond <chipx86@chipx86.com>
parents:
8259
diff
changeset
|
455 | gtk_entry_set_text(GTK_ENTRY(dialog->buddy_entry), username); |
|
9910
7b4465b92411
[gaim-migrate @ 10802]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9791
diff
changeset
|
456 | dialog->account = account; |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15496
diff
changeset
|
457 | pidgin_account_option_menu_set_selected(dialog->account_menu, account); |
|
8803
79bc4ecbcac7
[gaim-migrate @ 9565]
Christian Hammond <chipx86@chipx86.com>
parents:
8259
diff
changeset
|
458 | } |
|
79bc4ecbcac7
[gaim-migrate @ 9565]
Christian Hammond <chipx86@chipx86.com>
parents:
8259
diff
changeset
|
459 | } |
|
79bc4ecbcac7
[gaim-migrate @ 9565]
Christian Hammond <chipx86@chipx86.com>
parents:
8259
diff
changeset
|
460 | |
|
14097
0c340861ab79
[gaim-migrate @ 16638]
Mark Doliner <markdoliner@pidgin.im>
parents:
13844
diff
changeset
|
461 | g_free(username); |
|
0c340861ab79
[gaim-migrate @ 16638]
Mark Doliner <markdoliner@pidgin.im>
parents:
13844
diff
changeset
|
462 | g_free(protocol); |
|
8803
79bc4ecbcac7
[gaim-migrate @ 9565]
Christian Hammond <chipx86@chipx86.com>
parents:
8259
diff
changeset
|
463 | |
|
79bc4ecbcac7
[gaim-migrate @ 9565]
Christian Hammond <chipx86@chipx86.com>
parents:
8259
diff
changeset
|
464 | gtk_drag_finish(dc, TRUE, (dc->action == GDK_ACTION_MOVE), t); |
|
79bc4ecbcac7
[gaim-migrate @ 9565]
Christian Hammond <chipx86@chipx86.com>
parents:
8259
diff
changeset
|
465 | } |
|
79bc4ecbcac7
[gaim-migrate @ 9565]
Christian Hammond <chipx86@chipx86.com>
parents:
8259
diff
changeset
|
466 | } |
|
79bc4ecbcac7
[gaim-migrate @ 9565]
Christian Hammond <chipx86@chipx86.com>
parents:
8259
diff
changeset
|
467 | |
|
79bc4ecbcac7
[gaim-migrate @ 9565]
Christian Hammond <chipx86@chipx86.com>
parents:
8259
diff
changeset
|
468 | static const GtkTargetEntry dnd_targets[] = |
|
79bc4ecbcac7
[gaim-migrate @ 9565]
Christian Hammond <chipx86@chipx86.com>
parents:
8259
diff
changeset
|
469 | { |
| 15884 | 470 | {"PURPLE_BLIST_NODE", GTK_TARGET_SAME_APP, 0}, |
|
8803
79bc4ecbcac7
[gaim-migrate @ 9565]
Christian Hammond <chipx86@chipx86.com>
parents:
8259
diff
changeset
|
471 | {"application/x-im-contact", 0, 1} |
|
79bc4ecbcac7
[gaim-migrate @ 9565]
Christian Hammond <chipx86@chipx86.com>
parents:
8259
diff
changeset
|
472 | }; |
|
79bc4ecbcac7
[gaim-migrate @ 9565]
Christian Hammond <chipx86@chipx86.com>
parents:
8259
diff
changeset
|
473 | |
|
17388
8be39f0de528
Allow formatted text in the pounce dialog. Also, use the same code to
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16490
diff
changeset
|
474 | static void |
|
8be39f0de528
Allow formatted text in the pounce dialog. Also, use the same code to
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16490
diff
changeset
|
475 | reset_send_msg_entry(PidginPounceDialog *dialog, GtkWidget *dontcare) |
|
8be39f0de528
Allow formatted text in the pounce dialog. Also, use the same code to
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16490
diff
changeset
|
476 | { |
|
8be39f0de528
Allow formatted text in the pounce dialog. Also, use the same code to
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16490
diff
changeset
|
477 | PurpleAccount *account = pidgin_account_option_menu_get_selected(dialog->account_menu); |
|
8be39f0de528
Allow formatted text in the pounce dialog. Also, use the same code to
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16490
diff
changeset
|
478 | gtk_imhtml_setup_entry(GTK_IMHTML(dialog->send_msg_entry), |
|
8be39f0de528
Allow formatted text in the pounce dialog. Also, use the same code to
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16490
diff
changeset
|
479 | (account && account->gc) ? account->gc->flags : PURPLE_CONNECTION_HTML); |
|
8be39f0de528
Allow formatted text in the pounce dialog. Also, use the same code to
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16490
diff
changeset
|
480 | } |
|
8be39f0de528
Allow formatted text in the pounce dialog. Also, use the same code to
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16490
diff
changeset
|
481 | |
| 5032 | 482 | void |
| 20706 | 483 | pidgin_pounce_editor_show(PurpleAccount *account, const char *name, |
|
25390
02100938b030
Make dialogs that double as add and save dialogs indicate the current action
Etan Reisner <deryni@pidgin.im>
parents:
24594
diff
changeset
|
484 | PurplePounce *cur_pounce) |
| 20706 | 485 | { |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15496
diff
changeset
|
486 | PidginPounceDialog *dialog; |
| 5032 | 487 | GtkWidget *window; |
| 488 | GtkWidget *label; | |
| 489 | GtkWidget *vbox1, *vbox2; | |
| 490 | GtkWidget *hbox; | |
| 491 | GtkWidget *button; | |
| 492 | GtkWidget *frame; | |
| 493 | GtkWidget *table; | |
| 494 | GtkSizeGroup *sg; | |
| 5319 | 495 | GPtrArray *sound_widgets; |
| 496 | GPtrArray *exec_widgets; | |
|
17388
8be39f0de528
Allow formatted text in the pounce dialog. Also, use the same code to
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16490
diff
changeset
|
497 | GtkWidget *send_msg_imhtml; |
|
5857
52cff8a95261
[gaim-migrate @ 6288]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
498 | |
|
15058
212b71a4faf6
[gaim-migrate @ 17775]
Richard Laager <rlaager@pidgin.im>
parents:
14253
diff
changeset
|
499 | g_return_if_fail((cur_pounce != NULL) || |
|
212b71a4faf6
[gaim-migrate @ 17775]
Richard Laager <rlaager@pidgin.im>
parents:
14253
diff
changeset
|
500 | (account != NULL) || |
| 15884 | 501 | (purple_accounts_get_all() != NULL)); |
|
10352
802e7ab5b838
[gaim-migrate @ 11569]
Mark Doliner <markdoliner@pidgin.im>
parents:
10250
diff
changeset
|
502 | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15496
diff
changeset
|
503 | dialog = g_new0(PidginPounceDialog, 1); |
| 5032 | 504 | |
|
8803
79bc4ecbcac7
[gaim-migrate @ 9565]
Christian Hammond <chipx86@chipx86.com>
parents:
8259
diff
changeset
|
505 | if (cur_pounce != NULL) |
|
79bc4ecbcac7
[gaim-migrate @ 9565]
Christian Hammond <chipx86@chipx86.com>
parents:
8259
diff
changeset
|
506 | { |
| 5032 | 507 | dialog->pounce = cur_pounce; |
| 15884 | 508 | dialog->account = purple_pounce_get_pouncer(cur_pounce); |
| 5032 | 509 | } |
|
8803
79bc4ecbcac7
[gaim-migrate @ 9565]
Christian Hammond <chipx86@chipx86.com>
parents:
8259
diff
changeset
|
510 | else if (account != NULL) |
|
79bc4ecbcac7
[gaim-migrate @ 9565]
Christian Hammond <chipx86@chipx86.com>
parents:
8259
diff
changeset
|
511 | { |
| 5032 | 512 | dialog->pounce = NULL; |
|
5907
b2812113a4a6
[gaim-migrate @ 6339]
Christian Hammond <chipx86@chipx86.com>
parents:
5877
diff
changeset
|
513 | dialog->account = account; |
| 5032 | 514 | } |
|
8803
79bc4ecbcac7
[gaim-migrate @ 9565]
Christian Hammond <chipx86@chipx86.com>
parents:
8259
diff
changeset
|
515 | else |
|
79bc4ecbcac7
[gaim-migrate @ 9565]
Christian Hammond <chipx86@chipx86.com>
parents:
8259
diff
changeset
|
516 | { |
|
18122
9bf9970c1b6a
disapproval of revision '2d8ea56b90971e7851442d96b7d74ecb4f052126'
Richard Laager <rlaager@pidgin.im>
parents:
18121
diff
changeset
|
517 | GList *connections = purple_connections_get_all(); |
| 15884 | 518 | PurpleConnection *gc; |
|
8803
79bc4ecbcac7
[gaim-migrate @ 9565]
Christian Hammond <chipx86@chipx86.com>
parents:
8259
diff
changeset
|
519 | |
|
15058
212b71a4faf6
[gaim-migrate @ 17775]
Richard Laager <rlaager@pidgin.im>
parents:
14253
diff
changeset
|
520 | if (connections != NULL) |
|
212b71a4faf6
[gaim-migrate @ 17775]
Richard Laager <rlaager@pidgin.im>
parents:
14253
diff
changeset
|
521 | { |
| 15884 | 522 | gc = (PurpleConnection *)connections->data; |
| 523 | dialog->account = purple_connection_get_account(gc); | |
|
15058
212b71a4faf6
[gaim-migrate @ 17775]
Richard Laager <rlaager@pidgin.im>
parents:
14253
diff
changeset
|
524 | } |
|
212b71a4faf6
[gaim-migrate @ 17775]
Richard Laager <rlaager@pidgin.im>
parents:
14253
diff
changeset
|
525 | else |
| 15884 | 526 | dialog->account = purple_accounts_get_all()->data; |
|
8803
79bc4ecbcac7
[gaim-migrate @ 9565]
Christian Hammond <chipx86@chipx86.com>
parents:
8259
diff
changeset
|
527 | |
| 5032 | 528 | dialog->pounce = NULL; |
| 529 | } | |
| 530 | ||
| 531 | sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); | |
| 532 | ||
| 533 | /* Create the window. */ | |
|
19546
b7a8a86af65a
Use GtkDialog more often. Thanks nix_nix. Fixes #2618
Sean Egan <seanegan@pidgin.im>
parents:
18966
diff
changeset
|
534 | dialog->window = window = gtk_dialog_new(); |
|
25868
66d6c3e2963d
Use "Add Buddy Pounce" and "Modify Buddy Pounce" as the buddy pounce dialog
Etan Reisner <deryni@pidgin.im>
parents:
24594
diff
changeset
|
535 | gtk_window_set_title(GTK_WINDOW(window), (cur_pounce == NULL ? _("Add Buddy Pounce") : _("Modify Buddy Pounce"))); |
|
19546
b7a8a86af65a
Use GtkDialog more often. Thanks nix_nix. Fixes #2618
Sean Egan <seanegan@pidgin.im>
parents:
18966
diff
changeset
|
536 | gtk_window_set_role(GTK_WINDOW(window), "buddy_pounce"); |
|
b7a8a86af65a
Use GtkDialog more often. Thanks nix_nix. Fixes #2618
Sean Egan <seanegan@pidgin.im>
parents:
18966
diff
changeset
|
537 | gtk_container_set_border_width(GTK_CONTAINER(dialog->window), PIDGIN_HIG_BORDER); |
| 5032 | 538 | |
| 539 | g_signal_connect(G_OBJECT(window), "delete_event", | |
| 540 | G_CALLBACK(delete_win_cb), dialog); | |
| 541 | ||
| 542 | /* Create the parent vbox for everything. */ | |
|
19546
b7a8a86af65a
Use GtkDialog more often. Thanks nix_nix. Fixes #2618
Sean Egan <seanegan@pidgin.im>
parents:
18966
diff
changeset
|
543 | vbox1 = GTK_DIALOG(window)->vbox; |
| 5032 | 544 | |
| 545 | /* Create the vbox that will contain all the prefs stuff. */ | |
| 15882 | 546 | vbox2 = gtk_vbox_new(FALSE, PIDGIN_HIG_BOX_SPACE); |
| 5032 | 547 | gtk_box_pack_start(GTK_BOX(vbox1), vbox2, TRUE, TRUE, 0); |
| 548 | ||
| 12694 | 549 | /* Create the "Pounce on Whom" frame. */ |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15496
diff
changeset
|
550 | frame = pidgin_make_frame(vbox2, _("Pounce on Whom")); |
| 5032 | 551 | |
| 552 | /* Account: */ | |
| 15882 | 553 | hbox = gtk_hbox_new(FALSE, PIDGIN_HIG_BOX_SPACE); |
| 5032 | 554 | gtk_box_pack_start(GTK_BOX(frame), hbox, FALSE, FALSE, 0); |
| 555 | gtk_widget_show(hbox); | |
| 556 | ||
| 557 | label = gtk_label_new_with_mnemonic(_("_Account:")); | |
| 558 | gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); | |
| 559 | gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); | |
| 560 | gtk_widget_show(label); | |
| 561 | gtk_size_group_add_widget(sg, label); | |
| 562 | ||
|
5877
37695b88b248
[gaim-migrate @ 6309]
Christian Hammond <chipx86@chipx86.com>
parents:
5876
diff
changeset
|
563 | dialog->account_menu = |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15496
diff
changeset
|
564 | pidgin_account_option_menu_new(dialog->account, TRUE, |
|
6646
b9a0b5eb74e6
[gaim-migrate @ 7171]
Christian Hammond <chipx86@chipx86.com>
parents:
6640
diff
changeset
|
565 | G_CALLBACK(pounce_choose_cb), |
|
b9a0b5eb74e6
[gaim-migrate @ 7171]
Christian Hammond <chipx86@chipx86.com>
parents:
6640
diff
changeset
|
566 | NULL, dialog); |
|
5877
37695b88b248
[gaim-migrate @ 6309]
Christian Hammond <chipx86@chipx86.com>
parents:
5876
diff
changeset
|
567 | |
| 5032 | 568 | gtk_box_pack_start(GTK_BOX(hbox), dialog->account_menu, FALSE, FALSE, 0); |
| 569 | gtk_widget_show(dialog->account_menu); | |
| 15568 | 570 | pidgin_set_accessible_label (dialog->account_menu, label); |
| 5032 | 571 | |
| 572 | /* Buddy: */ | |
| 15882 | 573 | hbox = gtk_hbox_new(FALSE, PIDGIN_HIG_BOX_SPACE); |
| 5032 | 574 | gtk_box_pack_start(GTK_BOX(frame), hbox, FALSE, FALSE, 0); |
| 575 | gtk_widget_show(hbox); | |
| 576 | ||
|
8803
79bc4ecbcac7
[gaim-migrate @ 9565]
Christian Hammond <chipx86@chipx86.com>
parents:
8259
diff
changeset
|
577 | label = gtk_label_new_with_mnemonic(_("_Buddy name:")); |
| 5032 | 578 | gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); |
| 579 | gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); | |
| 580 | gtk_widget_show(label); | |
| 581 | gtk_size_group_add_widget(sg, label); | |
| 582 | ||
| 583 | dialog->buddy_entry = gtk_entry_new(); | |
|
8803
79bc4ecbcac7
[gaim-migrate @ 9565]
Christian Hammond <chipx86@chipx86.com>
parents:
8259
diff
changeset
|
584 | |
|
18966
6a0715b72b6b
Screenname auto-completion filtering by Leonardo Fernandes, Fixes #519
Sean Egan <seanegan@pidgin.im>
parents:
18209
diff
changeset
|
585 | pidgin_setup_screenname_autocomplete_with_filter(dialog->buddy_entry, dialog->account_menu, pidgin_screenname_autocomplete_default_filter, GINT_TO_POINTER(FALSE)); |
|
13361
bb2f64cf6721
[gaim-migrate @ 15733]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13228
diff
changeset
|
586 | |
| 5032 | 587 | gtk_box_pack_start(GTK_BOX(hbox), dialog->buddy_entry, TRUE, TRUE, 0); |
| 588 | gtk_widget_show(dialog->buddy_entry); | |
| 589 | ||
|
5876
c12b198bde14
[gaim-migrate @ 6308]
Christian Hammond <chipx86@chipx86.com>
parents:
5875
diff
changeset
|
590 | g_signal_connect(G_OBJECT(dialog->buddy_entry), "changed", |
|
c12b198bde14
[gaim-migrate @ 6308]
Christian Hammond <chipx86@chipx86.com>
parents:
5875
diff
changeset
|
591 | G_CALLBACK(buddy_changed_cb), dialog); |
| 15568 | 592 | pidgin_set_accessible_label (dialog->buddy_entry, label); |
|
5876
c12b198bde14
[gaim-migrate @ 6308]
Christian Hammond <chipx86@chipx86.com>
parents:
5875
diff
changeset
|
593 | |
| 5032 | 594 | if (cur_pounce != NULL) { |
| 595 | gtk_entry_set_text(GTK_ENTRY(dialog->buddy_entry), | |
| 15884 | 596 | purple_pounce_get_pouncee(cur_pounce)); |
| 5032 | 597 | } |
|
5907
b2812113a4a6
[gaim-migrate @ 6339]
Christian Hammond <chipx86@chipx86.com>
parents:
5877
diff
changeset
|
598 | else if (name != NULL) { |
|
b2812113a4a6
[gaim-migrate @ 6339]
Christian Hammond <chipx86@chipx86.com>
parents:
5877
diff
changeset
|
599 | gtk_entry_set_text(GTK_ENTRY(dialog->buddy_entry), name); |
| 5032 | 600 | } |
| 601 | ||
| 12694 | 602 | /* Create the "Pounce When Buddy..." frame. */ |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15496
diff
changeset
|
603 | frame = pidgin_make_frame(vbox2, _("Pounce When Buddy...")); |
| 5032 | 604 | |
|
13844
835b8f7b3d1d
[gaim-migrate @ 16295]
Mark Doliner <markdoliner@pidgin.im>
parents:
13775
diff
changeset
|
605 | table = gtk_table_new(5, 2, FALSE); |
| 5032 | 606 | gtk_container_add(GTK_CONTAINER(frame), table); |
| 15882 | 607 | gtk_table_set_col_spacings(GTK_TABLE(table), PIDGIN_HIG_BORDER); |
| 5032 | 608 | gtk_widget_show(table); |
| 609 | ||
| 610 | dialog->signon = | |
|
12141
9cd436b9b7f6
[gaim-migrate @ 14442]
Richard Laager <rlaager@pidgin.im>
parents:
12137
diff
changeset
|
611 | gtk_check_button_new_with_mnemonic(_("Si_gns on")); |
| 5032 | 612 | dialog->signoff = |
|
12142
45aba96df80d
[gaim-migrate @ 14443]
Richard Laager <rlaager@pidgin.im>
parents:
12141
diff
changeset
|
613 | gtk_check_button_new_with_mnemonic(_("Signs o_ff")); |
| 5032 | 614 | dialog->away = |
|
12141
9cd436b9b7f6
[gaim-migrate @ 14442]
Richard Laager <rlaager@pidgin.im>
parents:
12137
diff
changeset
|
615 | gtk_check_button_new_with_mnemonic(_("Goes a_way")); |
| 5032 | 616 | dialog->away_return = |
|
12144
a24ccdee060b
[gaim-migrate @ 14445]
Richard Laager <rlaager@pidgin.im>
parents:
12142
diff
changeset
|
617 | gtk_check_button_new_with_mnemonic(_("Ret_urns from away")); |
| 5032 | 618 | dialog->idle = |
|
12192
36b7b33aa956
[gaim-migrate @ 14494]
Richard Laager <rlaager@pidgin.im>
parents:
12186
diff
changeset
|
619 | gtk_check_button_new_with_mnemonic(_("Becomes _idle")); |
| 5032 | 620 | dialog->idle_return = |
|
12192
36b7b33aa956
[gaim-migrate @ 14494]
Richard Laager <rlaager@pidgin.im>
parents:
12186
diff
changeset
|
621 | gtk_check_button_new_with_mnemonic(_("Is no longer i_dle")); |
| 5032 | 622 | dialog->typing = |
|
12141
9cd436b9b7f6
[gaim-migrate @ 14442]
Richard Laager <rlaager@pidgin.im>
parents:
12137
diff
changeset
|
623 | gtk_check_button_new_with_mnemonic(_("Starts _typing")); |
|
13844
835b8f7b3d1d
[gaim-migrate @ 16295]
Mark Doliner <markdoliner@pidgin.im>
parents:
13775
diff
changeset
|
624 | dialog->typed = |
|
835b8f7b3d1d
[gaim-migrate @ 16295]
Mark Doliner <markdoliner@pidgin.im>
parents:
13775
diff
changeset
|
625 | gtk_check_button_new_with_mnemonic(_("P_auses while typing")); |
| 5032 | 626 | dialog->stop_typing = |
|
12141
9cd436b9b7f6
[gaim-migrate @ 14442]
Richard Laager <rlaager@pidgin.im>
parents:
12137
diff
changeset
|
627 | gtk_check_button_new_with_mnemonic(_("Stops t_yping")); |
| 12694 | 628 | dialog->message_recv = |
| 629 | gtk_check_button_new_with_mnemonic(_("Sends a _message")); | |
| 5032 | 630 | |
|
13844
835b8f7b3d1d
[gaim-migrate @ 16295]
Mark Doliner <markdoliner@pidgin.im>
parents:
13775
diff
changeset
|
631 | gtk_table_attach(GTK_TABLE(table), dialog->message_recv, 0, 1, 0, 1, |
| 5032 | 632 | GTK_FILL, 0, 0, 0); |
|
13844
835b8f7b3d1d
[gaim-migrate @ 16295]
Mark Doliner <markdoliner@pidgin.im>
parents:
13775
diff
changeset
|
633 | gtk_table_attach(GTK_TABLE(table), dialog->signon, 0, 1, 1, 2, |
| 5032 | 634 | GTK_FILL, 0, 0, 0); |
|
13844
835b8f7b3d1d
[gaim-migrate @ 16295]
Mark Doliner <markdoliner@pidgin.im>
parents:
13775
diff
changeset
|
635 | gtk_table_attach(GTK_TABLE(table), dialog->signoff, 0, 1, 2, 3, |
| 5032 | 636 | GTK_FILL, 0, 0, 0); |
|
25909
d5b0f5340ef0
Buddy pounce options are now in four columns instead of two. Fixes issues with height of dialog on small resolutions.
Casey Ho <caseyho@pidgin.im>
parents:
25869
diff
changeset
|
637 | gtk_table_attach(GTK_TABLE(table), dialog->away, 1, 2, 0, 1, |
|
13844
835b8f7b3d1d
[gaim-migrate @ 16295]
Mark Doliner <markdoliner@pidgin.im>
parents:
13775
diff
changeset
|
638 | GTK_FILL, 0, 0, 0); |
|
25909
d5b0f5340ef0
Buddy pounce options are now in four columns instead of two. Fixes issues with height of dialog on small resolutions.
Casey Ho <caseyho@pidgin.im>
parents:
25869
diff
changeset
|
639 | gtk_table_attach(GTK_TABLE(table), dialog->away_return, 1, 2, 1, 2, |
| 5032 | 640 | GTK_FILL, 0, 0, 0); |
|
25909
d5b0f5340ef0
Buddy pounce options are now in four columns instead of two. Fixes issues with height of dialog on small resolutions.
Casey Ho <caseyho@pidgin.im>
parents:
25869
diff
changeset
|
641 | gtk_table_attach(GTK_TABLE(table), dialog->idle, 1, 2, 2, 3, |
| 12694 | 642 | GTK_FILL, 0, 0, 0); |
|
25909
d5b0f5340ef0
Buddy pounce options are now in four columns instead of two. Fixes issues with height of dialog on small resolutions.
Casey Ho <caseyho@pidgin.im>
parents:
25869
diff
changeset
|
643 | gtk_table_attach(GTK_TABLE(table), dialog->idle_return, 2, 3, 0, 1, |
| 5032 | 644 | GTK_FILL, 0, 0, 0); |
|
25909
d5b0f5340ef0
Buddy pounce options are now in four columns instead of two. Fixes issues with height of dialog on small resolutions.
Casey Ho <caseyho@pidgin.im>
parents:
25869
diff
changeset
|
645 | gtk_table_attach(GTK_TABLE(table), dialog->typing, 2, 3, 1, 2, |
| 5032 | 646 | GTK_FILL, 0, 0, 0); |
|
25909
d5b0f5340ef0
Buddy pounce options are now in four columns instead of two. Fixes issues with height of dialog on small resolutions.
Casey Ho <caseyho@pidgin.im>
parents:
25869
diff
changeset
|
647 | gtk_table_attach(GTK_TABLE(table), dialog->typed, 2, 3, 2, 3, |
| 5032 | 648 | GTK_FILL, 0, 0, 0); |
|
25909
d5b0f5340ef0
Buddy pounce options are now in four columns instead of two. Fixes issues with height of dialog on small resolutions.
Casey Ho <caseyho@pidgin.im>
parents:
25869
diff
changeset
|
649 | gtk_table_attach(GTK_TABLE(table), dialog->stop_typing, 3, 4, 0, 1, |
| 5032 | 650 | GTK_FILL, 0, 0, 0); |
| 651 | ||
| 652 | gtk_widget_show(dialog->signon); | |
| 653 | gtk_widget_show(dialog->signoff); | |
| 654 | gtk_widget_show(dialog->away); | |
| 655 | gtk_widget_show(dialog->away_return); | |
| 656 | gtk_widget_show(dialog->idle); | |
| 657 | gtk_widget_show(dialog->idle_return); | |
| 658 | gtk_widget_show(dialog->typing); | |
|
13844
835b8f7b3d1d
[gaim-migrate @ 16295]
Mark Doliner <markdoliner@pidgin.im>
parents:
13775
diff
changeset
|
659 | gtk_widget_show(dialog->typed); |
| 5032 | 660 | gtk_widget_show(dialog->stop_typing); |
| 12694 | 661 | gtk_widget_show(dialog->message_recv); |
| 5032 | 662 | |
| 12694 | 663 | /* Create the "Action" frame. */ |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15496
diff
changeset
|
664 | frame = pidgin_make_frame(vbox2, _("Action")); |
| 5032 | 665 | |
|
23260
56fda1590379
Make it more obvious that there is a default buddy pounce sound, and
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22214
diff
changeset
|
666 | table = gtk_table_new(3, 6, FALSE); |
| 5032 | 667 | gtk_container_add(GTK_CONTAINER(frame), table); |
| 15882 | 668 | gtk_table_set_col_spacings(GTK_TABLE(table), PIDGIN_HIG_BORDER); |
| 5032 | 669 | gtk_widget_show(table); |
| 670 | ||
|
9205
8c4dbbe6386f
[gaim-migrate @ 10000]
Christian Hammond <chipx86@chipx86.com>
parents:
9191
diff
changeset
|
671 | dialog->open_win |
|
12192
36b7b33aa956
[gaim-migrate @ 14494]
Richard Laager <rlaager@pidgin.im>
parents:
12186
diff
changeset
|
672 | = gtk_check_button_new_with_mnemonic(_("Ope_n an IM window")); |
|
9205
8c4dbbe6386f
[gaim-migrate @ 10000]
Christian Hammond <chipx86@chipx86.com>
parents:
9191
diff
changeset
|
673 | dialog->popup |
|
12141
9cd436b9b7f6
[gaim-migrate @ 14442]
Richard Laager <rlaager@pidgin.im>
parents:
12137
diff
changeset
|
674 | = gtk_check_button_new_with_mnemonic(_("_Pop up a notification")); |
|
9205
8c4dbbe6386f
[gaim-migrate @ 10000]
Christian Hammond <chipx86@chipx86.com>
parents:
9191
diff
changeset
|
675 | dialog->send_msg |
|
8c4dbbe6386f
[gaim-migrate @ 10000]
Christian Hammond <chipx86@chipx86.com>
parents:
9191
diff
changeset
|
676 | = gtk_check_button_new_with_mnemonic(_("Send a _message")); |
|
8c4dbbe6386f
[gaim-migrate @ 10000]
Christian Hammond <chipx86@chipx86.com>
parents:
9191
diff
changeset
|
677 | dialog->exec_cmd |
|
8c4dbbe6386f
[gaim-migrate @ 10000]
Christian Hammond <chipx86@chipx86.com>
parents:
9191
diff
changeset
|
678 | = gtk_check_button_new_with_mnemonic(_("E_xecute a command")); |
|
8c4dbbe6386f
[gaim-migrate @ 10000]
Christian Hammond <chipx86@chipx86.com>
parents:
9191
diff
changeset
|
679 | dialog->play_sound |
|
8c4dbbe6386f
[gaim-migrate @ 10000]
Christian Hammond <chipx86@chipx86.com>
parents:
9191
diff
changeset
|
680 | = gtk_check_button_new_with_mnemonic(_("P_lay a sound")); |
|
7035
76bca80cd91d
[gaim-migrate @ 7598]
Christian Hammond <chipx86@chipx86.com>
parents:
6982
diff
changeset
|
681 | |
|
17388
8be39f0de528
Allow formatted text in the pounce dialog. Also, use the same code to
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16490
diff
changeset
|
682 | send_msg_imhtml = pidgin_create_imhtml(TRUE, &dialog->send_msg_entry, NULL, NULL); |
|
8be39f0de528
Allow formatted text in the pounce dialog. Also, use the same code to
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16490
diff
changeset
|
683 | reset_send_msg_entry(dialog, NULL); |
|
9205
8c4dbbe6386f
[gaim-migrate @ 10000]
Christian Hammond <chipx86@chipx86.com>
parents:
9191
diff
changeset
|
684 | dialog->exec_cmd_entry = gtk_entry_new(); |
| 12934 | 685 | dialog->popup_entry = gtk_entry_new(); |
|
12192
36b7b33aa956
[gaim-migrate @ 14494]
Richard Laager <rlaager@pidgin.im>
parents:
12186
diff
changeset
|
686 | dialog->exec_cmd_browse = gtk_button_new_with_mnemonic(_("Brows_e...")); |
|
9205
8c4dbbe6386f
[gaim-migrate @ 10000]
Christian Hammond <chipx86@chipx86.com>
parents:
9191
diff
changeset
|
687 | dialog->play_sound_entry = gtk_entry_new(); |
|
23260
56fda1590379
Make it more obvious that there is a default buddy pounce sound, and
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22214
diff
changeset
|
688 | gtk_entry_set_text(GTK_ENTRY(dialog->play_sound_entry), _("(default)")); |
|
56fda1590379
Make it more obvious that there is a default buddy pounce sound, and
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22214
diff
changeset
|
689 | gtk_editable_set_editable(GTK_EDITABLE(dialog->play_sound_entry), FALSE); |
|
12144
a24ccdee060b
[gaim-migrate @ 14445]
Richard Laager <rlaager@pidgin.im>
parents:
12142
diff
changeset
|
690 | dialog->play_sound_browse = gtk_button_new_with_mnemonic(_("Br_owse...")); |
|
9205
8c4dbbe6386f
[gaim-migrate @ 10000]
Christian Hammond <chipx86@chipx86.com>
parents:
9191
diff
changeset
|
691 | dialog->play_sound_test = gtk_button_new_with_mnemonic(_("Pre_view")); |
|
23260
56fda1590379
Make it more obvious that there is a default buddy pounce sound, and
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22214
diff
changeset
|
692 | dialog->play_sound_reset = gtk_button_new_with_mnemonic(_("Reset")); |
|
7035
76bca80cd91d
[gaim-migrate @ 7598]
Christian Hammond <chipx86@chipx86.com>
parents:
6982
diff
changeset
|
693 | |
|
17388
8be39f0de528
Allow formatted text in the pounce dialog. Also, use the same code to
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16490
diff
changeset
|
694 | gtk_widget_set_sensitive(send_msg_imhtml, FALSE); |
| 12694 | 695 | gtk_widget_set_sensitive(dialog->exec_cmd_entry, FALSE); |
| 12934 | 696 | gtk_widget_set_sensitive(dialog->popup_entry, FALSE); |
| 12694 | 697 | gtk_widget_set_sensitive(dialog->exec_cmd_browse, FALSE); |
| 698 | gtk_widget_set_sensitive(dialog->play_sound_entry, FALSE); | |
| 699 | gtk_widget_set_sensitive(dialog->play_sound_browse, FALSE); | |
| 700 | gtk_widget_set_sensitive(dialog->play_sound_test, FALSE); | |
|
23260
56fda1590379
Make it more obvious that there is a default buddy pounce sound, and
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22214
diff
changeset
|
701 | gtk_widget_set_sensitive(dialog->play_sound_reset, FALSE); |
| 12694 | 702 | |
|
20289
5c844288fbec
applied changes from 32f31e981f0618a4167aa98bcc22c2dab13d1550
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
20168
diff
changeset
|
703 | g_object_unref(sg); |
|
5c844288fbec
applied changes from 32f31e981f0618a4167aa98bcc22c2dab13d1550
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
20168
diff
changeset
|
704 | |
| 12694 | 705 | sg = gtk_size_group_new(GTK_SIZE_GROUP_VERTICAL); |
| 706 | gtk_size_group_add_widget(sg, dialog->open_win); | |
| 707 | gtk_size_group_add_widget(sg, dialog->popup); | |
| 12934 | 708 | gtk_size_group_add_widget(sg, dialog->popup_entry); |
| 12694 | 709 | gtk_size_group_add_widget(sg, dialog->exec_cmd); |
| 710 | gtk_size_group_add_widget(sg, dialog->exec_cmd_entry); | |
| 711 | gtk_size_group_add_widget(sg, dialog->exec_cmd_browse); | |
| 712 | gtk_size_group_add_widget(sg, dialog->play_sound); | |
| 713 | gtk_size_group_add_widget(sg, dialog->play_sound_entry); | |
| 714 | gtk_size_group_add_widget(sg, dialog->play_sound_browse); | |
| 715 | gtk_size_group_add_widget(sg, dialog->play_sound_test); | |
|
23260
56fda1590379
Make it more obvious that there is a default buddy pounce sound, and
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22214
diff
changeset
|
716 | gtk_size_group_add_widget(sg, dialog->play_sound_reset); |
| 5032 | 717 | |
|
20289
5c844288fbec
applied changes from 32f31e981f0618a4167aa98bcc22c2dab13d1550
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
20168
diff
changeset
|
718 | g_object_unref(sg); |
|
5c844288fbec
applied changes from 32f31e981f0618a4167aa98bcc22c2dab13d1550
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
20168
diff
changeset
|
719 | sg = NULL; |
|
5c844288fbec
applied changes from 32f31e981f0618a4167aa98bcc22c2dab13d1550
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
20168
diff
changeset
|
720 | |
| 5032 | 721 | gtk_table_attach(GTK_TABLE(table), dialog->open_win, 0, 1, 0, 1, |
| 722 | GTK_FILL, 0, 0, 0); | |
| 723 | gtk_table_attach(GTK_TABLE(table), dialog->popup, 0, 1, 1, 2, | |
| 724 | GTK_FILL, 0, 0, 0); | |
|
23260
56fda1590379
Make it more obvious that there is a default buddy pounce sound, and
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22214
diff
changeset
|
725 | gtk_table_attach(GTK_TABLE(table), dialog->popup_entry, 1, 5, 1, 2, |
| 12934 | 726 | GTK_FILL, 0, 0, 0); |
|
23260
56fda1590379
Make it more obvious that there is a default buddy pounce sound, and
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22214
diff
changeset
|
727 | gtk_table_attach(GTK_TABLE(table), dialog->send_msg, 0, 5, 2, 3, |
| 5032 | 728 | GTK_FILL, 0, 0, 0); |
|
23260
56fda1590379
Make it more obvious that there is a default buddy pounce sound, and
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22214
diff
changeset
|
729 | gtk_table_attach(GTK_TABLE(table), send_msg_imhtml, 0, 5, 3, 4, |
| 5032 | 730 | GTK_FILL, 0, 0, 0); |
|
17388
8be39f0de528
Allow formatted text in the pounce dialog. Also, use the same code to
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16490
diff
changeset
|
731 | gtk_table_attach(GTK_TABLE(table), dialog->exec_cmd, 0, 1, 4, 5, |
| 5032 | 732 | GTK_FILL, 0, 0, 0); |
|
17388
8be39f0de528
Allow formatted text in the pounce dialog. Also, use the same code to
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16490
diff
changeset
|
733 | gtk_table_attach(GTK_TABLE(table), dialog->exec_cmd_entry, 1, 2, 4, 5, |
| 5032 | 734 | GTK_FILL, 0, 0, 0); |
|
17388
8be39f0de528
Allow formatted text in the pounce dialog. Also, use the same code to
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16490
diff
changeset
|
735 | gtk_table_attach(GTK_TABLE(table), dialog->exec_cmd_browse, 2, 3, 4, 5, |
| 5319 | 736 | GTK_FILL | GTK_EXPAND, 0, 0, 0); |
|
17388
8be39f0de528
Allow formatted text in the pounce dialog. Also, use the same code to
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16490
diff
changeset
|
737 | gtk_table_attach(GTK_TABLE(table), dialog->play_sound, 0, 1, 5, 6, |
| 5032 | 738 | GTK_FILL, 0, 0, 0); |
|
17388
8be39f0de528
Allow formatted text in the pounce dialog. Also, use the same code to
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16490
diff
changeset
|
739 | gtk_table_attach(GTK_TABLE(table), dialog->play_sound_entry, 1, 2, 5, 6, |
| 5032 | 740 | GTK_FILL, 0, 0, 0); |
|
17388
8be39f0de528
Allow formatted text in the pounce dialog. Also, use the same code to
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16490
diff
changeset
|
741 | gtk_table_attach(GTK_TABLE(table), dialog->play_sound_browse,2, 3, 5, 6, |
| 5319 | 742 | GTK_FILL | GTK_EXPAND, 0, 0, 0); |
|
17388
8be39f0de528
Allow formatted text in the pounce dialog. Also, use the same code to
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16490
diff
changeset
|
743 | gtk_table_attach(GTK_TABLE(table), dialog->play_sound_test, 3, 4, 5, 6, |
| 5319 | 744 | GTK_FILL | GTK_EXPAND, 0, 0, 0); |
|
23260
56fda1590379
Make it more obvious that there is a default buddy pounce sound, and
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22214
diff
changeset
|
745 | gtk_table_attach(GTK_TABLE(table), dialog->play_sound_reset, 4, 5, 5, 6, |
|
56fda1590379
Make it more obvious that there is a default buddy pounce sound, and
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22214
diff
changeset
|
746 | GTK_FILL | GTK_EXPAND, 0, 0, 0); |
| 5032 | 747 | |
| 15882 | 748 | gtk_table_set_row_spacings(GTK_TABLE(table), PIDGIN_HIG_BOX_SPACE / 2); |
| 12694 | 749 | |
| 5032 | 750 | gtk_widget_show(dialog->open_win); |
| 751 | gtk_widget_show(dialog->popup); | |
| 12934 | 752 | gtk_widget_show(dialog->popup_entry); |
| 5032 | 753 | gtk_widget_show(dialog->send_msg); |
|
17388
8be39f0de528
Allow formatted text in the pounce dialog. Also, use the same code to
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16490
diff
changeset
|
754 | gtk_widget_show(send_msg_imhtml); |
| 5032 | 755 | gtk_widget_show(dialog->exec_cmd); |
| 756 | gtk_widget_show(dialog->exec_cmd_entry); | |
| 5319 | 757 | gtk_widget_show(dialog->exec_cmd_browse); |
| 5032 | 758 | gtk_widget_show(dialog->play_sound); |
| 759 | gtk_widget_show(dialog->play_sound_entry); | |
| 5319 | 760 | gtk_widget_show(dialog->play_sound_browse); |
| 761 | gtk_widget_show(dialog->play_sound_test); | |
|
23260
56fda1590379
Make it more obvious that there is a default buddy pounce sound, and
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22214
diff
changeset
|
762 | gtk_widget_show(dialog->play_sound_reset); |
| 5032 | 763 | |
| 12694 | 764 | g_signal_connect(G_OBJECT(dialog->message_recv), "clicked", |
| 765 | G_CALLBACK(message_recv_toggle), | |
| 766 | dialog->send_msg); | |
| 767 | ||
| 5032 | 768 | g_signal_connect(G_OBJECT(dialog->send_msg), "clicked", |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15496
diff
changeset
|
769 | G_CALLBACK(pidgin_toggle_sensitive), |
|
17388
8be39f0de528
Allow formatted text in the pounce dialog. Also, use the same code to
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16490
diff
changeset
|
770 | send_msg_imhtml); |
| 5319 | 771 | |
| 12934 | 772 | g_signal_connect(G_OBJECT(dialog->popup), "clicked", |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15496
diff
changeset
|
773 | G_CALLBACK(pidgin_toggle_sensitive), |
| 12934 | 774 | dialog->popup_entry); |
| 775 | ||
| 5319 | 776 | exec_widgets = g_ptr_array_new(); |
| 777 | g_ptr_array_add(exec_widgets,dialog->exec_cmd_entry); | |
| 778 | g_ptr_array_add(exec_widgets,dialog->exec_cmd_browse); | |
|
7035
76bca80cd91d
[gaim-migrate @ 7598]
Christian Hammond <chipx86@chipx86.com>
parents:
6982
diff
changeset
|
779 | |
| 5032 | 780 | g_signal_connect(G_OBJECT(dialog->exec_cmd), "clicked", |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15496
diff
changeset
|
781 | G_CALLBACK(pidgin_toggle_sensitive_array), |
| 5319 | 782 | exec_widgets); |
| 783 | g_signal_connect(G_OBJECT(dialog->exec_cmd_browse), "clicked", | |
|
5857
52cff8a95261
[gaim-migrate @ 6288]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
784 | G_CALLBACK(filesel), |
| 5032 | 785 | dialog->exec_cmd_entry); |
|
15315
048e3e051d67
[gaim-migrate @ 18043]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15058
diff
changeset
|
786 | g_object_set_data_full(G_OBJECT(dialog->window), "exec-widgets", |
|
048e3e051d67
[gaim-migrate @ 18043]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15058
diff
changeset
|
787 | exec_widgets, (GDestroyNotify)g_ptr_array_free); |
| 5319 | 788 | |
| 789 | sound_widgets = g_ptr_array_new(); | |
| 790 | g_ptr_array_add(sound_widgets,dialog->play_sound_entry); | |
| 791 | g_ptr_array_add(sound_widgets,dialog->play_sound_browse); | |
| 792 | g_ptr_array_add(sound_widgets,dialog->play_sound_test); | |
|
23260
56fda1590379
Make it more obvious that there is a default buddy pounce sound, and
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22214
diff
changeset
|
793 | g_ptr_array_add(sound_widgets,dialog->play_sound_reset); |
| 5319 | 794 | |
| 5032 | 795 | g_signal_connect(G_OBJECT(dialog->play_sound), "clicked", |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15496
diff
changeset
|
796 | G_CALLBACK(pidgin_toggle_sensitive_array), |
| 5319 | 797 | sound_widgets); |
| 798 | g_signal_connect(G_OBJECT(dialog->play_sound_browse), "clicked", | |
|
5857
52cff8a95261
[gaim-migrate @ 6288]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
799 | G_CALLBACK(filesel), |
| 5032 | 800 | dialog->play_sound_entry); |
| 5319 | 801 | g_signal_connect(G_OBJECT(dialog->play_sound_test), "clicked", |
| 802 | G_CALLBACK(pounce_test_sound), | |
| 803 | dialog->play_sound_entry); | |
|
23260
56fda1590379
Make it more obvious that there is a default buddy pounce sound, and
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22214
diff
changeset
|
804 | g_signal_connect(G_OBJECT(dialog->play_sound_reset), "clicked", |
|
56fda1590379
Make it more obvious that there is a default buddy pounce sound, and
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22214
diff
changeset
|
805 | G_CALLBACK(pounce_reset_sound), |
|
56fda1590379
Make it more obvious that there is a default buddy pounce sound, and
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22214
diff
changeset
|
806 | dialog->play_sound_entry); |
|
15315
048e3e051d67
[gaim-migrate @ 18043]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15058
diff
changeset
|
807 | g_object_set_data_full(G_OBJECT(dialog->window), "sound-widgets", |
|
048e3e051d67
[gaim-migrate @ 18043]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15058
diff
changeset
|
808 | sound_widgets, (GDestroyNotify)g_ptr_array_free); |
|
7035
76bca80cd91d
[gaim-migrate @ 7598]
Christian Hammond <chipx86@chipx86.com>
parents:
6982
diff
changeset
|
809 | |
|
17388
8be39f0de528
Allow formatted text in the pounce dialog. Also, use the same code to
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16490
diff
changeset
|
810 | g_signal_connect_swapped(G_OBJECT(dialog->send_msg_entry), "format_function_clear", |
|
8be39f0de528
Allow formatted text in the pounce dialog. Also, use the same code to
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16490
diff
changeset
|
811 | G_CALLBACK(reset_send_msg_entry), dialog); |
|
8be39f0de528
Allow formatted text in the pounce dialog. Also, use the same code to
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16490
diff
changeset
|
812 | g_signal_connect_swapped(G_OBJECT(dialog->account_menu), "changed", |
|
8be39f0de528
Allow formatted text in the pounce dialog. Also, use the same code to
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16490
diff
changeset
|
813 | G_CALLBACK(reset_send_msg_entry), dialog); |
|
8be39f0de528
Allow formatted text in the pounce dialog. Also, use the same code to
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16490
diff
changeset
|
814 | |
|
8be39f0de528
Allow formatted text in the pounce dialog. Also, use the same code to
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16490
diff
changeset
|
815 | g_signal_connect(G_OBJECT(dialog->send_msg_entry), "message_send", |
| 5032 | 816 | G_CALLBACK(save_pounce_cb), dialog); |
| 12934 | 817 | g_signal_connect(G_OBJECT(dialog->popup_entry), "activate", |
| 818 | G_CALLBACK(save_pounce_cb), dialog); | |
| 5032 | 819 | g_signal_connect(G_OBJECT(dialog->exec_cmd_entry), "activate", |
| 820 | G_CALLBACK(save_pounce_cb), dialog); | |
|
7035
76bca80cd91d
[gaim-migrate @ 7598]
Christian Hammond <chipx86@chipx86.com>
parents:
6982
diff
changeset
|
821 | |
| 12694 | 822 | /* Create the "Options" frame. */ |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15496
diff
changeset
|
823 | frame = pidgin_make_frame(vbox2, _("Options")); |
| 12694 | 824 | |
| 825 | table = gtk_table_new(2, 1, FALSE); | |
| 826 | gtk_container_add(GTK_CONTAINER(frame), table); | |
| 15882 | 827 | gtk_table_set_col_spacings(GTK_TABLE(table), PIDGIN_HIG_BORDER); |
| 12694 | 828 | gtk_widget_show(table); |
| 829 | ||
| 830 | dialog->on_away = | |
|
17655
64f25df341e4
Hopefully make what this checkbox does a little more clear by changing
Etan Reisner <deryni@pidgin.im>
parents:
16490
diff
changeset
|
831 | gtk_check_button_new_with_mnemonic(_("P_ounce only when my status is not Available")); |
| 12694 | 832 | gtk_table_attach(GTK_TABLE(table), dialog->on_away, 0, 1, 0, 1, |
| 833 | GTK_FILL, 0, 0, 0); | |
| 834 | ||
| 5032 | 835 | dialog->save_pounce = gtk_check_button_new_with_mnemonic( |
|
12186
fddd08d58f3b
[gaim-migrate @ 14488]
Mark Doliner <markdoliner@pidgin.im>
parents:
12144
diff
changeset
|
836 | _("_Recurring")); |
| 12694 | 837 | gtk_table_attach(GTK_TABLE(table), dialog->save_pounce, 0, 1, 1, 2, |
| 838 | GTK_FILL, 0, 0, 0); | |
| 5032 | 839 | |
| 12694 | 840 | gtk_widget_show(dialog->on_away); |
| 841 | gtk_widget_show(dialog->save_pounce); | |
| 5032 | 842 | |
| 843 | /* Cancel button */ | |
|
19546
b7a8a86af65a
Use GtkDialog more often. Thanks nix_nix. Fixes #2618
Sean Egan <seanegan@pidgin.im>
parents:
18966
diff
changeset
|
844 | button = gtk_dialog_add_button(GTK_DIALOG(window), GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL); |
| 5032 | 845 | g_signal_connect(G_OBJECT(button), "clicked", |
| 846 | G_CALLBACK(cancel_cb), dialog); | |
| 847 | ||
|
25390
02100938b030
Make dialogs that double as add and save dialogs indicate the current action
Etan Reisner <deryni@pidgin.im>
parents:
24594
diff
changeset
|
848 | /* Save/Add button */ |
|
02100938b030
Make dialogs that double as add and save dialogs indicate the current action
Etan Reisner <deryni@pidgin.im>
parents:
24594
diff
changeset
|
849 | dialog->save_button = button = gtk_dialog_add_button(GTK_DIALOG(window), |
|
02100938b030
Make dialogs that double as add and save dialogs indicate the current action
Etan Reisner <deryni@pidgin.im>
parents:
24594
diff
changeset
|
850 | (cur_pounce == NULL ? GTK_STOCK_ADD : GTK_STOCK_SAVE), |
|
02100938b030
Make dialogs that double as add and save dialogs indicate the current action
Etan Reisner <deryni@pidgin.im>
parents:
24594
diff
changeset
|
851 | GTK_RESPONSE_OK); |
| 5032 | 852 | g_signal_connect(G_OBJECT(button), "clicked", |
|
25390
02100938b030
Make dialogs that double as add and save dialogs indicate the current action
Etan Reisner <deryni@pidgin.im>
parents:
24594
diff
changeset
|
853 | G_CALLBACK(save_pounce_cb), dialog); |
| 5032 | 854 | |
|
5876
c12b198bde14
[gaim-migrate @ 6308]
Christian Hammond <chipx86@chipx86.com>
parents:
5875
diff
changeset
|
855 | if (*gtk_entry_get_text(GTK_ENTRY(dialog->buddy_entry)) == '\0') |
|
c12b198bde14
[gaim-migrate @ 6308]
Christian Hammond <chipx86@chipx86.com>
parents:
5875
diff
changeset
|
856 | gtk_widget_set_sensitive(button, FALSE); |
|
c12b198bde14
[gaim-migrate @ 6308]
Christian Hammond <chipx86@chipx86.com>
parents:
5875
diff
changeset
|
857 | |
|
8803
79bc4ecbcac7
[gaim-migrate @ 9565]
Christian Hammond <chipx86@chipx86.com>
parents:
8259
diff
changeset
|
858 | /* Setup drag-and-drop */ |
|
79bc4ecbcac7
[gaim-migrate @ 9565]
Christian Hammond <chipx86@chipx86.com>
parents:
8259
diff
changeset
|
859 | gtk_drag_dest_set(window, |
|
79bc4ecbcac7
[gaim-migrate @ 9565]
Christian Hammond <chipx86@chipx86.com>
parents:
8259
diff
changeset
|
860 | GTK_DEST_DEFAULT_MOTION | |
|
79bc4ecbcac7
[gaim-migrate @ 9565]
Christian Hammond <chipx86@chipx86.com>
parents:
8259
diff
changeset
|
861 | GTK_DEST_DEFAULT_DROP, |
|
79bc4ecbcac7
[gaim-migrate @ 9565]
Christian Hammond <chipx86@chipx86.com>
parents:
8259
diff
changeset
|
862 | dnd_targets, |
|
79bc4ecbcac7
[gaim-migrate @ 9565]
Christian Hammond <chipx86@chipx86.com>
parents:
8259
diff
changeset
|
863 | sizeof(dnd_targets) / sizeof(GtkTargetEntry), |
|
79bc4ecbcac7
[gaim-migrate @ 9565]
Christian Hammond <chipx86@chipx86.com>
parents:
8259
diff
changeset
|
864 | GDK_ACTION_COPY); |
|
79bc4ecbcac7
[gaim-migrate @ 9565]
Christian Hammond <chipx86@chipx86.com>
parents:
8259
diff
changeset
|
865 | gtk_drag_dest_set(dialog->buddy_entry, |
|
79bc4ecbcac7
[gaim-migrate @ 9565]
Christian Hammond <chipx86@chipx86.com>
parents:
8259
diff
changeset
|
866 | GTK_DEST_DEFAULT_MOTION | |
|
79bc4ecbcac7
[gaim-migrate @ 9565]
Christian Hammond <chipx86@chipx86.com>
parents:
8259
diff
changeset
|
867 | GTK_DEST_DEFAULT_DROP, |
|
79bc4ecbcac7
[gaim-migrate @ 9565]
Christian Hammond <chipx86@chipx86.com>
parents:
8259
diff
changeset
|
868 | dnd_targets, |
|
79bc4ecbcac7
[gaim-migrate @ 9565]
Christian Hammond <chipx86@chipx86.com>
parents:
8259
diff
changeset
|
869 | sizeof(dnd_targets) / sizeof(GtkTargetEntry), |
|
79bc4ecbcac7
[gaim-migrate @ 9565]
Christian Hammond <chipx86@chipx86.com>
parents:
8259
diff
changeset
|
870 | GDK_ACTION_COPY); |
|
79bc4ecbcac7
[gaim-migrate @ 9565]
Christian Hammond <chipx86@chipx86.com>
parents:
8259
diff
changeset
|
871 | |
|
79bc4ecbcac7
[gaim-migrate @ 9565]
Christian Hammond <chipx86@chipx86.com>
parents:
8259
diff
changeset
|
872 | g_signal_connect(G_OBJECT(window), "drag_data_received", |
|
79bc4ecbcac7
[gaim-migrate @ 9565]
Christian Hammond <chipx86@chipx86.com>
parents:
8259
diff
changeset
|
873 | G_CALLBACK(pounce_dnd_recv), dialog); |
|
79bc4ecbcac7
[gaim-migrate @ 9565]
Christian Hammond <chipx86@chipx86.com>
parents:
8259
diff
changeset
|
874 | g_signal_connect(G_OBJECT(dialog->buddy_entry), "drag_data_received", |
|
79bc4ecbcac7
[gaim-migrate @ 9565]
Christian Hammond <chipx86@chipx86.com>
parents:
8259
diff
changeset
|
875 | G_CALLBACK(pounce_dnd_recv), dialog); |
|
79bc4ecbcac7
[gaim-migrate @ 9565]
Christian Hammond <chipx86@chipx86.com>
parents:
8259
diff
changeset
|
876 | |
| 5032 | 877 | /* Set the values of stuff. */ |
|
9205
8c4dbbe6386f
[gaim-migrate @ 10000]
Christian Hammond <chipx86@chipx86.com>
parents:
9191
diff
changeset
|
878 | if (cur_pounce != NULL) |
|
8c4dbbe6386f
[gaim-migrate @ 10000]
Christian Hammond <chipx86@chipx86.com>
parents:
9191
diff
changeset
|
879 | { |
| 15884 | 880 | PurplePounceEvent events = purple_pounce_get_events(cur_pounce); |
| 881 | PurplePounceOption options = purple_pounce_get_options(cur_pounce); | |
|
5864
86822afeeab0
[gaim-migrate @ 6295]
Christian Hammond <chipx86@chipx86.com>
parents:
5857
diff
changeset
|
882 | const char *value; |
| 5032 | 883 | |
| 12694 | 884 | /* Options */ |
| 885 | gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(dialog->on_away), | |
| 15884 | 886 | (options & PURPLE_POUNCE_OPTION_AWAY)); |
| 12694 | 887 | |
|
5864
86822afeeab0
[gaim-migrate @ 6295]
Christian Hammond <chipx86@chipx86.com>
parents:
5857
diff
changeset
|
888 | /* Events */ |
| 5032 | 889 | gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(dialog->signon), |
| 15884 | 890 | (events & PURPLE_POUNCE_SIGNON)); |
| 5032 | 891 | gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(dialog->signoff), |
| 15884 | 892 | (events & PURPLE_POUNCE_SIGNOFF)); |
| 5032 | 893 | gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(dialog->away), |
| 15884 | 894 | (events & PURPLE_POUNCE_AWAY)); |
| 5032 | 895 | gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(dialog->away_return), |
| 15884 | 896 | (events & PURPLE_POUNCE_AWAY_RETURN)); |
| 5032 | 897 | gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(dialog->idle), |
| 15884 | 898 | (events & PURPLE_POUNCE_IDLE)); |
| 5032 | 899 | gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(dialog->idle_return), |
| 15884 | 900 | (events & PURPLE_POUNCE_IDLE_RETURN)); |
| 5032 | 901 | gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(dialog->typing), |
| 15884 | 902 | (events & PURPLE_POUNCE_TYPING)); |
|
13844
835b8f7b3d1d
[gaim-migrate @ 16295]
Mark Doliner <markdoliner@pidgin.im>
parents:
13775
diff
changeset
|
903 | gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(dialog->typed), |
| 15884 | 904 | (events & PURPLE_POUNCE_TYPED)); |
| 5032 | 905 | gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(dialog->stop_typing), |
| 15884 | 906 | (events & PURPLE_POUNCE_TYPING_STOPPED)); |
| 12694 | 907 | gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(dialog->message_recv), |
| 15884 | 908 | (events & PURPLE_POUNCE_MESSAGE_RECEIVED)); |
| 5032 | 909 | |
|
5864
86822afeeab0
[gaim-migrate @ 6295]
Christian Hammond <chipx86@chipx86.com>
parents:
5857
diff
changeset
|
910 | /* Actions */ |
| 5032 | 911 | gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(dialog->open_win), |
| 15884 | 912 | purple_pounce_action_is_enabled(cur_pounce, "open-window")); |
| 5032 | 913 | gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(dialog->popup), |
| 15884 | 914 | purple_pounce_action_is_enabled(cur_pounce, "popup-notify")); |
| 5032 | 915 | gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(dialog->send_msg), |
| 15884 | 916 | purple_pounce_action_is_enabled(cur_pounce, "send-message")); |
| 5032 | 917 | gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(dialog->exec_cmd), |
| 15884 | 918 | purple_pounce_action_is_enabled(cur_pounce, "execute-command")); |
| 5032 | 919 | gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(dialog->play_sound), |
| 15884 | 920 | purple_pounce_action_is_enabled(cur_pounce, "play-sound")); |
| 5032 | 921 | |
| 922 | gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(dialog->save_pounce), | |
| 15884 | 923 | purple_pounce_get_save(cur_pounce)); |
|
5864
86822afeeab0
[gaim-migrate @ 6295]
Christian Hammond <chipx86@chipx86.com>
parents:
5857
diff
changeset
|
924 | |
| 15884 | 925 | if ((value = purple_pounce_action_get_attribute(cur_pounce, |
|
5864
86822afeeab0
[gaim-migrate @ 6295]
Christian Hammond <chipx86@chipx86.com>
parents:
5857
diff
changeset
|
926 | "send-message", |
|
9205
8c4dbbe6386f
[gaim-migrate @ 10000]
Christian Hammond <chipx86@chipx86.com>
parents:
9191
diff
changeset
|
927 | "message")) != NULL) |
|
8c4dbbe6386f
[gaim-migrate @ 10000]
Christian Hammond <chipx86@chipx86.com>
parents:
9191
diff
changeset
|
928 | { |
|
17388
8be39f0de528
Allow formatted text in the pounce dialog. Also, use the same code to
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16490
diff
changeset
|
929 | gtk_imhtml_append_text(GTK_IMHTML(dialog->send_msg_entry), value, 0); |
|
5864
86822afeeab0
[gaim-migrate @ 6295]
Christian Hammond <chipx86@chipx86.com>
parents:
5857
diff
changeset
|
930 | } |
| 5032 | 931 | |
| 15884 | 932 | if ((value = purple_pounce_action_get_attribute(cur_pounce, |
| 12934 | 933 | "popup-notify", |
| 934 | "reason")) != NULL) | |
| 935 | { | |
| 936 | gtk_entry_set_text(GTK_ENTRY(dialog->popup_entry), value); | |
| 937 | } | |
| 938 | ||
| 15884 | 939 | if ((value = purple_pounce_action_get_attribute(cur_pounce, |
|
5864
86822afeeab0
[gaim-migrate @ 6295]
Christian Hammond <chipx86@chipx86.com>
parents:
5857
diff
changeset
|
940 | "execute-command", |
|
9205
8c4dbbe6386f
[gaim-migrate @ 10000]
Christian Hammond <chipx86@chipx86.com>
parents:
9191
diff
changeset
|
941 | "command")) != NULL) |
|
8c4dbbe6386f
[gaim-migrate @ 10000]
Christian Hammond <chipx86@chipx86.com>
parents:
9191
diff
changeset
|
942 | { |
|
5864
86822afeeab0
[gaim-migrate @ 6295]
Christian Hammond <chipx86@chipx86.com>
parents:
5857
diff
changeset
|
943 | gtk_entry_set_text(GTK_ENTRY(dialog->exec_cmd_entry), value); |
|
86822afeeab0
[gaim-migrate @ 6295]
Christian Hammond <chipx86@chipx86.com>
parents:
5857
diff
changeset
|
944 | } |
|
86822afeeab0
[gaim-migrate @ 6295]
Christian Hammond <chipx86@chipx86.com>
parents:
5857
diff
changeset
|
945 | |
| 15884 | 946 | if ((value = purple_pounce_action_get_attribute(cur_pounce, |
|
5864
86822afeeab0
[gaim-migrate @ 6295]
Christian Hammond <chipx86@chipx86.com>
parents:
5857
diff
changeset
|
947 | "play-sound", |
|
9205
8c4dbbe6386f
[gaim-migrate @ 10000]
Christian Hammond <chipx86@chipx86.com>
parents:
9191
diff
changeset
|
948 | "filename")) != NULL) |
|
8c4dbbe6386f
[gaim-migrate @ 10000]
Christian Hammond <chipx86@chipx86.com>
parents:
9191
diff
changeset
|
949 | { |
|
23260
56fda1590379
Make it more obvious that there is a default buddy pounce sound, and
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22214
diff
changeset
|
950 | gtk_entry_set_text(GTK_ENTRY(dialog->play_sound_entry), (value && *value != '\0') ? value : _("(default)")); |
|
5864
86822afeeab0
[gaim-migrate @ 6295]
Christian Hammond <chipx86@chipx86.com>
parents:
5857
diff
changeset
|
951 | } |
| 5032 | 952 | } |
|
9205
8c4dbbe6386f
[gaim-migrate @ 10000]
Christian Hammond <chipx86@chipx86.com>
parents:
9191
diff
changeset
|
953 | else |
|
8c4dbbe6386f
[gaim-migrate @ 10000]
Christian Hammond <chipx86@chipx86.com>
parents:
9191
diff
changeset
|
954 | { |
| 15884 | 955 | PurpleBuddy *buddy = NULL; |
|
9205
8c4dbbe6386f
[gaim-migrate @ 10000]
Christian Hammond <chipx86@chipx86.com>
parents:
9191
diff
changeset
|
956 | |
|
8c4dbbe6386f
[gaim-migrate @ 10000]
Christian Hammond <chipx86@chipx86.com>
parents:
9191
diff
changeset
|
957 | if (name != NULL) |
| 15884 | 958 | buddy = purple_find_buddy(account, name); |
|
9205
8c4dbbe6386f
[gaim-migrate @ 10000]
Christian Hammond <chipx86@chipx86.com>
parents:
9191
diff
changeset
|
959 | |
| 5032 | 960 | /* Set some defaults */ |
|
9205
8c4dbbe6386f
[gaim-migrate @ 10000]
Christian Hammond <chipx86@chipx86.com>
parents:
9191
diff
changeset
|
961 | if (buddy == NULL) |
|
8c4dbbe6386f
[gaim-migrate @ 10000]
Christian Hammond <chipx86@chipx86.com>
parents:
9191
diff
changeset
|
962 | { |
|
8c4dbbe6386f
[gaim-migrate @ 10000]
Christian Hammond <chipx86@chipx86.com>
parents:
9191
diff
changeset
|
963 | gtk_toggle_button_set_active( |
|
8c4dbbe6386f
[gaim-migrate @ 10000]
Christian Hammond <chipx86@chipx86.com>
parents:
9191
diff
changeset
|
964 | GTK_TOGGLE_BUTTON(dialog->signon), TRUE); |
|
8c4dbbe6386f
[gaim-migrate @ 10000]
Christian Hammond <chipx86@chipx86.com>
parents:
9191
diff
changeset
|
965 | } |
|
8c4dbbe6386f
[gaim-migrate @ 10000]
Christian Hammond <chipx86@chipx86.com>
parents:
9191
diff
changeset
|
966 | else |
|
8c4dbbe6386f
[gaim-migrate @ 10000]
Christian Hammond <chipx86@chipx86.com>
parents:
9191
diff
changeset
|
967 | { |
| 15884 | 968 | if (!PURPLE_BUDDY_IS_ONLINE(buddy)) |
|
9205
8c4dbbe6386f
[gaim-migrate @ 10000]
Christian Hammond <chipx86@chipx86.com>
parents:
9191
diff
changeset
|
969 | { |
|
8c4dbbe6386f
[gaim-migrate @ 10000]
Christian Hammond <chipx86@chipx86.com>
parents:
9191
diff
changeset
|
970 | gtk_toggle_button_set_active( |
|
8c4dbbe6386f
[gaim-migrate @ 10000]
Christian Hammond <chipx86@chipx86.com>
parents:
9191
diff
changeset
|
971 | GTK_TOGGLE_BUTTON(dialog->signon), TRUE); |
|
8c4dbbe6386f
[gaim-migrate @ 10000]
Christian Hammond <chipx86@chipx86.com>
parents:
9191
diff
changeset
|
972 | } |
|
8c4dbbe6386f
[gaim-migrate @ 10000]
Christian Hammond <chipx86@chipx86.com>
parents:
9191
diff
changeset
|
973 | else |
|
8c4dbbe6386f
[gaim-migrate @ 10000]
Christian Hammond <chipx86@chipx86.com>
parents:
9191
diff
changeset
|
974 | { |
|
8c4dbbe6386f
[gaim-migrate @ 10000]
Christian Hammond <chipx86@chipx86.com>
parents:
9191
diff
changeset
|
975 | gboolean default_set = FALSE; |
| 15884 | 976 | PurplePresence *presence = purple_buddy_get_presence(buddy); |
|
9205
8c4dbbe6386f
[gaim-migrate @ 10000]
Christian Hammond <chipx86@chipx86.com>
parents:
9191
diff
changeset
|
977 | |
| 15884 | 978 | if (purple_presence_is_idle(presence)) |
|
9205
8c4dbbe6386f
[gaim-migrate @ 10000]
Christian Hammond <chipx86@chipx86.com>
parents:
9191
diff
changeset
|
979 | { |
|
8c4dbbe6386f
[gaim-migrate @ 10000]
Christian Hammond <chipx86@chipx86.com>
parents:
9191
diff
changeset
|
980 | gtk_toggle_button_set_active( |
|
8c4dbbe6386f
[gaim-migrate @ 10000]
Christian Hammond <chipx86@chipx86.com>
parents:
9191
diff
changeset
|
981 | GTK_TOGGLE_BUTTON(dialog->idle_return), TRUE); |
|
8c4dbbe6386f
[gaim-migrate @ 10000]
Christian Hammond <chipx86@chipx86.com>
parents:
9191
diff
changeset
|
982 | |
|
8c4dbbe6386f
[gaim-migrate @ 10000]
Christian Hammond <chipx86@chipx86.com>
parents:
9191
diff
changeset
|
983 | default_set = TRUE; |
|
8c4dbbe6386f
[gaim-migrate @ 10000]
Christian Hammond <chipx86@chipx86.com>
parents:
9191
diff
changeset
|
984 | } |
|
8c4dbbe6386f
[gaim-migrate @ 10000]
Christian Hammond <chipx86@chipx86.com>
parents:
9191
diff
changeset
|
985 | |
| 15884 | 986 | if (!purple_presence_is_available(presence)) |
|
9205
8c4dbbe6386f
[gaim-migrate @ 10000]
Christian Hammond <chipx86@chipx86.com>
parents:
9191
diff
changeset
|
987 | { |
|
8c4dbbe6386f
[gaim-migrate @ 10000]
Christian Hammond <chipx86@chipx86.com>
parents:
9191
diff
changeset
|
988 | gtk_toggle_button_set_active( |
|
8c4dbbe6386f
[gaim-migrate @ 10000]
Christian Hammond <chipx86@chipx86.com>
parents:
9191
diff
changeset
|
989 | GTK_TOGGLE_BUTTON(dialog->away_return), TRUE); |
|
8c4dbbe6386f
[gaim-migrate @ 10000]
Christian Hammond <chipx86@chipx86.com>
parents:
9191
diff
changeset
|
990 | |
|
8c4dbbe6386f
[gaim-migrate @ 10000]
Christian Hammond <chipx86@chipx86.com>
parents:
9191
diff
changeset
|
991 | default_set = TRUE; |
|
8c4dbbe6386f
[gaim-migrate @ 10000]
Christian Hammond <chipx86@chipx86.com>
parents:
9191
diff
changeset
|
992 | } |
|
8c4dbbe6386f
[gaim-migrate @ 10000]
Christian Hammond <chipx86@chipx86.com>
parents:
9191
diff
changeset
|
993 | |
|
8c4dbbe6386f
[gaim-migrate @ 10000]
Christian Hammond <chipx86@chipx86.com>
parents:
9191
diff
changeset
|
994 | if (!default_set) |
|
8c4dbbe6386f
[gaim-migrate @ 10000]
Christian Hammond <chipx86@chipx86.com>
parents:
9191
diff
changeset
|
995 | { |
|
8c4dbbe6386f
[gaim-migrate @ 10000]
Christian Hammond <chipx86@chipx86.com>
parents:
9191
diff
changeset
|
996 | gtk_toggle_button_set_active( |
|
8c4dbbe6386f
[gaim-migrate @ 10000]
Christian Hammond <chipx86@chipx86.com>
parents:
9191
diff
changeset
|
997 | GTK_TOGGLE_BUTTON(dialog->signon), TRUE); |
|
8c4dbbe6386f
[gaim-migrate @ 10000]
Christian Hammond <chipx86@chipx86.com>
parents:
9191
diff
changeset
|
998 | } |
|
8c4dbbe6386f
[gaim-migrate @ 10000]
Christian Hammond <chipx86@chipx86.com>
parents:
9191
diff
changeset
|
999 | } |
|
8c4dbbe6386f
[gaim-migrate @ 10000]
Christian Hammond <chipx86@chipx86.com>
parents:
9191
diff
changeset
|
1000 | } |
|
8c4dbbe6386f
[gaim-migrate @ 10000]
Christian Hammond <chipx86@chipx86.com>
parents:
9191
diff
changeset
|
1001 | |
|
9206
57a4db675f8d
[gaim-migrate @ 10001]
Christian Hammond <chipx86@chipx86.com>
parents:
9205
diff
changeset
|
1002 | gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(dialog->open_win), |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
1003 | purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/pounces/default_actions/open-window")); |
|
9206
57a4db675f8d
[gaim-migrate @ 10001]
Christian Hammond <chipx86@chipx86.com>
parents:
9205
diff
changeset
|
1004 | gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(dialog->popup), |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
1005 | purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/pounces/default_actions/popup-notify")); |
|
9206
57a4db675f8d
[gaim-migrate @ 10001]
Christian Hammond <chipx86@chipx86.com>
parents:
9205
diff
changeset
|
1006 | gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(dialog->send_msg), |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
1007 | purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/pounces/default_actions/send-message")); |
|
9206
57a4db675f8d
[gaim-migrate @ 10001]
Christian Hammond <chipx86@chipx86.com>
parents:
9205
diff
changeset
|
1008 | gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(dialog->exec_cmd), |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
1009 | purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/pounces/default_actions/execute-command")); |
|
9206
57a4db675f8d
[gaim-migrate @ 10001]
Christian Hammond <chipx86@chipx86.com>
parents:
9205
diff
changeset
|
1010 | gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(dialog->play_sound), |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
1011 | purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/pounces/default_actions/play-sound")); |
| 5032 | 1012 | } |
| 1013 | ||
|
19786
33ab83cd846b
Don't show *all*\!
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
19546
diff
changeset
|
1014 | gtk_widget_show(vbox2); |
| 5032 | 1015 | gtk_widget_show(window); |
| 1016 | } | |
| 1017 | ||
| 12136 | 1018 | static gboolean |
| 1019 | pounces_manager_configure_cb(GtkWidget *widget, GdkEventConfigure *event, PouncesManager *dialog) | |
| 1020 | { | |
| 1021 | if (GTK_WIDGET_VISIBLE(widget)) { | |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
1022 | purple_prefs_set_int(PIDGIN_PREFS_ROOT "/pounces/dialog/width", event->width); |
|
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
1023 | purple_prefs_set_int(PIDGIN_PREFS_ROOT "/pounces/dialog/height", event->height); |
| 12136 | 1024 | } |
| 1025 | ||
| 1026 | return FALSE; | |
| 1027 | } | |
| 1028 | ||
| 1029 | static gboolean | |
| 15884 | 1030 | pounces_manager_find_pounce(GtkTreeIter *iter, PurplePounce *pounce) |
| 5032 | 1031 | { |
| 12136 | 1032 | GtkTreeModel *model = GTK_TREE_MODEL(pounces_manager->model); |
| 15884 | 1033 | PurplePounce *p; |
| 12136 | 1034 | |
| 1035 | if (!gtk_tree_model_get_iter_first(model, iter)) | |
| 1036 | return FALSE; | |
| 1037 | ||
| 1038 | gtk_tree_model_get(model, iter, POUNCES_MANAGER_COLUMN_POUNCE, &p, -1); | |
| 1039 | if (pounce == p) | |
| 1040 | return TRUE; | |
| 1041 | ||
| 1042 | while (gtk_tree_model_iter_next(model, iter)) | |
| 1043 | { | |
| 1044 | gtk_tree_model_get(model, iter, POUNCES_MANAGER_COLUMN_POUNCE, &p, -1); | |
| 1045 | if (pounce == p) | |
| 1046 | return TRUE; | |
| 1047 | } | |
| 1048 | ||
| 1049 | return FALSE; | |
| 1050 | } | |
| 1051 | ||
| 1052 | static gboolean | |
| 1053 | pounces_manager_destroy_cb(GtkWidget *widget, GdkEvent *event, gpointer user_data) | |
| 1054 | { | |
| 1055 | PouncesManager *dialog = user_data; | |
| 1056 | ||
| 1057 | dialog->window = NULL; | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15496
diff
changeset
|
1058 | pidgin_pounces_manager_hide(); |
| 12136 | 1059 | |
| 1060 | return FALSE; | |
| 1061 | } | |
| 1062 | ||
| 1063 | static void | |
| 15884 | 1064 | pounces_manager_connection_cb(PurpleConnection *gc, GtkWidget *add_button) |
| 12136 | 1065 | { |
| 15884 | 1066 | gtk_widget_set_sensitive(add_button, (purple_connections_get_all() != NULL)); |
| 5032 | 1067 | } |
| 1068 | ||
| 1069 | static void | |
| 12136 | 1070 | pounces_manager_add_cb(GtkButton *button, gpointer user_data) |
| 1071 | { | |
|
21214
db28e29a4990
Reverted changes from ef7ac46f90a801547f7dfc4295927a956f90e869 to
Richard Laager <rlaager@pidgin.im>
parents:
21171
diff
changeset
|
1072 | pidgin_pounce_editor_show(NULL, NULL, NULL); |
| 12136 | 1073 | } |
| 1074 | ||
| 1075 | static void | |
| 1076 | pounces_manager_modify_foreach(GtkTreeModel *model, GtkTreePath *path, | |
| 1077 | GtkTreeIter *iter, gpointer user_data) | |
|
5153
4865538db77a
[gaim-migrate @ 5517]
Christian Hammond <chipx86@chipx86.com>
parents:
5054
diff
changeset
|
1078 | { |
| 15884 | 1079 | PurplePounce *pounce; |
| 12136 | 1080 | |
| 1081 | gtk_tree_model_get(model, iter, POUNCES_MANAGER_COLUMN_POUNCE, &pounce, -1); | |
|
21214
db28e29a4990
Reverted changes from ef7ac46f90a801547f7dfc4295927a956f90e869 to
Richard Laager <rlaager@pidgin.im>
parents:
21171
diff
changeset
|
1082 | pidgin_pounce_editor_show(NULL, NULL, pounce); |
| 12136 | 1083 | } |
| 1084 | ||
| 1085 | static void | |
| 1086 | pounces_manager_modify_cb(GtkButton *button, gpointer user_data) | |
| 1087 | { | |
| 1088 | PouncesManager *dialog = user_data; | |
| 1089 | GtkTreeSelection *selection; | |
| 1090 | ||
| 1091 | selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(dialog->treeview)); | |
| 1092 | ||
| 1093 | gtk_tree_selection_selected_foreach(selection, pounces_manager_modify_foreach, user_data); | |
| 1094 | } | |
| 1095 | ||
| 1096 | static void | |
| 15884 | 1097 | pounces_manager_delete_confirm_cb(PurplePounce *pounce) |
| 12136 | 1098 | { |
| 1099 | GtkTreeIter iter; | |
| 1100 | ||
|
13172
4e7621289194
[gaim-migrate @ 15534]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13120
diff
changeset
|
1101 | if (pounces_manager && pounces_manager_find_pounce(&iter, pounce)) |
| 12136 | 1102 | gtk_list_store_remove(pounces_manager->model, &iter); |
| 1103 | ||
| 15884 | 1104 | purple_request_close_with_handle(pounce); |
| 1105 | purple_pounce_destroy(pounce); | |
|
5153
4865538db77a
[gaim-migrate @ 5517]
Christian Hammond <chipx86@chipx86.com>
parents:
5054
diff
changeset
|
1106 | } |
|
4865538db77a
[gaim-migrate @ 5517]
Christian Hammond <chipx86@chipx86.com>
parents:
5054
diff
changeset
|
1107 | |
|
4865538db77a
[gaim-migrate @ 5517]
Christian Hammond <chipx86@chipx86.com>
parents:
5054
diff
changeset
|
1108 | static void |
| 12136 | 1109 | pounces_manager_delete_foreach(GtkTreeModel *model, GtkTreePath *path, |
| 1110 | GtkTreeIter *iter, gpointer user_data) | |
| 1111 | { | |
| 15884 | 1112 | PurplePounce *pounce; |
| 1113 | PurpleAccount *account; | |
| 12136 | 1114 | const char *pouncer, *pouncee; |
| 1115 | char *buf; | |
| 1116 | ||
| 1117 | gtk_tree_model_get(model, iter, POUNCES_MANAGER_COLUMN_POUNCE, &pounce, -1); | |
| 15884 | 1118 | account = purple_pounce_get_pouncer(pounce); |
| 1119 | pouncer = purple_account_get_username(account); | |
| 1120 | pouncee = purple_pounce_get_pouncee(pounce); | |
| 12136 | 1121 | |
| 1122 | buf = g_strdup_printf(_("Are you sure you want to delete the pounce on %s for %s?"), pouncee, pouncer); | |
|
21175
c6d76b49c206
disapproval of revision '8ba833993a115415727bb1b70362e0bd1603c169'
Richard Laager <rlaager@pidgin.im>
parents:
21174
diff
changeset
|
1123 | purple_request_action(pounce, NULL, buf, NULL, 0, |
|
16490
68c22924d66b
Added account, who, and conversation parameters to the request API calls, and updated all code to match. I can't compile the Perl module, so I'd appreciate it if someone who knows it would verify that this doesn't break Perl.
Evan Schoenberg <evands@pidgin.im>
parents:
16254
diff
changeset
|
1124 | account, pouncee, NULL, |
|
21175
c6d76b49c206
disapproval of revision '8ba833993a115415727bb1b70362e0bd1603c169'
Richard Laager <rlaager@pidgin.im>
parents:
21174
diff
changeset
|
1125 | pounce, 2, |
| 12136 | 1126 | _("Delete"), pounces_manager_delete_confirm_cb, |
|
13228
d1ef216aba5c
[gaim-migrate @ 15592]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13172
diff
changeset
|
1127 | _("Cancel"), NULL); |
| 12136 | 1128 | g_free(buf); |
| 1129 | } | |
| 1130 | ||
| 1131 | static void | |
| 1132 | pounces_manager_delete_cb(GtkButton *button, gpointer user_data) | |
| 1133 | { | |
| 1134 | PouncesManager *dialog = user_data; | |
| 1135 | GtkTreeSelection *selection; | |
| 1136 | ||
| 1137 | selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(dialog->treeview)); | |
| 1138 | ||
| 1139 | gtk_tree_selection_selected_foreach(selection, pounces_manager_delete_foreach, user_data); | |
| 1140 | } | |
| 1141 | ||
| 1142 | static void | |
| 1143 | pounces_manager_close_cb(GtkButton *button, gpointer user_data) | |
| 5032 | 1144 | { |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15496
diff
changeset
|
1145 | pidgin_pounces_manager_hide(); |
| 12136 | 1146 | } |
| 1147 | ||
| 1148 | static void | |
| 1149 | pounce_selected_cb(GtkTreeSelection *sel, gpointer user_data) | |
| 1150 | { | |
| 1151 | PouncesManager *dialog = user_data; | |
| 1152 | int num_selected = 0; | |
| 1153 | ||
| 1154 | num_selected = gtk_tree_selection_count_selected_rows(sel); | |
| 1155 | ||
| 1156 | gtk_widget_set_sensitive(dialog->modify_button, (num_selected > 0)); | |
| 1157 | gtk_widget_set_sensitive(dialog->delete_button, (num_selected > 0)); | |
| 1158 | } | |
| 1159 | ||
|
12137
6a9dafcaaed1
[gaim-migrate @ 14437]
Richard Laager <rlaager@pidgin.im>
parents:
12136
diff
changeset
|
1160 | static gboolean |
|
6a9dafcaaed1
[gaim-migrate @ 14437]
Richard Laager <rlaager@pidgin.im>
parents:
12136
diff
changeset
|
1161 | pounce_double_click_cb(GtkTreeView *treeview, GdkEventButton *event, gpointer user_data) |
|
6a9dafcaaed1
[gaim-migrate @ 14437]
Richard Laager <rlaager@pidgin.im>
parents:
12136
diff
changeset
|
1162 | { |
|
6a9dafcaaed1
[gaim-migrate @ 14437]
Richard Laager <rlaager@pidgin.im>
parents:
12136
diff
changeset
|
1163 | PouncesManager *dialog = user_data; |
|
6a9dafcaaed1
[gaim-migrate @ 14437]
Richard Laager <rlaager@pidgin.im>
parents:
12136
diff
changeset
|
1164 | GtkTreePath *path; |
|
6a9dafcaaed1
[gaim-migrate @ 14437]
Richard Laager <rlaager@pidgin.im>
parents:
12136
diff
changeset
|
1165 | GtkTreeIter iter; |
| 15884 | 1166 | PurplePounce *pounce; |
|
12137
6a9dafcaaed1
[gaim-migrate @ 14437]
Richard Laager <rlaager@pidgin.im>
parents:
12136
diff
changeset
|
1167 | |
|
6a9dafcaaed1
[gaim-migrate @ 14437]
Richard Laager <rlaager@pidgin.im>
parents:
12136
diff
changeset
|
1168 | /* Figure out which node was clicked */ |
|
6a9dafcaaed1
[gaim-migrate @ 14437]
Richard Laager <rlaager@pidgin.im>
parents:
12136
diff
changeset
|
1169 | if (!gtk_tree_view_get_path_at_pos(GTK_TREE_VIEW(dialog->treeview), event->x, event->y, &path, NULL, NULL, NULL)) |
|
6a9dafcaaed1
[gaim-migrate @ 14437]
Richard Laager <rlaager@pidgin.im>
parents:
12136
diff
changeset
|
1170 | return FALSE; |
|
6a9dafcaaed1
[gaim-migrate @ 14437]
Richard Laager <rlaager@pidgin.im>
parents:
12136
diff
changeset
|
1171 | gtk_tree_model_get_iter(GTK_TREE_MODEL(dialog->model), &iter, path); |
|
6a9dafcaaed1
[gaim-migrate @ 14437]
Richard Laager <rlaager@pidgin.im>
parents:
12136
diff
changeset
|
1172 | gtk_tree_path_free(path); |
|
6a9dafcaaed1
[gaim-migrate @ 14437]
Richard Laager <rlaager@pidgin.im>
parents:
12136
diff
changeset
|
1173 | gtk_tree_model_get(GTK_TREE_MODEL(dialog->model), &iter, POUNCES_MANAGER_COLUMN_POUNCE, &pounce, -1); |
|
6a9dafcaaed1
[gaim-migrate @ 14437]
Richard Laager <rlaager@pidgin.im>
parents:
12136
diff
changeset
|
1174 | |
|
6a9dafcaaed1
[gaim-migrate @ 14437]
Richard Laager <rlaager@pidgin.im>
parents:
12136
diff
changeset
|
1175 | if ((pounce != NULL) && (event->button == 1) && |
|
6a9dafcaaed1
[gaim-migrate @ 14437]
Richard Laager <rlaager@pidgin.im>
parents:
12136
diff
changeset
|
1176 | (event->type == GDK_2BUTTON_PRESS)) |
|
6a9dafcaaed1
[gaim-migrate @ 14437]
Richard Laager <rlaager@pidgin.im>
parents:
12136
diff
changeset
|
1177 | { |
|
21214
db28e29a4990
Reverted changes from ef7ac46f90a801547f7dfc4295927a956f90e869 to
Richard Laager <rlaager@pidgin.im>
parents:
21171
diff
changeset
|
1178 | pidgin_pounce_editor_show(NULL, NULL, pounce); |
|
12137
6a9dafcaaed1
[gaim-migrate @ 14437]
Richard Laager <rlaager@pidgin.im>
parents:
12136
diff
changeset
|
1179 | return TRUE; |
|
6a9dafcaaed1
[gaim-migrate @ 14437]
Richard Laager <rlaager@pidgin.im>
parents:
12136
diff
changeset
|
1180 | } |
|
6a9dafcaaed1
[gaim-migrate @ 14437]
Richard Laager <rlaager@pidgin.im>
parents:
12136
diff
changeset
|
1181 | |
|
6a9dafcaaed1
[gaim-migrate @ 14437]
Richard Laager <rlaager@pidgin.im>
parents:
12136
diff
changeset
|
1182 | return FALSE; |
|
6a9dafcaaed1
[gaim-migrate @ 14437]
Richard Laager <rlaager@pidgin.im>
parents:
12136
diff
changeset
|
1183 | } |
|
6a9dafcaaed1
[gaim-migrate @ 14437]
Richard Laager <rlaager@pidgin.im>
parents:
12136
diff
changeset
|
1184 | |
| 12136 | 1185 | static void |
|
12193
243b18a880ba
[gaim-migrate @ 14495]
Richard Laager <rlaager@pidgin.im>
parents:
12192
diff
changeset
|
1186 | pounces_manager_recurring_cb(GtkCellRendererToggle *renderer, gchar *path_str, |
| 12136 | 1187 | gpointer user_data) |
| 1188 | { | |
| 1189 | PouncesManager *dialog = user_data; | |
| 15884 | 1190 | PurplePounce *pounce; |
|
12193
243b18a880ba
[gaim-migrate @ 14495]
Richard Laager <rlaager@pidgin.im>
parents:
12192
diff
changeset
|
1191 | gboolean recurring; |
| 12136 | 1192 | GtkTreeModel *model = GTK_TREE_MODEL(dialog->model); |
| 1193 | GtkTreeIter iter; | |
| 1194 | ||
| 1195 | gtk_tree_model_get_iter_from_string(model, &iter, path_str); | |
| 1196 | gtk_tree_model_get(model, &iter, | |
| 1197 | POUNCES_MANAGER_COLUMN_POUNCE, &pounce, | |
|
12193
243b18a880ba
[gaim-migrate @ 14495]
Richard Laager <rlaager@pidgin.im>
parents:
12192
diff
changeset
|
1198 | POUNCES_MANAGER_COLUMN_RECURRING, &recurring, |
| 12136 | 1199 | -1); |
| 1200 | ||
| 15884 | 1201 | purple_pounce_set_save(pounce, !recurring); |
| 12136 | 1202 | |
| 1203 | update_pounces(); | |
| 5032 | 1204 | } |
| 1205 | ||
|
8259
7ed91862683d
[gaim-migrate @ 8982]
Christian Hammond <chipx86@chipx86.com>
parents:
8252
diff
changeset
|
1206 | static gboolean |
| 12136 | 1207 | search_func(GtkTreeModel *model, gint column, const gchar *key, GtkTreeIter *iter, gpointer search_data) |
|
5153
4865538db77a
[gaim-migrate @ 5517]
Christian Hammond <chipx86@chipx86.com>
parents:
5054
diff
changeset
|
1208 | { |
| 12136 | 1209 | gboolean result; |
| 1210 | char *haystack; | |
| 1211 | ||
| 1212 | gtk_tree_model_get(model, iter, column, &haystack, -1); | |
| 1213 | ||
| 15884 | 1214 | result = (purple_strcasestr(haystack, key) == NULL); |
| 12136 | 1215 | |
| 1216 | g_free(haystack); | |
| 1217 | ||
| 1218 | return result; | |
| 1219 | } | |
| 1220 | ||
| 1221 | static GtkWidget * | |
| 1222 | create_pounces_list(PouncesManager *dialog) | |
| 1223 | { | |
| 1224 | GtkWidget *treeview; | |
| 1225 | GtkTreeSelection *sel; | |
| 1226 | GtkTreeViewColumn *column; | |
| 1227 | GtkCellRenderer *renderer; | |
|
5153
4865538db77a
[gaim-migrate @ 5517]
Christian Hammond <chipx86@chipx86.com>
parents:
5054
diff
changeset
|
1228 | |
| 12136 | 1229 | /* Create the list model */ |
| 1230 | dialog->model = gtk_list_store_new(POUNCES_MANAGER_NUM_COLUMNS, | |
| 1231 | G_TYPE_POINTER, | |
| 1232 | GDK_TYPE_PIXBUF, | |
| 1233 | G_TYPE_STRING, | |
| 1234 | G_TYPE_STRING, | |
| 1235 | G_TYPE_BOOLEAN | |
| 1236 | ); | |
|
10250
9a0f00083ec1
[gaim-migrate @ 11390]
Mark Doliner <markdoliner@pidgin.im>
parents:
10246
diff
changeset
|
1237 | |
| 12136 | 1238 | /* Create the treeview */ |
| 1239 | treeview = gtk_tree_view_new_with_model(GTK_TREE_MODEL(dialog->model)); | |
|
22214
e8a9916cb99e
It turns out the tree-models need to be unref'ed.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22005
diff
changeset
|
1240 | g_object_unref(G_OBJECT(dialog->model)); |
| 12136 | 1241 | dialog->treeview = treeview; |
| 1242 | gtk_tree_view_set_rules_hint(GTK_TREE_VIEW(treeview), TRUE); | |
|
10250
9a0f00083ec1
[gaim-migrate @ 11390]
Mark Doliner <markdoliner@pidgin.im>
parents:
10246
diff
changeset
|
1243 | |
| 12136 | 1244 | sel = gtk_tree_view_get_selection(GTK_TREE_VIEW(treeview)); |
| 1245 | gtk_tree_selection_set_mode(sel, GTK_SELECTION_MULTIPLE); | |
| 1246 | g_signal_connect(G_OBJECT(sel), "changed", | |
| 1247 | G_CALLBACK(pounce_selected_cb), dialog); | |
| 1248 | ||
|
12137
6a9dafcaaed1
[gaim-migrate @ 14437]
Richard Laager <rlaager@pidgin.im>
parents:
12136
diff
changeset
|
1249 | /* Handle double-clicking */ |
|
6a9dafcaaed1
[gaim-migrate @ 14437]
Richard Laager <rlaager@pidgin.im>
parents:
12136
diff
changeset
|
1250 | g_signal_connect(G_OBJECT(treeview), "button_press_event", |
|
6a9dafcaaed1
[gaim-migrate @ 14437]
Richard Laager <rlaager@pidgin.im>
parents:
12136
diff
changeset
|
1251 | G_CALLBACK(pounce_double_click_cb), dialog); |
| 12136 | 1252 | gtk_widget_show(treeview); |
|
8259
7ed91862683d
[gaim-migrate @ 8982]
Christian Hammond <chipx86@chipx86.com>
parents:
8252
diff
changeset
|
1253 | |
| 12136 | 1254 | /* Pouncee Column */ |
| 1255 | column = gtk_tree_view_column_new(); | |
| 1256 | gtk_tree_view_column_set_title(column, _("Pounce Target")); | |
| 1257 | gtk_tree_view_column_set_resizable(column, TRUE); | |
| 1258 | gtk_tree_view_column_set_min_width(column, 200); | |
| 1259 | gtk_tree_view_column_set_sort_column_id(column, | |
| 1260 | POUNCES_MANAGER_COLUMN_TARGET); | |
| 1261 | gtk_tree_view_append_column(GTK_TREE_VIEW(treeview), column); | |
| 5161 | 1262 | |
| 12136 | 1263 | /* Icon */ |
| 1264 | renderer = gtk_cell_renderer_pixbuf_new(); | |
| 1265 | gtk_tree_view_column_pack_start(column, renderer, FALSE); | |
| 1266 | gtk_tree_view_column_add_attribute(column, renderer, "pixbuf", | |
| 1267 | POUNCES_MANAGER_COLUMN_ICON); | |
| 1268 | ||
| 1269 | /* Pouncee */ | |
| 1270 | renderer = gtk_cell_renderer_text_new(); | |
| 1271 | gtk_tree_view_column_pack_start(column, renderer, TRUE); | |
| 1272 | gtk_tree_view_column_add_attribute(column, renderer, "text", | |
| 1273 | POUNCES_MANAGER_COLUMN_TARGET); | |
| 1274 | ||
|
5153
4865538db77a
[gaim-migrate @ 5517]
Christian Hammond <chipx86@chipx86.com>
parents:
5054
diff
changeset
|
1275 | |
| 12136 | 1276 | /* Account Column */ |
| 1277 | column = gtk_tree_view_column_new(); | |
| 1278 | gtk_tree_view_column_set_title(column, _("Account")); | |
| 1279 | gtk_tree_view_column_set_resizable(column, TRUE); | |
| 1280 | gtk_tree_view_column_set_min_width(column, 200); | |
| 1281 | gtk_tree_view_column_set_sort_column_id(column, | |
| 1282 | POUNCES_MANAGER_COLUMN_ACCOUNT); | |
| 1283 | gtk_tree_view_append_column(GTK_TREE_VIEW(treeview), column); | |
| 1284 | renderer = gtk_cell_renderer_text_new(); | |
| 1285 | gtk_tree_view_column_pack_start(column, renderer, TRUE); | |
| 1286 | gtk_tree_view_column_add_attribute(column, renderer, "text", | |
| 1287 | POUNCES_MANAGER_COLUMN_ACCOUNT); | |
|
5153
4865538db77a
[gaim-migrate @ 5517]
Christian Hammond <chipx86@chipx86.com>
parents:
5054
diff
changeset
|
1288 | |
|
12193
243b18a880ba
[gaim-migrate @ 14495]
Richard Laager <rlaager@pidgin.im>
parents:
12192
diff
changeset
|
1289 | /* Recurring Column */ |
| 12136 | 1290 | renderer = gtk_cell_renderer_toggle_new(); |
|
12193
243b18a880ba
[gaim-migrate @ 14495]
Richard Laager <rlaager@pidgin.im>
parents:
12192
diff
changeset
|
1291 | column = gtk_tree_view_column_new_with_attributes(_("Recurring"), renderer, |
|
243b18a880ba
[gaim-migrate @ 14495]
Richard Laager <rlaager@pidgin.im>
parents:
12192
diff
changeset
|
1292 | "active", POUNCES_MANAGER_COLUMN_RECURRING, NULL); |
| 12136 | 1293 | gtk_tree_view_column_set_sort_column_id(column, |
|
12193
243b18a880ba
[gaim-migrate @ 14495]
Richard Laager <rlaager@pidgin.im>
parents:
12192
diff
changeset
|
1294 | POUNCES_MANAGER_COLUMN_RECURRING); |
| 12136 | 1295 | gtk_tree_view_append_column(GTK_TREE_VIEW(treeview), column); |
| 1296 | g_signal_connect(G_OBJECT(renderer), "toggled", | |
|
12193
243b18a880ba
[gaim-migrate @ 14495]
Richard Laager <rlaager@pidgin.im>
parents:
12192
diff
changeset
|
1297 | G_CALLBACK(pounces_manager_recurring_cb), dialog); |
|
5153
4865538db77a
[gaim-migrate @ 5517]
Christian Hammond <chipx86@chipx86.com>
parents:
5054
diff
changeset
|
1298 | |
| 12136 | 1299 | /* Enable CTRL+F searching */ |
| 1300 | gtk_tree_view_set_search_column(GTK_TREE_VIEW(treeview), POUNCES_MANAGER_COLUMN_TARGET); | |
| 1301 | gtk_tree_view_set_search_equal_func(GTK_TREE_VIEW(treeview), search_func, NULL, NULL); | |
|
8259
7ed91862683d
[gaim-migrate @ 8982]
Christian Hammond <chipx86@chipx86.com>
parents:
8252
diff
changeset
|
1302 | |
| 12136 | 1303 | /* Sort the pouncee column by default */ |
| 1304 | gtk_tree_sortable_set_sort_column_id(GTK_TREE_SORTABLE(dialog->model), | |
| 1305 | POUNCES_MANAGER_COLUMN_TARGET, | |
| 1306 | GTK_SORT_ASCENDING); | |
| 1307 | ||
| 1308 | /* Populate list */ | |
| 1309 | populate_pounces_list(dialog); | |
| 1310 | ||
|
31321
1fef3832cfa2
Add pidgin_make_scrollable and use it. Cleans up a bunch of duplicate code. Net code loss of 180 lines. Fixes #13073.
Gabriel Schulhof <nix@go-nix.ca>
parents:
30706
diff
changeset
|
1311 | return pidgin_make_scrollable(treeview, GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC, GTK_SHADOW_IN, -1, -1); |
|
5153
4865538db77a
[gaim-migrate @ 5517]
Christian Hammond <chipx86@chipx86.com>
parents:
5054
diff
changeset
|
1312 | } |
|
4865538db77a
[gaim-migrate @ 5517]
Christian Hammond <chipx86@chipx86.com>
parents:
5054
diff
changeset
|
1313 | |
| 5032 | 1314 | void |
|
21182
23cc39e90bf7
Only the request API changes
Gabriel Schulhof <nix@go-nix.ca>
parents:
21162
diff
changeset
|
1315 | pidgin_pounces_manager_show(void) |
| 5032 | 1316 | { |
| 12136 | 1317 | PouncesManager *dialog; |
| 1318 | GtkWidget *button; | |
| 1319 | GtkWidget *list; | |
| 1320 | GtkWidget *vbox; | |
| 1321 | GtkWidget *win; | |
| 1322 | int width, height; | |
| 5032 | 1323 | |
| 12136 | 1324 | if (pounces_manager != NULL) { |
| 1325 | gtk_window_present(GTK_WINDOW(pounces_manager->window)); | |
| 1326 | return; | |
| 5032 | 1327 | } |
| 8252 | 1328 | |
| 12136 | 1329 | pounces_manager = dialog = g_new0(PouncesManager, 1); |
| 1330 | ||
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
1331 | width = purple_prefs_get_int(PIDGIN_PREFS_ROOT "/pounces/dialog/width"); |
|
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
1332 | height = purple_prefs_get_int(PIDGIN_PREFS_ROOT "/pounces/dialog/height"); |
| 12136 | 1333 | |
|
22000
5e7708f58d3d
Patch from fmoo. This makes a lot of the windows closeable with Escape. There
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21630
diff
changeset
|
1334 | dialog->window = win = pidgin_create_dialog(_("Buddy Pounces"), PIDGIN_HIG_BORDER, "pounces", TRUE); |
| 12136 | 1335 | gtk_window_set_default_size(GTK_WINDOW(win), width, height); |
| 1336 | ||
| 1337 | g_signal_connect(G_OBJECT(win), "delete_event", | |
| 1338 | G_CALLBACK(pounces_manager_destroy_cb), dialog); | |
| 1339 | g_signal_connect(G_OBJECT(win), "configure_event", | |
| 1340 | G_CALLBACK(pounces_manager_configure_cb), dialog); | |
| 1341 | ||
| 1342 | /* Setup the vbox */ | |
|
22000
5e7708f58d3d
Patch from fmoo. This makes a lot of the windows closeable with Escape. There
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21630
diff
changeset
|
1343 | vbox = pidgin_dialog_get_vbox_with_properties(GTK_DIALOG(win), FALSE, PIDGIN_HIG_BORDER); |
| 5032 | 1344 | |
| 12136 | 1345 | /* List of saved buddy pounces */ |
| 1346 | list = create_pounces_list(dialog); | |
| 1347 | gtk_box_pack_start(GTK_BOX(vbox), list, TRUE, TRUE, 0); | |
| 1348 | ||
|
22005
0183020ba2cc
Add a utility function pidgin_dialog_add_button to add buttons to a dialog
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22000
diff
changeset
|
1349 | /* Add button */ |
|
24594
b2da1decae23
Add an ellipsis to the "Add" and "Modify" buttons in the accounts, pounces, and
Alex Willmer <alex@moreati.org.uk>
parents:
23260
diff
changeset
|
1350 | button = pidgin_dialog_add_button(GTK_DIALOG(win), PIDGIN_STOCK_ADD, G_CALLBACK(pounces_manager_add_cb), dialog); |
|
22005
0183020ba2cc
Add a utility function pidgin_dialog_add_button to add buttons to a dialog
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22000
diff
changeset
|
1351 | gtk_widget_set_sensitive(button, (purple_accounts_get_all() != NULL)); |
| 5032 | 1352 | |
| 15884 | 1353 | purple_signal_connect(purple_connections_get_handle(), "signed-on", |
| 1354 | pounces_manager, PURPLE_CALLBACK(pounces_manager_connection_cb), button); | |
| 1355 | purple_signal_connect(purple_connections_get_handle(), "signed-off", | |
| 1356 | pounces_manager, PURPLE_CALLBACK(pounces_manager_connection_cb), button); | |
| 5032 | 1357 | |
| 12136 | 1358 | /* Modify button */ |
|
22005
0183020ba2cc
Add a utility function pidgin_dialog_add_button to add buttons to a dialog
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22000
diff
changeset
|
1359 | button = pidgin_dialog_add_button(GTK_DIALOG(win), PIDGIN_STOCK_MODIFY, G_CALLBACK(pounces_manager_modify_cb), dialog); |
| 12136 | 1360 | gtk_widget_set_sensitive(button, FALSE); |
|
22005
0183020ba2cc
Add a utility function pidgin_dialog_add_button to add buttons to a dialog
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22000
diff
changeset
|
1361 | dialog->modify_button = button; |
|
8259
7ed91862683d
[gaim-migrate @ 8982]
Christian Hammond <chipx86@chipx86.com>
parents:
8252
diff
changeset
|
1362 | |
| 12136 | 1363 | /* Delete button */ |
|
22005
0183020ba2cc
Add a utility function pidgin_dialog_add_button to add buttons to a dialog
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22000
diff
changeset
|
1364 | button = pidgin_dialog_add_button(GTK_DIALOG(win), GTK_STOCK_DELETE, G_CALLBACK(pounces_manager_delete_cb), dialog); |
| 12136 | 1365 | gtk_widget_set_sensitive(button, FALSE); |
|
22005
0183020ba2cc
Add a utility function pidgin_dialog_add_button to add buttons to a dialog
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22000
diff
changeset
|
1366 | dialog->delete_button = button; |
| 5032 | 1367 | |
| 12136 | 1368 | /* Close button */ |
|
22005
0183020ba2cc
Add a utility function pidgin_dialog_add_button to add buttons to a dialog
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22000
diff
changeset
|
1369 | pidgin_dialog_add_button(GTK_DIALOG(win), GTK_STOCK_CLOSE, G_CALLBACK(pounces_manager_close_cb), dialog); |
| 12136 | 1370 | |
| 1371 | gtk_widget_show(win); | |
| 1372 | } | |
| 1373 | ||
| 1374 | void | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15496
diff
changeset
|
1375 | pidgin_pounces_manager_hide(void) |
| 12136 | 1376 | { |
| 1377 | if (pounces_manager == NULL) | |
| 1378 | return; | |
| 1379 | ||
| 1380 | if (pounces_manager->window != NULL) | |
| 1381 | gtk_widget_destroy(pounces_manager->window); | |
| 1382 | ||
| 15884 | 1383 | purple_signals_disconnect_by_handle(pounces_manager); |
| 12136 | 1384 | |
| 1385 | g_free(pounces_manager); | |
| 1386 | pounces_manager = NULL; | |
| 5032 | 1387 | } |
| 1388 | ||
|
5875
493a921c0378
[gaim-migrate @ 6307]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
1389 | static void |
| 15884 | 1390 | pounce_cb(PurplePounce *pounce, PurplePounceEvent events, void *data) |
|
5875
493a921c0378
[gaim-migrate @ 6307]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
1391 | { |
| 15884 | 1392 | PurpleConversation *conv; |
| 1393 | PurpleAccount *account; | |
| 1394 | PurpleBuddy *buddy; | |
|
5875
493a921c0378
[gaim-migrate @ 6307]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
1395 | const char *pouncee; |
|
7994
13b0203d6d52
[gaim-migrate @ 8671]
Christian Hammond <chipx86@chipx86.com>
parents:
7276
diff
changeset
|
1396 | const char *alias; |
|
9205
8c4dbbe6386f
[gaim-migrate @ 10000]
Christian Hammond <chipx86@chipx86.com>
parents:
9191
diff
changeset
|
1397 | |
| 15884 | 1398 | pouncee = purple_pounce_get_pouncee(pounce); |
| 1399 | account = purple_pounce_get_pouncer(pounce); | |
|
5875
493a921c0378
[gaim-migrate @ 6307]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
1400 | |
| 15884 | 1401 | buddy = purple_find_buddy(account, pouncee); |
| 12934 | 1402 | if (buddy != NULL) |
| 1403 | { | |
| 15884 | 1404 | alias = purple_buddy_get_alias(buddy); |
| 12934 | 1405 | if (alias == NULL) |
| 1406 | alias = pouncee; | |
| 1407 | } | |
| 1408 | else | |
| 1409 | alias = pouncee; | |
|
7994
13b0203d6d52
[gaim-migrate @ 8671]
Christian Hammond <chipx86@chipx86.com>
parents:
7276
diff
changeset
|
1410 | |
| 15884 | 1411 | if (purple_pounce_action_is_enabled(pounce, "open-window")) |
|
9205
8c4dbbe6386f
[gaim-migrate @ 10000]
Christian Hammond <chipx86@chipx86.com>
parents:
9191
diff
changeset
|
1412 | { |
|
33794
716cbef8d1c6
Fix a number of additional trivial issues - unused variables, etc.
Daniel Atallah <datallah@pidgin.im>
parents:
33782
diff
changeset
|
1413 | if (!purple_find_conversation_with_account(PURPLE_CONV_TYPE_IM, pouncee, account)) |
|
716cbef8d1c6
Fix a number of additional trivial issues - unused variables, etc.
Daniel Atallah <datallah@pidgin.im>
parents:
33782
diff
changeset
|
1414 | purple_conversation_new(PURPLE_CONV_TYPE_IM, account, pouncee); |
|
5875
493a921c0378
[gaim-migrate @ 6307]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
1415 | } |
|
493a921c0378
[gaim-migrate @ 6307]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
1416 | |
| 15884 | 1417 | if (purple_pounce_action_is_enabled(pounce, "popup-notify")) |
|
9205
8c4dbbe6386f
[gaim-migrate @ 10000]
Christian Hammond <chipx86@chipx86.com>
parents:
9191
diff
changeset
|
1418 | { |
| 12934 | 1419 | char *tmp; |
| 1420 | const char *reason; | |
| 15884 | 1421 | reason = purple_pounce_action_get_attribute(pounce, "popup-notify", |
| 12934 | 1422 | "reason"); |
|
5875
493a921c0378
[gaim-migrate @ 6307]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
1423 | |
|
9205
8c4dbbe6386f
[gaim-migrate @ 10000]
Christian Hammond <chipx86@chipx86.com>
parents:
9191
diff
changeset
|
1424 | /* |
|
8c4dbbe6386f
[gaim-migrate @ 10000]
Christian Hammond <chipx86@chipx86.com>
parents:
9191
diff
changeset
|
1425 | * Here we place the protocol name in the pounce dialog to lessen |
|
8c4dbbe6386f
[gaim-migrate @ 10000]
Christian Hammond <chipx86@chipx86.com>
parents:
9191
diff
changeset
|
1426 | * confusion about what protocol a pounce is for. |
|
8c4dbbe6386f
[gaim-migrate @ 10000]
Christian Hammond <chipx86@chipx86.com>
parents:
9191
diff
changeset
|
1427 | */ |
|
28717
7cd8b1322913
A simple g_strdup is fine here.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
26467
diff
changeset
|
1428 | tmp = g_strdup( |
| 15884 | 1429 | (events & PURPLE_POUNCE_TYPING) ? |
|
26467
ca1524dbcbf0
A patch from Jorge VillaseƱor which makes all pounces share a single window.
Kevin Stange <kstange@pidgin.im>
parents:
25909
diff
changeset
|
1430 | _("Started typing") : |
| 15884 | 1431 | (events & PURPLE_POUNCE_TYPED) ? |
|
26467
ca1524dbcbf0
A patch from Jorge VillaseƱor which makes all pounces share a single window.
Kevin Stange <kstange@pidgin.im>
parents:
25909
diff
changeset
|
1432 | _("Paused while typing") : |
| 15884 | 1433 | (events & PURPLE_POUNCE_SIGNON) ? |
|
26467
ca1524dbcbf0
A patch from Jorge VillaseƱor which makes all pounces share a single window.
Kevin Stange <kstange@pidgin.im>
parents:
25909
diff
changeset
|
1434 | _("Signed on") : |
| 15884 | 1435 | (events & PURPLE_POUNCE_IDLE_RETURN) ? |
|
26467
ca1524dbcbf0
A patch from Jorge VillaseƱor which makes all pounces share a single window.
Kevin Stange <kstange@pidgin.im>
parents:
25909
diff
changeset
|
1436 | _("Returned from being idle") : |
| 15884 | 1437 | (events & PURPLE_POUNCE_AWAY_RETURN) ? |
|
26467
ca1524dbcbf0
A patch from Jorge VillaseƱor which makes all pounces share a single window.
Kevin Stange <kstange@pidgin.im>
parents:
25909
diff
changeset
|
1438 | _("Returned from being away") : |
| 15884 | 1439 | (events & PURPLE_POUNCE_TYPING_STOPPED) ? |
|
26467
ca1524dbcbf0
A patch from Jorge VillaseƱor which makes all pounces share a single window.
Kevin Stange <kstange@pidgin.im>
parents:
25909
diff
changeset
|
1440 | _("Stopped typing") : |
| 15884 | 1441 | (events & PURPLE_POUNCE_SIGNOFF) ? |
|
26467
ca1524dbcbf0
A patch from Jorge VillaseƱor which makes all pounces share a single window.
Kevin Stange <kstange@pidgin.im>
parents:
25909
diff
changeset
|
1442 | _("Signed off") : |
| 15884 | 1443 | (events & PURPLE_POUNCE_IDLE) ? |
|
26467
ca1524dbcbf0
A patch from Jorge VillaseƱor which makes all pounces share a single window.
Kevin Stange <kstange@pidgin.im>
parents:
25909
diff
changeset
|
1444 | _("Became idle") : |
| 15884 | 1445 | (events & PURPLE_POUNCE_AWAY) ? |
|
26467
ca1524dbcbf0
A patch from Jorge VillaseƱor which makes all pounces share a single window.
Kevin Stange <kstange@pidgin.im>
parents:
25909
diff
changeset
|
1446 | _("Went away") : |
| 15884 | 1447 | (events & PURPLE_POUNCE_MESSAGE_RECEIVED) ? |
|
26467
ca1524dbcbf0
A patch from Jorge VillaseƱor which makes all pounces share a single window.
Kevin Stange <kstange@pidgin.im>
parents:
25909
diff
changeset
|
1448 | _("Sent a message") : |
|
ca1524dbcbf0
A patch from Jorge VillaseƱor which makes all pounces share a single window.
Kevin Stange <kstange@pidgin.im>
parents:
25909
diff
changeset
|
1449 | _("Unknown.... Please report this!") |
|
ca1524dbcbf0
A patch from Jorge VillaseƱor which makes all pounces share a single window.
Kevin Stange <kstange@pidgin.im>
parents:
25909
diff
changeset
|
1450 | ); |
|
5875
493a921c0378
[gaim-migrate @ 6307]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
1451 | |
|
26467
ca1524dbcbf0
A patch from Jorge VillaseƱor which makes all pounces share a single window.
Kevin Stange <kstange@pidgin.im>
parents:
25909
diff
changeset
|
1452 | pidgin_notify_pounce_add(account, pounce, alias, tmp, reason, |
|
ca1524dbcbf0
A patch from Jorge VillaseƱor which makes all pounces share a single window.
Kevin Stange <kstange@pidgin.im>
parents:
25909
diff
changeset
|
1453 | purple_date_format_full(NULL)); |
|
ca1524dbcbf0
A patch from Jorge VillaseƱor which makes all pounces share a single window.
Kevin Stange <kstange@pidgin.im>
parents:
25909
diff
changeset
|
1454 | |
| 12934 | 1455 | g_free(tmp); |
|
5875
493a921c0378
[gaim-migrate @ 6307]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
1456 | } |
|
493a921c0378
[gaim-migrate @ 6307]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
1457 | |
| 15884 | 1458 | if (purple_pounce_action_is_enabled(pounce, "send-message")) |
|
9205
8c4dbbe6386f
[gaim-migrate @ 10000]
Christian Hammond <chipx86@chipx86.com>
parents:
9191
diff
changeset
|
1459 | { |
|
5875
493a921c0378
[gaim-migrate @ 6307]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
1460 | const char *message; |
|
493a921c0378
[gaim-migrate @ 6307]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
1461 | |
| 15884 | 1462 | message = purple_pounce_action_get_attribute(pounce, "send-message", |
|
5875
493a921c0378
[gaim-migrate @ 6307]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
1463 | "message"); |
|
493a921c0378
[gaim-migrate @ 6307]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
1464 | |
|
9205
8c4dbbe6386f
[gaim-migrate @ 10000]
Christian Hammond <chipx86@chipx86.com>
parents:
9191
diff
changeset
|
1465 | if (message != NULL) |
|
8c4dbbe6386f
[gaim-migrate @ 10000]
Christian Hammond <chipx86@chipx86.com>
parents:
9191
diff
changeset
|
1466 | { |
| 15884 | 1467 | conv = purple_find_conversation_with_account(PURPLE_CONV_TYPE_IM, pouncee, account); |
|
5875
493a921c0378
[gaim-migrate @ 6307]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
1468 | |
|
493a921c0378
[gaim-migrate @ 6307]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
1469 | if (conv == NULL) |
| 15884 | 1470 | conv = purple_conversation_new(PURPLE_CONV_TYPE_IM, account, pouncee); |
|
5875
493a921c0378
[gaim-migrate @ 6307]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
1471 | |
| 15884 | 1472 | purple_conversation_write(conv, NULL, message, |
| 1473 | PURPLE_MESSAGE_SEND, time(NULL)); | |
|
5875
493a921c0378
[gaim-migrate @ 6307]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
1474 | |
|
6982
12f08de92674
[gaim-migrate @ 7538]
Mark Doliner <markdoliner@pidgin.im>
parents:
6695
diff
changeset
|
1475 | serv_send_im(account->gc, (char *)pouncee, (char *)message, 0); |
|
5875
493a921c0378
[gaim-migrate @ 6307]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
1476 | } |
|
493a921c0378
[gaim-migrate @ 6307]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
1477 | } |
|
493a921c0378
[gaim-migrate @ 6307]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
1478 | |
| 15884 | 1479 | if (purple_pounce_action_is_enabled(pounce, "execute-command")) |
|
9205
8c4dbbe6386f
[gaim-migrate @ 10000]
Christian Hammond <chipx86@chipx86.com>
parents:
9191
diff
changeset
|
1480 | { |
|
5875
493a921c0378
[gaim-migrate @ 6307]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
1481 | const char *command; |
|
493a921c0378
[gaim-migrate @ 6307]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
1482 | |
| 15884 | 1483 | command = purple_pounce_action_get_attribute(pounce, |
|
10921
44adf364b1e7
[gaim-migrate @ 12688]
Daniel Atallah <datallah@pidgin.im>
parents:
10913
diff
changeset
|
1484 | "execute-command", "command"); |
|
5875
493a921c0378
[gaim-migrate @ 6307]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
1485 | |
|
10921
44adf364b1e7
[gaim-migrate @ 12688]
Daniel Atallah <datallah@pidgin.im>
parents:
10913
diff
changeset
|
1486 | if (command != NULL) |
|
9205
8c4dbbe6386f
[gaim-migrate @ 10000]
Christian Hammond <chipx86@chipx86.com>
parents:
9191
diff
changeset
|
1487 | { |
| 6660 | 1488 | #ifndef _WIN32 |
|
10921
44adf364b1e7
[gaim-migrate @ 12688]
Daniel Atallah <datallah@pidgin.im>
parents:
10913
diff
changeset
|
1489 | char *localecmd = g_locale_from_utf8(command, -1, NULL, |
|
44adf364b1e7
[gaim-migrate @ 12688]
Daniel Atallah <datallah@pidgin.im>
parents:
10913
diff
changeset
|
1490 | NULL, NULL); |
|
5875
493a921c0378
[gaim-migrate @ 6307]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
1491 | |
|
10921
44adf364b1e7
[gaim-migrate @ 12688]
Daniel Atallah <datallah@pidgin.im>
parents:
10913
diff
changeset
|
1492 | if (localecmd != NULL) |
|
44adf364b1e7
[gaim-migrate @ 12688]
Daniel Atallah <datallah@pidgin.im>
parents:
10913
diff
changeset
|
1493 | { |
|
44adf364b1e7
[gaim-migrate @ 12688]
Daniel Atallah <datallah@pidgin.im>
parents:
10913
diff
changeset
|
1494 | int pid = fork(); |
|
44adf364b1e7
[gaim-migrate @ 12688]
Daniel Atallah <datallah@pidgin.im>
parents:
10913
diff
changeset
|
1495 | |
|
44adf364b1e7
[gaim-migrate @ 12688]
Daniel Atallah <datallah@pidgin.im>
parents:
10913
diff
changeset
|
1496 | if (pid == 0) { |
|
44adf364b1e7
[gaim-migrate @ 12688]
Daniel Atallah <datallah@pidgin.im>
parents:
10913
diff
changeset
|
1497 | char *args[4]; |
|
5875
493a921c0378
[gaim-migrate @ 6307]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
1498 | |
|
10921
44adf364b1e7
[gaim-migrate @ 12688]
Daniel Atallah <datallah@pidgin.im>
parents:
10913
diff
changeset
|
1499 | args[0] = "sh"; |
|
44adf364b1e7
[gaim-migrate @ 12688]
Daniel Atallah <datallah@pidgin.im>
parents:
10913
diff
changeset
|
1500 | args[1] = "-c"; |
|
44adf364b1e7
[gaim-migrate @ 12688]
Daniel Atallah <datallah@pidgin.im>
parents:
10913
diff
changeset
|
1501 | args[2] = (char *)localecmd; |
|
44adf364b1e7
[gaim-migrate @ 12688]
Daniel Atallah <datallah@pidgin.im>
parents:
10913
diff
changeset
|
1502 | args[3] = NULL; |
|
5875
493a921c0378
[gaim-migrate @ 6307]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
1503 | |
|
10921
44adf364b1e7
[gaim-migrate @ 12688]
Daniel Atallah <datallah@pidgin.im>
parents:
10913
diff
changeset
|
1504 | execvp(args[0], args); |
|
5875
493a921c0378
[gaim-migrate @ 6307]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
1505 | |
|
10921
44adf364b1e7
[gaim-migrate @ 12688]
Daniel Atallah <datallah@pidgin.im>
parents:
10913
diff
changeset
|
1506 | _exit(0); |
|
44adf364b1e7
[gaim-migrate @ 12688]
Daniel Atallah <datallah@pidgin.im>
parents:
10913
diff
changeset
|
1507 | } |
|
44adf364b1e7
[gaim-migrate @ 12688]
Daniel Atallah <datallah@pidgin.im>
parents:
10913
diff
changeset
|
1508 | g_free(localecmd); |
|
5875
493a921c0378
[gaim-migrate @ 6307]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
1509 | } |
|
9205
8c4dbbe6386f
[gaim-migrate @ 10000]
Christian Hammond <chipx86@chipx86.com>
parents:
9191
diff
changeset
|
1510 | #else /* !_WIN32 */ |
|
29362
f5768aad49af
Make the "Execute a command" buddy pounce action use ShellExecute() on Windows so that it can open files of all types (e.g. MP3s) with their default associated application. Fixes #11333.
Daniel Atallah <datallah@pidgin.im>
parents:
28717
diff
changeset
|
1511 | winpidgin_shell_execute(command, "open", NULL); |
|
9205
8c4dbbe6386f
[gaim-migrate @ 10000]
Christian Hammond <chipx86@chipx86.com>
parents:
9191
diff
changeset
|
1512 | #endif /* !_WIN32 */ |
|
5875
493a921c0378
[gaim-migrate @ 6307]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
1513 | } |
|
493a921c0378
[gaim-migrate @ 6307]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
1514 | } |
|
493a921c0378
[gaim-migrate @ 6307]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
1515 | |
| 15884 | 1516 | if (purple_pounce_action_is_enabled(pounce, "play-sound")) |
|
9205
8c4dbbe6386f
[gaim-migrate @ 10000]
Christian Hammond <chipx86@chipx86.com>
parents:
9191
diff
changeset
|
1517 | { |
|
5875
493a921c0378
[gaim-migrate @ 6307]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
1518 | const char *sound; |
|
493a921c0378
[gaim-migrate @ 6307]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
1519 | |
| 15884 | 1520 | sound = purple_pounce_action_get_attribute(pounce, |
|
9205
8c4dbbe6386f
[gaim-migrate @ 10000]
Christian Hammond <chipx86@chipx86.com>
parents:
9191
diff
changeset
|
1521 | "play-sound", "filename"); |
|
5875
493a921c0378
[gaim-migrate @ 6307]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
1522 | |
|
493a921c0378
[gaim-migrate @ 6307]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
1523 | if (sound != NULL) |
| 15884 | 1524 | purple_sound_play_file(sound, account); |
|
5875
493a921c0378
[gaim-migrate @ 6307]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
1525 | else |
| 15884 | 1526 | purple_sound_play_event(PURPLE_SOUND_POUNCE_DEFAULT, account); |
|
5875
493a921c0378
[gaim-migrate @ 6307]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
1527 | } |
|
493a921c0378
[gaim-migrate @ 6307]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
1528 | } |
|
493a921c0378
[gaim-migrate @ 6307]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
1529 | |
|
493a921c0378
[gaim-migrate @ 6307]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
1530 | static void |
| 15884 | 1531 | free_pounce(PurplePounce *pounce) |
|
5875
493a921c0378
[gaim-migrate @ 6307]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
1532 | { |
| 12136 | 1533 | update_pounces(); |
|
5875
493a921c0378
[gaim-migrate @ 6307]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
1534 | } |
|
493a921c0378
[gaim-migrate @ 6307]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
1535 | |
|
493a921c0378
[gaim-migrate @ 6307]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
1536 | static void |
| 15884 | 1537 | new_pounce(PurplePounce *pounce) |
|
5875
493a921c0378
[gaim-migrate @ 6307]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
1538 | { |
| 15884 | 1539 | purple_pounce_action_register(pounce, "open-window"); |
| 1540 | purple_pounce_action_register(pounce, "popup-notify"); | |
| 1541 | purple_pounce_action_register(pounce, "send-message"); | |
| 1542 | purple_pounce_action_register(pounce, "execute-command"); | |
| 1543 | purple_pounce_action_register(pounce, "play-sound"); | |
| 12136 | 1544 | |
| 1545 | update_pounces(); | |
| 1546 | } | |
| 1547 | ||
| 1548 | void * | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15496
diff
changeset
|
1549 | pidgin_pounces_get_handle() { |
| 12136 | 1550 | static int handle; |
| 1551 | ||
| 1552 | return &handle; | |
|
5875
493a921c0378
[gaim-migrate @ 6307]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
1553 | } |
|
493a921c0378
[gaim-migrate @ 6307]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
1554 | |
|
493a921c0378
[gaim-migrate @ 6307]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
1555 | void |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15496
diff
changeset
|
1556 | pidgin_pounces_init(void) |
|
5875
493a921c0378
[gaim-migrate @ 6307]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
1557 | { |
| 15884 | 1558 | purple_pounces_register_handler(PIDGIN_UI, pounce_cb, new_pounce, |
|
5875
493a921c0378
[gaim-migrate @ 6307]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
1559 | free_pounce); |
|
9206
57a4db675f8d
[gaim-migrate @ 10001]
Christian Hammond <chipx86@chipx86.com>
parents:
9205
diff
changeset
|
1560 | |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
1561 | purple_prefs_add_none(PIDGIN_PREFS_ROOT "/pounces"); |
|
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
1562 | purple_prefs_add_none(PIDGIN_PREFS_ROOT "/pounces/default_actions"); |
|
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
1563 | purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/pounces/default_actions/open-window", |
|
9206
57a4db675f8d
[gaim-migrate @ 10001]
Christian Hammond <chipx86@chipx86.com>
parents:
9205
diff
changeset
|
1564 | FALSE); |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
1565 | purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/pounces/default_actions/popup-notify", |
|
12141
9cd436b9b7f6
[gaim-migrate @ 14442]
Richard Laager <rlaager@pidgin.im>
parents:
12137
diff
changeset
|
1566 | TRUE); |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
1567 | purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/pounces/default_actions/send-message", |
|
12141
9cd436b9b7f6
[gaim-migrate @ 14442]
Richard Laager <rlaager@pidgin.im>
parents:
12137
diff
changeset
|
1568 | FALSE); |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
1569 | purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/pounces/default_actions/execute-command", |
|
9206
57a4db675f8d
[gaim-migrate @ 10001]
Christian Hammond <chipx86@chipx86.com>
parents:
9205
diff
changeset
|
1570 | FALSE); |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
1571 | purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/pounces/default_actions/play-sound", |
|
9206
57a4db675f8d
[gaim-migrate @ 10001]
Christian Hammond <chipx86@chipx86.com>
parents:
9205
diff
changeset
|
1572 | FALSE); |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
1573 | purple_prefs_add_none(PIDGIN_PREFS_ROOT "/pounces/dialog"); |
|
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
1574 | purple_prefs_add_int(PIDGIN_PREFS_ROOT "/pounces/dialog/width", 520); |
|
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
1575 | purple_prefs_add_int(PIDGIN_PREFS_ROOT "/pounces/dialog/height", 321); |
| 12136 | 1576 | |
| 15884 | 1577 | purple_signal_connect(purple_connections_get_handle(), "signed-on", |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15496
diff
changeset
|
1578 | pidgin_pounces_get_handle(), |
| 15884 | 1579 | PURPLE_CALLBACK(signed_on_off_cb), NULL); |
| 1580 | purple_signal_connect(purple_connections_get_handle(), "signed-off", | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15496
diff
changeset
|
1581 | pidgin_pounces_get_handle(), |
| 15884 | 1582 | PURPLE_CALLBACK(signed_on_off_cb), NULL); |
|
5875
493a921c0378
[gaim-migrate @ 6307]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
1583 | } |