aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--calendar/gui/dialogs/cal-prefs-dialog.c33
-rw-r--r--calendar/gui/dialogs/cal-prefs-dialog.glade137
-rw-r--r--calendar/gui/dialogs/cal-prefs-dialog.h1
3 files changed, 128 insertions, 43 deletions
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
@@ -434,6 +434,18 @@ ba_reminder_units_changed (GtkWidget *widget, CalendarPrefsDialog *prefs)
}
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)
{
ESourceList *source_list = prefs->alarms_list;
@@ -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</property>
<property name="visible">True</property>
<property name="border_width">12</property>
<property name="spacing">6</property>
- <child>
- <widget class="GtkHBox" id="hbox24">
- <property name="visible">True</property>
- <child>
- <widget class="GtkLabel" id="label62">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Select the calendars for alarm notification</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <widget class="GtkScrolledWindow" id="calendar-source-scrolled-window">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="hscrollbar_policy">automatic</property>
- <property name="vscrollbar_policy">automatic</property>
- <property name="shadow_type">in</property>
- <child>
- <placeholder/>
- </child>
- </widget>
- <packing>
- <property name="position">1</property>
- </packing>
- </child>
+ <child>
+ <widget class="GtkLabel" id="label65">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">&lt;span weight=&quot;bold&quot;&gt;Alarms&lt;/span&gt;</property>
+ <property name="use_underline">False</property>
+ <property name="use_markup">True</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">False</property>
+ <property name="selectable">False</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+ <property name="width_chars">-1</property>
+ <property name="single_line_mode">False</property>
+ <property name="angle">0</property>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkAlignment" id="alignment1">
+ <property name="visible">True</property>
+ <property name="xalign">0.5</property>
+ <property name="yalign">0.5</property>
+ <property name="xscale">1</property>
+ <property name="yscale">1</property>
+ <property name="top_padding">0</property>
+ <property name="bottom_padding">0</property>
+ <property name="left_padding">10</property>
+ <property name="right_padding">0</property>
+
+ <child>
+ <widget class="GtkCheckButton" id="notify_with_tray">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="label" translatable="yes">Display alarms in _notification area only</property>
+ <property name="use_underline">True</property>
+ <property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
+ <property name="active">False</property>
+ <property name="inconsistent">False</property>
+ <property name="draw_indicator">True</property>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkLabel" id="label62">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Select the calendars for alarm notification</property>
+ <property name="use_underline">False</property>
+ <property name="use_markup">False</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">False</property>
+ <property name="selectable">False</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+ <property name="width_chars">-1</property>
+ <property name="single_line_mode">False</property>
+ <property name="angle">0</property>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkScrolledWindow" id="calendar-source-scrolled-window">
+- <property name="visible">True</property>
+- <property name="can_focus">True</property>
+- <property name="hscrollbar_policy">automatic</property>
+- <property name="vscrollbar_policy">automatic</property>
+- <property name="shadow_type">in</property>
+
+ <child>
+ <placeholder/>
+ </child>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ </packing>
+ </child>
</widget>
<packing>
<property name="position">2</property>
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;