changeset 5974:1abc483f74c6

[gaim-migrate @ 6421] Makes the two checkboxes on the file transfer dialog window remember themselves. Just like the Alamo. committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Sun, 29 Jun 2003 07:50:48 +0000
parents 53782414bc3a
children 80e5258226f3
files src/gtkft.c src/gtkft.h src/main.c
diffstat 3 files changed, 19 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/gtkft.c	Sun Jun 29 06:40:17 2003 +0000
+++ b/src/gtkft.c	Sun Jun 29 07:50:48 2003 +0000
@@ -32,6 +32,7 @@
 #include "gaim-disclosure.h"
 #include "gtkcellrendererprogress.h"
 #include "gtkft.h"
+#include "prefs.h"
 #include "gtkutils.h"
 #include "stock.h"
 
@@ -299,12 +300,14 @@
 toggle_keep_open_cb(GtkWidget *w, struct gaim_gtkxfer_dialog *dialog)
 {
 	dialog->keep_open = !dialog->keep_open;
+	gaim_prefs_set_bool("/gaim/gtk/filetransfer/keep_open", dialog->keep_open);
 }
 
 static void
 toggle_clear_finished_cb(GtkWidget *w, struct gaim_gtkxfer_dialog *dialog)
 {
 	dialog->auto_clear = !dialog->auto_clear;
+	gaim_prefs_set_bool("/gaim/gtk/filetransfer/clear_finished", dialog->auto_clear);
 }
 
 static void
@@ -545,8 +548,8 @@
 	GtkWidget *checkbox;
 
 	dialog = g_new0(struct gaim_gtkxfer_dialog, 1);
-	dialog->keep_open  = FALSE;
-	dialog->auto_clear = TRUE;
+	dialog->keep_open  = gaim_prefs_get_bool("/gaim/gtk/filetransfer/keep_open");
+	dialog->auto_clear = gaim_prefs_get_bool("/gaim/gtk/filetransfer/clear_finished");
 
 	/* Create the window. */
 	dialog->window = window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
@@ -1179,6 +1182,14 @@
  * GTK+ File Transfer API
  **************************************************************************/
 void
+gaim_gtk_xfer_init(void)
+{
+	gaim_prefs_add_none("/gaim/gtk/filetransfer");
+	gaim_prefs_add_bool("/gaim/gtk/filetransfer/clear_finished", TRUE);
+	gaim_prefs_add_bool("/gaim/gtk/filetransfer/keep_open", FALSE);
+}
+
+void
 gaim_set_gtkxfer_dialog(struct gaim_gtkxfer_dialog *dialog)
 {
 	xfer_dialog = dialog;
--- a/src/gtkft.h	Sun Jun 29 06:40:17 2003 +0000
+++ b/src/gtkft.h	Sun Jun 29 07:50:48 2003 +0000
@@ -115,6 +115,11 @@
 /*@{*/
 
 /**
+ * Initializes the GTK+ file transfer system.
+ */
+void gaim_gtk_xfer_init(void);
+
+/**
  * Sets gaim's main file transfer dialog.
  *
  * @param dialog The main dialog.
--- a/src/main.c	Sun Jun 29 06:40:17 2003 +0000
+++ b/src/main.c	Sun Jun 29 07:50:48 2003 +0000
@@ -862,6 +862,7 @@
 	gaim_gtk_blist_init();
 	gaim_gtk_conversation_init();
 	gaim_gtk_pounces_init();
+	gaim_gtk_xfer_init();
 
 	plugin_search_paths[0] = LIBDIR;
 	plugin_search_paths[1] = gaim_user_dir();