changeset 6016:1e4a574bb46d

[gaim-migrate @ 6466] Removed move of the #if 0'ed code from gtkprefs.c. I think Chip or Nathan or whoever left this here so that they could go back later and make sure all the old #if 0'ed stuff works correctly with the new prefs, so to reassure whoever did that, I've been verifying that all these prefs work as they should. Made the "use server alias" checkbox instantly affect conversation titles. Fixed a crash caused by trying to enable buddy icon animation for static images which happened after toggling the "enable buddy icon animation" preference to the O-N positiO-N. All you people need to hop on the bug fix bandwagon. It's happy hour. committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Fri, 04 Jul 2003 19:12:06 +0000
parents 225902daab80
children 968a00c9f230
files src/conversation.c src/gtkconv.c src/gtkprefs.c
diffstat 3 files changed, 57 insertions(+), 91 deletions(-) [+]
line wrap: on
line diff
--- a/src/conversation.c	Fri Jul 04 15:58:03 2003 +0000
+++ b/src/conversation.c	Fri Jul 04 19:12:06 2003 +0000
@@ -2313,6 +2313,21 @@
 	place_conv = fnc;
 }
 
+static void
+update_titles_pref_cb(const char *name, GaimPrefType type, gpointer value,
+		gpointer data)
+{
+	/*
+	 * If the use_server_alias option was changed, and use_alias_for_title 
+	 * is false, then we don't have to do anything here.
+	 */
+	if (!strcmp(name, "/core/buddies/use_server_alias") && 
+		!gaim_prefs_get_bool("/core/conversations/use_alias_for_title"))
+		return;
+
+	gaim_conversation_foreach(gaim_conversation_autoset_title);
+}
+
 void
 gaim_set_win_ui_ops(GaimWindowUiOps *ops)
 {
@@ -2350,4 +2365,8 @@
 	gaim_prefs_connect_callback("/core/conversations/placement",
 			conv_placement_pref_cb, NULL);
 	gaim_prefs_trigger_callback("/core/conversations/placement");
+	gaim_prefs_connect_callback("/core/conversations/use_alias_for_title",
+			update_titles_pref_cb, NULL);
+	gaim_prefs_connect_callback("/core/buddies/use_server_alias",
+			update_titles_pref_cb, NULL);
 }
--- a/src/gtkconv.c	Fri Jul 04 15:58:03 2003 +0000
+++ b/src/gtkconv.c	Fri Jul 04 19:12:06 2003 +0000
@@ -4920,6 +4920,9 @@
 
 	gtkconv = GAIM_GTK_CONVERSATION(conv);
 
+	if (gdk_pixbuf_animation_is_static_image(gtkconv->u.im->anim))
+		return;
+
 	delay = gdk_pixbuf_animation_iter_get_delay_time(gtkconv->u.im->iter) / 10;
 
 	if (gtkconv->u.im->anim)
--- a/src/gtkprefs.c	Fri Jul 04 15:58:03 2003 +0000
+++ b/src/gtkprefs.c	Fri Jul 04 19:12:06 2003 +0000
@@ -1196,6 +1196,38 @@
 }
 
 #ifndef _WIN32
+static gboolean program_is_valid(const char *program) 
+{
+	GError *error = NULL;
+	char **argv; 
+	gchar *progname;
+	gboolean is_valid = FALSE;
+
+	if (program == NULL || *program == '\0') {
+		return FALSE;
+	}
+
+	if (!g_shell_parse_argv(program, NULL, &argv, &error)) {
+		gaim_debug(GAIM_DEBUG_ERROR, "program_is_valid",
+				   "Could not parse program '%s': %s\n",
+				   program, error->message);
+		g_error_free(error);
+		return FALSE;
+	}
+
+	if (argv == NULL) {
+		return FALSE;
+	}
+
+	progname = g_find_program_in_path(argv[0]);
+	is_valid = (progname != NULL);
+
+	g_strfreev(argv);
+	g_free(progname);
+	
+	return is_valid;
+}
+
 static gboolean manual_browser_set(GtkWidget *entry, GdkEventFocus *event, gpointer data) {
 	const char *program = gtk_entry_get_text(GTK_ENTRY(entry));
 
@@ -2105,7 +2137,7 @@
 }
 
 void remove_away_message(GtkWidget *widget, GtkTreeView *tv) {
-        struct away_message *am;
+	struct away_message *am;
 	GtkTreeIter iter;
 	GtkTreeSelection *sel = gtk_tree_view_get_selection(tv);
 	GtkTreeModel *model = GTK_TREE_MODEL(prefs_away_store);
@@ -2295,7 +2327,8 @@
 
 	/* copy the preferences to tmp values...
 	 * I liked "take affect immediately" Oh well :-( */
-	
+	/* (that should have been "effect," right?) */
+
 	/* Back to instant-apply! I win!  BU-HAHAHA! */
 
 	/* Create the window */
@@ -2401,15 +2434,6 @@
 }
 
 #if 0
-static void set_misc_option(GtkWidget *w, const char *key)
-{
-
-	if(option == OPT_MISC_USE_SERVER_ALIAS) {
-		/* XXX blist reset the aliases here */
-		gaim_conversation_foreach(gaim_conversation_autoset_title);
-	}
-}
-
 static void set_logging_option(GtkWidget *w, int option)
 {
 	logging_options ^= option;
@@ -2418,32 +2442,6 @@
 		update_log_convs();
 }
 
-static void set_blist_option(GtkWidget *w, int option)
-{
-	struct gaim_gtk_buddy_list *gtkblist;
-
-	gtkblist = GAIM_GTK_BLIST(gaim_get_blist());
-
-	blist_options ^= option;
-
-	if (!gtkblist)
-		return;
-
-	if (option == OPT_BLIST_SHOW_WARN)
-		gaim_gtk_blist_update_columns();
-	else if (option == OPT_BLIST_SHOW_IDLETIME) {
-		gaim_gtk_blist_update_refresh_timeout();
-		gaim_gtk_blist_update_columns();
-	}
-	else if (option == OPT_BLIST_SHOW_ICONS) {
-		gaim_gtk_blist_update_refresh_timeout();
-		gaim_gtk_blist_refresh(gaim_get_blist());
-		gaim_gtk_blist_update_columns();
-	} else
-		gaim_gtk_blist_refresh(gaim_get_blist());
-
-}
-
 static void set_convo_option(GtkWidget *w, int option)
 {
 	convo_options ^= option;
@@ -2453,12 +2451,6 @@
 
 	if (option == OPT_CONVO_SHOW_TIME)
 		gaim_gtkconv_toggle_timestamps();
-
-	if (option == OPT_CONVO_CHECK_SPELLING)
-		gaim_gtkconv_toggle_spellchk();
-
-	if (option == OPT_CONVO_NO_X_ON_TAB)
-		gaim_gtkconv_toggle_close_buttons();
 }
 
 static void set_im_option(GtkWidget *w, int option)
@@ -2469,15 +2461,6 @@
 	if (option == OPT_IM_ONE_WINDOW)
 		im_tabize();
 #endif
-
-	if (option == OPT_IM_HIDE_ICONS)
-		gaim_gtkconv_hide_buddy_icons();
-
-	if (option == OPT_IM_ALIAS_TAB)
-		gaim_conversation_foreach(gaim_conversation_autoset_title);
-
-	if (option == OPT_IM_NO_ANIMATION)
-		gaim_gtkconv_set_anim();
 }
 
 static void set_chat_option(GtkWidget *w, int option)
@@ -2490,11 +2473,6 @@
 #endif
 }
 
-void set_sound_option(GtkWidget *w, int option)
-{
-	sound_options ^= option;
-}
-
 static void set_away_option(GtkWidget *w, int option)
 {
 	away_options ^= option;
@@ -2619,40 +2597,6 @@
 		default_away = g_slist_nth_data(away_messages, (int)i);
 }
 
-#ifndef _WIN32
-static gboolean program_is_valid(const char *program) 
-{
-	GError *error = NULL;
-	char **argv; 
-	gchar *progname;
-	gboolean is_valid = FALSE;
-
-	if (program == NULL || *program == '\0') {
-		return FALSE;
-	}
-
-	if (!g_shell_parse_argv(program, NULL, &argv, &error)) {
-		gaim_debug(GAIM_DEBUG_ERROR, "program_is_valid",
-				   "Could not parse program '%s': %s\n",
-				   program, error->message);
-		g_error_free(error);
-		return FALSE;
-	}
-
-	if (argv == NULL) {
-		return FALSE;
-	}
-
-	progname = g_find_program_in_path(argv[0]);
-	is_valid = (progname != NULL);
-
-	g_strfreev(argv);
-	g_free(progname);
-	
-	return is_valid;
-}
-#endif
-
 static GtkWidget *show_color_pref(GtkWidget *box, gboolean fgc)
 {
 	/* more stuff stolen from X-Chat */