aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/dialogs
diff options
context:
space:
mode:
authorChenthill Palanisamy <pchen@src.gnome.org>2006-01-25 18:48:16 +0800
committerChenthill Palanisamy <pchen@src.gnome.org>2006-01-25 18:48:16 +0800
commitec86e3f4d5d20bd6ce273030f7f6201fa6cc9851 (patch)
treeec2fdc7652c058d0d4a0a2e24291ebbef72d3d96 /calendar/gui/dialogs
parentc31d93ccb23c2c7ba2faa82668d0a45a7bddf369 (diff)
downloadgsoc2013-evolution-ec86e3f4d5d20bd6ce273030f7f6201fa6cc9851.tar
gsoc2013-evolution-ec86e3f4d5d20bd6ce273030f7f6201fa6cc9851.tar.gz
gsoc2013-evolution-ec86e3f4d5d20bd6ce273030f7f6201fa6cc9851.tar.bz2
gsoc2013-evolution-ec86e3f4d5d20bd6ce273030f7f6201fa6cc9851.tar.lz
gsoc2013-evolution-ec86e3f4d5d20bd6ce273030f7f6201fa6cc9851.tar.xz
gsoc2013-evolution-ec86e3f4d5d20bd6ce273030f7f6201fa6cc9851.tar.zst
gsoc2013-evolution-ec86e3f4d5d20bd6ce273030f7f6201fa6cc9851.zip
fixes #325762
svn path=/trunk/; revision=31308
Diffstat (limited to 'calendar/gui/dialogs')
-rw-r--r--calendar/gui/dialogs/cal-prefs-dialog.c78
-rw-r--r--calendar/gui/dialogs/cal-prefs-dialog.glade98
-rw-r--r--calendar/gui/dialogs/cal-prefs-dialog.h6
3 files changed, 180 insertions, 2 deletions
diff --git a/calendar/gui/dialogs/cal-prefs-dialog.c b/calendar/gui/dialogs/cal-prefs-dialog.c
index 2f548b66c1..996b257353 100644
--- a/calendar/gui/dialogs/cal-prefs-dialog.c
+++ b/calendar/gui/dialogs/cal-prefs-dialog.c
@@ -303,6 +303,41 @@ default_reminder_units_changed (GtkWidget *widget, CalendarPrefsDialog *prefs)
}
static void
+alarms_selection_changed (ESourceSelector *selector, CalendarPrefsDialog *prefs)
+{
+ ESourceList *source_list = prefs->alarms_list;
+ GSList *selection;
+ GSList *l;
+ GSList *groups;
+
+ /* first we clear all the alarm flags from all sources */
+ g_message ("Clearing selection");
+ for (groups = e_source_list_peek_groups (source_list); groups; groups = groups->next) {
+ ESourceGroup *group = E_SOURCE_GROUP (groups->data);
+ GSList *sources;
+ for (sources = e_source_group_peek_sources (group); sources; sources = sources->next) {
+ ESource *source = E_SOURCE (sources->data);
+
+ g_message ("Unsetting for %s", e_source_peek_name (source));
+ e_source_set_property (source, "alarm", "false");
+ }
+ }
+
+ /* then we loop over the selector's selection, setting the
+ property on those sources */
+ selection = e_source_selector_get_selection (selector);
+ for (l = selection; l; l = l->next) {
+ g_message ("Setting for %s", e_source_peek_name (E_SOURCE (l->data)));
+ e_source_set_property (E_SOURCE (l->data), "alarm", "true");
+ }
+ e_source_selector_free_selection (selection);
+
+ /* FIXME show an error if this fails? */
+ e_source_list_sync (source_list, NULL);
+ printf("changed\n");
+}
+
+static void
template_url_changed (GtkEntry *entry, CalendarPrefsDialog *prefs)
{
calendar_config_set_free_busy_template (gtk_entry_get_text (entry));
@@ -347,6 +382,9 @@ setup_changes (CalendarPrefsDialog *prefs)
G_CALLBACK (default_reminder_interval_changed), prefs);
g_signal_connect (G_OBJECT (prefs->default_reminder_units), "changed", G_CALLBACK (default_reminder_units_changed), prefs);
+ g_signal_connect (G_OBJECT (prefs->alarm_list_widget), "selection_changed", G_CALLBACK (alarms_selection_changed), prefs);
+
+
g_signal_connect (G_OBJECT (prefs->template_url), "changed", G_CALLBACK (template_url_changed), prefs);
}
@@ -402,6 +440,38 @@ show_task_list_config (CalendarPrefsDialog *prefs)
gtk_widget_set_sensitive (prefs->tasks_hide_completed_units, hide_completed_tasks);
}
+static void
+initialize_selection (ESourceSelector *selector, ESourceList *source_list)
+{
+ GSList *groups;
+
+ for (groups = e_source_list_peek_groups (source_list); groups; groups = groups->next) {
+ ESourceGroup *group = E_SOURCE_GROUP (groups->data);
+ GSList *sources;
+ for (sources = e_source_group_peek_sources (group); sources; sources = sources->next) {
+ ESource *source = E_SOURCE (sources->data);
+ const char *completion = e_source_get_property (source, "alarm");
+ if (!completion || !g_ascii_strcasecmp (completion, "true")) {
+ if (!completion)
+ e_source_set_property (E_SOURCE (source), "alarm", "true");
+ e_source_selector_select_source (selector, source);
+ }
+ }
+ }
+}
+
+static void
+show_alarms_config (CalendarPrefsDialog *prefs)
+{
+ if (!e_cal_get_sources (&prefs->alarms_list, E_CAL_SOURCE_TYPE_EVENT, NULL))
+ return;
+
+ 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);
+ initialize_selection (prefs->alarm_list_widget, prefs->alarms_list);
+}
+
/* Shows the current config settings in the dialog. */
static void
show_config (CalendarPrefsDialog *prefs)
@@ -460,6 +530,9 @@ show_config (CalendarPrefsDialog *prefs)
/* Task list */
show_task_list_config (prefs);
+ /* Alarms list*/
+ show_alarms_config (prefs);
+
/* Free/Busy */
show_fb_config (prefs);
@@ -480,6 +553,7 @@ static ECalConfigItem eccp_items[] = {
{ E_CONFIG_PAGE, "10.display", "display", eccp_widget_glade },
{ E_CONFIG_SECTION, "10.display/00.general", "displayGeneral", eccp_widget_glade },
{ E_CONFIG_SECTION, "10.display/10.taskList", "taskList", eccp_widget_glade },
+ { E_CONFIG_PAGE, "15.alarms", "alarms", eccp_widget_glade },
{ E_CONFIG_PAGE, "20.freeBusy", "freebusy", eccp_widget_glade },
{ E_CONFIG_SECTION, "20.freeBusy/00.defaultServer", "defaultFBServer", eccp_widget_glade },
};
@@ -558,6 +632,10 @@ calendar_prefs_dialog_construct (CalendarPrefsDialog *prefs)
prefs->tasks_hide_completed_interval = glade_xml_get_widget (gui, "tasks_hide_completed_interval");
prefs->tasks_hide_completed_units = glade_xml_get_widget (gui, "tasks_hide_completed_units");
+
+ /* Alarms tab */
+ prefs->scrolled_window = glade_xml_get_widget (gui, "calendar-source-scrolled-window");
+
/* Free/Busy tab */
prefs->template_url = glade_xml_get_widget (gui, "template_url");
target = e_cal_config_target_new_prefs (ec, prefs->gconf);
diff --git a/calendar/gui/dialogs/cal-prefs-dialog.glade b/calendar/gui/dialogs/cal-prefs-dialog.glade
index fbc149683a..09966cb4ca 100644
--- a/calendar/gui/dialogs/cal-prefs-dialog.glade
+++ b/calendar/gui/dialogs/cal-prefs-dialog.glade
@@ -1210,7 +1210,7 @@ Days</property>
<property name="can_focus">True</property>
<property name="dither">True</property>
<property name="use_alpha">False</property>
- <property name="title" translatable="yes">Color for tasks due today</property>
+ <property name="title" translatable="yes">Pick a color</property>
<property name="focus_on_click">True</property>
</widget>
<packing>
@@ -1229,7 +1229,7 @@ Days</property>
<property name="can_focus">True</property>
<property name="dither">True</property>
<property name="use_alpha">False</property>
- <property name="title" translatable="yes">Color for overdue tasks</property>
+ <property name="title" translatable="yes">Pick a color</property>
<property name="focus_on_click">True</property>
</widget>
<packing>
@@ -1360,6 +1360,100 @@ Days</property>
</child>
<child>
+ <widget class="GtkVBox" id="vbox16">
+ <property name="border_width">12</property>
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">6</property>
+
+ <child>
+ <widget class="GtkHBox" id="hbox24">
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">0</property>
+
+ <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.5</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>
+ </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">GTK_POLICY_AUTOMATIC</property>
+ <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
+ <property name="shadow_type">GTK_SHADOW_IN</property>
+ <property name="window_placement">GTK_CORNER_TOP_LEFT</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="tab_expand">False</property>
+ <property name="tab_fill">True</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkLabel" id="alarm-label">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Alarms</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.5</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="type">tab</property>
+ </packing>
+ </child>
+
+ <child>
<widget class="GtkVBox" id="freebusy">
<property name="border_width">12</property>
<property name="visible">True</property>
diff --git a/calendar/gui/dialogs/cal-prefs-dialog.h b/calendar/gui/dialogs/cal-prefs-dialog.h
index ab717d85a9..3575e9baca 100644
--- a/calendar/gui/dialogs/cal-prefs-dialog.h
+++ b/calendar/gui/dialogs/cal-prefs-dialog.h
@@ -28,6 +28,7 @@
#include <gtk/gtk.h>
#include <glade/glade.h>
#include <gconf/gconf-client.h>
+#include <libedataserverui/e-source-selector.h>
#include "evolution-config-control.h"
G_BEGIN_DECLS
@@ -66,6 +67,11 @@ struct _CalendarPrefsDialog {
GtkWidget *tasks_hide_completed_interval;
GtkWidget *tasks_hide_completed_units;
+ /* Alarms tab */
+ GtkWidget *scrolled_window;
+ ESourceList *alarms_list;
+ GtkWidget *alarm_list_widget;
+
/* Free/Busy tab */
GtkWidget *url_add;
GtkWidget *url_edit;