Mon, 23 Nov 2020 01:41:50 -0600
Delete a bunch of unused zephyr stuff
* Remove unused `ZSetFD`.
* Remove `__HM_set` which is never read.
* Remove `__Zephyr_open` global, which is redundant with `__Zephyr_fd != -1`.
* Remove `ZSetSrv.c`, as `ZSetServerState` is never called.
Consequently, remove `__Zephyr_server` global and all things that check it as it will never be TRUE.
* Remove zephyr internal debug code, as `ZSetDebug` is never called.
Also, make a couple debug messages go to libpurple.
* Remove unused `ZNewLocateUser` compatibility macro.
Testing Done:
Compile only.
Reviewed at https://reviews.imfreedom.org/r/249/
|
20147
66f05a854eee
applied changes from 8a731bbd0197fbcc91a705c2d8f528154216defa
Richard Laager <rlaager@pidgin.im>
parents:
19859
diff
changeset
|
1 | /* pidgin |
| 5032 | 2 | * |
|
15931
716b5fac1895
Re-sed the copyright notices so they don't all talk about Purple.
Richard Laager <rlaager@pidgin.im>
parents:
15884
diff
changeset
|
3 | * Pidgin is the legal property of its developers, whose names are too numerous |
| 8046 | 4 | * to list here. Please refer to the COPYRIGHT file distributed with this |
| 5 | * source distribution. | |
|
7035
76bca80cd91d
[gaim-migrate @ 7598]
Christian Hammond <chipx86@chipx86.com>
parents:
6982
diff
changeset
|
6 | * |
| 5032 | 7 | * This program is free software; you can redistribute it and/or modify |
| 8 | * it under the terms of the GNU General Public License as published by | |
| 9 | * the Free Software Foundation; either version 2 of the License, or | |
| 10 | * (at your option) any later version. | |
| 11 | * | |
| 12 | * This program is distributed in the hope that it will be useful, | |
| 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 15 | * GNU General Public License for more details. | |
| 16 | * | |
| 17 | * You should have received a copy of the GNU General Public License | |
| 18 | * 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
|
19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA |
| 5032 | 20 | * |
| 21 | */ | |
|
40439
e9838d634d5e
Make sure that internal.h can only be included by libpurple and split out some pieces to purpleprivate.h
Gary Kramlich <grim@reaperworld.com>
parents:
40360
diff
changeset
|
22 | |
|
e9838d634d5e
Make sure that internal.h can only be included by libpurple and split out some pieces to purpleprivate.h
Gary Kramlich <grim@reaperworld.com>
parents:
40360
diff
changeset
|
23 | #include <glib/gi18n-lib.h> |
|
e9838d634d5e
Make sure that internal.h can only be included by libpurple and split out some pieces to purpleprivate.h
Gary Kramlich <grim@reaperworld.com>
parents:
40360
diff
changeset
|
24 | |
|
39223
7016ec26cd75
Move GtkPounce to Talkatu
Gary Kramlich <grim@reaperworld.com>
parents:
39176
diff
changeset
|
25 | #include <talkatu.h> |
|
7016ec26cd75
Move GtkPounce to Talkatu
Gary Kramlich <grim@reaperworld.com>
parents:
39176
diff
changeset
|
26 | |
|
40360
e21f3bbcc2a5
Update all of the pidgin code to include purple.h
Gary Kramlich <grim@reaperworld.com>
parents:
40197
diff
changeset
|
27 | #include <purple.h> |
|
5872
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5866
diff
changeset
|
28 | |
|
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5866
diff
changeset
|
29 | #include "gtkblist.h" |
|
9709
2e73f176cc80
[gaim-migrate @ 10570]
Mark Doliner <markdoliner@pidgin.im>
parents:
9699
diff
changeset
|
30 | #include "gtkdialogs.h" |
| 5032 | 31 | #include "gtkpounce.h" |
|
26467
ca1524dbcbf0
A patch from Jorge VillaseƱor which makes all pounces share a single window.
Kevin Stange <kstange@pidgin.im>
parents:
25909
diff
changeset
|
32 | #include "gtknotify.h" |
|
15883
969b74a3e27a
According to etags, pidgin/ should be completely clean of references to 'gaim' as a client
Sean Egan <seanegan@pidgin.im>
parents:
15882
diff
changeset
|
33 | #include "pidginstock.h" |
|
5872
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5866
diff
changeset
|
34 | #include "gtkutils.h" |
|
39785
aa7e3b71802d
Split pidgin_account_option_menu into its own files.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39223
diff
changeset
|
35 | #include "pidginaccountchooser.h" |
|
40534
8dad2981fb86
Separate the AccountChooser from its model and move options to filters
Gary Kramlich <grim@reaperworld.com>
parents:
40533
diff
changeset
|
36 | #include "pidginaccountstore.h" |
|
40496
6941fece679b
phase2 of pidgin.h: move existing file to pidgincore.h
Gary Kramlich <grim@reaperworld.com>
parents:
40490
diff
changeset
|
37 | #include "pidgincore.h" |
|
40533
b1921b17b683
Replace some utility functions with actual widgets
Gary Kramlich <grim@reaperworld.com>
parents:
40509
diff
changeset
|
38 | #include "pidgindialog.h" |
|
39223
7016ec26cd75
Move GtkPounce to Talkatu
Gary Kramlich <grim@reaperworld.com>
parents:
39176
diff
changeset
|
39 | #include "pidgintalkatu.h" |
|
5872
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5866
diff
changeset
|
40 | |
|
33212
970a460e74fa
Fix compilation for GTK2
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33195
diff
changeset
|
41 | #include <gdk/gdkkeysyms.h> |
|
5872
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5866
diff
changeset
|
42 | |
|
35455
216a37403c5b
Fix a bunch of gtk-doc warnings in pidgin
Ankit Vani <a@nevitus.org>
parents:
35454
diff
changeset
|
43 | /* |
| 12136 | 44 | * These are used for the GtkTreeView when you're scrolling through |
| 45 | * all your saved pounces. | |
| 46 | */ | |
| 47 | enum | |
| 48 | { | |
| 15884 | 49 | /* Hidden column containing the PurplePounce */ |
| 12136 | 50 | POUNCES_MANAGER_COLUMN_POUNCE, |
| 51 | POUNCES_MANAGER_COLUMN_ICON, | |
| 52 | POUNCES_MANAGER_COLUMN_TARGET, | |
| 53 | POUNCES_MANAGER_COLUMN_ACCOUNT, | |
|
12193
243b18a880ba
[gaim-migrate @ 14495]
Richard Laager <rlaager@pidgin.im>
parents:
12192
diff
changeset
|
54 | POUNCES_MANAGER_COLUMN_RECURRING, |
| 12136 | 55 | POUNCES_MANAGER_NUM_COLUMNS |
| 56 | }; | |
| 57 | ||
|
5857
52cff8a95261
[gaim-migrate @ 6288]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
58 | typedef struct |
| 5032 | 59 | { |
| 60 | /* Pounce data */ | |
| 15884 | 61 | PurplePounce *pounce; |
| 62 | PurpleAccount *account; | |
| 5032 | 63 | |
| 64 | /* The window */ | |
| 65 | GtkWidget *window; | |
| 66 | ||
| 12694 | 67 | /* Pounce on Whom */ |
| 5032 | 68 | GtkWidget *account_menu; |
| 69 | GtkWidget *buddy_entry; | |
| 70 | ||
| 12694 | 71 | /* Pounce options */ |
| 72 | GtkWidget *on_away; | |
| 73 | ||
| 74 | /* Pounce When Buddy... */ | |
| 5032 | 75 | GtkWidget *signon; |
| 76 | GtkWidget *signoff; | |
| 77 | GtkWidget *away; | |
| 78 | GtkWidget *away_return; | |
| 79 | GtkWidget *idle; | |
| 80 | GtkWidget *idle_return; | |
| 81 | GtkWidget *typing; | |
|
13844
835b8f7b3d1d
[gaim-migrate @ 16295]
Mark Doliner <markdoliner@pidgin.im>
parents:
13775
diff
changeset
|
82 | GtkWidget *typed; |
| 5032 | 83 | GtkWidget *stop_typing; |
| 12694 | 84 | GtkWidget *message_recv; |
| 5032 | 85 | |
| 12694 | 86 | /* Action */ |
| 5032 | 87 | GtkWidget *open_win; |
| 88 | GtkWidget *popup; | |
| 12934 | 89 | GtkWidget *popup_entry; |
| 5032 | 90 | GtkWidget *send_msg; |
| 91 | GtkWidget *send_msg_entry; | |
|
39223
7016ec26cd75
Move GtkPounce to Talkatu
Gary Kramlich <grim@reaperworld.com>
parents:
39176
diff
changeset
|
92 | GtkTextBuffer *send_msg_buffer; |
| 5032 | 93 | GtkWidget *exec_cmd; |
| 94 | GtkWidget *exec_cmd_entry; | |
| 5319 | 95 | GtkWidget *exec_cmd_browse; |
|
7035
76bca80cd91d
[gaim-migrate @ 7598]
Christian Hammond <chipx86@chipx86.com>
parents:
6982
diff
changeset
|
96 | |
| 5032 | 97 | GtkWidget *save_pounce; |
|
5857
52cff8a95261
[gaim-migrate @ 6288]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
98 | |
|
5876
c12b198bde14
[gaim-migrate @ 6308]
Christian Hammond <chipx86@chipx86.com>
parents:
5875
diff
changeset
|
99 | /* Buttons */ |
|
c12b198bde14
[gaim-migrate @ 6308]
Christian Hammond <chipx86@chipx86.com>
parents:
5875
diff
changeset
|
100 | GtkWidget *save_button; |
|
c12b198bde14
[gaim-migrate @ 6308]
Christian Hammond <chipx86@chipx86.com>
parents:
5875
diff
changeset
|
101 | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15496
diff
changeset
|
102 | } PidginPounceDialog; |
| 5032 | 103 | |
| 12136 | 104 | typedef struct |
| 105 | { | |
| 106 | GtkWidget *window; | |
| 107 | GtkListStore *model; | |
| 108 | GtkWidget *treeview; | |
| 109 | GtkWidget *modify_button; | |
| 110 | GtkWidget *delete_button; | |
| 111 | } PouncesManager; | |
| 112 | ||
| 113 | static PouncesManager *pounces_manager = NULL; | |
| 114 | ||
| 5032 | 115 | /************************************************************************** |
| 116 | * Callbacks | |
| 117 | **************************************************************************/ | |
| 118 | static gint | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15496
diff
changeset
|
119 | delete_win_cb(GtkWidget *w, GdkEventAny *e, PidginPounceDialog *dialog) |
| 5032 | 120 | { |
| 121 | gtk_widget_destroy(dialog->window); | |
| 122 | g_free(dialog); | |
| 123 | ||
| 124 | return TRUE; | |
| 125 | } | |
| 126 | ||
| 127 | static void | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15496
diff
changeset
|
128 | cancel_cb(GtkWidget *w, PidginPounceDialog *dialog) |
| 5032 | 129 | { |
| 130 | delete_win_cb(NULL, NULL, dialog); | |
| 131 | } | |
| 132 | ||
| 5319 | 133 | static void |
|
9505
6120a3cb8af7
[gaim-migrate @ 10332]
Mark Doliner <markdoliner@pidgin.im>
parents:
9206
diff
changeset
|
134 | pounce_update_entry_fields(void *user_data, const char *filename) |
| 5319 | 135 | { |
|
9505
6120a3cb8af7
[gaim-migrate @ 10332]
Mark Doliner <markdoliner@pidgin.im>
parents:
9206
diff
changeset
|
136 | GtkWidget *entry = (GtkWidget *)user_data; |
|
5857
52cff8a95261
[gaim-migrate @ 6288]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
137 | |
|
9505
6120a3cb8af7
[gaim-migrate @ 10332]
Mark Doliner <markdoliner@pidgin.im>
parents:
9206
diff
changeset
|
138 | gtk_entry_set_text(GTK_ENTRY(entry), filename); |
| 5319 | 139 | } |
| 140 | ||
| 141 | static void | |
|
9505
6120a3cb8af7
[gaim-migrate @ 10332]
Mark Doliner <markdoliner@pidgin.im>
parents:
9206
diff
changeset
|
142 | filesel(GtkWidget *widget, gpointer data) |
| 5319 | 143 | { |
| 144 | GtkWidget *entry; | |
|
9505
6120a3cb8af7
[gaim-migrate @ 10332]
Mark Doliner <markdoliner@pidgin.im>
parents:
9206
diff
changeset
|
145 | const gchar *name; |
|
7035
76bca80cd91d
[gaim-migrate @ 7598]
Christian Hammond <chipx86@chipx86.com>
parents:
6982
diff
changeset
|
146 | |
|
76bca80cd91d
[gaim-migrate @ 7598]
Christian Hammond <chipx86@chipx86.com>
parents:
6982
diff
changeset
|
147 | entry = (GtkWidget *)data; |
|
9505
6120a3cb8af7
[gaim-migrate @ 10332]
Mark Doliner <markdoliner@pidgin.im>
parents:
9206
diff
changeset
|
148 | name = gtk_entry_get_text(GTK_ENTRY(entry)); |
|
5857
52cff8a95261
[gaim-migrate @ 6288]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
149 | |
|
21175
c6d76b49c206
disapproval of revision '8ba833993a115415727bb1b70362e0bd1603c169'
Richard Laager <rlaager@pidgin.im>
parents:
21174
diff
changeset
|
150 | purple_request_file(entry, _("Select a file"), name, FALSE, |
|
34333
b92698241603
Request API refactoring: switch purple_request_file to PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34331
diff
changeset
|
151 | G_CALLBACK(pounce_update_entry_fields), NULL, NULL, entry); |
|
15319
f8f83efdc3a6
[gaim-migrate @ 18047]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15315
diff
changeset
|
152 | g_signal_connect_swapped(G_OBJECT(entry), "destroy", |
| 15884 | 153 | G_CALLBACK(purple_request_close_with_handle), entry); |
| 5319 | 154 | } |
| 155 | ||
| 156 | static void | |
| 15884 | 157 | add_pounce_to_treeview(GtkListStore *model, PurplePounce *pounce) |
| 12136 | 158 | { |
| 159 | GtkTreeIter iter; | |
| 15884 | 160 | PurpleAccount *account; |
|
12193
243b18a880ba
[gaim-migrate @ 14495]
Richard Laager <rlaager@pidgin.im>
parents:
12192
diff
changeset
|
161 | gboolean recurring; |
| 12136 | 162 | const char *pouncer; |
| 163 | const char *pouncee; | |
|
13091
b5ed878998dd
[gaim-migrate @ 15452]
Mark Doliner <markdoliner@pidgin.im>
parents:
13033
diff
changeset
|
164 | GdkPixbuf *pixbuf; |
| 12136 | 165 | |
| 15884 | 166 | account = purple_pounce_get_pouncer(pounce); |
| 12136 | 167 | |
|
36545
23b59a16c808
Replaced some _prpl_ stuff with _protocol_
Ankit Vani <a@nevitus.org>
parents:
36543
diff
changeset
|
168 | pixbuf = pidgin_create_protocol_icon(account, PIDGIN_PROTOCOL_ICON_MEDIUM); |
| 12136 | 169 | |
| 15884 | 170 | pouncer = purple_account_get_username(account); |
| 171 | pouncee = purple_pounce_get_pouncee(pounce); | |
| 172 | recurring = purple_pounce_get_save(pounce); | |
| 12136 | 173 | |
| 174 | gtk_list_store_append(model, &iter); | |
| 175 | gtk_list_store_set(model, &iter, | |
| 176 | POUNCES_MANAGER_COLUMN_POUNCE, pounce, | |
|
13091
b5ed878998dd
[gaim-migrate @ 15452]
Mark Doliner <markdoliner@pidgin.im>
parents:
13033
diff
changeset
|
177 | POUNCES_MANAGER_COLUMN_ICON, pixbuf, |
| 12136 | 178 | POUNCES_MANAGER_COLUMN_TARGET, pouncee, |
| 179 | POUNCES_MANAGER_COLUMN_ACCOUNT, pouncer, | |
|
12193
243b18a880ba
[gaim-migrate @ 14495]
Richard Laager <rlaager@pidgin.im>
parents:
12192
diff
changeset
|
180 | POUNCES_MANAGER_COLUMN_RECURRING, recurring, |
| 12136 | 181 | -1); |
|
13091
b5ed878998dd
[gaim-migrate @ 15452]
Mark Doliner <markdoliner@pidgin.im>
parents:
13033
diff
changeset
|
182 | |
|
b5ed878998dd
[gaim-migrate @ 15452]
Mark Doliner <markdoliner@pidgin.im>
parents:
13033
diff
changeset
|
183 | if (pixbuf != NULL) |
|
b5ed878998dd
[gaim-migrate @ 15452]
Mark Doliner <markdoliner@pidgin.im>
parents:
13033
diff
changeset
|
184 | g_object_unref(pixbuf); |
| 12136 | 185 | } |
| 186 | ||
| 187 | static void | |
| 188 | populate_pounces_list(PouncesManager *dialog) | |
| 189 | { | |
|
18190
bcf28ef7e8ff
Re-fix the DBus list handling code by killing const GList* / const GSList*
Richard Laager <rlaager@pidgin.im>
parents:
18186
diff
changeset
|
190 | GList *pounces; |
| 12136 | 191 | |
| 192 | gtk_list_store_clear(dialog->model); | |
| 193 | ||
|
18209
5f63822878eb
Fix #1574. (Pidgin and Finch show each other's pounces, interact in
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18193
diff
changeset
|
194 | 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
|
195 | pounces = g_list_delete_link(pounces, pounces)) |
| 12136 | 196 | { |
| 197 | add_pounce_to_treeview(dialog->model, pounces->data); | |
| 198 | } | |
| 199 | } | |
| 200 | ||
| 201 | static void | |
| 202 | update_pounces(void) | |
| 203 | { | |
| 204 | /* Rebuild the pounces list if the pounces manager is open */ | |
| 205 | if (pounces_manager != NULL) | |
| 206 | { | |
| 207 | populate_pounces_list(pounces_manager); | |
| 208 | } | |
| 209 | } | |
| 210 | ||
| 211 | static void | |
| 15884 | 212 | signed_on_off_cb(PurpleConnection *gc, gpointer user_data) |
| 12136 | 213 | { |
| 214 | update_pounces(); | |
| 215 | } | |
| 216 | ||
| 217 | static void | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15496
diff
changeset
|
218 | save_pounce_cb(GtkWidget *w, PidginPounceDialog *dialog) |
| 5032 | 219 | { |
| 220 | const char *name; | |
|
40509
6748a5ec6644
remove the old sound api
Gary Kramlich <grim@reaperworld.com>
parents:
40496
diff
changeset
|
221 | const char *command, *reason; |
|
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
|
222 | char *message; |
| 15884 | 223 | PurplePounceEvent events = PURPLE_POUNCE_NONE; |
| 224 | PurplePounceOption options = PURPLE_POUNCE_OPTION_NONE; | |
| 5032 | 225 | |
| 226 | name = gtk_entry_get_text(GTK_ENTRY(dialog->buddy_entry)); | |
| 227 | ||
|
9206
57a4db675f8d
[gaim-migrate @ 10001]
Christian Hammond <chipx86@chipx86.com>
parents:
9205
diff
changeset
|
228 | if (*name == '\0') |
|
57a4db675f8d
[gaim-migrate @ 10001]
Christian Hammond <chipx86@chipx86.com>
parents:
9205
diff
changeset
|
229 | { |
|
34449
bbcb198650b7
Notify API: extend purple_notify_message with PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34333
diff
changeset
|
230 | purple_notify_error(NULL, NULL, _("Please enter a buddy to " |
|
bbcb198650b7
Notify API: extend purple_notify_message with PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34333
diff
changeset
|
231 | "pounce."), NULL, NULL); |
| 5032 | 232 | return; |
| 233 | } | |
| 234 | ||
| 12694 | 235 | /* Options */ |
| 236 | if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(dialog->on_away))) | |
| 15884 | 237 | options |= PURPLE_POUNCE_OPTION_AWAY; |
| 12694 | 238 | |
| 5032 | 239 | /* Events */ |
| 240 | if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(dialog->signon))) | |
| 15884 | 241 | events |= PURPLE_POUNCE_SIGNON; |
| 5032 | 242 | |
| 243 | if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(dialog->signoff))) | |
| 15884 | 244 | events |= PURPLE_POUNCE_SIGNOFF; |
| 5032 | 245 | |
| 246 | if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(dialog->away))) | |
| 15884 | 247 | events |= PURPLE_POUNCE_AWAY; |
| 5032 | 248 | |
| 249 | if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(dialog->away_return))) | |
| 15884 | 250 | events |= PURPLE_POUNCE_AWAY_RETURN; |
| 5032 | 251 | |
| 252 | if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(dialog->idle))) | |
| 15884 | 253 | events |= PURPLE_POUNCE_IDLE; |
| 5032 | 254 | |
| 255 | if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(dialog->idle_return))) | |
| 15884 | 256 | events |= PURPLE_POUNCE_IDLE_RETURN; |
| 5032 | 257 | |
| 258 | if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(dialog->typing))) | |
| 15884 | 259 | events |= PURPLE_POUNCE_TYPING; |
| 5032 | 260 | |
|
13844
835b8f7b3d1d
[gaim-migrate @ 16295]
Mark Doliner <markdoliner@pidgin.im>
parents:
13775
diff
changeset
|
261 | if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(dialog->typed))) |
| 15884 | 262 | events |= PURPLE_POUNCE_TYPED; |
|
13844
835b8f7b3d1d
[gaim-migrate @ 16295]
Mark Doliner <markdoliner@pidgin.im>
parents:
13775
diff
changeset
|
263 | |
| 5032 | 264 | if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(dialog->stop_typing))) |
| 15884 | 265 | events |= PURPLE_POUNCE_TYPING_STOPPED; |
| 5032 | 266 | |
| 12694 | 267 | if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(dialog->message_recv))) |
| 15884 | 268 | events |= PURPLE_POUNCE_MESSAGE_RECEIVED; |
| 12694 | 269 | |
| 5032 | 270 | /* Data fields */ |
|
39223
7016ec26cd75
Move GtkPounce to Talkatu
Gary Kramlich <grim@reaperworld.com>
parents:
39176
diff
changeset
|
271 | message = talkatu_markup_get_html(dialog->send_msg_buffer, NULL); |
| 5032 | 272 | command = gtk_entry_get_text(GTK_ENTRY(dialog->exec_cmd_entry)); |
| 12934 | 273 | reason = gtk_entry_get_text(GTK_ENTRY(dialog->popup_entry)); |
| 5032 | 274 | |
| 12934 | 275 | 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
|
276 | 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
|
277 | 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
|
278 | 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
|
279 | } |
| 5032 | 280 | if (*command == '\0') command = NULL; |
| 281 | ||
|
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
|
282 | /* 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
|
283 | 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
|
284 | && 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
|
285 | 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
|
286 | 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
|
287 | } |
|
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
|
288 | |
|
9205
8c4dbbe6386f
[gaim-migrate @ 10000]
Christian Hammond <chipx86@chipx86.com>
parents:
9191
diff
changeset
|
289 | if (dialog->pounce == NULL) |
|
8c4dbbe6386f
[gaim-migrate @ 10000]
Christian Hammond <chipx86@chipx86.com>
parents:
9191
diff
changeset
|
290 | { |
| 15884 | 291 | dialog->pounce = purple_pounce_new(PIDGIN_UI, dialog->account, |
| 12694 | 292 | name, events, options); |
| 5032 | 293 | } |
|
5864
86822afeeab0
[gaim-migrate @ 6295]
Christian Hammond <chipx86@chipx86.com>
parents:
5857
diff
changeset
|
294 | else { |
| 15884 | 295 | purple_pounce_set_events(dialog->pounce, events); |
| 296 | purple_pounce_set_options(dialog->pounce, options); | |
| 297 | purple_pounce_set_pouncer(dialog->pounce, dialog->account); | |
| 298 | purple_pounce_set_pouncee(dialog->pounce, name); | |
| 5032 | 299 | } |
| 300 | ||
|
9206
57a4db675f8d
[gaim-migrate @ 10001]
Christian Hammond <chipx86@chipx86.com>
parents:
9205
diff
changeset
|
301 | /* Actions */ |
| 15884 | 302 | purple_pounce_action_set_enabled(dialog->pounce, "open-window", |
|
5864
86822afeeab0
[gaim-migrate @ 6295]
Christian Hammond <chipx86@chipx86.com>
parents:
5857
diff
changeset
|
303 | gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(dialog->open_win))); |
| 15884 | 304 | purple_pounce_action_set_enabled(dialog->pounce, "popup-notify", |
|
5864
86822afeeab0
[gaim-migrate @ 6295]
Christian Hammond <chipx86@chipx86.com>
parents:
5857
diff
changeset
|
305 | gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(dialog->popup))); |
| 15884 | 306 | purple_pounce_action_set_enabled(dialog->pounce, "send-message", |
|
5864
86822afeeab0
[gaim-migrate @ 6295]
Christian Hammond <chipx86@chipx86.com>
parents:
5857
diff
changeset
|
307 | gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(dialog->send_msg))); |
| 15884 | 308 | purple_pounce_action_set_enabled(dialog->pounce, "execute-command", |
|
5864
86822afeeab0
[gaim-migrate @ 6295]
Christian Hammond <chipx86@chipx86.com>
parents:
5857
diff
changeset
|
309 | gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(dialog->exec_cmd))); |
|
86822afeeab0
[gaim-migrate @ 6295]
Christian Hammond <chipx86@chipx86.com>
parents:
5857
diff
changeset
|
310 | |
| 15884 | 311 | purple_pounce_action_set_attribute(dialog->pounce, "send-message", |
|
5864
86822afeeab0
[gaim-migrate @ 6295]
Christian Hammond <chipx86@chipx86.com>
parents:
5857
diff
changeset
|
312 | "message", message); |
| 15884 | 313 | purple_pounce_action_set_attribute(dialog->pounce, "execute-command", |
|
5864
86822afeeab0
[gaim-migrate @ 6295]
Christian Hammond <chipx86@chipx86.com>
parents:
5857
diff
changeset
|
314 | "command", command); |
| 15884 | 315 | purple_pounce_action_set_attribute(dialog->pounce, "popup-notify", |
| 12934 | 316 | "reason", reason); |
|
5864
86822afeeab0
[gaim-migrate @ 6295]
Christian Hammond <chipx86@chipx86.com>
parents:
5857
diff
changeset
|
317 | |
|
9206
57a4db675f8d
[gaim-migrate @ 10001]
Christian Hammond <chipx86@chipx86.com>
parents:
9205
diff
changeset
|
318 | /* 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
|
319 | 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
|
320 | 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
|
321 | 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
|
322 | 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
|
323 | 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
|
324 | 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
|
325 | 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
|
326 | gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(dialog->exec_cmd))); |
|
57a4db675f8d
[gaim-migrate @ 10001]
Christian Hammond <chipx86@chipx86.com>
parents:
9205
diff
changeset
|
327 | |
| 15884 | 328 | purple_pounce_set_save(dialog->pounce, |
|
5864
86822afeeab0
[gaim-migrate @ 6295]
Christian Hammond <chipx86@chipx86.com>
parents:
5857
diff
changeset
|
329 | gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(dialog->save_pounce))); |
|
86822afeeab0
[gaim-migrate @ 6295]
Christian Hammond <chipx86@chipx86.com>
parents:
5857
diff
changeset
|
330 | |
| 12136 | 331 | 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
|
332 | g_free(message); |
| 5032 | 333 | |
| 12136 | 334 | delete_win_cb(NULL, NULL, dialog); |
| 5032 | 335 | } |
| 336 | ||
|
33194
e5258008e4d7
Convert pounce dialog to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33170
diff
changeset
|
337 | static gboolean |
|
e5258008e4d7
Convert pounce dialog to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33170
diff
changeset
|
338 | entry_key_press_cb(GtkWidget *widget, GdkEventKey *event, |
|
e5258008e4d7
Convert pounce dialog to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33170
diff
changeset
|
339 | PidginPounceDialog *dialog) |
|
e5258008e4d7
Convert pounce dialog to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33170
diff
changeset
|
340 | { |
|
e5258008e4d7
Convert pounce dialog to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33170
diff
changeset
|
341 | if ((event->keyval == GDK_KEY_Return) |
|
e5258008e4d7
Convert pounce dialog to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33170
diff
changeset
|
342 | || (event->keyval == GDK_KEY_KP_Enter)) { |
|
e5258008e4d7
Convert pounce dialog to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33170
diff
changeset
|
343 | save_pounce_cb(widget, dialog); |
|
e5258008e4d7
Convert pounce dialog to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33170
diff
changeset
|
344 | return TRUE; |
|
e5258008e4d7
Convert pounce dialog to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33170
diff
changeset
|
345 | } |
|
e5258008e4d7
Convert pounce dialog to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33170
diff
changeset
|
346 | |
|
e5258008e4d7
Convert pounce dialog to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33170
diff
changeset
|
347 | return FALSE; |
|
e5258008e4d7
Convert pounce dialog to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33170
diff
changeset
|
348 | } |
|
e5258008e4d7
Convert pounce dialog to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33170
diff
changeset
|
349 | |
| 5054 | 350 | static void |
|
40534
8dad2981fb86
Separate the AccountChooser from its model and move options to filters
Gary Kramlich <grim@reaperworld.com>
parents:
40533
diff
changeset
|
351 | pounce_choose_cb(GtkWidget *w, PidginPounceDialog *dialog) |
| 5032 | 352 | { |
|
40534
8dad2981fb86
Separate the AccountChooser from its model and move options to filters
Gary Kramlich <grim@reaperworld.com>
parents:
40533
diff
changeset
|
353 | PidginAccountChooser *chooser = PIDGIN_ACCOUNT_CHOOSER(w); |
|
39787
af7ae86ee287
Remove callback from account chooser constructor.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39786
diff
changeset
|
354 | dialog->account = pidgin_account_chooser_get_selected(chooser); |
| 5032 | 355 | } |
| 356 | ||
|
5876
c12b198bde14
[gaim-migrate @ 6308]
Christian Hammond <chipx86@chipx86.com>
parents:
5875
diff
changeset
|
357 | static void |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15496
diff
changeset
|
358 | buddy_changed_cb(GtkEntry *entry, PidginPounceDialog *dialog) |
|
5876
c12b198bde14
[gaim-migrate @ 6308]
Christian Hammond <chipx86@chipx86.com>
parents:
5875
diff
changeset
|
359 | { |
|
c12b198bde14
[gaim-migrate @ 6308]
Christian Hammond <chipx86@chipx86.com>
parents:
5875
diff
changeset
|
360 | if (dialog->save_button == NULL) |
|
c12b198bde14
[gaim-migrate @ 6308]
Christian Hammond <chipx86@chipx86.com>
parents:
5875
diff
changeset
|
361 | return; |
|
c12b198bde14
[gaim-migrate @ 6308]
Christian Hammond <chipx86@chipx86.com>
parents:
5875
diff
changeset
|
362 | |
|
c12b198bde14
[gaim-migrate @ 6308]
Christian Hammond <chipx86@chipx86.com>
parents:
5875
diff
changeset
|
363 | gtk_widget_set_sensitive(dialog->save_button, |
|
9205
8c4dbbe6386f
[gaim-migrate @ 10000]
Christian Hammond <chipx86@chipx86.com>
parents:
9191
diff
changeset
|
364 | *gtk_entry_get_text(entry) != '\0'); |
|
5876
c12b198bde14
[gaim-migrate @ 6308]
Christian Hammond <chipx86@chipx86.com>
parents:
5875
diff
changeset
|
365 | } |
|
c12b198bde14
[gaim-migrate @ 6308]
Christian Hammond <chipx86@chipx86.com>
parents:
5875
diff
changeset
|
366 | |
|
8803
79bc4ecbcac7
[gaim-migrate @ 9565]
Christian Hammond <chipx86@chipx86.com>
parents:
8259
diff
changeset
|
367 | static void |
| 12694 | 368 | message_recv_toggle(GtkButton *message_recv, GtkWidget *send_msg) |
| 369 | { | |
| 370 | gboolean active = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(message_recv)); | |
| 371 | ||
| 372 | gtk_widget_set_sensitive(send_msg, !active); | |
| 373 | if (active) | |
| 374 | gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(send_msg), FALSE); | |
| 375 | } | |
| 376 | ||
| 377 | static void | |
|
8803
79bc4ecbcac7
[gaim-migrate @ 9565]
Christian Hammond <chipx86@chipx86.com>
parents:
8259
diff
changeset
|
378 | pounce_dnd_recv(GtkWidget *widget, GdkDragContext *dc, gint x, gint y, |
|
79bc4ecbcac7
[gaim-migrate @ 9565]
Christian Hammond <chipx86@chipx86.com>
parents:
8259
diff
changeset
|
379 | GtkSelectionData *sd, guint info, guint t, gpointer data) |
|
79bc4ecbcac7
[gaim-migrate @ 9565]
Christian Hammond <chipx86@chipx86.com>
parents:
8259
diff
changeset
|
380 | { |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15496
diff
changeset
|
381 | PidginPounceDialog *dialog; |
|
32422
c215bc5d85e4
Whitespace fixes. Try and check your editor settings before writing
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32394
diff
changeset
|
382 | GdkAtom target = gtk_selection_data_get_target(sd); |
|
c215bc5d85e4
Whitespace fixes. Try and check your editor settings before writing
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32394
diff
changeset
|
383 | const guchar *sd_data = gtk_selection_data_get_data(sd); |
|
8803
79bc4ecbcac7
[gaim-migrate @ 9565]
Christian Hammond <chipx86@chipx86.com>
parents:
8259
diff
changeset
|
384 | |
|
32394
f883709bdba4
compiles using GTK+ 3 from git, beware it does not yet run, in fact it crashes...
Marcus Lundblad <malu@pidgin.im>
parents:
30706
diff
changeset
|
385 | if (target == gdk_atom_intern("PURPLE_BLIST_NODE", FALSE)) |
|
8803
79bc4ecbcac7
[gaim-migrate @ 9565]
Christian Hammond <chipx86@chipx86.com>
parents:
8259
diff
changeset
|
386 | { |
| 15884 | 387 | PurpleBlistNode *node = NULL; |
| 388 | PurpleBuddy *buddy; | |
|
8803
79bc4ecbcac7
[gaim-migrate @ 9565]
Christian Hammond <chipx86@chipx86.com>
parents:
8259
diff
changeset
|
389 | |
|
32394
f883709bdba4
compiles using GTK+ 3 from git, beware it does not yet run, in fact it crashes...
Marcus Lundblad <malu@pidgin.im>
parents:
30706
diff
changeset
|
390 | memcpy(&node, sd_data, sizeof(node)); |
|
8803
79bc4ecbcac7
[gaim-migrate @ 9565]
Christian Hammond <chipx86@chipx86.com>
parents:
8259
diff
changeset
|
391 | |
|
34696
6e0d13978666
Global replace to use GObject-style macros. See details.
Ankit Vani <a@nevitus.org>
parents:
34662
diff
changeset
|
392 | if (PURPLE_IS_CONTACT(node)) |
| 15884 | 393 | buddy = purple_contact_get_priority_buddy((PurpleContact *)node); |
|
34696
6e0d13978666
Global replace to use GObject-style macros. See details.
Ankit Vani <a@nevitus.org>
parents:
34662
diff
changeset
|
394 | else if (PURPLE_IS_BUDDY(node)) |
| 15884 | 395 | buddy = (PurpleBuddy *)node; |
|
8803
79bc4ecbcac7
[gaim-migrate @ 9565]
Christian Hammond <chipx86@chipx86.com>
parents:
8259
diff
changeset
|
396 | else |
|
79bc4ecbcac7
[gaim-migrate @ 9565]
Christian Hammond <chipx86@chipx86.com>
parents:
8259
diff
changeset
|
397 | return; |
|
79bc4ecbcac7
[gaim-migrate @ 9565]
Christian Hammond <chipx86@chipx86.com>
parents:
8259
diff
changeset
|
398 | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15496
diff
changeset
|
399 | dialog = (PidginPounceDialog *)data; |
|
8803
79bc4ecbcac7
[gaim-migrate @ 9565]
Christian Hammond <chipx86@chipx86.com>
parents:
8259
diff
changeset
|
400 | |
|
32709
0edad3ff7243
Use the PurpleBuddy accessor functions.
Andrew Victor <andrew.victor@mxit.com>
parents:
32678
diff
changeset
|
401 | gtk_entry_set_text(GTK_ENTRY(dialog->buddy_entry), purple_buddy_get_name(buddy)); |
|
0edad3ff7243
Use the PurpleBuddy accessor functions.
Andrew Victor <andrew.victor@mxit.com>
parents:
32678
diff
changeset
|
402 | dialog->account = purple_buddy_get_account(buddy); |
|
39786
7800f52d0ae6
Rename pidgin_account_option_menu_* to pidgin_account_chooser_*.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39785
diff
changeset
|
403 | pidgin_account_chooser_set_selected( |
|
40534
8dad2981fb86
Separate the AccountChooser from its model and move options to filters
Gary Kramlich <grim@reaperworld.com>
parents:
40533
diff
changeset
|
404 | PIDGIN_ACCOUNT_CHOOSER(dialog->account_menu), |
|
8dad2981fb86
Separate the AccountChooser from its model and move options to filters
Gary Kramlich <grim@reaperworld.com>
parents:
40533
diff
changeset
|
405 | purple_buddy_get_account(buddy)); |
|
8803
79bc4ecbcac7
[gaim-migrate @ 9565]
Christian Hammond <chipx86@chipx86.com>
parents:
8259
diff
changeset
|
406 | |
|
32394
f883709bdba4
compiles using GTK+ 3 from git, beware it does not yet run, in fact it crashes...
Marcus Lundblad <malu@pidgin.im>
parents:
30706
diff
changeset
|
407 | gtk_drag_finish(dc, TRUE, (gdk_drag_context_get_actions(dc) == GDK_ACTION_MOVE), t); |
|
8803
79bc4ecbcac7
[gaim-migrate @ 9565]
Christian Hammond <chipx86@chipx86.com>
parents:
8259
diff
changeset
|
408 | } |
|
32394
f883709bdba4
compiles using GTK+ 3 from git, beware it does not yet run, in fact it crashes...
Marcus Lundblad <malu@pidgin.im>
parents:
30706
diff
changeset
|
409 | else if (target == gdk_atom_intern("application/x-im-contact", FALSE)) |
|
8803
79bc4ecbcac7
[gaim-migrate @ 9565]
Christian Hammond <chipx86@chipx86.com>
parents:
8259
diff
changeset
|
410 | { |
|
79bc4ecbcac7
[gaim-migrate @ 9565]
Christian Hammond <chipx86@chipx86.com>
parents:
8259
diff
changeset
|
411 | char *protocol = NULL; |
|
79bc4ecbcac7
[gaim-migrate @ 9565]
Christian Hammond <chipx86@chipx86.com>
parents:
8259
diff
changeset
|
412 | char *username = NULL; |
| 15884 | 413 | PurpleAccount *account; |
|
8803
79bc4ecbcac7
[gaim-migrate @ 9565]
Christian Hammond <chipx86@chipx86.com>
parents:
8259
diff
changeset
|
414 | |
|
33170
ce4447562d64
Add checks for old GTK+2 stuff.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33141
diff
changeset
|
415 | 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
|
416 | &protocol, &username, NULL)) |
|
79bc4ecbcac7
[gaim-migrate @ 9565]
Christian Hammond <chipx86@chipx86.com>
parents:
8259
diff
changeset
|
417 | { |
|
79bc4ecbcac7
[gaim-migrate @ 9565]
Christian Hammond <chipx86@chipx86.com>
parents:
8259
diff
changeset
|
418 | if (account == NULL) |
|
79bc4ecbcac7
[gaim-migrate @ 9565]
Christian Hammond <chipx86@chipx86.com>
parents:
8259
diff
changeset
|
419 | { |
| 15884 | 420 | purple_notify_error(NULL, NULL, |
|
8803
79bc4ecbcac7
[gaim-migrate @ 9565]
Christian Hammond <chipx86@chipx86.com>
parents:
8259
diff
changeset
|
421 | _("You are not currently signed on with an account that " |
|
34449
bbcb198650b7
Notify API: extend purple_notify_message with PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34333
diff
changeset
|
422 | "can add that buddy."), NULL, NULL); |
|
8803
79bc4ecbcac7
[gaim-migrate @ 9565]
Christian Hammond <chipx86@chipx86.com>
parents:
8259
diff
changeset
|
423 | } |
|
79bc4ecbcac7
[gaim-migrate @ 9565]
Christian Hammond <chipx86@chipx86.com>
parents:
8259
diff
changeset
|
424 | else |
|
79bc4ecbcac7
[gaim-migrate @ 9565]
Christian Hammond <chipx86@chipx86.com>
parents:
8259
diff
changeset
|
425 | { |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15496
diff
changeset
|
426 | dialog = (PidginPounceDialog *)data; |
|
8803
79bc4ecbcac7
[gaim-migrate @ 9565]
Christian Hammond <chipx86@chipx86.com>
parents:
8259
diff
changeset
|
427 | |
|
79bc4ecbcac7
[gaim-migrate @ 9565]
Christian Hammond <chipx86@chipx86.com>
parents:
8259
diff
changeset
|
428 | gtk_entry_set_text(GTK_ENTRY(dialog->buddy_entry), username); |
|
9910
7b4465b92411
[gaim-migrate @ 10802]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9791
diff
changeset
|
429 | dialog->account = account; |
|
39786
7800f52d0ae6
Rename pidgin_account_option_menu_* to pidgin_account_chooser_*.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39785
diff
changeset
|
430 | pidgin_account_chooser_set_selected( |
|
40534
8dad2981fb86
Separate the AccountChooser from its model and move options to filters
Gary Kramlich <grim@reaperworld.com>
parents:
40533
diff
changeset
|
431 | PIDGIN_ACCOUNT_CHOOSER(dialog->account_menu), account); |
|
8803
79bc4ecbcac7
[gaim-migrate @ 9565]
Christian Hammond <chipx86@chipx86.com>
parents:
8259
diff
changeset
|
432 | } |
|
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 | |
|
14097
0c340861ab79
[gaim-migrate @ 16638]
Mark Doliner <markdoliner@pidgin.im>
parents:
13844
diff
changeset
|
435 | g_free(username); |
|
0c340861ab79
[gaim-migrate @ 16638]
Mark Doliner <markdoliner@pidgin.im>
parents:
13844
diff
changeset
|
436 | g_free(protocol); |
|
8803
79bc4ecbcac7
[gaim-migrate @ 9565]
Christian Hammond <chipx86@chipx86.com>
parents:
8259
diff
changeset
|
437 | |
|
32394
f883709bdba4
compiles using GTK+ 3 from git, beware it does not yet run, in fact it crashes...
Marcus Lundblad <malu@pidgin.im>
parents:
30706
diff
changeset
|
438 | gtk_drag_finish(dc, TRUE, (gdk_drag_context_get_actions(dc) == GDK_ACTION_MOVE), t); |
|
8803
79bc4ecbcac7
[gaim-migrate @ 9565]
Christian Hammond <chipx86@chipx86.com>
parents:
8259
diff
changeset
|
439 | } |
|
79bc4ecbcac7
[gaim-migrate @ 9565]
Christian Hammond <chipx86@chipx86.com>
parents:
8259
diff
changeset
|
440 | } |
|
79bc4ecbcac7
[gaim-migrate @ 9565]
Christian Hammond <chipx86@chipx86.com>
parents:
8259
diff
changeset
|
441 | |
|
79bc4ecbcac7
[gaim-migrate @ 9565]
Christian Hammond <chipx86@chipx86.com>
parents:
8259
diff
changeset
|
442 | static const GtkTargetEntry dnd_targets[] = |
|
79bc4ecbcac7
[gaim-migrate @ 9565]
Christian Hammond <chipx86@chipx86.com>
parents:
8259
diff
changeset
|
443 | { |
| 15884 | 444 | {"PURPLE_BLIST_NODE", GTK_TARGET_SAME_APP, 0}, |
|
8803
79bc4ecbcac7
[gaim-migrate @ 9565]
Christian Hammond <chipx86@chipx86.com>
parents:
8259
diff
changeset
|
445 | {"application/x-im-contact", 0, 1} |
|
79bc4ecbcac7
[gaim-migrate @ 9565]
Christian Hammond <chipx86@chipx86.com>
parents:
8259
diff
changeset
|
446 | }; |
|
79bc4ecbcac7
[gaim-migrate @ 9565]
Christian Hammond <chipx86@chipx86.com>
parents:
8259
diff
changeset
|
447 | |
|
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
|
448 | 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
|
449 | 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
|
450 | { |
|
40534
8dad2981fb86
Separate the AccountChooser from its model and move options to filters
Gary Kramlich <grim@reaperworld.com>
parents:
40533
diff
changeset
|
451 | PidginAccountChooser *chooser = PIDGIN_ACCOUNT_CHOOSER(dialog->account_menu); |
|
8dad2981fb86
Separate the AccountChooser from its model and move options to filters
Gary Kramlich <grim@reaperworld.com>
parents:
40533
diff
changeset
|
452 | PurpleAccount *account = pidgin_account_chooser_get_selected(chooser); |
|
39223
7016ec26cd75
Move GtkPounce to Talkatu
Gary Kramlich <grim@reaperworld.com>
parents:
39176
diff
changeset
|
453 | |
|
7016ec26cd75
Move GtkPounce to Talkatu
Gary Kramlich <grim@reaperworld.com>
parents:
39176
diff
changeset
|
454 | if(GTK_IS_TEXT_BUFFER(dialog->send_msg_buffer)) { |
|
7016ec26cd75
Move GtkPounce to Talkatu
Gary Kramlich <grim@reaperworld.com>
parents:
39176
diff
changeset
|
455 | g_object_unref(dialog->send_msg_buffer); |
|
7016ec26cd75
Move GtkPounce to Talkatu
Gary Kramlich <grim@reaperworld.com>
parents:
39176
diff
changeset
|
456 | } |
|
7016ec26cd75
Move GtkPounce to Talkatu
Gary Kramlich <grim@reaperworld.com>
parents:
39176
diff
changeset
|
457 | |
|
7016ec26cd75
Move GtkPounce to Talkatu
Gary Kramlich <grim@reaperworld.com>
parents:
39176
diff
changeset
|
458 | dialog->send_msg_buffer = NULL; |
|
7016ec26cd75
Move GtkPounce to Talkatu
Gary Kramlich <grim@reaperworld.com>
parents:
39176
diff
changeset
|
459 | |
|
7016ec26cd75
Move GtkPounce to Talkatu
Gary Kramlich <grim@reaperworld.com>
parents:
39176
diff
changeset
|
460 | if(account) { |
|
7016ec26cd75
Move GtkPounce to Talkatu
Gary Kramlich <grim@reaperworld.com>
parents:
39176
diff
changeset
|
461 | PurpleConnection *pc = purple_account_get_connection(account); |
|
7016ec26cd75
Move GtkPounce to Talkatu
Gary Kramlich <grim@reaperworld.com>
parents:
39176
diff
changeset
|
462 | |
|
7016ec26cd75
Move GtkPounce to Talkatu
Gary Kramlich <grim@reaperworld.com>
parents:
39176
diff
changeset
|
463 | if(pc) { |
|
7016ec26cd75
Move GtkPounce to Talkatu
Gary Kramlich <grim@reaperworld.com>
parents:
39176
diff
changeset
|
464 | dialog->send_msg_buffer = pidgin_talkatu_buffer_new_for_connection(pc); |
|
7016ec26cd75
Move GtkPounce to Talkatu
Gary Kramlich <grim@reaperworld.com>
parents:
39176
diff
changeset
|
465 | } |
|
7016ec26cd75
Move GtkPounce to Talkatu
Gary Kramlich <grim@reaperworld.com>
parents:
39176
diff
changeset
|
466 | } |
|
7016ec26cd75
Move GtkPounce to Talkatu
Gary Kramlich <grim@reaperworld.com>
parents:
39176
diff
changeset
|
467 | |
|
7016ec26cd75
Move GtkPounce to Talkatu
Gary Kramlich <grim@reaperworld.com>
parents:
39176
diff
changeset
|
468 | if(dialog->send_msg_buffer == NULL) { |
|
7016ec26cd75
Move GtkPounce to Talkatu
Gary Kramlich <grim@reaperworld.com>
parents:
39176
diff
changeset
|
469 | dialog->send_msg_buffer = talkatu_buffer_new(NULL); |
|
7016ec26cd75
Move GtkPounce to Talkatu
Gary Kramlich <grim@reaperworld.com>
parents:
39176
diff
changeset
|
470 | } |
|
7016ec26cd75
Move GtkPounce to Talkatu
Gary Kramlich <grim@reaperworld.com>
parents:
39176
diff
changeset
|
471 | |
|
7016ec26cd75
Move GtkPounce to Talkatu
Gary Kramlich <grim@reaperworld.com>
parents:
39176
diff
changeset
|
472 | gtk_text_view_set_buffer(GTK_TEXT_VIEW(dialog->send_msg_entry), dialog->send_msg_buffer); |
|
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
|
473 | } |
|
8be39f0de528
Allow formatted text in the pounce dialog. Also, use the same code to
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16490
diff
changeset
|
474 | |
| 5032 | 475 | void |
| 20706 | 476 | pidgin_pounce_editor_show(PurpleAccount *account, const char *name, |
|
25390
02100938b030
Make dialogs that double as add and save dialogs indicate the current action
Etan Reisner <deryni@pidgin.im>
parents:
24594
diff
changeset
|
477 | PurplePounce *cur_pounce) |
| 20706 | 478 | { |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15496
diff
changeset
|
479 | PidginPounceDialog *dialog; |
| 5032 | 480 | GtkWidget *window; |
| 481 | GtkWidget *label; | |
| 482 | GtkWidget *vbox1, *vbox2; | |
| 483 | GtkWidget *hbox; | |
| 484 | GtkWidget *button; | |
| 485 | GtkWidget *frame; | |
|
36247
b6b783c2b362
Replace GtkTable with GtkGrid in Pounce window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
36098
diff
changeset
|
486 | GtkWidget *grid; |
| 5032 | 487 | GtkSizeGroup *sg; |
|
39223
7016ec26cd75
Move GtkPounce to Talkatu
Gary Kramlich <grim@reaperworld.com>
parents:
39176
diff
changeset
|
488 | GtkWidget *editor; |
|
40534
8dad2981fb86
Separate the AccountChooser from its model and move options to filters
Gary Kramlich <grim@reaperworld.com>
parents:
40533
diff
changeset
|
489 | GtkTreeModel *model; |
|
5857
52cff8a95261
[gaim-migrate @ 6288]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
490 | |
|
15058
212b71a4faf6
[gaim-migrate @ 17775]
Richard Laager <rlaager@pidgin.im>
parents:
14253
diff
changeset
|
491 | g_return_if_fail((cur_pounce != NULL) || |
|
212b71a4faf6
[gaim-migrate @ 17775]
Richard Laager <rlaager@pidgin.im>
parents:
14253
diff
changeset
|
492 | (account != NULL) || |
| 15884 | 493 | (purple_accounts_get_all() != NULL)); |
|
10352
802e7ab5b838
[gaim-migrate @ 11569]
Mark Doliner <markdoliner@pidgin.im>
parents:
10250
diff
changeset
|
494 | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15496
diff
changeset
|
495 | dialog = g_new0(PidginPounceDialog, 1); |
| 5032 | 496 | |
|
8803
79bc4ecbcac7
[gaim-migrate @ 9565]
Christian Hammond <chipx86@chipx86.com>
parents:
8259
diff
changeset
|
497 | if (cur_pounce != NULL) |
|
79bc4ecbcac7
[gaim-migrate @ 9565]
Christian Hammond <chipx86@chipx86.com>
parents:
8259
diff
changeset
|
498 | { |
| 5032 | 499 | dialog->pounce = cur_pounce; |
| 15884 | 500 | dialog->account = purple_pounce_get_pouncer(cur_pounce); |
| 5032 | 501 | } |
|
8803
79bc4ecbcac7
[gaim-migrate @ 9565]
Christian Hammond <chipx86@chipx86.com>
parents:
8259
diff
changeset
|
502 | else if (account != NULL) |
|
79bc4ecbcac7
[gaim-migrate @ 9565]
Christian Hammond <chipx86@chipx86.com>
parents:
8259
diff
changeset
|
503 | { |
| 5032 | 504 | dialog->pounce = NULL; |
|
5907
b2812113a4a6
[gaim-migrate @ 6339]
Christian Hammond <chipx86@chipx86.com>
parents:
5877
diff
changeset
|
505 | dialog->account = account; |
| 5032 | 506 | } |
|
8803
79bc4ecbcac7
[gaim-migrate @ 9565]
Christian Hammond <chipx86@chipx86.com>
parents:
8259
diff
changeset
|
507 | else |
|
79bc4ecbcac7
[gaim-migrate @ 9565]
Christian Hammond <chipx86@chipx86.com>
parents:
8259
diff
changeset
|
508 | { |
|
18122
9bf9970c1b6a
disapproval of revision '2d8ea56b90971e7851442d96b7d74ecb4f052126'
Richard Laager <rlaager@pidgin.im>
parents:
18121
diff
changeset
|
509 | GList *connections = purple_connections_get_all(); |
| 15884 | 510 | PurpleConnection *gc; |
|
8803
79bc4ecbcac7
[gaim-migrate @ 9565]
Christian Hammond <chipx86@chipx86.com>
parents:
8259
diff
changeset
|
511 | |
|
15058
212b71a4faf6
[gaim-migrate @ 17775]
Richard Laager <rlaager@pidgin.im>
parents:
14253
diff
changeset
|
512 | if (connections != NULL) |
|
212b71a4faf6
[gaim-migrate @ 17775]
Richard Laager <rlaager@pidgin.im>
parents:
14253
diff
changeset
|
513 | { |
| 15884 | 514 | gc = (PurpleConnection *)connections->data; |
| 515 | dialog->account = purple_connection_get_account(gc); | |
|
15058
212b71a4faf6
[gaim-migrate @ 17775]
Richard Laager <rlaager@pidgin.im>
parents:
14253
diff
changeset
|
516 | } |
|
212b71a4faf6
[gaim-migrate @ 17775]
Richard Laager <rlaager@pidgin.im>
parents:
14253
diff
changeset
|
517 | else |
| 15884 | 518 | dialog->account = purple_accounts_get_all()->data; |
|
8803
79bc4ecbcac7
[gaim-migrate @ 9565]
Christian Hammond <chipx86@chipx86.com>
parents:
8259
diff
changeset
|
519 | |
| 5032 | 520 | dialog->pounce = NULL; |
| 521 | } | |
| 522 | ||
| 523 | sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); | |
| 524 | ||
| 525 | /* Create the window. */ | |
|
19546
b7a8a86af65a
Use GtkDialog more often. Thanks nix_nix. Fixes #2618
Sean Egan <seanegan@pidgin.im>
parents:
18966
diff
changeset
|
526 | dialog->window = window = gtk_dialog_new(); |
|
25868
66d6c3e2963d
Use "Add Buddy Pounce" and "Modify Buddy Pounce" as the buddy pounce dialog
Etan Reisner <deryni@pidgin.im>
parents:
24594
diff
changeset
|
527 | gtk_window_set_title(GTK_WINDOW(window), (cur_pounce == NULL ? _("Add Buddy Pounce") : _("Modify Buddy Pounce"))); |
|
19546
b7a8a86af65a
Use GtkDialog more often. Thanks nix_nix. Fixes #2618
Sean Egan <seanegan@pidgin.im>
parents:
18966
diff
changeset
|
528 | gtk_window_set_role(GTK_WINDOW(window), "buddy_pounce"); |
| 5032 | 529 | |
| 530 | g_signal_connect(G_OBJECT(window), "delete_event", | |
| 531 | G_CALLBACK(delete_win_cb), dialog); | |
| 532 | ||
|
33170
ce4447562d64
Add checks for old GTK+2 stuff.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33141
diff
changeset
|
533 | /* Get the parent vbox for everything. */ |
|
32394
f883709bdba4
compiles using GTK+ 3 from git, beware it does not yet run, in fact it crashes...
Marcus Lundblad <malu@pidgin.im>
parents:
30706
diff
changeset
|
534 | vbox1 = gtk_dialog_get_content_area(GTK_DIALOG(window)); |
| 5032 | 535 | |
| 536 | /* Create the vbox that will contain all the prefs stuff. */ | |
|
40490
fb6e46c4c63c
Remove PIDGIN_HIG_* constants
Gary Kramlich <grim@reaperworld.com>
parents:
40484
diff
changeset
|
537 | vbox2 = gtk_box_new(GTK_ORIENTATION_VERTICAL, 6); |
| 5032 | 538 | gtk_box_pack_start(GTK_BOX(vbox1), vbox2, TRUE, TRUE, 0); |
| 539 | ||
| 12694 | 540 | /* Create the "Pounce on Whom" frame. */ |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15496
diff
changeset
|
541 | frame = pidgin_make_frame(vbox2, _("Pounce on Whom")); |
| 5032 | 542 | |
| 543 | /* Account: */ | |
|
40490
fb6e46c4c63c
Remove PIDGIN_HIG_* constants
Gary Kramlich <grim@reaperworld.com>
parents:
40484
diff
changeset
|
544 | hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 6); |
| 5032 | 545 | gtk_box_pack_start(GTK_BOX(frame), hbox, FALSE, FALSE, 0); |
| 546 | gtk_widget_show(hbox); | |
| 547 | ||
| 548 | label = gtk_label_new_with_mnemonic(_("_Account:")); | |
|
38007
3b971d2ecae1
Simplify gtk_label_set_[xy]align calls.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
37990
diff
changeset
|
549 | gtk_label_set_xalign(GTK_LABEL(label), 0); |
| 5032 | 550 | gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); |
| 551 | gtk_widget_show(label); | |
| 552 | gtk_size_group_add_widget(sg, label); | |
| 553 | ||
|
40534
8dad2981fb86
Separate the AccountChooser from its model and move options to filters
Gary Kramlich <grim@reaperworld.com>
parents:
40533
diff
changeset
|
554 | dialog->account_menu = pidgin_account_chooser_new(); |
|
8dad2981fb86
Separate the AccountChooser from its model and move options to filters
Gary Kramlich <grim@reaperworld.com>
parents:
40533
diff
changeset
|
555 | model = GTK_TREE_MODEL(pidgin_account_store_new()); |
|
8dad2981fb86
Separate the AccountChooser from its model and move options to filters
Gary Kramlich <grim@reaperworld.com>
parents:
40533
diff
changeset
|
556 | gtk_combo_box_set_model(GTK_COMBO_BOX(dialog->account_menu), model); |
|
8dad2981fb86
Separate the AccountChooser from its model and move options to filters
Gary Kramlich <grim@reaperworld.com>
parents:
40533
diff
changeset
|
557 | g_object_unref(G_OBJECT(model)); |
|
8dad2981fb86
Separate the AccountChooser from its model and move options to filters
Gary Kramlich <grim@reaperworld.com>
parents:
40533
diff
changeset
|
558 | pidgin_account_chooser_set_selected( |
|
8dad2981fb86
Separate the AccountChooser from its model and move options to filters
Gary Kramlich <grim@reaperworld.com>
parents:
40533
diff
changeset
|
559 | PIDGIN_ACCOUNT_CHOOSER(dialog->account_menu), dialog->account); |
|
39787
af7ae86ee287
Remove callback from account chooser constructor.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39786
diff
changeset
|
560 | g_signal_connect(dialog->account_menu, "changed", |
|
af7ae86ee287
Remove callback from account chooser constructor.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39786
diff
changeset
|
561 | G_CALLBACK(pounce_choose_cb), dialog); |
|
5877
37695b88b248
[gaim-migrate @ 6309]
Christian Hammond <chipx86@chipx86.com>
parents:
5876
diff
changeset
|
562 | |
| 5032 | 563 | gtk_box_pack_start(GTK_BOX(hbox), dialog->account_menu, FALSE, FALSE, 0); |
| 564 | gtk_widget_show(dialog->account_menu); | |
|
35721
abae078d0525
Fix some warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35527
diff
changeset
|
565 | pidgin_set_accessible_label(dialog->account_menu, GTK_LABEL(label)); |
| 5032 | 566 | |
| 567 | /* Buddy: */ | |
|
40490
fb6e46c4c63c
Remove PIDGIN_HIG_* constants
Gary Kramlich <grim@reaperworld.com>
parents:
40484
diff
changeset
|
568 | hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 6); |
| 5032 | 569 | gtk_box_pack_start(GTK_BOX(frame), hbox, FALSE, FALSE, 0); |
| 570 | gtk_widget_show(hbox); | |
| 571 | ||
|
8803
79bc4ecbcac7
[gaim-migrate @ 9565]
Christian Hammond <chipx86@chipx86.com>
parents:
8259
diff
changeset
|
572 | label = gtk_label_new_with_mnemonic(_("_Buddy name:")); |
|
38007
3b971d2ecae1
Simplify gtk_label_set_[xy]align calls.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
37990
diff
changeset
|
573 | gtk_label_set_xalign(GTK_LABEL(label), 0); |
| 5032 | 574 | gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); |
| 575 | gtk_widget_show(label); | |
| 576 | gtk_size_group_add_widget(sg, label); | |
| 577 | ||
| 578 | dialog->buddy_entry = gtk_entry_new(); | |
|
8803
79bc4ecbcac7
[gaim-migrate @ 9565]
Christian Hammond <chipx86@chipx86.com>
parents:
8259
diff
changeset
|
579 | |
|
33698
e730d1a5f058
Rename pidgin_setup_screenname_autocomplete_with_filter to pidgin_setup_screenname_autocomplete.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33375
diff
changeset
|
580 | pidgin_setup_screenname_autocomplete(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
|
581 | |
| 5032 | 582 | gtk_box_pack_start(GTK_BOX(hbox), dialog->buddy_entry, TRUE, TRUE, 0); |
| 583 | gtk_widget_show(dialog->buddy_entry); | |
| 584 | ||
|
5876
c12b198bde14
[gaim-migrate @ 6308]
Christian Hammond <chipx86@chipx86.com>
parents:
5875
diff
changeset
|
585 | g_signal_connect(G_OBJECT(dialog->buddy_entry), "changed", |
|
c12b198bde14
[gaim-migrate @ 6308]
Christian Hammond <chipx86@chipx86.com>
parents:
5875
diff
changeset
|
586 | G_CALLBACK(buddy_changed_cb), dialog); |
|
35721
abae078d0525
Fix some warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35527
diff
changeset
|
587 | pidgin_set_accessible_label(dialog->buddy_entry, GTK_LABEL(label)); |
|
5876
c12b198bde14
[gaim-migrate @ 6308]
Christian Hammond <chipx86@chipx86.com>
parents:
5875
diff
changeset
|
588 | |
| 5032 | 589 | if (cur_pounce != NULL) { |
| 590 | gtk_entry_set_text(GTK_ENTRY(dialog->buddy_entry), | |
| 15884 | 591 | purple_pounce_get_pouncee(cur_pounce)); |
| 5032 | 592 | } |
|
5907
b2812113a4a6
[gaim-migrate @ 6339]
Christian Hammond <chipx86@chipx86.com>
parents:
5877
diff
changeset
|
593 | else if (name != NULL) { |
|
b2812113a4a6
[gaim-migrate @ 6339]
Christian Hammond <chipx86@chipx86.com>
parents:
5877
diff
changeset
|
594 | gtk_entry_set_text(GTK_ENTRY(dialog->buddy_entry), name); |
| 5032 | 595 | } |
| 596 | ||
| 12694 | 597 | /* Create the "Pounce When Buddy..." frame. */ |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15496
diff
changeset
|
598 | frame = pidgin_make_frame(vbox2, _("Pounce When Buddy...")); |
| 5032 | 599 | |
|
37989
018063ec9d2e
Remove backwards-compatibility with GTK+2.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
37422
diff
changeset
|
600 | grid = gtk_grid_new(); |
|
36247
b6b783c2b362
Replace GtkTable with GtkGrid in Pounce window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
36098
diff
changeset
|
601 | gtk_container_add(GTK_CONTAINER(frame), grid); |
|
40490
fb6e46c4c63c
Remove PIDGIN_HIG_* constants
Gary Kramlich <grim@reaperworld.com>
parents:
40484
diff
changeset
|
602 | gtk_grid_set_column_spacing(GTK_GRID(grid), 12); |
|
36247
b6b783c2b362
Replace GtkTable with GtkGrid in Pounce window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
36098
diff
changeset
|
603 | gtk_widget_show(grid); |
| 5032 | 604 | |
| 605 | dialog->signon = | |
|
12141
9cd436b9b7f6
[gaim-migrate @ 14442]
Richard Laager <rlaager@pidgin.im>
parents:
12137
diff
changeset
|
606 | gtk_check_button_new_with_mnemonic(_("Si_gns on")); |
| 5032 | 607 | dialog->signoff = |
|
12142
45aba96df80d
[gaim-migrate @ 14443]
Richard Laager <rlaager@pidgin.im>
parents:
12141
diff
changeset
|
608 | gtk_check_button_new_with_mnemonic(_("Signs o_ff")); |
| 5032 | 609 | dialog->away = |
|
12141
9cd436b9b7f6
[gaim-migrate @ 14442]
Richard Laager <rlaager@pidgin.im>
parents:
12137
diff
changeset
|
610 | gtk_check_button_new_with_mnemonic(_("Goes a_way")); |
| 5032 | 611 | dialog->away_return = |
|
12144
a24ccdee060b
[gaim-migrate @ 14445]
Richard Laager <rlaager@pidgin.im>
parents:
12142
diff
changeset
|
612 | gtk_check_button_new_with_mnemonic(_("Ret_urns from away")); |
| 5032 | 613 | dialog->idle = |
|
12192
36b7b33aa956
[gaim-migrate @ 14494]
Richard Laager <rlaager@pidgin.im>
parents:
12186
diff
changeset
|
614 | gtk_check_button_new_with_mnemonic(_("Becomes _idle")); |
| 5032 | 615 | dialog->idle_return = |
|
12192
36b7b33aa956
[gaim-migrate @ 14494]
Richard Laager <rlaager@pidgin.im>
parents:
12186
diff
changeset
|
616 | gtk_check_button_new_with_mnemonic(_("Is no longer i_dle")); |
| 5032 | 617 | dialog->typing = |
|
12141
9cd436b9b7f6
[gaim-migrate @ 14442]
Richard Laager <rlaager@pidgin.im>
parents:
12137
diff
changeset
|
618 | gtk_check_button_new_with_mnemonic(_("Starts _typing")); |
|
13844
835b8f7b3d1d
[gaim-migrate @ 16295]
Mark Doliner <markdoliner@pidgin.im>
parents:
13775
diff
changeset
|
619 | dialog->typed = |
|
835b8f7b3d1d
[gaim-migrate @ 16295]
Mark Doliner <markdoliner@pidgin.im>
parents:
13775
diff
changeset
|
620 | gtk_check_button_new_with_mnemonic(_("P_auses while typing")); |
| 5032 | 621 | dialog->stop_typing = |
|
12141
9cd436b9b7f6
[gaim-migrate @ 14442]
Richard Laager <rlaager@pidgin.im>
parents:
12137
diff
changeset
|
622 | gtk_check_button_new_with_mnemonic(_("Stops t_yping")); |
| 12694 | 623 | dialog->message_recv = |
| 624 | gtk_check_button_new_with_mnemonic(_("Sends a _message")); | |
| 5032 | 625 | |
|
37989
018063ec9d2e
Remove backwards-compatibility with GTK+2.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
37422
diff
changeset
|
626 | gtk_widget_set_valign(dialog->message_recv, GTK_ALIGN_CENTER); |
|
018063ec9d2e
Remove backwards-compatibility with GTK+2.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
37422
diff
changeset
|
627 | gtk_widget_set_valign(dialog->signon, GTK_ALIGN_CENTER); |
|
018063ec9d2e
Remove backwards-compatibility with GTK+2.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
37422
diff
changeset
|
628 | gtk_widget_set_valign(dialog->signoff, GTK_ALIGN_CENTER); |
|
018063ec9d2e
Remove backwards-compatibility with GTK+2.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
37422
diff
changeset
|
629 | gtk_widget_set_valign(dialog->away, GTK_ALIGN_CENTER); |
|
018063ec9d2e
Remove backwards-compatibility with GTK+2.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
37422
diff
changeset
|
630 | gtk_widget_set_valign(dialog->away_return, GTK_ALIGN_CENTER); |
|
018063ec9d2e
Remove backwards-compatibility with GTK+2.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
37422
diff
changeset
|
631 | gtk_widget_set_valign(dialog->idle, GTK_ALIGN_CENTER); |
|
018063ec9d2e
Remove backwards-compatibility with GTK+2.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
37422
diff
changeset
|
632 | gtk_widget_set_valign(dialog->idle_return, GTK_ALIGN_CENTER); |
|
018063ec9d2e
Remove backwards-compatibility with GTK+2.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
37422
diff
changeset
|
633 | gtk_widget_set_valign(dialog->typing, GTK_ALIGN_CENTER); |
|
018063ec9d2e
Remove backwards-compatibility with GTK+2.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
37422
diff
changeset
|
634 | gtk_widget_set_valign(dialog->typed, GTK_ALIGN_CENTER); |
|
018063ec9d2e
Remove backwards-compatibility with GTK+2.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
37422
diff
changeset
|
635 | gtk_widget_set_valign(dialog->stop_typing, GTK_ALIGN_CENTER); |
|
018063ec9d2e
Remove backwards-compatibility with GTK+2.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
37422
diff
changeset
|
636 | |
|
018063ec9d2e
Remove backwards-compatibility with GTK+2.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
37422
diff
changeset
|
637 | gtk_grid_attach(GTK_GRID(grid), dialog->message_recv, 0, 0, 1, 1); |
|
018063ec9d2e
Remove backwards-compatibility with GTK+2.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
37422
diff
changeset
|
638 | gtk_grid_attach(GTK_GRID(grid), dialog->signon, 0, 1, 1, 1); |
|
018063ec9d2e
Remove backwards-compatibility with GTK+2.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
37422
diff
changeset
|
639 | gtk_grid_attach(GTK_GRID(grid), dialog->signoff, 0, 2, 1, 1); |
|
018063ec9d2e
Remove backwards-compatibility with GTK+2.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
37422
diff
changeset
|
640 | gtk_grid_attach(GTK_GRID(grid), dialog->away, 1, 0, 1, 1); |
|
018063ec9d2e
Remove backwards-compatibility with GTK+2.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
37422
diff
changeset
|
641 | gtk_grid_attach(GTK_GRID(grid), dialog->away_return, 1, 1, 1, 1); |
|
018063ec9d2e
Remove backwards-compatibility with GTK+2.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
37422
diff
changeset
|
642 | gtk_grid_attach(GTK_GRID(grid), dialog->idle, 1, 2, 1, 1); |
|
018063ec9d2e
Remove backwards-compatibility with GTK+2.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
37422
diff
changeset
|
643 | gtk_grid_attach(GTK_GRID(grid), dialog->idle_return, 2, 0, 1, 1); |
|
018063ec9d2e
Remove backwards-compatibility with GTK+2.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
37422
diff
changeset
|
644 | gtk_grid_attach(GTK_GRID(grid), dialog->typing, 2, 1, 1, 1); |
|
018063ec9d2e
Remove backwards-compatibility with GTK+2.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
37422
diff
changeset
|
645 | gtk_grid_attach(GTK_GRID(grid), dialog->typed, 2, 2, 1, 1); |
|
018063ec9d2e
Remove backwards-compatibility with GTK+2.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
37422
diff
changeset
|
646 | gtk_grid_attach(GTK_GRID(grid), dialog->stop_typing, 3, 0, 1, 1); |
| 5032 | 647 | |
| 648 | gtk_widget_show(dialog->signon); | |
| 649 | gtk_widget_show(dialog->signoff); | |
| 650 | gtk_widget_show(dialog->away); | |
| 651 | gtk_widget_show(dialog->away_return); | |
| 652 | gtk_widget_show(dialog->idle); | |
| 653 | gtk_widget_show(dialog->idle_return); | |
| 654 | gtk_widget_show(dialog->typing); | |
|
13844
835b8f7b3d1d
[gaim-migrate @ 16295]
Mark Doliner <markdoliner@pidgin.im>
parents:
13775
diff
changeset
|
655 | gtk_widget_show(dialog->typed); |
| 5032 | 656 | gtk_widget_show(dialog->stop_typing); |
| 12694 | 657 | gtk_widget_show(dialog->message_recv); |
| 5032 | 658 | |
| 12694 | 659 | /* Create the "Action" frame. */ |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15496
diff
changeset
|
660 | frame = pidgin_make_frame(vbox2, _("Action")); |
| 5032 | 661 | |
|
37989
018063ec9d2e
Remove backwards-compatibility with GTK+2.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
37422
diff
changeset
|
662 | grid = gtk_grid_new(); |
|
36247
b6b783c2b362
Replace GtkTable with GtkGrid in Pounce window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
36098
diff
changeset
|
663 | gtk_container_add(GTK_CONTAINER(frame), grid); |
|
40490
fb6e46c4c63c
Remove PIDGIN_HIG_* constants
Gary Kramlich <grim@reaperworld.com>
parents:
40484
diff
changeset
|
664 | gtk_grid_set_column_spacing(GTK_GRID(grid), 12); |
|
36247
b6b783c2b362
Replace GtkTable with GtkGrid in Pounce window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
36098
diff
changeset
|
665 | gtk_widget_show(grid); |
| 5032 | 666 | |
|
9205
8c4dbbe6386f
[gaim-migrate @ 10000]
Christian Hammond <chipx86@chipx86.com>
parents:
9191
diff
changeset
|
667 | dialog->open_win |
|
12192
36b7b33aa956
[gaim-migrate @ 14494]
Richard Laager <rlaager@pidgin.im>
parents:
12186
diff
changeset
|
668 | = 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
|
669 | dialog->popup |
|
12141
9cd436b9b7f6
[gaim-migrate @ 14442]
Richard Laager <rlaager@pidgin.im>
parents:
12137
diff
changeset
|
670 | = gtk_check_button_new_with_mnemonic(_("_Pop up a notification")); |
|
9205
8c4dbbe6386f
[gaim-migrate @ 10000]
Christian Hammond <chipx86@chipx86.com>
parents:
9191
diff
changeset
|
671 | dialog->send_msg |
|
8c4dbbe6386f
[gaim-migrate @ 10000]
Christian Hammond <chipx86@chipx86.com>
parents:
9191
diff
changeset
|
672 | = gtk_check_button_new_with_mnemonic(_("Send a _message")); |
|
8c4dbbe6386f
[gaim-migrate @ 10000]
Christian Hammond <chipx86@chipx86.com>
parents:
9191
diff
changeset
|
673 | dialog->exec_cmd |
|
8c4dbbe6386f
[gaim-migrate @ 10000]
Christian Hammond <chipx86@chipx86.com>
parents:
9191
diff
changeset
|
674 | = gtk_check_button_new_with_mnemonic(_("E_xecute a command")); |
|
7035
76bca80cd91d
[gaim-migrate @ 7598]
Christian Hammond <chipx86@chipx86.com>
parents:
6982
diff
changeset
|
675 | |
|
39223
7016ec26cd75
Move GtkPounce to Talkatu
Gary Kramlich <grim@reaperworld.com>
parents:
39176
diff
changeset
|
676 | editor = talkatu_editor_new(); |
|
40484
7df95db772d8
Update a a few things that were changed in talkatu
Gary Kramlich <grim@reaperworld.com>
parents:
40439
diff
changeset
|
677 | dialog->send_msg_entry = talkatu_editor_get_input(TALKATU_EDITOR(editor)); |
|
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
|
678 | reset_send_msg_entry(dialog, NULL); |
|
39223
7016ec26cd75
Move GtkPounce to Talkatu
Gary Kramlich <grim@reaperworld.com>
parents:
39176
diff
changeset
|
679 | |
|
9205
8c4dbbe6386f
[gaim-migrate @ 10000]
Christian Hammond <chipx86@chipx86.com>
parents:
9191
diff
changeset
|
680 | dialog->exec_cmd_entry = gtk_entry_new(); |
| 12934 | 681 | dialog->popup_entry = gtk_entry_new(); |
|
12192
36b7b33aa956
[gaim-migrate @ 14494]
Richard Laager <rlaager@pidgin.im>
parents:
12186
diff
changeset
|
682 | dialog->exec_cmd_browse = gtk_button_new_with_mnemonic(_("Brows_e...")); |
|
7035
76bca80cd91d
[gaim-migrate @ 7598]
Christian Hammond <chipx86@chipx86.com>
parents:
6982
diff
changeset
|
683 | |
|
39223
7016ec26cd75
Move GtkPounce to Talkatu
Gary Kramlich <grim@reaperworld.com>
parents:
39176
diff
changeset
|
684 | gtk_widget_set_sensitive(editor, FALSE); |
| 12694 | 685 | gtk_widget_set_sensitive(dialog->exec_cmd_entry, FALSE); |
| 12934 | 686 | gtk_widget_set_sensitive(dialog->popup_entry, FALSE); |
| 12694 | 687 | gtk_widget_set_sensitive(dialog->exec_cmd_browse, FALSE); |
| 688 | ||
|
20289
5c844288fbec
applied changes from 32f31e981f0618a4167aa98bcc22c2dab13d1550
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
20168
diff
changeset
|
689 | g_object_unref(sg); |
|
5c844288fbec
applied changes from 32f31e981f0618a4167aa98bcc22c2dab13d1550
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
20168
diff
changeset
|
690 | |
| 12694 | 691 | sg = gtk_size_group_new(GTK_SIZE_GROUP_VERTICAL); |
| 692 | gtk_size_group_add_widget(sg, dialog->open_win); | |
| 693 | gtk_size_group_add_widget(sg, dialog->popup); | |
| 12934 | 694 | gtk_size_group_add_widget(sg, dialog->popup_entry); |
| 12694 | 695 | gtk_size_group_add_widget(sg, dialog->exec_cmd); |
| 696 | gtk_size_group_add_widget(sg, dialog->exec_cmd_entry); | |
| 697 | gtk_size_group_add_widget(sg, dialog->exec_cmd_browse); | |
| 5032 | 698 | |
|
20289
5c844288fbec
applied changes from 32f31e981f0618a4167aa98bcc22c2dab13d1550
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
20168
diff
changeset
|
699 | g_object_unref(sg); |
|
5c844288fbec
applied changes from 32f31e981f0618a4167aa98bcc22c2dab13d1550
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
20168
diff
changeset
|
700 | sg = NULL; |
|
5c844288fbec
applied changes from 32f31e981f0618a4167aa98bcc22c2dab13d1550
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
20168
diff
changeset
|
701 | |
|
37989
018063ec9d2e
Remove backwards-compatibility with GTK+2.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
37422
diff
changeset
|
702 | gtk_widget_set_valign(dialog->open_win, GTK_ALIGN_CENTER); |
|
018063ec9d2e
Remove backwards-compatibility with GTK+2.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
37422
diff
changeset
|
703 | gtk_widget_set_valign(dialog->popup, GTK_ALIGN_CENTER); |
|
018063ec9d2e
Remove backwards-compatibility with GTK+2.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
37422
diff
changeset
|
704 | gtk_widget_set_valign(dialog->popup_entry, GTK_ALIGN_CENTER); |
|
018063ec9d2e
Remove backwards-compatibility with GTK+2.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
37422
diff
changeset
|
705 | gtk_widget_set_valign(dialog->send_msg, GTK_ALIGN_CENTER); |
|
39223
7016ec26cd75
Move GtkPounce to Talkatu
Gary Kramlich <grim@reaperworld.com>
parents:
39176
diff
changeset
|
706 | gtk_widget_set_valign(editor, GTK_ALIGN_CENTER); |
|
37989
018063ec9d2e
Remove backwards-compatibility with GTK+2.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
37422
diff
changeset
|
707 | gtk_widget_set_valign(dialog->exec_cmd, GTK_ALIGN_CENTER); |
|
018063ec9d2e
Remove backwards-compatibility with GTK+2.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
37422
diff
changeset
|
708 | gtk_widget_set_valign(dialog->exec_cmd_entry, GTK_ALIGN_CENTER); |
|
018063ec9d2e
Remove backwards-compatibility with GTK+2.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
37422
diff
changeset
|
709 | gtk_widget_set_hexpand(dialog->exec_cmd_browse, TRUE); |
|
018063ec9d2e
Remove backwards-compatibility with GTK+2.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
37422
diff
changeset
|
710 | gtk_widget_set_valign(dialog->exec_cmd_browse, GTK_ALIGN_CENTER); |
| 5032 | 711 | |
|
37989
018063ec9d2e
Remove backwards-compatibility with GTK+2.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
37422
diff
changeset
|
712 | gtk_grid_attach(GTK_GRID(grid), dialog->open_win, 0, 0, 1, 1); |
|
018063ec9d2e
Remove backwards-compatibility with GTK+2.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
37422
diff
changeset
|
713 | gtk_grid_attach(GTK_GRID(grid), dialog->popup, 0, 1, 1, 1); |
|
018063ec9d2e
Remove backwards-compatibility with GTK+2.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
37422
diff
changeset
|
714 | gtk_grid_attach(GTK_GRID(grid), dialog->popup_entry, 1, 1, 4, 1); |
|
018063ec9d2e
Remove backwards-compatibility with GTK+2.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
37422
diff
changeset
|
715 | gtk_grid_attach(GTK_GRID(grid), dialog->send_msg, 0, 2, 5, 1); |
|
39223
7016ec26cd75
Move GtkPounce to Talkatu
Gary Kramlich <grim@reaperworld.com>
parents:
39176
diff
changeset
|
716 | gtk_grid_attach(GTK_GRID(grid), editor, 0, 3, 5, 1); |
|
37989
018063ec9d2e
Remove backwards-compatibility with GTK+2.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
37422
diff
changeset
|
717 | gtk_grid_attach(GTK_GRID(grid), dialog->exec_cmd, 0, 4, 1, 1); |
|
018063ec9d2e
Remove backwards-compatibility with GTK+2.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
37422
diff
changeset
|
718 | gtk_grid_attach(GTK_GRID(grid), dialog->exec_cmd_entry, 1, 4, 1, 1); |
|
018063ec9d2e
Remove backwards-compatibility with GTK+2.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
37422
diff
changeset
|
719 | gtk_grid_attach(GTK_GRID(grid), dialog->exec_cmd_browse, 2, 4, 1, 1); |
| 5032 | 720 | |
|
40490
fb6e46c4c63c
Remove PIDGIN_HIG_* constants
Gary Kramlich <grim@reaperworld.com>
parents:
40484
diff
changeset
|
721 | gtk_grid_set_row_spacing(GTK_GRID(grid), 3); |
| 12694 | 722 | |
| 5032 | 723 | gtk_widget_show(dialog->open_win); |
| 724 | gtk_widget_show(dialog->popup); | |
| 12934 | 725 | gtk_widget_show(dialog->popup_entry); |
| 5032 | 726 | gtk_widget_show(dialog->send_msg); |
|
39223
7016ec26cd75
Move GtkPounce to Talkatu
Gary Kramlich <grim@reaperworld.com>
parents:
39176
diff
changeset
|
727 | gtk_widget_show(editor); |
| 5032 | 728 | gtk_widget_show(dialog->exec_cmd); |
| 729 | gtk_widget_show(dialog->exec_cmd_entry); | |
| 5319 | 730 | gtk_widget_show(dialog->exec_cmd_browse); |
| 5032 | 731 | |
| 12694 | 732 | g_signal_connect(G_OBJECT(dialog->message_recv), "clicked", |
| 733 | G_CALLBACK(message_recv_toggle), | |
| 734 | dialog->send_msg); | |
| 735 | ||
|
39173
7adf95ad7b4a
Replace pidgin_toggle_sensitive by g_object_bind_property.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
38712
diff
changeset
|
736 | g_object_bind_property(dialog->send_msg, "active", |
|
39223
7016ec26cd75
Move GtkPounce to Talkatu
Gary Kramlich <grim@reaperworld.com>
parents:
39176
diff
changeset
|
737 | editor, "sensitive", |
|
39176
5e0c89a7612b
Use G_BINDING_DEFAULT when no binding options needed.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
39174
diff
changeset
|
738 | G_BINDING_DEFAULT); |
| 5319 | 739 | |
|
39173
7adf95ad7b4a
Replace pidgin_toggle_sensitive by g_object_bind_property.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
38712
diff
changeset
|
740 | g_object_bind_property(dialog->popup, "active", |
|
7adf95ad7b4a
Replace pidgin_toggle_sensitive by g_object_bind_property.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
38712
diff
changeset
|
741 | dialog->popup_entry, "sensitive", |
|
39176
5e0c89a7612b
Use G_BINDING_DEFAULT when no binding options needed.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
39174
diff
changeset
|
742 | G_BINDING_DEFAULT); |
| 12934 | 743 | |
|
39174
9ebbe6363809
Replace pidgin_toggle_sensitive_array as before.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
39173
diff
changeset
|
744 | g_object_bind_property(dialog->exec_cmd, "active", |
|
9ebbe6363809
Replace pidgin_toggle_sensitive_array as before.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
39173
diff
changeset
|
745 | dialog->exec_cmd_entry, "sensitive", |
|
39176
5e0c89a7612b
Use G_BINDING_DEFAULT when no binding options needed.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
39174
diff
changeset
|
746 | G_BINDING_DEFAULT); |
|
39174
9ebbe6363809
Replace pidgin_toggle_sensitive_array as before.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
39173
diff
changeset
|
747 | g_object_bind_property(dialog->exec_cmd, "active", |
|
9ebbe6363809
Replace pidgin_toggle_sensitive_array as before.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
39173
diff
changeset
|
748 | dialog->exec_cmd_browse, "sensitive", |
|
39176
5e0c89a7612b
Use G_BINDING_DEFAULT when no binding options needed.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
39174
diff
changeset
|
749 | G_BINDING_DEFAULT); |
| 5319 | 750 | g_signal_connect(G_OBJECT(dialog->exec_cmd_browse), "clicked", |
|
5857
52cff8a95261
[gaim-migrate @ 6288]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
751 | G_CALLBACK(filesel), |
| 5032 | 752 | dialog->exec_cmd_entry); |
| 5319 | 753 | |
|
33194
e5258008e4d7
Convert pounce dialog to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33170
diff
changeset
|
754 | g_signal_connect_swapped(G_OBJECT(dialog->send_msg_entry), "format-cleared", |
|
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
|
755 | 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
|
756 | 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
|
757 | 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
|
758 | |
|
33194
e5258008e4d7
Convert pounce dialog to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33170
diff
changeset
|
759 | g_signal_connect(G_OBJECT(dialog->send_msg_entry), "key-press-event", |
|
e5258008e4d7
Convert pounce dialog to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33170
diff
changeset
|
760 | G_CALLBACK(entry_key_press_cb), dialog); |
| 12934 | 761 | g_signal_connect(G_OBJECT(dialog->popup_entry), "activate", |
| 762 | G_CALLBACK(save_pounce_cb), dialog); | |
| 5032 | 763 | g_signal_connect(G_OBJECT(dialog->exec_cmd_entry), "activate", |
| 764 | G_CALLBACK(save_pounce_cb), dialog); | |
|
7035
76bca80cd91d
[gaim-migrate @ 7598]
Christian Hammond <chipx86@chipx86.com>
parents:
6982
diff
changeset
|
765 | |
| 12694 | 766 | /* Create the "Options" frame. */ |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15496
diff
changeset
|
767 | frame = pidgin_make_frame(vbox2, _("Options")); |
| 12694 | 768 | |
|
37989
018063ec9d2e
Remove backwards-compatibility with GTK+2.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
37422
diff
changeset
|
769 | grid = gtk_grid_new(); |
|
36247
b6b783c2b362
Replace GtkTable with GtkGrid in Pounce window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
36098
diff
changeset
|
770 | gtk_container_add(GTK_CONTAINER(frame), grid); |
|
40490
fb6e46c4c63c
Remove PIDGIN_HIG_* constants
Gary Kramlich <grim@reaperworld.com>
parents:
40484
diff
changeset
|
771 | gtk_grid_set_column_spacing(GTK_GRID(grid), 12); |
|
36247
b6b783c2b362
Replace GtkTable with GtkGrid in Pounce window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
36098
diff
changeset
|
772 | gtk_widget_show(grid); |
| 12694 | 773 | |
| 774 | 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
|
775 | gtk_check_button_new_with_mnemonic(_("P_ounce only when my status is not Available")); |
|
37989
018063ec9d2e
Remove backwards-compatibility with GTK+2.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
37422
diff
changeset
|
776 | gtk_widget_set_valign(dialog->on_away, GTK_ALIGN_CENTER); |
|
018063ec9d2e
Remove backwards-compatibility with GTK+2.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
37422
diff
changeset
|
777 | gtk_grid_attach(GTK_GRID(grid), dialog->on_away, 0, 0, 1, 1); |
| 12694 | 778 | |
| 5032 | 779 | dialog->save_pounce = gtk_check_button_new_with_mnemonic( |
|
12186
fddd08d58f3b
[gaim-migrate @ 14488]
Mark Doliner <markdoliner@pidgin.im>
parents:
12144
diff
changeset
|
780 | _("_Recurring")); |
|
37989
018063ec9d2e
Remove backwards-compatibility with GTK+2.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
37422
diff
changeset
|
781 | gtk_widget_set_valign(dialog->save_pounce, GTK_ALIGN_CENTER); |
|
018063ec9d2e
Remove backwards-compatibility with GTK+2.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
37422
diff
changeset
|
782 | gtk_grid_attach(GTK_GRID(grid), dialog->save_pounce, 0, 1, 1, 1); |
| 5032 | 783 | |
| 12694 | 784 | gtk_widget_show(dialog->on_away); |
| 785 | gtk_widget_show(dialog->save_pounce); | |
| 5032 | 786 | |
| 787 | /* Cancel button */ | |
|
19546
b7a8a86af65a
Use GtkDialog more often. Thanks nix_nix. Fixes #2618
Sean Egan <seanegan@pidgin.im>
parents:
18966
diff
changeset
|
788 | button = gtk_dialog_add_button(GTK_DIALOG(window), GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL); |
| 5032 | 789 | g_signal_connect(G_OBJECT(button), "clicked", |
| 790 | G_CALLBACK(cancel_cb), dialog); | |
| 791 | ||
|
25390
02100938b030
Make dialogs that double as add and save dialogs indicate the current action
Etan Reisner <deryni@pidgin.im>
parents:
24594
diff
changeset
|
792 | /* Save/Add button */ |
|
02100938b030
Make dialogs that double as add and save dialogs indicate the current action
Etan Reisner <deryni@pidgin.im>
parents:
24594
diff
changeset
|
793 | dialog->save_button = button = gtk_dialog_add_button(GTK_DIALOG(window), |
|
02100938b030
Make dialogs that double as add and save dialogs indicate the current action
Etan Reisner <deryni@pidgin.im>
parents:
24594
diff
changeset
|
794 | (cur_pounce == NULL ? GTK_STOCK_ADD : GTK_STOCK_SAVE), |
|
02100938b030
Make dialogs that double as add and save dialogs indicate the current action
Etan Reisner <deryni@pidgin.im>
parents:
24594
diff
changeset
|
795 | GTK_RESPONSE_OK); |
| 5032 | 796 | g_signal_connect(G_OBJECT(button), "clicked", |
|
25390
02100938b030
Make dialogs that double as add and save dialogs indicate the current action
Etan Reisner <deryni@pidgin.im>
parents:
24594
diff
changeset
|
797 | G_CALLBACK(save_pounce_cb), dialog); |
| 5032 | 798 | |
|
5876
c12b198bde14
[gaim-migrate @ 6308]
Christian Hammond <chipx86@chipx86.com>
parents:
5875
diff
changeset
|
799 | if (*gtk_entry_get_text(GTK_ENTRY(dialog->buddy_entry)) == '\0') |
|
c12b198bde14
[gaim-migrate @ 6308]
Christian Hammond <chipx86@chipx86.com>
parents:
5875
diff
changeset
|
800 | gtk_widget_set_sensitive(button, FALSE); |
|
c12b198bde14
[gaim-migrate @ 6308]
Christian Hammond <chipx86@chipx86.com>
parents:
5875
diff
changeset
|
801 | |
|
8803
79bc4ecbcac7
[gaim-migrate @ 9565]
Christian Hammond <chipx86@chipx86.com>
parents:
8259
diff
changeset
|
802 | /* Setup drag-and-drop */ |
|
79bc4ecbcac7
[gaim-migrate @ 9565]
Christian Hammond <chipx86@chipx86.com>
parents:
8259
diff
changeset
|
803 | gtk_drag_dest_set(window, |
|
79bc4ecbcac7
[gaim-migrate @ 9565]
Christian Hammond <chipx86@chipx86.com>
parents:
8259
diff
changeset
|
804 | GTK_DEST_DEFAULT_MOTION | |
|
79bc4ecbcac7
[gaim-migrate @ 9565]
Christian Hammond <chipx86@chipx86.com>
parents:
8259
diff
changeset
|
805 | GTK_DEST_DEFAULT_DROP, |
|
79bc4ecbcac7
[gaim-migrate @ 9565]
Christian Hammond <chipx86@chipx86.com>
parents:
8259
diff
changeset
|
806 | dnd_targets, |
|
79bc4ecbcac7
[gaim-migrate @ 9565]
Christian Hammond <chipx86@chipx86.com>
parents:
8259
diff
changeset
|
807 | sizeof(dnd_targets) / sizeof(GtkTargetEntry), |
|
79bc4ecbcac7
[gaim-migrate @ 9565]
Christian Hammond <chipx86@chipx86.com>
parents:
8259
diff
changeset
|
808 | GDK_ACTION_COPY); |
|
79bc4ecbcac7
[gaim-migrate @ 9565]
Christian Hammond <chipx86@chipx86.com>
parents:
8259
diff
changeset
|
809 | gtk_drag_dest_set(dialog->buddy_entry, |
|
79bc4ecbcac7
[gaim-migrate @ 9565]
Christian Hammond <chipx86@chipx86.com>
parents:
8259
diff
changeset
|
810 | GTK_DEST_DEFAULT_MOTION | |
|
79bc4ecbcac7
[gaim-migrate @ 9565]
Christian Hammond <chipx86@chipx86.com>
parents:
8259
diff
changeset
|
811 | GTK_DEST_DEFAULT_DROP, |
|
79bc4ecbcac7
[gaim-migrate @ 9565]
Christian Hammond <chipx86@chipx86.com>
parents:
8259
diff
changeset
|
812 | dnd_targets, |
|
79bc4ecbcac7
[gaim-migrate @ 9565]
Christian Hammond <chipx86@chipx86.com>
parents:
8259
diff
changeset
|
813 | sizeof(dnd_targets) / sizeof(GtkTargetEntry), |
|
79bc4ecbcac7
[gaim-migrate @ 9565]
Christian Hammond <chipx86@chipx86.com>
parents:
8259
diff
changeset
|
814 | GDK_ACTION_COPY); |
|
79bc4ecbcac7
[gaim-migrate @ 9565]
Christian Hammond <chipx86@chipx86.com>
parents:
8259
diff
changeset
|
815 | |
|
79bc4ecbcac7
[gaim-migrate @ 9565]
Christian Hammond <chipx86@chipx86.com>
parents:
8259
diff
changeset
|
816 | g_signal_connect(G_OBJECT(window), "drag_data_received", |
|
79bc4ecbcac7
[gaim-migrate @ 9565]
Christian Hammond <chipx86@chipx86.com>
parents:
8259
diff
changeset
|
817 | G_CALLBACK(pounce_dnd_recv), dialog); |
|
79bc4ecbcac7
[gaim-migrate @ 9565]
Christian Hammond <chipx86@chipx86.com>
parents:
8259
diff
changeset
|
818 | g_signal_connect(G_OBJECT(dialog->buddy_entry), "drag_data_received", |
|
79bc4ecbcac7
[gaim-migrate @ 9565]
Christian Hammond <chipx86@chipx86.com>
parents:
8259
diff
changeset
|
819 | G_CALLBACK(pounce_dnd_recv), dialog); |
|
79bc4ecbcac7
[gaim-migrate @ 9565]
Christian Hammond <chipx86@chipx86.com>
parents:
8259
diff
changeset
|
820 | |
| 5032 | 821 | /* Set the values of stuff. */ |
|
9205
8c4dbbe6386f
[gaim-migrate @ 10000]
Christian Hammond <chipx86@chipx86.com>
parents:
9191
diff
changeset
|
822 | if (cur_pounce != NULL) |
|
8c4dbbe6386f
[gaim-migrate @ 10000]
Christian Hammond <chipx86@chipx86.com>
parents:
9191
diff
changeset
|
823 | { |
| 15884 | 824 | PurplePounceEvent events = purple_pounce_get_events(cur_pounce); |
| 825 | PurplePounceOption options = purple_pounce_get_options(cur_pounce); | |
|
5864
86822afeeab0
[gaim-migrate @ 6295]
Christian Hammond <chipx86@chipx86.com>
parents:
5857
diff
changeset
|
826 | const char *value; |
| 5032 | 827 | |
| 12694 | 828 | /* Options */ |
| 829 | gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(dialog->on_away), | |
| 15884 | 830 | (options & PURPLE_POUNCE_OPTION_AWAY)); |
| 12694 | 831 | |
|
5864
86822afeeab0
[gaim-migrate @ 6295]
Christian Hammond <chipx86@chipx86.com>
parents:
5857
diff
changeset
|
832 | /* Events */ |
| 5032 | 833 | gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(dialog->signon), |
| 15884 | 834 | (events & PURPLE_POUNCE_SIGNON)); |
| 5032 | 835 | gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(dialog->signoff), |
| 15884 | 836 | (events & PURPLE_POUNCE_SIGNOFF)); |
| 5032 | 837 | gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(dialog->away), |
| 15884 | 838 | (events & PURPLE_POUNCE_AWAY)); |
| 5032 | 839 | gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(dialog->away_return), |
| 15884 | 840 | (events & PURPLE_POUNCE_AWAY_RETURN)); |
| 5032 | 841 | gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(dialog->idle), |
| 15884 | 842 | (events & PURPLE_POUNCE_IDLE)); |
| 5032 | 843 | gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(dialog->idle_return), |
| 15884 | 844 | (events & PURPLE_POUNCE_IDLE_RETURN)); |
| 5032 | 845 | gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(dialog->typing), |
| 15884 | 846 | (events & PURPLE_POUNCE_TYPING)); |
|
13844
835b8f7b3d1d
[gaim-migrate @ 16295]
Mark Doliner <markdoliner@pidgin.im>
parents:
13775
diff
changeset
|
847 | gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(dialog->typed), |
| 15884 | 848 | (events & PURPLE_POUNCE_TYPED)); |
| 5032 | 849 | gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(dialog->stop_typing), |
| 15884 | 850 | (events & PURPLE_POUNCE_TYPING_STOPPED)); |
| 12694 | 851 | gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(dialog->message_recv), |
| 15884 | 852 | (events & PURPLE_POUNCE_MESSAGE_RECEIVED)); |
| 5032 | 853 | |
|
5864
86822afeeab0
[gaim-migrate @ 6295]
Christian Hammond <chipx86@chipx86.com>
parents:
5857
diff
changeset
|
854 | /* Actions */ |
| 5032 | 855 | gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(dialog->open_win), |
| 15884 | 856 | purple_pounce_action_is_enabled(cur_pounce, "open-window")); |
| 5032 | 857 | gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(dialog->popup), |
| 15884 | 858 | purple_pounce_action_is_enabled(cur_pounce, "popup-notify")); |
| 5032 | 859 | gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(dialog->send_msg), |
| 15884 | 860 | purple_pounce_action_is_enabled(cur_pounce, "send-message")); |
| 5032 | 861 | gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(dialog->exec_cmd), |
| 15884 | 862 | purple_pounce_action_is_enabled(cur_pounce, "execute-command")); |
| 5032 | 863 | |
| 864 | gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(dialog->save_pounce), | |
| 15884 | 865 | purple_pounce_get_save(cur_pounce)); |
|
5864
86822afeeab0
[gaim-migrate @ 6295]
Christian Hammond <chipx86@chipx86.com>
parents:
5857
diff
changeset
|
866 | |
| 15884 | 867 | if ((value = purple_pounce_action_get_attribute(cur_pounce, |
|
5864
86822afeeab0
[gaim-migrate @ 6295]
Christian Hammond <chipx86@chipx86.com>
parents:
5857
diff
changeset
|
868 | "send-message", |
|
9205
8c4dbbe6386f
[gaim-migrate @ 10000]
Christian Hammond <chipx86@chipx86.com>
parents:
9191
diff
changeset
|
869 | "message")) != NULL) |
|
8c4dbbe6386f
[gaim-migrate @ 10000]
Christian Hammond <chipx86@chipx86.com>
parents:
9191
diff
changeset
|
870 | { |
|
39223
7016ec26cd75
Move GtkPounce to Talkatu
Gary Kramlich <grim@reaperworld.com>
parents:
39176
diff
changeset
|
871 | talkatu_markup_set_html(TALKATU_BUFFER(dialog->send_msg_buffer), value, -1); |
|
5864
86822afeeab0
[gaim-migrate @ 6295]
Christian Hammond <chipx86@chipx86.com>
parents:
5857
diff
changeset
|
872 | } |
| 5032 | 873 | |
| 15884 | 874 | if ((value = purple_pounce_action_get_attribute(cur_pounce, |
| 12934 | 875 | "popup-notify", |
| 876 | "reason")) != NULL) | |
| 877 | { | |
| 878 | gtk_entry_set_text(GTK_ENTRY(dialog->popup_entry), value); | |
| 879 | } | |
| 880 | ||
| 15884 | 881 | if ((value = purple_pounce_action_get_attribute(cur_pounce, |
|
5864
86822afeeab0
[gaim-migrate @ 6295]
Christian Hammond <chipx86@chipx86.com>
parents:
5857
diff
changeset
|
882 | "execute-command", |
|
9205
8c4dbbe6386f
[gaim-migrate @ 10000]
Christian Hammond <chipx86@chipx86.com>
parents:
9191
diff
changeset
|
883 | "command")) != NULL) |
|
8c4dbbe6386f
[gaim-migrate @ 10000]
Christian Hammond <chipx86@chipx86.com>
parents:
9191
diff
changeset
|
884 | { |
|
5864
86822afeeab0
[gaim-migrate @ 6295]
Christian Hammond <chipx86@chipx86.com>
parents:
5857
diff
changeset
|
885 | gtk_entry_set_text(GTK_ENTRY(dialog->exec_cmd_entry), value); |
|
86822afeeab0
[gaim-migrate @ 6295]
Christian Hammond <chipx86@chipx86.com>
parents:
5857
diff
changeset
|
886 | } |
| 5032 | 887 | } |
|
9205
8c4dbbe6386f
[gaim-migrate @ 10000]
Christian Hammond <chipx86@chipx86.com>
parents:
9191
diff
changeset
|
888 | else |
|
8c4dbbe6386f
[gaim-migrate @ 10000]
Christian Hammond <chipx86@chipx86.com>
parents:
9191
diff
changeset
|
889 | { |
| 15884 | 890 | PurpleBuddy *buddy = NULL; |
|
9205
8c4dbbe6386f
[gaim-migrate @ 10000]
Christian Hammond <chipx86@chipx86.com>
parents:
9191
diff
changeset
|
891 | |
|
8c4dbbe6386f
[gaim-migrate @ 10000]
Christian Hammond <chipx86@chipx86.com>
parents:
9191
diff
changeset
|
892 | if (name != NULL) |
|
34728
8efd73063ecf
Renamed buddy list functions to more appropriate/simler names.
Ankit Vani <a@nevitus.org>
parents:
34708
diff
changeset
|
893 | buddy = purple_blist_find_buddy(account, name); |
|
9205
8c4dbbe6386f
[gaim-migrate @ 10000]
Christian Hammond <chipx86@chipx86.com>
parents:
9191
diff
changeset
|
894 | |
| 5032 | 895 | /* Set some defaults */ |
|
9205
8c4dbbe6386f
[gaim-migrate @ 10000]
Christian Hammond <chipx86@chipx86.com>
parents:
9191
diff
changeset
|
896 | if (buddy == NULL) |
|
8c4dbbe6386f
[gaim-migrate @ 10000]
Christian Hammond <chipx86@chipx86.com>
parents:
9191
diff
changeset
|
897 | { |
|
8c4dbbe6386f
[gaim-migrate @ 10000]
Christian Hammond <chipx86@chipx86.com>
parents:
9191
diff
changeset
|
898 | gtk_toggle_button_set_active( |
|
8c4dbbe6386f
[gaim-migrate @ 10000]
Christian Hammond <chipx86@chipx86.com>
parents:
9191
diff
changeset
|
899 | GTK_TOGGLE_BUTTON(dialog->signon), TRUE); |
|
8c4dbbe6386f
[gaim-migrate @ 10000]
Christian Hammond <chipx86@chipx86.com>
parents:
9191
diff
changeset
|
900 | } |
|
8c4dbbe6386f
[gaim-migrate @ 10000]
Christian Hammond <chipx86@chipx86.com>
parents:
9191
diff
changeset
|
901 | else |
|
8c4dbbe6386f
[gaim-migrate @ 10000]
Christian Hammond <chipx86@chipx86.com>
parents:
9191
diff
changeset
|
902 | { |
| 15884 | 903 | if (!PURPLE_BUDDY_IS_ONLINE(buddy)) |
|
9205
8c4dbbe6386f
[gaim-migrate @ 10000]
Christian Hammond <chipx86@chipx86.com>
parents:
9191
diff
changeset
|
904 | { |
|
8c4dbbe6386f
[gaim-migrate @ 10000]
Christian Hammond <chipx86@chipx86.com>
parents:
9191
diff
changeset
|
905 | gtk_toggle_button_set_active( |
|
8c4dbbe6386f
[gaim-migrate @ 10000]
Christian Hammond <chipx86@chipx86.com>
parents:
9191
diff
changeset
|
906 | GTK_TOGGLE_BUTTON(dialog->signon), TRUE); |
|
8c4dbbe6386f
[gaim-migrate @ 10000]
Christian Hammond <chipx86@chipx86.com>
parents:
9191
diff
changeset
|
907 | } |
|
8c4dbbe6386f
[gaim-migrate @ 10000]
Christian Hammond <chipx86@chipx86.com>
parents:
9191
diff
changeset
|
908 | else |
|
8c4dbbe6386f
[gaim-migrate @ 10000]
Christian Hammond <chipx86@chipx86.com>
parents:
9191
diff
changeset
|
909 | { |
|
8c4dbbe6386f
[gaim-migrate @ 10000]
Christian Hammond <chipx86@chipx86.com>
parents:
9191
diff
changeset
|
910 | gboolean default_set = FALSE; |
| 15884 | 911 | PurplePresence *presence = purple_buddy_get_presence(buddy); |
|
9205
8c4dbbe6386f
[gaim-migrate @ 10000]
Christian Hammond <chipx86@chipx86.com>
parents:
9191
diff
changeset
|
912 | |
| 15884 | 913 | if (purple_presence_is_idle(presence)) |
|
9205
8c4dbbe6386f
[gaim-migrate @ 10000]
Christian Hammond <chipx86@chipx86.com>
parents:
9191
diff
changeset
|
914 | { |
|
8c4dbbe6386f
[gaim-migrate @ 10000]
Christian Hammond <chipx86@chipx86.com>
parents:
9191
diff
changeset
|
915 | gtk_toggle_button_set_active( |
|
8c4dbbe6386f
[gaim-migrate @ 10000]
Christian Hammond <chipx86@chipx86.com>
parents:
9191
diff
changeset
|
916 | GTK_TOGGLE_BUTTON(dialog->idle_return), TRUE); |
|
8c4dbbe6386f
[gaim-migrate @ 10000]
Christian Hammond <chipx86@chipx86.com>
parents:
9191
diff
changeset
|
917 | |
|
8c4dbbe6386f
[gaim-migrate @ 10000]
Christian Hammond <chipx86@chipx86.com>
parents:
9191
diff
changeset
|
918 | default_set = TRUE; |
|
8c4dbbe6386f
[gaim-migrate @ 10000]
Christian Hammond <chipx86@chipx86.com>
parents:
9191
diff
changeset
|
919 | } |
|
8c4dbbe6386f
[gaim-migrate @ 10000]
Christian Hammond <chipx86@chipx86.com>
parents:
9191
diff
changeset
|
920 | |
| 15884 | 921 | if (!purple_presence_is_available(presence)) |
|
9205
8c4dbbe6386f
[gaim-migrate @ 10000]
Christian Hammond <chipx86@chipx86.com>
parents:
9191
diff
changeset
|
922 | { |
|
8c4dbbe6386f
[gaim-migrate @ 10000]
Christian Hammond <chipx86@chipx86.com>
parents:
9191
diff
changeset
|
923 | gtk_toggle_button_set_active( |
|
8c4dbbe6386f
[gaim-migrate @ 10000]
Christian Hammond <chipx86@chipx86.com>
parents:
9191
diff
changeset
|
924 | GTK_TOGGLE_BUTTON(dialog->away_return), TRUE); |
|
8c4dbbe6386f
[gaim-migrate @ 10000]
Christian Hammond <chipx86@chipx86.com>
parents:
9191
diff
changeset
|
925 | |
|
8c4dbbe6386f
[gaim-migrate @ 10000]
Christian Hammond <chipx86@chipx86.com>
parents:
9191
diff
changeset
|
926 | default_set = TRUE; |
|
8c4dbbe6386f
[gaim-migrate @ 10000]
Christian Hammond <chipx86@chipx86.com>
parents:
9191
diff
changeset
|
927 | } |
|
8c4dbbe6386f
[gaim-migrate @ 10000]
Christian Hammond <chipx86@chipx86.com>
parents:
9191
diff
changeset
|
928 | |
|
8c4dbbe6386f
[gaim-migrate @ 10000]
Christian Hammond <chipx86@chipx86.com>
parents:
9191
diff
changeset
|
929 | if (!default_set) |
|
8c4dbbe6386f
[gaim-migrate @ 10000]
Christian Hammond <chipx86@chipx86.com>
parents:
9191
diff
changeset
|
930 | { |
|
8c4dbbe6386f
[gaim-migrate @ 10000]
Christian Hammond <chipx86@chipx86.com>
parents:
9191
diff
changeset
|
931 | gtk_toggle_button_set_active( |
|
8c4dbbe6386f
[gaim-migrate @ 10000]
Christian Hammond <chipx86@chipx86.com>
parents:
9191
diff
changeset
|
932 | GTK_TOGGLE_BUTTON(dialog->signon), TRUE); |
|
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 | } |
|
8c4dbbe6386f
[gaim-migrate @ 10000]
Christian Hammond <chipx86@chipx86.com>
parents:
9191
diff
changeset
|
935 | } |
|
8c4dbbe6386f
[gaim-migrate @ 10000]
Christian Hammond <chipx86@chipx86.com>
parents:
9191
diff
changeset
|
936 | |
|
9206
57a4db675f8d
[gaim-migrate @ 10001]
Christian Hammond <chipx86@chipx86.com>
parents:
9205
diff
changeset
|
937 | 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
|
938 | 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
|
939 | 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
|
940 | 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
|
941 | 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
|
942 | 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
|
943 | 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
|
944 | purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/pounces/default_actions/execute-command")); |
| 5032 | 945 | } |
| 946 | ||
|
19786
33ab83cd846b
Don't show *all*\!
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
19546
diff
changeset
|
947 | gtk_widget_show(vbox2); |
| 5032 | 948 | gtk_widget_show(window); |
| 949 | } | |
| 950 | ||
| 12136 | 951 | static gboolean |
| 952 | pounces_manager_configure_cb(GtkWidget *widget, GdkEventConfigure *event, PouncesManager *dialog) | |
| 953 | { | |
|
32913
af2c726febce
Fix all deprecated GTK_WIDGET_* macros.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32624
diff
changeset
|
954 | if (gtk_widget_get_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
|
955 | 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
|
956 | purple_prefs_set_int(PIDGIN_PREFS_ROOT "/pounces/dialog/height", event->height); |
| 12136 | 957 | } |
| 958 | ||
| 959 | return FALSE; | |
| 960 | } | |
| 961 | ||
| 962 | static gboolean | |
| 15884 | 963 | pounces_manager_find_pounce(GtkTreeIter *iter, PurplePounce *pounce) |
| 5032 | 964 | { |
| 12136 | 965 | GtkTreeModel *model = GTK_TREE_MODEL(pounces_manager->model); |
| 15884 | 966 | PurplePounce *p; |
| 12136 | 967 | |
| 968 | if (!gtk_tree_model_get_iter_first(model, iter)) | |
| 969 | return FALSE; | |
| 970 | ||
| 971 | gtk_tree_model_get(model, iter, POUNCES_MANAGER_COLUMN_POUNCE, &p, -1); | |
| 972 | if (pounce == p) | |
| 973 | return TRUE; | |
| 974 | ||
| 975 | while (gtk_tree_model_iter_next(model, iter)) | |
| 976 | { | |
| 977 | gtk_tree_model_get(model, iter, POUNCES_MANAGER_COLUMN_POUNCE, &p, -1); | |
| 978 | if (pounce == p) | |
| 979 | return TRUE; | |
| 980 | } | |
| 981 | ||
| 982 | return FALSE; | |
| 983 | } | |
| 984 | ||
| 985 | static gboolean | |
| 986 | pounces_manager_destroy_cb(GtkWidget *widget, GdkEvent *event, gpointer user_data) | |
| 987 | { | |
| 988 | PouncesManager *dialog = user_data; | |
| 989 | ||
| 990 | dialog->window = NULL; | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15496
diff
changeset
|
991 | pidgin_pounces_manager_hide(); |
| 12136 | 992 | |
| 993 | return FALSE; | |
| 994 | } | |
| 995 | ||
| 996 | static void | |
| 15884 | 997 | pounces_manager_connection_cb(PurpleConnection *gc, GtkWidget *add_button) |
| 12136 | 998 | { |
| 15884 | 999 | gtk_widget_set_sensitive(add_button, (purple_connections_get_all() != NULL)); |
| 5032 | 1000 | } |
| 1001 | ||
| 1002 | static void | |
| 12136 | 1003 | pounces_manager_add_cb(GtkButton *button, gpointer user_data) |
| 1004 | { | |
|
21214
db28e29a4990
Reverted changes from ef7ac46f90a801547f7dfc4295927a956f90e869 to
Richard Laager <rlaager@pidgin.im>
parents:
21171
diff
changeset
|
1005 | pidgin_pounce_editor_show(NULL, NULL, NULL); |
| 12136 | 1006 | } |
| 1007 | ||
| 1008 | static void | |
| 1009 | pounces_manager_modify_foreach(GtkTreeModel *model, GtkTreePath *path, | |
| 1010 | GtkTreeIter *iter, gpointer user_data) | |
|
5153
4865538db77a
[gaim-migrate @ 5517]
Christian Hammond <chipx86@chipx86.com>
parents:
5054
diff
changeset
|
1011 | { |
| 15884 | 1012 | PurplePounce *pounce; |
| 12136 | 1013 | |
| 1014 | 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
|
1015 | pidgin_pounce_editor_show(NULL, NULL, pounce); |
| 12136 | 1016 | } |
| 1017 | ||
| 1018 | static void | |
| 1019 | pounces_manager_modify_cb(GtkButton *button, gpointer user_data) | |
| 1020 | { | |
| 1021 | PouncesManager *dialog = user_data; | |
| 1022 | GtkTreeSelection *selection; | |
| 1023 | ||
| 1024 | selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(dialog->treeview)); | |
| 1025 | ||
| 1026 | gtk_tree_selection_selected_foreach(selection, pounces_manager_modify_foreach, user_data); | |
| 1027 | } | |
| 1028 | ||
| 1029 | static void | |
| 15884 | 1030 | pounces_manager_delete_confirm_cb(PurplePounce *pounce) |
| 12136 | 1031 | { |
| 1032 | GtkTreeIter iter; | |
| 1033 | ||
|
13172
4e7621289194
[gaim-migrate @ 15534]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13120
diff
changeset
|
1034 | if (pounces_manager && pounces_manager_find_pounce(&iter, pounce)) |
| 12136 | 1035 | gtk_list_store_remove(pounces_manager->model, &iter); |
| 1036 | ||
| 15884 | 1037 | purple_request_close_with_handle(pounce); |
| 1038 | purple_pounce_destroy(pounce); | |
|
5153
4865538db77a
[gaim-migrate @ 5517]
Christian Hammond <chipx86@chipx86.com>
parents:
5054
diff
changeset
|
1039 | } |
|
4865538db77a
[gaim-migrate @ 5517]
Christian Hammond <chipx86@chipx86.com>
parents:
5054
diff
changeset
|
1040 | |
|
4865538db77a
[gaim-migrate @ 5517]
Christian Hammond <chipx86@chipx86.com>
parents:
5054
diff
changeset
|
1041 | static void |
| 12136 | 1042 | pounces_manager_delete_foreach(GtkTreeModel *model, GtkTreePath *path, |
| 1043 | GtkTreeIter *iter, gpointer user_data) | |
| 1044 | { | |
| 15884 | 1045 | PurplePounce *pounce; |
| 1046 | PurpleAccount *account; | |
| 12136 | 1047 | const char *pouncer, *pouncee; |
| 1048 | char *buf; | |
| 1049 | ||
| 1050 | gtk_tree_model_get(model, iter, POUNCES_MANAGER_COLUMN_POUNCE, &pounce, -1); | |
| 15884 | 1051 | account = purple_pounce_get_pouncer(pounce); |
| 1052 | pouncer = purple_account_get_username(account); | |
| 1053 | pouncee = purple_pounce_get_pouncee(pounce); | |
| 12136 | 1054 | |
| 1055 | 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
|
1056 | purple_request_action(pounce, NULL, buf, NULL, 0, |
|
34331
c8486462bb63
Request API refactoring: switch purple_request_action to PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34274
diff
changeset
|
1057 | purple_request_cpar_from_account(account), |
|
c8486462bb63
Request API refactoring: switch purple_request_action to PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34274
diff
changeset
|
1058 | pounce, 2, _("Delete"), pounces_manager_delete_confirm_cb, |
|
c8486462bb63
Request API refactoring: switch purple_request_action to PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34274
diff
changeset
|
1059 | _("Cancel"), NULL); |
| 12136 | 1060 | g_free(buf); |
| 1061 | } | |
| 1062 | ||
| 1063 | static void | |
| 1064 | pounces_manager_delete_cb(GtkButton *button, gpointer user_data) | |
| 1065 | { | |
| 1066 | PouncesManager *dialog = user_data; | |
| 1067 | GtkTreeSelection *selection; | |
| 1068 | ||
| 1069 | selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(dialog->treeview)); | |
| 1070 | ||
| 1071 | gtk_tree_selection_selected_foreach(selection, pounces_manager_delete_foreach, user_data); | |
| 1072 | } | |
| 1073 | ||
| 1074 | static void | |
| 1075 | pounces_manager_close_cb(GtkButton *button, gpointer user_data) | |
| 5032 | 1076 | { |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15496
diff
changeset
|
1077 | pidgin_pounces_manager_hide(); |
| 12136 | 1078 | } |
| 1079 | ||
| 1080 | static void | |
| 1081 | pounce_selected_cb(GtkTreeSelection *sel, gpointer user_data) | |
| 1082 | { | |
| 1083 | PouncesManager *dialog = user_data; | |
| 1084 | int num_selected = 0; | |
| 1085 | ||
| 1086 | num_selected = gtk_tree_selection_count_selected_rows(sel); | |
| 1087 | ||
| 1088 | gtk_widget_set_sensitive(dialog->modify_button, (num_selected > 0)); | |
| 1089 | gtk_widget_set_sensitive(dialog->delete_button, (num_selected > 0)); | |
| 1090 | } | |
| 1091 | ||
|
12137
6a9dafcaaed1
[gaim-migrate @ 14437]
Richard Laager <rlaager@pidgin.im>
parents:
12136
diff
changeset
|
1092 | static gboolean |
|
6a9dafcaaed1
[gaim-migrate @ 14437]
Richard Laager <rlaager@pidgin.im>
parents:
12136
diff
changeset
|
1093 | pounce_double_click_cb(GtkTreeView *treeview, GdkEventButton *event, gpointer user_data) |
|
6a9dafcaaed1
[gaim-migrate @ 14437]
Richard Laager <rlaager@pidgin.im>
parents:
12136
diff
changeset
|
1094 | { |
|
6a9dafcaaed1
[gaim-migrate @ 14437]
Richard Laager <rlaager@pidgin.im>
parents:
12136
diff
changeset
|
1095 | PouncesManager *dialog = user_data; |
|
6a9dafcaaed1
[gaim-migrate @ 14437]
Richard Laager <rlaager@pidgin.im>
parents:
12136
diff
changeset
|
1096 | GtkTreePath *path; |
|
6a9dafcaaed1
[gaim-migrate @ 14437]
Richard Laager <rlaager@pidgin.im>
parents:
12136
diff
changeset
|
1097 | GtkTreeIter iter; |
| 15884 | 1098 | PurplePounce *pounce; |
|
12137
6a9dafcaaed1
[gaim-migrate @ 14437]
Richard Laager <rlaager@pidgin.im>
parents:
12136
diff
changeset
|
1099 | |
|
6a9dafcaaed1
[gaim-migrate @ 14437]
Richard Laager <rlaager@pidgin.im>
parents:
12136
diff
changeset
|
1100 | /* Figure out which node was clicked */ |
|
6a9dafcaaed1
[gaim-migrate @ 14437]
Richard Laager <rlaager@pidgin.im>
parents:
12136
diff
changeset
|
1101 | 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
|
1102 | return FALSE; |
|
6a9dafcaaed1
[gaim-migrate @ 14437]
Richard Laager <rlaager@pidgin.im>
parents:
12136
diff
changeset
|
1103 | 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
|
1104 | gtk_tree_path_free(path); |
|
6a9dafcaaed1
[gaim-migrate @ 14437]
Richard Laager <rlaager@pidgin.im>
parents:
12136
diff
changeset
|
1105 | 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
|
1106 | |
|
38712
ea49cd76cf47
Use GDK button constants instead of magic numbers.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38583
diff
changeset
|
1107 | if ((pounce != NULL) && (event->button == GDK_BUTTON_PRIMARY) && |
|
12137
6a9dafcaaed1
[gaim-migrate @ 14437]
Richard Laager <rlaager@pidgin.im>
parents:
12136
diff
changeset
|
1108 | (event->type == GDK_2BUTTON_PRESS)) |
|
6a9dafcaaed1
[gaim-migrate @ 14437]
Richard Laager <rlaager@pidgin.im>
parents:
12136
diff
changeset
|
1109 | { |
|
21214
db28e29a4990
Reverted changes from ef7ac46f90a801547f7dfc4295927a956f90e869 to
Richard Laager <rlaager@pidgin.im>
parents:
21171
diff
changeset
|
1110 | pidgin_pounce_editor_show(NULL, NULL, pounce); |
|
12137
6a9dafcaaed1
[gaim-migrate @ 14437]
Richard Laager <rlaager@pidgin.im>
parents:
12136
diff
changeset
|
1111 | return TRUE; |
|
6a9dafcaaed1
[gaim-migrate @ 14437]
Richard Laager <rlaager@pidgin.im>
parents:
12136
diff
changeset
|
1112 | } |
|
6a9dafcaaed1
[gaim-migrate @ 14437]
Richard Laager <rlaager@pidgin.im>
parents:
12136
diff
changeset
|
1113 | |
|
6a9dafcaaed1
[gaim-migrate @ 14437]
Richard Laager <rlaager@pidgin.im>
parents:
12136
diff
changeset
|
1114 | return FALSE; |
|
6a9dafcaaed1
[gaim-migrate @ 14437]
Richard Laager <rlaager@pidgin.im>
parents:
12136
diff
changeset
|
1115 | } |
|
6a9dafcaaed1
[gaim-migrate @ 14437]
Richard Laager <rlaager@pidgin.im>
parents:
12136
diff
changeset
|
1116 | |
| 12136 | 1117 | static void |
|
12193
243b18a880ba
[gaim-migrate @ 14495]
Richard Laager <rlaager@pidgin.im>
parents:
12192
diff
changeset
|
1118 | pounces_manager_recurring_cb(GtkCellRendererToggle *renderer, gchar *path_str, |
| 12136 | 1119 | gpointer user_data) |
| 1120 | { | |
| 1121 | PouncesManager *dialog = user_data; | |
| 15884 | 1122 | PurplePounce *pounce; |
|
12193
243b18a880ba
[gaim-migrate @ 14495]
Richard Laager <rlaager@pidgin.im>
parents:
12192
diff
changeset
|
1123 | gboolean recurring; |
| 12136 | 1124 | GtkTreeModel *model = GTK_TREE_MODEL(dialog->model); |
| 1125 | GtkTreeIter iter; | |
| 1126 | ||
| 1127 | gtk_tree_model_get_iter_from_string(model, &iter, path_str); | |
| 1128 | gtk_tree_model_get(model, &iter, | |
| 1129 | POUNCES_MANAGER_COLUMN_POUNCE, &pounce, | |
|
12193
243b18a880ba
[gaim-migrate @ 14495]
Richard Laager <rlaager@pidgin.im>
parents:
12192
diff
changeset
|
1130 | POUNCES_MANAGER_COLUMN_RECURRING, &recurring, |
| 12136 | 1131 | -1); |
| 1132 | ||
| 15884 | 1133 | purple_pounce_set_save(pounce, !recurring); |
| 12136 | 1134 | |
| 1135 | update_pounces(); | |
| 5032 | 1136 | } |
| 1137 | ||
|
8259
7ed91862683d
[gaim-migrate @ 8982]
Christian Hammond <chipx86@chipx86.com>
parents:
8252
diff
changeset
|
1138 | static gboolean |
| 12136 | 1139 | 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
|
1140 | { |
| 12136 | 1141 | gboolean result; |
| 1142 | char *haystack; | |
| 1143 | ||
| 1144 | gtk_tree_model_get(model, iter, column, &haystack, -1); | |
| 1145 | ||
| 15884 | 1146 | result = (purple_strcasestr(haystack, key) == NULL); |
| 12136 | 1147 | |
| 1148 | g_free(haystack); | |
| 1149 | ||
| 1150 | return result; | |
| 1151 | } | |
| 1152 | ||
| 1153 | static GtkWidget * | |
| 1154 | create_pounces_list(PouncesManager *dialog) | |
| 1155 | { | |
| 1156 | GtkWidget *treeview; | |
| 1157 | GtkTreeSelection *sel; | |
| 1158 | GtkTreeViewColumn *column; | |
| 1159 | GtkCellRenderer *renderer; | |
|
5153
4865538db77a
[gaim-migrate @ 5517]
Christian Hammond <chipx86@chipx86.com>
parents:
5054
diff
changeset
|
1160 | |
| 12136 | 1161 | /* Create the list model */ |
| 1162 | dialog->model = gtk_list_store_new(POUNCES_MANAGER_NUM_COLUMNS, | |
| 1163 | G_TYPE_POINTER, | |
| 1164 | GDK_TYPE_PIXBUF, | |
| 1165 | G_TYPE_STRING, | |
| 1166 | G_TYPE_STRING, | |
| 1167 | G_TYPE_BOOLEAN | |
| 1168 | ); | |
|
10250
9a0f00083ec1
[gaim-migrate @ 11390]
Mark Doliner <markdoliner@pidgin.im>
parents:
10246
diff
changeset
|
1169 | |
| 12136 | 1170 | /* Create the treeview */ |
| 1171 | treeview = gtk_tree_view_new_with_model(GTK_TREE_MODEL(dialog->model)); | |
|
22214
e8a9916cb99e
It turns out the tree-models need to be unref'ed.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22005
diff
changeset
|
1172 | g_object_unref(G_OBJECT(dialog->model)); |
| 12136 | 1173 | dialog->treeview = treeview; |
|
10250
9a0f00083ec1
[gaim-migrate @ 11390]
Mark Doliner <markdoliner@pidgin.im>
parents:
10246
diff
changeset
|
1174 | |
| 12136 | 1175 | sel = gtk_tree_view_get_selection(GTK_TREE_VIEW(treeview)); |
| 1176 | gtk_tree_selection_set_mode(sel, GTK_SELECTION_MULTIPLE); | |
| 1177 | g_signal_connect(G_OBJECT(sel), "changed", | |
| 1178 | G_CALLBACK(pounce_selected_cb), dialog); | |
| 1179 | ||
|
12137
6a9dafcaaed1
[gaim-migrate @ 14437]
Richard Laager <rlaager@pidgin.im>
parents:
12136
diff
changeset
|
1180 | /* Handle double-clicking */ |
|
6a9dafcaaed1
[gaim-migrate @ 14437]
Richard Laager <rlaager@pidgin.im>
parents:
12136
diff
changeset
|
1181 | g_signal_connect(G_OBJECT(treeview), "button_press_event", |
|
6a9dafcaaed1
[gaim-migrate @ 14437]
Richard Laager <rlaager@pidgin.im>
parents:
12136
diff
changeset
|
1182 | G_CALLBACK(pounce_double_click_cb), dialog); |
| 12136 | 1183 | gtk_widget_show(treeview); |
|
8259
7ed91862683d
[gaim-migrate @ 8982]
Christian Hammond <chipx86@chipx86.com>
parents:
8252
diff
changeset
|
1184 | |
| 12136 | 1185 | /* Pouncee Column */ |
| 1186 | column = gtk_tree_view_column_new(); | |
| 1187 | gtk_tree_view_column_set_title(column, _("Pounce Target")); | |
| 1188 | gtk_tree_view_column_set_resizable(column, TRUE); | |
| 1189 | gtk_tree_view_column_set_min_width(column, 200); | |
| 1190 | gtk_tree_view_column_set_sort_column_id(column, | |
| 1191 | POUNCES_MANAGER_COLUMN_TARGET); | |
| 1192 | gtk_tree_view_append_column(GTK_TREE_VIEW(treeview), column); | |
| 5161 | 1193 | |
| 12136 | 1194 | /* Icon */ |
| 1195 | renderer = gtk_cell_renderer_pixbuf_new(); | |
| 1196 | gtk_tree_view_column_pack_start(column, renderer, FALSE); | |
| 1197 | gtk_tree_view_column_add_attribute(column, renderer, "pixbuf", | |
| 1198 | POUNCES_MANAGER_COLUMN_ICON); | |
| 1199 | ||
| 1200 | /* Pouncee */ | |
| 1201 | renderer = gtk_cell_renderer_text_new(); | |
| 1202 | gtk_tree_view_column_pack_start(column, renderer, TRUE); | |
| 1203 | gtk_tree_view_column_add_attribute(column, renderer, "text", | |
| 1204 | POUNCES_MANAGER_COLUMN_TARGET); | |
| 1205 | ||
|
5153
4865538db77a
[gaim-migrate @ 5517]
Christian Hammond <chipx86@chipx86.com>
parents:
5054
diff
changeset
|
1206 | |
| 12136 | 1207 | /* Account Column */ |
| 1208 | column = gtk_tree_view_column_new(); | |
| 1209 | gtk_tree_view_column_set_title(column, _("Account")); | |
| 1210 | gtk_tree_view_column_set_resizable(column, TRUE); | |
| 1211 | gtk_tree_view_column_set_min_width(column, 200); | |
| 1212 | gtk_tree_view_column_set_sort_column_id(column, | |
| 1213 | POUNCES_MANAGER_COLUMN_ACCOUNT); | |
| 1214 | gtk_tree_view_append_column(GTK_TREE_VIEW(treeview), column); | |
| 1215 | renderer = gtk_cell_renderer_text_new(); | |
| 1216 | gtk_tree_view_column_pack_start(column, renderer, TRUE); | |
| 1217 | gtk_tree_view_column_add_attribute(column, renderer, "text", | |
| 1218 | POUNCES_MANAGER_COLUMN_ACCOUNT); | |
|
5153
4865538db77a
[gaim-migrate @ 5517]
Christian Hammond <chipx86@chipx86.com>
parents:
5054
diff
changeset
|
1219 | |
|
12193
243b18a880ba
[gaim-migrate @ 14495]
Richard Laager <rlaager@pidgin.im>
parents:
12192
diff
changeset
|
1220 | /* Recurring Column */ |
| 12136 | 1221 | renderer = gtk_cell_renderer_toggle_new(); |
|
12193
243b18a880ba
[gaim-migrate @ 14495]
Richard Laager <rlaager@pidgin.im>
parents:
12192
diff
changeset
|
1222 | column = gtk_tree_view_column_new_with_attributes(_("Recurring"), renderer, |
|
243b18a880ba
[gaim-migrate @ 14495]
Richard Laager <rlaager@pidgin.im>
parents:
12192
diff
changeset
|
1223 | "active", POUNCES_MANAGER_COLUMN_RECURRING, NULL); |
| 12136 | 1224 | gtk_tree_view_column_set_sort_column_id(column, |
|
12193
243b18a880ba
[gaim-migrate @ 14495]
Richard Laager <rlaager@pidgin.im>
parents:
12192
diff
changeset
|
1225 | POUNCES_MANAGER_COLUMN_RECURRING); |
| 12136 | 1226 | gtk_tree_view_append_column(GTK_TREE_VIEW(treeview), column); |
| 1227 | g_signal_connect(G_OBJECT(renderer), "toggled", | |
|
12193
243b18a880ba
[gaim-migrate @ 14495]
Richard Laager <rlaager@pidgin.im>
parents:
12192
diff
changeset
|
1228 | G_CALLBACK(pounces_manager_recurring_cb), dialog); |
|
5153
4865538db77a
[gaim-migrate @ 5517]
Christian Hammond <chipx86@chipx86.com>
parents:
5054
diff
changeset
|
1229 | |
| 12136 | 1230 | /* Enable CTRL+F searching */ |
| 1231 | gtk_tree_view_set_search_column(GTK_TREE_VIEW(treeview), POUNCES_MANAGER_COLUMN_TARGET); | |
| 1232 | 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
|
1233 | |
| 12136 | 1234 | /* Sort the pouncee column by default */ |
| 1235 | gtk_tree_sortable_set_sort_column_id(GTK_TREE_SORTABLE(dialog->model), | |
| 1236 | POUNCES_MANAGER_COLUMN_TARGET, | |
| 1237 | GTK_SORT_ASCENDING); | |
| 1238 | ||
| 1239 | /* Populate list */ | |
| 1240 | populate_pounces_list(dialog); | |
| 1241 | ||
|
31321
1fef3832cfa2
Add pidgin_make_scrollable and use it. Cleans up a bunch of duplicate code. Net code loss of 180 lines. Fixes #13073.
Gabriel Schulhof <nix@go-nix.ca>
parents:
30706
diff
changeset
|
1242 | return pidgin_make_scrollable(treeview, GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC, GTK_SHADOW_IN, -1, -1); |
|
5153
4865538db77a
[gaim-migrate @ 5517]
Christian Hammond <chipx86@chipx86.com>
parents:
5054
diff
changeset
|
1243 | } |
|
4865538db77a
[gaim-migrate @ 5517]
Christian Hammond <chipx86@chipx86.com>
parents:
5054
diff
changeset
|
1244 | |
| 5032 | 1245 | void |
|
21182
23cc39e90bf7
Only the request API changes
Gabriel Schulhof <nix@go-nix.ca>
parents:
21162
diff
changeset
|
1246 | pidgin_pounces_manager_show(void) |
| 5032 | 1247 | { |
| 12136 | 1248 | PouncesManager *dialog; |
| 1249 | GtkWidget *button; | |
| 1250 | GtkWidget *list; | |
| 1251 | GtkWidget *vbox; | |
| 1252 | GtkWidget *win; | |
| 1253 | int width, height; | |
| 5032 | 1254 | |
| 12136 | 1255 | if (pounces_manager != NULL) { |
| 1256 | gtk_window_present(GTK_WINDOW(pounces_manager->window)); | |
| 1257 | return; | |
| 5032 | 1258 | } |
| 8252 | 1259 | |
| 12136 | 1260 | pounces_manager = dialog = g_new0(PouncesManager, 1); |
| 1261 | ||
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
1262 | 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
|
1263 | height = purple_prefs_get_int(PIDGIN_PREFS_ROOT "/pounces/dialog/height"); |
| 12136 | 1264 | |
|
40533
b1921b17b683
Replace some utility functions with actual widgets
Gary Kramlich <grim@reaperworld.com>
parents:
40509
diff
changeset
|
1265 | dialog->window = win = pidgin_dialog_new(_("Buddy Pounces"), 0, "pounces", TRUE); |
|
37422
07dcc28b6039
Remove support for GTK+2
Jorge Villaseñor <salinasv@pidgin.im>
parents:
37158
diff
changeset
|
1266 | |
| 12136 | 1267 | gtk_window_set_default_size(GTK_WINDOW(win), width, height); |
| 1268 | ||
| 1269 | g_signal_connect(G_OBJECT(win), "delete_event", | |
| 1270 | G_CALLBACK(pounces_manager_destroy_cb), dialog); | |
| 1271 | g_signal_connect(G_OBJECT(win), "configure_event", | |
| 1272 | G_CALLBACK(pounces_manager_configure_cb), dialog); | |
| 1273 | ||
| 1274 | /* Setup the vbox */ | |
|
40490
fb6e46c4c63c
Remove PIDGIN_HIG_* constants
Gary Kramlich <grim@reaperworld.com>
parents:
40484
diff
changeset
|
1275 | vbox = pidgin_dialog_get_vbox_with_properties(GTK_DIALOG(win), FALSE, 12); |
| 5032 | 1276 | |
| 12136 | 1277 | /* List of saved buddy pounces */ |
| 1278 | list = create_pounces_list(dialog); | |
| 1279 | gtk_box_pack_start(GTK_BOX(vbox), list, TRUE, TRUE, 0); | |
| 1280 | ||
|
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
|
1281 | /* Add button */ |
|
24594
b2da1decae23
Add an ellipsis to the "Add" and "Modify" buttons in the accounts, pounces, and
Alex Willmer <alex@moreati.org.uk>
parents:
23260
diff
changeset
|
1282 | button = pidgin_dialog_add_button(GTK_DIALOG(win), PIDGIN_STOCK_ADD, G_CALLBACK(pounces_manager_add_cb), dialog); |
|
22005
0183020ba2cc
Add a utility function pidgin_dialog_add_button to add buttons to a dialog
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22000
diff
changeset
|
1283 | gtk_widget_set_sensitive(button, (purple_accounts_get_all() != NULL)); |
| 5032 | 1284 | |
| 15884 | 1285 | purple_signal_connect(purple_connections_get_handle(), "signed-on", |
| 1286 | pounces_manager, PURPLE_CALLBACK(pounces_manager_connection_cb), button); | |
| 1287 | purple_signal_connect(purple_connections_get_handle(), "signed-off", | |
| 1288 | pounces_manager, PURPLE_CALLBACK(pounces_manager_connection_cb), button); | |
| 5032 | 1289 | |
| 12136 | 1290 | /* 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
|
1291 | button = pidgin_dialog_add_button(GTK_DIALOG(win), PIDGIN_STOCK_MODIFY, G_CALLBACK(pounces_manager_modify_cb), dialog); |
| 12136 | 1292 | 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
|
1293 | dialog->modify_button = button; |
|
8259
7ed91862683d
[gaim-migrate @ 8982]
Christian Hammond <chipx86@chipx86.com>
parents:
8252
diff
changeset
|
1294 | |
| 12136 | 1295 | /* 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
|
1296 | button = pidgin_dialog_add_button(GTK_DIALOG(win), GTK_STOCK_DELETE, G_CALLBACK(pounces_manager_delete_cb), dialog); |
| 12136 | 1297 | 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
|
1298 | dialog->delete_button = button; |
| 5032 | 1299 | |
| 12136 | 1300 | /* 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
|
1301 | pidgin_dialog_add_button(GTK_DIALOG(win), GTK_STOCK_CLOSE, G_CALLBACK(pounces_manager_close_cb), dialog); |
| 12136 | 1302 | |
| 1303 | gtk_widget_show(win); | |
| 1304 | } | |
| 1305 | ||
| 1306 | void | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15496
diff
changeset
|
1307 | pidgin_pounces_manager_hide(void) |
| 12136 | 1308 | { |
| 1309 | if (pounces_manager == NULL) | |
| 1310 | return; | |
| 1311 | ||
| 1312 | if (pounces_manager->window != NULL) | |
| 1313 | gtk_widget_destroy(pounces_manager->window); | |
| 1314 | ||
| 15884 | 1315 | purple_signals_disconnect_by_handle(pounces_manager); |
| 12136 | 1316 | |
| 1317 | g_free(pounces_manager); | |
| 1318 | pounces_manager = NULL; | |
| 5032 | 1319 | } |
| 1320 | ||
|
5875
493a921c0378
[gaim-migrate @ 6307]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
1321 | static void |
| 15884 | 1322 | pounce_cb(PurplePounce *pounce, PurplePounceEvent events, void *data) |
|
5875
493a921c0378
[gaim-migrate @ 6307]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
1323 | { |
|
34662
f14347f38e3b
Refactor the remaining pidgin to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34627
diff
changeset
|
1324 | PurpleIMConversation *im; |
| 15884 | 1325 | PurpleAccount *account; |
| 1326 | PurpleBuddy *buddy; | |
|
5875
493a921c0378
[gaim-migrate @ 6307]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
1327 | const char *pouncee; |
|
7994
13b0203d6d52
[gaim-migrate @ 8671]
Christian Hammond <chipx86@chipx86.com>
parents:
7276
diff
changeset
|
1328 | const char *alias; |
|
9205
8c4dbbe6386f
[gaim-migrate @ 10000]
Christian Hammond <chipx86@chipx86.com>
parents:
9191
diff
changeset
|
1329 | |
| 15884 | 1330 | pouncee = purple_pounce_get_pouncee(pounce); |
| 1331 | account = purple_pounce_get_pouncer(pounce); | |
|
5875
493a921c0378
[gaim-migrate @ 6307]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
1332 | |
|
34728
8efd73063ecf
Renamed buddy list functions to more appropriate/simler names.
Ankit Vani <a@nevitus.org>
parents:
34708
diff
changeset
|
1333 | buddy = purple_blist_find_buddy(account, pouncee); |
| 12934 | 1334 | if (buddy != NULL) |
| 1335 | { | |
| 15884 | 1336 | alias = purple_buddy_get_alias(buddy); |
| 12934 | 1337 | if (alias == NULL) |
| 1338 | alias = pouncee; | |
| 1339 | } | |
| 1340 | else | |
| 1341 | alias = pouncee; | |
|
7994
13b0203d6d52
[gaim-migrate @ 8671]
Christian Hammond <chipx86@chipx86.com>
parents:
7276
diff
changeset
|
1342 | |
| 15884 | 1343 | if (purple_pounce_action_is_enabled(pounce, "open-window")) |
|
9205
8c4dbbe6386f
[gaim-migrate @ 10000]
Christian Hammond <chipx86@chipx86.com>
parents:
9191
diff
changeset
|
1344 | { |
|
34625
03d62b1660fc
Refactor code to remove conversation type from some instances of purple_conversations_find_with_account()
Ankit Vani <a@nevitus.org>
parents:
34622
diff
changeset
|
1345 | if (!purple_conversations_find_im_with_account(pouncee, account)) |
|
34627
08733a7475df
Replaced purple_conversation_new() with purple_[im,chat]_conversation_new()
Ankit Vani <a@nevitus.org>
parents:
34625
diff
changeset
|
1346 | purple_im_conversation_new(account, pouncee); |
|
5875
493a921c0378
[gaim-migrate @ 6307]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
1347 | } |
|
493a921c0378
[gaim-migrate @ 6307]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
1348 | |
| 15884 | 1349 | if (purple_pounce_action_is_enabled(pounce, "popup-notify")) |
|
9205
8c4dbbe6386f
[gaim-migrate @ 10000]
Christian Hammond <chipx86@chipx86.com>
parents:
9191
diff
changeset
|
1350 | { |
| 12934 | 1351 | char *tmp; |
| 1352 | const char *reason; | |
| 15884 | 1353 | reason = purple_pounce_action_get_attribute(pounce, "popup-notify", |
| 12934 | 1354 | "reason"); |
|
5875
493a921c0378
[gaim-migrate @ 6307]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
1355 | |
|
9205
8c4dbbe6386f
[gaim-migrate @ 10000]
Christian Hammond <chipx86@chipx86.com>
parents:
9191
diff
changeset
|
1356 | /* |
|
8c4dbbe6386f
[gaim-migrate @ 10000]
Christian Hammond <chipx86@chipx86.com>
parents:
9191
diff
changeset
|
1357 | * 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
|
1358 | * confusion about what protocol a pounce is for. |
|
8c4dbbe6386f
[gaim-migrate @ 10000]
Christian Hammond <chipx86@chipx86.com>
parents:
9191
diff
changeset
|
1359 | */ |
|
28717
7cd8b1322913
A simple g_strdup is fine here.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
26467
diff
changeset
|
1360 | tmp = g_strdup( |
| 15884 | 1361 | (events & PURPLE_POUNCE_TYPING) ? |
|
26467
ca1524dbcbf0
A patch from Jorge VillaseƱor which makes all pounces share a single window.
Kevin Stange <kstange@pidgin.im>
parents:
25909
diff
changeset
|
1362 | _("Started typing") : |
| 15884 | 1363 | (events & PURPLE_POUNCE_TYPED) ? |
|
26467
ca1524dbcbf0
A patch from Jorge VillaseƱor which makes all pounces share a single window.
Kevin Stange <kstange@pidgin.im>
parents:
25909
diff
changeset
|
1364 | _("Paused while typing") : |
| 15884 | 1365 | (events & PURPLE_POUNCE_SIGNON) ? |
|
26467
ca1524dbcbf0
A patch from Jorge VillaseƱor which makes all pounces share a single window.
Kevin Stange <kstange@pidgin.im>
parents:
25909
diff
changeset
|
1366 | _("Signed on") : |
| 15884 | 1367 | (events & PURPLE_POUNCE_IDLE_RETURN) ? |
|
26467
ca1524dbcbf0
A patch from Jorge VillaseƱor which makes all pounces share a single window.
Kevin Stange <kstange@pidgin.im>
parents:
25909
diff
changeset
|
1368 | _("Returned from being idle") : |
| 15884 | 1369 | (events & PURPLE_POUNCE_AWAY_RETURN) ? |
|
26467
ca1524dbcbf0
A patch from Jorge VillaseƱor which makes all pounces share a single window.
Kevin Stange <kstange@pidgin.im>
parents:
25909
diff
changeset
|
1370 | _("Returned from being away") : |
| 15884 | 1371 | (events & PURPLE_POUNCE_TYPING_STOPPED) ? |
|
26467
ca1524dbcbf0
A patch from Jorge VillaseƱor which makes all pounces share a single window.
Kevin Stange <kstange@pidgin.im>
parents:
25909
diff
changeset
|
1372 | _("Stopped typing") : |
| 15884 | 1373 | (events & PURPLE_POUNCE_SIGNOFF) ? |
|
26467
ca1524dbcbf0
A patch from Jorge VillaseƱor which makes all pounces share a single window.
Kevin Stange <kstange@pidgin.im>
parents:
25909
diff
changeset
|
1374 | _("Signed off") : |
| 15884 | 1375 | (events & PURPLE_POUNCE_IDLE) ? |
|
26467
ca1524dbcbf0
A patch from Jorge VillaseƱor which makes all pounces share a single window.
Kevin Stange <kstange@pidgin.im>
parents:
25909
diff
changeset
|
1376 | _("Became idle") : |
| 15884 | 1377 | (events & PURPLE_POUNCE_AWAY) ? |
|
26467
ca1524dbcbf0
A patch from Jorge VillaseƱor which makes all pounces share a single window.
Kevin Stange <kstange@pidgin.im>
parents:
25909
diff
changeset
|
1378 | _("Went away") : |
| 15884 | 1379 | (events & PURPLE_POUNCE_MESSAGE_RECEIVED) ? |
|
26467
ca1524dbcbf0
A patch from Jorge VillaseƱor which makes all pounces share a single window.
Kevin Stange <kstange@pidgin.im>
parents:
25909
diff
changeset
|
1380 | _("Sent a message") : |
|
ca1524dbcbf0
A patch from Jorge VillaseƱor which makes all pounces share a single window.
Kevin Stange <kstange@pidgin.im>
parents:
25909
diff
changeset
|
1381 | _("Unknown.... Please report this!") |
|
ca1524dbcbf0
A patch from Jorge VillaseƱor which makes all pounces share a single window.
Kevin Stange <kstange@pidgin.im>
parents:
25909
diff
changeset
|
1382 | ); |
|
5875
493a921c0378
[gaim-migrate @ 6307]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
1383 | |
|
26467
ca1524dbcbf0
A patch from Jorge VillaseƱor which makes all pounces share a single window.
Kevin Stange <kstange@pidgin.im>
parents:
25909
diff
changeset
|
1384 | pidgin_notify_pounce_add(account, pounce, alias, tmp, reason, |
|
ca1524dbcbf0
A patch from Jorge VillaseƱor which makes all pounces share a single window.
Kevin Stange <kstange@pidgin.im>
parents:
25909
diff
changeset
|
1385 | purple_date_format_full(NULL)); |
|
ca1524dbcbf0
A patch from Jorge VillaseƱor which makes all pounces share a single window.
Kevin Stange <kstange@pidgin.im>
parents:
25909
diff
changeset
|
1386 | |
| 12934 | 1387 | g_free(tmp); |
|
5875
493a921c0378
[gaim-migrate @ 6307]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
1388 | } |
|
493a921c0378
[gaim-migrate @ 6307]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
1389 | |
| 15884 | 1390 | if (purple_pounce_action_is_enabled(pounce, "send-message")) |
|
9205
8c4dbbe6386f
[gaim-migrate @ 10000]
Christian Hammond <chipx86@chipx86.com>
parents:
9191
diff
changeset
|
1391 | { |
|
5875
493a921c0378
[gaim-migrate @ 6307]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
1392 | const char *message; |
|
493a921c0378
[gaim-migrate @ 6307]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
1393 | |
| 15884 | 1394 | message = purple_pounce_action_get_attribute(pounce, "send-message", |
|
5875
493a921c0378
[gaim-migrate @ 6307]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
1395 | "message"); |
|
493a921c0378
[gaim-migrate @ 6307]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
1396 | |
|
9205
8c4dbbe6386f
[gaim-migrate @ 10000]
Christian Hammond <chipx86@chipx86.com>
parents:
9191
diff
changeset
|
1397 | if (message != NULL) |
|
8c4dbbe6386f
[gaim-migrate @ 10000]
Christian Hammond <chipx86@chipx86.com>
parents:
9191
diff
changeset
|
1398 | { |
|
36076
a0e5b68ff4ef
Switch purple_serv_send_im to PurpleMessage
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35721
diff
changeset
|
1399 | PurpleMessage *pmsg; |
|
40541
9ceb8d25d4d9
PurpleMessage cleanups from hell
Gary Kramlich <grim@reaperworld.com>
parents:
40534
diff
changeset
|
1400 | const gchar *me; |
|
5875
493a921c0378
[gaim-migrate @ 6307]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
1401 | |
|
34662
f14347f38e3b
Refactor the remaining pidgin to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34627
diff
changeset
|
1402 | im = purple_conversations_find_im_with_account(pouncee, account); |
|
40541
9ceb8d25d4d9
PurpleMessage cleanups from hell
Gary Kramlich <grim@reaperworld.com>
parents:
40534
diff
changeset
|
1403 | me = purple_account_get_name_for_display(account); |
|
5875
493a921c0378
[gaim-migrate @ 6307]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
1404 | |
|
34662
f14347f38e3b
Refactor the remaining pidgin to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34627
diff
changeset
|
1405 | if (im == NULL) |
|
f14347f38e3b
Refactor the remaining pidgin to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34627
diff
changeset
|
1406 | im = purple_im_conversation_new(account, pouncee); |
|
5875
493a921c0378
[gaim-migrate @ 6307]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
1407 | |
|
40541
9ceb8d25d4d9
PurpleMessage cleanups from hell
Gary Kramlich <grim@reaperworld.com>
parents:
40534
diff
changeset
|
1408 | pmsg = purple_message_new_outgoing(me, pouncee, message, 0); |
|
36076
a0e5b68ff4ef
Switch purple_serv_send_im to PurpleMessage
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35721
diff
changeset
|
1409 | purple_serv_send_im(purple_account_get_connection(account), pmsg); |
|
36089
c035b9a63457
Use purple_conversation_write_system_message where appropriate
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
36076
diff
changeset
|
1410 | purple_conversation_write_message(PURPLE_CONVERSATION(im), pmsg); |
|
40541
9ceb8d25d4d9
PurpleMessage cleanups from hell
Gary Kramlich <grim@reaperworld.com>
parents:
40534
diff
changeset
|
1411 | g_object_unref(G_OBJECT(pmsg)); |
|
5875
493a921c0378
[gaim-migrate @ 6307]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
1412 | } |
|
493a921c0378
[gaim-migrate @ 6307]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
1413 | } |
|
493a921c0378
[gaim-migrate @ 6307]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
1414 | |
| 15884 | 1415 | if (purple_pounce_action_is_enabled(pounce, "execute-command")) |
|
9205
8c4dbbe6386f
[gaim-migrate @ 10000]
Christian Hammond <chipx86@chipx86.com>
parents:
9191
diff
changeset
|
1416 | { |
|
5875
493a921c0378
[gaim-migrate @ 6307]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
1417 | const char *command; |
|
493a921c0378
[gaim-migrate @ 6307]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
1418 | |
| 15884 | 1419 | command = purple_pounce_action_get_attribute(pounce, |
|
10921
44adf364b1e7
[gaim-migrate @ 12688]
Daniel Atallah <datallah@pidgin.im>
parents:
10913
diff
changeset
|
1420 | "execute-command", "command"); |
|
5875
493a921c0378
[gaim-migrate @ 6307]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
1421 | |
|
10921
44adf364b1e7
[gaim-migrate @ 12688]
Daniel Atallah <datallah@pidgin.im>
parents:
10913
diff
changeset
|
1422 | if (command != NULL) |
|
9205
8c4dbbe6386f
[gaim-migrate @ 10000]
Christian Hammond <chipx86@chipx86.com>
parents:
9191
diff
changeset
|
1423 | { |
|
33375
6fd4e9f0884e
Use g_spawn_command_line_async for pounces.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33212
diff
changeset
|
1424 | GError *error = NULL; |
|
6fd4e9f0884e
Use g_spawn_command_line_async for pounces.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33212
diff
changeset
|
1425 | if (!g_spawn_command_line_async(command, &error)) { |
|
6fd4e9f0884e
Use g_spawn_command_line_async for pounces.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33212
diff
changeset
|
1426 | purple_debug_error("gtkpounce", |
|
6fd4e9f0884e
Use g_spawn_command_line_async for pounces.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33212
diff
changeset
|
1427 | "pounce command could not be launched: %s\n", |
|
6fd4e9f0884e
Use g_spawn_command_line_async for pounces.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33212
diff
changeset
|
1428 | error->message); |
|
6fd4e9f0884e
Use g_spawn_command_line_async for pounces.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33212
diff
changeset
|
1429 | g_error_free(error); |
|
5875
493a921c0378
[gaim-migrate @ 6307]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
1430 | } |
|
493a921c0378
[gaim-migrate @ 6307]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
1431 | } |
|
493a921c0378
[gaim-migrate @ 6307]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
1432 | } |
|
493a921c0378
[gaim-migrate @ 6307]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
1433 | } |
|
493a921c0378
[gaim-migrate @ 6307]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
1434 | |
|
493a921c0378
[gaim-migrate @ 6307]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
1435 | static void |
| 15884 | 1436 | free_pounce(PurplePounce *pounce) |
|
5875
493a921c0378
[gaim-migrate @ 6307]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
1437 | { |
| 12136 | 1438 | update_pounces(); |
|
5875
493a921c0378
[gaim-migrate @ 6307]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
1439 | } |
|
493a921c0378
[gaim-migrate @ 6307]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
1440 | |
|
493a921c0378
[gaim-migrate @ 6307]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
1441 | static void |
| 15884 | 1442 | new_pounce(PurplePounce *pounce) |
|
5875
493a921c0378
[gaim-migrate @ 6307]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
1443 | { |
| 15884 | 1444 | purple_pounce_action_register(pounce, "open-window"); |
| 1445 | purple_pounce_action_register(pounce, "popup-notify"); | |
| 1446 | purple_pounce_action_register(pounce, "send-message"); | |
| 1447 | purple_pounce_action_register(pounce, "execute-command"); | |
| 12136 | 1448 | |
| 1449 | update_pounces(); | |
| 1450 | } | |
| 1451 | ||
| 1452 | void * | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15496
diff
changeset
|
1453 | pidgin_pounces_get_handle() { |
| 12136 | 1454 | static int handle; |
| 1455 | ||
| 1456 | return &handle; | |
|
5875
493a921c0378
[gaim-migrate @ 6307]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
1457 | } |
|
493a921c0378
[gaim-migrate @ 6307]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
1458 | |
|
493a921c0378
[gaim-migrate @ 6307]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
1459 | void |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15496
diff
changeset
|
1460 | pidgin_pounces_init(void) |
|
5875
493a921c0378
[gaim-migrate @ 6307]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
1461 | { |
| 15884 | 1462 | purple_pounces_register_handler(PIDGIN_UI, pounce_cb, new_pounce, |
|
5875
493a921c0378
[gaim-migrate @ 6307]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
1463 | free_pounce); |
|
9206
57a4db675f8d
[gaim-migrate @ 10001]
Christian Hammond <chipx86@chipx86.com>
parents:
9205
diff
changeset
|
1464 | |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15931
diff
changeset
|
1465 | 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
|
1466 | 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
|
1467 | 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
|
1468 | 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
|
1469 | 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
|
1470 | 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
|
1471 | 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
|
1472 | 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
|
1473 | 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
|
1474 | 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
|
1475 | 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
|
1476 | 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
|
1477 | purple_prefs_add_int(PIDGIN_PREFS_ROOT "/pounces/dialog/height", 321); |
| 12136 | 1478 | |
| 15884 | 1479 | 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
|
1480 | pidgin_pounces_get_handle(), |
| 15884 | 1481 | PURPLE_CALLBACK(signed_on_off_cb), NULL); |
| 1482 | 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
|
1483 | pidgin_pounces_get_handle(), |
| 15884 | 1484 | PURPLE_CALLBACK(signed_on_off_cb), NULL); |
|
5875
493a921c0378
[gaim-migrate @ 6307]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
1485 | } |