changeset 5568:fb4f7bd7525c

[gaim-migrate @ 5970] Fixed up the preferences dialog a bit, and some other things. The prefs dialog now loads! committer: Tailor Script <tailor@pidgin.im>
author Christian Hammond <chipx86@chipx86.com>
date Fri, 30 May 2003 19:29:49 +0000
parents cc9ddec20010
children 5d2911d6d38e
files src/gaimrc.c src/gtkprefs.c src/prefs.c
diffstat 3 files changed, 30 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/src/gaimrc.c	Fri May 30 18:44:03 2003 +0000
+++ b/src/gaimrc.c	Fri May 30 19:29:49 2003 +0000
@@ -541,7 +541,7 @@
 		}
 	}
 
-	if ((i = strlen(account->user_info)))
+	if ((i = strlen(user_info)))
 		user_info[i - 1] = '\0';
 
 	gaim_account_set_user_info(account, user_info);
--- a/src/gtkprefs.c	Fri May 30 18:44:03 2003 +0000
+++ b/src/gtkprefs.c	Fri May 30 19:29:49 2003 +0000
@@ -85,6 +85,8 @@
 static int notebook_page = 0;
 static GtkTreeIter plugin_iter;
 
+static guint browser_pref_id = 0;
+
 /*
  * PROTOTYPES
  */
@@ -266,8 +268,6 @@
 		menuitems = g_list_next(menuitems);
 		g_return_val_if_fail(menuitems != NULL, NULL);
 
-		menuitems = g_list_next(menuitems);
-
 		opt = gtk_menu_item_new_with_label(text);
 
 		g_object_set_data(G_OBJECT(opt), "type", GINT_TO_POINTER(type));
@@ -301,6 +301,8 @@
 			gtk_menu_set_active(GTK_MENU(menu), o);
 		}
 
+		menuitems = g_list_next(menuitems);
+
 		o++;
 	}
 
@@ -371,6 +373,9 @@
 	g_object_unref(G_OBJECT(prefs_away_store));
 	prefs_away_store = NULL;
 
+	/* Unregister callbacks. */
+	gaim_prefs_disconnect_callback(browser_pref_id);
+
 	for (l = gaim_plugins_get_loaded(); l != NULL; l = l->next) {
 		plug = l->data;
 
@@ -722,7 +727,7 @@
 	prefs_checkbox(_("_Bold"),
 				  "/gaim/gtk/conversations/send_bold", vbox);
 	prefs_checkbox(_("_Italics"),
-				  "/gaim/gtk/conversations/send_italics", vbox);
+				  "/gaim/gtk/conversations/send_italic", vbox);
 	prefs_checkbox(_("_Underline"),
 				  "/gaim/gtk/conversations/send_underline", vbox);
 	prefs_checkbox(_("_Strikethrough"),
@@ -976,7 +981,7 @@
 									"/gaim/gtk/conversations/close_on_tabs",
 									vbox);
 
-	if (gaim_prefs_get_bool("/gaim/gtk/conversations/tabs")) {
+	if (!gaim_prefs_get_bool("/gaim/gtk/conversations/tabs")) {
 		gtk_widget_set_sensitive(GTK_WIDGET(close_checkbox), FALSE);
 	}
 
@@ -1026,7 +1031,7 @@
 
 	vbox = gaim_gtk_make_frame (ret, _("Buddy Icons"));
 	prefs_checkbox(_("Show buddy _icons"),
-				  "/gaim/gtk/conversations/show_buddy_icons", vbox);
+				  "/gaim/gtk/conversations/im/show_buddy_icons", vbox);
 	prefs_checkbox(_("Enable buddy icon a_nimation"),
 				  "/gaim/gtk/conversations/im/animate_buddy_icons", vbox);
 
@@ -1225,19 +1230,30 @@
 	GList *browsers = NULL;
 	int i = 0;
 
-	browsers = g_list_prepend(browsers, GINT_TO_POINTER(BROWSER_MANUAL));
+	browsers = g_list_prepend(browsers, "custom");
 	browsers = g_list_prepend(browsers, _("Manual"));
+
 	for (i = 0; i < num_possible_browsers; i++) {
 		if (program_is_valid(possible_browsers[i].command)) {
 			browsers = g_list_prepend(browsers, 
 									  possible_browsers[i].command);
-			browsers = g_list_prepend(browsers, possible_browsers[i].name);
+			browsers = g_list_prepend(browsers, _(possible_browsers[i].name));
 		}
 	}
 
 	return browsers;
 }
 
+static void
+browser_changed_cb(const char *name, GaimPrefType type, gpointer value,
+				   gpointer data)
+{
+	GtkWidget *hbox = data;
+	const char *browser = value;
+
+	gtk_widget_set_sensitive(hbox, !strcmp(browser, "custom"));
+}
+
 GtkWidget *browser_page() {
 	GtkWidget *ret;
 	GtkWidget *vbox;
@@ -1282,6 +1298,9 @@
 	g_signal_connect(G_OBJECT(browser_entry), "focus-out-event",
 					 G_CALLBACK(manual_browser_set), NULL);
 
+	browser_pref_id = gaim_prefs_connect_callback("/gaim/gtk/browsers/browser",
+												  browser_changed_cb, hbox);
+
 	if (browsers != NULL) {
 		vbox = gaim_gtk_make_frame (ret, _("Browser Options"));
 		label = prefs_checkbox(_("Open new _window by default"),
@@ -1423,7 +1442,7 @@
 	prefs_checkbox(_("_Sending messages removes away status"),
 				  "/core/conversations/away_back_on_send", vbox);
 	prefs_checkbox(_("_Queue new messages when away"),
-				  "/core/away/queue_messages", vbox);
+				  "/plugins/gtk/docklet/queue_messages", vbox);
 
 	vbox = gaim_gtk_make_frame (ret, _("Auto-response"));
 	hbox = gtk_hbox_new(FALSE, 0);
@@ -2328,6 +2347,7 @@
 
 	prefs_notebook_init();
 
+	/* Show everything. */
 	gtk_tree_view_expand_all (GTK_TREE_VIEW(tree_v));
 	gtk_widget_show(prefs);
 }
--- a/src/prefs.c	Fri May 30 18:44:03 2003 +0000
+++ b/src/prefs.c	Fri May 30 19:29:49 2003 +0000
@@ -440,6 +440,7 @@
 gboolean gaim_prefs_get_bool(const char *name) {
 	struct gaim_pref *pref = find_pref(name);
 
+	printf("bool name = '%s'\n", name);
 	g_return_val_if_fail(pref != NULL, FALSE);
 	g_return_val_if_fail(pref->type == GAIM_PREF_BOOLEAN, FALSE);