Mercurial > pidgin
annotate src/prefs.c @ 4978:307c16c4b57e
[gaim-migrate @ 5313]
(08:55:48) Robot101: patch to:
(08:56:07) Robot101: * make online buddies appear black, not grey, when you have 'show offline buddies' turned on
(08:56:21) Robot101: * random cleanup in buddy.c (tooltip/timer freeing)
(08:56:43) Robot101: * stop the add buddy dialog resetting your choice of group when you choose an account
(08:57:03) Robot101: * fix little memleak when loading the default window icon
(08:57:16) Robot101: * make the main window use the default instead of loading the same icon itself
(08:57:42) Robot101: * make the manual browser pref validate and save when the entry widget loses focus, not with a crappy button
committer: Tailor Script <tailor@pidgin.im>
| author | Luke Schierer <lschiere@pidgin.im> |
|---|---|
| date | Thu, 03 Apr 2003 14:05:43 +0000 |
| parents | 42bd8ab53234 |
| children | 06baf1e9094c |
| rev | line source |
|---|---|
| 1 | 1 /* |
| 2 * gaim | |
| 3 * | |
| 3434 | 4 * Copyright (C) 1998-2002, Mark Spencer <markster@marko.net> |
| 1 | 5 * |
| 6 * This program is free software; you can redistribute it and/or modify | |
| 7 * it under the terms of the GNU General Public License as published by | |
| 8 * the Free Software Foundation; either version 2 of the License, or | |
| 9 * (at your option) any later version. | |
| 10 * | |
| 11 * This program is distributed in the hope that it will be useful, | |
| 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 14 * GNU General Public License for more details. | |
| 15 * | |
| 16 * You should have received a copy of the GNU General Public License | |
| 17 * along with this program; if not, write to the Free Software | |
| 18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
| 19 * | |
| 20 */ | |
| 21 | |
|
349
b402a23f35df
[gaim-migrate @ 359]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
340
diff
changeset
|
22 #ifdef HAVE_CONFIG_H |
|
2090
b66aca8e8dce
[gaim-migrate @ 2100]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2074
diff
changeset
|
23 #include <config.h> |
|
349
b402a23f35df
[gaim-migrate @ 359]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
340
diff
changeset
|
24 #endif |
| 1 | 25 #include <string.h> |
| 26 #include <sys/time.h> | |
| 27 | |
| 28 #include <sys/types.h> | |
| 29 #include <sys/stat.h> | |
| 30 | |
| 31 #include <unistd.h> | |
| 32 #include <stdio.h> | |
| 33 #include <stdlib.h> | |
| 970 | 34 #include <stdarg.h> |
| 3379 | 35 #include <ctype.h> |
| 1 | 36 #include <gtk/gtk.h> |
|
1780
d7cbedd1d651
[gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1773
diff
changeset
|
37 #include "gtkimhtml.h" |
| 1 | 38 #include "gaim.h" |
| 4687 | 39 #include "gtklist.h" |
|
1357
783ba886b6b6
[gaim-migrate @ 1367]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1324
diff
changeset
|
40 #include "prpl.h" |
| 3366 | 41 #include "proxy.h" |
| 4561 | 42 #include "sound.h" |
| 3366 | 43 |
|
4026
a997156437b6
[gaim-migrate @ 4230]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4010
diff
changeset
|
44 #ifdef _WIN32 |
|
a997156437b6
[gaim-migrate @ 4230]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4010
diff
changeset
|
45 #include "win32dep.h" |
|
a997156437b6
[gaim-migrate @ 4230]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4010
diff
changeset
|
46 #endif |
|
a997156437b6
[gaim-migrate @ 4230]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4010
diff
changeset
|
47 |
| 3567 | 48 GtkWidget *tree_v = NULL; |
|
1109
c73736fa0b7c
[gaim-migrate @ 1119]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1087
diff
changeset
|
49 GtkWidget *prefs_away_menu = NULL; |
| 3366 | 50 GtkWidget *fontseld = NULL; |
| 51 | |
| 3379 | 52 GtkListStore *prefs_away_store = NULL; |
| 3366 | 53 |
| 54 static int sound_row_sel = 0; | |
| 55 static char *last_sound_dir = NULL; | |
| 56 | |
| 57 static GtkWidget *sounddialog = NULL; | |
| 58 static GtkWidget *browser_entry = NULL; | |
| 59 static GtkWidget *sound_entry = NULL; | |
| 60 static GtkWidget *away_text = NULL; | |
| 4324 | 61 static GtkListStore *smiley_theme_store = NULL; |
| 2254 | 62 GtkWidget *prefs_proxy_frame = NULL; |
|
4026
a997156437b6
[gaim-migrate @ 4230]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4010
diff
changeset
|
63 GtkWidget *gaim_button(const char *, guint *, int, GtkWidget *); |
| 3427 | 64 GtkWidget *gaim_labeled_spin_button(GtkWidget *, const gchar *, int*, int, int, GtkSizeGroup *); |
| 3366 | 65 static GtkWidget *gaim_dropdown(GtkWidget *, const gchar *, int *, int, ...); |
| 4428 | 66 static GtkWidget *gaim_dropdown_from_list(GtkWidget *, const gchar *, int *, int, GList *); |
| 3366 | 67 static GtkWidget *show_color_pref(GtkWidget *, gboolean); |
| 68 static void delete_prefs(GtkWidget *, void *); | |
| 69 void set_default_away(GtkWidget *, gpointer); | |
| 4428 | 70 static gboolean program_is_valid(const char *); |
| 1026 | 71 |
| 3366 | 72 struct debug_window *dw = NULL; |
| 3565 | 73 GtkWidget *prefs = NULL; |
| 3366 | 74 GtkWidget *debugbutton = NULL; |
| 3565 | 75 static int notebook_page = 0; |
| 76 static GtkTreeIter plugin_iter; | |
|
1525
ba8e6e211af5
[gaim-migrate @ 1535]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1455
diff
changeset
|
77 |
| 3630 | 78 /* |
| 79 * PROTOTYPES | |
| 80 */ | |
| 81 GtkTreeIter *prefs_notebook_add_page(char*, GdkPixbuf*, GtkWidget*, GtkTreeIter*, GtkTreeIter*, int); | |
| 82 | |
| 3366 | 83 void delete_prefs(GtkWidget *asdf, void *gdsa) { |
| 4215 | 84 GList *l = plugins; |
| 85 struct gaim_plugin *plug; | |
| 86 | |
| 4064 | 87 save_prefs(); |
| 3485 | 88 prefs = NULL; |
| 3567 | 89 tree_v = NULL; |
| 3485 | 90 sound_entry = NULL; |
| 91 browser_entry = NULL; | |
| 3526 | 92 debugbutton = NULL; |
| 93 prefs_away_menu = NULL; | |
| 3565 | 94 notebook_page = 0; |
| 4324 | 95 smiley_theme_store = NULL; |
| 3485 | 96 if(sounddialog) |
| 3379 | 97 gtk_widget_destroy(sounddialog); |
| 3500 | 98 g_object_unref(G_OBJECT(prefs_away_store)); |
| 4635 | 99 prefs_away_store = NULL; |
| 4215 | 100 while(l) { |
| 101 plug = l->data; | |
| 102 if(plug->iter) { | |
| 103 g_free(plug->iter); | |
| 104 plug->iter = NULL; | |
| 105 } | |
| 106 l = l->next; | |
| 107 } | |
|
1525
ba8e6e211af5
[gaim-migrate @ 1535]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1455
diff
changeset
|
108 } |
|
ba8e6e211af5
[gaim-migrate @ 1535]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1455
diff
changeset
|
109 |
| 3366 | 110 GtkWidget *preflabel; |
| 111 GtkWidget *prefsnotebook; | |
| 112 GtkTreeStore *prefstree; | |
|
1750
d2eca7a46cfd
[gaim-migrate @ 1760]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1711
diff
changeset
|
113 |
| 3818 | 114 static void set_misc_option(); |
| 115 static void set_logging_option(); | |
| 116 static void set_blist_option(); | |
| 117 static void set_convo_option(); | |
| 118 static void set_im_option(); | |
| 119 static void set_chat_option(); | |
| 120 static void set_font_option(); | |
| 121 static void set_sound_option(); | |
| 122 static void set_away_option(); | |
|
1750
d2eca7a46cfd
[gaim-migrate @ 1760]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1711
diff
changeset
|
123 |
|
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
124 #define PROXYHOST 0 |
|
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
125 #define PROXYPORT 1 |
|
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
126 #define PROXYTYPE 2 |
|
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
127 #define PROXYUSER 3 |
|
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
128 #define PROXYPASS 4 |
|
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
129 static void proxy_print_option(GtkEntry *entry, int entrynum) |
|
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
130 { |
|
2372
2927c2c26fe6
[gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2323
diff
changeset
|
131 if (entrynum == PROXYHOST) |
| 4634 | 132 g_snprintf(global_proxy_info.proxyhost, sizeof(global_proxy_info.proxyhost), "%s", gtk_entry_get_text(entry)); |
|
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
133 else if (entrynum == PROXYPORT) |
| 4634 | 134 global_proxy_info.proxyport = atoi(gtk_entry_get_text(entry)); |
|
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
135 else if (entrynum == PROXYUSER) |
| 4634 | 136 g_snprintf(global_proxy_info.proxyuser, sizeof(global_proxy_info.proxyuser), "%s", gtk_entry_get_text(entry)); |
|
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
137 else if (entrynum == PROXYPASS) |
| 4634 | 138 g_snprintf(global_proxy_info.proxypass, sizeof(global_proxy_info.proxypass), "%s", gtk_entry_get_text(entry)); |
| 4137 | 139 proxy_info_is_from_gaimrc = 1; /* If the user specifies it, we want |
| 140 to save it */ | |
|
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
141 } |
|
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
142 |
| 3366 | 143 |
| 3565 | 144 GtkWidget *make_frame(GtkWidget *ret, char *text) { |
| 3427 | 145 GtkWidget *vbox, *label, *hbox; |
| 146 char labeltext[256]; | |
| 3500 | 147 |
| 3427 | 148 vbox = gtk_vbox_new(FALSE, 6); |
| 149 gtk_box_pack_start(GTK_BOX(ret), vbox, FALSE, FALSE, 0); | |
| 150 label = gtk_label_new(NULL); | |
| 151 g_snprintf(labeltext, sizeof(labeltext), "<span weight=\"bold\">%s</span>", text); | |
| 152 gtk_label_set_markup(GTK_LABEL(label), labeltext); | |
| 153 gtk_misc_set_alignment(GTK_MISC(label), 0, 0); | |
| 154 gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0); | |
| 155 hbox = gtk_hbox_new(FALSE, 6); | |
| 156 gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0); | |
| 157 label = gtk_label_new(" "); | |
| 158 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); | |
| 159 vbox = gtk_vbox_new(FALSE, 6); | |
| 160 gtk_box_pack_start(GTK_BOX(hbox), vbox, FALSE, FALSE, 0); | |
| 161 return vbox; | |
| 162 } | |
| 163 | |
| 3366 | 164 /* OK, Apply and Cancel */ |
| 165 | |
| 166 static void pref_nb_select(GtkTreeSelection *sel, GtkNotebook *nb) { | |
| 167 GtkTreeIter iter; | |
| 3427 | 168 char text[128]; |
| 3366 | 169 GValue val = { 0, }; |
| 170 GtkTreeModel *model = GTK_TREE_MODEL(prefstree); | |
| 3500 | 171 |
| 3366 | 172 if (! gtk_tree_selection_get_selected (sel, &model, &iter)) |
| 173 return; | |
| 174 gtk_tree_model_get_value (model, &iter, 1, &val); | |
| 3500 | 175 g_snprintf(text, sizeof(text), "<span weight=\"bold\" size=\"larger\">%s</span>", |
| 3427 | 176 g_value_get_string(&val)); |
| 177 gtk_label_set_markup (GTK_LABEL(preflabel), text); | |
| 3366 | 178 g_value_unset (&val); |
| 179 gtk_tree_model_get_value (model, &iter, 2, &val); | |
| 180 gtk_notebook_set_current_page (GTK_NOTEBOOK (prefsnotebook), g_value_get_int (&val)); | |
| 181 | |
| 182 } | |
| 183 | |
| 184 /* These are the pages in the preferences notebook */ | |
| 185 GtkWidget *interface_page() { | |
| 186 GtkWidget *ret; | |
|
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
187 GtkWidget *vbox; |
| 3427 | 188 ret = gtk_vbox_new(FALSE, 18); |
| 189 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
| 3366 | 190 |
| 3427 | 191 vbox = make_frame(ret, _("Interface Options")); |
| 3500 | 192 |
| 4227 | 193 gaim_button(_("D_isplay remote nicknames if no alias is set"), &misc_options, OPT_MISC_USE_SERVER_ALIAS, vbox); |
| 194 | |
| 3366 | 195 |
| 3427 | 196 gtk_widget_show_all(ret); |
| 3366 | 197 return ret; |
| 198 } | |
| 199 | |
| 4288 | 200 static void smiley_sel (GtkTreeSelection *sel, GtkTreeModel *model) { |
| 201 GtkTreeIter iter; | |
| 4298 | 202 const char *filename; |
| 4288 | 203 GValue val = { 0, }; |
| 204 | |
| 205 if (! gtk_tree_selection_get_selected (sel, &model, &iter)) | |
| 206 return; | |
| 207 gtk_tree_model_get_value (model, &iter, 2, &val); | |
| 208 filename = g_value_get_string(&val); | |
| 209 load_smiley_theme(filename, TRUE); | |
| 210 g_value_unset (&val); | |
| 4302 | 211 save_prefs(); |
| 4288 | 212 } |
| 213 | |
| 4324 | 214 GtkTreePath *theme_refresh_theme_list() |
| 215 { | |
| 216 GdkPixbuf *pixbuf; | |
| 4323 | 217 GSList *themes; |
| 4288 | 218 GtkTreeIter iter; |
| 4328 | 219 GtkTreePath *path = NULL; |
| 4325 | 220 int ind = 0; |
| 221 | |
| 4288 | 222 |
| 4323 | 223 smiley_theme_probe(); |
| 4328 | 224 |
| 4323 | 225 if (!smiley_themes) |
| 4328 | 226 return NULL; |
| 4325 | 227 |
| 4323 | 228 themes = smiley_themes; |
| 4325 | 229 |
| 230 gtk_list_store_clear(smiley_theme_store); | |
| 231 | |
| 4288 | 232 while (themes) { |
| 233 struct smiley_theme *theme = themes->data; | |
| 234 char *description = g_strdup_printf("<span size='larger' weight='bold'>%s</span> - %s\n" | |
| 4718 | 235 "<span size='smaller' foreground='dim grey'>%s</span>", |
| 236 theme->name, theme->author, theme->desc); | |
| 4324 | 237 gtk_list_store_append (smiley_theme_store, &iter); |
| 4288 | 238 pixbuf = gdk_pixbuf_new_from_file(theme->icon, NULL); |
| 4328 | 239 |
| 4324 | 240 gtk_list_store_set(smiley_theme_store, &iter, |
| 4288 | 241 0, pixbuf, |
| 242 1, description, | |
| 243 2, theme->path, | |
| 244 -1); | |
| 4892 | 245 g_object_unref(G_OBJECT(pixbuf)); |
| 4288 | 246 g_free(description); |
| 247 themes = themes->next; | |
| 248 if (current_smiley_theme && !strcmp(theme->path, current_smiley_theme->path)) { | |
| 249 /* path = gtk_tree_path_new_from_indices(ind); */ | |
| 250 char *iwishihadgtk2_2 = g_strdup_printf("%d", ind); | |
| 251 path = gtk_tree_path_new_from_string(iwishihadgtk2_2); | |
| 252 g_free(iwishihadgtk2_2); | |
| 253 } | |
| 254 ind++; | |
| 255 } | |
| 4325 | 256 |
| 4324 | 257 return path; |
| 258 } | |
| 4325 | 259 |
| 4326 | 260 void theme_install_theme(char *path, char *extn) { |
| 4325 | 261 gchar *command; |
| 262 gchar *destdir; | |
| 263 gchar *tail; | |
| 264 | |
| 265 /* Just to be safe */ | |
| 266 g_strchomp(path); | |
| 267 | |
| 268 /* I dont know what you are, get out of here */ | |
| 4326 | 269 if (extn != NULL) |
| 270 tail = extn; | |
| 271 else if ((tail = strrchr(path, '.')) == NULL) | |
| 4325 | 272 return; |
| 273 | |
| 274 destdir = g_strconcat(gaim_user_dir(), G_DIR_SEPARATOR_S "smileys", NULL); | |
| 275 | |
| 276 /* We'll check this just to make sure. This also lets us do something different on | |
| 277 * other platforms, if need be */ | |
| 4793 | 278 if (!g_ascii_strcasecmp(tail, ".gz") || !g_ascii_strcasecmp(tail, ".tgz")) |
| 4325 | 279 command = g_strdup_printf("tar > /dev/null xzf \"%s\" -C %s", path, destdir); |
| 280 else { | |
| 281 g_free(destdir); | |
| 282 return; | |
| 283 } | |
| 284 | |
| 285 /* Fire! */ | |
| 286 system(command); | |
| 287 | |
| 288 g_free(command); | |
| 289 g_free(destdir); | |
| 290 | |
| 291 theme_refresh_theme_list(); | |
| 292 } | |
| 293 | |
| 4326 | 294 static void theme_got_url(gpointer data, char *themedata, unsigned long len) { |
| 295 FILE *f; | |
| 296 gchar *path; | |
| 297 | |
| 298 f = gaim_mkstemp(&path); | |
| 299 fwrite(themedata, len, 1, f); | |
| 300 fclose(f); | |
| 301 | |
| 302 theme_install_theme(path, data); | |
| 303 | |
| 304 unlink(path); | |
| 305 g_free(path); | |
| 306 } | |
| 307 | |
| 4328 | 308 void theme_dnd_recv(GtkWidget *widget, GdkDragContext *dc, guint x, guint y, GtkSelectionData *sd, |
| 4325 | 309 guint info, guint t, gpointer data) { |
| 310 gchar *name = sd->data; | |
| 311 | |
| 312 if ((sd->length >= 0) && (sd->format == 8)) { | |
| 313 /* Well, it looks like the drag event was cool. | |
| 314 * Let's do something with it */ | |
| 315 | |
| 4793 | 316 if (!g_ascii_strncasecmp(name, "file://", 7)) { |
| 4325 | 317 /* It looks like we're dealing with a local file. Let's |
| 318 * just untar it in the right place */ | |
| 4326 | 319 theme_install_theme(name + 7, NULL); |
| 4793 | 320 } else if (!g_ascii_strncasecmp(name, "http://", 7)) { |
| 4326 | 321 /* Oo, a web drag and drop. This is where things |
| 322 * will start to get interesting */ | |
| 323 gchar *tail; | |
| 4328 | 324 |
| 4326 | 325 if ((tail = strrchr(name, '.')) == NULL) |
| 326 return; | |
| 327 | |
| 328 /* We'll check this just to make sure. This also lets us do something different on | |
| 329 * other platforms, if need be */ | |
|
4332
c8f374cadbd9
[gaim-migrate @ 4596]
Christian Hammond <chipx86@chipx86.com>
parents:
4330
diff
changeset
|
330 grab_url(name, TRUE, theme_got_url, ".tgz"); |
| 4325 | 331 } |
| 332 | |
| 333 gtk_drag_finish(dc, TRUE, FALSE, t); | |
| 334 } | |
| 335 | |
| 336 gtk_drag_finish(dc, FALSE, FALSE, t); | |
| 337 } | |
| 338 | |
| 4324 | 339 GtkWidget *theme_page() { |
| 340 GtkWidget *ret; | |
| 341 GtkWidget *sw; | |
| 342 GtkWidget *view; | |
| 343 GtkCellRenderer *rend; | |
| 344 GtkTreeViewColumn *col; | |
| 345 GtkTreeSelection *sel; | |
| 346 GtkTreePath *path = NULL; | |
| 4334 | 347 GtkWidget *label; |
| 4702 | 348 GtkTargetEntry te[3] = {{"text/plain", 0, 0},{"text/uri-list", 0, 1},{"STRING", 0, 2}}; |
| 4324 | 349 |
| 350 ret = gtk_vbox_new(FALSE, 18); | |
| 351 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
| 352 | |
|
4339
78bc4c8e4b2e
[gaim-migrate @ 4603]
Christian Hammond <chipx86@chipx86.com>
parents:
4334
diff
changeset
|
353 label = gtk_label_new(_("Select a smiley theme that you would like to use from the list below. New themes can be installed by dragging and dropping them onto the theme list.")); |
| 4334 | 354 |
|
4339
78bc4c8e4b2e
[gaim-migrate @ 4603]
Christian Hammond <chipx86@chipx86.com>
parents:
4334
diff
changeset
|
355 gtk_label_set_line_wrap(GTK_LABEL(label), TRUE); |
| 4334 | 356 gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); |
| 357 gtk_label_set_justify(GTK_LABEL(label), GTK_JUSTIFY_LEFT); | |
| 358 | |
| 359 gtk_box_pack_start(GTK_BOX(ret), label, FALSE, TRUE, 0); | |
| 360 gtk_widget_show(label); | |
| 361 | |
| 4324 | 362 sw = gtk_scrolled_window_new(NULL,NULL); |
| 363 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC); | |
| 364 gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW(sw), GTK_SHADOW_IN); | |
| 365 | |
| 366 gtk_box_pack_start(GTK_BOX(ret), sw, TRUE, TRUE, 0); | |
| 367 smiley_theme_store = gtk_list_store_new (3, GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_STRING); | |
| 368 | |
| 369 path = theme_refresh_theme_list(); | |
| 4288 | 370 |
| 4324 | 371 view = gtk_tree_view_new_with_model (GTK_TREE_MODEL(smiley_theme_store)); |
| 4325 | 372 |
| 373 gtk_drag_dest_set(view, GTK_DEST_DEFAULT_MOTION | GTK_DEST_DEFAULT_HIGHLIGHT | GTK_DEST_DEFAULT_DROP, te, | |
| 374 sizeof(te) / sizeof(GtkTargetEntry) , GDK_ACTION_COPY | GDK_ACTION_MOVE); | |
| 375 | |
| 376 g_signal_connect(G_OBJECT(view), "drag_data_received", G_CALLBACK(theme_dnd_recv), smiley_theme_store); | |
| 377 | |
| 4288 | 378 rend = gtk_cell_renderer_pixbuf_new(); |
| 379 sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (view)); | |
| 4328 | 380 |
| 381 if(path) { | |
| 382 gtk_tree_selection_select_path(sel, path); | |
| 383 gtk_tree_path_free(path); | |
| 384 } | |
| 4288 | 385 |
| 4589 | 386 col = gtk_tree_view_column_new_with_attributes (_("Icon"), |
| 4288 | 387 rend, |
| 388 "pixbuf", 0, | |
| 389 NULL); | |
| 390 gtk_tree_view_append_column (GTK_TREE_VIEW(view), col); | |
| 391 | |
| 392 rend = gtk_cell_renderer_text_new(); | |
| 4589 | 393 col = gtk_tree_view_column_new_with_attributes (_("Description"), |
| 4288 | 394 rend, |
| 395 "markup", 1, | |
| 396 NULL); | |
| 397 gtk_tree_view_append_column (GTK_TREE_VIEW(view), col); | |
| 4324 | 398 g_object_unref(G_OBJECT(smiley_theme_store)); |
| 4288 | 399 gtk_container_add(GTK_CONTAINER(sw), view); |
| 400 | |
| 401 g_signal_connect (G_OBJECT (sel), "changed", | |
| 402 G_CALLBACK (smiley_sel), | |
| 403 NULL); | |
| 404 | |
| 405 | |
| 406 gtk_widget_show_all(ret); | |
| 407 return ret; | |
| 408 } | |
| 409 | |
| 3366 | 410 GtkWidget *font_page() { |
| 411 GtkWidget *ret; | |
| 412 GtkWidget *button; | |
| 413 GtkWidget *vbox, *hbox; | |
| 414 GtkWidget *select = NULL; | |
| 3427 | 415 GtkSizeGroup *sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); |
| 3500 | 416 |
| 3427 | 417 ret = gtk_vbox_new(FALSE, 18); |
| 418 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
| 3500 | 419 |
| 3427 | 420 vbox = make_frame(ret, _("Style")); |
| 3818 | 421 gaim_button(_("_Bold"), &font_options, OPT_FONT_BOLD, vbox); |
| 422 gaim_button(_("_Italics"), &font_options, OPT_FONT_ITALIC, vbox); | |
| 423 gaim_button(_("_Underline"), &font_options, OPT_FONT_UNDERLINE, vbox); | |
| 4599 | 424 gaim_button(_("_Strikethrough"), &font_options, OPT_FONT_STRIKE, vbox); |
| 3500 | 425 |
| 3427 | 426 vbox = make_frame(ret, _("Face")); |
| 427 hbox = gtk_hbox_new(FALSE, 6); | |
| 428 gtk_container_add(GTK_CONTAINER(vbox), hbox); | |
| 3818 | 429 button = gaim_button(_("Use custo_m face"), &font_options, OPT_FONT_FACE, hbox); |
| 3427 | 430 gtk_size_group_add_widget(sg, button); |
| 431 select = gtk_button_new_from_stock(GTK_STOCK_SELECT_FONT); | |
| 3366 | 432 |
| 3818 | 433 if (!(font_options & OPT_FONT_FACE)) |
| 3366 | 434 gtk_widget_set_sensitive(GTK_WIDGET(select), FALSE); |
|
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4339
diff
changeset
|
435 g_signal_connect(GTK_OBJECT(button), "clicked", |
|
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4339
diff
changeset
|
436 G_CALLBACK(gaim_gtk_toggle_sensitive), select); |
|
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4339
diff
changeset
|
437 g_signal_connect(GTK_OBJECT(select), "clicked", |
|
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4339
diff
changeset
|
438 G_CALLBACK(show_font_dialog), NULL); |
| 3366 | 439 gtk_box_pack_start(GTK_BOX(hbox), select, FALSE, FALSE, 0); |
| 440 | |
| 441 hbox = gtk_hbox_new(FALSE, 5); | |
| 442 gtk_container_add(GTK_CONTAINER(vbox), hbox); | |
| 3818 | 443 button = gaim_button(_("Use custom si_ze"), &font_options, OPT_FONT_SIZE, hbox); |
| 3427 | 444 gtk_size_group_add_widget(sg, button); |
| 3818 | 445 select = gaim_labeled_spin_button(hbox, NULL, &fontsize, 1, 7, NULL); |
| 446 if (!(font_options & OPT_FONT_SIZE)) | |
| 3366 | 447 gtk_widget_set_sensitive(GTK_WIDGET(select), FALSE); |
|
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4339
diff
changeset
|
448 g_signal_connect(GTK_OBJECT(button), "clicked", |
|
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4339
diff
changeset
|
449 G_CALLBACK(gaim_gtk_toggle_sensitive), select); |
| 3366 | 450 |
| 3500 | 451 vbox = make_frame(ret, _("Color")); |
| 3366 | 452 hbox = gtk_hbox_new(FALSE, 5); |
| 453 gtk_container_add(GTK_CONTAINER(vbox), hbox); | |
| 3500 | 454 |
| 455 | |
| 3818 | 456 button = gaim_button(_("_Text color"), &font_options, OPT_FONT_FGCOL, hbox); |
| 3427 | 457 gtk_size_group_add_widget(sg, button); |
| 458 | |
| 459 select = gtk_button_new_from_stock(GTK_STOCK_SELECT_COLOR); | |
| 460 gtk_box_pack_start(GTK_BOX(hbox), select, FALSE, FALSE, 0); | |
| 3366 | 461 pref_fg_picture = show_color_pref(hbox, TRUE); |
|
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
462 g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(update_color), |
| 3366 | 463 pref_fg_picture); |
| 3427 | 464 |
| 3818 | 465 if (!(font_options & OPT_FONT_FGCOL)) |
| 3366 | 466 gtk_widget_set_sensitive(GTK_WIDGET(select), FALSE); |
|
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4339
diff
changeset
|
467 g_signal_connect(GTK_OBJECT(button), "clicked", |
|
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4339
diff
changeset
|
468 G_CALLBACK(gaim_gtk_toggle_sensitive), select); |
|
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
469 g_signal_connect(GTK_OBJECT(select), "clicked", G_CALLBACK(show_fgcolor_dialog), NULL); |
| 3366 | 470 hbox = gtk_hbox_new(FALSE, 5); |
| 471 gtk_container_add(GTK_CONTAINER(vbox), hbox); | |
| 3500 | 472 |
| 3818 | 473 button = gaim_button(_("Bac_kground color"), &font_options, OPT_FONT_BGCOL, hbox); |
| 3427 | 474 gtk_size_group_add_widget(sg, button); |
| 475 select = gtk_button_new_from_stock(GTK_STOCK_SELECT_COLOR); | |
| 476 gtk_box_pack_start(GTK_BOX(hbox), select, FALSE, FALSE, 0); | |
| 3366 | 477 pref_bg_picture = show_color_pref(hbox, FALSE); |
|
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
478 g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(update_color), |
| 3366 | 479 pref_bg_picture); |
| 3472 | 480 |
| 3818 | 481 if (!(font_options & OPT_FONT_BGCOL)) |
| 3366 | 482 gtk_widget_set_sensitive(GTK_WIDGET(select), FALSE); |
|
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
483 g_signal_connect(GTK_OBJECT(select), "clicked", G_CALLBACK(show_bgcolor_dialog), NULL); |
|
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4339
diff
changeset
|
484 g_signal_connect(GTK_OBJECT(button), "clicked", |
|
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4339
diff
changeset
|
485 G_CALLBACK(gaim_gtk_toggle_sensitive), select); |
| 3366 | 486 |
| 3427 | 487 gtk_widget_show_all(ret); |
| 3366 | 488 return ret; |
| 489 } | |
| 490 | |
| 491 | |
| 492 GtkWidget *messages_page() { | |
| 493 GtkWidget *ret; | |
| 494 GtkWidget *vbox; | |
| 3427 | 495 ret = gtk_vbox_new(FALSE, 18); |
| 496 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
| 3366 | 497 |
| 3427 | 498 vbox = make_frame (ret, _("Display")); |
| 3818 | 499 gaim_button(_("Show graphical _smileys"), &convo_options, OPT_CONVO_SHOW_SMILEY, vbox); |
| 500 gaim_button(_("Show _timestamp on messages"), &convo_options, OPT_CONVO_SHOW_TIME, vbox); | |
| 501 gaim_button(_("Show _URLs as links"), &convo_options, OPT_CONVO_SEND_LINKS, vbox); | |
| 3803 | 502 #ifdef USE_GTKSPELL |
| 3818 | 503 gaim_button(_("_Highlight misspelled words"), &convo_options, OPT_CONVO_CHECK_SPELLING, vbox); |
| 3803 | 504 #endif |
| 3427 | 505 vbox = make_frame (ret, _("Ignore")); |
| 3818 | 506 gaim_button(_("Ignore c_olors"), &convo_options, OPT_CONVO_IGNORE_COLOUR, vbox); |
| 507 gaim_button(_("Ignore font _faces"), &convo_options, OPT_CONVO_IGNORE_FONTS, vbox); | |
| 508 gaim_button(_("Ignore font si_zes"), &convo_options, OPT_CONVO_IGNORE_SIZES, vbox); | |
| 509 /* gaim_button(_("Ignore Ti_K Automated Messages"), &away_options, OPT_AWAY_TIK_HACK, vbox); */ | |
| 3500 | 510 |
| 3427 | 511 gtk_widget_show_all(ret); |
| 3366 | 512 return ret; |
| 513 } | |
| 514 | |
| 515 GtkWidget *hotkeys_page() { | |
| 516 GtkWidget *ret; | |
| 517 GtkWidget *vbox; | |
| 3427 | 518 ret = gtk_vbox_new(FALSE, 18); |
| 519 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
| 3366 | 520 |
| 3427 | 521 vbox = make_frame(ret, _("Send Message")); |
| 3818 | 522 gaim_button(_("_Enter sends message"), &convo_options, OPT_CONVO_ENTER_SENDS, vbox); |
| 523 gaim_button(_("C_ontrol-Enter sends message"), &convo_options, OPT_CONVO_CTL_ENTER, vbox); | |
| 3500 | 524 |
| 3427 | 525 vbox = make_frame (ret, _("Window Closing")); |
| 3818 | 526 gaim_button(_("E_scape closes window"), &convo_options, OPT_CONVO_ESC_CAN_CLOSE, vbox); |
| 527 gaim_button(_("Control-_W closes window"), &convo_options, OPT_CONVO_CTL_W_CLOSES, vbox); | |
| 3366 | 528 |
| 3427 | 529 vbox = make_frame(ret, "Insertions"); |
| 3818 | 530 gaim_button(_("Control-{B/I/U/S} inserts _HTML tags"), &convo_options, OPT_CONVO_CTL_CHARS, vbox); |
| 531 gaim_button(_("Control-(number) inserts _smileys"), &convo_options, OPT_CONVO_CTL_SMILEYS, vbox); | |
|
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
532 |
| 3427 | 533 gtk_widget_show_all(ret); |
| 3366 | 534 return ret; |
| 535 } | |
| 536 | |
| 537 GtkWidget *list_page() { | |
| 538 GtkWidget *ret; | |
| 539 GtkWidget *vbox; | |
| 3427 | 540 ret = gtk_vbox_new(FALSE, 18); |
| 541 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
| 3366 | 542 |
| 4956 | 543 vbox = make_frame (ret, _("Buddy List Toolbar")); |
| 4944 | 544 gaim_dropdown(vbox, _("Show _buttons as:"), &blist_options, OPT_BLIST_SHOW_BUTTON_XPM | OPT_BLIST_NO_BUTTON_TEXT, |
| 545 _("Pictures"), OPT_BLIST_SHOW_BUTTON_XPM | OPT_BLIST_NO_BUTTON_TEXT, | |
| 546 _("Text"), 0, | |
| 547 _("Pictures and text"), OPT_BLIST_SHOW_BUTTON_XPM, | |
| 548 _("None"), OPT_BLIST_NO_BUTTON_TEXT, NULL); | |
| 3366 | 549 |
| 3427 | 550 vbox = make_frame (ret, _("Buddy List Window")); |
| 4045 | 551 gaim_button(_("_Save window size/position"), &blist_options, OPT_BLIST_SAVED_WINDOWS, vbox); |
| 552 gaim_button(_("_Raise window on events"), &blist_options, OPT_BLIST_POPUP, vbox); | |
| 3366 | 553 |
| 4717 | 554 /* vbox = make_frame (ret, _("Group Display")); */ |
| 4700 | 555 /* gaim_button(_("Hide _groups with no online buddies"), &blist_options, OPT_BLIST_NO_MT_GRP, vbox); */ |
| 556 /* gaim_button(_("Show _numbers in groups"), &blist_options, OPT_BLIST_SHOW_GRPNUM, vbox); */ | |
| 3366 | 557 |
| 3427 | 558 vbox = make_frame (ret, _("Buddy Display")); |
| 4687 | 559 gaim_button(_("Show buddy _icons"), &blist_options, OPT_BLIST_SHOW_ICONS, vbox); |
| 4700 | 560 /* gaim_button(_("Show buddy t_ype icons"), &blist_options, OPT_BLIST_SHOW_PIXMAPS, vbox); */ |
| 3818 | 561 gaim_button(_("Show _warning levels"), &blist_options, OPT_BLIST_SHOW_WARN, vbox); |
| 562 gaim_button(_("Show idle _times"), &blist_options, OPT_BLIST_SHOW_IDLETIME, vbox); | |
| 4944 | 563 gaim_button(_("Dim i_dle buddies"), &blist_options, OPT_BLIST_GREY_IDLERS, vbox); |
| 3366 | 564 |
| 3427 | 565 gtk_widget_show_all(ret); |
| 3366 | 566 return ret; |
| 567 } | |
| 568 | |
|
4469
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
569 GtkWidget *conv_page() { |
|
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
570 GtkWidget *ret; |
|
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
571 GtkWidget *vbox; |
|
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
572 GtkWidget *label; |
|
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
573 GtkSizeGroup *sg; |
|
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
574 GList *names = NULL; |
|
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
575 int i; |
|
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
576 |
|
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
577 ret = gtk_vbox_new(FALSE, 18); |
|
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
578 gtk_container_set_border_width(GTK_CONTAINER(ret), 12); |
|
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
579 |
|
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
580 sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); |
|
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
581 vbox = make_frame(ret, _("Conversations")); |
|
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
582 |
|
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
583 /* Build a list of names. */ |
|
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
584 for (i = 0; i < gaim_conv_placement_get_fnc_count(); i++) { |
|
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
585 names = g_list_append(names, (char *)gaim_conv_placement_get_name(i)); |
|
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
586 names = g_list_append(names, GINT_TO_POINTER(i)); |
|
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
587 } |
|
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
588 |
|
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
589 label = gaim_dropdown_from_list(vbox, _("_Placement:"), |
|
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
590 &conv_placement_option, -1, names); |
|
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
591 |
|
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
592 g_list_free(names); |
|
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
593 |
|
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
594 gtk_misc_set_alignment(GTK_MISC(label), 0, 0); |
|
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
595 gtk_size_group_add_widget(sg, label); |
|
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
596 |
|
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
597 gaim_button(_("Show IMs and chats in _same tabbed window."), |
|
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
598 &convo_options, OPT_CONVO_COMBINE, vbox); |
|
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
599 |
|
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
600 gtk_widget_show_all(ret); |
|
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
601 |
|
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
602 return ret; |
|
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
603 } |
|
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
604 |
| 3366 | 605 GtkWidget *im_page() { |
| 606 GtkWidget *ret; | |
| 3500 | 607 GtkWidget *vbox; |
| 3427 | 608 GtkWidget *typingbutton, *widge; |
| 609 GtkSizeGroup *sg; | |
| 3366 | 610 |
| 3427 | 611 ret = gtk_vbox_new(FALSE, 18); |
| 612 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
| 613 | |
| 614 sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); | |
| 615 | |
| 616 vbox = make_frame (ret, _("Window")); | |
| 4114 | 617 widge = gaim_dropdown(vbox, _("Show _buttons as:"), &im_options, OPT_IM_BUTTON_TEXT | OPT_IM_BUTTON_XPM, |
| 618 _("Pictures"), OPT_IM_BUTTON_XPM, | |
| 619 _("Text"), OPT_IM_BUTTON_TEXT, | |
| 620 _("Pictures and text"), OPT_IM_BUTTON_XPM | OPT_IM_BUTTON_TEXT, NULL); | |
| 3427 | 621 gtk_size_group_add_widget(sg, widge); |
| 622 gtk_misc_set_alignment(GTK_MISC(widge), 0, 0); | |
| 3818 | 623 gaim_labeled_spin_button(vbox, _("New window _width:"), &conv_size.width, 25, 9999, sg); |
| 624 gaim_labeled_spin_button(vbox, _("New window _height:"), &conv_size.height, 25, 9999, sg); | |
| 625 gaim_labeled_spin_button(vbox, _("_Entry widget height:"), &conv_size.entry_height, 25, 9999, sg); | |
| 626 gaim_button(_("_Raise windows on events"), &im_options, OPT_IM_POPUP, vbox); | |
| 627 gaim_button(_("Hide window on _send"), &im_options, OPT_IM_POPDOWN, vbox); | |
| 3366 | 628 gtk_widget_show (vbox); |
| 629 | |
| 3427 | 630 vbox = make_frame (ret, _("Buddy Icons")); |
| 4045 | 631 gaim_button(_("Hide buddy _icons"), &im_options, OPT_IM_HIDE_ICONS, vbox); |
| 632 gaim_button(_("Disable buddy icon a_nimation"), &im_options, OPT_IM_NO_ANIMATION, vbox); | |
| 3366 | 633 |
| 3427 | 634 vbox = make_frame (ret, _("Display")); |
| 3818 | 635 gaim_button(_("Show _logins in window"), &im_options, OPT_IM_LOGON, vbox); |
| 3366 | 636 |
| 3427 | 637 vbox = make_frame (ret, _("Typing Notification")); |
| 3818 | 638 typingbutton = gaim_button(_("Notify buddies that you are _typing to them"), &misc_options, |
| 3366 | 639 OPT_MISC_STEALTH_TYPING, vbox); |
| 640 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(typingbutton), !gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(typingbutton))); | |
| 3818 | 641 misc_options ^= OPT_MISC_STEALTH_TYPING; |
| 3366 | 642 |
| 3427 | 643 gtk_widget_show_all(ret); |
| 3366 | 644 return ret; |
| 645 } | |
| 646 | |
| 647 GtkWidget *chat_page() { | |
| 648 GtkWidget *ret; | |
| 649 GtkWidget *vbox; | |
| 3427 | 650 GtkWidget *dd; |
| 651 GtkSizeGroup *sg; | |
| 3366 | 652 |
| 3427 | 653 ret = gtk_vbox_new(FALSE, 18); |
| 654 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
| 3500 | 655 |
| 3427 | 656 sg = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL); |
| 3366 | 657 |
| 3427 | 658 vbox = make_frame (ret, _("Window")); |
| 4114 | 659 dd = gaim_dropdown(vbox, _("Show _buttons as:"), &chat_options, OPT_CHAT_BUTTON_TEXT | OPT_CHAT_BUTTON_XPM, |
| 660 _("Pictures"), OPT_CHAT_BUTTON_XPM, | |
| 661 _("Text"), OPT_CHAT_BUTTON_TEXT, | |
| 662 _("Pictures and text"), OPT_CHAT_BUTTON_XPM | OPT_CHAT_BUTTON_TEXT, NULL); | |
| 3427 | 663 gtk_size_group_add_widget(sg, dd); |
| 664 gtk_misc_set_alignment(GTK_MISC(dd), 0, 0); | |
| 3818 | 665 gaim_labeled_spin_button(vbox, _("New window _width:"), &buddy_chat_size.width, 25, 9999, sg); |
| 666 gaim_labeled_spin_button(vbox, _("New window _height:"), &buddy_chat_size.height, 25, 9999, sg); | |
| 667 gaim_labeled_spin_button(vbox, _("_Entry widget height:"), &buddy_chat_size.entry_height, 25, 9999, sg); | |
| 668 gaim_button(_("_Raise windows on events"), &chat_options, OPT_CHAT_POPUP, vbox); | |
| 3366 | 669 |
| 3427 | 670 vbox = make_frame (ret, _("Tab Completion")); |
| 4045 | 671 gaim_button(_("_Tab-complete nicks"), &chat_options, OPT_CHAT_TAB_COMPLETE, vbox); |
| 672 gaim_button(_("_Old-style tab completion"), &chat_options, OPT_CHAT_OLD_STYLE_TAB, vbox); | |
| 3427 | 673 |
| 674 vbox = make_frame (ret, _("Display")); | |
| 3818 | 675 gaim_button(_("_Show people joining/leaving in window"), &chat_options, OPT_CHAT_LOGON, vbox); |
| 676 gaim_button(_("Co_lorize screennames"), &chat_options, OPT_CHAT_COLORIZE, vbox); | |
| 3427 | 677 |
| 678 gtk_widget_show_all(ret); | |
| 3366 | 679 return ret; |
| 680 } | |
|
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
681 |
| 3366 | 682 GtkWidget *tab_page() { |
| 683 GtkWidget *ret; | |
| 684 GtkWidget *vbox; | |
| 3427 | 685 GtkWidget *dd; |
| 4445 | 686 GtkWidget *button; |
| 3427 | 687 GtkSizeGroup *sg; |
| 688 ret = gtk_vbox_new(FALSE, 18); | |
| 689 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
| 3366 | 690 |
| 3427 | 691 sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); |
| 3500 | 692 |
| 3427 | 693 vbox = make_frame (ret, _("IM Tabs")); |
| 4114 | 694 dd = gaim_dropdown(vbox, _("Tab _placement:"), &im_options, OPT_IM_SIDE_TAB | OPT_IM_BR_TAB, |
| 695 _("Top"), 0, | |
| 696 _("Bottom"), OPT_IM_BR_TAB, | |
| 697 _("Left"), OPT_IM_SIDE_TAB, | |
| 698 _("Right"), OPT_IM_BR_TAB | OPT_IM_SIDE_TAB, NULL); | |
| 3427 | 699 gtk_size_group_add_widget(sg, dd); |
| 4045 | 700 gaim_button(_("Show all _instant messages in one tabbed\nwindow"), &im_options, OPT_IM_ONE_WINDOW, vbox); |
| 3818 | 701 gaim_button(_("Show a_liases in tabs/titles"), &im_options, OPT_IM_ALIAS_TAB, vbox); |
| 3366 | 702 |
| 3427 | 703 vbox = make_frame (ret, _("Chat Tabs")); |
| 4114 | 704 dd = gaim_dropdown(vbox, _("Tab _placement:"), &chat_options, OPT_CHAT_SIDE_TAB | OPT_CHAT_BR_TAB, |
| 705 _("Top"), 0, | |
| 706 _("Bottom"), OPT_CHAT_BR_TAB, | |
| 707 _("Left"), OPT_CHAT_SIDE_TAB, | |
| 708 _("Right"), OPT_CHAT_SIDE_TAB | OPT_CHAT_BR_TAB, NULL); | |
| 3427 | 709 gtk_size_group_add_widget(sg, dd); |
| 3818 | 710 gaim_button(_("Show all c_hats in one tabbed window"), &chat_options, OPT_CHAT_ONE_WINDOW, |
| 3366 | 711 vbox); |
|
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
712 |
| 4445 | 713 vbox = make_frame (ret, _("Tab Options")); |
| 714 button = gaim_button(_("Show _close button on tabs."), &convo_options, OPT_CONVO_NO_X_ON_TAB, vbox); | |
| 4449 | 715 convo_options ^= OPT_CONVO_NO_X_ON_TAB; |
| 4445 | 716 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(button), !gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(button))); |
| 717 | |
| 718 | |
| 3427 | 719 gtk_widget_show_all(ret); |
| 3366 | 720 return ret; |
| 721 } | |
| 722 | |
| 723 GtkWidget *proxy_page() { | |
| 724 GtkWidget *ret; | |
| 725 GtkWidget *vbox; | |
| 726 GtkWidget *entry; | |
| 727 GtkWidget *label; | |
| 728 GtkWidget *hbox; | |
| 729 GtkWidget *table; | |
| 730 | |
| 3427 | 731 ret = gtk_vbox_new(FALSE, 18); |
| 732 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
| 3366 | 733 |
| 3427 | 734 vbox = make_frame (ret, _("Proxy Type")); |
| 4634 | 735 gaim_dropdown(vbox, _("Proxy _type:"), (int*)&global_proxy_info.proxytype, -1, |
| 4114 | 736 _("No proxy"), PROXY_NONE, |
| 3366 | 737 "SOCKS 4", PROXY_SOCKS4, |
| 738 "SOCKS 5", PROXY_SOCKS5, | |
| 739 "HTTP", PROXY_HTTP, NULL); | |
|
2372
2927c2c26fe6
[gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2323
diff
changeset
|
740 |
| 3427 | 741 vbox = make_frame(ret, _("Proxy Server")); |
| 742 prefs_proxy_frame = vbox; | |
| 2254 | 743 |
| 4634 | 744 if (global_proxy_info.proxytype == PROXY_NONE) |
| 3427 | 745 gtk_widget_set_sensitive(GTK_WIDGET(vbox), FALSE); |
| 2254 | 746 |
| 747 table = gtk_table_new(2, 4, FALSE); | |
| 748 gtk_container_set_border_width(GTK_CONTAINER(table), 5); | |
| 749 gtk_table_set_col_spacings(GTK_TABLE(table), 5); | |
| 750 gtk_table_set_row_spacings(GTK_TABLE(table), 10); | |
| 3427 | 751 gtk_container_add(GTK_CONTAINER(vbox), table); |
| 2254 | 752 |
| 753 | |
| 3427 | 754 label = gtk_label_new_with_mnemonic(_("_Host")); |
| 2254 | 755 gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5); |
| 756 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
|
757 |
|
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
758 entry = gtk_entry_new(); |
| 3427 | 759 gtk_label_set_mnemonic_widget(GTK_LABEL(label), entry); |
| 3366 | 760 gtk_table_attach(GTK_TABLE(table), entry, 1, 2, 0, 1, GTK_FILL, 0, 0, 0); |
|
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
761 g_signal_connect(GTK_OBJECT(entry), "changed", |
|
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
762 G_CALLBACK(proxy_print_option), (void *)PROXYHOST); |
| 4634 | 763 gtk_entry_set_text(GTK_ENTRY(entry), global_proxy_info.proxyhost); |
|
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
764 |
|
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
765 hbox = gtk_hbox_new(TRUE, 5); |
|
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
766 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); |
|
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
767 |
| 3427 | 768 label = gtk_label_new_with_mnemonic(_("Port")); |
| 2254 | 769 gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5); |
| 770 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
|
771 |
|
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
772 entry = gtk_entry_new(); |
| 3427 | 773 gtk_label_set_mnemonic_widget(GTK_LABEL(label), entry); |
| 3366 | 774 gtk_table_attach(GTK_TABLE(table), entry, 1, 2, 1, 2, GTK_FILL, 0, 0, 0); |
|
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
775 g_signal_connect(GTK_OBJECT(entry), "changed", |
|
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
776 G_CALLBACK(proxy_print_option), (void *)PROXYPORT); |
| 2254 | 777 |
| 4634 | 778 if (global_proxy_info.proxyport) { |
|
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
779 char buf[128]; |
| 4634 | 780 g_snprintf(buf, sizeof(buf), "%d", global_proxy_info.proxyport); |
|
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
781 gtk_entry_set_text(GTK_ENTRY(entry), buf); |
|
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
782 } |
|
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
783 |
| 3427 | 784 label = gtk_label_new_with_mnemonic(_("_User")); |
| 2254 | 785 gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5); |
| 786 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
|
787 |
|
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
788 entry = gtk_entry_new(); |
| 3427 | 789 gtk_label_set_mnemonic_widget(GTK_LABEL(label), entry); |
| 3366 | 790 gtk_table_attach(GTK_TABLE(table), entry, 1, 2, 2, 3, GTK_FILL, 0, 0, 0); |
|
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
791 g_signal_connect(GTK_OBJECT(entry), "changed", |
|
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
792 G_CALLBACK(proxy_print_option), (void *)PROXYUSER); |
| 4634 | 793 gtk_entry_set_text(GTK_ENTRY(entry), global_proxy_info.proxyuser); |
|
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
794 |
|
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
795 hbox = gtk_hbox_new(TRUE, 5); |
|
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
796 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); |
|
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
797 |
| 3427 | 798 label = gtk_label_new_with_mnemonic(_("Pa_ssword")); |
| 2254 | 799 gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5); |
| 800 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
|
801 |
|
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
802 entry = gtk_entry_new(); |
| 3427 | 803 gtk_label_set_mnemonic_widget(GTK_LABEL(label), entry); |
| 3366 | 804 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
|
805 gtk_entry_set_visibility(GTK_ENTRY(entry), FALSE); |
|
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
806 g_signal_connect(GTK_OBJECT(entry), "changed", |
|
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
807 G_CALLBACK(proxy_print_option), (void *)PROXYPASS); |
| 4634 | 808 gtk_entry_set_text(GTK_ENTRY(entry), global_proxy_info.proxypass); |
| 3500 | 809 |
| 3427 | 810 gtk_widget_show_all(ret); |
| 3366 | 811 return ret; |
|
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
812 } |
|
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
813 |
| 3821 | 814 #ifndef _WIN32 |
| 4978 | 815 static gboolean manual_browser_set(GtkWidget *entry, GdkEventFocus *event, gpointer data) { |
| 816 const char *program = gtk_entry_get_text(GTK_ENTRY(entry)); | |
| 817 | |
| 4428 | 818 if (!program_is_valid(program)) { |
| 819 char *error = g_strdup_printf(_("The entered manual browser " | |
|
4461
75ff69e592cc
[gaim-migrate @ 4736]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4451
diff
changeset
|
820 "'%s' is not valid. Hyperlinks will " |
|
75ff69e592cc
[gaim-migrate @ 4736]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4451
diff
changeset
|
821 "not work."), program); |
| 4428 | 822 do_error_dialog(error, NULL, GAIM_WARNING); |
| 823 } | |
| 824 | |
| 825 g_strlcpy(web_command, program, sizeof(web_command)); | |
| 4978 | 826 |
| 827 /* carry on normally */ | |
| 828 return FALSE; | |
| 3432 | 829 } |
| 830 | |
| 4428 | 831 static GList *get_available_browsers() |
| 832 { | |
| 833 struct browser { | |
| 834 char *name; | |
|
4461
75ff69e592cc
[gaim-migrate @ 4736]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4451
diff
changeset
|
835 char *command; |
| 4428 | 836 int id; |
| 837 }; | |
| 838 | |
| 839 static struct browser possible_browsers[] = { | |
| 840 {N_("Konqueror"), "kfmclient", BROWSER_KONQ}, | |
| 841 {N_("Opera"), "opera", BROWSER_OPERA}, | |
| 842 {N_("Galeon"), "galeon", BROWSER_GALEON}, | |
| 843 {N_("Netscape"), "netscape", BROWSER_NETSCAPE}, | |
| 844 {N_("Mozilla"), "mozilla", BROWSER_MOZILLA}, | |
| 845 }; | |
| 846 static const int num_possible_browsers = 5; | |
| 847 | |
| 848 GList *browsers = NULL; | |
| 849 int i = 0; | |
| 850 | |
| 851 browsers = g_list_prepend(browsers, GINT_TO_POINTER(BROWSER_MANUAL)); | |
| 852 browsers = g_list_prepend(browsers, _("Manual")); | |
|
4461
75ff69e592cc
[gaim-migrate @ 4736]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4451
diff
changeset
|
853 for (i = 0; i < num_possible_browsers; i++) { |
| 4428 | 854 if (program_is_valid(possible_browsers[i].command)) { |
| 855 browsers = g_list_prepend(browsers, | |
|
4461
75ff69e592cc
[gaim-migrate @ 4736]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4451
diff
changeset
|
856 GINT_TO_POINTER(possible_browsers[i].id)); |
| 4428 | 857 browsers = g_list_prepend(browsers, possible_browsers[i].name); |
| 858 } | |
| 859 } | |
| 860 | |
| 861 return browsers; | |
| 862 } | |
| 863 | |
| 3366 | 864 GtkWidget *browser_page() { |
| 865 GtkWidget *ret; | |
| 3821 | 866 GtkWidget *vbox; |
| 867 GtkWidget *hbox; | |
| 3366 | 868 GtkWidget *label; |
| 3427 | 869 GtkSizeGroup *sg; |
| 4428 | 870 GList *browsers = NULL; |
| 3427 | 871 |
| 872 ret = gtk_vbox_new(FALSE, 18); | |
| 873 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
| 874 | |
| 875 sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); | |
| 876 vbox = make_frame (ret, _("Browser Selection")); | |
| 4428 | 877 |
| 878 browsers = get_available_browsers(); | |
| 879 if (browsers != NULL) { | |
| 880 label = gaim_dropdown_from_list(vbox,_("_Browser"), &web_browser, -1, | |
|
4461
75ff69e592cc
[gaim-migrate @ 4736]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4451
diff
changeset
|
881 browsers); |
|
75ff69e592cc
[gaim-migrate @ 4736]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4451
diff
changeset
|
882 gtk_misc_set_alignment(GTK_MISC(label), 0, 0); |
|
75ff69e592cc
[gaim-migrate @ 4736]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4451
diff
changeset
|
883 gtk_size_group_add_widget(sg, label); |
| 4428 | 884 } |
|
915
378c862a2381
[gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
910
diff
changeset
|
885 |
| 3366 | 886 hbox = gtk_hbox_new(FALSE, 5); |
| 887 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); | |
| 4295 | 888 label = gtk_label_new_with_mnemonic(_("_Manual: ")); |
| 3366 | 889 gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0); |
| 3427 | 890 gtk_misc_set_alignment(GTK_MISC(label), 0, 0); |
| 891 gtk_size_group_add_widget(sg, label); | |
| 4978 | 892 |
| 3366 | 893 browser_entry = gtk_entry_new(); |
| 3427 | 894 gtk_label_set_mnemonic_widget(GTK_LABEL(label), browser_entry); |
| 3818 | 895 if (web_browser != BROWSER_MANUAL) |
| 4428 | 896 gtk_widget_set_sensitive(hbox, FALSE); |
| 3366 | 897 gtk_box_pack_start (GTK_BOX (hbox), browser_entry, FALSE, FALSE, 0); |
|
1750
d2eca7a46cfd
[gaim-migrate @ 1760]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1711
diff
changeset
|
898 |
| 3818 | 899 gtk_entry_set_text(GTK_ENTRY(browser_entry), web_command); |
| 4978 | 900 g_signal_connect(G_OBJECT(browser_entry), "focus-out-event", G_CALLBACK(manual_browser_set), NULL); |
| 4428 | 901 |
| 902 if (browsers != NULL) { | |
|
4461
75ff69e592cc
[gaim-migrate @ 4736]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4451
diff
changeset
|
903 vbox = make_frame (ret, _("Browser Options")); |
|
75ff69e592cc
[gaim-migrate @ 4736]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4451
diff
changeset
|
904 label = gaim_button(_("Open new _window by default"), &misc_options, OPT_MISC_BROWSER_POPUP, vbox); |
| 4428 | 905 } |
|
4451
ce5b64fac95d
[gaim-migrate @ 4726]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4449
diff
changeset
|
906 |
| 3427 | 907 gtk_widget_show_all(ret); |
| 3366 | 908 return ret; |
| 3500 | 909 } |
|
4461
75ff69e592cc
[gaim-migrate @ 4736]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4451
diff
changeset
|
910 #endif /*_WIN32*/ |
| 3366 | 911 |
| 912 GtkWidget *logging_page() { | |
| 913 GtkWidget *ret; | |
| 914 GtkWidget *vbox; | |
| 3427 | 915 ret = gtk_vbox_new(FALSE, 18); |
| 916 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
|
915
378c862a2381
[gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
910
diff
changeset
|
917 |
| 3427 | 918 vbox = make_frame (ret, _("Message Logs")); |
| 4045 | 919 gaim_button(_("_Log all instant messages"), &logging_options, OPT_LOG_CONVOS, vbox); |
| 3818 | 920 gaim_button(_("Log all c_hats"), &logging_options, OPT_LOG_CHATS, vbox); |
| 921 gaim_button(_("Strip _HTML from logs"), &logging_options, OPT_LOG_STRIP_HTML, vbox); | |
|
2843
87d11d2a7d59
[gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2839
diff
changeset
|
922 |
| 3427 | 923 vbox = make_frame (ret, _("System Logs")); |
| 3818 | 924 gaim_button(_("Log when buddies _sign on/sign off"), &logging_options, OPT_LOG_BUDDY_SIGNON, |
| 3366 | 925 vbox); |
| 3818 | 926 gaim_button(_("Log when buddies become _idle/un-idle"), &logging_options, OPT_LOG_BUDDY_IDLE, |
| 3366 | 927 vbox); |
| 3818 | 928 gaim_button(_("Log when buddies go away/come _back"), &logging_options, OPT_LOG_BUDDY_AWAY, vbox); |
| 929 gaim_button(_("Log your _own signons/idleness/awayness"), &logging_options, OPT_LOG_MY_SIGNON, | |
| 3366 | 930 vbox); |
| 3818 | 931 gaim_button(_("I_ndividual log file for each buddy's signons"), &logging_options, |
| 3366 | 932 OPT_LOG_INDIVIDUAL, vbox); |
|
1757
3dfe4aefd366
[gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1755
diff
changeset
|
933 |
| 3427 | 934 gtk_widget_show_all(ret); |
| 3366 | 935 return ret; |
|
1757
3dfe4aefd366
[gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1755
diff
changeset
|
936 } |
|
3dfe4aefd366
[gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1755
diff
changeset
|
937 |
| 3366 | 938 static GtkWidget *sndcmd = NULL; |
|
1757
3dfe4aefd366
[gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1755
diff
changeset
|
939 |
| 3821 | 940 #ifndef _WIN32 |
| 4095 | 941 static gint sound_cmd_yeah(GtkEntry *entry, gpointer d) |
|
1813
998a6a032874
[gaim-migrate @ 1823]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1805
diff
changeset
|
942 { |
| 4561 | 943 gaim_sound_set_command(gtk_entry_get_text(GTK_ENTRY(sndcmd))); |
| 3366 | 944 return TRUE; |
|
1813
998a6a032874
[gaim-migrate @ 1823]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1805
diff
changeset
|
945 } |
| 3821 | 946 #endif |
|
1813
998a6a032874
[gaim-migrate @ 1823]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1805
diff
changeset
|
947 |
| 3366 | 948 GtkWidget *sound_page() { |
| 949 GtkWidget *ret; | |
| 3821 | 950 GtkWidget *vbox; |
| 951 GtkSizeGroup *sg; | |
| 952 #ifndef _WIN32 | |
| 953 GtkWidget *dd; | |
| 954 GtkWidget *hbox; | |
|
1750
d2eca7a46cfd
[gaim-migrate @ 1760]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1711
diff
changeset
|
955 GtkWidget *label; |
| 4561 | 956 char *cmd; |
| 3821 | 957 #endif |
| 3366 | 958 |
| 3427 | 959 ret = gtk_vbox_new(FALSE, 18); |
| 960 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
|
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
961 |
| 3427 | 962 sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); |
|
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
963 |
| 3427 | 964 vbox = make_frame (ret, _("Sound Options")); |
| 3818 | 965 gaim_button(_("_No sounds when you log in"), &sound_options, OPT_SOUND_SILENT_SIGNON, vbox); |
| 966 gaim_button(_("_Sounds while away"), &sound_options, OPT_SOUND_WHEN_AWAY, vbox); | |
|
2843
87d11d2a7d59
[gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2839
diff
changeset
|
967 |
| 3630 | 968 #ifndef _WIN32 |
| 3427 | 969 vbox = make_frame (ret, _("Sound Method")); |
| 4114 | 970 dd = gaim_dropdown(vbox, _("_Method"), &sound_options, OPT_SOUND_BEEP | |
| 4581 | 971 OPT_SOUND_ESD | OPT_SOUND_ARTS | OPT_SOUND_NAS | |
| 972 OPT_SOUND_NORMAL | OPT_SOUND_CMD, | |
| 4114 | 973 _("Console beep"), OPT_SOUND_BEEP, |
| 4561 | 974 #ifdef USE_AO |
| 975 _("Automatic"), OPT_SOUND_NORMAL, | |
| 4581 | 976 "ESD", OPT_SOUND_ESD, |
| 977 "Arts", OPT_SOUND_ARTS, | |
| 978 #endif | |
| 979 #ifdef USE_NAS_AUDIO | |
| 980 "NAS", OPT_SOUND_NAS, | |
| 4082 | 981 #endif |
| 4114 | 982 _("Command"), OPT_SOUND_CMD, NULL); |
| 3427 | 983 gtk_size_group_add_widget(sg, dd); |
| 984 gtk_misc_set_alignment(GTK_MISC(dd), 0, 0); | |
|
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
985 |
|
1813
998a6a032874
[gaim-migrate @ 1823]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1805
diff
changeset
|
986 hbox = gtk_hbox_new(FALSE, 5); |
|
998a6a032874
[gaim-migrate @ 1823]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1805
diff
changeset
|
987 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 5); |
| 3427 | 988 |
| 3366 | 989 hbox = gtk_hbox_new(FALSE, 5); |
| 990 gtk_container_add(GTK_CONTAINER(vbox), hbox); | |
| 3500 | 991 label = gtk_label_new_with_mnemonic(_("Sound c_ommand\n(%s for filename)")); |
| 3427 | 992 gtk_size_group_add_widget(sg, label); |
| 993 gtk_misc_set_alignment(GTK_MISC(label), 0, 0); | |
| 3366 | 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 |
| 3366 | 996 sndcmd = gtk_entry_new(); |
| 3427 | 997 gtk_label_set_mnemonic_widget(GTK_LABEL(label), sndcmd); |
|
1813
998a6a032874
[gaim-migrate @ 1823]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1805
diff
changeset
|
998 |
| 4635 | 999 gtk_editable_set_editable(GTK_EDITABLE(sndcmd), TRUE); |
| 4561 | 1000 cmd = gaim_sound_get_command(); |
| 1001 if(cmd) | |
| 1002 gtk_entry_set_text(GTK_ENTRY(sndcmd), cmd); | |
| 3366 | 1003 gtk_widget_set_size_request(sndcmd, 75, -1); |
| 3427 | 1004 |
| 3818 | 1005 gtk_widget_set_sensitive(sndcmd, (sound_options & OPT_SOUND_CMD)); |
| 3366 | 1006 gtk_box_pack_start(GTK_BOX(hbox), sndcmd, TRUE, TRUE, 5); |
|
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
1007 g_signal_connect(GTK_OBJECT(sndcmd), "changed", G_CALLBACK(sound_cmd_yeah), NULL); |
| 3630 | 1008 #endif /* _WIN32 */ |
| 3427 | 1009 gtk_widget_show_all(ret); |
| 3366 | 1010 return ret; |
|
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 |
| 3366 | 1013 GtkWidget *away_page() { |
| 1014 GtkWidget *ret; | |
|
2262
9c8f353331e7
[gaim-migrate @ 2272]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2254
diff
changeset
|
1015 GtkWidget *vbox; |
|
9c8f353331e7
[gaim-migrate @ 2272]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2254
diff
changeset
|
1016 GtkWidget *hbox; |
| 3366 | 1017 GtkWidget *label; |
|
2262
9c8f353331e7
[gaim-migrate @ 2272]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2254
diff
changeset
|
1018 GtkWidget *button; |
| 3366 | 1019 GtkWidget *select; |
| 3427 | 1020 GtkWidget *dd; |
| 1021 GtkSizeGroup *sg; | |
|
2262
9c8f353331e7
[gaim-migrate @ 2272]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2254
diff
changeset
|
1022 |
| 3427 | 1023 ret = gtk_vbox_new(FALSE, 18); |
| 1024 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
|
2262
9c8f353331e7
[gaim-migrate @ 2272]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2254
diff
changeset
|
1025 |
| 3427 | 1026 sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); |
|
1813
998a6a032874
[gaim-migrate @ 1823]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1805
diff
changeset
|
1027 |
| 3427 | 1028 vbox = make_frame (ret, _("Away")); |
| 3818 | 1029 gaim_button(_("_Sending messages removes away status"), &away_options, OPT_AWAY_BACK_ON_IM, vbox); |
| 1030 gaim_button(_("_Queue new messages when away"), &away_options, OPT_AWAY_QUEUE, vbox); | |
| 1031 gaim_button(_("_Ignore new conversations when away"), &away_options, OPT_AWAY_DISCARD, vbox); | |
|
1813
998a6a032874
[gaim-migrate @ 1823]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1805
diff
changeset
|
1032 |
| 3427 | 1033 vbox = make_frame (ret, _("Auto-response")); |
| 3366 | 1034 hbox = gtk_hbox_new(FALSE, 0); |
| 1035 gtk_container_add(GTK_CONTAINER(vbox), hbox); | |
| 3427 | 1036 gaim_labeled_spin_button(hbox, _("Seconds before _resending:"), |
| 3818 | 1037 &away_resend, 1, 24 * 60 * 60, sg); |
| 1038 gaim_button(_("_Don't send auto-response"), &away_options, OPT_AWAY_NO_AUTO_RESP, vbox); | |
| 1039 gaim_button(_("_Only send auto-response when idle"), &away_options, OPT_AWAY_IDLE_RESP, vbox); | |
| 1040 gaim_button(_("Do_n't send auto-response in active conversations"), &away_options, OPT_AWAY_DELAY_IN_USE, vbox); | |
|
1813
998a6a032874
[gaim-migrate @ 1823]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1805
diff
changeset
|
1041 |
| 3818 | 1042 if (away_options & OPT_AWAY_NO_AUTO_RESP) |
| 3366 | 1043 gtk_widget_set_sensitive(hbox, FALSE); |
| 3500 | 1044 |
| 3427 | 1045 vbox = make_frame (ret, _("Idle")); |
| 4052 | 1046 dd = gaim_dropdown(vbox, _("Idle _time reporting:"), &report_idle, -1, |
| 1047 _("None"), IDLE_NONE, | |
| 1048 _("Gaim usage"), IDLE_GAIM, | |
| 3366 | 1049 #ifdef USE_SCREENSAVER |
|
3905
3e508dd31b76
[gaim-migrate @ 4058]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3902
diff
changeset
|
1050 #ifndef _WIN32 |
| 4052 | 1051 _("X usage"), IDLE_SCREENSAVER, |
|
3905
3e508dd31b76
[gaim-migrate @ 4058]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3902
diff
changeset
|
1052 #else |
| 4052 | 1053 _("Windows usage"), IDLE_SCREENSAVER, |
|
3905
3e508dd31b76
[gaim-migrate @ 4058]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3902
diff
changeset
|
1054 #endif |
| 3366 | 1055 #endif |
| 3427 | 1056 NULL); |
| 1057 gtk_size_group_add_widget(sg, dd); | |
| 1058 gtk_misc_set_alignment(GTK_MISC(dd), 0, 0); | |
|
2385
bdc74764245c
[gaim-migrate @ 2398]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2372
diff
changeset
|
1059 |
| 3427 | 1060 vbox = make_frame (ret, _("Auto-away")); |
| 3818 | 1061 button = gaim_button(_("Set away _when idle"), &away_options, OPT_AWAY_AUTO, vbox); |
| 4052 | 1062 select = gaim_labeled_spin_button(vbox, _("_Minutes before setting away:"), &auto_away, 1, 24 * 60, sg); |
| 3818 | 1063 if (!(away_options & OPT_AWAY_AUTO)) |
| 3366 | 1064 gtk_widget_set_sensitive(GTK_WIDGET(select), FALSE); |
|
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4339
diff
changeset
|
1065 g_signal_connect(GTK_OBJECT(button), "clicked", |
|
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4339
diff
changeset
|
1066 G_CALLBACK(gaim_gtk_toggle_sensitive), select); |
| 1 | 1067 |
| 4052 | 1068 label = gtk_label_new_with_mnemonic(_("Away m_essage:")); |
| 3427 | 1069 gtk_size_group_add_widget(sg, label); |
| 1070 gtk_misc_set_alignment(GTK_MISC(label), 0, 0); | |
| 3366 | 1071 hbox = gtk_hbox_new(FALSE, 0); |
| 1072 gtk_container_add(GTK_CONTAINER(vbox), hbox); | |
| 1073 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); | |
| 1074 prefs_away_menu = gtk_option_menu_new(); | |
| 3427 | 1075 gtk_label_set_mnemonic_widget(GTK_LABEL(label), prefs_away_menu); |
| 3818 | 1076 if (!(away_options & OPT_AWAY_AUTO)) |
| 3366 | 1077 gtk_widget_set_sensitive(GTK_WIDGET(prefs_away_menu), FALSE); |
|
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4339
diff
changeset
|
1078 g_signal_connect(GTK_OBJECT(button), "clicked", |
|
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4339
diff
changeset
|
1079 G_CALLBACK(gaim_gtk_toggle_sensitive), prefs_away_menu); |
| 3366 | 1080 default_away_menu_init(prefs_away_menu); |
| 1081 gtk_widget_show(prefs_away_menu); | |
| 1082 gtk_box_pack_start(GTK_BOX(hbox), prefs_away_menu, FALSE, FALSE, 0); | |
| 3500 | 1083 |
| 3427 | 1084 gtk_widget_show_all(ret); |
| 3366 | 1085 return ret; |
|
873
789df4b47508
[gaim-migrate @ 883]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
864
diff
changeset
|
1086 } |
|
789df4b47508
[gaim-migrate @ 883]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
864
diff
changeset
|
1087 |
| 3551 | 1088 #if USE_PLUGINS |
| 1089 GtkWidget *plugin_description=NULL, *plugin_details=NULL; | |
| 1090 static void prefs_plugin_sel (GtkTreeSelection *sel, GtkTreeModel *model) | |
| 1091 { | |
| 1092 gchar buf[1024]; | |
| 1093 GtkTreeIter iter; | |
| 1094 GValue val = { 0, }; | |
| 1095 struct gaim_plugin *plug; | |
| 1096 | |
| 1097 if (! gtk_tree_selection_get_selected (sel, &model, &iter)) | |
| 1098 return; | |
| 1099 gtk_tree_model_get_value (model, &iter, 2, &val); | |
| 1100 plug = g_value_get_pointer(&val); | |
| 1101 | |
| 3563 | 1102 if (plug->error[0]) |
| 4309 | 1103 g_snprintf(buf, sizeof(buf), "<span size=\"larger\">%s %s</span>\n\n" |
| 3563 | 1104 "<span weight=\"bold\" color=\"red\">%s</span>\n\n" |
| 4309 | 1105 "%s", plug->desc.name, plug->desc.version, plug->error, plug->desc.description); |
| 3563 | 1106 else |
| 4309 | 1107 g_snprintf(buf, sizeof(buf), "<span size=\"larger\">%s %s</span>\n\n" |
| 1108 "%s", plug->desc.name, plug->desc.version, plug->desc.description); | |
| 3551 | 1109 gtk_label_set_markup(GTK_LABEL(plugin_description), buf); |
| 3630 | 1110 g_snprintf(buf, sizeof(buf), |
| 1111 #ifndef _WIN32 | |
| 1112 _("<span size=\"larger\">%s %s</span>\n\n" | |
| 1113 "<span weight=\"bold\">Written by:</span>\t%s\n" | |
| 4617 | 1114 "<span weight=\"bold\">Web site:</span>\t\t%s\n" |
| 3630 | 1115 "<span weight=\"bold\">File name:</span>\t%s"), |
| 1116 #else | |
| 1117 _("<span size=\"larger\">%s %s</span>\n\n" | |
| 1118 "<span weight=\"bold\">Written by:</span> %s\n" | |
| 1119 "<span weight=\"bold\">URL:</span> %s\n" | |
| 1120 "<span weight=\"bold\">File name:</span> %s"), | |
| 1121 #endif | |
| 3551 | 1122 plug->desc.name, plug->desc.version, plug->desc.authors, plug->desc.url, plug->path); |
| 1123 gtk_label_set_markup(GTK_LABEL(plugin_details), buf); | |
| 1124 g_value_unset (&val); | |
| 1125 } | |
| 1126 | |
| 1127 static void plugin_load (GtkCellRendererToggle *cell, gchar *pth, gpointer data) | |
| 1128 { | |
| 1129 GtkTreeModel *model = (GtkTreeModel *)data; | |
| 1130 GtkTreeIter iter; | |
| 1131 GtkTreePath *path = gtk_tree_path_new_from_string(pth); | |
| 1132 struct gaim_plugin *plug; | |
| 1133 gchar buf[1024]; | |
| 3565 | 1134 GtkWidget *(*config)(); |
| 1135 | |
| 3551 | 1136 GdkCursor *wait = gdk_cursor_new (GDK_WATCH); |
| 1137 gdk_window_set_cursor(prefs->window, wait); | |
| 1138 gdk_cursor_unref(wait); | |
| 1139 | |
| 1140 gtk_tree_model_get_iter (model, &iter, path); | |
| 1141 gtk_tree_model_get (model, &iter, 2, &plug, -1); | |
| 1142 | |
| 1143 if (!plug->handle) | |
| 1144 | |
| 1145 if (plug->type == plugin) | |
| 1146 #ifdef GAIM_PLUGINS | |
| 3565 | 1147 { |
| 1148 load_plugin(plug->path); | |
| 1149 if (g_module_symbol(plug->handle, "gaim_plugin_config_gtk", (gpointer *)&config)) { | |
| 1150 plug->iter = g_new0(GtkTreeIter, 1); | |
| 1151 prefs_notebook_add_page(plug->desc.name, NULL, config(), plug->iter, &plugin_iter, notebook_page++); | |
| 3567 | 1152 if (gtk_tree_model_iter_n_children(GTK_TREE_MODEL(prefstree), &plugin_iter) == 1) { |
| 1153 /* Expand the tree for the first plugin added */ | |
| 3630 | 1154 GtkTreePath *path2 = gtk_tree_model_get_path(GTK_TREE_MODEL(prefstree), &plugin_iter); |
| 3567 | 1155 gtk_tree_view_expand_row(GTK_TREE_VIEW(tree_v), path2, TRUE); |
| 1156 gtk_tree_path_free (path2); | |
| 1157 } | |
| 3565 | 1158 } |
| 1159 } | |
| 3551 | 1160 #else |
| 1161 {} | |
| 1162 #endif | |
| 1163 else | |
| 1164 #ifdef USE_PERL | |
| 1165 perl_load_file(plug->path); | |
| 1166 #else | |
| 1167 {} | |
| 1168 #endif | |
| 1169 else | |
| 1170 if (plug->type == plugin) | |
| 1171 #ifdef GAIM_PLUGINS | |
| 3565 | 1172 { |
| 1173 unload_plugin(plug); | |
| 1174 if (plug->iter) { | |
| 1175 gtk_tree_store_remove(GTK_TREE_STORE(prefstree), plug->iter); | |
| 1176 g_free(plug->iter); | |
| 1177 plug->iter = NULL; | |
| 1178 } | |
| 1179 } | |
| 3551 | 1180 #else |
| 1181 {} | |
| 1182 #endif | |
| 1183 else | |
| 1184 #ifdef USE_PERL | |
| 1185 perl_unload_file(plug); | |
| 1186 #else | |
| 1187 {} | |
| 1188 #endif | |
| 1189 gdk_window_set_cursor(prefs->window, NULL); | |
| 3563 | 1190 if (plug->error[0]) |
| 4309 | 1191 g_snprintf(buf, sizeof(buf), "<span size=\"larger\">%s %s</span>\n\n" |
| 3563 | 1192 "<span weight=\"bold\" color=\"red\">%s</span>\n\n" |
| 4309 | 1193 "%s", plug->desc.name, plug->desc.version, plug->error, plug->desc.description); |
| 3563 | 1194 else |
| 4309 | 1195 g_snprintf(buf, sizeof(buf), "<span size=\"larger\">%s %s</span>\n\n" |
| 1196 "%s", plug->desc.name, plug->desc.version, plug->desc.description); | |
| 3563 | 1197 gtk_label_set_markup(GTK_LABEL(plugin_description), buf); |
| 3551 | 1198 gtk_list_store_set (GTK_LIST_STORE (model), &iter, 0, plug->handle, -1); |
| 3563 | 1199 |
| 3551 | 1200 gtk_label_set_markup(GTK_LABEL(plugin_description), buf); |
| 1201 gtk_tree_path_free(path); | |
| 1202 } | |
| 1203 | |
| 1204 static GtkWidget *plugin_page () | |
| 1205 { | |
| 1206 GtkWidget *ret; | |
| 1207 | |
| 1208 GtkWidget *sw, *vp; | |
| 1209 GtkTreeIter iter; | |
| 1210 GtkWidget *event_view; | |
| 1211 GtkListStore *ls; | |
| 1212 GtkCellRenderer *rend, *rendt; | |
| 1213 GtkTreeViewColumn *col; | |
| 1214 GtkTreeSelection *sel; | |
| 1215 GtkTreePath *path; | |
| 1216 | |
| 1217 GtkWidget *nb; | |
| 1218 | |
| 1219 GList *probes = probed_plugins; | |
| 1220 struct gaim_plugin *plug; | |
| 1221 | |
| 1222 ret = gtk_vbox_new(FALSE, 18); | |
| 1223 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
| 1224 | |
| 1225 sw = gtk_scrolled_window_new(NULL,NULL); | |
| 1226 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), GTK_POLICY_NEVER, GTK_POLICY_ALWAYS); | |
| 1227 gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW(sw), GTK_SHADOW_IN); | |
| 1228 | |
| 1229 gtk_box_pack_start(GTK_BOX(ret), sw, TRUE, TRUE, 0); | |
| 1230 | |
| 1231 ls = gtk_list_store_new (3, G_TYPE_BOOLEAN, G_TYPE_STRING, G_TYPE_POINTER); | |
| 1232 while (probes) { | |
| 1233 plug = probes->data; | |
| 1234 gtk_list_store_append (ls, &iter); | |
| 1235 gtk_list_store_set(ls, &iter, | |
| 1236 0, plug->handle, | |
| 1237 1, plug->desc.name ? plug->desc.name : plug->path, | |
| 1238 2, plug, -1); | |
| 1239 probes = probes->next; | |
| 1240 } | |
| 1241 | |
| 1242 event_view = gtk_tree_view_new_with_model (GTK_TREE_MODEL(ls)); | |
| 1243 | |
| 1244 rend = gtk_cell_renderer_toggle_new(); | |
| 1245 sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (event_view)); | |
| 1246 | |
| 1247 | |
| 4295 | 1248 col = gtk_tree_view_column_new_with_attributes (_("Load"), |
| 3551 | 1249 rend, |
| 1250 "active", 0, | |
| 1251 NULL); | |
| 1252 gtk_tree_view_append_column (GTK_TREE_VIEW(event_view), col); | |
| 1253 | |
| 1254 rendt = gtk_cell_renderer_text_new(); | |
| 4295 | 1255 col = gtk_tree_view_column_new_with_attributes (_("Name"), |
| 3551 | 1256 rendt, |
| 1257 "text", 1, | |
| 1258 NULL); | |
| 1259 gtk_tree_view_append_column (GTK_TREE_VIEW(event_view), col); | |
| 1260 g_object_unref(G_OBJECT(ls)); | |
| 1261 gtk_container_add(GTK_CONTAINER(sw), event_view); | |
| 1262 | |
| 1263 | |
| 1264 nb = gtk_notebook_new(); | |
| 1265 gtk_notebook_set_tab_pos (GTK_NOTEBOOK(nb), GTK_POS_BOTTOM); | |
| 1266 gtk_notebook_popup_disable(GTK_NOTEBOOK(nb)); | |
| 1267 | |
| 1268 /* Description */ | |
| 1269 sw = gtk_scrolled_window_new(NULL, NULL); | |
| 1270 gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW(sw), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); | |
| 1271 plugin_description = gtk_label_new(NULL); | |
| 1272 | |
| 1273 vp = gtk_viewport_new(NULL, NULL); | |
| 3630 | 1274 gtk_viewport_set_shadow_type(GTK_VIEWPORT(vp), GTK_SHADOW_NONE); |
| 3551 | 1275 gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW(sw), GTK_SHADOW_NONE); |
| 1276 | |
| 3630 | 1277 gtk_container_add(GTK_CONTAINER(vp), plugin_description); |
| 1278 gtk_container_add(GTK_CONTAINER(sw), vp); | |
| 3551 | 1279 |
| 3630 | 1280 gtk_label_set_selectable(GTK_LABEL(plugin_description), TRUE); |
| 1281 gtk_label_set_line_wrap(GTK_LABEL(plugin_description), TRUE); | |
| 3551 | 1282 gtk_misc_set_alignment(GTK_MISC(plugin_description), 0, 0); |
| 1283 gtk_misc_set_padding(GTK_MISC(plugin_description), 6, 6); | |
| 1284 gtk_notebook_append_page(GTK_NOTEBOOK(nb), sw, gtk_label_new(_("Description"))); | |
| 1285 | |
| 1286 /* Details */ | |
| 1287 sw = gtk_scrolled_window_new(NULL, NULL); | |
| 1288 gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW(sw), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); | |
| 1289 plugin_details = gtk_label_new(NULL); | |
| 1290 | |
| 1291 vp = gtk_viewport_new(NULL, NULL); | |
| 3630 | 1292 gtk_viewport_set_shadow_type(GTK_VIEWPORT(vp), GTK_SHADOW_NONE); |
| 3551 | 1293 gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW(sw), GTK_SHADOW_NONE); |
| 1294 | |
| 3630 | 1295 gtk_container_add(GTK_CONTAINER(vp), plugin_details); |
| 1296 gtk_container_add(GTK_CONTAINER(sw), vp); | |
| 3551 | 1297 |
| 3630 | 1298 gtk_label_set_selectable(GTK_LABEL(plugin_details), TRUE); |
| 1299 gtk_label_set_line_wrap(GTK_LABEL(plugin_details), TRUE); | |
| 3551 | 1300 gtk_misc_set_alignment(GTK_MISC(plugin_details), 0, 0); |
| 1301 gtk_misc_set_padding(GTK_MISC(plugin_details), 6, 6); | |
| 1302 gtk_notebook_append_page(GTK_NOTEBOOK(nb), sw, gtk_label_new(_("Details"))); | |
| 1303 gtk_box_pack_start(GTK_BOX(ret), nb, TRUE, TRUE, 0); | |
| 1304 | |
| 1305 g_signal_connect (G_OBJECT (sel), "changed", | |
| 1306 G_CALLBACK (prefs_plugin_sel), | |
| 1307 NULL); | |
| 1308 g_signal_connect (G_OBJECT(rend), "toggled", | |
| 1309 G_CALLBACK(plugin_load), ls); | |
| 1310 | |
| 1311 path = gtk_tree_path_new_first(); | |
| 1312 gtk_tree_selection_select_path(sel, path); | |
| 1313 gtk_tree_path_free(path); | |
| 1314 | |
| 1315 gtk_widget_show_all(ret); | |
| 1316 return ret; | |
| 1317 } | |
| 1318 #endif | |
| 1319 | |
| 3366 | 1320 static void event_toggled (GtkCellRendererToggle *cell, gchar *pth, gpointer data) |
|
873
789df4b47508
[gaim-migrate @ 883]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
864
diff
changeset
|
1321 { |
| 3366 | 1322 GtkTreeModel *model = (GtkTreeModel *)data; |
| 1323 GtkTreeIter iter; | |
| 1324 GtkTreePath *path = gtk_tree_path_new_from_string(pth); | |
| 3500 | 1325 gint soundnum; |
| 3366 | 1326 |
| 1327 gtk_tree_model_get_iter (model, &iter, path); | |
| 1328 gtk_tree_model_get (model, &iter, 2, &soundnum, -1); | |
|
873
789df4b47508
[gaim-migrate @ 883]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
864
diff
changeset
|
1329 |
| 4561 | 1330 sound_options ^= gaim_sound_get_event_option(soundnum); |
| 1331 gtk_list_store_set (GTK_LIST_STORE (model), &iter, 0, sound_options & gaim_sound_get_event_option(soundnum), -1); | |
| 3522 | 1332 |
| 1333 gtk_tree_path_free(path); | |
| 3366 | 1334 } |
| 1335 | |
| 1336 static void test_sound(GtkWidget *button, gpointer i_am_NULL) | |
| 1337 { | |
| 1338 guint32 tmp_sound = sound_options; | |
| 1339 if (!(sound_options & OPT_SOUND_WHEN_AWAY)) | |
| 1340 sound_options ^= OPT_SOUND_WHEN_AWAY; | |
| 4561 | 1341 if (!(sound_options & gaim_sound_get_event_option(sound_row_sel))) |
| 1342 sound_options ^= gaim_sound_get_event_option(sound_row_sel); | |
| 1343 gaim_sound_play_event(sound_row_sel); | |
| 3500 | 1344 |
| 3366 | 1345 sound_options = tmp_sound; |
|
873
789df4b47508
[gaim-migrate @ 883]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
864
diff
changeset
|
1346 } |
|
789df4b47508
[gaim-migrate @ 883]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
864
diff
changeset
|
1347 |
| 3366 | 1348 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
|
1349 { |
| 3366 | 1350 /* This just resets a sound file back to default */ |
| 4561 | 1351 gaim_sound_set_event_file(sound_row_sel, NULL); |
|
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1352 |
| 3366 | 1353 gtk_entry_set_text(GTK_ENTRY(sound_entry), "(default)"); |
|
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1354 } |
|
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1355 |
|
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1356 void close_sounddialog(GtkWidget *w, GtkWidget *w2) |
| 1170 | 1357 { |
| 1358 | |
| 1359 GtkWidget *dest; | |
|
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1360 |
| 1170 | 1361 if (!GTK_IS_WIDGET(w2)) |
| 1362 dest = w; | |
| 1363 else | |
| 1364 dest = w2; | |
| 1365 | |
| 1366 sounddialog = NULL; | |
| 1367 | |
| 1368 gtk_widget_destroy(dest); | |
| 1369 } | |
| 1370 | |
|
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1371 void do_select_sound(GtkWidget *w, int snd) |
|
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1372 { |
|
1953
f0ff0b367e3d
[gaim-migrate @ 1963]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1930
diff
changeset
|
1373 const char *file; |
|
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1374 |
| 1170 | 1375 file = gtk_file_selection_get_filename(GTK_FILE_SELECTION(sounddialog)); |
| 1376 | |
| 1377 /* If they type in a directory, change there */ | |
| 1378 if (file_is_dir(file, sounddialog)) | |
| 1379 return; | |
| 1380 | |
| 1381 /* Set it -- and forget it */ | |
| 4561 | 1382 gaim_sound_set_event_file(snd, file); |
| 3500 | 1383 |
| 1175 | 1384 /* Set our text entry */ |
| 4561 | 1385 gtk_entry_set_text(GTK_ENTRY(sound_entry), file); |
|
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1386 |
| 1170 | 1387 /* Close the window! It's getting cold in here! */ |
| 1388 close_sounddialog(NULL, sounddialog); | |
|
2471
612efbf62c35
[gaim-migrate @ 2484]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2385
diff
changeset
|
1389 |
|
612efbf62c35
[gaim-migrate @ 2484]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2385
diff
changeset
|
1390 if (last_sound_dir) |
|
612efbf62c35
[gaim-migrate @ 2484]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2385
diff
changeset
|
1391 g_free(last_sound_dir); |
| 4793 | 1392 last_sound_dir = g_path_get_dirname(file); |
| 1170 | 1393 } |
| 1394 | |
| 3366 | 1395 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
|
1396 { |
| 1170 | 1397 char *buf = g_malloc(BUF_LEN); |
|
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1398 |
|
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1399 if (!sounddialog) { |
| 4703 | 1400 sounddialog = gtk_file_selection_new(_("Sound Selection")); |
| 1170 | 1401 |
| 1402 gtk_file_selection_hide_fileop_buttons(GTK_FILE_SELECTION(sounddialog)); | |
| 1403 | |
| 3630 | 1404 g_snprintf(buf, BUF_LEN - 1, "%s" G_DIR_SEPARATOR_S, last_sound_dir ? last_sound_dir : gaim_home_dir()); |
| 1170 | 1405 |
| 1406 gtk_file_selection_set_filename(GTK_FILE_SELECTION(sounddialog), buf); | |
| 1407 | |
|
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
1408 g_signal_connect(GTK_OBJECT(sounddialog), "destroy", |
|
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
1409 G_CALLBACK(close_sounddialog), sounddialog); |
| 1170 | 1410 |
|
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
1411 g_signal_connect(GTK_OBJECT(GTK_FILE_SELECTION(sounddialog)->ok_button), |
|
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
1412 "clicked", G_CALLBACK(do_select_sound), (int *)sound_row_sel); |
| 1170 | 1413 |
|
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
1414 g_signal_connect(GTK_OBJECT(GTK_FILE_SELECTION(sounddialog)->cancel_button), |
|
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
1415 "clicked", G_CALLBACK(close_sounddialog), sounddialog); |
| 1170 | 1416 } |
| 1417 | |
| 1418 g_free(buf); | |
| 1419 gtk_widget_show(sounddialog); | |
| 1420 gdk_window_raise(sounddialog->window); | |
|
1006
0a4d0ed65e17
[gaim-migrate @ 1016]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
1421 } |
|
0a4d0ed65e17
[gaim-migrate @ 1016]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
1422 |
| 3366 | 1423 |
| 1424 static void prefs_sound_sel (GtkTreeSelection *sel, GtkTreeModel *model) { | |
| 1425 GtkTreeIter iter; | |
| 1426 GValue val = { 0, }; | |
| 4561 | 1427 char *file; |
| 3500 | 1428 |
| 3366 | 1429 if (! gtk_tree_selection_get_selected (sel, &model, &iter)) |
| 1430 return; | |
| 1431 gtk_tree_model_get_value (model, &iter, 2, &val); | |
| 1432 sound_row_sel = g_value_get_uint(&val); | |
| 4561 | 1433 file = gaim_sound_get_event_file(sound_row_sel); |
| 3366 | 1434 if (sound_entry) |
| 4561 | 1435 gtk_entry_set_text(GTK_ENTRY(sound_entry), file ? file : "(default)"); |
| 3366 | 1436 g_value_unset (&val); |
| 1437 if (sounddialog) | |
| 1438 gtk_widget_destroy(sounddialog); | |
| 1439 } | |
| 1440 | |
| 1441 GtkWidget *sound_events_page() { | |
| 1442 | |
| 1443 GtkWidget *ret; | |
| 1444 GtkWidget *sw; | |
| 1445 GtkWidget *button, *hbox; | |
| 1446 GtkTreeIter iter; | |
| 1447 GtkWidget *event_view; | |
| 1448 GtkListStore *event_store; | |
| 1449 GtkCellRenderer *rend; | |
| 1450 GtkTreeViewColumn *col; | |
| 1451 GtkTreeSelection *sel; | |
| 1452 GtkTreePath *path; | |
| 1453 int j; | |
| 4561 | 1454 char *file; |
| 3366 | 1455 |
| 3427 | 1456 ret = gtk_vbox_new(FALSE, 18); |
| 1457 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
| 3366 | 1458 |
| 1459 sw = gtk_scrolled_window_new(NULL,NULL); | |
| 1460 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC); | |
| 3814 | 1461 gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW(sw), GTK_SHADOW_IN); |
| 1462 | |
| 3427 | 1463 gtk_box_pack_start(GTK_BOX(ret), sw, TRUE, TRUE, 0); |
| 3366 | 1464 event_store = gtk_list_store_new (3, G_TYPE_BOOLEAN, G_TYPE_STRING, G_TYPE_UINT); |
| 1465 | |
| 4561 | 1466 for (j=0; j < GAIM_NUM_SOUNDS; j++) { |
| 1467 guint opt = gaim_sound_get_event_option(j); | |
| 1468 if (opt == 0) | |
| 3366 | 1469 continue; |
| 3500 | 1470 |
| 3366 | 1471 gtk_list_store_append (event_store, &iter); |
| 1472 gtk_list_store_set(event_store, &iter, | |
| 4561 | 1473 0, sound_options & opt, |
| 1474 1, gettext(gaim_sound_get_event_label(j)), | |
| 3366 | 1475 2, j, -1); |
| 1476 } | |
| 1477 | |
| 1478 event_view = gtk_tree_view_new_with_model (GTK_TREE_MODEL(event_store)); | |
| 3500 | 1479 |
| 3366 | 1480 rend = gtk_cell_renderer_toggle_new(); |
| 1481 sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (event_view)); | |
| 1482 g_signal_connect (G_OBJECT (sel), "changed", | |
| 1483 G_CALLBACK (prefs_sound_sel), | |
| 1484 NULL); | |
| 1485 g_signal_connect (G_OBJECT(rend), "toggled", | |
| 1486 G_CALLBACK(event_toggled), event_store); | |
| 1487 path = gtk_tree_path_new_first(); | |
| 1488 gtk_tree_selection_select_path(sel, path); | |
| 3522 | 1489 gtk_tree_path_free(path); |
| 3500 | 1490 |
| 4295 | 1491 col = gtk_tree_view_column_new_with_attributes (_("Play"), |
| 3366 | 1492 rend, |
| 1493 "active", 0, | |
| 1494 NULL); | |
| 1495 gtk_tree_view_append_column (GTK_TREE_VIEW(event_view), col); | |
| 1496 | |
| 1497 rend = gtk_cell_renderer_text_new(); | |
| 4295 | 1498 col = gtk_tree_view_column_new_with_attributes (_("Event"), |
| 3366 | 1499 rend, |
| 1500 "text", 1, | |
| 1501 NULL); | |
| 1502 gtk_tree_view_append_column (GTK_TREE_VIEW(event_view), col); | |
| 3500 | 1503 g_object_unref(G_OBJECT(event_store)); |
| 3366 | 1504 gtk_container_add(GTK_CONTAINER(sw), event_view); |
| 1505 | |
| 3427 | 1506 hbox = gtk_hbox_new(FALSE, 6); |
| 1507 gtk_box_pack_start(GTK_BOX(ret), hbox, FALSE, FALSE, 0); | |
| 3366 | 1508 sound_entry = gtk_entry_new(); |
| 4561 | 1509 file = gaim_sound_get_event_file(0); |
| 1510 gtk_entry_set_text(GTK_ENTRY(sound_entry), file ? file : "(default)"); | |
| 4635 | 1511 gtk_editable_set_editable(GTK_EDITABLE(sound_entry), FALSE); |
| 3366 | 1512 gtk_box_pack_start(GTK_BOX(hbox), sound_entry, FALSE, FALSE, 5); |
|
1006
0a4d0ed65e17
[gaim-migrate @ 1016]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
1513 |
| 3025 | 1514 button = gtk_button_new_with_label(_("Test")); |
|
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
1515 g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(test_sound), NULL); |
| 3366 | 1516 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
|
1517 |
| 1175 | 1518 button = gtk_button_new_with_label(_("Reset")); |
|
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
1519 g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(reset_sound), NULL); |
| 3366 | 1520 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 1); |
| 1175 | 1521 |
| 1381 | 1522 button = gtk_button_new_with_label(_("Choose...")); |
|
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
1523 g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(sel_sound), NULL); |
| 3366 | 1524 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 1); |
| 3500 | 1525 |
| 3427 | 1526 gtk_widget_show_all (ret); |
|
1006
0a4d0ed65e17
[gaim-migrate @ 1016]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
1527 |
| 3366 | 1528 return ret; |
|
2580
86eaeb064e82
[gaim-migrate @ 2593]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2566
diff
changeset
|
1529 } |
|
86eaeb064e82
[gaim-migrate @ 2593]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2566
diff
changeset
|
1530 |
| 3366 | 1531 void away_message_sel(GtkTreeSelection *sel, GtkTreeModel *model) |
|
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1532 { |
| 3366 | 1533 GtkTreeIter iter; |
| 1534 GValue val = { 0, }; | |
|
1780
d7cbedd1d651
[gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1773
diff
changeset
|
1535 gchar buffer[BUF_LONG]; |
|
d7cbedd1d651
[gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1773
diff
changeset
|
1536 char *tmp; |
| 3374 | 1537 struct away_message *am; |
|
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1538 |
| 3366 | 1539 if (! gtk_tree_selection_get_selected (sel, &model, &iter)) |
| 1540 return; | |
| 1541 gtk_tree_model_get_value (model, &iter, 1, &val); | |
| 3374 | 1542 am = g_value_get_pointer(&val); |
|
1780
d7cbedd1d651
[gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1773
diff
changeset
|
1543 gtk_imhtml_clear(GTK_IMHTML(away_text)); |
| 3374 | 1544 strncpy(buffer, am->message, BUF_LONG); |
|
1780
d7cbedd1d651
[gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1773
diff
changeset
|
1545 tmp = stylize(buffer, BUF_LONG); |
|
2856
b1e300a85678
[gaim-migrate @ 2869]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2843
diff
changeset
|
1546 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
|
1547 GTK_IMHTML_NO_COMMENTS | GTK_IMHTML_NO_SCROLL); |
|
2856
b1e300a85678
[gaim-migrate @ 2869]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2843
diff
changeset
|
1548 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
|
1549 GTK_IMHTML_NO_COMMENTS | GTK_IMHTML_NO_SCROLL); |
|
1780
d7cbedd1d651
[gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1773
diff
changeset
|
1550 g_free(tmp); |
| 3366 | 1551 g_value_unset (&val); |
| 3500 | 1552 |
|
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1553 } |
|
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1554 |
| 3500 | 1555 void remove_away_message(GtkWidget *widget, GtkTreeView *tv) { |
| 3366 | 1556 struct away_message *am; |
| 1557 GtkTreeIter iter; | |
| 1558 GtkTreeSelection *sel = gtk_tree_view_get_selection(tv); | |
| 3379 | 1559 GtkTreeModel *model = GTK_TREE_MODEL(prefs_away_store); |
| 3366 | 1560 GValue val = { 0, }; |
| 3500 | 1561 |
| 3379 | 1562 if (! gtk_tree_selection_get_selected (sel, &model, &iter)) |
| 3366 | 1563 return; |
| 3379 | 1564 gtk_tree_model_get_value (GTK_TREE_MODEL(prefs_away_store), &iter, 1, &val); |
| 3366 | 1565 am = g_value_get_pointer (&val); |
| 1566 gtk_imhtml_clear(GTK_IMHTML(away_text)); | |
| 1567 rem_away_mess(NULL, am); | |
|
1109
c73736fa0b7c
[gaim-migrate @ 1119]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1087
diff
changeset
|
1568 } |
|
c73736fa0b7c
[gaim-migrate @ 1119]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1087
diff
changeset
|
1569 |
| 3366 | 1570 GtkWidget *away_message_page() { |
| 1571 GtkWidget *ret; | |
| 3427 | 1572 GtkWidget *hbox; |
| 3379 | 1573 GtkWidget *button; |
|
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1574 GtkWidget *sw; |
| 3366 | 1575 GtkTreeIter iter; |
| 1576 GtkWidget *event_view; | |
| 1577 GtkCellRenderer *rend; | |
| 1578 GtkTreeViewColumn *col; | |
| 1579 GtkTreeSelection *sel; | |
| 940 | 1580 GSList *awy = away_messages; |
|
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1581 struct away_message *a; |
| 3366 | 1582 GtkWidget *sw2; |
| 3427 | 1583 GtkSizeGroup *sg; |
|
1780
d7cbedd1d651
[gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1773
diff
changeset
|
1584 |
| 3427 | 1585 ret = gtk_vbox_new(FALSE, 18); |
| 1586 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
| 1587 | |
| 1588 sg = gtk_size_group_new(GTK_SIZE_GROUP_BOTH); | |
| 3500 | 1589 |
| 3366 | 1590 sw = gtk_scrolled_window_new(NULL,NULL); |
| 1591 away_text = gtk_imhtml_new(NULL, NULL); | |
| 3427 | 1592 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), GTK_POLICY_NEVER, GTK_POLICY_ALWAYS); |
| 3817 | 1593 /* |
| 1594 gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(sw), GTK_SHADOW_IN); | |
| 1595 */ | |
| 3427 | 1596 gtk_box_pack_start(GTK_BOX(ret), sw, TRUE, TRUE, 0); |
| 3500 | 1597 |
| 3374 | 1598 prefs_away_store = gtk_list_store_new (2, G_TYPE_STRING, G_TYPE_POINTER); |
| 3366 | 1599 while (awy) { |
| 1600 a = (struct away_message *)awy->data; | |
| 1601 gtk_list_store_append (prefs_away_store, &iter); | |
| 1602 gtk_list_store_set(prefs_away_store, &iter, | |
| 3374 | 1603 0, a->name, |
| 1604 1, a, -1); | |
| 3366 | 1605 awy = awy->next; |
| 1606 } | |
| 1607 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
|
1608 |
|
2906
538c58b43eff
[gaim-migrate @ 2919]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2856
diff
changeset
|
1609 |
| 3366 | 1610 rend = gtk_cell_renderer_text_new(); |
| 1611 col = gtk_tree_view_column_new_with_attributes ("NULL", | |
| 1612 rend, | |
| 1613 "text", 0, | |
| 1614 NULL); | |
| 1615 gtk_tree_view_append_column (GTK_TREE_VIEW(event_view), col); | |
| 1616 gtk_tree_view_set_headers_visible (GTK_TREE_VIEW(event_view), FALSE); | |
| 1617 gtk_widget_show(event_view); | |
| 3427 | 1618 gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(sw), event_view); |
| 3374 | 1619 |
|
1780
d7cbedd1d651
[gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1773
diff
changeset
|
1620 sw2 = gtk_scrolled_window_new(NULL, NULL); |
|
d7cbedd1d651
[gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1773
diff
changeset
|
1621 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw2), |
|
d7cbedd1d651
[gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1773
diff
changeset
|
1622 GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS); |
| 3427 | 1623 gtk_box_pack_start(GTK_BOX(ret), sw2, TRUE, TRUE, 0); |
| 3500 | 1624 |
| 3427 | 1625 gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(sw2), away_text); |
|
1815
f15d449b3167
[gaim-migrate @ 1825]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1813
diff
changeset
|
1626 gaim_setup_imhtml(away_text); |
| 3366 | 1627 sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (event_view)); |
| 1628 g_signal_connect (G_OBJECT (sel), "changed", | |
| 1629 G_CALLBACK (away_message_sel), | |
| 1630 NULL); | |
| 1631 hbox = gtk_hbox_new(TRUE, 5); | |
| 3427 | 1632 gtk_box_pack_start(GTK_BOX(ret), hbox, FALSE, FALSE, 0); |
| 3366 | 1633 button = gtk_button_new_from_stock (GTK_STOCK_ADD); |
| 1634 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0); | |
| 3427 | 1635 gtk_size_group_add_widget(sg, button); |
|
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
1636 g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(create_away_mess), NULL); |
| 3472 | 1637 |
| 3366 | 1638 button = gtk_button_new_from_stock (GTK_STOCK_REMOVE); |
| 3427 | 1639 gtk_size_group_add_widget(sg, button); |
|
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
1640 g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(remove_away_message), event_view); |
| 3472 | 1641 |
| 3366 | 1642 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0); |
| 3472 | 1643 |
| 3649 | 1644 button = gaim_pixbuf_button(_("_Edit"), "edit.png", GAIM_BUTTON_HORIZONTAL); |
| 3427 | 1645 gtk_size_group_add_widget(sg, button); |
|
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
1646 g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(create_away_mess), event_view); |
| 3366 | 1647 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0); |
| 3500 | 1648 |
| 3427 | 1649 gtk_widget_show_all(ret); |
| 3366 | 1650 return ret; |
| 1651 } | |
| 3472 | 1652 |
| 3500 | 1653 GtkTreeIter *prefs_notebook_add_page(char *text, |
| 1654 GdkPixbuf *pixbuf, | |
| 1655 GtkWidget *page, | |
| 3366 | 1656 GtkTreeIter *iter, |
| 3500 | 1657 GtkTreeIter *parent, |
| 3366 | 1658 int ind) { |
| 1659 GdkPixbuf *icon = NULL; | |
| 3500 | 1660 |
| 3366 | 1661 if (pixbuf) |
| 3500 | 1662 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
|
1663 |
| 3366 | 1664 gtk_tree_store_append (prefstree, iter, parent); |
| 1665 gtk_tree_store_set (prefstree, iter, 0, icon, 1, text, 2, ind, -1); | |
| 3500 | 1666 |
| 3366 | 1667 if (pixbuf) |
| 1668 g_object_unref(pixbuf); | |
| 1669 if (icon) | |
| 1670 g_object_unref(icon); | |
| 1671 gtk_notebook_append_page(GTK_NOTEBOOK(prefsnotebook), page, gtk_label_new(text)); | |
| 1672 return iter; | |
|
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1673 } |
|
1124
a70d5200edde
[gaim-migrate @ 1134]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1123
diff
changeset
|
1674 |
| 3366 | 1675 void prefs_notebook_init() { |
|
4469
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
1676 GtkTreeIter p, p2, c; |
| 3565 | 1677 #if USE_PLUGINS |
| 1678 GtkWidget *(*config)(); | |
| 1679 GList *l = plugins; | |
| 1680 struct gaim_plugin *plug; | |
| 1681 #endif | |
| 1682 prefs_notebook_add_page(_("Interface"), NULL, interface_page(), &p, NULL, notebook_page++); | |
| 4620 | 1683 prefs_notebook_add_page(_("Smiley Themes"), NULL, theme_page(), &c, &p, notebook_page++); |
| 3565 | 1684 prefs_notebook_add_page(_("Fonts"), NULL, font_page(), &c, &p, notebook_page++); |
| 1685 prefs_notebook_add_page(_("Message Text"), NULL, messages_page(), &c, &p, notebook_page++); | |
| 1686 prefs_notebook_add_page(_("Shortcuts"), NULL, hotkeys_page(), &c, &p, notebook_page++); | |
| 1687 prefs_notebook_add_page(_("Buddy List"), NULL, list_page(), &c, &p, notebook_page++); | |
| 4488 | 1688 prefs_notebook_add_page(_("Conversations"), NULL, conv_page(), &p2, NULL, notebook_page++); |
|
4469
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
1689 prefs_notebook_add_page(_("IMs"), NULL, im_page(), &c, &p2, notebook_page++); |
|
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
1690 prefs_notebook_add_page(_("Chats"), NULL, chat_page(), &c, &p2, notebook_page++); |
|
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
1691 prefs_notebook_add_page(_("Tabs"), NULL, tab_page(), &c, &p2, notebook_page++); |
| 3565 | 1692 prefs_notebook_add_page(_("Proxy"), NULL, proxy_page(), &p, NULL, notebook_page++); |
|
4461
75ff69e592cc
[gaim-migrate @ 4736]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4451
diff
changeset
|
1693 #ifndef _WIN32 |
|
75ff69e592cc
[gaim-migrate @ 4736]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4451
diff
changeset
|
1694 /* We use the registered default browser in windows */ |
| 3565 | 1695 prefs_notebook_add_page(_("Browser"), NULL, browser_page(), &p, NULL, notebook_page++); |
|
4461
75ff69e592cc
[gaim-migrate @ 4736]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4451
diff
changeset
|
1696 #endif |
| 3565 | 1697 prefs_notebook_add_page(_("Logging"), NULL, logging_page(), &p, NULL, notebook_page++); |
| 1698 prefs_notebook_add_page(_("Sounds"), NULL, sound_page(), &p, NULL, notebook_page++); | |
| 1699 prefs_notebook_add_page(_("Sound Events"), NULL, sound_events_page(), &c, &p, notebook_page++); | |
| 1700 prefs_notebook_add_page(_("Away / Idle"), NULL, away_page(), &p, NULL, notebook_page++); | |
| 1701 prefs_notebook_add_page(_("Away Messages"), NULL, away_message_page(), &c, &p, notebook_page++); | |
| 3551 | 1702 #if USE_PLUGINS |
| 3565 | 1703 prefs_notebook_add_page(_("Plugins"), NULL, plugin_page(), &plugin_iter, NULL, notebook_page++); |
| 1704 while (l) { | |
| 1705 plug = l->data; | |
| 1706 if (plug->type == plugin && g_module_symbol(plug->handle, "gaim_plugin_config_gtk", (gpointer *)&config)) { | |
| 1707 plug->iter = g_new0(GtkTreeIter, 1); | |
| 1708 prefs_notebook_add_page(plug->desc.name, NULL, config(), plug->iter, &plugin_iter, notebook_page++); | |
| 1709 } | |
| 1710 l = l->next; | |
| 1711 } | |
| 3551 | 1712 #endif |
|
1124
a70d5200edde
[gaim-migrate @ 1134]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1123
diff
changeset
|
1713 } |
|
a70d5200edde
[gaim-migrate @ 1134]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1123
diff
changeset
|
1714 |
| 3500 | 1715 void show_prefs() |
|
1124
a70d5200edde
[gaim-migrate @ 1134]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1123
diff
changeset
|
1716 { |
| 3366 | 1717 GtkWidget *vbox, *vbox2; |
|
1124
a70d5200edde
[gaim-migrate @ 1134]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1123
diff
changeset
|
1718 GtkWidget *hbox; |
| 3366 | 1719 GtkWidget *frame; |
| 1720 GtkTreeViewColumn *column; | |
| 1721 GtkCellRenderer *cell; | |
| 1722 GtkTreeSelection *sel; | |
| 1723 GtkWidget *notebook; | |
| 1724 GtkWidget *sep; | |
|
1124
a70d5200edde
[gaim-migrate @ 1134]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1123
diff
changeset
|
1725 GtkWidget *button; |
| 3515 | 1726 GtkSizeGroup *sg = gtk_size_group_new(GTK_SIZE_GROUP_BOTH); |
| 3500 | 1727 |
|
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1728 if (prefs) { |
| 3472 | 1729 gtk_window_present(GTK_WINDOW(prefs)); |
|
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1730 return; |
|
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1731 } |
|
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1732 |
| 3366 | 1733 /* copy the preferences to tmp values... |
| 1734 * I liked "take affect immediately" Oh well :-( */ | |
| 3818 | 1735 |
| 1736 /* Back to instant-apply! I win! BU-HAHAHA! */ | |
| 3500 | 1737 |
| 3366 | 1738 /* Create the window */ |
|
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1739 prefs = gtk_window_new(GTK_WINDOW_TOPLEVEL); |
| 4074 | 1740 gtk_window_set_role(GTK_WINDOW(prefs), "preferences"); |
|
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1741 gtk_widget_realize(prefs); |
| 4703 | 1742 gtk_window_set_title(GTK_WINDOW(prefs), _("Preferences")); |
| 4635 | 1743 gtk_window_set_resizable (GTK_WINDOW(prefs), FALSE); |
|
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
1744 g_signal_connect(GTK_OBJECT(prefs), "destroy", G_CALLBACK(delete_prefs), NULL); |
|
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1745 |
|
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1746 vbox = gtk_vbox_new(FALSE, 5); |
| 4635 | 1747 gtk_container_set_border_width(GTK_CONTAINER(vbox), 5); |
|
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1748 gtk_container_add(GTK_CONTAINER(prefs), vbox); |
|
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1749 gtk_widget_show(vbox); |
|
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1750 |
| 3366 | 1751 hbox = gtk_hbox_new (FALSE, 6); |
| 1752 gtk_container_set_border_width (GTK_CONTAINER (hbox), 6); | |
| 1753 gtk_container_add (GTK_CONTAINER(vbox), hbox); | |
| 1754 gtk_widget_show (hbox); | |
| 1755 | |
| 1756 frame = gtk_frame_new (NULL); | |
| 1757 gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN); | |
| 1758 gtk_box_pack_start (GTK_BOX (hbox), frame, FALSE, FALSE, 0); | |
| 1759 gtk_widget_show (frame); | |
| 3500 | 1760 |
| 3366 | 1761 /* The tree -- much inspired by the Gimp */ |
| 1762 prefstree = gtk_tree_store_new (3, GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_INT); | |
| 1763 tree_v = gtk_tree_view_new_with_model (GTK_TREE_MODEL (prefstree)); | |
| 1764 gtk_container_add (GTK_CONTAINER (frame), tree_v); | |
| 1765 | |
| 1766 gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (tree_v), FALSE); | |
| 1767 gtk_widget_show(tree_v); | |
| 1768 /* icons */ | |
| 4892 | 1769 /* XXX: to be used at a later date |
| 3366 | 1770 cell = gtk_cell_renderer_pixbuf_new (); |
| 1771 column = gtk_tree_view_column_new_with_attributes ("icons", cell, "pixbuf", 0, NULL); | |
| 4892 | 1772 */ |
| 3500 | 1773 |
| 3366 | 1774 /* text */ |
| 1775 cell = gtk_cell_renderer_text_new (); | |
| 1776 column = gtk_tree_view_column_new_with_attributes ("text", cell, "text", 1, NULL); | |
| 3500 | 1777 |
| 3366 | 1778 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
|
1779 |
| 3472 | 1780 /* The right side */ |
| 1781 frame = gtk_frame_new (NULL); | |
| 1782 gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN); | |
| 1783 gtk_box_pack_start (GTK_BOX (hbox), frame, TRUE, TRUE, 0); | |
| 1784 gtk_widget_show (frame); | |
| 3500 | 1785 |
| 3472 | 1786 vbox2 = gtk_vbox_new (FALSE, 4); |
| 1787 gtk_container_add (GTK_CONTAINER (frame), vbox2); | |
| 1788 gtk_widget_show (vbox2); | |
| 3500 | 1789 |
| 3472 | 1790 frame = gtk_frame_new (NULL); |
| 1791 gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_OUT); | |
| 1792 gtk_box_pack_start (GTK_BOX (vbox2), frame, FALSE, TRUE, 0); | |
| 1793 gtk_widget_show (frame); | |
| 3500 | 1794 |
| 3472 | 1795 hbox = gtk_hbox_new (FALSE, 4); |
| 1796 gtk_container_set_border_width (GTK_CONTAINER (hbox), 4); | |
| 1797 gtk_container_add (GTK_CONTAINER (frame), hbox); | |
| 1798 gtk_widget_show (hbox); | |
| 3500 | 1799 |
| 3472 | 1800 preflabel = gtk_label_new(NULL); |
| 1801 gtk_box_pack_end (GTK_BOX (hbox), preflabel, FALSE, FALSE, 0); | |
| 1802 gtk_widget_show (preflabel); | |
| 3500 | 1803 |
| 3472 | 1804 /* The notebook */ |
| 1805 prefsnotebook = notebook = gtk_notebook_new (); | |
| 1806 gtk_notebook_set_show_tabs (GTK_NOTEBOOK (notebook), FALSE); | |
| 1807 gtk_notebook_set_show_border (GTK_NOTEBOOK (notebook), FALSE); | |
| 1808 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
|
1809 |
| 3472 | 1810 sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (tree_v)); |
| 1811 g_signal_connect (G_OBJECT (sel), "changed", | |
| 1812 G_CALLBACK (pref_nb_select), | |
| 1813 notebook); | |
| 3500 | 1814 gtk_widget_show(notebook); |
| 3472 | 1815 sep = gtk_hseparator_new(); |
| 1816 gtk_widget_show(sep); | |
| 1817 gtk_box_pack_start (GTK_BOX (vbox), sep, FALSE, FALSE, 0); | |
| 3500 | 1818 |
| 3818 | 1819 /* The buttons^H to press! */ |
| 3472 | 1820 hbox = gtk_hbox_new (FALSE, 6); |
| 1821 gtk_container_set_border_width (GTK_CONTAINER (hbox), 6); | |
| 1822 gtk_container_add (GTK_CONTAINER(vbox), hbox); | |
| 3500 | 1823 gtk_widget_show (hbox); |
| 3377 | 1824 |
| 3818 | 1825 button = gtk_button_new_from_stock (GTK_STOCK_CLOSE); |
| 3515 | 1826 gtk_size_group_add_widget(sg, button); |
|
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
1827 g_signal_connect_swapped(GTK_OBJECT(button), "clicked", G_CALLBACK(gtk_widget_destroy), prefs); |
| 3515 | 1828 gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0); |
| 1829 gtk_widget_show(button); | |
| 1830 | |
| 3500 | 1831 prefs_notebook_init(); |
| 3427 | 1832 |
| 3472 | 1833 gtk_tree_view_expand_all (GTK_TREE_VIEW(tree_v)); |
| 1834 gtk_widget_show(prefs); | |
|
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1835 } |
|
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1836 |
|
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1837 static gint debug_delete(GtkWidget *w, GdkEvent *event, void *dummy) |
|
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1838 { |
|
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1839 if (debugbutton) |
|
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1840 gtk_button_clicked(GTK_BUTTON(debugbutton)); |
|
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1841 if (misc_options & OPT_MISC_DEBUG) { |
| 3818 | 1842 misc_options ^= OPT_MISC_DEBUG; |
|
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1843 } |
|
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1844 g_free(dw); |
|
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1845 dw = NULL; |
| 4788 | 1846 save_prefs(); |
|
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1847 return FALSE; |
| 1 | 1848 } |
| 1849 | |
|
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1850 static void build_debug() |
|
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1851 { |
| 4005 | 1852 GtkWidget *sw; |
| 1853 GtkTextBuffer *buffer; | |
| 1854 GtkTextIter end; | |
| 1855 | |
|
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1856 if (!dw) |
|
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1857 dw = g_new0(struct debug_window, 1); |
|
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1858 |
|
2725
f3c094e78609
[gaim-migrate @ 2738]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2676
diff
changeset
|
1859 GAIM_DIALOG(dw->window); |
| 4005 | 1860 gtk_window_set_default_size(GTK_WINDOW(dw->window), 500, 200); |
| 1861 gtk_window_set_role(GTK_WINDOW(dw->window), "debug"); | |
| 4703 | 1862 gtk_window_set_title(GTK_WINDOW(dw->window), _("Debug Window")); |
| 4005 | 1863 g_signal_connect(G_OBJECT(dw->window), "delete_event", G_CALLBACK(debug_delete), NULL); |
|
2282
0dea5214d63f
[gaim-migrate @ 2292]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2269
diff
changeset
|
1864 |
| 4005 | 1865 sw = gtk_scrolled_window_new(NULL, NULL); |
| 1866 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), | |
| 1867 GTK_POLICY_NEVER, | |
| 1868 GTK_POLICY_ALWAYS); | |
|
2282
0dea5214d63f
[gaim-migrate @ 2292]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2269
diff
changeset
|
1869 |
| 4005 | 1870 dw->entry = gtk_text_view_new(); |
| 1871 gtk_text_view_set_cursor_visible(GTK_TEXT_VIEW(dw->entry), FALSE); | |
| 1872 gtk_text_view_set_editable(GTK_TEXT_VIEW(dw->entry), FALSE); | |
| 1873 gtk_text_view_set_wrap_mode(GTK_TEXT_VIEW(dw->entry), GTK_WRAP_WORD); | |
|
2282
0dea5214d63f
[gaim-migrate @ 2292]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2269
diff
changeset
|
1874 |
| 4005 | 1875 buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(dw->entry)); |
| 1876 gtk_text_buffer_get_end_iter(buffer, &end); | |
| 1877 gtk_text_buffer_create_mark(buffer, "end", &end, FALSE); | |
|
2282
0dea5214d63f
[gaim-migrate @ 2292]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2269
diff
changeset
|
1878 |
| 4005 | 1879 gtk_container_add(GTK_CONTAINER(sw), dw->entry); |
| 1880 gtk_container_add(GTK_CONTAINER(dw->window), sw); | |
| 1881 gtk_widget_show_all(dw->window); | |
|
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1882 } |
|
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1883 |
|
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1884 void show_debug() |
| 1 | 1885 { |
|
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1886 if ((misc_options & OPT_MISC_DEBUG)) { |
|
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1887 if (!dw || !dw->window) |
|
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1888 build_debug(); |
|
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1889 gtk_widget_show(dw->window); |
|
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1890 } else { |
|
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1891 if (!dw) |
|
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1892 return; |
|
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1893 gtk_widget_destroy(dw->window); |
|
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1894 dw->window = NULL; |
|
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1895 } |
|
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1896 } |
|
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1897 |
| 4755 | 1898 void toggle_debug() |
| 1899 { | |
| 1900 misc_options ^= OPT_MISC_DEBUG; | |
| 1901 show_debug(); | |
| 1902 save_prefs(); | |
| 1903 } | |
| 1904 | |
| 970 | 1905 void debug_printf(char *fmt, ...) |
| 1906 { | |
| 1907 va_list ap; | |
| 1908 gchar *s; | |
| 1909 | |
|
1366
155db3303ebb
[gaim-migrate @ 1376]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1357
diff
changeset
|
1910 va_start(ap, fmt); |
|
155db3303ebb
[gaim-migrate @ 1376]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1357
diff
changeset
|
1911 s = g_strdup_vprintf(fmt, ap); |
|
155db3303ebb
[gaim-migrate @ 1376]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1357
diff
changeset
|
1912 va_end(ap); |
|
155db3303ebb
[gaim-migrate @ 1376]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1357
diff
changeset
|
1913 |
|
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1914 if (misc_options & OPT_MISC_DEBUG && dw) { |
| 4005 | 1915 GtkTextBuffer *buffer; |
| 1916 GtkTextMark *endmark; | |
| 1917 GtkTextIter end; | |
|
2282
0dea5214d63f
[gaim-migrate @ 2292]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2269
diff
changeset
|
1918 |
| 4005 | 1919 buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(dw->entry)); |
| 1920 endmark = gtk_text_buffer_get_mark(buffer, "end"); | |
| 1921 gtk_text_buffer_get_iter_at_mark(buffer, &end, endmark); | |
| 1922 gtk_text_buffer_insert(buffer, &end, s, -1); | |
| 1923 gtk_text_view_scroll_mark_onscreen(GTK_TEXT_VIEW(dw->entry), endmark); | |
|
1366
155db3303ebb
[gaim-migrate @ 1376]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1357
diff
changeset
|
1924 } |
|
2823
cd23279122ed
[gaim-migrate @ 2836]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2794
diff
changeset
|
1925 if (opt_debug) |
|
cd23279122ed
[gaim-migrate @ 2836]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2794
diff
changeset
|
1926 g_print("%s", s); |
|
1366
155db3303ebb
[gaim-migrate @ 1376]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1357
diff
changeset
|
1927 g_free(s); |
| 970 | 1928 } |
|
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1929 |
| 1 | 1930 void set_option(GtkWidget *w, int *option) |
| 1931 { | |
| 1932 *option = !(*option); | |
| 1933 } | |
| 1934 | |
|
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1935 static void set_misc_option(GtkWidget *w, int option) |
|
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1936 { |
| 3818 | 1937 misc_options ^= option; |
|
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1938 |
| 3818 | 1939 if (option == OPT_MISC_DEBUG) |
|
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1940 show_debug(); |
| 4227 | 1941 else if(option == OPT_MISC_USE_SERVER_ALIAS) { |
| 4687 | 1942 /* XXX blist reset the aliases here */ |
|
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4339
diff
changeset
|
1943 gaim_conversation_foreach(gaim_conversation_autoset_title); |
| 4227 | 1944 } |
|
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1945 } |
|
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1946 |
| 3818 | 1947 static void set_logging_option(GtkWidget *w, int option) |
|
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1948 { |
| 3818 | 1949 logging_options ^= option; |
| 3500 | 1950 |
| 3818 | 1951 if (option == OPT_LOG_CONVOS || option == OPT_LOG_CHATS) |
| 1952 update_log_convs(); | |
| 3366 | 1953 } |
|
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1954 |
| 3818 | 1955 static void set_blist_option(GtkWidget *w, int option) |
| 3366 | 1956 { |
|
4695
4bdd9a5fd026
[gaim-migrate @ 5006]
Christian Hammond <chipx86@chipx86.com>
parents:
4687
diff
changeset
|
1957 struct gaim_gtk_buddy_list *gtkblist; |
|
4bdd9a5fd026
[gaim-migrate @ 5006]
Christian Hammond <chipx86@chipx86.com>
parents:
4687
diff
changeset
|
1958 |
|
4bdd9a5fd026
[gaim-migrate @ 5006]
Christian Hammond <chipx86@chipx86.com>
parents:
4687
diff
changeset
|
1959 gtkblist = GAIM_GTK_BLIST(gaim_get_blist()); |
|
4bdd9a5fd026
[gaim-migrate @ 5006]
Christian Hammond <chipx86@chipx86.com>
parents:
4687
diff
changeset
|
1960 |
| 3818 | 1961 blist_options ^= option; |
| 4687 | 1962 |
| 1963 if (!gtkblist) | |
|
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1964 return; |
| 4687 | 1965 |
| 4944 | 1966 if (option == OPT_BLIST_SHOW_WARN || |
| 4725 | 1967 option == OPT_BLIST_SHOW_IDLETIME) |
| 1968 gaim_gtk_blist_update_columns(); | |
| 1969 else if (option == OPT_BLIST_SHOW_ICONS) { | |
| 4697 | 1970 gaim_gtk_blist_refresh(gaim_get_blist()); |
| 4725 | 1971 gaim_gtk_blist_update_columns(); |
| 1972 } else | |
| 1973 gaim_gtk_blist_refresh(gaim_get_blist()); | |
|
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1974 } |
|
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1975 |
| 3818 | 1976 static void set_convo_option(GtkWidget *w, int option) |
|
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1977 { |
| 3818 | 1978 convo_options ^= option; |
| 3500 | 1979 |
| 3818 | 1980 if (option == OPT_CONVO_SHOW_SMILEY) |
|
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4339
diff
changeset
|
1981 gaim_gtkconv_toggle_smileys(); |
|
1428
00b3d02a2168
[gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1411
diff
changeset
|
1982 |
| 3818 | 1983 if (option == OPT_CONVO_SHOW_TIME) |
|
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4339
diff
changeset
|
1984 gaim_gtkconv_toggle_timestamps(); |
|
1428
00b3d02a2168
[gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1411
diff
changeset
|
1985 |
| 3818 | 1986 if (option == OPT_CONVO_CHECK_SPELLING) |
|
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4339
diff
changeset
|
1987 gaim_gtkconv_toggle_spellchk(); |
| 4445 | 1988 |
| 1989 if (option == OPT_CONVO_NO_X_ON_TAB) | |
| 1990 gaim_gtkconv_toggle_close_buttons(); | |
| 3818 | 1991 } |
| 1992 | |
| 1993 static void set_im_option(GtkWidget *w, int option) | |
| 1994 { | |
| 1995 im_options ^= option; | |
| 3500 | 1996 |
|
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4339
diff
changeset
|
1997 #if 0 |
| 3818 | 1998 if (option == OPT_IM_ONE_WINDOW) |
| 1999 im_tabize(); | |
|
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4339
diff
changeset
|
2000 #endif |
| 3818 | 2001 |
| 2002 if (option == OPT_IM_HIDE_ICONS) | |
|
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4339
diff
changeset
|
2003 gaim_gtkconv_hide_buddy_icons(); |
| 3818 | 2004 |
|
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4339
diff
changeset
|
2005 if (option == OPT_IM_ALIAS_TAB) |
|
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4339
diff
changeset
|
2006 gaim_conversation_foreach(gaim_conversation_autoset_title); |
|
2843
87d11d2a7d59
[gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2839
diff
changeset
|
2007 |
| 3818 | 2008 if (option == OPT_IM_NO_ANIMATION) |
|
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4339
diff
changeset
|
2009 gaim_gtkconv_set_anim(); |
| 1 | 2010 } |
| 2011 | |
| 3818 | 2012 static void set_chat_option(GtkWidget *w, int option) |
| 1 | 2013 { |
| 3818 | 2014 chat_options ^= option; |
|
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
2015 |
|
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4339
diff
changeset
|
2016 #if 0 |
| 3818 | 2017 if (option == OPT_CHAT_ONE_WINDOW) |
|
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
2018 chat_tabize(); |
|
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4339
diff
changeset
|
2019 #endif |
|
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
2020 } |
|
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
2021 |
| 3818 | 2022 void set_sound_option(GtkWidget *w, int option) |
|
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
2023 { |
| 3818 | 2024 sound_options ^= option; |
|
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
2025 } |
|
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
2026 |
| 3818 | 2027 static void set_font_option(GtkWidget *w, int option) |
|
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
2028 { |
| 3818 | 2029 font_options ^= option; |
| 3500 | 2030 |
|
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4339
diff
changeset
|
2031 gaim_gtkconv_update_font_buttons(); |
| 1 | 2032 } |
| 2033 | |
| 3818 | 2034 static void set_away_option(GtkWidget *w, int option) |
|
1525
ba8e6e211af5
[gaim-migrate @ 1535]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1455
diff
changeset
|
2035 { |
| 3818 | 2036 away_options ^= option; |
|
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
2037 |
| 3818 | 2038 if (option == OPT_AWAY_QUEUE) |
|
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
2039 toggle_away_queue(); |
|
1525
ba8e6e211af5
[gaim-migrate @ 1535]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1455
diff
changeset
|
2040 } |
|
ba8e6e211af5
[gaim-migrate @ 1535]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1455
diff
changeset
|
2041 |
|
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
2042 GtkWidget *gaim_button(const char *text, guint *options, int option, GtkWidget *page) |
| 1 | 2043 { |
| 2044 GtkWidget *button; | |
| 3427 | 2045 button = gtk_check_button_new_with_mnemonic(text); |
| 4635 | 2046 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), (*options & option)); |
| 1 | 2047 gtk_box_pack_start(GTK_BOX(page), button, FALSE, FALSE, 0); |
| 4635 | 2048 g_object_set_data(G_OBJECT(button), "options", options); |
| 1 | 2049 |
| 4064 | 2050 if (options == &misc_options) { |
|
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
2051 g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(set_misc_option), |
|
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
2052 (int *)option); |
| 4064 | 2053 } else if (options == &logging_options) { |
|
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
2054 g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(set_logging_option), |
| 3818 | 2055 (int *)option); |
| 4064 | 2056 } else if (options == &blist_options) { |
|
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
2057 g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(set_blist_option), |
| 3818 | 2058 (int *)option); |
| 4064 | 2059 } else if (options == &convo_options) { |
|
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
2060 g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(set_convo_option), |
| 3818 | 2061 (int *)option); |
| 4064 | 2062 } else if (options == &im_options) { |
|
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
2063 g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(set_im_option), |
| 3818 | 2064 (int *)option); |
| 4064 | 2065 } else if (options == &chat_options) { |
|
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
2066 g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(set_chat_option), |
| 3818 | 2067 (int *)option); |
| 4064 | 2068 } else if (options == &font_options) { |
|
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
2069 g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(set_font_option), |
| 3818 | 2070 (int *)option); |
| 4064 | 2071 } else if (options == &sound_options) { |
|
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
2072 g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(set_sound_option), |
| 3818 | 2073 (int *)option); |
| 4064 | 2074 } else if (options == &away_options) { |
|
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
2075 g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(set_away_option), |
| 4064 | 2076 (int *)option); |
| 2077 } else { | |
| 2078 debug_printf("gaim_button: \"%s\" has no signal handler attached to it!\n", text); | |
| 2079 } | |
| 1 | 2080 gtk_widget_show(button); |
| 2081 | |
| 2082 return button; | |
| 2083 } | |
| 2084 | |
| 3366 | 2085 void default_away_menu_init(GtkWidget *omenu) |
| 3032 | 2086 { |
| 3366 | 2087 GtkWidget *menu, *opt; |
| 2088 int index = 0; | |
| 2089 GSList *awy = away_messages; | |
| 2090 struct away_message *a; | |
| 2091 | |
| 2092 menu = gtk_menu_new(); | |
| 2093 | |
| 2094 while (awy) { | |
| 2095 a = (struct away_message *)awy->data; | |
| 2096 opt = gtk_menu_item_new_with_label(a->name); | |
|
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
2097 g_signal_connect(GTK_OBJECT(opt), "activate", G_CALLBACK(set_default_away), |
| 3366 | 2098 (gpointer)index); |
| 2099 gtk_widget_show(opt); | |
| 4635 | 2100 gtk_menu_shell_append(GTK_MENU_SHELL(menu), opt); |
| 3366 | 2101 |
| 2102 awy = awy->next; | |
| 2103 index++; | |
| 2104 } | |
| 2105 | |
| 2106 gtk_option_menu_remove_menu(GTK_OPTION_MENU(omenu)); | |
| 2107 gtk_option_menu_set_menu(GTK_OPTION_MENU(omenu), menu); | |
| 2108 gtk_option_menu_set_history(GTK_OPTION_MENU(omenu), g_slist_index(away_messages, default_away)); | |
| 2109 } | |
| 2110 | |
| 2111 GtkWidget *pref_fg_picture = NULL; | |
| 2112 GtkWidget *pref_bg_picture = NULL; | |
| 2113 | |
| 2114 void destroy_colorsel(GtkWidget *w, gpointer d) | |
| 2115 { | |
| 2116 if (d) { | |
| 2117 gtk_widget_destroy(fgcseld); | |
| 2118 fgcseld = NULL; | |
| 2119 } else { | |
| 2120 gtk_widget_destroy(bgcseld); | |
| 2121 bgcseld = NULL; | |
| 2122 } | |
| 3032 | 2123 } |
| 2124 | |
| 3366 | 2125 void apply_color_dlg(GtkWidget *w, gpointer d) |
| 3032 | 2126 { |
| 3366 | 2127 if ((int)d == 1) { |
| 2128 gtk_color_selection_get_current_color(GTK_COLOR_SELECTION | |
| 3500 | 2129 (GTK_COLOR_SELECTION_DIALOG(fgcseld)->colorsel), |
| 3818 | 2130 &fgcolor); |
| 3366 | 2131 destroy_colorsel(NULL, (void *)1); |
| 2132 update_color(NULL, pref_fg_picture); | |
| 2133 } else { | |
| 2134 gtk_color_selection_get_current_color(GTK_COLOR_SELECTION | |
| 3500 | 2135 (GTK_COLOR_SELECTION_DIALOG(bgcseld)->colorsel), |
| 3818 | 2136 &bgcolor); |
| 3366 | 2137 destroy_colorsel(NULL, (void *)0); |
| 2138 update_color(NULL, pref_bg_picture); | |
| 2139 } | |
| 4421 | 2140 gaim_conversation_foreach(gaim_gtkconv_update_font_colors); |
| 3032 | 2141 } |
| 2142 | |
| 3366 | 2143 void update_color(GtkWidget *w, GtkWidget *pic) |
| 1 | 2144 { |
| 3366 | 2145 GdkColor c; |
| 2146 GtkStyle *style; | |
| 2147 c.pixel = 0; | |
| 3500 | 2148 |
| 3366 | 2149 if (pic == pref_fg_picture) { |
| 3818 | 2150 if (font_options & OPT_FONT_FGCOL) { |
| 2151 c.red = fgcolor.red; | |
| 2152 c.blue = fgcolor.blue; | |
| 2153 c.green = fgcolor.green; | |
| 3366 | 2154 } else { |
| 2155 c.red = 0; | |
| 2156 c.blue = 0; | |
| 2157 c.green = 0; | |
| 2158 } | |
| 2159 } else { | |
| 3818 | 2160 if (font_options & OPT_FONT_BGCOL) { |
| 2161 c.red = bgcolor.red; | |
| 2162 c.blue = bgcolor.blue; | |
| 2163 c.green = bgcolor.green; | |
| 3366 | 2164 } else { |
| 2165 c.red = 0xffff; | |
| 2166 c.blue = 0xffff; | |
| 2167 c.green = 0xffff; | |
| 2168 } | |
| 2169 } | |
| 2170 | |
| 2171 style = gtk_style_new(); | |
| 2172 style->bg[0] = c; | |
| 2173 gtk_widget_set_style(pic, style); | |
| 4296 | 2174 g_object_unref(style); |
| 3366 | 2175 } |
| 4064 | 2176 |
| 3366 | 2177 void set_default_away(GtkWidget *w, gpointer i) |
| 2178 { | |
| 2179 | |
| 2180 int length = g_slist_length(away_messages); | |
|
338
9d258a0aa560
[gaim-migrate @ 348]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
337
diff
changeset
|
2181 |
| 3366 | 2182 if (away_messages == NULL) |
| 3818 | 2183 default_away = NULL; |
| 3366 | 2184 else if ((int)i >= length) |
| 3818 | 2185 default_away = g_slist_nth_data(away_messages, length - 1); |
| 3366 | 2186 else |
| 3818 | 2187 default_away = g_slist_nth_data(away_messages, (int)i); |
| 3366 | 2188 } |
| 3500 | 2189 |
| 4428 | 2190 static gboolean program_is_valid(const char *program) |
| 2191 { | |
| 2192 GError *error = NULL; | |
| 2193 char **argv; | |
| 4869 | 2194 gchar *progname; |
| 4428 | 2195 gboolean is_valid = FALSE; |
| 2196 | |
| 2197 if (program == NULL || *program == '\0') { | |
| 2198 return FALSE; | |
| 2199 } | |
| 2200 | |
| 2201 if (!g_shell_parse_argv(program, NULL, &argv, &error)) { | |
| 2202 debug_printf("Could not parse program '%s': ", error->message); | |
| 4800 | 2203 g_error_free(error); |
| 4428 | 2204 return FALSE; |
| 2205 } | |
| 2206 | |
| 2207 if (argv == NULL) { | |
| 2208 return FALSE; | |
| 2209 } | |
| 2210 | |
| 4869 | 2211 progname = g_find_program_in_path(argv[0]); |
| 2212 is_valid = (progname != NULL); | |
| 4428 | 2213 |
| 2214 g_strfreev(argv); | |
| 4869 | 2215 g_free(progname); |
| 2216 | |
| 4428 | 2217 return is_valid; |
| 2218 } | |
| 2219 | |
| 3366 | 2220 static void update_spin_value(GtkWidget *w, GtkWidget *spin) |
| 2221 { | |
| 4635 | 2222 int *value = g_object_get_data(G_OBJECT(spin), "val"); |
| 3366 | 2223 *value = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(spin)); |
| 2224 } | |
| 4064 | 2225 |
| 3427 | 2226 GtkWidget *gaim_labeled_spin_button(GtkWidget *box, const gchar *title, int *val, int min, int max, GtkSizeGroup *sg) |
| 3366 | 2227 { |
| 2228 GtkWidget *hbox; | |
| 2229 GtkWidget *label; | |
| 2230 GtkWidget *spin; | |
| 2231 GtkObject *adjust; | |
|
901
f168f2c7b357
[gaim-migrate @ 911]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
893
diff
changeset
|
2232 |
| 3366 | 2233 hbox = gtk_hbox_new(FALSE, 5); |
| 2234 gtk_box_pack_start(GTK_BOX(box), hbox, FALSE, FALSE, 5); | |
| 2235 gtk_widget_show(hbox); | |
| 2236 | |
| 3427 | 2237 label = gtk_label_new_with_mnemonic(title); |
| 3366 | 2238 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); |
| 2239 gtk_widget_show(label); | |
|
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
2240 |
| 3366 | 2241 adjust = gtk_adjustment_new(*val, min, max, 1, 1, 1); |
| 2242 spin = gtk_spin_button_new(GTK_ADJUSTMENT(adjust), 1, 0); | |
| 4635 | 2243 g_object_set_data(G_OBJECT(spin), "val", val); |
| 2244 gtk_widget_set_size_request(spin, 50, -1); | |
| 3366 | 2245 gtk_box_pack_start(GTK_BOX(hbox), spin, FALSE, FALSE, 0); |
|
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
2246 g_signal_connect(GTK_OBJECT(adjust), "value-changed", |
|
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
2247 G_CALLBACK(update_spin_value), GTK_WIDGET(spin)); |
| 3366 | 2248 gtk_widget_show(spin); |
| 3500 | 2249 |
| 3427 | 2250 gtk_label_set_mnemonic_widget(GTK_LABEL(label), spin); |
| 2251 | |
| 2252 if (sg) { | |
| 2253 gtk_size_group_add_widget(sg, label); | |
| 2254 gtk_misc_set_alignment(GTK_MISC(label), 0, 0); | |
| 3500 | 2255 |
| 3427 | 2256 } |
| 2257 return label; | |
|
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
2258 } |
| 1 | 2259 |
| 4635 | 2260 void dropdown_set(GObject *w, int *option) |
|
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
2261 { |
| 4635 | 2262 int opt = GPOINTER_TO_INT(g_object_get_data(w, "value")); |
| 2263 int clear = GPOINTER_TO_INT(g_object_get_data(w, "clear")); | |
| 3500 | 2264 |
| 3366 | 2265 if (clear != -1) { |
| 2266 *option = *option & ~clear; | |
| 2267 *option = *option | opt; | |
| 2268 } else { | |
| 2269 debug_printf("HELLO %d\n", opt); | |
| 2270 *option = opt; | |
| 2271 } | |
| 3500 | 2272 |
| 4634 | 2273 if (option == (int*)&global_proxy_info.proxytype) { |
| 3366 | 2274 if (opt == PROXY_NONE) |
| 2275 gtk_widget_set_sensitive(prefs_proxy_frame, FALSE); | |
| 2276 else | |
| 2277 gtk_widget_set_sensitive(prefs_proxy_frame, TRUE); | |
| 3818 | 2278 } else if (option == &web_browser) { |
| 3366 | 2279 if (opt == BROWSER_MANUAL) |
| 4428 | 2280 gtk_widget_set_sensitive(gtk_widget_get_parent(browser_entry), TRUE); |
| 3366 | 2281 else |
| 4428 | 2282 gtk_widget_set_sensitive(gtk_widget_get_parent(browser_entry), FALSE); |
| 3818 | 2283 } else if (option == (int*)&sound_options) { |
| 3366 | 2284 if (opt == OPT_SOUND_CMD) |
| 2285 gtk_widget_set_sensitive(sndcmd, TRUE); | |
| 2286 else | |
| 2287 gtk_widget_set_sensitive(sndcmd, FALSE); | |
| 4581 | 2288 gaim_sound_change_output_method(); |
| 4944 | 2289 } else if (option == (int*)&blist_options) { |
| 2290 gaim_gtk_blist_update_toolbar(); | |
| 3818 | 2291 } else if (option == (int*)&im_options) { |
| 2292 if (clear == (OPT_IM_SIDE_TAB | OPT_IM_BR_TAB)) | |
|
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4339
diff
changeset
|
2293 gaim_gtkconv_update_tabs(); |
| 3818 | 2294 else if (clear == (OPT_IM_BUTTON_TEXT | OPT_IM_BUTTON_XPM)) |
|
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4339
diff
changeset
|
2295 gaim_gtkconv_update_im_button_style(); |
| 3818 | 2296 } else if (option == (int*)&chat_options) { |
| 2297 if (clear == (OPT_CHAT_SIDE_TAB | OPT_CHAT_BR_TAB)) | |
|
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4339
diff
changeset
|
2298 gaim_gtkconv_update_tabs(); |
| 3818 | 2299 else if (clear == (OPT_CHAT_BUTTON_TEXT | OPT_CHAT_BUTTON_XPM)) |
|
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4339
diff
changeset
|
2300 gaim_gtkconv_update_chat_button_style(); |
| 4687 | 2301 // } else if (option == (int*)&blist_options) { |
| 2302 // set_blist_tab(); | |
|
4469
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
2303 } else if (option == (int *)&conv_placement_option) { |
|
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
2304 gaim_conv_placement_set_active(conv_placement_option); |
| 3366 | 2305 } |
| 1 | 2306 } |
| 2307 | |
| 3500 | 2308 static GtkWidget *gaim_dropdown(GtkWidget *box, const gchar *title, int *option, int clear, ...) |
| 1 | 2309 { |
| 4428 | 2310 va_list ap; |
| 2311 GList *menuitems = NULL; | |
| 2312 GtkWidget *dropdown = NULL; | |
| 2313 char *name; | |
| 2314 int id; | |
| 2315 | |
| 2316 va_start(ap, clear); | |
| 2317 while ((name = va_arg(ap, char *)) != NULL) { | |
| 2318 id = va_arg(ap, int); | |
| 2319 | |
| 2320 menuitems = g_list_prepend(menuitems, name); | |
| 2321 menuitems = g_list_prepend(menuitems, GINT_TO_POINTER(id)); | |
| 2322 } | |
| 2323 va_end(ap); | |
| 2324 | |
| 4433 | 2325 g_return_val_if_fail(menuitems != NULL, NULL); |
| 4428 | 2326 |
| 2327 menuitems = g_list_reverse(menuitems); | |
| 2328 | |
| 2329 dropdown = gaim_dropdown_from_list(box, title, option, clear, menuitems); | |
| 2330 | |
| 2331 g_list_free(menuitems); | |
| 2332 | |
| 2333 return dropdown; | |
| 2334 } | |
| 2335 | |
| 2336 static GtkWidget *gaim_dropdown_from_list(GtkWidget *box, const gchar *title, int *option, int clear, GList *menuitems) | |
| 2337 { | |
| 3366 | 2338 GtkWidget *dropdown, *opt, *menu; |
| 2339 GtkWidget *label; | |
| 2340 gchar *text; | |
| 2341 int value; | |
| 2342 int o = 0; | |
| 2343 GtkWidget *hbox; | |
| 1 | 2344 |
| 4428 | 2345 g_return_val_if_fail(menuitems != NULL, NULL); |
| 2346 | |
| 3366 | 2347 hbox = gtk_hbox_new(FALSE, 5); |
| 2348 gtk_container_add (GTK_CONTAINER (box), hbox); | |
| 2349 gtk_widget_show(hbox); | |
| 2350 | |
| 3427 | 2351 label = gtk_label_new_with_mnemonic(title); |
| 3366 | 2352 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); |
| 2353 gtk_widget_show(label); | |
| 2354 | |
| 2355 dropdown = gtk_option_menu_new(); | |
| 2356 menu = gtk_menu_new(); | |
| 3500 | 2357 |
| 3427 | 2358 gtk_label_set_mnemonic_widget(GTK_LABEL(label), dropdown); |
| 3500 | 2359 |
| 4428 | 2360 while (menuitems != NULL && (text = (char *) menuitems->data) != NULL) { |
| 2361 menuitems = g_list_next(menuitems); | |
| 2362 g_return_val_if_fail(menuitems != NULL, NULL); | |
| 2363 value = GPOINTER_TO_INT(menuitems->data); | |
| 2364 menuitems = g_list_next(menuitems); | |
| 2365 | |
| 3366 | 2366 opt = gtk_menu_item_new_with_label(text); |
| 4635 | 2367 g_object_set_data(G_OBJECT(opt), "value", GINT_TO_POINTER(value)); |
| 2368 g_object_set_data(G_OBJECT(opt), "clear", GINT_TO_POINTER(clear)); | |
|
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
2369 g_signal_connect(GTK_OBJECT(opt), "activate", |
|
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
2370 G_CALLBACK(dropdown_set), (void *)option); |
| 3366 | 2371 gtk_widget_show(opt); |
| 2372 gtk_menu_shell_append(GTK_MENU_SHELL(menu), opt); | |
| 1 | 2373 |
| 3366 | 2374 if (((clear > -1) && ((*option & value) == value)) || *option == value) { |
| 2375 gtk_menu_set_active(GTK_MENU(menu), o); | |
| 2376 } | |
| 2377 o++; | |
| 4428 | 2378 |
| 3366 | 2379 } |
|
2262
9c8f353331e7
[gaim-migrate @ 2272]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2254
diff
changeset
|
2380 |
| 3500 | 2381 gtk_option_menu_set_menu(GTK_OPTION_MENU(dropdown), menu); |
| 3366 | 2382 gtk_box_pack_start(GTK_BOX(hbox), dropdown, FALSE, FALSE, 0); |
| 2383 gtk_widget_show(dropdown); | |
| 3427 | 2384 return label; |
| 3500 | 2385 } |
| 2386 | |
| 3366 | 2387 static GtkWidget *show_color_pref(GtkWidget *box, gboolean fgc) |
| 1 | 2388 { |
| 3366 | 2389 /* more stuff stolen from X-Chat */ |
| 2390 GtkWidget *swid; | |
| 2391 GdkColor c; | |
| 2392 GtkStyle *style; | |
| 2393 c.pixel = 0; | |
| 2394 if (fgc) { | |
| 3818 | 2395 if (font_options & OPT_FONT_FGCOL) { |
| 2396 c.red = fgcolor.red; | |
| 2397 c.blue = fgcolor.blue; | |
| 2398 c.green = fgcolor.green; | |
| 3366 | 2399 } else { |
| 2400 c.red = 0; | |
| 2401 c.blue = 0; | |
| 2402 c.green = 0; | |
| 2403 } | |
| 2404 } else { | |
| 3818 | 2405 if (font_options & OPT_FONT_BGCOL) { |
| 2406 c.red = bgcolor.red; | |
| 2407 c.blue = bgcolor.blue; | |
| 2408 c.green = bgcolor.green; | |
| 3366 | 2409 } else { |
| 2410 c.red = 0xffff; | |
| 2411 c.blue = 0xffff; | |
| 2412 c.green = 0xffff; | |
| 2413 } | |
| 2414 } | |
| 1 | 2415 |
| 3366 | 2416 style = gtk_style_new(); |
| 2417 style->bg[0] = c; | |
|
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
2418 |
| 3366 | 2419 swid = gtk_event_box_new(); |
| 2420 gtk_widget_set_style(GTK_WIDGET(swid), style); | |
| 4296 | 2421 g_object_unref(style); |
| 4635 | 2422 gtk_widget_set_size_request(GTK_WIDGET(swid), 40, -1); |
| 3366 | 2423 gtk_box_pack_start(GTK_BOX(box), swid, FALSE, FALSE, 5); |
| 2424 gtk_widget_show(swid); | |
| 2425 return swid; | |
| 1 | 2426 } |
| 4064 | 2427 |
| 3366 | 2428 void apply_font_dlg(GtkWidget *w, GtkWidget *f) |
|
1124
a70d5200edde
[gaim-migrate @ 1134]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1123
diff
changeset
|
2429 { |
| 3366 | 2430 int i = 0; |
| 2431 char *fontname; | |
| 2432 | |
| 3473 | 2433 fontname = g_strdup(gtk_font_selection_dialog_get_font_name(GTK_FONT_SELECTION_DIALOG(f))); |
| 3366 | 2434 destroy_fontsel(0, 0); |
|
1124
a70d5200edde
[gaim-migrate @ 1134]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1123
diff
changeset
|
2435 |
| 3818 | 2436 while(fontname[i] && !isdigit(fontname[i]) && i < sizeof(fontface)) { |
| 2437 fontface[i] = fontname[i]; | |
| 3366 | 2438 i++; |
| 2439 } | |
|
4438
2054d8429925
[gaim-migrate @ 4713]
Christian Hammond <chipx86@chipx86.com>
parents:
4433
diff
changeset
|
2440 |
| 3818 | 2441 fontface[i] = 0; |
| 3366 | 2442 g_free(fontname); |
| 4635 | 2443 |
|
4438
2054d8429925
[gaim-migrate @ 4713]
Christian Hammond <chipx86@chipx86.com>
parents:
4433
diff
changeset
|
2444 gaim_conversation_foreach(gaim_gtkconv_update_font_face); |
|
1124
a70d5200edde
[gaim-migrate @ 1134]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1123
diff
changeset
|
2445 } |
| 3500 | 2446 |
