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