changeset 572:faca21605e1b

[gaim-migrate @ 582] no no no! :) committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Tue, 01 Aug 2000 22:59:00 +0000
parents feccb7afc81d
children 9566a53cde23
files src/prefs.c
diffstat 1 files changed, 32 insertions(+), 75 deletions(-) [+]
line wrap: on
line diff
--- a/src/prefs.c	Tue Aug 01 22:53:53 2000 +0000
+++ b/src/prefs.c	Tue Aug 01 22:59:00 2000 +0000
@@ -35,8 +35,6 @@
 #include "gaim.h"
 #include "proxy.h"
 #include "gnome_applet_mgr.h"
-#include "pixmaps/save.xpm"
-#include "pixmaps/cancel.xpm"
 
 struct prefs_data *pd = NULL;
 struct debug_window *dw = NULL;
@@ -97,6 +95,7 @@
         if (pd == NULL)
                 return;
 	strcpy(a->message, pd->edited_message);
+	save_prefs();
 }
 
 void set_option(GtkWidget *w, int *option)
@@ -113,11 +112,14 @@
 #ifdef USE_APPLET
 	update_pixmaps();
 #endif
+
+	save_prefs();
 }
 
 void set_sound_option(GtkWidget *w, int *option)
 {
 	sound_options = sound_options ^ (int)option;
+	save_prefs();
 }
 
 void set_font_option(GtkWidget *w, int *option)
@@ -125,6 +127,8 @@
 	font_options = font_options ^ (int)option;
 
 	update_font_buttons();	
+
+	save_prefs();
 }
 
 void set_general_option(GtkWidget *w, int *option)
@@ -135,6 +139,7 @@
        		update_lagometer(-1);
        	if ((int)option == OPT_GEN_LOG_ALL)
        		update_log_convs();
+	save_prefs();
 
 	/*
         if (data == &show_grp_nums)
@@ -157,6 +162,7 @@
 	if (general_options & OPT_GEN_DEBUG)
 	{
 		general_options = general_options ^ (int)OPT_GEN_DEBUG;
+		save_prefs();
 	}
 	g_free(dw);
 	dw=NULL;
@@ -184,6 +190,7 @@
 
 	}
 	
+	save_prefs();
 
 	if (event == NULL)
 	{
@@ -200,8 +207,8 @@
 static int
 manualentry_key_pressed(GtkWidget *w, GdkEvent *event, void *dummy)
 {
-    g_snprintf(web_command, sizeof(web_command), "%s", gtk_entry_get_text(GTK_ENTRY(pd->browser_entry)));
-
+        g_snprintf(web_command, sizeof(web_command), "%s", gtk_entry_get_text(GTK_ENTRY(pd->browser_entry)));
+        save_prefs();
 	return TRUE;
 }
 
@@ -217,6 +224,7 @@
 
 	g_snprintf(login_host, sizeof(login_host), "%s", gtk_entry_get_text(GTK_ENTRY(pd->login_host_entry)));
 	sscanf(gtk_entry_get_text(GTK_ENTRY(pd->login_port_entry)), "%d", &login_port);	
+	save_prefs();
 	return TRUE;
 }
 
@@ -241,6 +249,9 @@
                 if (pd->nwbutton)
                         gtk_widget_set_sensitive(pd->nwbutton, TRUE);
         }
+        
+
+        save_prefs();
 }
 
 static void set_connect(GtkWidget *w, int *data)
@@ -258,11 +269,13 @@
 			gtk_widget_set_sensitive(pd->proxy_port_entry, FALSE);
 	}
         
+        save_prefs();
 }
 
 static void set_idle(GtkWidget *w, int *data)
 {
 	report_idle = (int)data;
+        save_prefs();
 }
 
 
@@ -288,6 +301,7 @@
 	return button;
 }
 
+
 void build_prefs()
 {
 	GtkWidget *bbox;
@@ -302,6 +316,7 @@
 	GtkWidget *away_botbox;
 	GtkWidget *add_away;
 	GtkWidget *remove_away;
+	GtkWidget *close;
 	GtkWidget *notebook;
 	GtkWidget *sound_page;
 	/* GtkWidget *debug_page; */
@@ -320,7 +335,7 @@
         GtkWidget *label;
         GtkWidget *browseropt;
         GtkWidget *idleopt;
-	    
+	        
         GList *awy = away_messages;
         struct away_message *a;
         GtkWidget *sw;
@@ -328,10 +343,8 @@
 	GtkWidget *away_page;
 	GtkWidget *select_font;
 	GtkWidget *font_face_for_text;
+	
 	GtkWidget *list_item;
-	GtkWidget *button_box, *save, *cancel, *icon_i, *button_label;
-	GdkBitmap *mask;
-	GdkPixmap *icon;
 
 	gchar buffer[64];
 
@@ -799,82 +812,22 @@
 	gtk_widget_show(chat_page);
 	
 	bbox = gtk_hbox_new(FALSE, 5);
-
-	/* Build Save Button */
-
-	save = gtk_button_new();
-
-	button_box = gtk_hbox_new(FALSE, 5);
-	icon = gdk_pixmap_create_from_xpm_d ( pd->window->window, &mask, NULL, save_xpm);
-
-	icon_i = gtk_pixmap_new(icon, mask);
-	
-	button_label = gtk_label_new(_("Save"));
-
-	gtk_box_pack_start(GTK_BOX(button_box), icon_i, FALSE, FALSE, 2);
-	gtk_box_pack_end(GTK_BOX(button_box), button_label, FALSE, FALSE, 2);
-
-	gtk_widget_show(button_label);
-	gtk_widget_show(icon_i);
-
-	gtk_widget_show(button_box);
-
-	gtk_container_add(GTK_CONTAINER(save), button_box);
-	
-	/* End of Save Button */
-		
-	/* Build Cancel Button */
-
-	cancel = gtk_button_new();
-
-	button_box = gtk_hbox_new(FALSE, 5);
-	icon = gdk_pixmap_create_from_xpm_d ( pd->window->window, &mask, NULL, cancel_xpm);
-
-	icon_i = gtk_pixmap_new(icon, mask);
-	
-	button_label = gtk_label_new(_("Cancel"));
-
-	gtk_box_pack_start(GTK_BOX(button_box), icon_i, FALSE, FALSE, 2);
-	gtk_box_pack_end(GTK_BOX(button_box), button_label, FALSE, FALSE, 2);
-
-	gtk_widget_show(button_label);
-	gtk_widget_show(icon_i);
-
-	gtk_widget_show(button_box);
-
-	gtk_container_add(GTK_CONTAINER(cancel), button_box);
-	
-	/* End of Cancel Button */
-
-
+	close = gtk_button_new_with_label(_("Close"));
 	if (display_options & OPT_DISP_COOL_LOOK)
-	{
-		gtk_button_set_relief(GTK_BUTTON(save), GTK_RELIEF_NONE);
-		gtk_button_set_relief(GTK_BUTTON(cancel), GTK_RELIEF_NONE);
-	}
-	
-/*	close = gtk_button_new_with_label(_("Close"));
-	if (display_options & OPT_DISP_COOL_LOOK)
-		gtk_button_set_relief(GTK_BUTTON(close), GTK_RELIEF_NONE);*/
+		gtk_button_set_relief(GTK_BUTTON(close), GTK_RELIEF_NONE);
 	
 	/* Pack the button(s) in the button box */
-	gtk_box_pack_end(GTK_BOX(bbox), cancel, FALSE, FALSE, 5);
-	gtk_box_pack_end(GTK_BOX(bbox), save, FALSE, FALSE, 5);
+	gtk_box_pack_end(GTK_BOX(bbox), close, FALSE, FALSE, 5);
 	gtk_box_pack_start(GTK_BOX(vbox),bbox, FALSE, FALSE, 5);
 
 	gtk_widget_show(notebook);
- 	gtk_widget_show(save);
- 	gtk_widget_show(cancel);
- 
+        gtk_widget_show(close);
+
 	gtk_widget_show(bbox);
 	gtk_widget_show(vbox);
 
-	gtk_signal_connect(GTK_OBJECT(save), "clicked", GTK_SIGNAL_FUNC(save_prefs), NULL);
-	gtk_signal_connect(GTK_OBJECT(save), "clicked", GTK_SIGNAL_FUNC(handle_delete), NULL);
-	gtk_signal_connect(GTK_OBJECT(cancel), "clicked", GTK_SIGNAL_FUNC(set_defaults), NULL);
-	gtk_signal_connect(GTK_OBJECT(cancel), "clicked", GTK_SIGNAL_FUNC(load_prefs), NULL);
-	gtk_signal_connect(GTK_OBJECT(cancel), "clicked", GTK_SIGNAL_FUNC(handle_delete), NULL);
-	gtk_signal_connect(GTK_OBJECT(pd->window),"delete_event", GTK_SIGNAL_FUNC(handle_delete), NULL);
+	gtk_signal_connect(GTK_OBJECT(close), "clicked", GTK_SIGNAL_FUNC(handle_delete), NULL);
+        gtk_signal_connect(GTK_OBJECT(pd->window),"delete_event", GTK_SIGNAL_FUNC(handle_delete), NULL);
 
 }
 
@@ -913,6 +866,9 @@
 	chat_rooms = g_list_append(chat_rooms, cr2);
 
 	setup_buddy_chats();
+	save_prefs();
+	
+
 }
 
 void remove_chat(GtkWidget *w, struct chat_page *cp)
@@ -950,6 +906,7 @@
 	}
 
 	setup_buddy_chats();
+        save_prefs();
 }
 
 void refresh_list(GtkWidget *w, struct chat_page *cp)