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