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



Hi

Made the suggesed changes.
Please review.

Thanks
Johnny

On 1/2/06, chen <pchenthill novell com> wrote:
> The gconf values should be accessed from conf-data.[ch]. Please do the
> necessary changes and resend the patch.
>
>
> thanks, Chenthill.
>
> On Thu, 2005-12-22 at 14:35 +0530, Johnny Jacob wrote:
> > HI
> > Attached a patch for Bug 213660.
> >
> > Please review
> >
> > Thanks
> > Johnny
> > _______________________________________________
> > Evolution-patches mailing list
> > Evolution-patches gnome org
> > http://mail.gnome.org/mailman/listinfo/evolution-patches
>
Index: calendar/ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/calendar/ChangeLog,v
retrieving revision 1.2926
diff -u -p -r1.2926 ChangeLog
--- calendar/ChangeLog	10 Jan 2006 08:08:20 -0000	1.2926
+++ calendar/ChangeLog	12 Jan 2006 09:21:30 -0000
@@ -1,3 +1,13 @@
+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.
+	* gui/dialogs/calendar-config.ch (calendar_config_set_dir): Added.
+	save the path in gconf.
+	(calendar_config_get_dir_path): Added. Retrive the path from gconf.
+
 2006-01-10  Simon Zheng  <simon zheng sun com>
 
 	* gui/calendar-component.c: (calendar_component_peek):
Index: calendar/gui/calendar-config.h
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/calendar-config.h,v
retrieving revision 1.44
diff -u -p -r1.44 calendar-config.h
--- calendar/gui/calendar-config.h	16 Nov 2005 13:53:46 -0000	1.44
+++ calendar/gui/calendar-config.h	12 Jan 2006 09:21:59 -0000
@@ -251,4 +251,7 @@ void	  calendar_config_check_timezone_se
    supports 12-hour time format. */
 gboolean  calendar_config_locale_supports_12_hour_format(void);
 
+void	  calendar_config_set_dir_path (char *);
+char *	  calendar_config_get_dir_path (void);
+
 #endif /* _CALENDAR_CONFIG_H_ */
Index: calendar/gui/calendar-config.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/calendar-config.c,v
retrieving revision 1.84
diff -u -p -r1.84 calendar-config.c
--- calendar/gui/calendar-config.c	10 Jan 2006 08:08:21 -0000	1.84
+++ calendar/gui/calendar-config.c	12 Jan 2006 09:22:32 -0000
@@ -1331,3 +1331,19 @@ calendar_config_add_notification_free_bu
 	
 	return id;	
 }
+
+void
+calendar_config_set_dir_path (const gchar *path)
+{
+	gconf_client_set_string (config, CALENDAR_CONFIG_SAVE_DIR, path, NULL);
+}
+
+char *
+calendar_config_get_dir_path (void)
+{
+	char *path;
+
+	path = gconf_client_get_string (config, CALENDAR_CONFIG_SAVE_DIR, NULL);
+
+	return path;
+}
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	12 Jan 2006 09:23:29 -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
@@ -678,11 +681,18 @@ repeat_toggle_toggled_cb (GtkToggleButto
 static void
 check_custom_sound (Dialog *dialog)
 {
-	char *str;
+	char *str, *dir;
 	gboolean sens;
 	
 	str = e_dialog_editable_get (dialog->aalarm_attach);
 
+	if ( str && *str ) {
+		dir = g_path_get_dirname (str);
+		if ( dir && *dir ) {
+			calendar_config_set_dir_path (dir);
+		}
+	}
+
 	sens = e_dialog_toggle_get (dialog->aalarm_sound) ? str && *str : TRUE;
 	gtk_dialog_set_response_sensitive (GTK_DIALOG (dialog->toplevel), GTK_RESPONSE_OK, sens);
 
@@ -827,6 +837,7 @@ static void
 action_selection_done_cb (GtkMenuShell *menu_shell, gpointer data)
 {
 	Dialog *dialog = data;
+	char *dir;
 	ECalComponentAlarmAction action;
 	int page = 0, i;
 	
@@ -842,6 +853,9 @@ action_selection_done_cb (GtkMenuShell *
 
 	switch (action) {	
 	case E_CAL_COMPONENT_ALARM_AUDIO:
+		dir = calendar_config_get_dir_path ();
+		if ( dir && *dir )
+			gnome_file_entry_set_default_path (dialog->aalarm_file_entry, dir);
 		check_custom_sound (dialog);
 		break;
 
Index: calendar/gui/dialogs/alarm-dialog.glade
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/dialogs/alarm-dialog.glade,v
retrieving revision 1.10
diff -u -p -r1.10 alarm-dialog.glade
--- calendar/gui/dialogs/alarm-dialog.glade	8 Jan 2006 17:06:35 -0000	1.10
+++ calendar/gui/dialogs/alarm-dialog.glade	12 Jan 2006 09:24:46 -0000
@@ -764,7 +805,7 @@
 			  </child>
 
 			  <child>
-			    <widget class="GnomeFileEntry" id="file-entry1">
+			    <widget class="GnomeFileEntry" id="aalarm-file-entry">
 			      <property name="visible">True</property>
 			      <property name="max_saved">10</property>
 			      <property name="directory_entry">False</property>


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