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