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