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