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