Mercurial > pidgin
annotate src/prefs.c @ 4243:eae97ca4bbea
[gaim-migrate @ 4493]
Guess what?
Another SSI patch!
This one fixes the automatic deletion of empty groups upon signin.
The problem was that apparently WinICQ handles empty groups slightly
differently than WinAIM. It's all good now.
Uh, I fixed some comments.
Oh, and moving a buddy that you've requested authorization from to
a different group. I don't know if that used to give you the dialog
that prompted if you wanted to send another auth request, but it
shouldn't anymore (as long as you have sent 1 auth request).
I also changed the button title for ICQ's receive contacts. I changed
it from "Deny" to "Decline." Thanks to Nathan for pointing that out.
I am to Time Warner as spiders are to the bottom of my shoe.
committer: Tailor Script <tailor@pidgin.im>
| author | Mark Doliner <mark@kingant.net> |
|---|---|
| date | Wed, 08 Jan 2003 04:06:20 +0000 |
| parents | cc14954cc399 |
| children | a723d060620a |
| rev | line source |
|---|---|
| 1 | 1 /* |
| 2 * gaim | |
| 3 * | |
| 3434 | 4 * Copyright (C) 1998-2002, Mark Spencer <markster@marko.net> |
| 1 | 5 * |
| 6 * This program is free software; you can redistribute it and/or modify | |
| 7 * it under the terms of the GNU General Public License as published by | |
| 8 * the Free Software Foundation; either version 2 of the License, or | |
| 9 * (at your option) any later version. | |
| 10 * | |
| 11 * This program is distributed in the hope that it will be useful, | |
| 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 14 * GNU General Public License for more details. | |
| 15 * | |
| 16 * You should have received a copy of the GNU General Public License | |
| 17 * along with this program; if not, write to the Free Software | |
| 18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
| 19 * | |
| 20 */ | |
| 21 | |
|
349
b402a23f35df
[gaim-migrate @ 359]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
340
diff
changeset
|
22 #ifdef HAVE_CONFIG_H |
|
2090
b66aca8e8dce
[gaim-migrate @ 2100]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2074
diff
changeset
|
23 #include <config.h> |
|
349
b402a23f35df
[gaim-migrate @ 359]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
340
diff
changeset
|
24 #endif |
| 1 | 25 #include <string.h> |
| 26 #include <sys/time.h> | |
| 27 | |
| 28 #include <sys/types.h> | |
| 29 #include <sys/stat.h> | |
| 30 | |
| 31 #include <unistd.h> | |
| 32 #include <stdio.h> | |
| 33 #include <stdlib.h> | |
| 970 | 34 #include <stdarg.h> |
| 3379 | 35 #include <ctype.h> |
| 1 | 36 #include <gtk/gtk.h> |
|
1780
d7cbedd1d651
[gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1773
diff
changeset
|
37 #include "gtkimhtml.h" |
| 1 | 38 #include "gaim.h" |
|
1357
783ba886b6b6
[gaim-migrate @ 1367]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1324
diff
changeset
|
39 #include "prpl.h" |
| 3366 | 40 #include "proxy.h" |
| 41 | |
|
4026
a997156437b6
[gaim-migrate @ 4230]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4010
diff
changeset
|
42 #ifdef _WIN32 |
|
a997156437b6
[gaim-migrate @ 4230]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4010
diff
changeset
|
43 #include "win32dep.h" |
|
a997156437b6
[gaim-migrate @ 4230]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4010
diff
changeset
|
44 #endif |
|
a997156437b6
[gaim-migrate @ 4230]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4010
diff
changeset
|
45 |
| 3567 | 46 GtkWidget *tree_v = NULL; |
|
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
47 GtkWidget *prefs_away_list = NULL; |
|
1109
c73736fa0b7c
[gaim-migrate @ 1119]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1087
diff
changeset
|
48 GtkWidget *prefs_away_menu = NULL; |
|
1124
a70d5200edde
[gaim-migrate @ 1134]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1123
diff
changeset
|
49 GtkWidget *preftree = NULL; |
| 3366 | 50 GtkWidget *fontseld = NULL; |
| 51 | |
| 3379 | 52 GtkListStore *prefs_away_store = NULL; |
| 3366 | 53 |
| 54 static int sound_row_sel = 0; | |
| 55 static char *last_sound_dir = NULL; | |
| 56 | |
| 57 static GtkWidget *sounddialog = NULL; | |
| 58 static GtkWidget *browser_entry = NULL; | |
| 59 static GtkWidget *sound_entry = NULL; | |
| 60 static GtkWidget *away_text = NULL; | |
|
1124
a70d5200edde
[gaim-migrate @ 1134]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1123
diff
changeset
|
61 GtkCTreeNode *general_node = NULL; |
|
a70d5200edde
[gaim-migrate @ 1134]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1123
diff
changeset
|
62 GtkCTreeNode *deny_node = NULL; |
| 2254 | 63 GtkWidget *prefs_proxy_frame = NULL; |
|
4026
a997156437b6
[gaim-migrate @ 4230]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4010
diff
changeset
|
64 GtkWidget *gaim_button(const char *, guint *, int, GtkWidget *); |
| 3427 | 65 GtkWidget *gaim_labeled_spin_button(GtkWidget *, const gchar *, int*, int, int, GtkSizeGroup *); |
| 3366 | 66 static GtkWidget *gaim_dropdown(GtkWidget *, const gchar *, int *, int, ...); |
| 67 static GtkWidget *show_color_pref(GtkWidget *, gboolean); | |
| 68 static void delete_prefs(GtkWidget *, void *); | |
| 69 void set_default_away(GtkWidget *, gpointer); | |
| 1026 | 70 |
| 3366 | 71 struct debug_window *dw = NULL; |
| 3565 | 72 GtkWidget *prefs = NULL; |
| 3366 | 73 GtkWidget *debugbutton = NULL; |
| 3565 | 74 static int notebook_page = 0; |
| 75 static GtkTreeIter plugin_iter; | |
|
1525
ba8e6e211af5
[gaim-migrate @ 1535]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1455
diff
changeset
|
76 |
| 3630 | 77 /* |
| 78 * PROTOTYPES | |
| 79 */ | |
| 80 GtkTreeIter *prefs_notebook_add_page(char*, GdkPixbuf*, GtkWidget*, GtkTreeIter*, GtkTreeIter*, int); | |
| 81 | |
| 3366 | 82 void delete_prefs(GtkWidget *asdf, void *gdsa) { |
| 4215 | 83 GList *l = plugins; |
| 84 struct gaim_plugin *plug; | |
| 85 | |
| 4064 | 86 save_prefs(); |
| 3485 | 87 prefs = NULL; |
| 3567 | 88 tree_v = NULL; |
| 3485 | 89 sound_entry = NULL; |
| 90 browser_entry = NULL; | |
| 3526 | 91 debugbutton = NULL; |
| 92 prefs_away_menu = NULL; | |
| 3565 | 93 notebook_page = 0; |
| 3485 | 94 if(sounddialog) |
| 3379 | 95 gtk_widget_destroy(sounddialog); |
| 3500 | 96 g_object_unref(G_OBJECT(prefs_away_store)); |
| 4215 | 97 while(l) { |
| 98 plug = l->data; | |
| 99 if(plug->iter) { | |
| 100 g_free(plug->iter); | |
| 101 plug->iter = NULL; | |
| 102 } | |
| 103 l = l->next; | |
| 104 } | |
|
1525
ba8e6e211af5
[gaim-migrate @ 1535]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1455
diff
changeset
|
105 } |
|
ba8e6e211af5
[gaim-migrate @ 1535]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1455
diff
changeset
|
106 |
| 3366 | 107 GtkWidget *preflabel; |
| 108 GtkWidget *prefsnotebook; | |
| 109 GtkTreeStore *prefstree; | |
|
1750
d2eca7a46cfd
[gaim-migrate @ 1760]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1711
diff
changeset
|
110 |
| 3818 | 111 static void set_misc_option(); |
| 112 static void set_logging_option(); | |
| 113 static void set_blist_option(); | |
| 114 static void set_convo_option(); | |
| 115 static void set_im_option(); | |
| 116 static void set_chat_option(); | |
| 117 static void set_font_option(); | |
| 118 static void set_sound_option(); | |
| 119 static void set_away_option(); | |
|
1750
d2eca7a46cfd
[gaim-migrate @ 1760]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1711
diff
changeset
|
120 |
|
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
121 #define PROXYHOST 0 |
|
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
122 #define PROXYPORT 1 |
|
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
123 #define PROXYTYPE 2 |
|
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
124 #define PROXYUSER 3 |
|
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
125 #define PROXYPASS 4 |
|
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
126 static void proxy_print_option(GtkEntry *entry, int entrynum) |
|
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
127 { |
|
2372
2927c2c26fe6
[gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2323
diff
changeset
|
128 if (entrynum == PROXYHOST) |
|
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
129 g_snprintf(proxyhost, sizeof(proxyhost), "%s", gtk_entry_get_text(entry)); |
|
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
130 else if (entrynum == PROXYPORT) |
|
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
131 proxyport = atoi(gtk_entry_get_text(entry)); |
|
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
132 else if (entrynum == PROXYUSER) |
|
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
133 g_snprintf(proxyuser, sizeof(proxyuser), "%s", gtk_entry_get_text(entry)); |
|
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
134 else if (entrynum == PROXYPASS) |
|
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
135 g_snprintf(proxypass, sizeof(proxypass), "%s", gtk_entry_get_text(entry)); |
| 4137 | 136 proxy_info_is_from_gaimrc = 1; /* If the user specifies it, we want |
| 137 to save it */ | |
|
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
138 } |
|
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
139 |
| 3366 | 140 |
| 3565 | 141 GtkWidget *make_frame(GtkWidget *ret, char *text) { |
| 3427 | 142 GtkWidget *vbox, *label, *hbox; |
| 143 char labeltext[256]; | |
| 3500 | 144 |
| 3427 | 145 vbox = gtk_vbox_new(FALSE, 6); |
| 146 gtk_box_pack_start(GTK_BOX(ret), vbox, FALSE, FALSE, 0); | |
| 147 label = gtk_label_new(NULL); | |
| 148 g_snprintf(labeltext, sizeof(labeltext), "<span weight=\"bold\">%s</span>", text); | |
| 149 gtk_label_set_markup(GTK_LABEL(label), labeltext); | |
| 150 gtk_misc_set_alignment(GTK_MISC(label), 0, 0); | |
| 151 gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0); | |
| 152 hbox = gtk_hbox_new(FALSE, 6); | |
| 153 gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0); | |
| 154 label = gtk_label_new(" "); | |
| 155 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); | |
| 156 vbox = gtk_vbox_new(FALSE, 6); | |
| 157 gtk_box_pack_start(GTK_BOX(hbox), vbox, FALSE, FALSE, 0); | |
| 158 return vbox; | |
| 159 } | |
| 160 | |
| 3366 | 161 /* OK, Apply and Cancel */ |
| 162 | |
| 3427 | 163 |
| 3366 | 164 static void pref_nb_select(GtkTreeSelection *sel, GtkNotebook *nb) { |
| 165 GtkTreeIter iter; | |
| 3427 | 166 char text[128]; |
| 3366 | 167 GValue val = { 0, }; |
| 168 GtkTreeModel *model = GTK_TREE_MODEL(prefstree); | |
| 3500 | 169 |
| 3366 | 170 if (! gtk_tree_selection_get_selected (sel, &model, &iter)) |
| 171 return; | |
| 172 gtk_tree_model_get_value (model, &iter, 1, &val); | |
| 3500 | 173 g_snprintf(text, sizeof(text), "<span weight=\"bold\" size=\"larger\">%s</span>", |
| 3427 | 174 g_value_get_string(&val)); |
| 175 gtk_label_set_markup (GTK_LABEL(preflabel), text); | |
| 3366 | 176 g_value_unset (&val); |
| 177 gtk_tree_model_get_value (model, &iter, 2, &val); | |
| 178 gtk_notebook_set_current_page (GTK_NOTEBOOK (prefsnotebook), g_value_get_int (&val)); | |
| 179 | |
| 180 } | |
| 181 | |
| 182 /* These are the pages in the preferences notebook */ | |
| 183 GtkWidget *interface_page() { | |
| 184 GtkWidget *ret; | |
|
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
185 GtkWidget *vbox; |
| 3427 | 186 ret = gtk_vbox_new(FALSE, 18); |
| 187 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
| 3366 | 188 |
| 3427 | 189 vbox = make_frame(ret, _("Interface Options")); |
| 190 /* This shouldn't have to wait for user to click OK or APPLY or whatnot */ | |
| 191 /* This really shouldn't be in preferences at all */ | |
| 4045 | 192 debugbutton = gaim_button(_("Show _debug window"), &misc_options, OPT_MISC_DEBUG, vbox); |
| 3500 | 193 |
| 4227 | 194 gaim_button(_("D_isplay remote nicknames if no alias is set"), &misc_options, OPT_MISC_USE_SERVER_ALIAS, vbox); |
| 195 | |
| 3366 | 196 |
| 3427 | 197 gtk_widget_show_all(ret); |
| 3366 | 198 return ret; |
| 199 } | |
| 200 | |
| 201 GtkWidget *font_page() { | |
| 202 GtkWidget *ret; | |
| 203 GtkWidget *button; | |
| 204 GtkWidget *vbox, *hbox; | |
| 205 GtkWidget *select = NULL; | |
| 3427 | 206 GtkSizeGroup *sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); |
| 3500 | 207 |
| 3427 | 208 ret = gtk_vbox_new(FALSE, 18); |
| 209 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
| 3500 | 210 |
| 3427 | 211 vbox = make_frame(ret, _("Style")); |
| 3818 | 212 gaim_button(_("_Bold"), &font_options, OPT_FONT_BOLD, vbox); |
| 213 gaim_button(_("_Italics"), &font_options, OPT_FONT_ITALIC, vbox); | |
| 214 gaim_button(_("_Underline"), &font_options, OPT_FONT_UNDERLINE, vbox); | |
| 215 gaim_button(_("_Strikethough"), &font_options, OPT_FONT_STRIKE, vbox); | |
| 3500 | 216 |
| 3427 | 217 vbox = make_frame(ret, _("Face")); |
| 218 hbox = gtk_hbox_new(FALSE, 6); | |
| 219 gtk_container_add(GTK_CONTAINER(vbox), hbox); | |
| 3818 | 220 button = gaim_button(_("Use custo_m face"), &font_options, OPT_FONT_FACE, hbox); |
| 3427 | 221 gtk_size_group_add_widget(sg, button); |
| 222 select = gtk_button_new_from_stock(GTK_STOCK_SELECT_FONT); | |
| 3366 | 223 |
| 3818 | 224 if (!(font_options & OPT_FONT_FACE)) |
| 3366 | 225 gtk_widget_set_sensitive(GTK_WIDGET(select), FALSE); |
|
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
226 g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(toggle_sensitive), select); |
|
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
227 g_signal_connect(GTK_OBJECT(select), "clicked", G_CALLBACK(show_font_dialog), NULL); |
| 3366 | 228 gtk_box_pack_start(GTK_BOX(hbox), select, FALSE, FALSE, 0); |
| 229 | |
| 230 hbox = gtk_hbox_new(FALSE, 5); | |
| 231 gtk_container_add(GTK_CONTAINER(vbox), hbox); | |
| 3818 | 232 button = gaim_button(_("Use custom si_ze"), &font_options, OPT_FONT_SIZE, hbox); |
| 3427 | 233 gtk_size_group_add_widget(sg, button); |
| 3818 | 234 select = gaim_labeled_spin_button(hbox, NULL, &fontsize, 1, 7, NULL); |
| 235 if (!(font_options & OPT_FONT_SIZE)) | |
| 3366 | 236 gtk_widget_set_sensitive(GTK_WIDGET(select), FALSE); |
|
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
237 g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(toggle_sensitive), select); |
| 3366 | 238 |
| 3500 | 239 vbox = make_frame(ret, _("Color")); |
| 3366 | 240 hbox = gtk_hbox_new(FALSE, 5); |
| 241 gtk_container_add(GTK_CONTAINER(vbox), hbox); | |
| 3500 | 242 |
| 243 | |
| 3818 | 244 button = gaim_button(_("_Text color"), &font_options, OPT_FONT_FGCOL, hbox); |
| 3427 | 245 gtk_size_group_add_widget(sg, button); |
| 246 | |
| 247 select = gtk_button_new_from_stock(GTK_STOCK_SELECT_COLOR); | |
| 248 gtk_box_pack_start(GTK_BOX(hbox), select, FALSE, FALSE, 0); | |
| 3366 | 249 pref_fg_picture = show_color_pref(hbox, TRUE); |
|
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
250 g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(update_color), |
| 3366 | 251 pref_fg_picture); |
| 3427 | 252 |
| 3818 | 253 if (!(font_options & OPT_FONT_FGCOL)) |
| 3366 | 254 gtk_widget_set_sensitive(GTK_WIDGET(select), FALSE); |
|
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
255 g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(toggle_sensitive), select); |
|
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
256 g_signal_connect(GTK_OBJECT(select), "clicked", G_CALLBACK(show_fgcolor_dialog), NULL); |
| 3366 | 257 hbox = gtk_hbox_new(FALSE, 5); |
| 258 gtk_container_add(GTK_CONTAINER(vbox), hbox); | |
| 3500 | 259 |
| 3818 | 260 button = gaim_button(_("Bac_kground color"), &font_options, OPT_FONT_BGCOL, hbox); |
| 3427 | 261 gtk_size_group_add_widget(sg, button); |
| 262 select = gtk_button_new_from_stock(GTK_STOCK_SELECT_COLOR); | |
| 263 gtk_box_pack_start(GTK_BOX(hbox), select, FALSE, FALSE, 0); | |
| 3366 | 264 pref_bg_picture = show_color_pref(hbox, FALSE); |
|
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
265 g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(update_color), |
| 3366 | 266 pref_bg_picture); |
| 3472 | 267 |
| 3818 | 268 if (!(font_options & OPT_FONT_BGCOL)) |
| 3366 | 269 gtk_widget_set_sensitive(GTK_WIDGET(select), FALSE); |
|
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
270 g_signal_connect(GTK_OBJECT(select), "clicked", G_CALLBACK(show_bgcolor_dialog), NULL); |
|
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
271 g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(toggle_sensitive), select); |
| 3366 | 272 |
| 3427 | 273 gtk_widget_show_all(ret); |
| 3366 | 274 return ret; |
| 275 } | |
| 276 | |
| 277 | |
| 278 GtkWidget *messages_page() { | |
| 279 GtkWidget *ret; | |
| 280 GtkWidget *vbox; | |
| 3427 | 281 ret = gtk_vbox_new(FALSE, 18); |
| 282 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
| 3366 | 283 |
| 3427 | 284 vbox = make_frame (ret, _("Display")); |
| 3818 | 285 gaim_button(_("Show graphical _smileys"), &convo_options, OPT_CONVO_SHOW_SMILEY, vbox); |
| 286 gaim_button(_("Show _timestamp on messages"), &convo_options, OPT_CONVO_SHOW_TIME, vbox); | |
| 287 gaim_button(_("Show _URLs as links"), &convo_options, OPT_CONVO_SEND_LINKS, vbox); | |
| 3803 | 288 #ifdef USE_GTKSPELL |
| 3818 | 289 gaim_button(_("_Highlight misspelled words"), &convo_options, OPT_CONVO_CHECK_SPELLING, vbox); |
| 3803 | 290 #endif |
| 3427 | 291 vbox = make_frame (ret, _("Ignore")); |
| 3818 | 292 gaim_button(_("Ignore c_olors"), &convo_options, OPT_CONVO_IGNORE_COLOUR, vbox); |
| 293 gaim_button(_("Ignore font _faces"), &convo_options, OPT_CONVO_IGNORE_FONTS, vbox); | |
| 294 gaim_button(_("Ignore font si_zes"), &convo_options, OPT_CONVO_IGNORE_SIZES, vbox); | |
| 295 /* gaim_button(_("Ignore Ti_K Automated Messages"), &away_options, OPT_AWAY_TIK_HACK, vbox); */ | |
| 3500 | 296 |
| 3427 | 297 gtk_widget_show_all(ret); |
| 3366 | 298 return ret; |
| 299 } | |
| 300 | |
| 301 GtkWidget *hotkeys_page() { | |
| 302 GtkWidget *ret; | |
| 303 GtkWidget *vbox; | |
| 3427 | 304 ret = gtk_vbox_new(FALSE, 18); |
| 305 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
| 3366 | 306 |
| 3427 | 307 vbox = make_frame(ret, _("Send Message")); |
| 3818 | 308 gaim_button(_("_Enter sends message"), &convo_options, OPT_CONVO_ENTER_SENDS, vbox); |
| 309 gaim_button(_("C_ontrol-Enter sends message"), &convo_options, OPT_CONVO_CTL_ENTER, vbox); | |
| 3500 | 310 |
| 3427 | 311 vbox = make_frame (ret, _("Window Closing")); |
| 3818 | 312 gaim_button(_("E_scape closes window"), &convo_options, OPT_CONVO_ESC_CAN_CLOSE, vbox); |
| 313 gaim_button(_("Control-_W closes window"), &convo_options, OPT_CONVO_CTL_W_CLOSES, vbox); | |
| 3366 | 314 |
| 3427 | 315 vbox = make_frame(ret, "Insertions"); |
| 3818 | 316 gaim_button(_("Control-{B/I/U/S} inserts _HTML tags"), &convo_options, OPT_CONVO_CTL_CHARS, vbox); |
| 317 gaim_button(_("Control-(number) inserts _smileys"), &convo_options, OPT_CONVO_CTL_SMILEYS, vbox); | |
|
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
318 |
| 3427 | 319 gtk_widget_show_all(ret); |
| 3366 | 320 return ret; |
| 321 } | |
| 322 | |
| 323 GtkWidget *list_page() { | |
| 324 GtkWidget *ret; | |
| 325 GtkWidget *vbox; | |
| 3427 | 326 ret = gtk_vbox_new(FALSE, 18); |
| 327 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
| 3366 | 328 |
| 3427 | 329 vbox = make_frame (ret, _("Buttons")); |
| 3818 | 330 gaim_button(_("_Hide IM/Info/Chat buttons"), &blist_options, OPT_BLIST_NO_BUTTONS, vbox); |
| 331 gaim_button(_("Show _pictures on buttons"), &blist_options, OPT_BLIST_SHOW_BUTTON_XPM, vbox); | |
| 3366 | 332 |
| 3427 | 333 vbox = make_frame (ret, _("Buddy List Window")); |
| 4045 | 334 gaim_button(_("_Save window size/position"), &blist_options, OPT_BLIST_SAVED_WINDOWS, vbox); |
| 335 gaim_button(_("_Raise window on events"), &blist_options, OPT_BLIST_POPUP, vbox); | |
| 3366 | 336 |
| 3427 | 337 vbox = make_frame (ret, _("Group Display")); |
| 3818 | 338 gaim_button(_("Hide _groups with no online buddies"), &blist_options, OPT_BLIST_NO_MT_GRP, vbox); |
| 339 gaim_button(_("Show _numbers in groups"), &blist_options, OPT_BLIST_SHOW_GRPNUM, vbox); | |
| 3366 | 340 |
| 3427 | 341 vbox = make_frame (ret, _("Buddy Display")); |
| 3818 | 342 gaim_button(_("Show buddy type _icons"), &blist_options, OPT_BLIST_SHOW_PIXMAPS, vbox); |
| 343 gaim_button(_("Show _warning levels"), &blist_options, OPT_BLIST_SHOW_WARN, vbox); | |
| 344 gaim_button(_("Show idle _times"), &blist_options, OPT_BLIST_SHOW_IDLETIME, vbox); | |
| 345 gaim_button(_("Grey i_dle buddies"), &blist_options, OPT_BLIST_GREY_IDLERS, vbox); | |
| 3366 | 346 |
| 3427 | 347 gtk_widget_show_all(ret); |
| 3366 | 348 return ret; |
| 349 } | |
| 350 | |
| 351 GtkWidget *im_page() { | |
| 352 GtkWidget *ret; | |
| 3500 | 353 GtkWidget *vbox; |
| 3427 | 354 GtkWidget *typingbutton, *widge; |
| 355 GtkSizeGroup *sg; | |
| 3366 | 356 |
| 3427 | 357 ret = gtk_vbox_new(FALSE, 18); |
| 358 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
| 359 | |
| 360 sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); | |
| 361 | |
| 362 vbox = make_frame (ret, _("Window")); | |
| 4114 | 363 widge = gaim_dropdown(vbox, _("Show _buttons as:"), &im_options, OPT_IM_BUTTON_TEXT | OPT_IM_BUTTON_XPM, |
| 364 _("Pictures"), OPT_IM_BUTTON_XPM, | |
| 365 _("Text"), OPT_IM_BUTTON_TEXT, | |
| 366 _("Pictures and text"), OPT_IM_BUTTON_XPM | OPT_IM_BUTTON_TEXT, NULL); | |
| 3427 | 367 gtk_size_group_add_widget(sg, widge); |
| 368 gtk_misc_set_alignment(GTK_MISC(widge), 0, 0); | |
| 3818 | 369 gaim_labeled_spin_button(vbox, _("New window _width:"), &conv_size.width, 25, 9999, sg); |
| 370 gaim_labeled_spin_button(vbox, _("New window _height:"), &conv_size.height, 25, 9999, sg); | |
| 371 gaim_labeled_spin_button(vbox, _("_Entry widget height:"), &conv_size.entry_height, 25, 9999, sg); | |
| 372 gaim_button(_("_Raise windows on events"), &im_options, OPT_IM_POPUP, vbox); | |
| 373 gaim_button(_("Hide window on _send"), &im_options, OPT_IM_POPDOWN, vbox); | |
| 3366 | 374 gtk_widget_show (vbox); |
| 375 | |
| 3427 | 376 vbox = make_frame (ret, _("Buddy Icons")); |
| 4045 | 377 gaim_button(_("Hide buddy _icons"), &im_options, OPT_IM_HIDE_ICONS, vbox); |
| 378 gaim_button(_("Disable buddy icon a_nimation"), &im_options, OPT_IM_NO_ANIMATION, vbox); | |
| 3366 | 379 |
| 3427 | 380 vbox = make_frame (ret, _("Display")); |
| 3818 | 381 gaim_button(_("Show _logins in window"), &im_options, OPT_IM_LOGON, vbox); |
| 3366 | 382 |
| 3427 | 383 vbox = make_frame (ret, _("Typing Notification")); |
| 3818 | 384 typingbutton = gaim_button(_("Notify buddies that you are _typing to them"), &misc_options, |
| 3366 | 385 OPT_MISC_STEALTH_TYPING, vbox); |
| 386 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(typingbutton), !gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(typingbutton))); | |
| 3818 | 387 misc_options ^= OPT_MISC_STEALTH_TYPING; |
| 3366 | 388 |
| 3427 | 389 gtk_widget_show_all(ret); |
| 3366 | 390 return ret; |
| 391 } | |
| 392 | |
| 393 GtkWidget *chat_page() { | |
| 394 GtkWidget *ret; | |
| 395 GtkWidget *vbox; | |
| 3427 | 396 GtkWidget *dd; |
| 397 GtkSizeGroup *sg; | |
| 3366 | 398 |
| 3427 | 399 ret = gtk_vbox_new(FALSE, 18); |
| 400 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
| 3500 | 401 |
| 3427 | 402 sg = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL); |
| 3366 | 403 |
| 3427 | 404 vbox = make_frame (ret, _("Window")); |
| 4114 | 405 dd = gaim_dropdown(vbox, _("Show _buttons as:"), &chat_options, OPT_CHAT_BUTTON_TEXT | OPT_CHAT_BUTTON_XPM, |
| 406 _("Pictures"), OPT_CHAT_BUTTON_XPM, | |
| 407 _("Text"), OPT_CHAT_BUTTON_TEXT, | |
| 408 _("Pictures and text"), OPT_CHAT_BUTTON_XPM | OPT_CHAT_BUTTON_TEXT, NULL); | |
| 3427 | 409 gtk_size_group_add_widget(sg, dd); |
| 410 gtk_misc_set_alignment(GTK_MISC(dd), 0, 0); | |
| 3818 | 411 gaim_labeled_spin_button(vbox, _("New window _width:"), &buddy_chat_size.width, 25, 9999, sg); |
| 412 gaim_labeled_spin_button(vbox, _("New window _height:"), &buddy_chat_size.height, 25, 9999, sg); | |
| 413 gaim_labeled_spin_button(vbox, _("_Entry widget height:"), &buddy_chat_size.entry_height, 25, 9999, sg); | |
| 414 gaim_button(_("_Raise windows on events"), &chat_options, OPT_CHAT_POPUP, vbox); | |
| 3366 | 415 |
| 3427 | 416 vbox = make_frame (ret, _("Tab Completion")); |
| 4045 | 417 gaim_button(_("_Tab-complete nicks"), &chat_options, OPT_CHAT_TAB_COMPLETE, vbox); |
| 418 gaim_button(_("_Old-style tab completion"), &chat_options, OPT_CHAT_OLD_STYLE_TAB, vbox); | |
| 3427 | 419 |
| 420 vbox = make_frame (ret, _("Display")); | |
| 3818 | 421 gaim_button(_("_Show people joining/leaving in window"), &chat_options, OPT_CHAT_LOGON, vbox); |
| 422 gaim_button(_("Co_lorize screennames"), &chat_options, OPT_CHAT_COLORIZE, vbox); | |
| 3427 | 423 |
| 424 gtk_widget_show_all(ret); | |
| 3366 | 425 return ret; |
| 426 } | |
|
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
427 |
| 3366 | 428 GtkWidget *tab_page() { |
| 429 GtkWidget *ret; | |
| 430 GtkWidget *vbox; | |
| 3427 | 431 GtkWidget *dd; |
| 432 GtkSizeGroup *sg; | |
| 433 ret = gtk_vbox_new(FALSE, 18); | |
| 434 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
| 3366 | 435 |
| 3427 | 436 sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); |
| 3500 | 437 |
| 3427 | 438 vbox = make_frame (ret, _("IM Tabs")); |
| 4114 | 439 dd = gaim_dropdown(vbox, _("Tab _placement:"), &im_options, OPT_IM_SIDE_TAB | OPT_IM_BR_TAB, |
| 440 _("Top"), 0, | |
| 441 _("Bottom"), OPT_IM_BR_TAB, | |
| 442 _("Left"), OPT_IM_SIDE_TAB, | |
| 443 _("Right"), OPT_IM_BR_TAB | OPT_IM_SIDE_TAB, NULL); | |
| 3427 | 444 gtk_size_group_add_widget(sg, dd); |
| 4045 | 445 gaim_button(_("Show all _instant messages in one tabbed\nwindow"), &im_options, OPT_IM_ONE_WINDOW, vbox); |
| 3818 | 446 gaim_button(_("Show a_liases in tabs/titles"), &im_options, OPT_IM_ALIAS_TAB, vbox); |
| 3366 | 447 |
| 3427 | 448 vbox = make_frame (ret, _("Chat Tabs")); |
| 4114 | 449 dd = gaim_dropdown(vbox, _("Tab _placement:"), &chat_options, OPT_CHAT_SIDE_TAB | OPT_CHAT_BR_TAB, |
| 450 _("Top"), 0, | |
| 451 _("Bottom"), OPT_CHAT_BR_TAB, | |
| 452 _("Left"), OPT_CHAT_SIDE_TAB, | |
| 453 _("Right"), OPT_CHAT_SIDE_TAB | OPT_CHAT_BR_TAB, NULL); | |
| 3427 | 454 gtk_size_group_add_widget(sg, dd); |
| 3818 | 455 gaim_button(_("Show all c_hats in one tabbed window"), &chat_options, OPT_CHAT_ONE_WINDOW, |
| 3366 | 456 vbox); |
|
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
457 |
| 3427 | 458 vbox = make_frame (ret, _("Combined Tabs")); |
| 3818 | 459 gaim_button(_("Show IMs and chats in _same tabbed\nwindow."), &convo_options, OPT_CONVO_COMBINE, vbox); |
| 3500 | 460 |
| 3427 | 461 vbox = make_frame (ret, _("Buddy List Tabs")); |
| 4114 | 462 dd = gaim_dropdown(vbox, _("Tab _placement:"), &blist_options, OPT_BLIST_BOTTOM_TAB, |
| 463 _("Top"), 0, | |
| 464 _("Bottom"), OPT_BLIST_BOTTOM_TAB, NULL); | |
| 3427 | 465 gtk_size_group_add_widget(sg, dd); |
| 3500 | 466 |
| 3427 | 467 gtk_widget_show_all(ret); |
| 3366 | 468 return ret; |
| 469 } | |
| 470 | |
| 471 GtkWidget *proxy_page() { | |
| 472 GtkWidget *ret; | |
| 473 GtkWidget *vbox; | |
| 474 GtkWidget *entry; | |
| 475 GtkWidget *label; | |
| 476 GtkWidget *hbox; | |
| 477 GtkWidget *table; | |
| 478 | |
| 3427 | 479 ret = gtk_vbox_new(FALSE, 18); |
| 480 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
| 3366 | 481 |
| 3427 | 482 vbox = make_frame (ret, _("Proxy Type")); |
| 4114 | 483 gaim_dropdown(vbox, _("Proxy _type:"), &proxytype, -1, |
| 484 _("No proxy"), PROXY_NONE, | |
| 3366 | 485 "SOCKS 4", PROXY_SOCKS4, |
| 486 "SOCKS 5", PROXY_SOCKS5, | |
| 487 "HTTP", PROXY_HTTP, NULL); | |
|
2372
2927c2c26fe6
[gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2323
diff
changeset
|
488 |
| 2254 | 489 table = gtk_table_new(2, 2, FALSE); |
| 490 gtk_container_set_border_width(GTK_CONTAINER(table), 5); | |
| 491 gtk_table_set_col_spacings(GTK_TABLE(table), 5); | |
| 492 gtk_table_set_row_spacings(GTK_TABLE(table), 5); | |
| 493 | |
| 3427 | 494 vbox = make_frame(ret, _("Proxy Server")); |
| 495 prefs_proxy_frame = vbox; | |
| 2254 | 496 |
| 497 if (proxytype == PROXY_NONE) | |
| 3427 | 498 gtk_widget_set_sensitive(GTK_WIDGET(vbox), FALSE); |
| 2254 | 499 |
| 500 table = gtk_table_new(2, 4, FALSE); | |
| 501 gtk_container_set_border_width(GTK_CONTAINER(table), 5); | |
| 502 gtk_table_set_col_spacings(GTK_TABLE(table), 5); | |
| 503 gtk_table_set_row_spacings(GTK_TABLE(table), 10); | |
| 3427 | 504 gtk_container_add(GTK_CONTAINER(vbox), table); |
| 2254 | 505 |
| 506 | |
| 3427 | 507 label = gtk_label_new_with_mnemonic(_("_Host")); |
| 2254 | 508 gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5); |
| 509 gtk_table_attach(GTK_TABLE(table), label, 0, 1, 0, 1, GTK_FILL, 0, 0, 0); | |
|
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
510 |
|
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
511 entry = gtk_entry_new(); |
| 3427 | 512 gtk_label_set_mnemonic_widget(GTK_LABEL(label), entry); |
| 3366 | 513 gtk_table_attach(GTK_TABLE(table), entry, 1, 2, 0, 1, GTK_FILL, 0, 0, 0); |
|
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
514 g_signal_connect(GTK_OBJECT(entry), "changed", |
|
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
515 G_CALLBACK(proxy_print_option), (void *)PROXYHOST); |
|
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
516 gtk_entry_set_text(GTK_ENTRY(entry), proxyhost); |
|
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
517 |
|
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
518 hbox = gtk_hbox_new(TRUE, 5); |
|
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
519 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); |
|
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
520 |
| 3427 | 521 label = gtk_label_new_with_mnemonic(_("Port")); |
| 2254 | 522 gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5); |
| 523 gtk_table_attach(GTK_TABLE(table), label, 0, 1, 1, 2, GTK_FILL, 0, 0, 0); | |
|
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
524 |
|
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
525 entry = gtk_entry_new(); |
| 3427 | 526 gtk_label_set_mnemonic_widget(GTK_LABEL(label), entry); |
| 3366 | 527 gtk_table_attach(GTK_TABLE(table), entry, 1, 2, 1, 2, GTK_FILL, 0, 0, 0); |
|
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
528 g_signal_connect(GTK_OBJECT(entry), "changed", |
|
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
529 G_CALLBACK(proxy_print_option), (void *)PROXYPORT); |
| 2254 | 530 |
|
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
531 if (proxyport) { |
|
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
532 char buf[128]; |
|
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
533 g_snprintf(buf, sizeof(buf), "%d", proxyport); |
|
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
534 gtk_entry_set_text(GTK_ENTRY(entry), buf); |
|
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
535 } |
|
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
536 |
| 3427 | 537 label = gtk_label_new_with_mnemonic(_("_User")); |
| 2254 | 538 gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5); |
| 539 gtk_table_attach(GTK_TABLE(table), label, 0, 1, 2, 3, GTK_FILL, 0, 0, 0); | |
|
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
540 |
|
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
541 entry = gtk_entry_new(); |
| 3427 | 542 gtk_label_set_mnemonic_widget(GTK_LABEL(label), entry); |
| 3366 | 543 gtk_table_attach(GTK_TABLE(table), entry, 1, 2, 2, 3, GTK_FILL, 0, 0, 0); |
|
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
544 g_signal_connect(GTK_OBJECT(entry), "changed", |
|
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
545 G_CALLBACK(proxy_print_option), (void *)PROXYUSER); |
|
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
546 gtk_entry_set_text(GTK_ENTRY(entry), proxyuser); |
|
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
547 |
|
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
548 hbox = gtk_hbox_new(TRUE, 5); |
|
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
549 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); |
|
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
550 |
| 3427 | 551 label = gtk_label_new_with_mnemonic(_("Pa_ssword")); |
| 2254 | 552 gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5); |
| 553 gtk_table_attach(GTK_TABLE(table), label, 0, 1, 3, 4, GTK_FILL, 0, 0, 0); | |
|
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
554 |
|
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
555 entry = gtk_entry_new(); |
| 3427 | 556 gtk_label_set_mnemonic_widget(GTK_LABEL(label), entry); |
| 3366 | 557 gtk_table_attach(GTK_TABLE(table), entry, 1, 2, 3, 4, GTK_FILL , 0, 0, 0); |
|
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
558 gtk_entry_set_visibility(GTK_ENTRY(entry), FALSE); |
|
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
559 g_signal_connect(GTK_OBJECT(entry), "changed", |
|
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
560 G_CALLBACK(proxy_print_option), (void *)PROXYPASS); |
|
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
561 gtk_entry_set_text(GTK_ENTRY(entry), proxypass); |
| 3500 | 562 |
| 3427 | 563 gtk_widget_show_all(ret); |
| 3366 | 564 return ret; |
|
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
565 } |
|
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
566 |
| 3821 | 567 #ifndef _WIN32 |
| 3432 | 568 static void browser_print_option(GtkEntry *entry, void *nullish) { |
| 3818 | 569 g_snprintf(web_command, sizeof(web_command), "%s", gtk_entry_get_text(entry)); |
| 3432 | 570 } |
| 3821 | 571 #endif |
| 3432 | 572 |
| 3366 | 573 GtkWidget *browser_page() { |
| 574 GtkWidget *ret; | |
| 3821 | 575 GtkWidget *vbox; |
| 576 #ifndef _WIN32 | |
| 577 GtkWidget *hbox; | |
| 578 #endif | |
| 3366 | 579 GtkWidget *label; |
| 3427 | 580 GtkSizeGroup *sg; |
| 581 | |
| 582 ret = gtk_vbox_new(FALSE, 18); | |
| 583 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
| 584 | |
| 585 sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); | |
| 3630 | 586 #ifndef _WIN32 |
| 587 /* Registered default browser is used by Windows */ | |
| 3427 | 588 vbox = make_frame (ret, _("Browser Selection")); |
| 4114 | 589 label = gaim_dropdown(vbox, _("_Browser"), &web_browser, -1, |
| 3427 | 590 "Netscape", BROWSER_NETSCAPE, |
| 591 "Konqueror", BROWSER_KONQ, | |
| 592 "Mozilla", BROWSER_MOZILLA, | |
| 4114 | 593 _("Manual"), BROWSER_MANUAL, |
| 3472 | 594 /* fixme: GNOME binary helper |
| 4114 | 595 _("GNOME URL Handler"), BROWSER_GNOME, */ |
| 3427 | 596 "Galeon", BROWSER_GALEON, |
| 597 "Opera", BROWSER_OPERA, NULL); | |
| 598 gtk_misc_set_alignment(GTK_MISC(label), 0, 0); | |
| 599 gtk_size_group_add_widget(sg, label); | |
|
915
378c862a2381
[gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
910
diff
changeset
|
600 |
| 3366 | 601 hbox = gtk_hbox_new(FALSE, 5); |
| 602 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); | |
| 3427 | 603 label = gtk_label_new_with_mnemonic("_Manual: "); |
| 3366 | 604 gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0); |
| 3427 | 605 gtk_misc_set_alignment(GTK_MISC(label), 0, 0); |
| 606 gtk_size_group_add_widget(sg, label); | |
| 3366 | 607 browser_entry = gtk_entry_new(); |
| 3427 | 608 gtk_label_set_mnemonic_widget(GTK_LABEL(label), browser_entry); |
| 3818 | 609 if (web_browser != BROWSER_MANUAL) |
| 3366 | 610 gtk_widget_set_sensitive(browser_entry, FALSE); |
| 611 gtk_box_pack_start (GTK_BOX (hbox), browser_entry, FALSE, FALSE, 0); | |
|
1750
d2eca7a46cfd
[gaim-migrate @ 1760]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1711
diff
changeset
|
612 |
| 3818 | 613 gtk_entry_set_text(GTK_ENTRY(browser_entry), web_command); |
|
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
614 g_signal_connect(GTK_OBJECT(browser_entry), "changed", |
|
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
615 G_CALLBACK(browser_print_option), NULL); |
| 3630 | 616 #endif /* end !_WIN32 */ |
| 3427 | 617 vbox = make_frame (ret, _("Browser Options")); |
| 3818 | 618 label = gaim_button(_("Open new _window by default"), &misc_options, OPT_MISC_BROWSER_POPUP, vbox); |
| 3630 | 619 #ifdef _WIN32 |
| 620 /* Until I figure out how to implement this on windows */ | |
| 621 gtk_widget_set_sensitive(label, FALSE); | |
| 622 #endif | |
| 3427 | 623 gtk_widget_show_all(ret); |
| 3366 | 624 return ret; |
| 3500 | 625 } |
| 3366 | 626 |
| 627 GtkWidget *logging_page() { | |
| 628 GtkWidget *ret; | |
| 629 GtkWidget *vbox; | |
| 3427 | 630 ret = gtk_vbox_new(FALSE, 18); |
| 631 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
|
915
378c862a2381
[gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
910
diff
changeset
|
632 |
| 3427 | 633 vbox = make_frame (ret, _("Message Logs")); |
| 4045 | 634 gaim_button(_("_Log all instant messages"), &logging_options, OPT_LOG_CONVOS, vbox); |
| 3818 | 635 gaim_button(_("Log all c_hats"), &logging_options, OPT_LOG_CHATS, vbox); |
| 636 gaim_button(_("Strip _HTML from logs"), &logging_options, OPT_LOG_STRIP_HTML, vbox); | |
|
2843
87d11d2a7d59
[gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2839
diff
changeset
|
637 |
| 3427 | 638 vbox = make_frame (ret, _("System Logs")); |
| 3818 | 639 gaim_button(_("Log when buddies _sign on/sign off"), &logging_options, OPT_LOG_BUDDY_SIGNON, |
| 3366 | 640 vbox); |
| 3818 | 641 gaim_button(_("Log when buddies become _idle/un-idle"), &logging_options, OPT_LOG_BUDDY_IDLE, |
| 3366 | 642 vbox); |
| 3818 | 643 gaim_button(_("Log when buddies go away/come _back"), &logging_options, OPT_LOG_BUDDY_AWAY, vbox); |
| 644 gaim_button(_("Log your _own signons/idleness/awayness"), &logging_options, OPT_LOG_MY_SIGNON, | |
| 3366 | 645 vbox); |
| 3818 | 646 gaim_button(_("I_ndividual log file for each buddy's signons"), &logging_options, |
| 3366 | 647 OPT_LOG_INDIVIDUAL, vbox); |
|
1757
3dfe4aefd366
[gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1755
diff
changeset
|
648 |
| 3427 | 649 gtk_widget_show_all(ret); |
| 3366 | 650 return ret; |
|
1757
3dfe4aefd366
[gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1755
diff
changeset
|
651 } |
|
3dfe4aefd366
[gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1755
diff
changeset
|
652 |
| 3366 | 653 static GtkWidget *sndcmd = NULL; |
|
1757
3dfe4aefd366
[gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1755
diff
changeset
|
654 |
| 3821 | 655 #ifndef _WIN32 |
| 4095 | 656 static gint sound_cmd_yeah(GtkEntry *entry, gpointer d) |
|
1813
998a6a032874
[gaim-migrate @ 1823]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1805
diff
changeset
|
657 { |
| 3818 | 658 g_snprintf(sound_cmd, sizeof(sound_cmd), "%s", gtk_entry_get_text(GTK_ENTRY(sndcmd))); |
| 3366 | 659 return TRUE; |
|
1813
998a6a032874
[gaim-migrate @ 1823]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1805
diff
changeset
|
660 } |
| 3821 | 661 #endif |
|
1813
998a6a032874
[gaim-migrate @ 1823]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1805
diff
changeset
|
662 |
| 3366 | 663 GtkWidget *sound_page() { |
| 664 GtkWidget *ret; | |
| 3821 | 665 GtkWidget *vbox; |
| 666 GtkSizeGroup *sg; | |
| 667 #ifndef _WIN32 | |
| 668 GtkWidget *dd; | |
| 669 GtkWidget *hbox; | |
|
1750
d2eca7a46cfd
[gaim-migrate @ 1760]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1711
diff
changeset
|
670 GtkWidget *label; |
| 3821 | 671 #endif |
| 3366 | 672 |
| 3427 | 673 ret = gtk_vbox_new(FALSE, 18); |
| 674 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
|
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
675 |
| 3427 | 676 sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); |
|
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
677 |
| 3427 | 678 vbox = make_frame (ret, _("Sound Options")); |
| 3818 | 679 gaim_button(_("_No sounds when you log in"), &sound_options, OPT_SOUND_SILENT_SIGNON, vbox); |
| 680 gaim_button(_("_Sounds while away"), &sound_options, OPT_SOUND_WHEN_AWAY, vbox); | |
|
2843
87d11d2a7d59
[gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2839
diff
changeset
|
681 |
| 3630 | 682 #ifndef _WIN32 |
| 3427 | 683 vbox = make_frame (ret, _("Sound Method")); |
| 4114 | 684 dd = gaim_dropdown(vbox, _("_Method"), &sound_options, OPT_SOUND_BEEP | |
| 3366 | 685 OPT_SOUND_ESD | OPT_SOUND_ARTSC | OPT_SOUND_NAS | OPT_SOUND_NORMAL | |
| 3500 | 686 OPT_SOUND_CMD, |
| 4114 | 687 _("Console beep"), OPT_SOUND_BEEP, |
| 3366 | 688 #ifdef ESD_SOUND |
| 3500 | 689 "ESD", OPT_SOUND_ESD, |
| 4082 | 690 #endif |
| 691 #ifdef ARTSC_SOUND | |
| 3366 | 692 "ArtsC", OPT_SOUND_ARTSC, |
| 4082 | 693 #endif |
| 694 #ifdef NAS_SOUND | |
| 3366 | 695 "NAS", OPT_SOUND_NAS, |
| 4082 | 696 #endif |
| 4114 | 697 _("Internal"), OPT_SOUND_NORMAL, |
| 698 _("Command"), OPT_SOUND_CMD, NULL); | |
| 3427 | 699 gtk_size_group_add_widget(sg, dd); |
| 700 gtk_misc_set_alignment(GTK_MISC(dd), 0, 0); | |
|
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
701 |
|
1813
998a6a032874
[gaim-migrate @ 1823]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1805
diff
changeset
|
702 hbox = gtk_hbox_new(FALSE, 5); |
|
998a6a032874
[gaim-migrate @ 1823]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1805
diff
changeset
|
703 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 5); |
| 3427 | 704 |
| 3366 | 705 hbox = gtk_hbox_new(FALSE, 5); |
| 706 gtk_container_add(GTK_CONTAINER(vbox), hbox); | |
| 3500 | 707 label = gtk_label_new_with_mnemonic(_("Sound c_ommand\n(%s for filename)")); |
| 3427 | 708 gtk_size_group_add_widget(sg, label); |
| 709 gtk_misc_set_alignment(GTK_MISC(label), 0, 0); | |
| 3366 | 710 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 5); |
|
915
378c862a2381
[gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
910
diff
changeset
|
711 |
| 3366 | 712 sndcmd = gtk_entry_new(); |
| 3427 | 713 gtk_label_set_mnemonic_widget(GTK_LABEL(label), sndcmd); |
|
1813
998a6a032874
[gaim-migrate @ 1823]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1805
diff
changeset
|
714 |
| 3366 | 715 gtk_entry_set_editable(GTK_ENTRY(sndcmd), TRUE); |
| 716 gtk_entry_set_text(GTK_ENTRY(sndcmd), sound_cmd); | |
| 717 gtk_widget_set_size_request(sndcmd, 75, -1); | |
| 3427 | 718 |
| 3818 | 719 gtk_widget_set_sensitive(sndcmd, (sound_options & OPT_SOUND_CMD)); |
| 3366 | 720 gtk_box_pack_start(GTK_BOX(hbox), sndcmd, TRUE, TRUE, 5); |
|
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
721 g_signal_connect(GTK_OBJECT(sndcmd), "changed", G_CALLBACK(sound_cmd_yeah), NULL); |
| 3630 | 722 #endif /* _WIN32 */ |
| 3427 | 723 gtk_widget_show_all(ret); |
| 3366 | 724 return ret; |
|
2262
9c8f353331e7
[gaim-migrate @ 2272]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2254
diff
changeset
|
725 } |
|
9c8f353331e7
[gaim-migrate @ 2272]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2254
diff
changeset
|
726 |
| 3366 | 727 GtkWidget *away_page() { |
| 728 GtkWidget *ret; | |
|
2262
9c8f353331e7
[gaim-migrate @ 2272]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2254
diff
changeset
|
729 GtkWidget *vbox; |
|
9c8f353331e7
[gaim-migrate @ 2272]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2254
diff
changeset
|
730 GtkWidget *hbox; |
| 3366 | 731 GtkWidget *label; |
|
2262
9c8f353331e7
[gaim-migrate @ 2272]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2254
diff
changeset
|
732 GtkWidget *button; |
| 3366 | 733 GtkWidget *select; |
| 3427 | 734 GtkWidget *dd; |
| 735 GtkSizeGroup *sg; | |
|
2262
9c8f353331e7
[gaim-migrate @ 2272]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2254
diff
changeset
|
736 |
| 3427 | 737 ret = gtk_vbox_new(FALSE, 18); |
| 738 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
|
2262
9c8f353331e7
[gaim-migrate @ 2272]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2254
diff
changeset
|
739 |
| 3427 | 740 sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); |
|
1813
998a6a032874
[gaim-migrate @ 1823]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1805
diff
changeset
|
741 |
| 3427 | 742 vbox = make_frame (ret, _("Away")); |
| 3818 | 743 gaim_button(_("_Sending messages removes away status"), &away_options, OPT_AWAY_BACK_ON_IM, vbox); |
| 744 gaim_button(_("_Queue new messages when away"), &away_options, OPT_AWAY_QUEUE, vbox); | |
| 745 gaim_button(_("_Ignore new conversations when away"), &away_options, OPT_AWAY_DISCARD, vbox); | |
|
1813
998a6a032874
[gaim-migrate @ 1823]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1805
diff
changeset
|
746 |
| 3427 | 747 vbox = make_frame (ret, _("Auto-response")); |
| 3366 | 748 hbox = gtk_hbox_new(FALSE, 0); |
| 749 gtk_container_add(GTK_CONTAINER(vbox), hbox); | |
| 3427 | 750 gaim_labeled_spin_button(hbox, _("Seconds before _resending:"), |
| 3818 | 751 &away_resend, 1, 24 * 60 * 60, sg); |
| 752 gaim_button(_("_Don't send auto-response"), &away_options, OPT_AWAY_NO_AUTO_RESP, vbox); | |
| 753 gaim_button(_("_Only send auto-response when idle"), &away_options, OPT_AWAY_IDLE_RESP, vbox); | |
| 754 gaim_button(_("Do_n't send auto-response in active conversations"), &away_options, OPT_AWAY_DELAY_IN_USE, vbox); | |
|
1813
998a6a032874
[gaim-migrate @ 1823]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1805
diff
changeset
|
755 |
| 3818 | 756 if (away_options & OPT_AWAY_NO_AUTO_RESP) |
| 3366 | 757 gtk_widget_set_sensitive(hbox, FALSE); |
| 3500 | 758 |
| 3427 | 759 vbox = make_frame (ret, _("Idle")); |
| 4052 | 760 dd = gaim_dropdown(vbox, _("Idle _time reporting:"), &report_idle, -1, |
| 761 _("None"), IDLE_NONE, | |
| 762 _("Gaim usage"), IDLE_GAIM, | |
| 3366 | 763 #ifdef USE_SCREENSAVER |
|
3905
3e508dd31b76
[gaim-migrate @ 4058]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3902
diff
changeset
|
764 #ifndef _WIN32 |
| 4052 | 765 _("X usage"), IDLE_SCREENSAVER, |
|
3905
3e508dd31b76
[gaim-migrate @ 4058]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3902
diff
changeset
|
766 #else |
| 4052 | 767 _("Windows usage"), IDLE_SCREENSAVER, |
|
3905
3e508dd31b76
[gaim-migrate @ 4058]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3902
diff
changeset
|
768 #endif |
| 3366 | 769 #endif |
| 3427 | 770 NULL); |
| 771 gtk_size_group_add_widget(sg, dd); | |
| 772 gtk_misc_set_alignment(GTK_MISC(dd), 0, 0); | |
|
2385
bdc74764245c
[gaim-migrate @ 2398]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2372
diff
changeset
|
773 |
| 3427 | 774 vbox = make_frame (ret, _("Auto-away")); |
| 3818 | 775 button = gaim_button(_("Set away _when idle"), &away_options, OPT_AWAY_AUTO, vbox); |
| 4052 | 776 select = gaim_labeled_spin_button(vbox, _("_Minutes before setting away:"), &auto_away, 1, 24 * 60, sg); |
| 3818 | 777 if (!(away_options & OPT_AWAY_AUTO)) |
| 3366 | 778 gtk_widget_set_sensitive(GTK_WIDGET(select), FALSE); |
|
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
779 g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(toggle_sensitive), select); |
| 1 | 780 |
| 4052 | 781 label = gtk_label_new_with_mnemonic(_("Away m_essage:")); |
| 3427 | 782 gtk_size_group_add_widget(sg, label); |
| 783 gtk_misc_set_alignment(GTK_MISC(label), 0, 0); | |
| 3366 | 784 hbox = gtk_hbox_new(FALSE, 0); |
| 785 gtk_container_add(GTK_CONTAINER(vbox), hbox); | |
| 786 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); | |
| 787 prefs_away_menu = gtk_option_menu_new(); | |
| 3427 | 788 gtk_label_set_mnemonic_widget(GTK_LABEL(label), prefs_away_menu); |
| 3818 | 789 if (!(away_options & OPT_AWAY_AUTO)) |
| 3366 | 790 gtk_widget_set_sensitive(GTK_WIDGET(prefs_away_menu), FALSE); |
|
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
791 g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(toggle_sensitive), prefs_away_menu); |
| 3366 | 792 default_away_menu_init(prefs_away_menu); |
| 793 gtk_widget_show(prefs_away_menu); | |
| 794 gtk_box_pack_start(GTK_BOX(hbox), prefs_away_menu, FALSE, FALSE, 0); | |
| 3500 | 795 |
| 3427 | 796 gtk_widget_show_all(ret); |
| 3366 | 797 return ret; |
|
873
789df4b47508
[gaim-migrate @ 883]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
864
diff
changeset
|
798 } |
|
789df4b47508
[gaim-migrate @ 883]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
864
diff
changeset
|
799 |
| 3551 | 800 #if USE_PLUGINS |
| 801 GtkWidget *plugin_description=NULL, *plugin_details=NULL; | |
| 802 static void prefs_plugin_sel (GtkTreeSelection *sel, GtkTreeModel *model) | |
| 803 { | |
| 804 gchar buf[1024]; | |
| 805 GtkTreeIter iter; | |
| 806 GValue val = { 0, }; | |
| 807 struct gaim_plugin *plug; | |
| 808 | |
| 809 if (! gtk_tree_selection_get_selected (sel, &model, &iter)) | |
| 810 return; | |
| 811 gtk_tree_model_get_value (model, &iter, 2, &val); | |
| 812 plug = g_value_get_pointer(&val); | |
| 813 | |
| 3563 | 814 if (plug->error[0]) |
| 815 g_snprintf(buf, sizeof(buf), _("<span size=\"larger\">%s %s</span>\n\n" | |
| 816 "<span weight=\"bold\" color=\"red\">%s</span>\n\n" | |
| 817 "%s"), plug->desc.name, plug->desc.version, plug->error, plug->desc.description); | |
| 818 else | |
| 819 g_snprintf(buf, sizeof(buf), _("<span size=\"larger\">%s %s</span>\n\n" | |
| 820 "%s"), plug->desc.name, plug->desc.version, plug->desc.description); | |
| 3551 | 821 gtk_label_set_markup(GTK_LABEL(plugin_description), buf); |
| 3630 | 822 g_snprintf(buf, sizeof(buf), |
| 823 #ifndef _WIN32 | |
| 824 _("<span size=\"larger\">%s %s</span>\n\n" | |
| 825 "<span weight=\"bold\">Written by:</span>\t%s\n" | |
| 826 "<span weight=\"bold\">URL:</span>\t%s\n" | |
| 827 "<span weight=\"bold\">File name:</span>\t%s"), | |
| 828 #else | |
| 829 _("<span size=\"larger\">%s %s</span>\n\n" | |
| 830 "<span weight=\"bold\">Written by:</span> %s\n" | |
| 831 "<span weight=\"bold\">URL:</span> %s\n" | |
| 832 "<span weight=\"bold\">File name:</span> %s"), | |
| 833 #endif | |
| 3551 | 834 plug->desc.name, plug->desc.version, plug->desc.authors, plug->desc.url, plug->path); |
| 835 gtk_label_set_markup(GTK_LABEL(plugin_details), buf); | |
| 836 g_value_unset (&val); | |
| 837 } | |
| 838 | |
| 839 static void plugin_load (GtkCellRendererToggle *cell, gchar *pth, gpointer data) | |
| 840 { | |
| 841 GtkTreeModel *model = (GtkTreeModel *)data; | |
| 842 GtkTreeIter iter; | |
| 843 GtkTreePath *path = gtk_tree_path_new_from_string(pth); | |
| 844 struct gaim_plugin *plug; | |
| 845 gchar buf[1024]; | |
| 3565 | 846 GtkWidget *(*config)(); |
| 847 | |
| 3551 | 848 GdkCursor *wait = gdk_cursor_new (GDK_WATCH); |
| 849 gdk_window_set_cursor(prefs->window, wait); | |
| 850 gdk_cursor_unref(wait); | |
| 851 | |
| 852 gtk_tree_model_get_iter (model, &iter, path); | |
| 853 gtk_tree_model_get (model, &iter, 2, &plug, -1); | |
| 854 | |
| 855 if (!plug->handle) | |
| 856 | |
| 857 if (plug->type == plugin) | |
| 858 #ifdef GAIM_PLUGINS | |
| 3565 | 859 { |
| 860 load_plugin(plug->path); | |
| 861 if (g_module_symbol(plug->handle, "gaim_plugin_config_gtk", (gpointer *)&config)) { | |
| 862 plug->iter = g_new0(GtkTreeIter, 1); | |
| 863 prefs_notebook_add_page(plug->desc.name, NULL, config(), plug->iter, &plugin_iter, notebook_page++); | |
| 3567 | 864 if (gtk_tree_model_iter_n_children(GTK_TREE_MODEL(prefstree), &plugin_iter) == 1) { |
| 865 /* Expand the tree for the first plugin added */ | |
| 3630 | 866 GtkTreePath *path2 = gtk_tree_model_get_path(GTK_TREE_MODEL(prefstree), &plugin_iter); |
| 3567 | 867 gtk_tree_view_expand_row(GTK_TREE_VIEW(tree_v), path2, TRUE); |
| 868 gtk_tree_path_free (path2); | |
| 869 } | |
| 3565 | 870 } |
| 871 } | |
| 3551 | 872 #else |
| 873 {} | |
| 874 #endif | |
| 875 else | |
| 876 #ifdef USE_PERL | |
| 877 perl_load_file(plug->path); | |
| 878 #else | |
| 879 {} | |
| 880 #endif | |
| 881 else | |
| 882 if (plug->type == plugin) | |
| 883 #ifdef GAIM_PLUGINS | |
| 3565 | 884 { |
| 885 unload_plugin(plug); | |
| 886 if (plug->iter) { | |
| 887 gtk_tree_store_remove(GTK_TREE_STORE(prefstree), plug->iter); | |
| 888 g_free(plug->iter); | |
| 889 plug->iter = NULL; | |
| 890 } | |
| 891 } | |
| 3551 | 892 #else |
| 893 {} | |
| 894 #endif | |
| 895 else | |
| 896 #ifdef USE_PERL | |
| 897 perl_unload_file(plug); | |
| 898 #else | |
| 899 {} | |
| 900 #endif | |
| 901 gdk_window_set_cursor(prefs->window, NULL); | |
| 3563 | 902 if (plug->error[0]) |
| 903 g_snprintf(buf, sizeof(buf), _("<span size=\"larger\">%s %s</span>\n\n" | |
| 904 "<span weight=\"bold\" color=\"red\">%s</span>\n\n" | |
| 905 "%s"), plug->desc.name, plug->desc.version, plug->error, plug->desc.description); | |
| 906 else | |
| 907 g_snprintf(buf, sizeof(buf), _("<span size=\"larger\">%s %s</span>\n\n" | |
| 908 "%s"), plug->desc.name, plug->desc.version, plug->desc.description); | |
| 909 gtk_label_set_markup(GTK_LABEL(plugin_description), buf); | |
| 3551 | 910 gtk_list_store_set (GTK_LIST_STORE (model), &iter, 0, plug->handle, -1); |
| 3563 | 911 |
| 3551 | 912 gtk_label_set_markup(GTK_LABEL(plugin_description), buf); |
| 913 gtk_tree_path_free(path); | |
| 914 } | |
| 915 | |
| 916 static GtkWidget *plugin_page () | |
| 917 { | |
| 918 GtkWidget *ret; | |
| 919 | |
| 920 GtkWidget *sw, *vp; | |
| 921 GtkTreeIter iter; | |
| 922 GtkWidget *event_view; | |
| 923 GtkListStore *ls; | |
| 924 GtkCellRenderer *rend, *rendt; | |
| 925 GtkTreeViewColumn *col; | |
| 926 GtkTreeSelection *sel; | |
| 927 GtkTreePath *path; | |
| 928 | |
| 929 GtkWidget *nb; | |
| 930 | |
| 931 GList *probes = probed_plugins; | |
| 932 struct gaim_plugin *plug; | |
| 933 | |
| 934 ret = gtk_vbox_new(FALSE, 18); | |
| 935 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
| 936 | |
| 937 sw = gtk_scrolled_window_new(NULL,NULL); | |
| 938 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), GTK_POLICY_NEVER, GTK_POLICY_ALWAYS); | |
| 939 gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW(sw), GTK_SHADOW_IN); | |
| 940 | |
| 941 gtk_box_pack_start(GTK_BOX(ret), sw, TRUE, TRUE, 0); | |
| 942 | |
| 943 ls = gtk_list_store_new (3, G_TYPE_BOOLEAN, G_TYPE_STRING, G_TYPE_POINTER); | |
| 944 while (probes) { | |
| 945 plug = probes->data; | |
| 946 gtk_list_store_append (ls, &iter); | |
| 947 gtk_list_store_set(ls, &iter, | |
| 948 0, plug->handle, | |
| 949 1, plug->desc.name ? plug->desc.name : plug->path, | |
| 950 2, plug, -1); | |
| 951 probes = probes->next; | |
| 952 } | |
| 953 | |
| 954 event_view = gtk_tree_view_new_with_model (GTK_TREE_MODEL(ls)); | |
| 955 | |
| 956 rend = gtk_cell_renderer_toggle_new(); | |
| 957 sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (event_view)); | |
| 958 | |
| 959 | |
| 960 col = gtk_tree_view_column_new_with_attributes ("Load", | |
| 961 rend, | |
| 962 "active", 0, | |
| 963 NULL); | |
| 964 gtk_tree_view_append_column (GTK_TREE_VIEW(event_view), col); | |
| 965 | |
| 966 rendt = gtk_cell_renderer_text_new(); | |
| 967 col = gtk_tree_view_column_new_with_attributes ("Name", | |
| 968 rendt, | |
| 969 "text", 1, | |
| 970 NULL); | |
| 971 gtk_tree_view_append_column (GTK_TREE_VIEW(event_view), col); | |
| 972 g_object_unref(G_OBJECT(ls)); | |
| 973 gtk_container_add(GTK_CONTAINER(sw), event_view); | |
| 974 | |
| 975 | |
| 976 nb = gtk_notebook_new(); | |
| 977 gtk_notebook_set_tab_pos (GTK_NOTEBOOK(nb), GTK_POS_BOTTOM); | |
| 978 gtk_notebook_popup_disable(GTK_NOTEBOOK(nb)); | |
| 979 | |
| 980 /* Description */ | |
| 981 sw = gtk_scrolled_window_new(NULL, NULL); | |
| 982 gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW(sw), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); | |
| 983 plugin_description = gtk_label_new(NULL); | |
| 984 | |
| 985 vp = gtk_viewport_new(NULL, NULL); | |
| 3630 | 986 gtk_viewport_set_shadow_type(GTK_VIEWPORT(vp), GTK_SHADOW_NONE); |
| 3551 | 987 gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW(sw), GTK_SHADOW_NONE); |
| 988 | |
| 3630 | 989 gtk_container_add(GTK_CONTAINER(vp), plugin_description); |
| 990 gtk_container_add(GTK_CONTAINER(sw), vp); | |
| 3551 | 991 |
| 3630 | 992 gtk_label_set_selectable(GTK_LABEL(plugin_description), TRUE); |
| 993 gtk_label_set_line_wrap(GTK_LABEL(plugin_description), TRUE); | |
| 3551 | 994 gtk_misc_set_alignment(GTK_MISC(plugin_description), 0, 0); |
| 995 gtk_misc_set_padding(GTK_MISC(plugin_description), 6, 6); | |
| 996 gtk_notebook_append_page(GTK_NOTEBOOK(nb), sw, gtk_label_new(_("Description"))); | |
| 997 | |
| 998 /* Details */ | |
| 999 sw = gtk_scrolled_window_new(NULL, NULL); | |
| 1000 gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW(sw), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); | |
| 1001 plugin_details = gtk_label_new(NULL); | |
| 1002 | |
| 1003 vp = gtk_viewport_new(NULL, NULL); | |
| 3630 | 1004 gtk_viewport_set_shadow_type(GTK_VIEWPORT(vp), GTK_SHADOW_NONE); |
| 3551 | 1005 gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW(sw), GTK_SHADOW_NONE); |
| 1006 | |
| 3630 | 1007 gtk_container_add(GTK_CONTAINER(vp), plugin_details); |
| 1008 gtk_container_add(GTK_CONTAINER(sw), vp); | |
| 3551 | 1009 |
| 3630 | 1010 gtk_label_set_selectable(GTK_LABEL(plugin_details), TRUE); |
| 1011 gtk_label_set_line_wrap(GTK_LABEL(plugin_details), TRUE); | |
| 3551 | 1012 gtk_misc_set_alignment(GTK_MISC(plugin_details), 0, 0); |
| 1013 gtk_misc_set_padding(GTK_MISC(plugin_details), 6, 6); | |
| 1014 gtk_notebook_append_page(GTK_NOTEBOOK(nb), sw, gtk_label_new(_("Details"))); | |
| 1015 gtk_box_pack_start(GTK_BOX(ret), nb, TRUE, TRUE, 0); | |
| 1016 | |
| 1017 g_signal_connect (G_OBJECT (sel), "changed", | |
| 1018 G_CALLBACK (prefs_plugin_sel), | |
| 1019 NULL); | |
| 1020 g_signal_connect (G_OBJECT(rend), "toggled", | |
| 1021 G_CALLBACK(plugin_load), ls); | |
| 1022 | |
| 1023 path = gtk_tree_path_new_first(); | |
| 1024 gtk_tree_selection_select_path(sel, path); | |
| 1025 gtk_tree_path_free(path); | |
| 1026 | |
| 1027 gtk_widget_show_all(ret); | |
| 1028 return ret; | |
| 1029 } | |
| 1030 #endif | |
| 1031 | |
| 3366 | 1032 static void event_toggled (GtkCellRendererToggle *cell, gchar *pth, gpointer data) |
|
873
789df4b47508
[gaim-migrate @ 883]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
864
diff
changeset
|
1033 { |
| 3366 | 1034 GtkTreeModel *model = (GtkTreeModel *)data; |
| 1035 GtkTreeIter iter; | |
| 1036 GtkTreePath *path = gtk_tree_path_new_from_string(pth); | |
| 3500 | 1037 gint soundnum; |
| 3366 | 1038 |
| 1039 gtk_tree_model_get_iter (model, &iter, path); | |
| 1040 gtk_tree_model_get (model, &iter, 2, &soundnum, -1); | |
|
873
789df4b47508
[gaim-migrate @ 883]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
864
diff
changeset
|
1041 |
| 3818 | 1042 sound_options ^= sounds[soundnum].opt; |
| 1043 gtk_list_store_set (GTK_LIST_STORE (model), &iter, 0, sound_options & sounds[soundnum].opt, -1); | |
| 3522 | 1044 |
| 1045 gtk_tree_path_free(path); | |
| 3366 | 1046 } |
| 1047 | |
| 1048 static void test_sound(GtkWidget *button, gpointer i_am_NULL) | |
| 1049 { | |
| 1050 guint32 tmp_sound = sound_options; | |
| 1051 if (!(sound_options & OPT_SOUND_WHEN_AWAY)) | |
| 1052 sound_options ^= OPT_SOUND_WHEN_AWAY; | |
| 1053 if (!(sound_options & sounds[sound_row_sel].opt)) | |
| 1054 sound_options ^= sounds[sound_row_sel].opt; | |
| 1055 play_sound(sound_row_sel); | |
| 3500 | 1056 |
| 3366 | 1057 sound_options = tmp_sound; |
|
873
789df4b47508
[gaim-migrate @ 883]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
864
diff
changeset
|
1058 } |
|
789df4b47508
[gaim-migrate @ 883]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
864
diff
changeset
|
1059 |
| 3366 | 1060 static void reset_sound(GtkWidget *button, gpointer i_am_also_NULL) |
|
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1061 { |
| 3366 | 1062 /* This just resets a sound file back to default */ |
| 3818 | 1063 if (sound_file[sound_row_sel]) { |
| 1064 g_free(sound_file[sound_row_sel]); | |
| 1065 sound_file[sound_row_sel] = NULL; | |
| 3485 | 1066 } |
|
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1067 |
| 3366 | 1068 gtk_entry_set_text(GTK_ENTRY(sound_entry), "(default)"); |
|
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1069 } |
|
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1070 |
|
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1071 void close_sounddialog(GtkWidget *w, GtkWidget *w2) |
| 1170 | 1072 { |
| 1073 | |
| 1074 GtkWidget *dest; | |
|
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1075 |
| 1170 | 1076 if (!GTK_IS_WIDGET(w2)) |
| 1077 dest = w; | |
| 1078 else | |
| 1079 dest = w2; | |
| 1080 | |
| 1081 sounddialog = NULL; | |
| 1082 | |
| 1083 gtk_widget_destroy(dest); | |
| 1084 } | |
| 1085 | |
|
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1086 void do_select_sound(GtkWidget *w, int snd) |
|
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1087 { |
|
1953
f0ff0b367e3d
[gaim-migrate @ 1963]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1930
diff
changeset
|
1088 const char *file; |
|
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1089 |
| 1170 | 1090 file = gtk_file_selection_get_filename(GTK_FILE_SELECTION(sounddialog)); |
| 1091 | |
| 1092 /* If they type in a directory, change there */ | |
| 1093 if (file_is_dir(file, sounddialog)) | |
| 1094 return; | |
| 1095 | |
| 1096 /* Let's just be safe */ | |
| 3818 | 1097 if (sound_file[snd]) |
| 1098 g_free(sound_file[snd]); | |
| 1170 | 1099 |
| 1100 /* Set it -- and forget it */ | |
| 3818 | 1101 sound_file[snd] = g_strdup(file); |
| 3500 | 1102 |
| 1175 | 1103 /* Set our text entry */ |
| 3818 | 1104 gtk_entry_set_text(GTK_ENTRY(sound_entry), sound_file[snd]); |
|
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1105 |
| 1170 | 1106 /* Close the window! It's getting cold in here! */ |
| 1107 close_sounddialog(NULL, sounddialog); | |
|
2471
612efbf62c35
[gaim-migrate @ 2484]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2385
diff
changeset
|
1108 |
|
612efbf62c35
[gaim-migrate @ 2484]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2385
diff
changeset
|
1109 if (last_sound_dir) |
|
612efbf62c35
[gaim-migrate @ 2484]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2385
diff
changeset
|
1110 g_free(last_sound_dir); |
| 3818 | 1111 last_sound_dir = g_dirname(sound_file[snd]); |
| 1170 | 1112 } |
| 1113 | |
| 3366 | 1114 static void sel_sound(GtkWidget *button, gpointer being_NULL_is_fun) |
|
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1115 { |
| 1170 | 1116 char *buf = g_malloc(BUF_LEN); |
|
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1117 |
|
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1118 if (!sounddialog) { |
| 1170 | 1119 sounddialog = gtk_file_selection_new(_("Gaim - Sound Configuration")); |
| 1120 | |
| 1121 gtk_file_selection_hide_fileop_buttons(GTK_FILE_SELECTION(sounddialog)); | |
| 1122 | |
| 3630 | 1123 g_snprintf(buf, BUF_LEN - 1, "%s" G_DIR_SEPARATOR_S, last_sound_dir ? last_sound_dir : gaim_home_dir()); |
| 1170 | 1124 |
| 1125 gtk_file_selection_set_filename(GTK_FILE_SELECTION(sounddialog), buf); | |
| 1126 | |
|
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
1127 g_signal_connect(GTK_OBJECT(sounddialog), "destroy", |
|
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
1128 G_CALLBACK(close_sounddialog), sounddialog); |
| 1170 | 1129 |
|
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
1130 g_signal_connect(GTK_OBJECT(GTK_FILE_SELECTION(sounddialog)->ok_button), |
|
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
1131 "clicked", G_CALLBACK(do_select_sound), (int *)sound_row_sel); |
| 1170 | 1132 |
|
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
1133 g_signal_connect(GTK_OBJECT(GTK_FILE_SELECTION(sounddialog)->cancel_button), |
|
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
1134 "clicked", G_CALLBACK(close_sounddialog), sounddialog); |
| 1170 | 1135 } |
| 1136 | |
| 1137 g_free(buf); | |
| 1138 gtk_widget_show(sounddialog); | |
| 1139 gdk_window_raise(sounddialog->window); | |
|
1006
0a4d0ed65e17
[gaim-migrate @ 1016]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
1140 } |
|
0a4d0ed65e17
[gaim-migrate @ 1016]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
1141 |
| 3366 | 1142 |
| 1143 static void prefs_sound_sel (GtkTreeSelection *sel, GtkTreeModel *model) { | |
| 1144 GtkTreeIter iter; | |
| 1145 GValue val = { 0, }; | |
| 3500 | 1146 |
| 3366 | 1147 if (! gtk_tree_selection_get_selected (sel, &model, &iter)) |
| 1148 return; | |
| 1149 gtk_tree_model_get_value (model, &iter, 2, &val); | |
| 1150 sound_row_sel = g_value_get_uint(&val); | |
| 1151 if (sound_entry) | |
| 3818 | 1152 gtk_entry_set_text(GTK_ENTRY(sound_entry), sound_file[sound_row_sel] ? sound_file[sound_row_sel] : "(default)"); |
| 3366 | 1153 g_value_unset (&val); |
| 1154 if (sounddialog) | |
| 1155 gtk_widget_destroy(sounddialog); | |
| 1156 } | |
| 1157 | |
| 1158 GtkWidget *sound_events_page() { | |
| 1159 | |
| 1160 GtkWidget *ret; | |
| 1161 GtkWidget *sw; | |
| 1162 GtkWidget *button, *hbox; | |
| 1163 GtkTreeIter iter; | |
| 1164 GtkWidget *event_view; | |
| 1165 GtkListStore *event_store; | |
| 1166 GtkCellRenderer *rend; | |
| 1167 GtkTreeViewColumn *col; | |
| 1168 GtkTreeSelection *sel; | |
| 1169 GtkTreePath *path; | |
| 1170 int j; | |
| 1171 | |
| 3427 | 1172 ret = gtk_vbox_new(FALSE, 18); |
| 1173 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
| 3366 | 1174 |
| 1175 sw = gtk_scrolled_window_new(NULL,NULL); | |
| 1176 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC); | |
| 3814 | 1177 gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW(sw), GTK_SHADOW_IN); |
| 1178 | |
| 3427 | 1179 gtk_box_pack_start(GTK_BOX(ret), sw, TRUE, TRUE, 0); |
| 3366 | 1180 event_store = gtk_list_store_new (3, G_TYPE_BOOLEAN, G_TYPE_STRING, G_TYPE_UINT); |
| 1181 | |
| 1182 for (j=0; j < NUM_SOUNDS; j++) { | |
| 1183 if (sounds[j].opt == 0) | |
| 1184 continue; | |
| 3500 | 1185 |
| 3366 | 1186 gtk_list_store_append (event_store, &iter); |
| 1187 gtk_list_store_set(event_store, &iter, | |
| 1188 0, sound_options & sounds[j].opt, | |
| 4114 | 1189 1, gettext(sounds[j].label), |
| 3366 | 1190 2, j, -1); |
| 1191 } | |
| 1192 | |
| 1193 event_view = gtk_tree_view_new_with_model (GTK_TREE_MODEL(event_store)); | |
| 3500 | 1194 |
| 3366 | 1195 rend = gtk_cell_renderer_toggle_new(); |
| 1196 sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (event_view)); | |
| 1197 g_signal_connect (G_OBJECT (sel), "changed", | |
| 1198 G_CALLBACK (prefs_sound_sel), | |
| 1199 NULL); | |
| 1200 g_signal_connect (G_OBJECT(rend), "toggled", | |
| 1201 G_CALLBACK(event_toggled), event_store); | |
| 1202 path = gtk_tree_path_new_first(); | |
| 1203 gtk_tree_selection_select_path(sel, path); | |
| 3522 | 1204 gtk_tree_path_free(path); |
| 3500 | 1205 |
| 3366 | 1206 col = gtk_tree_view_column_new_with_attributes ("Play", |
| 1207 rend, | |
| 1208 "active", 0, | |
| 1209 NULL); | |
| 1210 gtk_tree_view_append_column (GTK_TREE_VIEW(event_view), col); | |
| 1211 | |
| 1212 rend = gtk_cell_renderer_text_new(); | |
| 1213 col = gtk_tree_view_column_new_with_attributes ("Event", | |
| 1214 rend, | |
| 1215 "text", 1, | |
| 1216 NULL); | |
| 1217 gtk_tree_view_append_column (GTK_TREE_VIEW(event_view), col); | |
| 3500 | 1218 g_object_unref(G_OBJECT(event_store)); |
| 3366 | 1219 gtk_container_add(GTK_CONTAINER(sw), event_view); |
| 1220 | |
| 3427 | 1221 hbox = gtk_hbox_new(FALSE, 6); |
| 1222 gtk_box_pack_start(GTK_BOX(ret), hbox, FALSE, FALSE, 0); | |
| 3366 | 1223 sound_entry = gtk_entry_new(); |
| 3818 | 1224 gtk_entry_set_text(GTK_ENTRY(sound_entry), sound_file[0] ? sound_file[0] : "(default)"); |
| 3366 | 1225 gtk_entry_set_editable(GTK_ENTRY(sound_entry), FALSE); |
| 1226 gtk_box_pack_start(GTK_BOX(hbox), sound_entry, FALSE, FALSE, 5); | |
|
1006
0a4d0ed65e17
[gaim-migrate @ 1016]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
1227 |
| 3025 | 1228 button = gtk_button_new_with_label(_("Test")); |
|
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
1229 g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(test_sound), NULL); |
| 3366 | 1230 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 1); |
|
2759
f26f1d139615
[gaim-migrate @ 2772]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2746
diff
changeset
|
1231 |
| 1175 | 1232 button = gtk_button_new_with_label(_("Reset")); |
|
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
1233 g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(reset_sound), NULL); |
| 3366 | 1234 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 1); |
| 1175 | 1235 |
| 1381 | 1236 button = gtk_button_new_with_label(_("Choose...")); |
|
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
1237 g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(sel_sound), NULL); |
| 3366 | 1238 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 1); |
| 3500 | 1239 |
| 3427 | 1240 gtk_widget_show_all (ret); |
|
1006
0a4d0ed65e17
[gaim-migrate @ 1016]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
1241 |
| 3366 | 1242 return ret; |
|
2580
86eaeb064e82
[gaim-migrate @ 2593]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2566
diff
changeset
|
1243 } |
|
86eaeb064e82
[gaim-migrate @ 2593]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2566
diff
changeset
|
1244 |
| 3366 | 1245 void away_message_sel(GtkTreeSelection *sel, GtkTreeModel *model) |
|
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1246 { |
| 3366 | 1247 GtkTreeIter iter; |
| 1248 GValue val = { 0, }; | |
|
1780
d7cbedd1d651
[gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1773
diff
changeset
|
1249 gchar buffer[BUF_LONG]; |
|
d7cbedd1d651
[gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1773
diff
changeset
|
1250 char *tmp; |
| 3374 | 1251 struct away_message *am; |
|
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1252 |
| 3366 | 1253 if (! gtk_tree_selection_get_selected (sel, &model, &iter)) |
| 1254 return; | |
| 1255 gtk_tree_model_get_value (model, &iter, 1, &val); | |
| 3374 | 1256 am = g_value_get_pointer(&val); |
|
1780
d7cbedd1d651
[gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1773
diff
changeset
|
1257 gtk_imhtml_clear(GTK_IMHTML(away_text)); |
| 3374 | 1258 strncpy(buffer, am->message, BUF_LONG); |
|
1780
d7cbedd1d651
[gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1773
diff
changeset
|
1259 tmp = stylize(buffer, BUF_LONG); |
|
2856
b1e300a85678
[gaim-migrate @ 2869]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2843
diff
changeset
|
1260 gtk_imhtml_append_text(GTK_IMHTML(away_text), tmp, -1, GTK_IMHTML_NO_TITLE | |
|
2372
2927c2c26fe6
[gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2323
diff
changeset
|
1261 GTK_IMHTML_NO_COMMENTS | GTK_IMHTML_NO_SCROLL); |
|
2856
b1e300a85678
[gaim-migrate @ 2869]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2843
diff
changeset
|
1262 gtk_imhtml_append_text(GTK_IMHTML(away_text), "<BR>", -1, GTK_IMHTML_NO_TITLE | |
|
2372
2927c2c26fe6
[gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2323
diff
changeset
|
1263 GTK_IMHTML_NO_COMMENTS | GTK_IMHTML_NO_SCROLL); |
|
1780
d7cbedd1d651
[gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1773
diff
changeset
|
1264 g_free(tmp); |
| 3366 | 1265 g_value_unset (&val); |
| 3500 | 1266 |
|
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1267 } |
|
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1268 |
| 3500 | 1269 void remove_away_message(GtkWidget *widget, GtkTreeView *tv) { |
| 3366 | 1270 struct away_message *am; |
| 1271 GtkTreeIter iter; | |
| 1272 GtkTreePath *path; | |
| 1273 GtkTreeStore *ts = GTK_TREE_STORE(gtk_tree_view_get_model(tv)); | |
| 1274 GtkTreeSelection *sel = gtk_tree_view_get_selection(tv); | |
| 3379 | 1275 GtkTreeModel *model = GTK_TREE_MODEL(prefs_away_store); |
| 3366 | 1276 GValue val = { 0, }; |
| 3500 | 1277 |
| 3379 | 1278 if (! gtk_tree_selection_get_selected (sel, &model, &iter)) |
| 3366 | 1279 return; |
| 3379 | 1280 gtk_tree_model_get_value (GTK_TREE_MODEL(prefs_away_store), &iter, 1, &val); |
| 3366 | 1281 am = g_value_get_pointer (&val); |
| 1282 gtk_imhtml_clear(GTK_IMHTML(away_text)); | |
| 1283 rem_away_mess(NULL, am); | |
| 3379 | 1284 gtk_list_store_remove(GTK_LIST_STORE(ts), &iter); |
| 1285 path = gtk_tree_path_new_first(); | |
| 3366 | 1286 gtk_tree_selection_select_path(sel, path); |
| 3522 | 1287 gtk_tree_path_free(path); |
|
1109
c73736fa0b7c
[gaim-migrate @ 1119]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1087
diff
changeset
|
1288 } |
|
c73736fa0b7c
[gaim-migrate @ 1119]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1087
diff
changeset
|
1289 |
| 3366 | 1290 GtkWidget *away_message_page() { |
| 1291 GtkWidget *ret; | |
| 3427 | 1292 GtkWidget *hbox; |
| 3379 | 1293 GtkWidget *button; |
|
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1294 GtkWidget *sw; |
| 3366 | 1295 GtkTreeIter iter; |
| 1296 GtkWidget *event_view; | |
| 1297 GtkCellRenderer *rend; | |
| 1298 GtkTreeViewColumn *col; | |
| 1299 GtkTreeSelection *sel; | |
| 940 | 1300 GSList *awy = away_messages; |
|
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1301 struct away_message *a; |
| 3366 | 1302 GtkWidget *sw2; |
| 3427 | 1303 GtkSizeGroup *sg; |
|
1780
d7cbedd1d651
[gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1773
diff
changeset
|
1304 |
| 3427 | 1305 ret = gtk_vbox_new(FALSE, 18); |
| 1306 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
| 1307 | |
| 1308 sg = gtk_size_group_new(GTK_SIZE_GROUP_BOTH); | |
| 3500 | 1309 |
| 3366 | 1310 sw = gtk_scrolled_window_new(NULL,NULL); |
| 1311 away_text = gtk_imhtml_new(NULL, NULL); | |
| 3427 | 1312 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), GTK_POLICY_NEVER, GTK_POLICY_ALWAYS); |
| 3817 | 1313 /* |
| 1314 gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(sw), GTK_SHADOW_IN); | |
| 1315 */ | |
| 3427 | 1316 gtk_box_pack_start(GTK_BOX(ret), sw, TRUE, TRUE, 0); |
| 3500 | 1317 |
| 3374 | 1318 prefs_away_store = gtk_list_store_new (2, G_TYPE_STRING, G_TYPE_POINTER); |
| 3366 | 1319 while (awy) { |
| 1320 a = (struct away_message *)awy->data; | |
| 1321 gtk_list_store_append (prefs_away_store, &iter); | |
| 1322 gtk_list_store_set(prefs_away_store, &iter, | |
| 3374 | 1323 0, a->name, |
| 1324 1, a, -1); | |
| 3366 | 1325 awy = awy->next; |
| 1326 } | |
| 1327 event_view = gtk_tree_view_new_with_model (GTK_TREE_MODEL(prefs_away_store)); | |
|
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1328 |
|
2906
538c58b43eff
[gaim-migrate @ 2919]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2856
diff
changeset
|
1329 |
| 3366 | 1330 rend = gtk_cell_renderer_text_new(); |
| 1331 col = gtk_tree_view_column_new_with_attributes ("NULL", | |
| 1332 rend, | |
| 1333 "text", 0, | |
| 1334 NULL); | |
| 1335 gtk_tree_view_append_column (GTK_TREE_VIEW(event_view), col); | |
| 1336 gtk_tree_view_set_headers_visible (GTK_TREE_VIEW(event_view), FALSE); | |
| 1337 gtk_widget_show(event_view); | |
| 3427 | 1338 gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(sw), event_view); |
| 3374 | 1339 |
|
1780
d7cbedd1d651
[gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1773
diff
changeset
|
1340 sw2 = gtk_scrolled_window_new(NULL, NULL); |
|
d7cbedd1d651
[gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1773
diff
changeset
|
1341 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw2), |
|
d7cbedd1d651
[gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1773
diff
changeset
|
1342 GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS); |
| 3427 | 1343 gtk_box_pack_start(GTK_BOX(ret), sw2, TRUE, TRUE, 0); |
| 3500 | 1344 |
| 3427 | 1345 gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(sw2), away_text); |
|
1815
f15d449b3167
[gaim-migrate @ 1825]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1813
diff
changeset
|
1346 gaim_setup_imhtml(away_text); |
| 3366 | 1347 sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (event_view)); |
| 1348 g_signal_connect (G_OBJECT (sel), "changed", | |
| 1349 G_CALLBACK (away_message_sel), | |
| 1350 NULL); | |
| 1351 hbox = gtk_hbox_new(TRUE, 5); | |
| 3427 | 1352 gtk_box_pack_start(GTK_BOX(ret), hbox, FALSE, FALSE, 0); |
| 3366 | 1353 button = gtk_button_new_from_stock (GTK_STOCK_ADD); |
| 1354 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0); | |
| 3427 | 1355 gtk_size_group_add_widget(sg, button); |
|
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
1356 g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(create_away_mess), NULL); |
| 3472 | 1357 |
| 3366 | 1358 button = gtk_button_new_from_stock (GTK_STOCK_REMOVE); |
| 3427 | 1359 gtk_size_group_add_widget(sg, button); |
|
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
1360 g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(remove_away_message), event_view); |
| 3472 | 1361 |
| 3366 | 1362 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0); |
| 3472 | 1363 |
| 3649 | 1364 button = gaim_pixbuf_button(_("_Edit"), "edit.png", GAIM_BUTTON_HORIZONTAL); |
| 3427 | 1365 gtk_size_group_add_widget(sg, button); |
|
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
1366 g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(create_away_mess), event_view); |
| 3366 | 1367 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0); |
| 3500 | 1368 |
| 3427 | 1369 gtk_widget_show_all(ret); |
| 3366 | 1370 return ret; |
| 1371 } | |
| 3472 | 1372 |
| 3500 | 1373 GtkTreeIter *prefs_notebook_add_page(char *text, |
| 1374 GdkPixbuf *pixbuf, | |
| 1375 GtkWidget *page, | |
| 3366 | 1376 GtkTreeIter *iter, |
| 3500 | 1377 GtkTreeIter *parent, |
| 3366 | 1378 int ind) { |
| 1379 GdkPixbuf *icon = NULL; | |
| 3500 | 1380 |
| 3366 | 1381 if (pixbuf) |
| 3500 | 1382 icon = gdk_pixbuf_scale_simple (pixbuf, 18, 18, GDK_INTERP_BILINEAR); |
|
1780
d7cbedd1d651
[gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1773
diff
changeset
|
1383 |
| 3366 | 1384 gtk_tree_store_append (prefstree, iter, parent); |
| 1385 gtk_tree_store_set (prefstree, iter, 0, icon, 1, text, 2, ind, -1); | |
| 3500 | 1386 |
| 3366 | 1387 if (pixbuf) |
| 1388 g_object_unref(pixbuf); | |
| 1389 if (icon) | |
| 1390 g_object_unref(icon); | |
| 1391 gtk_notebook_append_page(GTK_NOTEBOOK(prefsnotebook), page, gtk_label_new(text)); | |
| 1392 return iter; | |
|
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1393 } |
|
1124
a70d5200edde
[gaim-migrate @ 1134]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1123
diff
changeset
|
1394 |
| 3366 | 1395 void prefs_notebook_init() { |
| 1396 GtkTreeIter p, c; | |
| 3565 | 1397 #if USE_PLUGINS |
| 1398 GtkWidget *(*config)(); | |
| 1399 GList *l = plugins; | |
| 1400 struct gaim_plugin *plug; | |
| 1401 #endif | |
| 1402 prefs_notebook_add_page(_("Interface"), NULL, interface_page(), &p, NULL, notebook_page++); | |
| 1403 prefs_notebook_add_page(_("Fonts"), NULL, font_page(), &c, &p, notebook_page++); | |
| 1404 prefs_notebook_add_page(_("Message Text"), NULL, messages_page(), &c, &p, notebook_page++); | |
| 1405 prefs_notebook_add_page(_("Shortcuts"), NULL, hotkeys_page(), &c, &p, notebook_page++); | |
| 1406 prefs_notebook_add_page(_("Buddy List"), NULL, list_page(), &c, &p, notebook_page++); | |
| 1407 prefs_notebook_add_page(_("IM Window"), NULL, im_page(), &c, &p, notebook_page++); | |
| 1408 prefs_notebook_add_page(_("Chat Window"), NULL, chat_page(), &c, &p, notebook_page++); | |
| 1409 prefs_notebook_add_page(_("Tabs"), NULL, tab_page(), &c, &p, notebook_page++); | |
| 1410 prefs_notebook_add_page(_("Proxy"), NULL, proxy_page(), &p, NULL, notebook_page++); | |
| 1411 prefs_notebook_add_page(_("Browser"), NULL, browser_page(), &p, NULL, notebook_page++); | |
|
1130
d31fad9abb32
[gaim-migrate @ 1140]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1125
diff
changeset
|
1412 |
| 3565 | 1413 prefs_notebook_add_page(_("Logging"), NULL, logging_page(), &p, NULL, notebook_page++); |
| 1414 prefs_notebook_add_page(_("Sounds"), NULL, sound_page(), &p, NULL, notebook_page++); | |
| 1415 prefs_notebook_add_page(_("Sound Events"), NULL, sound_events_page(), &c, &p, notebook_page++); | |
| 1416 prefs_notebook_add_page(_("Away / Idle"), NULL, away_page(), &p, NULL, notebook_page++); | |
| 1417 prefs_notebook_add_page(_("Away Messages"), NULL, away_message_page(), &c, &p, notebook_page++); | |
| 3551 | 1418 #if USE_PLUGINS |
| 3565 | 1419 prefs_notebook_add_page(_("Plugins"), NULL, plugin_page(), &plugin_iter, NULL, notebook_page++); |
| 1420 while (l) { | |
| 1421 plug = l->data; | |
| 1422 if (plug->type == plugin && g_module_symbol(plug->handle, "gaim_plugin_config_gtk", (gpointer *)&config)) { | |
| 1423 plug->iter = g_new0(GtkTreeIter, 1); | |
| 1424 prefs_notebook_add_page(plug->desc.name, NULL, config(), plug->iter, &plugin_iter, notebook_page++); | |
| 1425 } | |
| 1426 l = l->next; | |
| 1427 } | |
| 3551 | 1428 #endif |
|
1124
a70d5200edde
[gaim-migrate @ 1134]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1123
diff
changeset
|
1429 } |
|
a70d5200edde
[gaim-migrate @ 1134]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1123
diff
changeset
|
1430 |
| 3500 | 1431 void show_prefs() |
|
1124
a70d5200edde
[gaim-migrate @ 1134]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1123
diff
changeset
|
1432 { |
| 3366 | 1433 GtkWidget *vbox, *vbox2; |
|
1124
a70d5200edde
[gaim-migrate @ 1134]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1123
diff
changeset
|
1434 GtkWidget *hbox; |
| 3366 | 1435 GtkWidget *frame; |
| 1436 GtkTreeViewColumn *column; | |
| 1437 GtkCellRenderer *cell; | |
| 1438 GtkTreeSelection *sel; | |
| 1439 GtkWidget *notebook; | |
| 1440 GtkWidget *sep; | |
|
1124
a70d5200edde
[gaim-migrate @ 1134]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1123
diff
changeset
|
1441 GtkWidget *button; |
| 3515 | 1442 GtkSizeGroup *sg = gtk_size_group_new(GTK_SIZE_GROUP_BOTH); |
| 3500 | 1443 |
|
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1444 if (prefs) { |
| 3472 | 1445 gtk_window_present(GTK_WINDOW(prefs)); |
|
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1446 return; |
|
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1447 } |
|
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1448 |
| 3366 | 1449 /* copy the preferences to tmp values... |
| 1450 * I liked "take affect immediately" Oh well :-( */ | |
| 3818 | 1451 |
| 1452 /* Back to instant-apply! I win! BU-HAHAHA! */ | |
| 3500 | 1453 |
| 3366 | 1454 /* Create the window */ |
|
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1455 prefs = gtk_window_new(GTK_WINDOW_TOPLEVEL); |
| 4074 | 1456 gtk_window_set_role(GTK_WINDOW(prefs), "preferences"); |
|
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1457 gtk_widget_realize(prefs); |
|
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1458 gtk_window_set_title(GTK_WINDOW(prefs), _("Gaim - Preferences")); |
| 3366 | 1459 gtk_window_set_policy (GTK_WINDOW(prefs), FALSE, FALSE, TRUE); |
|
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
1460 g_signal_connect(GTK_OBJECT(prefs), "destroy", G_CALLBACK(delete_prefs), NULL); |
|
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1461 |
|
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1462 vbox = gtk_vbox_new(FALSE, 5); |
| 1185 | 1463 gtk_container_border_width(GTK_CONTAINER(vbox), 5); |
|
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1464 gtk_container_add(GTK_CONTAINER(prefs), vbox); |
|
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1465 gtk_widget_show(vbox); |
|
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1466 |
| 3366 | 1467 hbox = gtk_hbox_new (FALSE, 6); |
| 1468 gtk_container_set_border_width (GTK_CONTAINER (hbox), 6); | |
| 1469 gtk_container_add (GTK_CONTAINER(vbox), hbox); | |
| 1470 gtk_widget_show (hbox); | |
| 1471 | |
| 1472 frame = gtk_frame_new (NULL); | |
| 1473 gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN); | |
| 1474 gtk_box_pack_start (GTK_BOX (hbox), frame, FALSE, FALSE, 0); | |
| 1475 gtk_widget_show (frame); | |
| 3500 | 1476 |
| 3366 | 1477 /* The tree -- much inspired by the Gimp */ |
| 1478 prefstree = gtk_tree_store_new (3, GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_INT); | |
| 1479 tree_v = gtk_tree_view_new_with_model (GTK_TREE_MODEL (prefstree)); | |
| 1480 gtk_container_add (GTK_CONTAINER (frame), tree_v); | |
| 1481 | |
| 1482 gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (tree_v), FALSE); | |
| 1483 gtk_widget_show(tree_v); | |
| 1484 /* icons */ | |
| 1485 cell = gtk_cell_renderer_pixbuf_new (); | |
| 1486 column = gtk_tree_view_column_new_with_attributes ("icons", cell, "pixbuf", 0, NULL); | |
| 3500 | 1487 |
| 3366 | 1488 /* text */ |
| 1489 cell = gtk_cell_renderer_text_new (); | |
| 1490 column = gtk_tree_view_column_new_with_attributes ("text", cell, "text", 1, NULL); | |
| 3500 | 1491 |
| 3366 | 1492 gtk_tree_view_append_column (GTK_TREE_VIEW (tree_v), column); |
|
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1493 |
| 3472 | 1494 /* The right side */ |
| 1495 frame = gtk_frame_new (NULL); | |
| 1496 gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN); | |
| 1497 gtk_box_pack_start (GTK_BOX (hbox), frame, TRUE, TRUE, 0); | |
| 1498 gtk_widget_show (frame); | |
| 3500 | 1499 |
| 3472 | 1500 vbox2 = gtk_vbox_new (FALSE, 4); |
| 1501 gtk_container_add (GTK_CONTAINER (frame), vbox2); | |
| 1502 gtk_widget_show (vbox2); | |
| 3500 | 1503 |
| 3472 | 1504 frame = gtk_frame_new (NULL); |
| 1505 gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_OUT); | |
| 1506 gtk_box_pack_start (GTK_BOX (vbox2), frame, FALSE, TRUE, 0); | |
| 1507 gtk_widget_show (frame); | |
| 3500 | 1508 |
| 3472 | 1509 hbox = gtk_hbox_new (FALSE, 4); |
| 1510 gtk_container_set_border_width (GTK_CONTAINER (hbox), 4); | |
| 1511 gtk_container_add (GTK_CONTAINER (frame), hbox); | |
| 1512 gtk_widget_show (hbox); | |
| 3500 | 1513 |
| 3472 | 1514 preflabel = gtk_label_new(NULL); |
| 1515 gtk_box_pack_end (GTK_BOX (hbox), preflabel, FALSE, FALSE, 0); | |
| 1516 gtk_widget_show (preflabel); | |
| 3500 | 1517 |
| 3472 | 1518 /* The notebook */ |
| 1519 prefsnotebook = notebook = gtk_notebook_new (); | |
| 1520 gtk_notebook_set_show_tabs (GTK_NOTEBOOK (notebook), FALSE); | |
| 1521 gtk_notebook_set_show_border (GTK_NOTEBOOK (notebook), FALSE); | |
| 1522 gtk_box_pack_start (GTK_BOX (vbox2), notebook, FALSE, FALSE, 0); | |
|
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1523 |
| 3472 | 1524 sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (tree_v)); |
| 1525 g_signal_connect (G_OBJECT (sel), "changed", | |
| 1526 G_CALLBACK (pref_nb_select), | |
| 1527 notebook); | |
| 3500 | 1528 gtk_widget_show(notebook); |
| 3472 | 1529 sep = gtk_hseparator_new(); |
| 1530 gtk_widget_show(sep); | |
| 1531 gtk_box_pack_start (GTK_BOX (vbox), sep, FALSE, FALSE, 0); | |
| 3500 | 1532 |
| 3818 | 1533 /* The buttons^H to press! */ |
| 3472 | 1534 hbox = gtk_hbox_new (FALSE, 6); |
| 1535 gtk_container_set_border_width (GTK_CONTAINER (hbox), 6); | |
| 1536 gtk_container_add (GTK_CONTAINER(vbox), hbox); | |
| 3500 | 1537 gtk_widget_show (hbox); |
| 3377 | 1538 |
| 3818 | 1539 button = gtk_button_new_from_stock (GTK_STOCK_CLOSE); |
| 3515 | 1540 gtk_size_group_add_widget(sg, button); |
|
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
1541 g_signal_connect_swapped(GTK_OBJECT(button), "clicked", G_CALLBACK(gtk_widget_destroy), prefs); |
| 3515 | 1542 gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0); |
| 1543 gtk_widget_show(button); | |
| 1544 | |
| 3500 | 1545 prefs_notebook_init(); |
| 3427 | 1546 |
| 3472 | 1547 gtk_tree_view_expand_all (GTK_TREE_VIEW(tree_v)); |
| 1548 gtk_widget_show(prefs); | |
|
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1549 } |
|
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1550 |
|
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1551 static gint debug_delete(GtkWidget *w, GdkEvent *event, void *dummy) |
|
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1552 { |
|
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1553 if (debugbutton) |
|
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1554 gtk_button_clicked(GTK_BUTTON(debugbutton)); |
|
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1555 if (misc_options & OPT_MISC_DEBUG) { |
| 3818 | 1556 misc_options ^= OPT_MISC_DEBUG; |
|
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1557 } |
|
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1558 g_free(dw); |
|
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1559 dw = NULL; |
|
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1560 return FALSE; |
| 1 | 1561 |
| 1562 } | |
| 1563 | |
|
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1564 static void build_debug() |
|
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1565 { |
| 4005 | 1566 GtkWidget *sw; |
| 1567 GtkTextBuffer *buffer; | |
| 1568 GtkTextIter end; | |
| 1569 | |
|
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1570 if (!dw) |
|
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1571 dw = g_new0(struct debug_window, 1); |
|
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1572 |
|
2725
f3c094e78609
[gaim-migrate @ 2738]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2676
diff
changeset
|
1573 GAIM_DIALOG(dw->window); |
| 4005 | 1574 gtk_window_set_default_size(GTK_WINDOW(dw->window), 500, 200); |
| 1575 gtk_window_set_role(GTK_WINDOW(dw->window), "debug"); | |
| 1576 gtk_window_set_title(GTK_WINDOW(dw->window), _("Gaim - Debug Window")); | |
| 1577 g_signal_connect(G_OBJECT(dw->window), "delete_event", G_CALLBACK(debug_delete), NULL); | |
|
2282
0dea5214d63f
[gaim-migrate @ 2292]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2269
diff
changeset
|
1578 |
| 4005 | 1579 sw = gtk_scrolled_window_new(NULL, NULL); |
| 1580 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), | |
| 1581 GTK_POLICY_NEVER, | |
| 1582 GTK_POLICY_ALWAYS); | |
|
2282
0dea5214d63f
[gaim-migrate @ 2292]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2269
diff
changeset
|
1583 |
| 4005 | 1584 dw->entry = gtk_text_view_new(); |
| 1585 gtk_text_view_set_cursor_visible(GTK_TEXT_VIEW(dw->entry), FALSE); | |
| 1586 gtk_text_view_set_editable(GTK_TEXT_VIEW(dw->entry), FALSE); | |
| 1587 gtk_text_view_set_wrap_mode(GTK_TEXT_VIEW(dw->entry), GTK_WRAP_WORD); | |
|
2282
0dea5214d63f
[gaim-migrate @ 2292]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2269
diff
changeset
|
1588 |
| 4005 | 1589 buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(dw->entry)); |
| 1590 gtk_text_buffer_get_end_iter(buffer, &end); | |
| 1591 gtk_text_buffer_create_mark(buffer, "end", &end, FALSE); | |
|
2282
0dea5214d63f
[gaim-migrate @ 2292]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2269
diff
changeset
|
1592 |
| 4005 | 1593 gtk_container_add(GTK_CONTAINER(sw), dw->entry); |
| 1594 gtk_container_add(GTK_CONTAINER(dw->window), sw); | |
| 1595 gtk_widget_show_all(dw->window); | |
|
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1596 } |
|
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1597 |
|
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1598 void show_debug() |
| 1 | 1599 { |
|
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1600 if ((misc_options & OPT_MISC_DEBUG)) { |
|
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1601 if (!dw || !dw->window) |
|
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1602 build_debug(); |
|
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1603 gtk_widget_show(dw->window); |
|
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1604 } else { |
|
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1605 if (!dw) |
|
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1606 return; |
|
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1607 gtk_widget_destroy(dw->window); |
|
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1608 dw->window = NULL; |
|
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1609 } |
|
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1610 } |
|
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1611 |
| 970 | 1612 void debug_printf(char *fmt, ...) |
| 1613 { | |
| 1614 va_list ap; | |
| 1615 gchar *s; | |
| 1616 | |
|
1366
155db3303ebb
[gaim-migrate @ 1376]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1357
diff
changeset
|
1617 va_start(ap, fmt); |
|
155db3303ebb
[gaim-migrate @ 1376]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1357
diff
changeset
|
1618 s = g_strdup_vprintf(fmt, ap); |
|
155db3303ebb
[gaim-migrate @ 1376]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1357
diff
changeset
|
1619 va_end(ap); |
|
155db3303ebb
[gaim-migrate @ 1376]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1357
diff
changeset
|
1620 |
|
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1621 if (misc_options & OPT_MISC_DEBUG && dw) { |
| 4005 | 1622 GtkTextBuffer *buffer; |
| 1623 GtkTextMark *endmark; | |
| 1624 GtkTextIter end; | |
|
2282
0dea5214d63f
[gaim-migrate @ 2292]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2269
diff
changeset
|
1625 |
| 4005 | 1626 buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(dw->entry)); |
| 1627 endmark = gtk_text_buffer_get_mark(buffer, "end"); | |
| 1628 gtk_text_buffer_get_iter_at_mark(buffer, &end, endmark); | |
| 1629 gtk_text_buffer_insert(buffer, &end, s, -1); | |
| 1630 gtk_text_view_scroll_mark_onscreen(GTK_TEXT_VIEW(dw->entry), endmark); | |
|
1366
155db3303ebb
[gaim-migrate @ 1376]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1357
diff
changeset
|
1631 } |
|
2823
cd23279122ed
[gaim-migrate @ 2836]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2794
diff
changeset
|
1632 if (opt_debug) |
|
cd23279122ed
[gaim-migrate @ 2836]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2794
diff
changeset
|
1633 g_print("%s", s); |
|
1366
155db3303ebb
[gaim-migrate @ 1376]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1357
diff
changeset
|
1634 g_free(s); |
| 970 | 1635 } |
|
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1636 |
| 1 | 1637 void set_option(GtkWidget *w, int *option) |
| 1638 { | |
| 1639 *option = !(*option); | |
| 1640 } | |
| 1641 | |
|
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1642 static void set_misc_option(GtkWidget *w, int option) |
|
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1643 { |
| 3818 | 1644 misc_options ^= option; |
|
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1645 |
| 3818 | 1646 if (option == OPT_MISC_DEBUG) |
|
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1647 show_debug(); |
| 4227 | 1648 else if(option == OPT_MISC_USE_SERVER_ALIAS) { |
| 1649 redo_buddy_list(); | |
| 1650 build_edit_tree(); | |
| 1651 set_convo_titles(); | |
| 1652 } | |
|
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1653 } |
|
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1654 |
| 3818 | 1655 static void set_logging_option(GtkWidget *w, int option) |
|
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1656 { |
| 3818 | 1657 logging_options ^= option; |
| 3500 | 1658 |
| 3818 | 1659 if (option == OPT_LOG_CONVOS || option == OPT_LOG_CHATS) |
| 1660 update_log_convs(); | |
| 3366 | 1661 } |
|
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1662 |
| 3818 | 1663 static void set_blist_option(GtkWidget *w, int option) |
| 3366 | 1664 { |
| 3818 | 1665 blist_options ^= option; |
| 3500 | 1666 |
|
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1667 if (!blist) |
|
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1668 return; |
| 3500 | 1669 |
| 3818 | 1670 if (option == OPT_BLIST_NO_BUTTONS) |
|
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1671 build_imchat_box(!(blist_options & OPT_BLIST_NO_BUTTONS)); |
|
696
97b75ed155b0
[gaim-migrate @ 706]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
683
diff
changeset
|
1672 |
| 3818 | 1673 if (option == OPT_BLIST_SHOW_GRPNUM) |
|
1070
b288f17c2fb2
[gaim-migrate @ 1080]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1030
diff
changeset
|
1674 update_num_groups(); |
| 9 | 1675 |
| 3818 | 1676 if (option == OPT_BLIST_NO_MT_GRP) |
|
1072
81d19577285a
[gaim-migrate @ 1082]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1070
diff
changeset
|
1677 toggle_show_empty_groups(); |
|
81d19577285a
[gaim-migrate @ 1082]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1070
diff
changeset
|
1678 |
| 3818 | 1679 if ((option == OPT_BLIST_SHOW_BUTTON_XPM) || (option == OPT_BLIST_NO_BUTTONS)) |
|
1296
11e5b1220028
[gaim-migrate @ 1306]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1269
diff
changeset
|
1680 update_button_pix(); |
|
11e5b1220028
[gaim-migrate @ 1306]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1269
diff
changeset
|
1681 |
| 3818 | 1682 if (option == OPT_BLIST_SHOW_PIXMAPS) |
|
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1683 toggle_buddy_pixmaps(); |
|
2593
5ba9ef368b8e
[gaim-migrate @ 2606]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2592
diff
changeset
|
1684 |
| 3818 | 1685 if ((option == OPT_BLIST_GREY_IDLERS) || (option == OPT_BLIST_SHOW_IDLETIME)) |
| 2594 | 1686 update_idle_times(); |
| 3032 | 1687 |
|
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1688 } |
|
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1689 |
| 3818 | 1690 static void set_convo_option(GtkWidget *w, int option) |
|
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1691 { |
| 3818 | 1692 convo_options ^= option; |
| 3500 | 1693 |
| 3818 | 1694 if (option == OPT_CONVO_SHOW_SMILEY) |
|
1428
00b3d02a2168
[gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1411
diff
changeset
|
1695 toggle_smileys(); |
|
00b3d02a2168
[gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1411
diff
changeset
|
1696 |
| 3818 | 1697 if (option == OPT_CONVO_SHOW_TIME) |
|
1428
00b3d02a2168
[gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1411
diff
changeset
|
1698 toggle_timestamps(); |
|
00b3d02a2168
[gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1411
diff
changeset
|
1699 |
| 3818 | 1700 if (option == OPT_CONVO_CHECK_SPELLING) |
|
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1701 toggle_spellchk(); |
| 3818 | 1702 } |
| 1703 | |
| 1704 static void set_im_option(GtkWidget *w, int option) | |
| 1705 { | |
| 1706 im_options ^= option; | |
| 3500 | 1707 |
| 3818 | 1708 if (option == OPT_IM_ONE_WINDOW) |
| 1709 im_tabize(); | |
| 1710 | |
| 1711 if (option == OPT_IM_HIDE_ICONS) | |
| 1712 set_hide_icons(); | |
| 1713 | |
| 1714 if (option == OPT_IM_ALIAS_TAB) { | |
| 1715 set_convo_titles(); | |
|
2843
87d11d2a7d59
[gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2839
diff
changeset
|
1716 } |
|
87d11d2a7d59
[gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2839
diff
changeset
|
1717 |
| 3818 | 1718 if (option == OPT_IM_NO_ANIMATION) |
| 3013 | 1719 set_anim(); |
| 1 | 1720 } |
| 1721 | |
| 3818 | 1722 static void set_chat_option(GtkWidget *w, int option) |
| 1 | 1723 { |
| 3818 | 1724 chat_options ^= option; |
|
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1725 |
| 3818 | 1726 if (option == OPT_CHAT_ONE_WINDOW) |
|
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1727 chat_tabize(); |
|
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1728 } |
|
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1729 |
| 3818 | 1730 void set_sound_option(GtkWidget *w, int option) |
|
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1731 { |
| 3818 | 1732 sound_options ^= option; |
|
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1733 } |
|
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1734 |
| 3818 | 1735 static void set_font_option(GtkWidget *w, int option) |
|
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1736 { |
| 3818 | 1737 font_options ^= option; |
| 3500 | 1738 |
|
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1739 update_font_buttons(); |
| 1 | 1740 } |
| 1741 | |
| 3818 | 1742 static void set_away_option(GtkWidget *w, int option) |
|
1525
ba8e6e211af5
[gaim-migrate @ 1535]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1455
diff
changeset
|
1743 { |
| 3818 | 1744 away_options ^= option; |
|
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1745 |
| 3818 | 1746 if (option == OPT_AWAY_QUEUE) |
|
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1747 toggle_away_queue(); |
|
1525
ba8e6e211af5
[gaim-migrate @ 1535]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1455
diff
changeset
|
1748 } |
|
ba8e6e211af5
[gaim-migrate @ 1535]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1455
diff
changeset
|
1749 |
|
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1750 GtkWidget *gaim_button(const char *text, guint *options, int option, GtkWidget *page) |
| 1 | 1751 { |
| 1752 GtkWidget *button; | |
| 3427 | 1753 button = gtk_check_button_new_with_mnemonic(text); |
| 1 | 1754 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(button), (*options & option)); |
| 1755 gtk_box_pack_start(GTK_BOX(page), button, FALSE, FALSE, 0); | |
| 3366 | 1756 gtk_object_set_user_data(GTK_OBJECT(button), options); |
| 1 | 1757 |
| 4064 | 1758 if (options == &misc_options) { |
|
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
1759 g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(set_misc_option), |
|
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1760 (int *)option); |
| 4064 | 1761 } else if (options == &logging_options) { |
|
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
1762 g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(set_logging_option), |
| 3818 | 1763 (int *)option); |
| 4064 | 1764 } else if (options == &blist_options) { |
|
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
1765 g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(set_blist_option), |
| 3818 | 1766 (int *)option); |
| 4064 | 1767 } else if (options == &convo_options) { |
|
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
1768 g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(set_convo_option), |
| 3818 | 1769 (int *)option); |
| 4064 | 1770 } else if (options == &im_options) { |
|
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
1771 g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(set_im_option), |
| 3818 | 1772 (int *)option); |
| 4064 | 1773 } else if (options == &chat_options) { |
|
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
1774 g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(set_chat_option), |
| 3818 | 1775 (int *)option); |
| 4064 | 1776 } else if (options == &font_options) { |
|
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
1777 g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(set_font_option), |
| 3818 | 1778 (int *)option); |
| 4064 | 1779 } else if (options == &sound_options) { |
|
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
1780 g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(set_sound_option), |
| 3818 | 1781 (int *)option); |
| 4064 | 1782 } else if (options == &away_options) { |
|
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
1783 g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(set_away_option), |
| 4064 | 1784 (int *)option); |
| 1785 } else { | |
| 1786 debug_printf("gaim_button: \"%s\" has no signal handler attached to it!\n", text); | |
| 1787 } | |
| 1 | 1788 gtk_widget_show(button); |
| 1789 | |
| 1790 return button; | |
| 1791 } | |
| 1792 | |
| 3366 | 1793 void away_list_clicked(GtkWidget *widget, struct away_message *a) |
| 1794 {} | |
| 1795 void default_away_menu_init(GtkWidget *omenu) | |
| 3032 | 1796 { |
| 3366 | 1797 GtkWidget *menu, *opt; |
| 1798 int index = 0; | |
| 1799 GSList *awy = away_messages; | |
| 1800 struct away_message *a; | |
| 1801 | |
| 1802 menu = gtk_menu_new(); | |
| 1803 | |
| 1804 while (awy) { | |
| 1805 a = (struct away_message *)awy->data; | |
| 1806 opt = gtk_menu_item_new_with_label(a->name); | |
|
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
1807 g_signal_connect(GTK_OBJECT(opt), "activate", G_CALLBACK(set_default_away), |
| 3366 | 1808 (gpointer)index); |
| 1809 gtk_widget_show(opt); | |
| 1810 gtk_menu_append(GTK_MENU(menu), opt); | |
| 1811 | |
| 1812 awy = awy->next; | |
| 1813 index++; | |
| 1814 } | |
| 1815 | |
| 1816 gtk_option_menu_remove_menu(GTK_OPTION_MENU(omenu)); | |
| 1817 gtk_option_menu_set_menu(GTK_OPTION_MENU(omenu), menu); | |
| 1818 gtk_option_menu_set_history(GTK_OPTION_MENU(omenu), g_slist_index(away_messages, default_away)); | |
| 1819 } | |
| 1820 | |
| 1821 GtkWidget *pref_fg_picture = NULL; | |
| 1822 GtkWidget *pref_bg_picture = NULL; | |
| 1823 | |
| 1824 void destroy_colorsel(GtkWidget *w, gpointer d) | |
| 1825 { | |
| 1826 if (d) { | |
| 1827 gtk_widget_destroy(fgcseld); | |
| 1828 fgcseld = NULL; | |
| 1829 } else { | |
| 1830 gtk_widget_destroy(bgcseld); | |
| 1831 bgcseld = NULL; | |
| 1832 } | |
| 3032 | 1833 } |
| 1834 | |
| 3366 | 1835 void apply_color_dlg(GtkWidget *w, gpointer d) |
| 3032 | 1836 { |
| 3366 | 1837 if ((int)d == 1) { |
| 1838 gtk_color_selection_get_current_color(GTK_COLOR_SELECTION | |
| 3500 | 1839 (GTK_COLOR_SELECTION_DIALOG(fgcseld)->colorsel), |
| 3818 | 1840 &fgcolor); |
| 3366 | 1841 destroy_colorsel(NULL, (void *)1); |
| 1842 update_color(NULL, pref_fg_picture); | |
| 1843 } else { | |
| 1844 gtk_color_selection_get_current_color(GTK_COLOR_SELECTION | |
| 3500 | 1845 (GTK_COLOR_SELECTION_DIALOG(bgcseld)->colorsel), |
| 3818 | 1846 &bgcolor); |
| 3366 | 1847 destroy_colorsel(NULL, (void *)0); |
| 1848 update_color(NULL, pref_bg_picture); | |
| 1849 } | |
| 3032 | 1850 } |
| 1851 | |
| 3366 | 1852 void update_color(GtkWidget *w, GtkWidget *pic) |
| 1 | 1853 { |
| 3366 | 1854 GdkColor c; |
| 1855 GtkStyle *style; | |
| 1856 c.pixel = 0; | |
| 3500 | 1857 |
| 3366 | 1858 if (pic == pref_fg_picture) { |
| 3818 | 1859 if (font_options & OPT_FONT_FGCOL) { |
| 1860 c.red = fgcolor.red; | |
| 1861 c.blue = fgcolor.blue; | |
| 1862 c.green = fgcolor.green; | |
| 3366 | 1863 } else { |
| 1864 c.red = 0; | |
| 1865 c.blue = 0; | |
| 1866 c.green = 0; | |
| 1867 } | |
| 1868 } else { | |
| 3818 | 1869 if (font_options & OPT_FONT_BGCOL) { |
| 1870 c.red = bgcolor.red; | |
| 1871 c.blue = bgcolor.blue; | |
| 1872 c.green = bgcolor.green; | |
| 3366 | 1873 } else { |
| 1874 c.red = 0xffff; | |
| 1875 c.blue = 0xffff; | |
| 1876 c.green = 0xffff; | |
| 1877 } | |
| 1878 } | |
| 1879 | |
| 1880 style = gtk_style_new(); | |
| 1881 style->bg[0] = c; | |
| 1882 gtk_widget_set_style(pic, style); | |
| 1883 gtk_style_unref(style); | |
| 1884 } | |
| 4064 | 1885 |
| 3366 | 1886 void set_default_away(GtkWidget *w, gpointer i) |
| 1887 { | |
| 1888 | |
| 1889 int length = g_slist_length(away_messages); | |
|
338
9d258a0aa560
[gaim-migrate @ 348]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
337
diff
changeset
|
1890 |
| 3366 | 1891 if (away_messages == NULL) |
| 3818 | 1892 default_away = NULL; |
| 3366 | 1893 else if ((int)i >= length) |
| 3818 | 1894 default_away = g_slist_nth_data(away_messages, length - 1); |
| 3366 | 1895 else |
| 3818 | 1896 default_away = g_slist_nth_data(away_messages, (int)i); |
| 3366 | 1897 } |
| 3500 | 1898 |
| 3366 | 1899 static void update_spin_value(GtkWidget *w, GtkWidget *spin) |
| 1900 { | |
| 1901 int *value = gtk_object_get_user_data(GTK_OBJECT(spin)); | |
| 1902 *value = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(spin)); | |
| 1903 } | |
| 4064 | 1904 |
| 3427 | 1905 GtkWidget *gaim_labeled_spin_button(GtkWidget *box, const gchar *title, int *val, int min, int max, GtkSizeGroup *sg) |
| 3366 | 1906 { |
| 1907 GtkWidget *hbox; | |
| 1908 GtkWidget *label; | |
| 1909 GtkWidget *spin; | |
| 1910 GtkObject *adjust; | |
|
901
f168f2c7b357
[gaim-migrate @ 911]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
893
diff
changeset
|
1911 |
| 3366 | 1912 hbox = gtk_hbox_new(FALSE, 5); |
| 1913 gtk_box_pack_start(GTK_BOX(box), hbox, FALSE, FALSE, 5); | |
| 1914 gtk_widget_show(hbox); | |
| 1915 | |
| 3427 | 1916 label = gtk_label_new_with_mnemonic(title); |
| 3366 | 1917 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); |
| 1918 gtk_widget_show(label); | |
|
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
1919 |
| 3366 | 1920 adjust = gtk_adjustment_new(*val, min, max, 1, 1, 1); |
| 1921 spin = gtk_spin_button_new(GTK_ADJUSTMENT(adjust), 1, 0); | |
| 1922 gtk_object_set_user_data(GTK_OBJECT(spin), val); | |
| 1923 gtk_widget_set_usize(spin, 50, -1); | |
| 1924 gtk_box_pack_start(GTK_BOX(hbox), spin, FALSE, FALSE, 0); | |
|
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
1925 g_signal_connect(GTK_OBJECT(adjust), "value-changed", |
|
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
1926 G_CALLBACK(update_spin_value), GTK_WIDGET(spin)); |
| 3366 | 1927 gtk_widget_show(spin); |
| 3500 | 1928 |
| 3427 | 1929 gtk_label_set_mnemonic_widget(GTK_LABEL(label), spin); |
| 1930 | |
| 1931 if (sg) { | |
| 1932 gtk_size_group_add_widget(sg, label); | |
| 1933 gtk_misc_set_alignment(GTK_MISC(label), 0, 0); | |
| 3500 | 1934 |
| 3427 | 1935 } |
| 1936 return label; | |
|
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1937 } |
| 1 | 1938 |
| 3366 | 1939 void dropdown_set(GtkObject *w, int *option) |
|
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1940 { |
| 3366 | 1941 int opt = (int)gtk_object_get_user_data(w); |
| 1942 int clear = (int)gtk_object_get_data(w, "clear"); | |
| 3500 | 1943 |
| 3366 | 1944 if (clear != -1) { |
| 1945 *option = *option & ~clear; | |
| 1946 *option = *option | opt; | |
| 1947 } else { | |
| 1948 debug_printf("HELLO %d\n", opt); | |
| 1949 *option = opt; | |
| 1950 } | |
| 3500 | 1951 |
| 3818 | 1952 if (option == &proxytype) { |
| 3366 | 1953 if (opt == PROXY_NONE) |
| 1954 gtk_widget_set_sensitive(prefs_proxy_frame, FALSE); | |
| 1955 else | |
| 1956 gtk_widget_set_sensitive(prefs_proxy_frame, TRUE); | |
| 3818 | 1957 } else if (option == &web_browser) { |
| 3366 | 1958 if (opt == BROWSER_MANUAL) |
| 1959 gtk_widget_set_sensitive(browser_entry, TRUE); | |
| 1960 else | |
| 1961 gtk_widget_set_sensitive(browser_entry, FALSE); | |
| 3818 | 1962 } else if (option == (int*)&sound_options) { |
| 3366 | 1963 if (opt == OPT_SOUND_CMD) |
| 1964 gtk_widget_set_sensitive(sndcmd, TRUE); | |
| 1965 else | |
| 1966 gtk_widget_set_sensitive(sndcmd, FALSE); | |
| 3818 | 1967 } else if (option == (int*)&im_options) { |
| 1968 if (clear == (OPT_IM_SIDE_TAB | OPT_IM_BR_TAB)) | |
| 1969 update_im_tabs(); | |
| 1970 else if (clear == (OPT_IM_BUTTON_TEXT | OPT_IM_BUTTON_XPM)) | |
| 1971 update_im_button_pix(); | |
| 1972 } else if (option == (int*)&chat_options) { | |
| 1973 if (clear == (OPT_CHAT_SIDE_TAB | OPT_CHAT_BR_TAB)) | |
|
4089
7f4f3aa61069
[gaim-migrate @ 4304]
Christian Hammond <chipx86@chipx86.com>
parents:
4082
diff
changeset
|
1974 update_chat_tabs(); |
| 3818 | 1975 else if (clear == (OPT_CHAT_BUTTON_TEXT | OPT_CHAT_BUTTON_XPM)) |
|
4089
7f4f3aa61069
[gaim-migrate @ 4304]
Christian Hammond <chipx86@chipx86.com>
parents:
4082
diff
changeset
|
1976 update_chat_button_pix(); |
| 3818 | 1977 } else if (option == (int*)&blist_options) { |
| 1978 set_blist_tab(); | |
| 3366 | 1979 } |
| 1 | 1980 } |
| 1981 | |
| 3500 | 1982 static GtkWidget *gaim_dropdown(GtkWidget *box, const gchar *title, int *option, int clear, ...) |
| 1 | 1983 { |
| 3366 | 1984 va_list menuitems; |
| 1985 GtkWidget *dropdown, *opt, *menu; | |
| 1986 GtkWidget *label; | |
| 1987 gchar *text; | |
| 1988 int value; | |
| 1989 int o = 0; | |
| 1990 GtkWidget *hbox; | |
| 1 | 1991 |
| 3366 | 1992 hbox = gtk_hbox_new(FALSE, 5); |
| 1993 gtk_container_add (GTK_CONTAINER (box), hbox); | |
| 1994 gtk_widget_show(hbox); | |
| 1995 | |
| 3427 | 1996 label = gtk_label_new_with_mnemonic(title); |
| 3366 | 1997 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); |
| 1998 gtk_widget_show(label); | |
| 1999 | |
| 2000 va_start(menuitems, clear); | |
| 2001 text = va_arg(menuitems, gchar *); | |
| 2002 | |
| 2003 if (!text) | |
| 2004 return NULL; | |
| 3500 | 2005 |
| 3366 | 2006 dropdown = gtk_option_menu_new(); |
| 2007 menu = gtk_menu_new(); | |
| 3500 | 2008 |
| 3427 | 2009 gtk_label_set_mnemonic_widget(GTK_LABEL(label), dropdown); |
| 3500 | 2010 |
| 3366 | 2011 while (text) { |
| 2012 value = va_arg(menuitems, int); | |
| 2013 opt = gtk_menu_item_new_with_label(text); | |
| 2014 gtk_object_set_user_data(GTK_OBJECT(opt), (void *)value); | |
| 2015 gtk_object_set_data(GTK_OBJECT(opt), "clear", (void *)clear); | |
|
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
2016 g_signal_connect(GTK_OBJECT(opt), "activate", |
|
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
2017 G_CALLBACK(dropdown_set), (void *)option); |
| 3366 | 2018 gtk_widget_show(opt); |
| 2019 gtk_menu_shell_append(GTK_MENU_SHELL(menu), opt); | |
| 1 | 2020 |
| 3366 | 2021 if (((clear > -1) && ((*option & value) == value)) || *option == value) { |
| 2022 gtk_menu_set_active(GTK_MENU(menu), o); | |
| 2023 } | |
| 2024 text = va_arg(menuitems, gchar *); | |
| 2025 o++; | |
| 2026 } | |
|
2262
9c8f353331e7
[gaim-migrate @ 2272]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2254
diff
changeset
|
2027 |
| 3366 | 2028 va_end(menuitems); |
| 1 | 2029 |
| 3500 | 2030 gtk_option_menu_set_menu(GTK_OPTION_MENU(dropdown), menu); |
| 3366 | 2031 gtk_box_pack_start(GTK_BOX(hbox), dropdown, FALSE, FALSE, 0); |
| 2032 gtk_widget_show(dropdown); | |
| 3427 | 2033 return label; |
| 3500 | 2034 } |
| 2035 | |
| 3366 | 2036 static GtkWidget *show_color_pref(GtkWidget *box, gboolean fgc) |
| 1 | 2037 { |
| 3366 | 2038 /* more stuff stolen from X-Chat */ |
| 2039 GtkWidget *swid; | |
| 2040 GdkColor c; | |
| 2041 GtkStyle *style; | |
| 2042 c.pixel = 0; | |
| 2043 if (fgc) { | |
| 3818 | 2044 if (font_options & OPT_FONT_FGCOL) { |
| 2045 c.red = fgcolor.red; | |
| 2046 c.blue = fgcolor.blue; | |
| 2047 c.green = fgcolor.green; | |
| 3366 | 2048 } else { |
| 2049 c.red = 0; | |
| 2050 c.blue = 0; | |
| 2051 c.green = 0; | |
| 2052 } | |
| 2053 } else { | |
| 3818 | 2054 if (font_options & OPT_FONT_BGCOL) { |
| 2055 c.red = bgcolor.red; | |
| 2056 c.blue = bgcolor.blue; | |
| 2057 c.green = bgcolor.green; | |
| 3366 | 2058 } else { |
| 2059 c.red = 0xffff; | |
| 2060 c.blue = 0xffff; | |
| 2061 c.green = 0xffff; | |
| 2062 } | |
| 2063 } | |
| 1 | 2064 |
| 3366 | 2065 style = gtk_style_new(); |
| 2066 style->bg[0] = c; | |
|
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
2067 |
| 3366 | 2068 swid = gtk_event_box_new(); |
| 2069 gtk_widget_set_style(GTK_WIDGET(swid), style); | |
| 2070 gtk_style_unref(style); | |
| 2071 gtk_widget_set_usize(GTK_WIDGET(swid), 40, -1); | |
| 2072 gtk_box_pack_start(GTK_BOX(box), swid, FALSE, FALSE, 5); | |
| 2073 gtk_widget_show(swid); | |
| 2074 return swid; | |
| 1 | 2075 } |
| 4064 | 2076 |
| 3366 | 2077 void apply_font_dlg(GtkWidget *w, GtkWidget *f) |
|
1124
a70d5200edde
[gaim-migrate @ 1134]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1123
diff
changeset
|
2078 { |
| 3366 | 2079 int i = 0; |
| 2080 char *fontname; | |
| 2081 | |
| 3473 | 2082 fontname = g_strdup(gtk_font_selection_dialog_get_font_name(GTK_FONT_SELECTION_DIALOG(f))); |
| 3366 | 2083 destroy_fontsel(0, 0); |
|
1124
a70d5200edde
[gaim-migrate @ 1134]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1123
diff
changeset
|
2084 |
| 3818 | 2085 while(fontname[i] && !isdigit(fontname[i]) && i < sizeof(fontface)) { |
| 2086 fontface[i] = fontname[i]; | |
| 3366 | 2087 i++; |
| 2088 } | |
| 3818 | 2089 fontface[i] = 0; |
| 3366 | 2090 g_free(fontname); |
|
1124
a70d5200edde
[gaim-migrate @ 1134]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1123
diff
changeset
|
2091 } |
| 3500 | 2092 |
