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