From ded09ddf48c5c9ecda22314247b42ed7b224595f Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Thu, 9 Jul 2009 12:05:33 +0200 Subject: Bug #425582 - Calendar Alarm Display is not noticable enough --- calendar/gui/dialogs/cal-prefs-dialog.c | 33 +++++-- calendar/gui/dialogs/cal-prefs-dialog.glade | 137 ++++++++++++++++++++-------- calendar/gui/dialogs/cal-prefs-dialog.h | 1 + 3 files changed, 128 insertions(+), 43 deletions(-) (limited to 'calendar') diff --git a/calendar/gui/dialogs/cal-prefs-dialog.c b/calendar/gui/dialogs/cal-prefs-dialog.c index 96f91c741f..db3a5aef13 100644 --- a/calendar/gui/dialogs/cal-prefs-dialog.c +++ b/calendar/gui/dialogs/cal-prefs-dialog.c @@ -433,6 +433,18 @@ ba_reminder_units_changed (GtkWidget *widget, CalendarPrefsDialog *prefs) calendar_config_set_ba_reminder (NULL, NULL, &units); } +static void +notify_with_tray_toggled (GtkToggleButton *toggle, CalendarPrefsDialog *prefs) +{ + GConfClient *gconf; + + g_return_if_fail (toggle != NULL); + + gconf = gconf_client_get_default (); + gconf_client_set_bool (gconf, "/apps/evolution/calendar/notify/notify_with_tray", gtk_toggle_button_get_active (toggle), NULL); + g_object_unref (gconf); +} + static void alarms_selection_changed (ESourceSelector *selector, CalendarPrefsDialog *prefs) { @@ -557,6 +569,7 @@ setup_changes (CalendarPrefsDialog *prefs) G_CALLBACK (ba_reminder_interval_changed), prefs); g_signal_connect (G_OBJECT (prefs->ba_reminder_units), "changed", G_CALLBACK (ba_reminder_units_changed), prefs); + g_signal_connect (G_OBJECT (prefs->notify_with_tray), "toggled", G_CALLBACK (notify_with_tray_toggled), prefs); g_signal_connect (G_OBJECT (prefs->alarm_list_widget), "selection_changed", G_CALLBACK (alarms_selection_changed), prefs); @@ -630,14 +643,19 @@ initialize_selection (ESourceSelector *selector, ESourceList *source_list) static void show_alarms_config (CalendarPrefsDialog *prefs) { - if (!e_cal_get_sources (&prefs->alarms_list, E_CAL_SOURCE_TYPE_EVENT, NULL)) - return; + GConfClient *gconf; + + if (e_cal_get_sources (&prefs->alarms_list, E_CAL_SOURCE_TYPE_EVENT, NULL)) { + prefs->alarm_list_widget = e_source_selector_new (prefs->alarms_list); + atk_object_set_name (gtk_widget_get_accessible (prefs->alarm_list_widget), _("Selected Calendars for Alarms")); + gtk_container_add (GTK_CONTAINER (prefs->scrolled_window), prefs->alarm_list_widget); + gtk_widget_show (prefs->alarm_list_widget); + initialize_selection (E_SOURCE_SELECTOR (prefs->alarm_list_widget), prefs->alarms_list); + } - prefs->alarm_list_widget = e_source_selector_new (prefs->alarms_list); - atk_object_set_name (gtk_widget_get_accessible (prefs->alarm_list_widget), _("Selected Calendars for Alarms")); - gtk_container_add (GTK_CONTAINER (prefs->scrolled_window), prefs->alarm_list_widget); - gtk_widget_show (prefs->alarm_list_widget); - initialize_selection (E_SOURCE_SELECTOR (prefs->alarm_list_widget), prefs->alarms_list); + gconf = gconf_client_get_default (); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (prefs->notify_with_tray), gconf_client_get_bool (gconf, "/apps/evolution/calendar/notify/notify_with_tray", NULL)); + g_object_unref (gconf); } /* Shows the current config settings in the dialog. */ @@ -836,6 +854,7 @@ calendar_prefs_dialog_construct (CalendarPrefsDialog *prefs) /* Alarms tab */ + prefs->notify_with_tray = glade_xml_get_widget (gui, "notify_with_tray"); prefs->scrolled_window = glade_xml_get_widget (gui, "calendar-source-scrolled-window"); /* Free/Busy tab */ diff --git a/calendar/gui/dialogs/cal-prefs-dialog.glade b/calendar/gui/dialogs/cal-prefs-dialog.glade index 9f2617db04..63e9e6092f 100644 --- a/calendar/gui/dialogs/cal-prefs-dialog.glade +++ b/calendar/gui/dialogs/cal-prefs-dialog.glade @@ -1045,42 +1045,107 @@ Days True 12 6 - - - True - - - True - Select the calendars for alarm notification - - - False - False - 0 - - - - - False - False - 0 - - - - - True - True - automatic - automatic - in - - - - - - 1 - - + + + True + <span weight="bold">Alarms</span> + False + True + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + True + 0.5 + 0.5 + 1 + 1 + 0 + 0 + 10 + 0 + + + + True + True + Display alarms in _notification area only + True + GTK_RELIEF_NORMAL + True + False + False + True + + + + + 0 + False + True + + + + + + True + Select the calendars for alarm notification + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + +- True +- True +- automatic +- automatic +- in + + + + + + + 0 + True + True + + 2 diff --git a/calendar/gui/dialogs/cal-prefs-dialog.h b/calendar/gui/dialogs/cal-prefs-dialog.h index 647df417df..611d4aabcc 100644 --- a/calendar/gui/dialogs/cal-prefs-dialog.h +++ b/calendar/gui/dialogs/cal-prefs-dialog.h @@ -75,6 +75,7 @@ struct _CalendarPrefsDialog { GtkWidget *tasks_hide_completed_units; /* Alarms tab */ + GtkWidget *notify_with_tray; GtkWidget *scrolled_window; ESourceList *alarms_list; GtkWidget *alarm_list_widget; -- cgit