diff options
author | Chenthill Palanisamy <pchen@src.gnome.org> | 2006-01-13 19:02:32 +0800 |
---|---|---|
committer | Chenthill Palanisamy <pchen@src.gnome.org> | 2006-01-13 19:02:32 +0800 |
commit | 8a35fece1b96e7b3d3938a2e9bfe7467908fbf42 (patch) | |
tree | 92e81e3699e6cc2f20af543e02fc966a449ae32a /calendar/gui | |
parent | f4f4f94e728d3973f7d780ca9390795c31e07578 (diff) | |
download | gsoc2013-evolution-8a35fece1b96e7b3d3938a2e9bfe7467908fbf42.tar.gz gsoc2013-evolution-8a35fece1b96e7b3d3938a2e9bfe7467908fbf42.tar.zst gsoc2013-evolution-8a35fece1b96e7b3d3938a2e9bfe7467908fbf42.zip |
fixes #213660
svn path=/trunk/; revision=31167
Diffstat (limited to 'calendar/gui')
-rw-r--r-- | calendar/gui/calendar-config-keys.h | 1 | ||||
-rw-r--r-- | calendar/gui/calendar-config.c | 16 | ||||
-rw-r--r-- | calendar/gui/calendar-config.h | 3 | ||||
-rw-r--r-- | calendar/gui/dialogs/alarm-dialog.c | 16 | ||||
-rw-r--r-- | calendar/gui/dialogs/alarm-dialog.glade | 2 | ||||
-rw-r--r-- | calendar/gui/e-select-names-editable.c | 2 |
6 files changed, 37 insertions, 3 deletions
diff --git a/calendar/gui/calendar-config-keys.h b/calendar/gui/calendar-config-keys.h index 08706d293a..e1f8a49470 100644 --- a/calendar/gui/calendar-config-keys.h +++ b/calendar/gui/calendar-config-keys.h @@ -89,6 +89,7 @@ G_BEGIN_DECLS /* Free/Busy settings */ #define CALENDAR_CONFIG_TEMPLATE CALENDAR_CONFIG_PREFIX"/publish/template" +#define CALENDAR_CONFIG_SAVE_DIR "/apps/evolution/mail/save_dir" G_END_DECLS #endif diff --git a/calendar/gui/calendar-config.c b/calendar/gui/calendar-config.c index 6128931476..e8de54d1af 100644 --- a/calendar/gui/calendar-config.c +++ b/calendar/gui/calendar-config.c @@ -1331,3 +1331,19 @@ calendar_config_add_notification_free_busy_template (GConfClientNotifyFunc func, 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; +} diff --git a/calendar/gui/calendar-config.h b/calendar/gui/calendar-config.h index b111dbe04c..e99265e784 100644 --- a/calendar/gui/calendar-config.h +++ b/calendar/gui/calendar-config.h @@ -251,4 +251,7 @@ void calendar_config_check_timezone_set (void); supports 12-hour time format. */ gboolean calendar_config_locale_supports_12_hour_format(void); +void calendar_config_set_dir_path (const char *); +char * calendar_config_get_dir_path (void); + #endif /* _CALENDAR_CONFIG_H_ */ diff --git a/calendar/gui/dialogs/alarm-dialog.c b/calendar/gui/dialogs/alarm-dialog.c index e730b00065..e030d007f4 100644 --- a/calendar/gui/dialogs/alarm-dialog.c +++ b/calendar/gui/dialogs/alarm-dialog.c @@ -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 (GtkToggleButton *toggle, gpointer data) 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 *menu_shell, gpointer data) 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; diff --git a/calendar/gui/dialogs/alarm-dialog.glade b/calendar/gui/dialogs/alarm-dialog.glade index adcb53262b..fb44f24b25 100644 --- a/calendar/gui/dialogs/alarm-dialog.glade +++ b/calendar/gui/dialogs/alarm-dialog.glade @@ -764,7 +764,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> diff --git a/calendar/gui/e-select-names-editable.c b/calendar/gui/e-select-names-editable.c index 6be5ec9bf8..c6bca611b2 100644 --- a/calendar/gui/e-select-names-editable.c +++ b/calendar/gui/e-select-names-editable.c @@ -193,7 +193,7 @@ GList * e_select_names_editable_get_names (ESelectNamesEditable *esne) { EDestinationStore *destination_store; - GList *destinations; + GList *destinations, *l; EDestination *destination; GList *result = NULL; |