[evolution-patches] [Calendar] Fix for Bug 213660



HI
Attached a patch for Bug 213660.

Please review

Thanks
Johnny
Index: calendar/ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/calendar/ChangeLog,v
retrieving revision 1.2899
diff -u -p -r1.2899 ChangeLog
--- calendar/ChangeLog	21 Dec 2005 04:13:33 -0000	1.2899
+++ calendar/ChangeLog	22 Dec 2005 08:40:12 -0000
@@ -1,3 +1,10 @@
+2005-12-21  Johnny Jacob  <johnnyjacob gmail com>
+
+	* gui/dialogs/alarm-dialog.c (check_custom_sound):
+	Save the directory path in gconf.
+	(action_selection_done_cb) : Read from gconf and set
+	the default path for the file entry.
+
 2005-12-20  Chenthill Palanisamy  <pchenthill novell com>
 
 	Fixes #324525
Index: calendar/gui/dialogs/alarm-dialog.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/dialogs/alarm-dialog.c,v
retrieving revision 1.12
diff -u -p -r1.12 alarm-dialog.c
--- calendar/gui/dialogs/alarm-dialog.c	26 Nov 2005 02:31:51 -0000	1.12
+++ calendar/gui/dialogs/alarm-dialog.c	22 Dec 2005 08:41:05 -0000
@@ -97,6 +97,7 @@ typedef struct {
 	GtkWidget *aalarm_group;
 	GtkWidget *aalarm_sound;
 	GtkWidget *aalarm_attach;
+	GtkWidget *aalarm_file_entry;
 
 	/* Mail alarm widgets */
 	const char *email;
@@ -554,6 +555,7 @@ get_widgets (Dialog *dialog)
 	dialog->aalarm_group = GW ("aalarm-group");
 	dialog->aalarm_sound = GW ("aalarm-sound");
 	dialog->aalarm_attach = GW ("aalarm-attach");
+	dialog->aalarm_file_entry = GW ("aalarm-file-entry");
 
 	dialog->malarm_group = GW ("malarm-group");
 	dialog->malarm_address_group = GW ("malarm-address-group");
@@ -584,6 +586,7 @@ get_widgets (Dialog *dialog)
 		&& dialog->aalarm_group
 		&& dialog->aalarm_sound
 		&& dialog->aalarm_attach
+		&& dialog->aalarm_file_entry
 		&& dialog->malarm_group
 		&& dialog->malarm_address_group
 		&& dialog->malarm_addressbook
@@ -680,8 +683,17 @@ check_custom_sound (Dialog *dialog)
 {
 	char *str;
 	gboolean sens;
-	
+	GConfClient *gconf;
+	char *dir;
+
 	str = e_dialog_editable_get (dialog->aalarm_attach);
+	if (str && *str) {
+		dir = g_path_get_dirname (str);
+		if (dir && *dir) {
+			gconf = gconf_client_get_default ();
+			gconf_client_set_string(gconf, "/apps/evolution/mail/save_dir", dir, NULL);	
+		}
+	}
 
 	sens = e_dialog_toggle_get (dialog->aalarm_sound) ? str && *str : TRUE;
 	gtk_dialog_set_response_sensitive (GTK_DIALOG (dialog->toplevel), GTK_RESPONSE_OK, sens);
@@ -829,6 +841,8 @@ action_selection_done_cb (GtkMenuShell *
 	Dialog *dialog = data;
 	ECalComponentAlarmAction action;
 	int page = 0, i;
+	GConfClient *gconf;
+	char *dir;
 	
 	action = e_dialog_option_menu_get (dialog->action, action_map);
 	for (i = 0; action_map[i] != -1 ; i++) {
@@ -842,6 +856,10 @@ action_selection_done_cb (GtkMenuShell *
 
 	switch (action) {	
 	case E_CAL_COMPONENT_ALARM_AUDIO:
+		gconf = gconf_client_get_default ();
+		dir = gconf_client_get_string(gconf, "/apps/evolution/mail/save_dir", NULL);
+		if ( dir && *dir )
+			gnome_file_entry_set_default_path (dialog->aalarm_file_entry, dir);
 		check_custom_sound (dialog);
 		break;
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]