Mercurial > pidgin
annotate src/prefs.c @ 3374:3cd2fbddf95a
[gaim-migrate @ 3393]
I had terrible days today and yesterday--a really terrible weekend.
No cool stuff from me--the prefs away message page works a bit better.
Ari and Chip both sent some patches to make things work a bit better in
GTK 2, and Etan rewrote the notify plugin so it's really cool now!
Thanks, guys!
committer: Tailor Script <tailor@pidgin.im>
| author | Sean Egan <seanegan@gmail.com> |
|---|---|
| date | Mon, 05 Aug 2002 07:33:09 +0000 |
| parents | 0e79bf1d79ea |
| children | 783e982a56da |
| rev | line source |
|---|---|
| 1 | 1 /* |
| 2 * gaim | |
| 3 * | |
| 3366 | 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> |
| 1 | 35 #include <gtk/gtk.h> |
|
1780
d7cbedd1d651
[gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1773
diff
changeset
|
36 #include "gtkimhtml.h" |
| 1 | 37 #include "gaim.h" |
|
1357
783ba886b6b6
[gaim-migrate @ 1367]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1324
diff
changeset
|
38 #include "prpl.h" |
| 3366 | 39 #include "proxy.h" |
| 40 | |
| 41 /* xpms for gtk1.2 */ | |
| 42 #if !GTK_CHECK_VERSION (1,3,0) | |
| 588 | 43 #include "pixmaps/cancel.xpm" |
| 595 | 44 #include "pixmaps/fontface2.xpm" |
| 617 | 45 #include "pixmaps/gnome_add.xpm" |
| 46 #include "pixmaps/gnome_remove.xpm" | |
|
832
0142b4c66394
[gaim-migrate @ 842]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
830
diff
changeset
|
47 #include "pixmaps/gnome_preferences.xpm" |
|
855
82673bb41e2f
[gaim-migrate @ 865]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
48 #include "pixmaps/bgcolor.xpm" |
|
82673bb41e2f
[gaim-migrate @ 865]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
49 #include "pixmaps/fgcolor.xpm" |
| 821 | 50 #include "pixmaps/save.xpm" |
| 3366 | 51 #include "pixmaps/ok.xpm" |
| 52 #include "pixmaps/join.xpm" | |
| 53 #endif | |
| 1 | 54 |
| 55 | |
| 3366 | 56 /* temporary preferences */ |
| 57 static guint misc_options_new; | |
| 58 static guint logging_options_new; | |
| 59 static guint blist_options_new; | |
| 60 static guint convo_options_new; | |
| 61 static guint im_options_new; | |
| 62 static guint chat_options_new; | |
| 63 static guint font_options_new; | |
| 64 static guint sound_options_new; | |
| 65 static char *sound_file_new[NUM_SOUNDS]; | |
| 66 static guint away_options_new; | |
| 67 static guint away_resend_new; | |
| 68 static int auto_away_new; | |
| 69 static int report_idle_new; | |
| 70 static int proxytype_new; | |
| 71 static struct away_message* default_away_new; | |
| 72 static int web_browser_new; | |
| 73 static char sound_cmd_new[2048]; | |
| 74 static char web_command_new[2048]; | |
| 75 static int fontsize_new; | |
| 76 GdkColor fgcolor_new, bgcolor_new; | |
| 77 static struct window_size conv_size_new, buddy_chat_size_new; | |
| 78 char fontface_new[128]; | |
| 79 #if !GTK_CHECK_VERSION(1,3,0) | |
| 80 char fontxfld_new[256]; | |
| 81 char fontfacexfld[256]; | |
| 82 #endif | |
| 83 char fontface[128]; | |
|
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
84 |
| 1175 | 85 |
|
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
86 GtkWidget *prefs_away_list = NULL; |
|
1109
c73736fa0b7c
[gaim-migrate @ 1119]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1087
diff
changeset
|
87 GtkWidget *prefs_away_menu = NULL; |
|
1124
a70d5200edde
[gaim-migrate @ 1134]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1123
diff
changeset
|
88 GtkWidget *preftree = NULL; |
| 3366 | 89 GtkWidget *fontseld = NULL; |
| 90 | |
| 91 #if GTK_CHECK_VERSION(1,3,0) | |
| 92 GtkTreeStore *prefs_away_store = NULL; | |
| 93 #endif | |
| 94 | |
| 95 static int sound_row_sel = 0; | |
| 96 static char *last_sound_dir = NULL; | |
| 97 | |
| 98 static GtkWidget *sounddialog = NULL; | |
| 99 static GtkWidget *browser_entry = NULL; | |
| 100 static GtkWidget *sound_entry = NULL; | |
| 101 static GtkWidget *away_text = NULL; | |
|
1124
a70d5200edde
[gaim-migrate @ 1134]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1123
diff
changeset
|
102 GtkCTreeNode *general_node = NULL; |
|
a70d5200edde
[gaim-migrate @ 1134]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1123
diff
changeset
|
103 GtkCTreeNode *deny_node = NULL; |
| 2254 | 104 GtkWidget *prefs_proxy_frame = NULL; |
| 3366 | 105 static GtkWidget *gaim_button(const char *, guint *, int, GtkWidget *); |
| 106 GtkWidget *gaim_labeled_spin_button(GtkWidget *, const gchar *, int*, int, int); | |
| 107 static GtkWidget *gaim_dropdown(GtkWidget *, const gchar *, int *, int, ...); | |
| 108 static GtkWidget *show_color_pref(GtkWidget *, gboolean); | |
| 109 static void delete_prefs(GtkWidget *, void *); | |
| 110 void set_default_away(GtkWidget *, gpointer); | |
| 111 static void set_font_option(GtkWidget *w, int option); | |
| 1026 | 112 |
| 3366 | 113 struct debug_window *dw = NULL; |
| 114 static GtkWidget *prefs = NULL; | |
| 115 GtkWidget *debugbutton = NULL; | |
|
1525
ba8e6e211af5
[gaim-migrate @ 1535]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1455
diff
changeset
|
116 |
| 3366 | 117 void delete_prefs(GtkWidget *asdf, void *gdsa) { |
| 118 int v; | |
| 119 | |
| 120 prefs = NULL; | |
| 121 for (v = 0; v < NUM_SOUNDS; v++) { | |
| 122 if (sound_file_new[v]) | |
| 123 g_free(sound_file_new[v]); | |
| 124 sound_file_new[v] = NULL; | |
| 125 } | |
| 126 sound_entry = NULL; | |
| 127 browser_entry = NULL; | |
| 128 debugbutton=NULL; | |
| 129 gtk_widget_destroy(sounddialog); | |
| 130 #if GTK_CHECK_VERSION(1,3,0) | |
| 131 g_object_unref(G_OBJECT(prefs_away_store)); | |
| 132 #endif | |
|
1525
ba8e6e211af5
[gaim-migrate @ 1535]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1455
diff
changeset
|
133 } |
|
ba8e6e211af5
[gaim-migrate @ 1535]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1455
diff
changeset
|
134 |
| 3366 | 135 GtkWidget *preflabel; |
| 136 GtkWidget *prefsnotebook; | |
| 137 #if GTK_CHECK_VERSION(1,3,0) | |
| 138 GtkTreeStore *prefstree; | |
| 139 #else | |
| 140 GtkWidget *prefstree; | |
|
1750
d2eca7a46cfd
[gaim-migrate @ 1760]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1711
diff
changeset
|
141 #endif |
|
d2eca7a46cfd
[gaim-migrate @ 1760]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1711
diff
changeset
|
142 |
| 3366 | 143 static void set_misc_options(); |
| 144 static void set_logging_options(); | |
| 145 static void set_blist_options(); | |
| 146 static void set_convo_options(); | |
| 147 static void set_im_options(); | |
| 148 static void set_chat_options(); | |
| 149 static void set_font_options(); | |
| 150 static void set_sound_options(); | |
| 151 static void set_away_options(); | |
|
1750
d2eca7a46cfd
[gaim-migrate @ 1760]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1711
diff
changeset
|
152 |
| 3366 | 153 extern void BuddyTickerShow(); |
|
1525
ba8e6e211af5
[gaim-migrate @ 1535]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1455
diff
changeset
|
154 |
|
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
155 #define PROXYHOST 0 |
|
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
156 #define PROXYPORT 1 |
|
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
157 #define PROXYTYPE 2 |
|
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
158 #define PROXYUSER 3 |
|
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
159 #define PROXYPASS 4 |
|
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
160 static void proxy_print_option(GtkEntry *entry, int entrynum) |
|
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
161 { |
|
2372
2927c2c26fe6
[gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2323
diff
changeset
|
162 if (entrynum == PROXYHOST) |
|
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
163 g_snprintf(proxyhost, sizeof(proxyhost), "%s", gtk_entry_get_text(entry)); |
|
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
164 else if (entrynum == PROXYPORT) |
|
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
165 proxyport = atoi(gtk_entry_get_text(entry)); |
|
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
166 else if (entrynum == PROXYUSER) |
|
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
167 g_snprintf(proxyuser, sizeof(proxyuser), "%s", gtk_entry_get_text(entry)); |
|
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
168 else if (entrynum == PROXYPASS) |
|
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
169 g_snprintf(proxypass, sizeof(proxypass), "%s", gtk_entry_get_text(entry)); |
|
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
170 save_prefs(); |
|
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
171 } |
|
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
172 |
| 3366 | 173 |
| 174 /* OK, Apply and Cancel */ | |
| 175 | |
| 176 static void apply_cb(GtkWidget *button, void *data) | |
|
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
177 { |
| 3366 | 178 int r; |
| 179 if (misc_options != misc_options_new) | |
| 180 set_misc_options(); | |
| 181 if (logging_options != logging_options_new) | |
| 182 set_logging_options(); | |
| 183 if (blist_options != blist_options_new) | |
| 184 set_blist_options(); | |
| 185 if (convo_options != convo_options_new) | |
| 186 set_convo_options(); | |
| 187 if (im_options != im_options_new) | |
| 188 set_im_options(); | |
| 189 if (chat_options != chat_options_new) | |
| 190 set_chat_options(); | |
| 191 chat_options = chat_options_new; | |
| 192 if (font_options != font_options_new) | |
| 193 set_font_options(); | |
| 194 if (sound_options != sound_options_new) | |
| 195 set_sound_options(); | |
| 196 for (r = 0; r < NUM_SOUNDS; r++) { | |
| 197 if (sound_file[r]) | |
| 198 g_free(sound_file[r]); | |
| 199 sound_file[r] = sound_file_new[r]; | |
| 200 sound_file_new[r] = NULL; | |
| 201 } | |
| 202 if (away_options != away_options_new) | |
| 203 set_away_options(); | |
| 204 away_resend = away_resend_new; | |
| 205 auto_away = auto_away_new; | |
| 206 report_idle = report_idle_new; | |
| 207 web_browser = web_browser_new; | |
| 208 proxytype = proxytype_new; | |
| 209 default_away = default_away_new; | |
| 210 fontsize = fontsize_new; | |
| 211 g_snprintf(sound_cmd, sizeof(sound_cmd), "%s", sound_cmd_new); | |
| 212 g_snprintf(web_command, sizeof(web_command), "%s", web_command_new); | |
| 213 memcpy(&conv_size, &conv_size_new, sizeof(struct window_size)); | |
| 214 memcpy(&conv_size, &conv_size_new, sizeof(struct window_size)); | |
| 215 memcpy(&fgcolor, &fgcolor_new, sizeof(GdkColor)); | |
| 216 memcpy(&bgcolor, &bgcolor_new, sizeof(GdkColor)); | |
| 2254 | 217 |
| 3366 | 218 |
| 219 g_snprintf(fontface, sizeof(fontface), fontface_new); | |
| 220 #if !GTK_CHECK_VERSION(1,3,0) | |
| 221 g_snprintf(fontxfld, sizeof(fontxfld), fontxfld_new); | |
| 222 #endif | |
| 223 update_convo_font(); | |
| 224 update_convo_color(); | |
|
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
225 save_prefs(); |
|
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
226 } |
|
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
227 |
| 3366 | 228 |
| 229 static void ok_cb(GtkWidget *button, void *data) | |
|
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
230 { |
| 3366 | 231 apply_cb(button, data); |
| 232 gtk_widget_destroy(prefs); | |
| 233 } | |
| 234 #if GTK_CHECK_VERSION(1,3,0) | |
| 235 static void pref_nb_select(GtkTreeSelection *sel, GtkNotebook *nb) { | |
| 236 GtkTreeIter iter; | |
| 237 GValue val = { 0, }; | |
| 238 GtkTreeModel *model = GTK_TREE_MODEL(prefstree); | |
| 239 | |
| 240 if (! gtk_tree_selection_get_selected (sel, &model, &iter)) | |
| 241 return; | |
| 242 gtk_tree_model_get_value (model, &iter, 1, &val); | |
| 243 gtk_label_set_text (GTK_LABEL(preflabel), g_value_get_string (&val)); | |
| 244 g_value_unset (&val); | |
| 245 gtk_tree_model_get_value (model, &iter, 2, &val); | |
| 246 gtk_notebook_set_current_page (GTK_NOTEBOOK (prefsnotebook), g_value_get_int (&val)); | |
| 247 | |
| 248 } | |
| 249 #else | |
| 250 static void pref_nb_select(GtkCTree *ctree, GtkCTreeNode *node, gint column, GtkNotebook *nb) { | |
| 251 char *text; | |
| 252 gtk_ctree_get_node_info(GTK_CTREE(ctree), node, &text, NULL, NULL, NULL, NULL, NULL, NULL, NULL); | |
| 253 gtk_label_set_text (GTK_LABEL(preflabel), text); | |
| 254 gtk_notebook_set_page (GTK_NOTEBOOK (prefsnotebook), gtk_ctree_node_get_row_data(GTK_CTREE(ctree), node)); | |
| 255 | |
| 256 } | |
| 257 #endif /* GTK_CHECK_VERSION */ | |
| 258 | |
| 259 /* These are the pages in the preferences notebook */ | |
| 260 GtkWidget *interface_page() { | |
| 261 GtkWidget *ret; | |
| 262 GtkWidget *frame; | |
|
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
263 GtkWidget *vbox; |
| 3366 | 264 ret = gtk_vbox_new(FALSE, 5); |
| 265 gtk_container_set_border_width (GTK_CONTAINER (ret), 6); | |
| 266 | |
| 267 /* All the pages are pretty similar--a vbox packed with frames... */ | |
| 268 frame = gtk_frame_new (_("Windows")); | |
| 269 gtk_box_pack_start (GTK_BOX (ret), frame, FALSE, FALSE, 0); | |
| 270 gtk_widget_show (frame); | |
| 271 | |
| 272 /* And a vbox in each frame */ | |
| 273 vbox = gtk_vbox_new(FALSE, 5); | |
| 274 gtk_container_add (GTK_CONTAINER (frame), vbox); | |
| 275 | |
| 276 /* These shouldn't have to wait for user to click OK or APPLY or whatnot */ | |
| 277 /* They really shouldn't be in preferences at all */ | |
| 278 gaim_button(_("Show Buddy Ticker"), &misc_options, OPT_MISC_BUDDY_TICKER, vbox); | |
| 279 debugbutton = gaim_button(_("Show Debug Window"), &misc_options, OPT_MISC_DEBUG, vbox); | |
| 280 gtk_widget_show (vbox); | |
| 281 | |
| 282 | |
| 283 frame = gtk_frame_new (_("Style")); | |
| 284 gtk_box_pack_start (GTK_BOX (ret), frame, FALSE, FALSE, 0); | |
| 285 gtk_widget_show (frame); | |
| 286 | |
| 287 vbox = gtk_vbox_new(FALSE, 5); | |
| 288 gtk_container_add (GTK_CONTAINER (frame), vbox); | |
| 289 gaim_button(_("Use borderless buttons"), &misc_options_new, OPT_MISC_COOL_LOOK, vbox); | |
| 290 gtk_widget_show (vbox); | |
| 291 | |
| 292 gtk_widget_show(ret); | |
| 293 return ret; | |
| 294 } | |
| 295 | |
| 296 GtkWidget *font_page() { | |
| 297 GtkWidget *ret; | |
| 2254 | 298 GtkWidget *frame; |
| 3366 | 299 GtkWidget *button; |
| 300 GtkWidget *vbox, *hbox; | |
| 301 GtkWidget *select = NULL; | |
| 302 ret = gtk_vbox_new(FALSE, 5); | |
| 303 gtk_container_set_border_width (GTK_CONTAINER (ret), 6); | |
| 304 | |
| 305 frame = gtk_frame_new (_("Style")); | |
| 306 gtk_box_pack_start (GTK_BOX (ret), frame, FALSE, FALSE, 0); | |
| 307 gtk_widget_show (frame); | |
| 308 | |
| 309 vbox = gtk_vbox_new(FALSE, 5); | |
| 310 gtk_container_add (GTK_CONTAINER (frame), vbox); | |
| 311 gaim_button(_("Bold"), &font_options_new, OPT_FONT_BOLD, vbox); | |
| 312 gaim_button(_("Italics"), &font_options_new, OPT_FONT_ITALIC, vbox); | |
| 313 gaim_button(_("Underline"), &font_options_new, OPT_FONT_UNDERLINE, vbox); | |
| 314 gaim_button(_("Strikethough"), &font_options_new, OPT_FONT_STRIKE, vbox); | |
| 315 gtk_widget_show (vbox); | |
| 316 | |
| 317 | |
| 318 frame = gtk_frame_new (_("Face")); | |
| 319 gtk_box_pack_start (GTK_BOX (ret), frame, FALSE, FALSE, 0); | |
| 320 gtk_widget_show (frame); | |
| 321 | |
| 322 vbox = gtk_vbox_new(FALSE, 5); | |
| 323 gtk_container_add (GTK_CONTAINER (frame), vbox); | |
| 324 hbox = gtk_hbox_new(FALSE, 5); | |
| 325 gtk_container_add(GTK_CONTAINER(vbox), hbox); | |
| 326 button = gaim_button(_("Use custom face"), &font_options_new, OPT_FONT_FACE, hbox); | |
| 327 #if GTK_CHECK_VERSION(1,3,0) | |
| 328 select = gtk_button_new_from_stock(GTK_STOCK_SELECT_FONT); | |
| 329 #else | |
| 330 select = picture_button(prefs, _("Select"), fontface2_xpm); | |
| 331 #endif | |
| 332 if (!(font_options_new & OPT_FONT_FACE)) | |
| 333 gtk_widget_set_sensitive(GTK_WIDGET(select), FALSE); | |
| 334 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(toggle_sensitive), select); | |
| 335 gtk_signal_connect(GTK_OBJECT(select), "clicked", GTK_SIGNAL_FUNC(show_font_dialog), NULL); | |
| 336 gtk_box_pack_start(GTK_BOX(hbox), select, FALSE, FALSE, 0); | |
| 337 if (misc_options & OPT_MISC_COOL_LOOK) | |
| 338 gtk_button_set_relief(GTK_BUTTON(select), GTK_RELIEF_NONE); | |
| 339 gtk_widget_show(select); | |
| 340 gtk_widget_show(hbox); | |
| 341 | |
| 342 hbox = gtk_hbox_new(FALSE, 5); | |
| 343 gtk_container_add(GTK_CONTAINER(vbox), hbox); | |
| 344 button = gaim_button(_("Use custom size"), &font_options_new, OPT_FONT_SIZE, hbox); | |
| 345 select = gaim_labeled_spin_button(hbox, NULL, &fontsize_new, 1, 7); | |
| 346 if (!(font_options_new & OPT_FONT_SIZE)) | |
| 347 gtk_widget_set_sensitive(GTK_WIDGET(select), FALSE); | |
| 348 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(toggle_sensitive), select); | |
| 349 gtk_widget_show(hbox); | |
| 350 gtk_widget_show (vbox); | |
| 351 | |
| 352 | |
| 353 frame = gtk_frame_new ("Color"); | |
| 354 gtk_box_pack_start (GTK_BOX (ret), frame, FALSE, FALSE, 0); | |
| 355 gtk_widget_show (frame); | |
| 356 vbox = gtk_vbox_new(FALSE, 5); | |
| 357 gtk_container_add (GTK_CONTAINER (frame), vbox); | |
| 358 hbox = gtk_hbox_new(FALSE, 5); | |
| 359 gtk_container_add(GTK_CONTAINER(vbox), hbox); | |
| 360 | |
| 361 pref_fg_picture = show_color_pref(hbox, TRUE); | |
| 362 button = gaim_button(_("Text color"), &font_options_new, OPT_FONT_FGCOL, hbox); | |
| 363 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(update_color), | |
| 364 pref_fg_picture); | |
| 365 | |
| 366 #if GTK_CHECK_VERSION(1,3,0) | |
| 367 select = gtk_button_new_from_stock(GTK_STOCK_SELECT_COLOR); | |
| 368 #else | |
| 369 select = picture_button(prefs, _("Select"), fgcolor_xpm); | |
| 370 #endif | |
| 371 if (!(font_options_new & OPT_FONT_FGCOL)) | |
| 372 gtk_widget_set_sensitive(GTK_WIDGET(select), FALSE); | |
| 373 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(toggle_sensitive), select); | |
| 374 gtk_signal_connect(GTK_OBJECT(select), "clicked", GTK_SIGNAL_FUNC(show_fgcolor_dialog), NULL); | |
| 375 gtk_box_pack_start(GTK_BOX(hbox), select, FALSE, FALSE, 0); | |
| 376 if (misc_options & OPT_MISC_COOL_LOOK) | |
| 377 gtk_button_set_relief(GTK_BUTTON(select), GTK_RELIEF_NONE); | |
| 378 gtk_widget_show(select); | |
| 379 gtk_widget_show(hbox); | |
|
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
380 |
| 3366 | 381 hbox = gtk_hbox_new(FALSE, 5); |
| 382 gtk_container_add(GTK_CONTAINER(vbox), hbox); | |
| 383 pref_bg_picture = show_color_pref(hbox, FALSE); | |
| 384 button = gaim_button(_("Background color"), &font_options_new, OPT_FONT_BGCOL, hbox); | |
| 385 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(update_color), | |
| 386 pref_bg_picture); | |
| 387 #if GTK_CHECK_VERSION(1,3,0) | |
| 388 select = gtk_button_new_from_stock(GTK_STOCK_SELECT_COLOR); | |
| 389 #else | |
| 390 select = picture_button(prefs, _("Select"), bgcolor_xpm); | |
| 391 #endif | |
| 392 if (!(font_options_new & OPT_FONT_BGCOL)) | |
| 393 gtk_widget_set_sensitive(GTK_WIDGET(select), FALSE); | |
| 394 gtk_signal_connect(GTK_OBJECT(select), "clicked", GTK_SIGNAL_FUNC(show_bgcolor_dialog), NULL); | |
| 395 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(toggle_sensitive), select); | |
| 396 gtk_box_pack_start(GTK_BOX(hbox), select, FALSE, FALSE, 0); | |
| 397 if (misc_options & OPT_MISC_COOL_LOOK) | |
| 398 gtk_button_set_relief(GTK_BUTTON(select), GTK_RELIEF_NONE); | |
| 399 gtk_widget_show(select); | |
| 400 gtk_widget_show(hbox); | |
| 401 gtk_widget_show (vbox); | |
| 402 | |
| 403 | |
| 404 gtk_widget_show(ret); | |
| 405 return ret; | |
| 406 } | |
| 407 | |
| 408 | |
| 409 GtkWidget *messages_page() { | |
| 410 GtkWidget *ret; | |
| 411 GtkWidget *frame; | |
| 412 GtkWidget *vbox; | |
| 413 ret = gtk_vbox_new(FALSE, 5); | |
| 414 gtk_container_set_border_width (GTK_CONTAINER (ret), 6); | |
| 415 | |
| 416 frame = gtk_frame_new ("Display"); | |
| 417 gtk_box_pack_start (GTK_BOX (ret), frame, FALSE, FALSE, 0); | |
| 418 gtk_widget_show (frame); | |
| 419 | |
| 420 vbox = gtk_vbox_new(FALSE, 5); | |
| 421 gtk_container_add (GTK_CONTAINER (frame), vbox); | |
| 422 gaim_button(_("Show graphical smileys"), &convo_options_new, OPT_CONVO_SHOW_SMILEY, vbox); | |
| 423 gaim_button(_("Show timestamp on messages"), &convo_options_new, OPT_CONVO_SHOW_TIME, vbox); | |
| 424 gaim_button(_("Show URLs as links"), &convo_options_new, OPT_CONVO_SEND_LINKS, vbox); | |
| 425 gaim_button(_("Highlight misspelled words"), &convo_options_new, OPT_CONVO_CHECK_SPELLING, vbox); | |
| 426 gtk_widget_show (vbox); | |
| 427 | |
|
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
428 |
| 3366 | 429 frame = gtk_frame_new ("Ignore"); |
| 430 gtk_box_pack_start (GTK_BOX (ret), frame, FALSE, FALSE, 0); | |
| 431 gtk_widget_show (frame); | |
| 432 | |
| 433 vbox = gtk_vbox_new(FALSE, 5); | |
| 434 gtk_container_add (GTK_CONTAINER (frame), vbox); | |
| 435 gaim_button(_("Ignore colors"), &convo_options_new, OPT_CONVO_IGNORE_COLOUR, vbox); | |
| 436 gaim_button(_("Ignore font faces"), &convo_options_new, OPT_CONVO_IGNORE_FONTS, vbox); | |
| 437 gaim_button(_("Ignore font sizes"), &convo_options_new, OPT_CONVO_IGNORE_SIZES, vbox); | |
| 438 gaim_button(_("Ignore TiK Automated Messages"), &away_options_new, OPT_AWAY_TIK_HACK, vbox); | |
| 439 gtk_widget_show (vbox); | |
| 440 | |
| 441 gtk_widget_show(ret); | |
| 442 return ret; | |
| 443 } | |
| 444 | |
| 445 GtkWidget *hotkeys_page() { | |
| 446 GtkWidget *ret; | |
| 447 GtkWidget *frame; | |
| 448 GtkWidget *vbox; | |
| 449 ret = gtk_vbox_new(FALSE, 5); | |
| 450 gtk_container_set_border_width (GTK_CONTAINER (ret), 6); | |
| 451 | |
| 452 frame = gtk_frame_new ("Send Message"); | |
| 453 gtk_box_pack_start (GTK_BOX (ret), frame, FALSE, FALSE, 0); | |
| 454 gtk_widget_show (frame); | |
| 455 | |
| 456 vbox = gtk_vbox_new(FALSE, 5); | |
| 457 gtk_container_add (GTK_CONTAINER (frame), vbox); | |
| 458 gaim_button(_("Enter sends message"), &convo_options_new, OPT_CONVO_ENTER_SENDS, vbox); | |
| 459 gaim_button(_("Control-Enter sends message"), &convo_options_new, OPT_CONVO_CTL_ENTER, vbox); | |
| 460 gtk_widget_show (vbox); | |
| 461 | |
| 462 frame = gtk_frame_new ("Window Closing"); | |
| 463 gtk_box_pack_start (GTK_BOX (ret), frame, FALSE, FALSE, 0); | |
| 464 gtk_widget_show (frame); | |
| 465 | |
| 466 vbox = gtk_vbox_new(FALSE, 5); | |
| 467 gtk_container_add (GTK_CONTAINER (frame), vbox); | |
| 468 gaim_button(_("Escape closes window"), &convo_options_new, OPT_CONVO_ESC_CAN_CLOSE, vbox); | |
| 469 gaim_button(_("Control-W closes window"), &convo_options_new, OPT_CONVO_CTL_W_CLOSES, vbox); | |
| 470 gtk_widget_show (vbox); | |
| 471 | |
| 472 | |
| 473 frame = gtk_frame_new ("Insertions"); | |
| 474 gtk_box_pack_start (GTK_BOX (ret), frame, FALSE, FALSE, 0); | |
| 475 gtk_widget_show (frame); | |
|
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
476 |
|
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
477 vbox = gtk_vbox_new(FALSE, 5); |
| 3366 | 478 gtk_container_add (GTK_CONTAINER (frame), vbox); |
| 479 gaim_button(_("Control-{B/I/U/S} inserts HTML tags"), &convo_options_new, OPT_CONVO_CTL_CHARS, vbox); | |
| 480 gaim_button(_("Control-(number) inserts smileys"), &convo_options_new, OPT_CONVO_CTL_SMILEYS, vbox); | |
| 481 gtk_widget_show (vbox); | |
| 482 | |
| 483 gtk_widget_show(ret); | |
| 484 return ret; | |
| 485 } | |
| 486 | |
| 487 GtkWidget *list_page() { | |
| 488 GtkWidget *ret; | |
| 489 GtkWidget *frame; | |
| 490 GtkWidget *vbox; | |
| 491 ret = gtk_vbox_new(FALSE, 5); | |
| 492 gtk_container_set_border_width (GTK_CONTAINER (ret), 6); | |
| 493 | |
| 494 frame = gtk_frame_new ("Buttons"); | |
| 495 gtk_box_pack_start (GTK_BOX (ret), frame, FALSE, FALSE, 0); | |
| 496 gtk_widget_show (frame); | |
| 497 vbox = gtk_vbox_new(FALSE, 5); | |
| 498 gtk_container_add (GTK_CONTAINER (frame), vbox); | |
| 499 gaim_button(_("Hide IM/Info/Chat buttons"), &blist_options_new, OPT_BLIST_NO_BUTTONS, vbox); | |
| 500 gaim_button(_("Show pictures on buttons"), &blist_options_new, OPT_BLIST_SHOW_BUTTON_XPM, vbox); | |
| 501 gtk_widget_show (vbox); | |
| 502 | |
| 503 | |
| 504 frame = gtk_frame_new ("Buddy List Window"); | |
| 505 gtk_box_pack_start (GTK_BOX (ret), frame, FALSE, FALSE, 0); | |
| 506 gtk_widget_show (frame); | |
| 507 vbox = gtk_vbox_new(FALSE, 5); | |
| 508 gtk_container_add (GTK_CONTAINER (frame), vbox); | |
| 509 #ifdef USE_APPLET | |
| 510 gaim_button(_("Automatically show buddy list on sign on"), &blist_options_new, | |
| 511 OPT_BLIST_APP_BUDDY_SHOW, vbox); | |
| 512 gaim_button(_("Display Buddy List near applet"), &blist_options_new, OPT_BLIST_NEAR_APPLET, vbox); | |
| 513 | |
| 514 #endif | |
| 515 gaim_button(_("Save Window Size/Position"), &blist_options_new, OPT_BLIST_SAVED_WINDOWS, vbox); | |
| 516 gaim_button(_("Raise Window on Events"), &blist_options_new, OPT_BLIST_POPUP, vbox); | |
| 517 gtk_widget_show(vbox); | |
| 518 | |
| 519 | |
| 520 frame = gtk_frame_new ("Group Display"); | |
| 521 gtk_box_pack_start (GTK_BOX (ret), frame, FALSE, FALSE, 0); | |
| 522 gtk_widget_show (frame); | |
| 523 vbox = gtk_vbox_new(FALSE, 5); | |
| 524 gtk_container_add (GTK_CONTAINER (frame), vbox); | |
| 525 gaim_button(_("Hide groups with no online buddies"), &blist_options_new, OPT_BLIST_NO_MT_GRP, vbox); | |
| 526 gaim_button(_("Show numbers in groups"), &blist_options_new, OPT_BLIST_SHOW_GRPNUM, vbox); | |
| 527 gtk_widget_show(vbox); | |
| 528 | |
| 529 | |
| 530 frame = gtk_frame_new ("Buddy Display"); | |
| 531 gtk_box_pack_start (GTK_BOX (ret), frame, FALSE, FALSE, 0); | |
| 532 gtk_widget_show (frame); | |
| 533 vbox = gtk_vbox_new(FALSE, 5); | |
| 534 gtk_container_add (GTK_CONTAINER (frame), vbox); | |
| 535 gaim_button(_("Show buddy type icons"), &blist_options_new, OPT_BLIST_SHOW_PIXMAPS, vbox); | |
| 536 gaim_button(_("Show warning levels"), &blist_options_new, OPT_BLIST_SHOW_WARN, vbox); | |
| 537 gaim_button(_("Show idle times"), &blist_options_new, OPT_BLIST_SHOW_IDLETIME, vbox); | |
| 538 gaim_button(_("Grey idle buddies"), &blist_options_new, OPT_BLIST_GREY_IDLERS, vbox); | |
| 539 gtk_widget_show(vbox); | |
| 540 | |
| 541 | |
| 542 | |
| 543 gtk_widget_show (vbox); | |
| 544 | |
| 545 gtk_widget_show(ret); | |
| 546 return ret; | |
| 547 } | |
| 548 | |
| 549 GtkWidget *im_page() { | |
| 550 GtkWidget *ret; | |
| 551 GtkWidget *frame; | |
| 552 GtkWidget *vbox; | |
| 553 GtkWidget *typingbutton; | |
| 554 | |
| 555 ret = gtk_vbox_new(FALSE, 5); | |
| 556 gtk_container_set_border_width (GTK_CONTAINER (ret), 6); | |
| 557 | |
| 558 frame = gtk_frame_new ("Window"); | |
| 559 gtk_box_pack_start (GTK_BOX (ret), frame, FALSE, FALSE, 0); | |
| 560 gtk_widget_show (frame); | |
| 561 vbox = gtk_vbox_new(FALSE, 5); | |
| 562 gtk_container_add (GTK_CONTAINER (frame), vbox); | |
| 563 gaim_dropdown(vbox, "Show buttons as:", &im_options_new, OPT_IM_BUTTON_TEXT | OPT_IM_BUTTON_XPM, | |
| 564 "Pictures", OPT_IM_BUTTON_XPM, | |
| 565 "Text", OPT_IM_BUTTON_TEXT, | |
| 566 "Pictures and text", OPT_IM_BUTTON_XPM | OPT_IM_BUTTON_TEXT, NULL); | |
| 567 gaim_labeled_spin_button(vbox, _("New window width:"), &conv_size_new.width, 25, 9999); | |
| 568 gaim_labeled_spin_button(vbox, _("New window height:"), &conv_size_new.height, 25, 9999); | |
| 569 gaim_labeled_spin_button(vbox, _("Entry widget height:"), &conv_size_new.entry_height, 25, 9999); | |
| 570 gaim_button(_("Raise windows on events"), &im_options_new, OPT_IM_POPUP, vbox); | |
| 571 gaim_button(_("Hide window on send"), &im_options_new, OPT_IM_POPDOWN, vbox); | |
| 572 gtk_widget_show (vbox); | |
| 573 | |
| 574 | |
| 575 frame = gtk_frame_new ("Buddy Icons"); | |
| 576 gtk_box_pack_start (GTK_BOX (ret), frame, FALSE, FALSE, 0); | |
| 577 gtk_widget_show (frame); | |
| 578 vbox = gtk_vbox_new(FALSE, 5); | |
| 579 gtk_container_add (GTK_CONTAINER (frame), vbox); | |
| 580 gaim_button(_("Hide Buddy Icons"), &im_options_new, OPT_IM_HIDE_ICONS, vbox); | |
| 581 gaim_button(_("Disable Buddy Icon Animation"), &im_options_new, OPT_IM_NO_ANIMATION, vbox); | |
|
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
582 gtk_widget_show(vbox); |
|
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
583 |
| 3366 | 584 |
| 585 frame = gtk_frame_new ("Display"); | |
| 586 gtk_box_pack_start (GTK_BOX (ret), frame, FALSE, FALSE, 0); | |
| 587 gtk_widget_show (frame); | |
| 588 vbox = gtk_vbox_new(FALSE, 5); | |
| 589 gtk_container_add (GTK_CONTAINER (frame), vbox); | |
| 590 gaim_button(_("Show logins in window"), &im_options_new, OPT_IM_LOGON, vbox); | |
| 591 gtk_widget_show(vbox); | |
| 592 | |
| 593 | |
| 594 frame = gtk_frame_new ("Typing Notification"); | |
| 595 gtk_box_pack_start (GTK_BOX (ret), frame, FALSE, FALSE, 0); | |
| 596 gtk_widget_show (frame); | |
| 597 vbox = gtk_vbox_new(FALSE, 5); | |
| 598 gtk_container_add (GTK_CONTAINER (frame), vbox); | |
| 599 typingbutton = gaim_button(_("Notify buddies that you are typing to them"), &misc_options_new, | |
| 600 OPT_MISC_STEALTH_TYPING, vbox); | |
| 601 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(typingbutton), !gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(typingbutton))); | |
| 602 misc_options ^= OPT_MISC_STEALTH_TYPING; | |
| 603 gtk_widget_show(vbox); | |
| 604 | |
| 605 | |
| 606 | |
| 607 gtk_widget_show (vbox); | |
| 608 | |
| 609 gtk_widget_show(ret); | |
| 610 return ret; | |
| 611 } | |
| 612 | |
| 613 GtkWidget *chat_page() { | |
| 614 GtkWidget *ret; | |
| 615 GtkWidget *frame; | |
| 616 GtkWidget *vbox; | |
| 617 ret = gtk_vbox_new(FALSE, 5); | |
| 618 gtk_container_set_border_width (GTK_CONTAINER (ret), 6); | |
| 619 | |
| 620 frame = gtk_frame_new ("Window"); | |
| 621 gtk_box_pack_start (GTK_BOX (ret), frame, FALSE, FALSE, 0); | |
| 622 gtk_widget_show (frame); | |
| 623 vbox = gtk_vbox_new(FALSE, 5); | |
| 624 gtk_container_add (GTK_CONTAINER (frame), vbox); | |
| 625 gaim_dropdown(vbox, "Show buttons as:", &chat_options_new, OPT_CHAT_BUTTON_TEXT | OPT_CHAT_BUTTON_XPM, | |
| 626 "Pictures", OPT_CHAT_BUTTON_XPM, | |
| 627 "Text", OPT_CHAT_BUTTON_TEXT, | |
| 628 "Pictures and Text", OPT_CHAT_BUTTON_XPM | OPT_CHAT_BUTTON_TEXT, NULL); | |
| 629 gaim_labeled_spin_button(vbox, _("New window width:"), &buddy_chat_size_new.width, 25, 9999); | |
| 630 gaim_labeled_spin_button(vbox, _("New window height:"), &buddy_chat_size_new.height, 25, 9999); | |
| 631 gaim_labeled_spin_button(vbox, _("Entry widget height:"), &buddy_chat_size_new.entry_height, 25, 9999); | |
| 632 gaim_button(_("Raise windows on events"), &chat_options, OPT_CHAT_POPUP, vbox); | |
| 633 gtk_widget_show (vbox); | |
| 634 | |
| 635 | |
| 636 frame = gtk_frame_new ("Tab Completion"); | |
| 637 gtk_box_pack_start (GTK_BOX (ret), frame, FALSE, FALSE, 0); | |
| 638 gtk_widget_show (frame); | |
| 639 vbox = gtk_vbox_new(FALSE, 5); | |
| 640 gtk_container_add (GTK_CONTAINER (frame), vbox); | |
| 641 gaim_button(_("Tab-Complete Nicks"), &chat_options_new, OPT_CHAT_TAB_COMPLETE, vbox); | |
| 642 gaim_button(_("Old-Style Tab Completion"), &chat_options_new, OPT_CHAT_OLD_STYLE_TAB, vbox); | |
| 643 gtk_widget_show(vbox); | |
| 644 | |
| 645 | |
| 646 frame = gtk_frame_new ("Display"); | |
| 647 gtk_box_pack_start (GTK_BOX (ret), frame, FALSE, FALSE, 0); | |
| 648 gtk_widget_show (frame); | |
| 649 vbox = gtk_vbox_new(FALSE, 5); | |
| 650 gtk_container_add (GTK_CONTAINER (frame), vbox); | |
| 651 gaim_button(_("Show people joining/leaving in window"), &chat_options_new, OPT_CHAT_LOGON, vbox); | |
| 652 gaim_button(_("Colorize screennames"), &chat_options_new, OPT_CHAT_COLORIZE, vbox); | |
| 653 gtk_widget_show(vbox); | |
| 654 | |
| 655 gtk_widget_show(ret); | |
| 656 return ret; | |
| 657 } | |
|
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
658 |
| 3366 | 659 GtkWidget *tab_page() { |
| 660 GtkWidget *ret; | |
| 661 GtkWidget *frame; | |
| 662 GtkWidget *vbox; | |
| 663 ret = gtk_vbox_new(FALSE, 5); | |
| 664 gtk_container_set_border_width (GTK_CONTAINER (ret), 6); | |
| 665 | |
| 666 frame = gtk_frame_new ("IM Tabs"); | |
| 667 gtk_box_pack_start (GTK_BOX (ret), frame, FALSE, FALSE, 0); | |
| 668 gtk_widget_show (frame); | |
| 669 vbox = gtk_vbox_new(FALSE, 5); | |
| 670 gtk_container_add (GTK_CONTAINER (frame), vbox); | |
| 671 | |
| 672 gaim_dropdown(vbox, "Tab Placement:", &im_options_new, OPT_IM_SIDE_TAB | OPT_IM_BR_TAB, | |
| 673 "Top", 0, | |
| 674 "Bottom", OPT_IM_BR_TAB, | |
| 675 "Left", OPT_IM_SIDE_TAB, | |
| 676 "Right", OPT_IM_BR_TAB | OPT_IM_SIDE_TAB, NULL); | |
| 677 gaim_button(_("Show all Instant Messages in one tabbed\nwindow"), &im_options_new, OPT_IM_ONE_WINDOW, vbox); | |
| 678 gaim_button(_("Show aliases in tabs/titles"), &im_options_new, OPT_IM_ALIAS_TAB, vbox); | |
| 679 gtk_widget_show (vbox); | |
| 680 | |
| 681 | |
| 682 frame = gtk_frame_new ("Chat Tabs"); | |
| 683 gtk_box_pack_start (GTK_BOX (ret), frame, FALSE, FALSE, 0); | |
| 684 gtk_widget_show (frame); | |
| 685 vbox = gtk_vbox_new(FALSE, 5); | |
| 686 gtk_container_add (GTK_CONTAINER (frame), vbox); | |
| 687 | |
| 688 gaim_dropdown(vbox, "Tab Placement:", &chat_options_new, OPT_CHAT_SIDE_TAB | OPT_CHAT_BR_TAB, | |
| 689 "Top", 0, | |
| 690 "Bottom", OPT_CHAT_BR_TAB, | |
| 691 "Left", OPT_CHAT_SIDE_TAB, | |
| 692 "Right", OPT_CHAT_SIDE_TAB | OPT_CHAT_BR_TAB, NULL); | |
| 693 gaim_button(_("Show all chats in one tabbed window"), &chat_options_new, OPT_CHAT_ONE_WINDOW, | |
| 694 vbox); | |
| 695 gtk_widget_show(vbox); | |
|
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
696 |
| 3366 | 697 frame = gtk_frame_new ("Combined Tabs"); |
| 698 gtk_box_pack_start (GTK_BOX (ret), frame, FALSE, FALSE, 0); | |
| 699 gtk_widget_show (frame); | |
| 700 vbox = gtk_vbox_new(FALSE, 5); | |
| 701 gtk_container_add (GTK_CONTAINER (frame), vbox); | |
| 702 gtk_widget_show(vbox); | |
| 703 gaim_button(_("Show IMs and chats in same tabbed\nwindow."), &convo_options_new, OPT_CONVO_COMBINE, vbox); | |
| 704 | |
| 705 frame = gtk_frame_new ("Buddy List Tabs"); | |
| 706 gtk_box_pack_start (GTK_BOX (ret), frame, FALSE, FALSE, 0); | |
| 707 gtk_widget_show (frame); | |
| 708 vbox = gtk_vbox_new(FALSE, 5); | |
| 709 gtk_container_add (GTK_CONTAINER (frame), vbox); | |
| 710 | |
| 711 gaim_dropdown(vbox, "Tab Placement:", &blist_options_new, OPT_BLIST_BOTTOM_TAB, | |
| 712 "Top", 0, | |
| 713 "Bottom", OPT_BLIST_BOTTOM_TAB, NULL); | |
| 714 gtk_widget_show(vbox); | |
| 715 | |
| 716 gtk_widget_show(ret); | |
| 717 return ret; | |
| 718 } | |
| 719 | |
| 720 GtkWidget *proxy_page() { | |
| 721 GtkWidget *ret; | |
| 722 GtkWidget *frame; | |
| 723 GtkWidget *vbox; | |
| 724 GtkWidget *entry; | |
| 725 GtkWidget *label; | |
| 726 GtkWidget *hbox; | |
| 727 GtkWidget *table; | |
| 728 | |
| 729 ret = gtk_vbox_new(FALSE, 5); | |
| 730 gtk_container_set_border_width (GTK_CONTAINER (ret), 6); | |
| 731 | |
| 732 frame = gtk_frame_new ("Proxy Type"); | |
| 733 gtk_box_pack_start (GTK_BOX (ret), frame, FALSE, FALSE, 0); | |
| 734 gtk_widget_show (frame); | |
| 735 vbox = gtk_vbox_new(FALSE, 5); | |
| 736 gtk_container_add (GTK_CONTAINER (frame), vbox); | |
| 737 gaim_dropdown(vbox, "Proxy Type:", &proxytype_new, -1, | |
| 738 "No Proxy", PROXY_NONE, | |
| 739 "SOCKS 4", PROXY_SOCKS4, | |
| 740 "SOCKS 5", PROXY_SOCKS5, | |
| 741 "HTTP", PROXY_HTTP, NULL); | |
| 742 gtk_widget_show (vbox); | |
|
2372
2927c2c26fe6
[gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2323
diff
changeset
|
743 |
| 2254 | 744 table = gtk_table_new(2, 2, FALSE); |
| 745 gtk_container_set_border_width(GTK_CONTAINER(table), 5); | |
| 746 gtk_table_set_col_spacings(GTK_TABLE(table), 5); | |
| 747 gtk_table_set_row_spacings(GTK_TABLE(table), 5); | |
| 748 gtk_widget_show(table); | |
| 749 | |
|
2839
c936163f916a
[gaim-migrate @ 2852]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2836
diff
changeset
|
750 frame = gtk_frame_new(_("Proxy Server")); |
|
c936163f916a
[gaim-migrate @ 2852]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2836
diff
changeset
|
751 prefs_proxy_frame = frame; |
|
c936163f916a
[gaim-migrate @ 2852]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2836
diff
changeset
|
752 |
| 2254 | 753 gtk_widget_show(frame); |
| 3366 | 754 gtk_box_pack_start(GTK_BOX(ret), frame, FALSE, FALSE, 5); |
| 2254 | 755 |
| 756 if (proxytype == PROXY_NONE) | |
| 757 gtk_widget_set_sensitive(GTK_WIDGET(frame), FALSE); | |
| 758 | |
| 759 table = gtk_table_new(2, 4, FALSE); | |
| 760 gtk_container_set_border_width(GTK_CONTAINER(table), 5); | |
| 761 gtk_table_set_col_spacings(GTK_TABLE(table), 5); | |
| 762 gtk_table_set_row_spacings(GTK_TABLE(table), 10); | |
| 763 gtk_widget_show(table); | |
| 764 gtk_container_add(GTK_CONTAINER(frame), table); | |
| 765 | |
| 766 | |
| 767 label = gtk_label_new(_("Host")); | |
| 768 gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5); | |
|
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
769 gtk_widget_show(label); |
| 2254 | 770 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
|
771 |
|
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
772 entry = gtk_entry_new(); |
| 3366 | 773 gtk_table_attach(GTK_TABLE(table), entry, 1, 2, 0, 1, GTK_FILL, 0, 0, 0); |
|
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
774 gtk_signal_connect(GTK_OBJECT(entry), "changed", |
|
2372
2927c2c26fe6
[gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2323
diff
changeset
|
775 GTK_SIGNAL_FUNC(proxy_print_option), (void *)PROXYHOST); |
|
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
776 gtk_entry_set_text(GTK_ENTRY(entry), proxyhost); |
|
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
777 gtk_widget_show(entry); |
|
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
778 |
|
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
779 hbox = gtk_hbox_new(TRUE, 5); |
|
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
780 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); |
|
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
781 gtk_widget_show(hbox); |
|
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
782 |
| 2254 | 783 label = gtk_label_new(_("Port")); |
| 784 gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5); | |
| 785 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
|
786 gtk_widget_show(label); |
|
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
787 |
|
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
788 entry = gtk_entry_new(); |
| 3366 | 789 gtk_table_attach(GTK_TABLE(table), entry, 1, 2, 1, 2, GTK_FILL, 0, 0, 0); |
|
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
790 gtk_signal_connect(GTK_OBJECT(entry), "changed", |
|
2372
2927c2c26fe6
[gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2323
diff
changeset
|
791 GTK_SIGNAL_FUNC(proxy_print_option), (void *)PROXYPORT); |
| 2254 | 792 |
|
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
793 if (proxyport) { |
|
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
794 char buf[128]; |
|
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
795 g_snprintf(buf, sizeof(buf), "%d", proxyport); |
|
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
796 gtk_entry_set_text(GTK_ENTRY(entry), buf); |
|
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
797 } |
|
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
798 gtk_widget_show(entry); |
|
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
799 |
| 2254 | 800 label = gtk_label_new(_("User")); |
| 801 gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5); | |
| 802 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
|
803 gtk_widget_show(label); |
|
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
804 |
|
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
805 entry = gtk_entry_new(); |
| 3366 | 806 gtk_table_attach(GTK_TABLE(table), entry, 1, 2, 2, 3, GTK_FILL, 0, 0, 0); |
|
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
807 gtk_signal_connect(GTK_OBJECT(entry), "changed", |
|
2372
2927c2c26fe6
[gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2323
diff
changeset
|
808 GTK_SIGNAL_FUNC(proxy_print_option), (void *)PROXYUSER); |
|
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
809 gtk_entry_set_text(GTK_ENTRY(entry), proxyuser); |
|
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
810 gtk_widget_show(entry); |
|
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
811 |
|
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
812 hbox = gtk_hbox_new(TRUE, 5); |
|
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
813 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); |
|
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
814 gtk_widget_show(hbox); |
|
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
815 |
| 2254 | 816 label = gtk_label_new(_("Password")); |
| 817 gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5); | |
| 818 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
|
819 gtk_widget_show(label); |
|
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
820 |
|
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
821 entry = gtk_entry_new(); |
| 3366 | 822 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
|
823 gtk_entry_set_visibility(GTK_ENTRY(entry), FALSE); |
|
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
824 gtk_signal_connect(GTK_OBJECT(entry), "changed", |
|
2372
2927c2c26fe6
[gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2323
diff
changeset
|
825 GTK_SIGNAL_FUNC(proxy_print_option), (void *)PROXYPASS); |
|
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
826 gtk_entry_set_text(GTK_ENTRY(entry), proxypass); |
|
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
827 gtk_widget_show(entry); |
| 3032 | 828 |
| 3366 | 829 gtk_widget_show(ret); |
| 830 return ret; | |
|
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
831 } |
|
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
832 |
| 3366 | 833 GtkWidget *browser_page() { |
| 834 GtkWidget *ret; | |
| 835 GtkWidget *frame; | |
| 836 GtkWidget *vbox, *hbox; | |
| 837 GtkWidget *label; | |
| 838 ret = gtk_vbox_new(FALSE, 5); | |
| 839 gtk_container_set_border_width (GTK_CONTAINER (ret), 6); | |
|
1757
3dfe4aefd366
[gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1755
diff
changeset
|
840 |
| 3366 | 841 frame = gtk_frame_new ("Browser Selection"); |
| 842 gtk_box_pack_start (GTK_BOX (ret), frame, FALSE, FALSE, 0); | |
| 843 gtk_widget_show (frame); | |
| 844 vbox = gtk_vbox_new(FALSE, 5); | |
| 845 gtk_container_add (GTK_CONTAINER (frame), vbox); | |
| 3374 | 846 gaim_dropdown(vbox, "Browser", &web_browser_new, -1, |
| 3366 | 847 "Netscape", BROWSER_NETSCAPE, |
| 848 "Konqueror", BROWSER_KONQ, | |
| 849 "Mozilla", BROWSER_MOZILLA, | |
| 850 "Manual", BROWSER_MANUAL, | |
| 851 #ifdef USE_GNOME | |
| 852 "GNOME URL Handler", BROWSER_GNOME, | |
| 853 #endif /* USE_GNOME */ | |
| 854 "Galeon", BROWSER_GALEON, | |
| 855 "Opera", BROWSER_OPERA, NULL); | |
|
915
378c862a2381
[gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
910
diff
changeset
|
856 |
| 3366 | 857 hbox = gtk_hbox_new(FALSE, 5); |
| 858 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); | |
| 859 label = gtk_label_new("Manual: "); | |
| 860 gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0); | |
| 861 gtk_widget_show(label); | |
| 862 browser_entry = gtk_entry_new(); | |
| 863 if (web_browser_new != BROWSER_MANUAL) | |
| 864 gtk_widget_set_sensitive(browser_entry, FALSE); | |
| 865 gtk_box_pack_start (GTK_BOX (hbox), browser_entry, FALSE, FALSE, 0); | |
| 866 gtk_widget_show(browser_entry); | |
| 867 gtk_widget_show(hbox); | |
| 868 gtk_widget_show (vbox); | |
| 869 | |
|
1750
d2eca7a46cfd
[gaim-migrate @ 1760]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1711
diff
changeset
|
870 |
| 3366 | 871 frame = gtk_frame_new ("Browser Options"); |
| 872 gtk_box_pack_start (GTK_BOX (ret), frame, FALSE, FALSE, 0); | |
| 873 gtk_widget_show (frame); | |
| 874 vbox = gtk_vbox_new(FALSE, 5); | |
| 875 gtk_container_add (GTK_CONTAINER (frame), vbox); | |
| 876 gaim_button(_("Open new window by default"), &misc_options_new, OPT_MISC_BROWSER_POPUP, vbox); | |
| 877 gtk_widget_show(vbox); | |
| 878 | |
| 879 gtk_widget_show(ret); | |
| 880 return ret; | |
| 881 } | |
| 882 | |
| 883 GtkWidget *logging_page() { | |
| 884 GtkWidget *ret; | |
| 885 GtkWidget *frame; | |
| 886 GtkWidget *vbox; | |
| 887 ret = gtk_vbox_new(FALSE, 5); | |
| 888 gtk_container_set_border_width (GTK_CONTAINER (ret), 6); | |
|
915
378c862a2381
[gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
910
diff
changeset
|
889 |
| 3366 | 890 frame = gtk_frame_new ("Message Logs"); |
| 891 gtk_box_pack_start (GTK_BOX (ret), frame, FALSE, FALSE, 0); | |
| 892 gtk_widget_show (frame); | |
| 893 vbox = gtk_vbox_new(FALSE, 5); | |
| 894 gtk_container_add (GTK_CONTAINER (frame), vbox); | |
| 895 gaim_button(_("Log all conversations"), &logging_options_new, OPT_LOG_ALL, vbox); | |
| 896 gaim_button(_("Strip HTML from logs"), &logging_options_new, OPT_LOG_STRIP_HTML, vbox); | |
| 897 gtk_widget_show (vbox); | |
|
915
378c862a2381
[gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
910
diff
changeset
|
898 |
|
2843
87d11d2a7d59
[gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2839
diff
changeset
|
899 |
| 3366 | 900 frame = gtk_frame_new ("System Logs"); |
| 901 gtk_box_pack_start (GTK_BOX (ret), frame, FALSE, FALSE, 0); | |
| 902 gtk_widget_show (frame); | |
| 903 vbox = gtk_vbox_new(FALSE, 5); | |
| 904 gtk_container_add (GTK_CONTAINER (frame), vbox); | |
| 905 gaim_button(_("Log when buddies sign on/sign off"), &logging_options_new, OPT_LOG_BUDDY_SIGNON, | |
| 906 vbox); | |
| 907 gaim_button(_("Log when buddies become idle/un-idle"), &logging_options_new, OPT_LOG_BUDDY_IDLE, | |
| 908 vbox); | |
| 909 gaim_button(_("Log when buddies go away/come back"), &logging_options_new, OPT_LOG_BUDDY_AWAY, vbox); | |
| 910 gaim_button(_("Log your own signons/idleness/awayness"), &logging_options_new, OPT_LOG_MY_SIGNON, | |
| 911 vbox); | |
| 912 gaim_button(_("Individual log file for each buddy's signons"), &logging_options_new, | |
| 913 OPT_LOG_INDIVIDUAL, vbox); | |
| 914 gtk_widget_show(vbox); | |
|
1757
3dfe4aefd366
[gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1755
diff
changeset
|
915 |
| 3366 | 916 gtk_widget_show(ret); |
| 917 return ret; | |
|
1757
3dfe4aefd366
[gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1755
diff
changeset
|
918 } |
|
3dfe4aefd366
[gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1755
diff
changeset
|
919 |
| 3366 | 920 static GtkWidget *sndcmd = NULL; |
| 921 /* static void set_sound_driver(GtkWidget *w, int option) | |
|
1757
3dfe4aefd366
[gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1755
diff
changeset
|
922 { |
| 3366 | 923 if (option == OPT_SOUND_CMD) |
| 924 gtk_widget_set_sensitive(sndcmd, TRUE); | |
|
1757
3dfe4aefd366
[gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1755
diff
changeset
|
925 else |
| 3366 | 926 gtk_widget_set_sensitive(sndcmd, FALSE); |
|
1757
3dfe4aefd366
[gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1755
diff
changeset
|
927 |
| 3366 | 928 sound_options &= ~(OPT_SOUND_NORMAL | OPT_SOUND_BEEP | |
| 929 OPT_SOUND_NAS | OPT_SOUND_ARTSC | | |
| 930 OPT_SOUND_ESD | OPT_SOUND_CMD); | |
| 931 sound_options |= option; | |
| 932 save_prefs(); | |
| 933 } */ | |
|
1757
3dfe4aefd366
[gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1755
diff
changeset
|
934 |
| 3366 | 935 static gint sound_cmd_yeah(GtkEntry *entry, GdkEvent *event, gpointer d) |
|
1813
998a6a032874
[gaim-migrate @ 1823]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1805
diff
changeset
|
936 { |
| 3366 | 937 g_snprintf(sound_cmd_new, sizeof(sound_cmd_new), "%s", gtk_entry_get_text(GTK_ENTRY(sndcmd))); |
| 938 return TRUE; | |
|
1813
998a6a032874
[gaim-migrate @ 1823]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1805
diff
changeset
|
939 } |
|
998a6a032874
[gaim-migrate @ 1823]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1805
diff
changeset
|
940 |
| 3366 | 941 GtkWidget *sound_page() { |
| 942 GtkWidget *ret; | |
| 943 GtkWidget *frame; | |
|
1750
d2eca7a46cfd
[gaim-migrate @ 1760]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1711
diff
changeset
|
944 GtkWidget *label; |
| 3366 | 945 GtkWidget *vbox, *hbox; |
| 946 | |
| 947 ret = gtk_vbox_new(FALSE, 5); | |
| 948 gtk_container_set_border_width (GTK_CONTAINER (ret), 6); | |
|
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
949 |
| 3366 | 950 frame = gtk_frame_new ("Sound Options"); |
| 951 gtk_box_pack_start (GTK_BOX (ret), frame, FALSE, FALSE, 0); | |
| 952 gtk_widget_show (frame); | |
| 953 vbox = gtk_vbox_new(FALSE, 5); | |
| 954 gtk_container_add (GTK_CONTAINER (frame), vbox); | |
| 955 gaim_button(_("No sounds when you log in"), &sound_options, OPT_SOUND_SILENT_SIGNON, vbox); | |
| 956 gaim_button(_("Sounds while away"), &sound_options, OPT_SOUND_WHEN_AWAY, vbox); | |
| 957 gtk_widget_show (vbox); | |
|
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
958 |
|
2843
87d11d2a7d59
[gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2839
diff
changeset
|
959 |
| 3366 | 960 frame = gtk_frame_new ("Sound Method"); |
| 961 gtk_box_pack_start (GTK_BOX (ret), frame, FALSE, FALSE, 0); | |
| 962 gtk_widget_show (frame); | |
| 963 vbox = gtk_vbox_new(FALSE, 5); | |
| 964 gtk_container_add (GTK_CONTAINER (frame), vbox); | |
|
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
965 |
| 3366 | 966 gaim_dropdown(vbox, "Method", &sound_options_new, OPT_SOUND_BEEP | |
| 967 OPT_SOUND_ESD | OPT_SOUND_ARTSC | OPT_SOUND_NAS | OPT_SOUND_NORMAL | | |
| 968 OPT_SOUND_CMD, | |
| 969 "Console Beep", OPT_SOUND_BEEP, | |
| 970 #ifdef ESD_SOUND | |
| 971 "ESD", OPT_SOUND_ESD, | |
| 972 #endif /* ESD_SOUND */ | |
| 973 #ifdef ARTSC_SOUND | |
| 974 "ArtsC", OPT_SOUND_ARTSC, | |
| 975 #endif /* ARTSC_SOUND */ | |
| 976 #ifdef NAS_SOUND | |
| 977 "NAS", OPT_SOUND_NAS, | |
| 978 #endif /* NAS_SOUND */ | |
| 979 "Internal", OPT_SOUND_NORMAL, | |
| 980 "Command", OPT_SOUND_CMD, NULL); | |
|
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
981 |
| 3366 | 982 |
|
1813
998a6a032874
[gaim-migrate @ 1823]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1805
diff
changeset
|
983 hbox = gtk_hbox_new(FALSE, 5); |
|
998a6a032874
[gaim-migrate @ 1823]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1805
diff
changeset
|
984 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 5); |
|
998a6a032874
[gaim-migrate @ 1823]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1805
diff
changeset
|
985 gtk_widget_show(hbox); |
| 3366 | 986 label = gtk_label_new("Sound Method"); |
| 987 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 5); | |
| 988 gtk_widget_show(label); | |
| 989 | |
| 990 hbox = gtk_hbox_new(FALSE, 5); | |
| 991 gtk_container_add(GTK_CONTAINER(vbox), hbox); | |
| 992 gtk_widget_show(hbox); | |
| 993 label = gtk_label_new(_("Sound command\n(%s for filename)")); | |
| 994 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
|
995 gtk_widget_show(label); |
|
378c862a2381
[gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
910
diff
changeset
|
996 |
| 3366 | 997 sndcmd = gtk_entry_new(); |
|
1813
998a6a032874
[gaim-migrate @ 1823]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1805
diff
changeset
|
998 |
| 3366 | 999 gtk_entry_set_editable(GTK_ENTRY(sndcmd), TRUE); |
| 1000 gtk_entry_set_text(GTK_ENTRY(sndcmd), sound_cmd); | |
| 1001 #if GTK_CHECK_VERSION(1,3,0) | |
| 1002 gtk_widget_set_size_request(sndcmd, 75, -1); | |
| 1003 #else | |
| 1004 gtk_widget_set_usize(sndcmd, 75, -1); | |
| 1005 #endif | |
| 1006 gtk_widget_set_sensitive(sndcmd, (sound_options_new & OPT_SOUND_CMD)); | |
| 1007 gtk_box_pack_start(GTK_BOX(hbox), sndcmd, TRUE, TRUE, 5); | |
| 1008 gtk_signal_connect(GTK_OBJECT(sndcmd), "focus_out_event", GTK_SIGNAL_FUNC(sound_cmd_yeah), NULL); | |
| 1009 gtk_widget_show(sndcmd); | |
|
2746
a0da8be3db45
[gaim-migrate @ 2759]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2745
diff
changeset
|
1010 |
|
2262
9c8f353331e7
[gaim-migrate @ 2272]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2254
diff
changeset
|
1011 |
|
9c8f353331e7
[gaim-migrate @ 2272]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2254
diff
changeset
|
1012 gtk_widget_show(vbox); |
|
9c8f353331e7
[gaim-migrate @ 2272]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2254
diff
changeset
|
1013 |
| 3366 | 1014 gtk_widget_show(ret); |
| 1015 return ret; | |
|
2262
9c8f353331e7
[gaim-migrate @ 2272]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2254
diff
changeset
|
1016 } |
|
9c8f353331e7
[gaim-migrate @ 2272]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2254
diff
changeset
|
1017 |
| 3366 | 1018 GtkWidget *away_page() { |
| 1019 GtkWidget *ret; | |
|
2262
9c8f353331e7
[gaim-migrate @ 2272]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2254
diff
changeset
|
1020 GtkWidget *frame; |
|
9c8f353331e7
[gaim-migrate @ 2272]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2254
diff
changeset
|
1021 GtkWidget *vbox; |
|
9c8f353331e7
[gaim-migrate @ 2272]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2254
diff
changeset
|
1022 GtkWidget *hbox; |
| 3366 | 1023 GtkWidget *label; |
|
2262
9c8f353331e7
[gaim-migrate @ 2272]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2254
diff
changeset
|
1024 GtkWidget *button; |
| 3366 | 1025 GtkWidget *select; |
|
2262
9c8f353331e7
[gaim-migrate @ 2272]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2254
diff
changeset
|
1026 |
| 3366 | 1027 ret = gtk_vbox_new(FALSE, 5); |
| 1028 gtk_container_set_border_width (GTK_CONTAINER (ret), 6); | |
|
2262
9c8f353331e7
[gaim-migrate @ 2272]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2254
diff
changeset
|
1029 |
| 3366 | 1030 frame = gtk_frame_new ("Away"); |
| 1031 gtk_box_pack_start (GTK_BOX (ret), frame, FALSE, FALSE, 0); | |
| 1032 gtk_widget_show (frame); | |
|
1813
998a6a032874
[gaim-migrate @ 1823]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1805
diff
changeset
|
1033 vbox = gtk_vbox_new(FALSE, 5); |
| 3366 | 1034 gtk_container_add (GTK_CONTAINER (frame), vbox); |
| 1035 gaim_button(_("Sending messages removes away status"), &away_options_new, OPT_AWAY_BACK_ON_IM, vbox); | |
| 1036 gaim_button(_("Queue new messages when away"), &away_options_new, OPT_AWAY_QUEUE, vbox); | |
| 1037 gaim_button(_("Ignore new conversations when away"), &away_options_new, OPT_AWAY_DISCARD, vbox); | |
| 1038 gtk_widget_show (vbox); | |
|
1813
998a6a032874
[gaim-migrate @ 1823]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1805
diff
changeset
|
1039 |
|
998a6a032874
[gaim-migrate @ 1823]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1805
diff
changeset
|
1040 |
| 3366 | 1041 frame = gtk_frame_new ("Auto-response"); |
| 1042 gtk_box_pack_start (GTK_BOX (ret), frame, FALSE, FALSE, 0); | |
| 1043 gtk_widget_show (frame); | |
| 1044 vbox = gtk_vbox_new(FALSE, 5); | |
| 1045 gtk_container_add (GTK_CONTAINER (frame), vbox); | |
|
1750
d2eca7a46cfd
[gaim-migrate @ 1760]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1711
diff
changeset
|
1046 |
| 3366 | 1047 hbox = gtk_hbox_new(FALSE, 0); |
| 1048 gtk_container_add(GTK_CONTAINER(vbox), hbox); | |
| 1049 gaim_labeled_spin_button(hbox, _("Seconds before resending:"), | |
| 1050 &away_resend_new, 1, 24 * 60 * 60); | |
| 1051 gtk_widget_show(hbox); | |
| 1052 gaim_button(_("Don't send auto-response"), &away_options, OPT_AWAY_NO_AUTO_RESP, vbox); | |
| 1053 gaim_button(_("Only send auto-response when idle"), &away_options_new, OPT_AWAY_IDLE_RESP, vbox); | |
|
1813
998a6a032874
[gaim-migrate @ 1823]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1805
diff
changeset
|
1054 |
| 3366 | 1055 if (away_options_new & OPT_AWAY_NO_AUTO_RESP) |
| 1056 gtk_widget_set_sensitive(hbox, FALSE); | |
|
2262
9c8f353331e7
[gaim-migrate @ 2272]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2254
diff
changeset
|
1057 gtk_widget_show(vbox); |
|
9c8f353331e7
[gaim-migrate @ 2272]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2254
diff
changeset
|
1058 |
|
9c8f353331e7
[gaim-migrate @ 2272]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2254
diff
changeset
|
1059 |
| 3366 | 1060 frame = gtk_frame_new ("Idle"); |
| 1061 gtk_box_pack_start (GTK_BOX (ret), frame, FALSE, FALSE, 0); | |
| 1062 gtk_widget_show (frame); | |
|
1757
3dfe4aefd366
[gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1755
diff
changeset
|
1063 vbox = gtk_vbox_new(FALSE, 5); |
| 3366 | 1064 gtk_container_add (GTK_CONTAINER (frame), vbox); |
| 1065 gaim_dropdown(vbox, "Idle Time Reporting:", &away_resend_new, -1, | |
| 1066 "None", IDLE_NONE, | |
| 1067 "Gaim Usage", IDLE_GAIM, | |
| 1068 #ifdef USE_SCREENSAVER | |
| 1069 "X Usage", IDLE_SCREENSAVER, | |
| 1070 #endif | |
| 1071 NULL); | |
|
1757
3dfe4aefd366
[gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1755
diff
changeset
|
1072 gtk_widget_show(vbox); |
| 3366 | 1073 |
| 1074 frame = gtk_frame_new ("Auto-away"); | |
| 1075 gtk_box_pack_start (GTK_BOX (ret), frame, FALSE, FALSE, 0); | |
| 1076 gtk_widget_show (frame); | |
|
2385
bdc74764245c
[gaim-migrate @ 2398]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2372
diff
changeset
|
1077 vbox = gtk_vbox_new(FALSE, 5); |
| 3366 | 1078 gtk_container_add (GTK_CONTAINER (frame), vbox); |
|
2385
bdc74764245c
[gaim-migrate @ 2398]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2372
diff
changeset
|
1079 |
| 3366 | 1080 button = gaim_button(_("Set away when idle"), &away_options_new, OPT_AWAY_AUTO, vbox); |
| 1081 select = gaim_labeled_spin_button(vbox, "Minutes before setting away:", &auto_away_new, 1, 24 * 60); | |
| 1082 if (!(away_options_new & OPT_AWAY_AUTO)) | |
| 1083 gtk_widget_set_sensitive(GTK_WIDGET(select), FALSE); | |
| 1084 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(toggle_sensitive), select); | |
| 1 | 1085 |
| 3366 | 1086 label = gtk_label_new("Away message:"); |
| 1087 hbox = gtk_hbox_new(FALSE, 0); | |
| 1088 gtk_container_add(GTK_CONTAINER(vbox), hbox); | |
| 1089 gtk_widget_show(hbox); | |
| 1090 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); | |
| 1091 gtk_widget_show(label); | |
| 1092 prefs_away_menu = gtk_option_menu_new(); | |
| 1093 if (!(away_options_new & OPT_AWAY_AUTO)) | |
| 1094 gtk_widget_set_sensitive(GTK_WIDGET(prefs_away_menu), FALSE); | |
| 1095 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(toggle_sensitive), prefs_away_menu); | |
| 1096 default_away_menu_init(prefs_away_menu); | |
| 1097 gtk_widget_show(prefs_away_menu); | |
| 1098 gtk_box_pack_start(GTK_BOX(hbox), prefs_away_menu, FALSE, FALSE, 0); | |
| 1099 gtk_widget_show (vbox); | |
| 1100 | |
| 1101 gtk_widget_show(ret); | |
| 1102 return ret; | |
|
873
789df4b47508
[gaim-migrate @ 883]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
864
diff
changeset
|
1103 } |
|
789df4b47508
[gaim-migrate @ 883]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
864
diff
changeset
|
1104 |
| 3366 | 1105 #if GTK_CHECK_VERSION (1,3,0) |
| 1106 static void event_toggled (GtkCellRendererToggle *cell, gchar *pth, gpointer data) | |
|
873
789df4b47508
[gaim-migrate @ 883]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
864
diff
changeset
|
1107 { |
| 3366 | 1108 GtkTreeModel *model = (GtkTreeModel *)data; |
| 1109 GtkTreeIter iter; | |
| 1110 GtkTreePath *path = gtk_tree_path_new_from_string(pth); | |
| 1111 gint soundnum; | |
| 1112 | |
| 1113 gtk_tree_model_get_iter (model, &iter, path); | |
| 1114 gtk_tree_model_get (model, &iter, 2, &soundnum, -1); | |
|
873
789df4b47508
[gaim-migrate @ 883]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
864
diff
changeset
|
1115 |
| 3366 | 1116 sound_options_new ^= sounds[soundnum].opt; |
| 1117 gtk_list_store_set (GTK_LIST_STORE (model), &iter, 0, sound_options_new & sounds[soundnum].opt, -1); | |
| 1118 } | |
| 1119 #endif | |
| 1120 | |
| 1121 static void test_sound(GtkWidget *button, gpointer i_am_NULL) | |
| 1122 { | |
| 1123 guint32 tmp_sound = sound_options; | |
| 1124 if (!(sound_options & OPT_SOUND_WHEN_AWAY)) | |
| 1125 sound_options ^= OPT_SOUND_WHEN_AWAY; | |
| 1126 if (!(sound_options & sounds[sound_row_sel].opt)) | |
| 1127 sound_options ^= sounds[sound_row_sel].opt; | |
| 1128 play_sound(sound_row_sel); | |
| 1129 sound_options = tmp_sound; | |
|
873
789df4b47508
[gaim-migrate @ 883]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
864
diff
changeset
|
1130 } |
|
789df4b47508
[gaim-migrate @ 883]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
864
diff
changeset
|
1131 |
| 3366 | 1132 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
|
1133 { |
|
2372
2927c2c26fe6
[gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2323
diff
changeset
|
1134 |
| 3366 | 1135 /* This just resets a sound file back to default */ |
| 1136 sound_file_new[sound_row_sel] = NULL; | |
|
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1137 |
| 3366 | 1138 gtk_entry_set_text(GTK_ENTRY(sound_entry), "(default)"); |
|
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1139 } |
|
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1140 |
|
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1141 void close_sounddialog(GtkWidget *w, GtkWidget *w2) |
| 1170 | 1142 { |
| 1143 | |
| 1144 GtkWidget *dest; | |
|
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1145 |
| 1170 | 1146 if (!GTK_IS_WIDGET(w2)) |
| 1147 dest = w; | |
| 1148 else | |
| 1149 dest = w2; | |
| 1150 | |
| 1151 sounddialog = NULL; | |
| 1152 | |
| 1153 gtk_widget_destroy(dest); | |
| 1154 } | |
| 1155 | |
|
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1156 void do_select_sound(GtkWidget *w, int snd) |
|
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1157 { |
|
1953
f0ff0b367e3d
[gaim-migrate @ 1963]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1930
diff
changeset
|
1158 const char *file; |
|
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1159 |
| 1170 | 1160 file = gtk_file_selection_get_filename(GTK_FILE_SELECTION(sounddialog)); |
| 1161 | |
| 1162 /* If they type in a directory, change there */ | |
| 1163 if (file_is_dir(file, sounddialog)) | |
| 1164 return; | |
| 1165 | |
| 1166 /* Let's just be safe */ | |
| 3366 | 1167 if (sound_file_new[snd]) |
| 1168 free(sound_file_new[snd]); | |
| 1170 | 1169 |
| 1170 /* Set it -- and forget it */ | |
| 3366 | 1171 sound_file_new[snd] = g_strdup(file); |
| 1172 | |
| 1175 | 1173 /* Set our text entry */ |
| 3366 | 1174 gtk_entry_set_text(GTK_ENTRY(sound_entry), sound_file_new[snd]); |
|
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1175 |
| 1170 | 1176 /* Close the window! It's getting cold in here! */ |
| 1177 close_sounddialog(NULL, sounddialog); | |
|
2471
612efbf62c35
[gaim-migrate @ 2484]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2385
diff
changeset
|
1178 |
|
612efbf62c35
[gaim-migrate @ 2484]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2385
diff
changeset
|
1179 if (last_sound_dir) |
|
612efbf62c35
[gaim-migrate @ 2484]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2385
diff
changeset
|
1180 g_free(last_sound_dir); |
|
612efbf62c35
[gaim-migrate @ 2484]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2385
diff
changeset
|
1181 last_sound_dir = g_dirname(sound_file[snd]); |
| 1170 | 1182 } |
| 1183 | |
| 3366 | 1184 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
|
1185 { |
| 1170 | 1186 char *buf = g_malloc(BUF_LEN); |
|
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1187 |
|
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1188 if (!sounddialog) { |
| 1170 | 1189 sounddialog = gtk_file_selection_new(_("Gaim - Sound Configuration")); |
| 1190 | |
| 1191 gtk_file_selection_hide_fileop_buttons(GTK_FILE_SELECTION(sounddialog)); | |
| 1192 | |
|
2471
612efbf62c35
[gaim-migrate @ 2484]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2385
diff
changeset
|
1193 g_snprintf(buf, BUF_LEN - 1, "%s/", last_sound_dir ? last_sound_dir : g_get_home_dir()); |
| 1170 | 1194 |
| 1195 gtk_file_selection_set_filename(GTK_FILE_SELECTION(sounddialog), buf); | |
| 1196 | |
|
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1197 gtk_signal_connect(GTK_OBJECT(sounddialog), "destroy", |
|
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1198 GTK_SIGNAL_FUNC(close_sounddialog), sounddialog); |
| 1170 | 1199 |
| 1200 gtk_signal_connect(GTK_OBJECT(GTK_FILE_SELECTION(sounddialog)->ok_button), | |
| 3366 | 1201 "clicked", GTK_SIGNAL_FUNC(do_select_sound), (int *)sound_row_sel); |
| 1170 | 1202 |
| 1203 gtk_signal_connect(GTK_OBJECT(GTK_FILE_SELECTION(sounddialog)->cancel_button), | |
|
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1204 "clicked", GTK_SIGNAL_FUNC(close_sounddialog), sounddialog); |
| 1170 | 1205 } |
| 1206 | |
| 1207 g_free(buf); | |
| 1208 gtk_widget_show(sounddialog); | |
| 1209 gdk_window_raise(sounddialog->window); | |
|
1006
0a4d0ed65e17
[gaim-migrate @ 1016]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
1210 } |
|
0a4d0ed65e17
[gaim-migrate @ 1016]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
1211 |
| 3366 | 1212 |
| 1213 #if GTK_CHECK_VERSION (1,3,0) | |
| 1214 static void prefs_sound_sel (GtkTreeSelection *sel, GtkTreeModel *model) { | |
| 1215 GtkTreeIter iter; | |
| 1216 GValue val = { 0, }; | |
| 1217 | |
| 1218 if (! gtk_tree_selection_get_selected (sel, &model, &iter)) | |
| 1219 return; | |
| 1220 gtk_tree_model_get_value (model, &iter, 2, &val); | |
| 1221 sound_row_sel = g_value_get_uint(&val); | |
| 1222 if (sound_entry) | |
| 3374 | 1223 gtk_entry_set_text(GTK_ENTRY(sound_entry), sound_file_new[sound_row_sel] ? sound_file_new[sound_row_sel] : "(default)"); |
| 3366 | 1224 g_value_unset (&val); |
| 1225 if (sounddialog) | |
| 1226 gtk_widget_destroy(sounddialog); | |
| 1227 } | |
| 1228 #endif | |
| 1229 | |
| 1230 GtkWidget *sound_events_page() { | |
| 1231 | |
| 1232 GtkWidget *ret; | |
| 1233 GtkWidget *frame; | |
| 1234 GtkWidget *vbox; | |
| 1235 GtkWidget *sw; | |
| 1236 GtkWidget *button, *hbox; | |
| 1237 | |
| 1238 #if GTK_CHECK_VERSION(1,3,0) | |
| 1239 GtkTreeIter iter; | |
| 1240 GtkWidget *event_view; | |
| 1241 GtkListStore *event_store; | |
| 1242 GtkCellRenderer *rend; | |
| 1243 GtkTreeViewColumn *col; | |
| 1244 GtkTreeSelection *sel; | |
| 1245 GtkTreePath *path; | |
| 1246 #else | |
| 1247 GtkWidget *list; | |
| 1248 #endif | |
| 1249 int j; | |
| 1250 | |
| 1251 ret = gtk_vbox_new(FALSE, 5); | |
| 1252 gtk_container_set_border_width (GTK_CONTAINER (ret), 6); | |
| 1253 | |
| 1254 frame = gtk_frame_new ("Sound Events"); | |
| 1255 gtk_box_pack_start (GTK_BOX (ret), frame, TRUE, TRUE, 0); | |
| 1256 gtk_widget_show (frame); | |
| 1257 vbox = gtk_vbox_new(FALSE, 5); | |
| 1258 gtk_container_add (GTK_CONTAINER (frame), vbox); | |
| 1259 sw = gtk_scrolled_window_new(NULL,NULL); | |
| 1260 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC); | |
| 1261 gtk_box_pack_start(GTK_BOX(vbox), sw, TRUE, TRUE, 0); | |
| 1262 | |
| 1263 #if GTK_CHECK_VERSION(1,3,0) | |
| 1264 event_store = gtk_list_store_new (3, G_TYPE_BOOLEAN, G_TYPE_STRING, G_TYPE_UINT); | |
| 1265 | |
| 1266 for (j=0; j < NUM_SOUNDS; j++) { | |
| 1267 if (sounds[j].opt == 0) | |
| 1268 continue; | |
| 1269 | |
| 1270 gtk_list_store_append (event_store, &iter); | |
| 1271 gtk_list_store_set(event_store, &iter, | |
| 1272 0, sound_options & sounds[j].opt, | |
| 1273 1, sounds[j].label, | |
| 1274 2, j, -1); | |
| 1275 } | |
| 1276 | |
| 1277 event_view = gtk_tree_view_new_with_model (GTK_TREE_MODEL(event_store)); | |
| 1278 | |
| 1279 rend = gtk_cell_renderer_toggle_new(); | |
| 1280 sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (event_view)); | |
| 1281 g_signal_connect (G_OBJECT (sel), "changed", | |
| 1282 G_CALLBACK (prefs_sound_sel), | |
| 1283 NULL); | |
| 1284 g_signal_connect (G_OBJECT(rend), "toggled", | |
| 1285 G_CALLBACK(event_toggled), event_store); | |
| 1286 path = gtk_tree_path_new_first(); | |
| 1287 gtk_tree_selection_select_path(sel, path); | |
| 1288 | |
| 1289 col = gtk_tree_view_column_new_with_attributes ("Play", | |
| 1290 rend, | |
| 1291 "active", 0, | |
| 1292 NULL); | |
| 1293 gtk_tree_view_append_column (GTK_TREE_VIEW(event_view), col); | |
| 1294 | |
| 1295 rend = gtk_cell_renderer_text_new(); | |
| 1296 col = gtk_tree_view_column_new_with_attributes ("Event", | |
| 1297 rend, | |
| 1298 "text", 1, | |
| 1299 NULL); | |
| 1300 gtk_tree_view_append_column (GTK_TREE_VIEW(event_view), col); | |
| 1301 gtk_widget_show(event_view); | |
| 1302 g_object_unref(G_OBJECT(event_store)); | |
| 1303 gtk_container_add(GTK_CONTAINER(sw), event_view); | |
| 1304 #else | |
| 1305 list = gtk_clist_new(1); | |
| 1306 for (j=0; sound_order[j] != 0; j++) { | |
| 1307 if (sounds[sound_order[j]].opt == 0) | |
| 1308 continue; | |
| 1309 gtk_clist_append(GTK_CLIST(list), &(sounds[sound_order[j]].label)); | |
| 1310 } | |
| 1311 gtk_widget_show(list); | |
| 1312 gtk_container_add(GTK_CONTAINER(sw), list); | |
| 1313 #endif | |
| 1314 | |
| 1315 gtk_widget_show (vbox); | |
| 1316 gtk_widget_show_all (ret); | |
| 1317 | |
| 1318 frame = gtk_frame_new ("Event Options"); | |
| 1319 gtk_box_pack_start (GTK_BOX (ret), frame, FALSE, FALSE, 0); | |
| 1320 gtk_widget_show (frame); | |
| 1321 vbox = gtk_vbox_new(FALSE, 5); | |
| 1322 gtk_container_add (GTK_CONTAINER (frame), vbox); | |
| 1323 | |
| 1324 hbox = gtk_hbox_new(FALSE, 0); | |
| 1325 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); | |
| 1326 gtk_widget_show(hbox); | |
| 1327 sound_entry = gtk_entry_new(); | |
| 1328 gtk_entry_set_text(GTK_ENTRY(sound_entry), sound_file_new[0] ? sound_file_new[0] : "(default)"); | |
| 1329 gtk_entry_set_editable(GTK_ENTRY(sound_entry), FALSE); | |
| 1330 gtk_box_pack_start(GTK_BOX(hbox), sound_entry, FALSE, FALSE, 5); | |
| 1331 gtk_widget_show(sound_entry); | |
| 1332 | |
|
1006
0a4d0ed65e17
[gaim-migrate @ 1016]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
1333 |
|
1780
d7cbedd1d651
[gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1773
diff
changeset
|
1334 hbox = gtk_hbox_new(FALSE, 0); |
| 3366 | 1335 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); |
|
1006
0a4d0ed65e17
[gaim-migrate @ 1016]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
1336 gtk_widget_show(hbox); |
| 3025 | 1337 button = gtk_button_new_with_label(_("Test")); |
| 3366 | 1338 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(test_sound), NULL); |
| 1339 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
|
1340 gtk_widget_show(button); |
|
f26f1d139615
[gaim-migrate @ 2772]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2746
diff
changeset
|
1341 |
| 1175 | 1342 button = gtk_button_new_with_label(_("Reset")); |
| 3366 | 1343 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(reset_sound), NULL); |
| 1344 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 1); | |
| 1175 | 1345 gtk_widget_show(button); |
| 1346 | |
| 1381 | 1347 button = gtk_button_new_with_label(_("Choose...")); |
| 3366 | 1348 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(sel_sound), NULL); |
| 1349 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 1); | |
|
1006
0a4d0ed65e17
[gaim-migrate @ 1016]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
1350 gtk_widget_show(button); |
| 3366 | 1351 |
| 1352 gtk_widget_show (vbox); | |
|
1006
0a4d0ed65e17
[gaim-migrate @ 1016]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
1353 |
| 3366 | 1354 return ret; |
|
2580
86eaeb064e82
[gaim-migrate @ 2593]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2566
diff
changeset
|
1355 } |
|
86eaeb064e82
[gaim-migrate @ 2593]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2566
diff
changeset
|
1356 |
| 3366 | 1357 #if GTK_CHECK_VERSION (1,3,0) |
| 1358 void away_message_sel(GtkTreeSelection *sel, GtkTreeModel *model) | |
|
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1359 { |
| 3366 | 1360 GtkTreeIter iter; |
| 1361 GValue val = { 0, }; | |
| 1362 gchar *message; | |
|
1780
d7cbedd1d651
[gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1773
diff
changeset
|
1363 gchar buffer[BUF_LONG]; |
|
d7cbedd1d651
[gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1773
diff
changeset
|
1364 char *tmp; |
| 3374 | 1365 struct away_message *am; |
|
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1366 |
| 3366 | 1367 if (! gtk_tree_selection_get_selected (sel, &model, &iter)) |
| 1368 return; | |
| 1369 gtk_tree_model_get_value (model, &iter, 1, &val); | |
| 3374 | 1370 am = g_value_get_pointer(&val); |
|
1780
d7cbedd1d651
[gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1773
diff
changeset
|
1371 gtk_imhtml_clear(GTK_IMHTML(away_text)); |
| 3374 | 1372 strncpy(buffer, am->message, BUF_LONG); |
|
1780
d7cbedd1d651
[gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1773
diff
changeset
|
1373 tmp = stylize(buffer, BUF_LONG); |
|
2856
b1e300a85678
[gaim-migrate @ 2869]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2843
diff
changeset
|
1374 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
|
1375 GTK_IMHTML_NO_COMMENTS | GTK_IMHTML_NO_SCROLL); |
|
2856
b1e300a85678
[gaim-migrate @ 2869]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2843
diff
changeset
|
1376 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
|
1377 GTK_IMHTML_NO_COMMENTS | GTK_IMHTML_NO_SCROLL); |
|
1780
d7cbedd1d651
[gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1773
diff
changeset
|
1378 g_free(tmp); |
| 3366 | 1379 g_value_unset (&val); |
| 1380 | |
|
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1381 } |
|
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1382 |
| 3366 | 1383 void remove_away_message(GtkWidget *widget, GtkTreeView *tv) { |
| 1384 struct away_message *am; | |
| 1385 GtkTreeIter iter; | |
| 1386 GtkTreePath *path; | |
| 1387 GtkTreeStore *ts = GTK_TREE_STORE(gtk_tree_view_get_model(tv)); | |
| 1388 GtkTreeSelection *sel = gtk_tree_view_get_selection(tv); | |
| 1389 GValue val = { 0, }; | |
| 1390 | |
| 1391 if (! gtk_tree_selection_get_selected (sel, &prefs_away_store, &iter)) | |
| 1392 return; | |
| 3374 | 1393 gtk_tree_model_get_value (prefs_away_store, &iter, 1, &val); |
| 3366 | 1394 am = g_value_get_pointer (&val); |
| 1395 gtk_imhtml_clear(GTK_IMHTML(away_text)); | |
| 1396 rem_away_mess(NULL, am); | |
| 1397 gtk_list_store_remove(ts, &iter); | |
| 1398 path = gtk_tree_path_new_first(); | |
| 1399 gtk_tree_selection_select_path(sel, path); | |
|
1109
c73736fa0b7c
[gaim-migrate @ 1119]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1087
diff
changeset
|
1400 } |
|
c73736fa0b7c
[gaim-migrate @ 1119]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1087
diff
changeset
|
1401 |
| 3366 | 1402 #else |
| 3374 | 1403 static struct away_message *cur_message; |
| 1404 void away_message_sel(GtkWidget *w, struct away_message *a) { | |
| 1405 gchar buffer[BUF_LONG]; | |
| 1406 char *tmp; | |
| 1407 | |
| 1408 cur_message = a; | |
| 1409 | |
| 1410 /* Clear the Box */ | |
| 1411 gtk_imhtml_clear(GTK_IMHTML(away_text)); | |
| 1412 | |
| 1413 /* Fill the text box with new message */ | |
| 1414 strncpy(buffer, a->message, BUF_LONG); | |
| 1415 tmp = stylize(buffer, BUF_LONG); | |
| 1416 | |
| 1417 debug_printf("FSD: %s\n", tmp); | |
| 1418 gtk_imhtml_append_text(GTK_IMHTML(away_text), tmp, -1, GTK_IMHTML_NO_TITLE | | |
| 1419 GTK_IMHTML_NO_COMMENTS | GTK_IMHTML_NO_SCROLL); | |
| 1420 gtk_imhtml_append_text(GTK_IMHTML(away_text), "<BR>", -1, GTK_IMHTML_NO_TITLE | | |
| 1421 GTK_IMHTML_NO_COMMENTS | GTK_IMHTML_NO_SCROLL); | |
| 1422 g_free(tmp); | |
| 1423 } | |
| 1424 void remove_away_message(GtkWidget *widget, GtkWidget *list) { | |
| 1425 GList *i; | |
| 1426 struct away_message *a; | |
| 1427 | |
| 1428 i = GTK_LIST(prefs_away_list)->selection; | |
| 1429 | |
| 1430 if (!i) | |
| 1431 return; | |
| 1432 if (!i->next) { | |
| 1433 gtk_imhtml_clear(GTK_IMHTML(away_text)); | |
| 1434 } | |
| 1435 a = gtk_object_get_user_data(GTK_OBJECT(i->data)); | |
| 1436 rem_away_mess(NULL, a); | |
| 1437 } | |
| 3366 | 1438 #endif |
|
1109
c73736fa0b7c
[gaim-migrate @ 1119]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1087
diff
changeset
|
1439 |
| 3366 | 1440 GtkWidget *away_message_page() { |
| 1441 GtkWidget *ret; | |
|
1780
d7cbedd1d651
[gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1773
diff
changeset
|
1442 GtkWidget *frame; |
| 3366 | 1443 GtkWidget *vbox, *hbox, *bbox; |
| 1444 GtkWidget *button, *image, *label; | |
|
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1445 GtkWidget *sw; |
| 3366 | 1446 |
| 1447 #if GTK_CHECK_VERSION(1,3,0) | |
| 1448 GtkTreeIter iter; | |
| 1449 GtkWidget *event_view; | |
| 1450 GtkCellRenderer *rend; | |
| 1451 GtkTreeViewColumn *col; | |
| 1452 GtkTreeSelection *sel; | |
| 1453 GtkTreePath *path; | |
| 1454 #endif | |
| 940 | 1455 GSList *awy = away_messages; |
|
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1456 struct away_message *a; |
| 3366 | 1457 GtkWidget *sw2; |
| 1458 | |
| 1459 ret = gtk_vbox_new(FALSE, 5); | |
| 1460 gtk_container_set_border_width (GTK_CONTAINER (ret), 6); | |
|
1780
d7cbedd1d651
[gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1773
diff
changeset
|
1461 |
| 3366 | 1462 frame = gtk_frame_new ("Title"); |
| 1463 gtk_box_pack_start (GTK_BOX (ret), frame, TRUE, TRUE, 0); | |
| 1464 gtk_widget_show (frame); | |
| 1465 vbox = gtk_vbox_new(FALSE, 5); | |
| 1466 gtk_container_add (GTK_CONTAINER (frame), vbox); | |
| 1467 sw = gtk_scrolled_window_new(NULL,NULL); | |
| 1468 away_text = gtk_imhtml_new(NULL, NULL); | |
| 1469 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC); | |
| 1470 gtk_box_pack_start(GTK_BOX(vbox), sw, TRUE, TRUE, 0); | |
| 1471 | |
| 1472 #if GTK_CHECK_VERSION(1,3,0) | |
| 3374 | 1473 prefs_away_store = gtk_list_store_new (2, G_TYPE_STRING, G_TYPE_POINTER); |
| 3366 | 1474 while (awy) { |
| 1475 a = (struct away_message *)awy->data; | |
| 1476 gtk_list_store_append (prefs_away_store, &iter); | |
| 1477 gtk_list_store_set(prefs_away_store, &iter, | |
| 3374 | 1478 0, a->name, |
| 1479 1, a, -1); | |
| 3366 | 1480 awy = awy->next; |
| 1481 } | |
| 1482 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
|
1483 |
|
2906
538c58b43eff
[gaim-migrate @ 2919]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2856
diff
changeset
|
1484 |
| 3366 | 1485 rend = gtk_cell_renderer_text_new(); |
| 1486 col = gtk_tree_view_column_new_with_attributes ("NULL", | |
| 1487 rend, | |
| 1488 "text", 0, | |
| 1489 NULL); | |
| 1490 gtk_tree_view_append_column (GTK_TREE_VIEW(event_view), col); | |
| 1491 gtk_tree_view_set_headers_visible (GTK_TREE_VIEW(event_view), FALSE); | |
| 1492 gtk_widget_show(event_view); | |
| 1493 gtk_container_add(GTK_CONTAINER(sw), event_view); | |
| 1494 #else | |
| 3374 | 1495 prefs_away_list = gtk_list_new(); |
| 3366 | 1496 while (awy) { |
| 3374 | 1497 GtkWidget *ambox = gtk_hbox_new(FALSE, 5); |
| 1498 GtkWidget *list_item =gtk_list_item_new(); | |
| 1499 GtkWidget *label; | |
| 3366 | 1500 a = (struct away_message *)awy->data; |
| 3374 | 1501 gtk_container_add(GTK_CONTAINER(prefs_away_list), list_item); |
| 1502 gtk_signal_connect(GTK_OBJECT(list_item), "select", GTK_SIGNAL_FUNC(away_message_sel), | |
| 1503 a); | |
| 1504 gtk_object_set_user_data(GTK_OBJECT(list_item), a); | |
| 1505 | |
| 1506 gtk_widget_show(list_item); | |
| 1507 | |
| 1508 ambox = gtk_hbox_new(FALSE, 5); | |
| 1509 gtk_container_add(GTK_CONTAINER(list_item), ambox); | |
| 1510 gtk_widget_show(ambox); | |
| 1511 | |
| 1512 label = gtk_label_new(a->name); | |
| 1513 gtk_box_pack_start(GTK_BOX(ambox), label, FALSE, FALSE, 5); | |
| 1514 gtk_widget_show(label); | |
| 1515 | |
| 3366 | 1516 awy = awy->next; |
| 3374 | 1517 |
| 3366 | 1518 } |
| 3374 | 1519 gtk_widget_show(prefs_away_list); |
| 1520 gtk_container_add(GTK_CONTAINER(sw), prefs_away_list); | |
| 3366 | 1521 #endif |
|
832
0142b4c66394
[gaim-migrate @ 842]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
830
diff
changeset
|
1522 |
| 3366 | 1523 gtk_widget_show (vbox); |
| 1524 gtk_widget_show (sw); | |
| 1525 | |
|
1780
d7cbedd1d651
[gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1773
diff
changeset
|
1526 |
| 3366 | 1527 frame = gtk_frame_new ("Message"); |
| 1528 gtk_box_pack_start (GTK_BOX (ret), frame, TRUE, TRUE, 0); | |
| 1529 gtk_widget_show (frame); | |
| 1530 vbox = gtk_vbox_new(FALSE, 5); | |
| 1531 gtk_container_add (GTK_CONTAINER (frame), vbox); | |
| 1532 | |
|
1780
d7cbedd1d651
[gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1773
diff
changeset
|
1533 sw2 = gtk_scrolled_window_new(NULL, NULL); |
|
d7cbedd1d651
[gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1773
diff
changeset
|
1534 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw2), |
|
d7cbedd1d651
[gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1773
diff
changeset
|
1535 GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS); |
| 3366 | 1536 gtk_box_pack_start(GTK_BOX(vbox), sw2, TRUE, TRUE, 0); |
|
1780
d7cbedd1d651
[gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1773
diff
changeset
|
1537 gtk_widget_show(sw2); |
| 3366 | 1538 |
|
1780
d7cbedd1d651
[gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1773
diff
changeset
|
1539 gtk_container_add(GTK_CONTAINER(sw2), away_text); |
|
2906
538c58b43eff
[gaim-migrate @ 2919]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2856
diff
changeset
|
1540 GTK_LAYOUT(away_text)->hadjustment->step_increment = 10.0; |
|
538c58b43eff
[gaim-migrate @ 2919]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2856
diff
changeset
|
1541 GTK_LAYOUT(away_text)->vadjustment->step_increment = 10.0; |
|
1815
f15d449b3167
[gaim-migrate @ 1825]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1813
diff
changeset
|
1542 gaim_setup_imhtml(away_text); |
|
1780
d7cbedd1d651
[gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1773
diff
changeset
|
1543 gtk_widget_show(away_text); |
| 3366 | 1544 gtk_widget_show (vbox); |
| 1545 gtk_widget_show (ret); | |
| 1546 gtk_imhtml_set_defaults(GTK_IMHTML(away_text), NULL, NULL, NULL); | |
| 1547 #if GTK_CHECK_VERSION(1,3,0) | |
| 1548 sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (event_view)); | |
| 1549 path = gtk_tree_path_new_first(); | |
| 1550 g_signal_connect (G_OBJECT (sel), "changed", | |
| 1551 G_CALLBACK (away_message_sel), | |
| 1552 NULL); | |
| 1553 #endif | |
| 1554 hbox = gtk_hbox_new(TRUE, 5); | |
| 1555 gtk_widget_show(hbox); | |
| 1556 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); | |
| 1557 #if GTK_CHECK_VERSION (1,3,0) | |
| 1558 button = gtk_button_new_from_stock (GTK_STOCK_ADD); | |
| 1559 #else | |
|
1780
d7cbedd1d651
[gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1773
diff
changeset
|
1560 button = picture_button(prefs, _("Add"), gnome_add_xpm); |
| 3366 | 1561 #endif |
| 1562 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0); | |
| 1563 if (misc_options & OPT_MISC_COOL_LOOK) | |
| 1564 gtk_button_set_relief(GTK_BUTTON(button), GTK_RELIEF_NONE); | |
| 1565 gtk_widget_show(button); | |
|
1780
d7cbedd1d651
[gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1773
diff
changeset
|
1566 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(create_away_mess), NULL); |
| 3366 | 1567 |
| 1568 #if GTK_CHECK_VERSION (1,3,0) | |
| 1569 button = gtk_button_new_from_stock (GTK_STOCK_REMOVE); | |
| 1570 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(remove_away_message), event_view); | |
| 1571 #else | |
| 1572 button = picture_button(prefs, _("Remove"), gnome_remove_xpm); | |
| 3374 | 1573 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(remove_away_message), prefs_away_list); |
| 3366 | 1574 #endif |
| 1575 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0); | |
| 1576 if (misc_options & OPT_MISC_COOL_LOOK) | |
| 1577 gtk_button_set_relief(GTK_BUTTON(button), GTK_RELIEF_NONE); | |
| 1578 gtk_widget_show(button); | |
| 1579 | |
| 1580 #if GTK_CHECK_VERSION (1,3,0) | |
| 1581 button = pixbuf_button(_("_Edit"), "edit.png"); | |
| 3374 | 1582 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(create_away_mess), event_view); |
| 3366 | 1583 #else |
|
1780
d7cbedd1d651
[gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1773
diff
changeset
|
1584 button = picture_button(prefs, _("Edit"), save_xpm); |
|
d7cbedd1d651
[gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1773
diff
changeset
|
1585 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(create_away_mess), button); |
| 3366 | 1586 #endif |
| 1587 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0); | |
| 1588 if (misc_options & OPT_MISC_COOL_LOOK) | |
| 1589 gtk_button_set_relief(GTK_BUTTON(button), GTK_RELIEF_NONE); | |
| 1590 gtk_widget_show(button); | |
| 1591 | |
| 1592 return ret; | |
| 1593 } | |
| 1594 #if GTK_CHECK_VERSION (1,3,0) | |
| 1595 GtkTreeIter *prefs_notebook_add_page(char *text, | |
| 1596 GdkPixbuf *pixbuf, | |
| 1597 GtkWidget *page, | |
| 1598 GtkTreeIter *iter, | |
| 1599 GtkTreeIter *parent, | |
| 1600 int ind) { | |
| 1601 GdkPixbuf *icon = NULL; | |
| 1602 | |
| 1603 if (pixbuf) | |
| 1604 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
|
1605 |
| 3366 | 1606 gtk_tree_store_append (prefstree, iter, parent); |
| 1607 gtk_tree_store_set (prefstree, iter, 0, icon, 1, text, 2, ind, -1); | |
| 1608 | |
| 1609 if (pixbuf) | |
| 1610 g_object_unref(pixbuf); | |
| 1611 if (icon) | |
| 1612 g_object_unref(icon); | |
| 1613 gtk_notebook_append_page(GTK_NOTEBOOK(prefsnotebook), page, gtk_label_new(text)); | |
| 1614 return iter; | |
|
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1615 } |
| 3366 | 1616 #else |
| 1617 GtkCTreeNode *prefs_notebook_add_page(char *text, | |
| 1618 GdkPixmap *pixmap, | |
| 1619 GtkWidget *page, | |
| 1620 GtkCTreeNode **iter, | |
| 1621 GtkCTreeNode **parent, | |
| 1622 int ind) { | |
|
1124
a70d5200edde
[gaim-migrate @ 1134]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1123
diff
changeset
|
1623 |
| 3366 | 1624 GtkCTreeNode *itern; |
| 1625 char *texts[1]; | |
|
1124
a70d5200edde
[gaim-migrate @ 1134]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1123
diff
changeset
|
1626 |
| 3366 | 1627 texts[0] = text; |
|
2074
a4367a6478eb
[gaim-migrate @ 2084]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2048
diff
changeset
|
1628 |
| 3366 | 1629 *iter = gtk_ctree_insert_node (GTK_CTREE(prefstree), parent ? *parent : NULL, NULL, &text, |
| 1630 0, NULL, NULL, NULL, NULL, 0, 1); | |
| 1631 gtk_ctree_node_set_row_data(GTK_CTREE(prefstree), GTK_CTREE_NODE(*iter), (void *)ind); | |
| 1632 if (pixmap) | |
| 1633 gdk_pixmap_unref(pixmap); | |
| 1634 | |
| 1635 debug_printf("%s\n", texts[0]); | |
|
2074
a4367a6478eb
[gaim-migrate @ 2084]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2048
diff
changeset
|
1636 |
| 3366 | 1637 gtk_notebook_append_page(GTK_NOTEBOOK(prefsnotebook), page, gtk_label_new(text)); |
| 1638 return iter; | |
|
2074
a4367a6478eb
[gaim-migrate @ 2084]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2048
diff
changeset
|
1639 } |
| 3366 | 1640 #endif |
|
1124
a70d5200edde
[gaim-migrate @ 1134]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1123
diff
changeset
|
1641 |
| 3366 | 1642 void prefs_notebook_init() { |
| 1643 int a = 0; | |
| 1644 #if GTK_CHECK_VERSION(1,3,0) | |
| 1645 GtkTreeIter p, c; | |
| 1646 #else | |
| 1647 GtkCTreeNode *p = NULL; | |
| 1648 GtkCTreeNode *c = NULL; | |
| 1649 #endif | |
| 3373 | 1650 prefs_notebook_add_page(_("Interface"), NULL, interface_page(), &p, NULL, a++); |
| 1651 prefs_notebook_add_page(_("Fonts"), NULL, font_page(), &c, &p, a++); | |
| 1652 prefs_notebook_add_page(_("Message Text"), NULL, messages_page(), &c, &p, a++); | |
| 1653 prefs_notebook_add_page(_("Shortcuts"), NULL, hotkeys_page(), &c, &p, a++); | |
| 1654 prefs_notebook_add_page(_("Buddy List"), NULL, list_page(), &c, &p, a++); | |
| 1655 prefs_notebook_add_page(_("IM Window"), NULL, im_page(), &c, &p, a++); | |
| 1656 prefs_notebook_add_page(_("Chat Window"), NULL, chat_page(), &c, &p, a++); | |
| 1657 prefs_notebook_add_page(_("Tabs"), NULL, tab_page(), &c, &p, a++); | |
| 1658 prefs_notebook_add_page(_("Proxy"), NULL, proxy_page(), &p, NULL, a++); | |
| 1659 prefs_notebook_add_page(_("Browser"), NULL, browser_page(), &p, NULL, a++); | |
|
1130
d31fad9abb32
[gaim-migrate @ 1140]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1125
diff
changeset
|
1660 |
| 3373 | 1661 prefs_notebook_add_page(_("Logging"), NULL, logging_page(), &p, NULL, a++); |
| 1662 prefs_notebook_add_page(_("Sounds"), NULL, sound_page(), &p, NULL, a++); | |
| 1663 prefs_notebook_add_page(_("Sound Events"), NULL, sound_events_page(), &c, &p, a++); | |
| 1664 prefs_notebook_add_page(_("Away / Idle"), NULL, away_page(), &p, NULL, a++); | |
| 1665 prefs_notebook_add_page(_("Away Messages"), NULL, away_message_page(), &c, &p, a++); | |
|
1124
a70d5200edde
[gaim-migrate @ 1134]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1123
diff
changeset
|
1666 } |
|
a70d5200edde
[gaim-migrate @ 1134]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1123
diff
changeset
|
1667 |
| 3366 | 1668 void show_prefs() |
|
1124
a70d5200edde
[gaim-migrate @ 1134]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1123
diff
changeset
|
1669 { |
| 3366 | 1670 GtkWidget *vbox, *vbox2; |
|
1124
a70d5200edde
[gaim-migrate @ 1134]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1123
diff
changeset
|
1671 GtkWidget *hbox; |
| 3366 | 1672 GtkWidget *frame; |
| 1673 #if GTK_CHECK_VERSION (1,3,0) | |
| 1674 GtkWidget *tree_v; | |
| 1675 GtkTreeViewColumn *column; | |
| 1676 GtkCellRenderer *cell; | |
| 1677 GtkTreeSelection *sel; | |
| 1678 #endif | |
| 1679 GtkWidget *notebook; | |
| 1680 GtkWidget *sep; | |
|
1124
a70d5200edde
[gaim-migrate @ 1134]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1123
diff
changeset
|
1681 GtkWidget *button; |
| 3366 | 1682 |
| 1683 int r; | |
|
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1684 |
|
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1685 if (prefs) { |
|
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1686 gtk_widget_show(prefs); |
|
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1687 return; |
|
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1688 } |
|
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1689 |
| 3366 | 1690 /* copy the preferences to tmp values... |
| 1691 * I liked "take affect immediately" Oh well :-( */ | |
| 1692 misc_options_new = misc_options; | |
| 1693 logging_options_new = logging_options; | |
| 1694 blist_options_new = blist_options; | |
| 1695 convo_options_new = convo_options; | |
| 1696 im_options_new = im_options; | |
| 1697 chat_options_new = chat_options; | |
| 1698 font_options_new = font_options; | |
| 1699 sound_options_new = sound_options; | |
| 1700 for (r = 0; r < NUM_SOUNDS; r++) | |
| 1701 sound_file_new[r] = g_strdup(sound_file[r]); | |
| 1702 away_options_new = away_options; | |
| 1703 away_resend_new = away_resend; | |
| 1704 report_idle_new = report_idle; | |
| 1705 auto_away_new = auto_away; | |
| 1706 default_away_new = default_away; | |
| 1707 fontsize_new = fontsize; | |
| 1708 web_browser_new = web_browser; | |
| 1709 proxytype_new = proxytype; | |
| 1710 g_snprintf(sound_cmd_new, sizeof(sound_cmd_new), "%s", sound_cmd); | |
| 1711 g_snprintf(web_command_new, sizeof(web_command_new), "%s", web_command); | |
| 1712 g_snprintf(fontface_new, sizeof(fontface_new), fontface); | |
| 1713 #if !GTK_CHECK_VERSION(1,3,0) | |
| 1714 g_snprintf(fontxfld_new, sizeof(fontxfld_new), fontxfld); | |
| 1715 #endif | |
| 1716 memcpy(&conv_size_new, &conv_size, sizeof(struct window_size)); | |
| 1717 memcpy(&buddy_chat_size_new, &buddy_chat_size, sizeof(struct window_size)); | |
| 1718 memcpy(&fgcolor_new, &fgcolor, sizeof(GdkColor)); | |
| 1719 memcpy(&bgcolor_new, &bgcolor, sizeof(GdkColor)); | |
| 1720 | |
| 1721 /* Create the window */ | |
|
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1722 prefs = gtk_window_new(GTK_WINDOW_TOPLEVEL); |
| 905 | 1723 gtk_window_set_wmclass(GTK_WINDOW(prefs), "preferences", "Gaim"); |
|
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1724 gtk_widget_realize(prefs); |
|
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1725 aol_icon(prefs->window); |
|
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1726 gtk_window_set_title(GTK_WINDOW(prefs), _("Gaim - Preferences")); |
| 3366 | 1727 gtk_window_set_policy (GTK_WINDOW(prefs), FALSE, FALSE, TRUE); |
|
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1728 gtk_signal_connect(GTK_OBJECT(prefs), "destroy", GTK_SIGNAL_FUNC(delete_prefs), NULL); |
|
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1729 |
|
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1730 vbox = gtk_vbox_new(FALSE, 5); |
| 1185 | 1731 gtk_container_border_width(GTK_CONTAINER(vbox), 5); |
|
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1732 gtk_container_add(GTK_CONTAINER(prefs), vbox); |
|
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1733 gtk_widget_show(vbox); |
|
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1734 |
| 3366 | 1735 hbox = gtk_hbox_new (FALSE, 6); |
| 1736 gtk_container_set_border_width (GTK_CONTAINER (hbox), 6); | |
| 1737 gtk_container_add (GTK_CONTAINER(vbox), hbox); | |
| 1738 gtk_widget_show (hbox); | |
| 1739 | |
| 1740 frame = gtk_frame_new (NULL); | |
| 1741 gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN); | |
| 1742 gtk_box_pack_start (GTK_BOX (hbox), frame, FALSE, FALSE, 0); | |
| 1743 gtk_widget_show (frame); | |
| 1744 | |
| 1745 /* The tree -- much inspired by the Gimp */ | |
| 1746 #if GTK_CHECK_VERSION(1,3,0) | |
| 1747 prefstree = gtk_tree_store_new (3, GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_INT); | |
| 1748 tree_v = gtk_tree_view_new_with_model (GTK_TREE_MODEL (prefstree)); | |
| 1749 gtk_container_add (GTK_CONTAINER (frame), tree_v); | |
| 1750 | |
| 1751 gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (tree_v), FALSE); | |
| 1752 gtk_widget_show(tree_v); | |
| 1753 /* icons */ | |
| 1754 cell = gtk_cell_renderer_pixbuf_new (); | |
| 1755 column = gtk_tree_view_column_new_with_attributes ("icons", cell, "pixbuf", 0, NULL); | |
| 1756 | |
| 1757 /* text */ | |
| 1758 cell = gtk_cell_renderer_text_new (); | |
| 1759 column = gtk_tree_view_column_new_with_attributes ("text", cell, "text", 1, NULL); | |
| 1760 | |
| 1761 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
|
1762 |
| 3366 | 1763 #else |
| 1764 prefstree = gtk_ctree_new(1,0); | |
| 1765 gtk_ctree_set_line_style(prefstree, GTK_CTREE_LINES_NONE); | |
| 1766 gtk_ctree_set_expander_style(GTK_CTREE(prefstree), GTK_CTREE_EXPANDER_TRIANGLE); | |
| 1767 gtk_container_add(GTK_CONTAINER (frame), prefstree); | |
| 1768 gtk_widget_set_usize(prefstree, 150, -1); | |
| 1769 gtk_widget_show(prefstree); | |
| 1770 #endif /* GTK_CHECK_VERSION */ | |
|
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1771 |
| 3366 | 1772 /* The right side */ |
| 1773 frame = gtk_frame_new (NULL); | |
| 1774 gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN); | |
| 1775 gtk_box_pack_start (GTK_BOX (hbox), frame, TRUE, TRUE, 0); | |
| 1776 gtk_widget_show (frame); | |
| 1777 | |
| 1778 vbox2 = gtk_vbox_new (FALSE, 4); | |
| 1779 gtk_container_add (GTK_CONTAINER (frame), vbox2); | |
| 1780 gtk_widget_show (vbox2); | |
| 1781 | |
| 1782 frame = gtk_frame_new (NULL); | |
| 1783 gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_OUT); | |
| 1784 gtk_box_pack_start (GTK_BOX (vbox2), frame, FALSE, TRUE, 0); | |
| 1785 gtk_widget_show (frame); | |
| 1786 | |
| 1787 hbox = gtk_hbox_new (FALSE, 4); | |
| 1788 gtk_container_set_border_width (GTK_CONTAINER (hbox), 4); | |
| 1789 gtk_container_add (GTK_CONTAINER (frame), hbox); | |
| 1790 gtk_widget_show (hbox); | |
| 1791 | |
| 1792 preflabel = gtk_label_new(NULL); | |
| 1793 gtk_box_pack_end (GTK_BOX (hbox), preflabel, FALSE, FALSE, 0); | |
| 1794 gtk_widget_show (preflabel); | |
|
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1795 |
| 3366 | 1796 |
| 1797 /* The notebook */ | |
| 1798 prefsnotebook = notebook = gtk_notebook_new (); | |
| 1799 gtk_notebook_set_show_tabs (GTK_NOTEBOOK (notebook), FALSE); | |
| 1800 gtk_notebook_set_show_border (GTK_NOTEBOOK (notebook), FALSE); | |
| 1801 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
|
1802 |
| 3366 | 1803 #if GTK_CHECK_VERSION(1,3,0) |
| 1804 sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (tree_v)); | |
| 1805 g_signal_connect (G_OBJECT (sel), "changed", | |
| 1806 G_CALLBACK (pref_nb_select), | |
| 1807 notebook); | |
| 1808 #else | |
| 1809 gtk_signal_connect(GTK_OBJECT(prefstree), "tree-select-row", GTK_SIGNAL_FUNC(pref_nb_select), notebook); | |
| 1810 #endif | |
| 1811 gtk_widget_show(notebook); | |
| 1812 sep = gtk_hseparator_new(); | |
| 1813 gtk_widget_show(sep); | |
| 1814 gtk_box_pack_start (GTK_BOX (vbox), sep, FALSE, FALSE, 0); | |
| 1815 | |
| 1816 /* The buttons to press! */ | |
| 1817 hbox = gtk_hbox_new (FALSE, 6); | |
| 1818 gtk_container_set_border_width (GTK_CONTAINER (hbox), 6); | |
| 1819 gtk_container_add (GTK_CONTAINER(vbox), hbox); | |
| 1820 gtk_widget_show (hbox); | |
| 1821 #if GTK_CHECK_VERSION(1,3,0) | |
| 1822 button = gtk_button_new_from_stock (GTK_STOCK_CANCEL); | |
| 1823 #else | |
| 1824 button = picture_button(prefs, _("Close"), cancel_xpm); | |
| 1825 #endif | |
| 1826 gtk_signal_connect_object(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(gtk_widget_destroy), prefs); | |
| 1827 gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0); | |
| 1828 if (misc_options & OPT_MISC_COOL_LOOK) | |
| 1829 gtk_button_set_relief(GTK_BUTTON(button), GTK_RELIEF_NONE); | |
| 1830 gtk_widget_show(button); | |
| 1831 #if GTK_CHECK_VERSION(1,3,0) | |
| 1832 button = gtk_button_new_from_stock (GTK_STOCK_APPLY); | |
| 1833 #else | |
| 1834 button = picture_button(prefs, _("Apply"), ok_xpm); | |
| 1835 #endif | |
| 1836 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(apply_cb), prefs); | |
| 1837 gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0); | |
| 1838 if (misc_options & OPT_MISC_COOL_LOOK) | |
| 1839 gtk_button_set_relief(GTK_BUTTON(button), GTK_RELIEF_NONE); | |
| 1840 gtk_widget_show(button); | |
| 1841 | |
| 1842 #if GTK_CHECK_VERSION(1,3,0) | |
| 1843 button = gtk_button_new_from_stock (GTK_STOCK_OK); | |
| 1844 #else | |
| 1845 button = picture_button(prefs, _("OK"), join_xpm); | |
| 1846 #endif | |
| 1847 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(ok_cb), prefs); | |
| 1848 gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0); | |
| 1849 if (misc_options & OPT_MISC_COOL_LOOK) | |
| 1850 gtk_button_set_relief(GTK_BUTTON(button), GTK_RELIEF_NONE); | |
| 1851 gtk_widget_show(button); | |
|
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1852 |
| 3366 | 1853 prefs_notebook_init(); |
| 1854 #if GTK_CHECK_VERSION(1,3,0) | |
| 1855 gtk_tree_view_expand_all (GTK_TREE_VIEW(tree_v)); | |
| 1856 #endif | |
| 1857 gtk_widget_show(prefs); | |
|
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1858 } |
|
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1859 |
|
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1860 static gint debug_delete(GtkWidget *w, GdkEvent *event, void *dummy) |
|
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1861 { |
|
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1862 if (debugbutton) |
|
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1863 gtk_button_clicked(GTK_BUTTON(debugbutton)); |
|
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1864 if (misc_options & OPT_MISC_DEBUG) { |
|
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1865 misc_options ^= OPT_MISC_DEBUG; |
|
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1866 save_prefs(); |
|
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1867 } |
|
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1868 g_free(dw); |
|
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1869 dw = NULL; |
|
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1870 return FALSE; |
| 1 | 1871 |
| 1872 } | |
| 1873 | |
|
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1874 static void build_debug() |
|
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1875 { |
|
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1876 GtkWidget *scroll; |
|
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1877 GtkWidget *box; |
|
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1878 if (!dw) |
|
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1879 dw = g_new0(struct debug_window, 1); |
|
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1880 |
|
2725
f3c094e78609
[gaim-migrate @ 2738]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2676
diff
changeset
|
1881 GAIM_DIALOG(dw->window); |
|
2536
0e0a54e5819a
[gaim-migrate @ 2549]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2471
diff
changeset
|
1882 gtk_window_set_title(GTK_WINDOW(dw->window), _("Gaim debug output window")); |
|
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1883 gtk_window_set_wmclass(GTK_WINDOW(dw->window), "debug_out", "Gaim"); |
|
2282
0dea5214d63f
[gaim-migrate @ 2292]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2269
diff
changeset
|
1884 gtk_signal_connect(GTK_OBJECT(dw->window), "delete_event", GTK_SIGNAL_FUNC(debug_delete), NULL); |
|
2547
ab55ac6234b8
[gaim-migrate @ 2560]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2536
diff
changeset
|
1885 gtk_widget_realize(dw->window); |
|
ab55ac6234b8
[gaim-migrate @ 2560]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2536
diff
changeset
|
1886 aol_icon(dw->window->window); |
|
2282
0dea5214d63f
[gaim-migrate @ 2292]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2269
diff
changeset
|
1887 |
|
0dea5214d63f
[gaim-migrate @ 2292]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2269
diff
changeset
|
1888 box = gtk_hbox_new(FALSE, 0); |
|
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1889 gtk_container_add(GTK_CONTAINER(dw->window), box); |
|
2282
0dea5214d63f
[gaim-migrate @ 2292]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2269
diff
changeset
|
1890 gtk_widget_show(box); |
|
0dea5214d63f
[gaim-migrate @ 2292]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2269
diff
changeset
|
1891 |
|
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1892 dw->entry = gtk_text_new(NULL, NULL); |
|
2282
0dea5214d63f
[gaim-migrate @ 2292]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2269
diff
changeset
|
1893 gtk_text_set_word_wrap(GTK_TEXT(dw->entry), TRUE); |
|
0dea5214d63f
[gaim-migrate @ 2292]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2269
diff
changeset
|
1894 gtk_text_set_editable(GTK_TEXT(dw->entry), FALSE); |
|
0dea5214d63f
[gaim-migrate @ 2292]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2269
diff
changeset
|
1895 gtk_container_add(GTK_CONTAINER(box), dw->entry); |
|
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1896 gtk_widget_set_usize(dw->entry, 500, 200); |
|
2282
0dea5214d63f
[gaim-migrate @ 2292]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2269
diff
changeset
|
1897 gtk_widget_show(dw->entry); |
|
0dea5214d63f
[gaim-migrate @ 2292]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2269
diff
changeset
|
1898 |
|
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1899 scroll = gtk_vscrollbar_new(GTK_TEXT(dw->entry)->vadj); |
|
2282
0dea5214d63f
[gaim-migrate @ 2292]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2269
diff
changeset
|
1900 gtk_box_pack_start(GTK_BOX(box), scroll, FALSE, FALSE, 0); |
|
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1901 gtk_widget_show(scroll); |
|
2282
0dea5214d63f
[gaim-migrate @ 2292]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2269
diff
changeset
|
1902 |
|
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1903 gtk_widget_show(dw->window); |
|
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1904 } |
|
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1905 |
|
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1906 void show_debug() |
| 1 | 1907 { |
|
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1908 if ((misc_options & OPT_MISC_DEBUG)) { |
|
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1909 if (!dw || !dw->window) |
|
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1910 build_debug(); |
|
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1911 gtk_widget_show(dw->window); |
|
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1912 } else { |
|
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1913 if (!dw) |
|
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1914 return; |
|
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1915 gtk_widget_destroy(dw->window); |
|
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1916 dw->window = NULL; |
|
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1917 } |
|
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1918 } |
|
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1919 |
| 970 | 1920 void debug_printf(char *fmt, ...) |
| 1921 { | |
| 1922 va_list ap; | |
| 1923 gchar *s; | |
| 1924 | |
|
1366
155db3303ebb
[gaim-migrate @ 1376]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1357
diff
changeset
|
1925 va_start(ap, fmt); |
|
155db3303ebb
[gaim-migrate @ 1376]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1357
diff
changeset
|
1926 s = g_strdup_vprintf(fmt, ap); |
|
155db3303ebb
[gaim-migrate @ 1376]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1357
diff
changeset
|
1927 va_end(ap); |
|
155db3303ebb
[gaim-migrate @ 1376]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1357
diff
changeset
|
1928 |
|
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1929 if (misc_options & OPT_MISC_DEBUG && dw) { |
|
2282
0dea5214d63f
[gaim-migrate @ 2292]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2269
diff
changeset
|
1930 GtkAdjustment *adj = GTK_TEXT(dw->entry)->vadj; |
|
0dea5214d63f
[gaim-migrate @ 2292]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2269
diff
changeset
|
1931 gboolean scroll = (adj->value == adj->upper - adj->lower - adj->page_size); |
|
0dea5214d63f
[gaim-migrate @ 2292]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2269
diff
changeset
|
1932 |
|
0dea5214d63f
[gaim-migrate @ 2292]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2269
diff
changeset
|
1933 gtk_text_freeze(GTK_TEXT(dw->entry)); |
| 970 | 1934 gtk_text_insert(GTK_TEXT(dw->entry), NULL, NULL, NULL, s, -1); |
|
2282
0dea5214d63f
[gaim-migrate @ 2292]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2269
diff
changeset
|
1935 gtk_text_thaw(GTK_TEXT(dw->entry)); |
|
0dea5214d63f
[gaim-migrate @ 2292]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2269
diff
changeset
|
1936 |
|
0dea5214d63f
[gaim-migrate @ 2292]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2269
diff
changeset
|
1937 if (scroll) |
|
0dea5214d63f
[gaim-migrate @ 2292]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2269
diff
changeset
|
1938 gtk_adjustment_set_value(adj, adj->upper - adj->lower - adj->page_size); |
|
1366
155db3303ebb
[gaim-migrate @ 1376]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1357
diff
changeset
|
1939 } |
|
2823
cd23279122ed
[gaim-migrate @ 2836]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2794
diff
changeset
|
1940 if (opt_debug) |
|
cd23279122ed
[gaim-migrate @ 2836]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2794
diff
changeset
|
1941 g_print("%s", s); |
|
1366
155db3303ebb
[gaim-migrate @ 1376]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1357
diff
changeset
|
1942 g_free(s); |
| 970 | 1943 } |
| 3366 | 1944 |
|
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1945 |
| 3366 | 1946 |
|
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1947 |
|
915
378c862a2381
[gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
910
diff
changeset
|
1948 |
| 3366 | 1949 |
| 1 | 1950 void set_option(GtkWidget *w, int *option) |
| 1951 { | |
| 1952 *option = !(*option); | |
| 1953 } | |
| 1954 | |
|
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1955 static void set_misc_option(GtkWidget *w, int option) |
|
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1956 { |
|
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1957 misc_options ^= option; |
|
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1958 |
|
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1959 if (option == OPT_MISC_DEBUG) |
|
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1960 show_debug(); |
|
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1961 |
|
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1962 if (option == OPT_MISC_BUDDY_TICKER) |
|
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1963 BuddyTickerShow(); |
|
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1964 |
|
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1965 save_prefs(); |
|
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1966 } |
|
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1967 |
| 3366 | 1968 |
| 1969 /* Functions for each _options variable that sees what's changed, and makes | |
| 1970 * effective those changes that take place immediately (UI stuff) */ | |
| 1971 static void set_misc_options() | |
|
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1972 { |
| 3366 | 1973 |
| 1974 /* int option = misc_options ^ misc_options_new; */ | |
| 1975 misc_options = misc_options_new; | |
| 1976 | |
| 1977 } | |
|
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1978 |
| 3366 | 1979 static void set_logging_options() |
| 1980 { | |
| 1981 int option = logging_options ^ logging_options_new; | |
| 1982 logging_options = logging_options_new; | |
| 1983 | |
| 1984 if (option & OPT_LOG_ALL) | |
|
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1985 update_log_convs(); |
| 1773 | 1986 |
|
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1987 } |
|
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1988 |
| 3366 | 1989 static void set_blist_options() |
| 1 | 1990 { |
| 3366 | 1991 int option = blist_options ^ blist_options_new; |
| 1992 blist_options = blist_options_new; | |
|
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1993 |
|
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1994 if (!blist) |
|
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1995 return; |
| 3366 | 1996 |
| 1997 if (option & OPT_BLIST_BOTTOM_TAB) | |
| 1998 set_blist_tab(); | |
|
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1999 |
| 3366 | 2000 if (option & OPT_BLIST_NO_BUTTONS) |
|
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
2001 build_imchat_box(!(blist_options & OPT_BLIST_NO_BUTTONS)); |
|
696
97b75ed155b0
[gaim-migrate @ 706]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
683
diff
changeset
|
2002 |
| 3366 | 2003 if (option & OPT_BLIST_SHOW_GRPNUM) |
|
1070
b288f17c2fb2
[gaim-migrate @ 1080]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1030
diff
changeset
|
2004 update_num_groups(); |
| 9 | 2005 |
| 3366 | 2006 if (option & OPT_BLIST_NO_MT_GRP) |
|
1072
81d19577285a
[gaim-migrate @ 1082]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1070
diff
changeset
|
2007 toggle_show_empty_groups(); |
|
81d19577285a
[gaim-migrate @ 1082]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1070
diff
changeset
|
2008 |
| 3366 | 2009 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
|
2010 update_button_pix(); |
|
11e5b1220028
[gaim-migrate @ 1306]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1269
diff
changeset
|
2011 |
| 3366 | 2012 if (option & OPT_BLIST_SHOW_PIXMAPS) |
|
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
2013 toggle_buddy_pixmaps(); |
|
2593
5ba9ef368b8e
[gaim-migrate @ 2606]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2592
diff
changeset
|
2014 |
| 3366 | 2015 if ((option & OPT_BLIST_GREY_IDLERS) || (option & OPT_BLIST_SHOW_IDLETIME)) |
| 2594 | 2016 update_idle_times(); |
| 3032 | 2017 |
|
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
2018 } |
|
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
2019 |
| 3366 | 2020 static void set_convo_options() |
|
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
2021 { |
| 3366 | 2022 int option = convo_options ^ convo_options_new; |
| 2023 convo_options = convo_options_new; | |
| 2024 | |
| 2025 if (option & OPT_CONVO_SHOW_SMILEY) | |
|
1428
00b3d02a2168
[gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1411
diff
changeset
|
2026 toggle_smileys(); |
|
00b3d02a2168
[gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1411
diff
changeset
|
2027 |
| 3366 | 2028 if (option & OPT_CONVO_SHOW_TIME) |
|
1428
00b3d02a2168
[gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1411
diff
changeset
|
2029 toggle_timestamps(); |
|
00b3d02a2168
[gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1411
diff
changeset
|
2030 |
| 3366 | 2031 if (option & OPT_CONVO_CHECK_SPELLING) |
|
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
2032 toggle_spellchk(); |
|
572
faca21605e1b
[gaim-migrate @ 582]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
570
diff
changeset
|
2033 |
| 3366 | 2034 if (option & OPT_CONVO_COMBINE) { |
|
2843
87d11d2a7d59
[gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2839
diff
changeset
|
2035 /* (OPT_IM_SIDE_TAB | OPT_IM_BR_TAB) == (OPT_CHAT_SIDE_TAB | OPT_CHAT_BR_TAB) */ |
| 3366 | 2036 |
|
2843
87d11d2a7d59
[gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2839
diff
changeset
|
2037 } |
|
87d11d2a7d59
[gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2839
diff
changeset
|
2038 |
| 1 | 2039 } |
| 2040 | |
| 3366 | 2041 static void set_im_options() |
| 1 | 2042 { |
| 3366 | 2043 int option = im_options ^ im_options_new; |
| 2044 im_options = im_options_new; | |
| 2045 | |
| 2046 if (option & OPT_IM_ONE_WINDOW) | |
|
2843
87d11d2a7d59
[gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2839
diff
changeset
|
2047 im_tabize(); |
|
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
2048 |
| 3366 | 2049 if (option & OPT_IM_SIDE_TAB || option & OPT_IM_BR_TAB) |
| 2050 update_im_tabs(); | |
| 2051 | |
| 2052 if (option & OPT_IM_HIDE_ICONS) | |
|
2323
bde2481bb4db
[gaim-migrate @ 2333]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2322
diff
changeset
|
2053 set_hide_icons(); |
|
bde2481bb4db
[gaim-migrate @ 2333]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2322
diff
changeset
|
2054 |
| 3366 | 2055 if (option & OPT_IM_ALIAS_TAB) |
|
2787
feea7103a235
[gaim-migrate @ 2800]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2760
diff
changeset
|
2056 set_convo_titles(); |
|
feea7103a235
[gaim-migrate @ 2800]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2760
diff
changeset
|
2057 |
| 3366 | 2058 if (option & OPT_IM_NO_ANIMATION) |
| 3013 | 2059 set_anim(); |
| 3366 | 2060 |
| 2061 if (option & OPT_IM_BUTTON_TEXT || option & OPT_IM_BUTTON_XPM) | |
| 2062 update_im_button_pix(); | |
| 1 | 2063 } |
| 2064 | |
| 3366 | 2065 static void set_chat_options() |
| 1 | 2066 { |
| 3366 | 2067 int option = chat_options ^ chat_options_new; |
| 2068 chat_options = chat_options_new; | |
|
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
2069 |
| 3366 | 2070 if (option & OPT_CHAT_ONE_WINDOW) |
|
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
2071 chat_tabize(); |
| 3366 | 2072 |
| 2073 if (option & OPT_CHAT_BUTTON_TEXT || option & OPT_CHAT_BUTTON_XPM) | |
| 2074 update_chat_button_pix(); | |
|
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
2075 } |
|
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
2076 |
| 3366 | 2077 void set_sound_options() |
|
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
2078 { |
| 3366 | 2079 /* int option = sound_options ^ sound_options_new; */ |
| 2080 sound_options = sound_options_new; | |
| 2081 | |
|
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
2082 } |
|
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
2083 |
| 3366 | 2084 static void set_font_options() |
|
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
2085 { |
| 3366 | 2086 /* int option = font_options ^ font_options_new; */ |
| 2087 font_options = font_options_new; | |
| 2088 | |
|
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
2089 update_font_buttons(); |
| 1 | 2090 } |
| 2091 | |
| 3366 | 2092 static void set_away_options() |
|
1525
ba8e6e211af5
[gaim-migrate @ 1535]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1455
diff
changeset
|
2093 { |
| 3366 | 2094 int option = away_options ^ away_options_new; |
| 2095 away_options = away_options_new; | |
|
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
2096 |
| 3366 | 2097 if (option & OPT_AWAY_QUEUE) |
|
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
2098 toggle_away_queue(); |
| 3366 | 2099 } |
|
1525
ba8e6e211af5
[gaim-migrate @ 1535]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1455
diff
changeset
|
2100 |
| 3366 | 2101 static void toggle_option(GtkWidget *w, int option) { |
| 2102 int *o = gtk_object_get_user_data(GTK_OBJECT(w)); | |
| 2103 *o ^= option; | |
|
1525
ba8e6e211af5
[gaim-migrate @ 1535]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1455
diff
changeset
|
2104 } |
|
ba8e6e211af5
[gaim-migrate @ 1535]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1455
diff
changeset
|
2105 |
|
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
2106 GtkWidget *gaim_button(const char *text, guint *options, int option, GtkWidget *page) |
| 1 | 2107 { |
| 2108 GtkWidget *button; | |
| 2109 button = gtk_check_button_new_with_label(text); | |
| 2110 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(button), (*options & option)); | |
| 2111 gtk_box_pack_start(GTK_BOX(page), button, FALSE, FALSE, 0); | |
| 3366 | 2112 gtk_object_set_user_data(GTK_OBJECT(button), options); |
| 1 | 2113 |
| 3366 | 2114 /* So that the ticker and debug window happen immediately |
| 2115 * I don't think they should be "preferences," anyway. */ | |
| 2116 if (options == &misc_options && (option == OPT_MISC_DEBUG || option == OPT_MISC_BUDDY_TICKER)) | |
|
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
2117 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(set_misc_option), |
|
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
2118 (int *)option); |
| 3366 | 2119 else |
| 2120 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(toggle_option), | |
|
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
2121 (int *)option); |
| 3366 | 2122 |
| 1 | 2123 gtk_widget_show(button); |
| 2124 | |
| 2125 return button; | |
| 2126 } | |
| 2127 | |
| 3366 | 2128 void away_list_clicked(GtkWidget *widget, struct away_message *a) |
| 2129 {} | |
| 2130 void default_away_menu_init(GtkWidget *omenu) | |
| 3032 | 2131 { |
| 3366 | 2132 GtkWidget *menu, *opt; |
| 2133 int index = 0; | |
| 2134 GSList *awy = away_messages; | |
| 2135 struct away_message *a; | |
| 2136 | |
| 2137 menu = gtk_menu_new(); | |
| 2138 | |
| 2139 while (awy) { | |
| 2140 a = (struct away_message *)awy->data; | |
| 2141 opt = gtk_menu_item_new_with_label(a->name); | |
| 2142 gtk_signal_connect(GTK_OBJECT(opt), "activate", GTK_SIGNAL_FUNC(set_default_away), | |
| 2143 (gpointer)index); | |
| 2144 gtk_widget_show(opt); | |
| 2145 gtk_menu_append(GTK_MENU(menu), opt); | |
| 2146 | |
| 2147 awy = awy->next; | |
| 2148 index++; | |
| 2149 } | |
| 2150 | |
| 2151 gtk_option_menu_remove_menu(GTK_OPTION_MENU(omenu)); | |
| 2152 gtk_option_menu_set_menu(GTK_OPTION_MENU(omenu), menu); | |
| 2153 gtk_option_menu_set_history(GTK_OPTION_MENU(omenu), g_slist_index(away_messages, default_away)); | |
| 2154 } | |
| 2155 | |
| 2156 GtkWidget *pref_fg_picture = NULL; | |
| 2157 GtkWidget *pref_bg_picture = NULL; | |
| 2158 | |
| 2159 void destroy_colorsel(GtkWidget *w, gpointer d) | |
| 2160 { | |
| 2161 if (d) { | |
| 2162 gtk_widget_destroy(fgcseld); | |
| 2163 fgcseld = NULL; | |
| 2164 } else { | |
| 2165 gtk_widget_destroy(bgcseld); | |
| 2166 bgcseld = NULL; | |
| 2167 } | |
| 3032 | 2168 } |
| 2169 | |
| 3366 | 2170 void apply_color_dlg(GtkWidget *w, gpointer d) |
| 3032 | 2171 { |
| 3366 | 2172 gdouble color[3]; |
| 2173 if ((int)d == 1) { | |
| 2174 #if GTK_CHECK_VERSION(1,3,0) | |
| 2175 gtk_color_selection_get_current_color(GTK_COLOR_SELECTION | |
| 2176 (GTK_COLOR_SELECTION_DIALOG(fgcseld)->colorsel), | |
| 2177 &fgcolor_new); | |
| 2178 #else | |
| 2179 gtk_color_selection_get_color(GTK_COLOR_SELECTION | |
| 2180 (GTK_COLOR_SELECTION_DIALOG(fgcseld)->colorsel), color); | |
| 3032 | 2181 |
| 3366 | 2182 fgcolor_new.red = ((guint16)(color[0] * 65535)) >> 8; |
| 2183 fgcolor_new.green = ((guint16)(color[1] * 65535)) >> 8; | |
| 2184 fgcolor_new.blue = ((guint16)(color[2] * 65535)) >> 8; | |
| 2185 #endif | |
| 2186 destroy_colorsel(NULL, (void *)1); | |
| 2187 update_color(NULL, pref_fg_picture); | |
| 2188 } else { | |
| 2189 #if GTK_CHECK_VERSION(1,3,0) | |
| 2190 gtk_color_selection_get_current_color(GTK_COLOR_SELECTION | |
| 2191 (GTK_COLOR_SELECTION_DIALOG(bgcseld)->colorsel), | |
| 2192 &bgcolor_new); | |
| 2193 #else | |
| 2194 gtk_color_selection_get_color(GTK_COLOR_SELECTION | |
| 2195 (GTK_COLOR_SELECTION_DIALOG(bgcseld)->colorsel), color); | |
| 2196 | |
| 2197 bgcolor_new.red = ((guint16)(color[0] * 65535)) >> 8; | |
| 2198 bgcolor_new.green = ((guint16)(color[1] * 65535)) >> 8; | |
| 2199 bgcolor_new.blue = ((guint16)(color[2] * 65535)) >> 8; | |
| 2200 #endif | |
| 2201 destroy_colorsel(NULL, (void *)0); | |
| 2202 update_color(NULL, pref_bg_picture); | |
| 2203 } | |
| 3032 | 2204 } |
| 2205 | |
| 3366 | 2206 void update_color(GtkWidget *w, GtkWidget *pic) |
| 1 | 2207 { |
| 3366 | 2208 GdkColor c; |
| 2209 GtkStyle *style; | |
| 2210 c.pixel = 0; | |
| 2211 | |
| 2212 if (pic == pref_fg_picture) { | |
| 2213 if (font_options_new & OPT_FONT_FGCOL) { | |
| 2214 c.red = fgcolor_new.red; | |
| 2215 c.blue = fgcolor_new.blue; | |
| 2216 c.green = fgcolor_new.green; | |
| 2217 } else { | |
| 2218 c.red = 0; | |
| 2219 c.blue = 0; | |
| 2220 c.green = 0; | |
| 2221 } | |
| 2222 } else { | |
| 2223 if (font_options_new & OPT_FONT_BGCOL) { | |
| 2224 c.red = bgcolor_new.red; | |
| 2225 c.blue = bgcolor_new.blue; | |
| 2226 c.green = bgcolor_new.green; | |
| 2227 } else { | |
| 2228 c.red = 0xffff; | |
| 2229 c.blue = 0xffff; | |
| 2230 c.green = 0xffff; | |
| 2231 } | |
| 2232 } | |
| 2233 | |
| 2234 style = gtk_style_new(); | |
| 2235 style->bg[0] = c; | |
| 2236 gtk_widget_set_style(pic, style); | |
| 2237 gtk_style_unref(style); | |
| 2238 } | |
| 2239 void set_default_away(GtkWidget *w, gpointer i) | |
| 2240 { | |
| 2241 | |
| 2242 int length = g_slist_length(away_messages); | |
|
338
9d258a0aa560
[gaim-migrate @ 348]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
337
diff
changeset
|
2243 |
| 3366 | 2244 if (away_messages == NULL) |
| 2245 default_away_new = NULL; | |
| 2246 else if ((int)i >= length) | |
| 2247 default_away_new = g_slist_nth_data(away_messages, length - 1); | |
| 2248 else | |
| 2249 default_away_new = g_slist_nth_data(away_messages, (int)i); | |
| 2250 } | |
| 2251 | |
| 2252 static void update_spin_value(GtkWidget *w, GtkWidget *spin) | |
| 2253 { | |
| 2254 int *value = gtk_object_get_user_data(GTK_OBJECT(spin)); | |
| 2255 *value = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(spin)); | |
| 2256 } | |
| 2257 GtkWidget *gaim_labeled_spin_button(GtkWidget *box, const gchar *title, int *val, int min, int max) | |
| 2258 { | |
| 2259 GtkWidget *hbox; | |
| 2260 GtkWidget *label; | |
| 2261 GtkWidget *spin; | |
| 2262 GtkObject *adjust; | |
|
901
f168f2c7b357
[gaim-migrate @ 911]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
893
diff
changeset
|
2263 |
| 3366 | 2264 hbox = gtk_hbox_new(FALSE, 5); |
| 2265 gtk_box_pack_start(GTK_BOX(box), hbox, FALSE, FALSE, 5); | |
| 2266 gtk_widget_show(hbox); | |
| 2267 | |
| 2268 label = gtk_label_new(title); | |
| 2269 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); | |
| 2270 gtk_widget_show(label); | |
|
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
2271 |
| 3366 | 2272 adjust = gtk_adjustment_new(*val, min, max, 1, 1, 1); |
| 2273 spin = gtk_spin_button_new(GTK_ADJUSTMENT(adjust), 1, 0); | |
| 2274 gtk_object_set_user_data(GTK_OBJECT(spin), val); | |
| 2275 gtk_widget_set_usize(spin, 50, -1); | |
| 2276 gtk_box_pack_start(GTK_BOX(hbox), spin, FALSE, FALSE, 0); | |
| 2277 gtk_signal_connect(GTK_OBJECT(adjust), "value-changed", | |
| 2278 GTK_SIGNAL_FUNC(update_spin_value), GTK_WIDGET(spin)); | |
| 2279 gtk_widget_show(spin); | |
| 2280 return spin; | |
|
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
2281 } |
| 1 | 2282 |
| 3366 | 2283 void dropdown_set(GtkObject *w, int *option) |
|
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
2284 { |
| 3366 | 2285 int opt = (int)gtk_object_get_user_data(w); |
| 2286 int clear = (int)gtk_object_get_data(w, "clear"); | |
| 2287 | |
| 2288 if (clear != -1) { | |
| 2289 *option = *option & ~clear; | |
| 2290 *option = *option | opt; | |
| 2291 } else { | |
| 2292 debug_printf("HELLO %d\n", opt); | |
| 2293 *option = opt; | |
| 2294 } | |
| 2295 | |
| 2296 if (option == &proxytype_new) { | |
| 2297 if (opt == PROXY_NONE) | |
| 2298 gtk_widget_set_sensitive(prefs_proxy_frame, FALSE); | |
| 2299 else | |
| 2300 gtk_widget_set_sensitive(prefs_proxy_frame, TRUE); | |
| 2301 } else if (option == &web_browser_new) { | |
| 2302 if (opt == BROWSER_MANUAL) | |
| 2303 gtk_widget_set_sensitive(browser_entry, TRUE); | |
| 2304 else | |
| 2305 gtk_widget_set_sensitive(browser_entry, FALSE); | |
| 2306 } else if (option == &sound_options_new) { | |
| 2307 if (opt == OPT_SOUND_CMD) | |
| 2308 gtk_widget_set_sensitive(sndcmd, TRUE); | |
| 2309 else | |
| 2310 gtk_widget_set_sensitive(sndcmd, FALSE); | |
| 2311 } | |
| 2312 | |
| 1 | 2313 } |
| 2314 | |
| 3366 | 2315 static GtkWidget *gaim_dropdown(GtkWidget *box, const gchar *title, int *option, int clear, ...) |
| 1 | 2316 { |
| 3366 | 2317 va_list menuitems; |
| 2318 GtkWidget *dropdown, *opt, *menu; | |
| 2319 GtkWidget *label; | |
| 2320 gchar *text; | |
| 2321 int value; | |
| 2322 int o = 0; | |
| 2323 GtkWidget *hbox; | |
| 1 | 2324 |
| 3366 | 2325 hbox = gtk_hbox_new(FALSE, 5); |
| 2326 gtk_container_add (GTK_CONTAINER (box), hbox); | |
| 2327 gtk_widget_show(hbox); | |
| 2328 | |
| 2329 label = gtk_label_new(title); | |
| 2330 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); | |
| 2331 gtk_widget_show(label); | |
| 2332 | |
| 2333 va_start(menuitems, clear); | |
| 2334 text = va_arg(menuitems, gchar *); | |
| 2335 | |
| 2336 if (!text) | |
| 2337 return NULL; | |
| 2338 | |
| 2339 dropdown = gtk_option_menu_new(); | |
| 2340 menu = gtk_menu_new(); | |
| 1 | 2341 |
| 3366 | 2342 while (text) { |
| 2343 value = va_arg(menuitems, int); | |
| 2344 opt = gtk_menu_item_new_with_label(text); | |
| 2345 gtk_object_set_user_data(GTK_OBJECT(opt), (void *)value); | |
| 2346 gtk_object_set_data(GTK_OBJECT(opt), "clear", (void *)clear); | |
| 2347 gtk_signal_connect(GTK_OBJECT(opt), "activate", | |
| 2348 GTK_SIGNAL_FUNC(dropdown_set), (void *)option); | |
| 2349 gtk_widget_show(opt); | |
| 2350 gtk_menu_shell_append(GTK_MENU_SHELL(menu), opt); | |
| 1 | 2351 |
| 3366 | 2352 if (((clear > -1) && ((*option & value) == value)) || *option == value) { |
| 2353 gtk_menu_set_active(GTK_MENU(menu), o); | |
| 2354 } | |
| 2355 text = va_arg(menuitems, gchar *); | |
| 2356 o++; | |
| 2357 } | |
|
2262
9c8f353331e7
[gaim-migrate @ 2272]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2254
diff
changeset
|
2358 |
| 3366 | 2359 va_end(menuitems); |
| 1 | 2360 |
| 3366 | 2361 gtk_option_menu_set_menu(GTK_OPTION_MENU(dropdown), menu); |
| 2362 gtk_box_pack_start(GTK_BOX(hbox), dropdown, FALSE, FALSE, 0); | |
| 2363 gtk_widget_show(dropdown); | |
| 2364 return dropdown; | |
| 2365 } | |
| 2366 | |
| 2367 static GtkWidget *show_color_pref(GtkWidget *box, gboolean fgc) | |
| 1 | 2368 { |
| 3366 | 2369 /* more stuff stolen from X-Chat */ |
| 2370 GtkWidget *swid; | |
| 2371 GdkColor c; | |
| 2372 GtkStyle *style; | |
| 2373 c.pixel = 0; | |
| 2374 if (fgc) { | |
| 2375 if (font_options_new & OPT_FONT_FGCOL) { | |
| 2376 c.red = fgcolor_new.red; | |
| 2377 c.blue = fgcolor_new.blue; | |
| 2378 c.green = fgcolor_new.green; | |
| 2379 } else { | |
| 2380 c.red = 0; | |
| 2381 c.blue = 0; | |
| 2382 c.green = 0; | |
| 2383 } | |
| 2384 } else { | |
| 2385 if (font_options_new & OPT_FONT_BGCOL) { | |
| 2386 c.red = bgcolor_new.red; | |
| 2387 c.blue = bgcolor_new.blue; | |
| 2388 c.green = bgcolor_new.green; | |
| 2389 } else { | |
| 2390 c.red = 0xffff; | |
| 2391 c.blue = 0xffff; | |
| 2392 c.green = 0xffff; | |
| 2393 } | |
| 2394 } | |
| 1 | 2395 |
| 3366 | 2396 style = gtk_style_new(); |
| 2397 style->bg[0] = c; | |
|
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
2398 |
| 3366 | 2399 swid = gtk_event_box_new(); |
| 2400 gtk_widget_set_style(GTK_WIDGET(swid), style); | |
| 2401 gtk_style_unref(style); | |
| 2402 gtk_widget_set_usize(GTK_WIDGET(swid), 40, -1); | |
| 2403 gtk_box_pack_start(GTK_BOX(box), swid, FALSE, FALSE, 5); | |
| 2404 gtk_widget_show(swid); | |
| 2405 return swid; | |
| 1 | 2406 } |
| 3366 | 2407 void apply_font_dlg(GtkWidget *w, GtkWidget *f) |
|
1124
a70d5200edde
[gaim-migrate @ 1134]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1123
diff
changeset
|
2408 { |
| 3366 | 2409 int i = 0; |
| 2410 #if !GTK_CHECK_VERSION(1,3,0) | |
| 2411 int j = 0, k = 0; | |
| 2412 #endif | |
| 2413 char *fontname; | |
| 2414 | |
| 2415 fontname = g_strdup(gtk_font_selection_dialog_get_font_name(GTK_FONT_SELECTION_DIALOG(fontseld))); | |
| 2416 destroy_fontsel(0, 0); | |
|
1124
a70d5200edde
[gaim-migrate @ 1134]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1123
diff
changeset
|
2417 |
| 3366 | 2418 #if !GTK_CHECK_VERSION(1,3,0) |
| 2419 for (i = 0; i < strlen(fontname); i++) { | |
| 2420 if (fontname[i] == '-') { | |
| 2421 if (++j > 2) | |
| 2422 break; | |
| 2423 } else if (j == 2) | |
| 2424 fontface_new[k++] = fontname[i]; | |
|
1124
a70d5200edde
[gaim-migrate @ 1134]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1123
diff
changeset
|
2425 } |
| 3366 | 2426 fontface_new[k] = '\0'; |
| 2427 g_snprintf(fontxfld_new, sizeof(fontxfld_new), "%s", fontname); | |
| 2428 #else | |
| 2429 while(fontname[i] && !isdigit(fontname[i]) && i < sizeof(fontface_new)) { | |
| 2430 fontface_new[i] = fontname[i]; | |
| 2431 i++; | |
| 2432 } | |
| 2433 | |
| 2434 #endif | |
| 2435 g_free(fontname); | |
|
1124
a70d5200edde
[gaim-migrate @ 1134]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1123
diff
changeset
|
2436 } |
