aboutsummaryrefslogtreecommitdiffstats
path: root/calendar
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2009-05-01 18:44:36 +0800
committerMatthew Barnes <mbarnes@redhat.com>2009-05-01 18:44:36 +0800
commit5f55aba5b052fb7284973f50009f8b369334d084 (patch)
treee7a5149f56fd8550915c3141a408fb79a14d0239 /calendar
parent6824309c1179f1346b4877f67e386f237d954196 (diff)
downloadgsoc2013-evolution-5f55aba5b052fb7284973f50009f8b369334d084.tar
gsoc2013-evolution-5f55aba5b052fb7284973f50009f8b369334d084.tar.gz
gsoc2013-evolution-5f55aba5b052fb7284973f50009f8b369334d084.tar.bz2
gsoc2013-evolution-5f55aba5b052fb7284973f50009f8b369334d084.tar.lz
gsoc2013-evolution-5f55aba5b052fb7284973f50009f8b369334d084.tar.xz
gsoc2013-evolution-5f55aba5b052fb7284973f50009f8b369334d084.tar.zst
gsoc2013-evolution-5f55aba5b052fb7284973f50009f8b369334d084.zip
Merge in changes from master.
Diffstat (limited to 'calendar')
-rw-r--r--calendar/gui/alarm-notify/alarm-notify-dialog.c3
-rw-r--r--calendar/gui/alarm-notify/alarm-queue.c4
-rw-r--r--calendar/gui/apps_evolution_calendar.schemas.in12
-rw-r--r--calendar/gui/calendar-config-keys.h2
-rw-r--r--calendar/gui/calendar-config.c29
-rw-r--r--calendar/gui/calendar-config.h14
-rw-r--r--calendar/gui/dialogs/cal-prefs-dialog.c11
-rw-r--r--calendar/gui/dialogs/cal-prefs-dialog.glade19
-rw-r--r--calendar/gui/dialogs/cal-prefs-dialog.h1
-rw-r--r--calendar/gui/dialogs/calendar-setup.c1
-rw-r--r--calendar/gui/e-calendar-table.c4
-rw-r--r--calendar/gui/e-comp-editor-registry.c1
-rw-r--r--calendar/gui/e-week-view.c48
-rw-r--r--calendar/gui/e-week-view.h4
-rw-r--r--calendar/gui/gnome-cal.c2
15 files changed, 129 insertions, 26 deletions
diff --git a/calendar/gui/alarm-notify/alarm-notify-dialog.c b/calendar/gui/alarm-notify/alarm-notify-dialog.c
index ee09c0dde4..7f54b6bf2d 100644
--- a/calendar/gui/alarm-notify/alarm-notify-dialog.c
+++ b/calendar/gui/alarm-notify/alarm-notify-dialog.c
@@ -26,9 +26,6 @@
#include <stdio.h>
#include <string.h>
#include <glib/gi18n.h>
-#if 0
-# include <libgnomeui/gnome-winhints.h>
-#endif
#include <glade/glade.h>
#include <libedataserver/e-time-utils.h>
#include <libecal/e-cal-time-util.h>
diff --git a/calendar/gui/alarm-notify/alarm-queue.c b/calendar/gui/alarm-notify/alarm-queue.c
index 531cc115cd..0328743a77 100644
--- a/calendar/gui/alarm-notify/alarm-queue.c
+++ b/calendar/gui/alarm-notify/alarm-queue.c
@@ -55,10 +55,6 @@
#include "e-util/e-popup.h"
#include "e-util/e-error.h"
-#if !GTK_CHECK_VERSION(2,16,0)
-#define gtk_status_icon_set_tooltip_text gtk_status_icon_set_tooltip
-#endif
-
#define d(x)
/* The dialog with alarm nofications */
diff --git a/calendar/gui/apps_evolution_calendar.schemas.in b/calendar/gui/apps_evolution_calendar.schemas.in
index 98e31ac775..6e5e057c14 100644
--- a/calendar/gui/apps_evolution_calendar.schemas.in
+++ b/calendar/gui/apps_evolution_calendar.schemas.in
@@ -550,6 +550,18 @@
</locale>
</schema>
+ <schema>
+ <key>/schemas/apps/evolution/calendar/display/month_scroll_by_week</key>
+ <applyto>/apps/evolution/calendar/display/month_scroll_by_week</applyto>
+ <owner>evolution-calendar</owner>
+ <type>bool</type>
+ <default>false</default>
+ <locale name="C">
+ <short>Scroll Month View by a week</short>
+ <long>Whether to scroll a Month View by a week, not by a month.</long>
+ </locale>
+ </schema>
+
<!-- Date navigator -->
<schema>
diff --git a/calendar/gui/calendar-config-keys.h b/calendar/gui/calendar-config-keys.h
index 15edb32c8e..4e7ec7c254 100644
--- a/calendar/gui/calendar-config-keys.h
+++ b/calendar/gui/calendar-config-keys.h
@@ -38,7 +38,7 @@ G_BEGIN_DECLS
#define CALENDAR_CONFIG_DAY_END_HOUR CALENDAR_CONFIG_PREFIX "/display/day_end_hour"
#define CALENDAR_CONFIG_DAY_END_MINUTE CALENDAR_CONFIG_PREFIX "/display/day_end_minute"
#define CALENDAR_CONFIG_TIME_DIVISIONS CALENDAR_CONFIG_PREFIX "/display/time_divisions"
-#define CALENDAR_CONFIG_TIME_DIVISIONS CALENDAR_CONFIG_PREFIX "/display/time_divisions"
+#define CALENDAR_CONFIG_MONTH_SCROLL_BY_WEEK CALENDAR_CONFIG_PREFIX "/display/month_scroll_by_week"
#define CALENDAR_CONFIG_MARCUS_BAINS_LINE CALENDAR_CONFIG_PREFIX "/display/marcus_bains_line"
#define CALENDAR_CONFIG_MARCUS_BAINS_COLOR_DAYVIEW CALENDAR_CONFIG_PREFIX "/display/marcus_bains_color_dayview"
#define CALENDAR_CONFIG_MARCUS_BAINS_COLOR_TIMEBAR CALENDAR_CONFIG_PREFIX "/display/marcus_bains_color_timebar"
diff --git a/calendar/gui/calendar-config.c b/calendar/gui/calendar-config.c
index 3f62cd9e9f..11c3c8f33d 100644
--- a/calendar/gui/calendar-config.c
+++ b/calendar/gui/calendar-config.c
@@ -437,6 +437,35 @@ calendar_config_add_notification_time_divisions (GConfClientNotifyFunc func, gpo
return id;
}
+/* Scroll in a month view by a week, not by a month */
+gboolean
+calendar_config_get_month_scroll_by_week (void)
+{
+ calendar_config_init ();
+
+ return gconf_client_get_bool (config, CALENDAR_CONFIG_MONTH_SCROLL_BY_WEEK, NULL);
+}
+
+void
+calendar_config_set_month_scroll_by_week (gboolean value)
+{
+ calendar_config_init ();
+
+ gconf_client_set_bool (config, CALENDAR_CONFIG_MONTH_SCROLL_BY_WEEK, value, NULL);
+}
+
+guint
+calendar_config_add_notification_month_scroll_by_week (GConfClientNotifyFunc func, gpointer data)
+{
+ guint id;
+
+ calendar_config_init ();
+
+ id = gconf_client_notify_add (config, CALENDAR_CONFIG_MONTH_SCROLL_BY_WEEK, func, data, NULL, NULL);
+
+ return id;
+}
+
/* Whether we show the Marcus Bains Line (current time), and in what colors. */
void
calendar_config_get_marcus_bains (gboolean *show_line, const char **dayview_color, const char **timebar_color)
diff --git a/calendar/gui/calendar-config.h b/calendar/gui/calendar-config.h
index 97e4fe13d7..09a9a7d53b 100644
--- a/calendar/gui/calendar-config.h
+++ b/calendar/gui/calendar-config.h
@@ -247,15 +247,9 @@ guint calendar_config_add_notification_day_second_zone (GConfClientNotifyFunc
gboolean calendar_config_get_ba_reminder (int *interval, CalUnits *units);
void calendar_config_set_ba_reminder (gboolean *enabled, int *interval, CalUnits *units);
-GSList *calendar_config_get_day_second_zones (void);
-void calendar_config_free_day_second_zones (GSList *zones);
-void calendar_config_set_day_second_zone (const char *location);
-char * calendar_config_get_day_second_zone (void);
-void calendar_config_select_day_second_zone (void);
-guint calendar_config_add_notification_day_second_zone (GConfClientNotifyFunc func, gpointer data);
-
-/* Birthdays & Anniversaries reminder settings */
-gboolean calendar_config_get_ba_reminder (int *interval, CalUnits *units);
-void calendar_config_set_ba_reminder (gboolean *enabled, int *interval, CalUnits *units);
+/* Scroll in a month view by a week, not by a month */
+gboolean calendar_config_get_month_scroll_by_week (void);
+void calendar_config_set_month_scroll_by_week (gboolean value);
+guint calendar_config_add_notification_month_scroll_by_week (GConfClientNotifyFunc func, gpointer data);
#endif /* _CALENDAR_CONFIG_H_ */
diff --git a/calendar/gui/dialogs/cal-prefs-dialog.c b/calendar/gui/dialogs/cal-prefs-dialog.c
index 6d50a406b3..cdef86eb5a 100644
--- a/calendar/gui/dialogs/cal-prefs-dialog.c
+++ b/calendar/gui/dialogs/cal-prefs-dialog.c
@@ -326,6 +326,12 @@ dview_show_week_no_toggled (GtkToggleButton *toggle, CalendarPrefsDialog *prefs)
}
static void
+month_scroll_by_week_toggled (GtkToggleButton *toggle, CalendarPrefsDialog *prefs)
+{
+ calendar_config_set_month_scroll_by_week (gtk_toggle_button_get_active (toggle));
+}
+
+static void
hide_completed_tasks_toggled (GtkToggleButton *toggle, CalendarPrefsDialog *prefs)
{
gboolean hide;
@@ -521,6 +527,7 @@ setup_changes (CalendarPrefsDialog *prefs)
g_signal_connect (G_OBJECT (prefs->compress_weekend), "toggled", G_CALLBACK (compress_weekend_toggled), prefs);
g_signal_connect (G_OBJECT (prefs->dnav_show_week_no), "toggled", G_CALLBACK (dnav_show_week_no_toggled), prefs);
g_signal_connect (G_OBJECT (prefs->dview_show_week_no), "toggled", G_CALLBACK (dview_show_week_no_toggled), prefs);
+ g_signal_connect (G_OBJECT (prefs->month_scroll_by_week), "toggled", G_CALLBACK (month_scroll_by_week_toggled), prefs);
g_signal_connect (G_OBJECT (prefs->tasks_hide_completed), "toggled",
G_CALLBACK (hide_completed_tasks_toggled), prefs);
@@ -695,6 +702,9 @@ show_config (CalendarPrefsDialog *prefs)
/* Day/Work Week view - Show Week Number. */
e_dialog_toggle_set (prefs->dview_show_week_no, calendar_config_get_dview_show_week_no ());
+ /* Month View - Scroll by a week */
+ e_dialog_toggle_set (prefs->month_scroll_by_week, calendar_config_get_month_scroll_by_week ());
+
/* Task list */
show_task_list_config (prefs);
@@ -825,6 +835,7 @@ calendar_prefs_dialog_construct (CalendarPrefsDialog *prefs,
prefs->compress_weekend = glade_xml_get_widget (gui, "compress_weekend");
prefs->dnav_show_week_no = glade_xml_get_widget (gui, "dnav_show_week_no");
prefs->dview_show_week_no = glade_xml_get_widget (gui, "dview_show_week_no");
+ prefs->month_scroll_by_week = glade_xml_get_widget (gui, "month_scroll_by_week");
prefs->tasks_due_today_color = glade_xml_get_widget (gui, "tasks_due_today_color");
prefs->tasks_overdue_color = glade_xml_get_widget (gui, "tasks_overdue_color");
prefs->tasks_hide_completed = glade_xml_get_widget (gui, "tasks_hide_completed");
diff --git a/calendar/gui/dialogs/cal-prefs-dialog.glade b/calendar/gui/dialogs/cal-prefs-dialog.glade
index 867abdbb22..a279ad1107 100644
--- a/calendar/gui/dialogs/cal-prefs-dialog.glade
+++ b/calendar/gui/dialogs/cal-prefs-dialog.glade
@@ -1368,6 +1368,25 @@ Days</property>
<property name="fill">False</property>
</packing>
</child>
+
+ <child>
+ <widget class="GtkCheckButton" id="month_scroll_by_week">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="label" translatable="yes">Sc_roll Month View by a week</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>
+ <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>
diff --git a/calendar/gui/dialogs/cal-prefs-dialog.h b/calendar/gui/dialogs/cal-prefs-dialog.h
index 84c1873e9a..ba1bf607ea 100644
--- a/calendar/gui/dialogs/cal-prefs-dialog.h
+++ b/calendar/gui/dialogs/cal-prefs-dialog.h
@@ -85,6 +85,7 @@ struct _CalendarPrefsDialog {
GtkWidget *compress_weekend;
GtkWidget *dnav_show_week_no;
GtkWidget *dview_show_week_no;
+ GtkWidget *month_scroll_by_week;
GtkWidget *tasks_due_today_color;
GtkWidget *tasks_overdue_color;
GtkWidget *tasks_hide_completed;
diff --git a/calendar/gui/dialogs/calendar-setup.c b/calendar/gui/dialogs/calendar-setup.c
index 724206a072..b182f9cc78 100644
--- a/calendar/gui/dialogs/calendar-setup.c
+++ b/calendar/gui/dialogs/calendar-setup.c
@@ -31,7 +31,6 @@
#include <libedataserver/e-source.h>
#include <libedataserver/e-source-list.h>
#include <glib/gi18n.h>
-#include <libgnomeui/libgnomeui.h>
#include <libecal/e-cal.h>
#include "calendar-setup.h"
#include "../e-cal-config.h"
diff --git a/calendar/gui/e-calendar-table.c b/calendar/gui/e-calendar-table.c
index 6eecb856b0..a4320273ac 100644
--- a/calendar/gui/e-calendar-table.c
+++ b/calendar/gui/e-calendar-table.c
@@ -34,7 +34,9 @@
#include <unistd.h>
#include <glib/gi18n.h>
#include <glib/gstdio.h>
-#include <widgets/misc/e-gui-utils.h>
+#include <gtk/gtk.h>
+#include <gdk/gdkkeysyms.h>
+#include <misc/e-gui-utils.h>
#include <table/e-cell-checkbox.h>
#include <table/e-cell-toggle.h>
#include <table/e-cell-text.h>
diff --git a/calendar/gui/e-comp-editor-registry.c b/calendar/gui/e-comp-editor-registry.c
index 9855d12462..31b46372b2 100644
--- a/calendar/gui/e-comp-editor-registry.c
+++ b/calendar/gui/e-comp-editor-registry.c
@@ -24,7 +24,6 @@
#include <config.h>
#endif
-#include <gnome.h>
#include "e-comp-editor-registry.h"
struct _ECompEditorRegistryPrivate {
diff --git a/calendar/gui/e-week-view.c b/calendar/gui/e-week-view.c
index 53955c5bbe..2120d024d0 100644
--- a/calendar/gui/e-week-view.c
+++ b/calendar/gui/e-week-view.c
@@ -505,6 +505,8 @@ e_week_view_init (EWeekView *week_view)
week_view->spans = NULL;
week_view->multi_week_view = FALSE;
+ week_view->month_scroll_by_week = FALSE;
+ week_view->scroll_by_week_notif_id = 0;
week_view->update_base_date = TRUE;
week_view->weeks_shown = 6;
week_view->rows = 6;
@@ -704,6 +706,11 @@ e_week_view_destroy (GtkObject *object)
week_view->resize_width_cursor = NULL;
}
+ if (week_view->scroll_by_week_notif_id) {
+ calendar_config_remove_notification (week_view->scroll_by_week_notif_id);
+ week_view->scroll_by_week_notif_id = 0;
+ }
+
GTK_OBJECT_CLASS (e_week_view_parent_class)->destroy (object);
}
@@ -1644,6 +1651,19 @@ e_week_view_recalc_day_starts (EWeekView *week_view,
}
}
+static void
+month_scrol_by_week_changed_cb (GConfClient *client, guint cnxn_id, GConfEntry *entry, gpointer user_data)
+{
+ EWeekView *week_view = user_data;
+
+ g_return_if_fail (week_view != NULL);
+ g_return_if_fail (E_IS_WEEK_VIEW (week_view));
+
+ if (week_view->multi_week_view && week_view->month_scroll_by_week != calendar_config_get_month_scroll_by_week ()) {
+ week_view->multi_week_view = FALSE;
+ e_week_view_set_multi_week_view (week_view, TRUE);
+ }
+}
gboolean
e_week_view_get_multi_week_view (EWeekView *week_view)
@@ -1670,11 +1690,26 @@ e_week_view_set_multi_week_view (EWeekView *week_view,
if (multi_week_view) {
gtk_widget_show (week_view->titles_canvas);
- page_increment = 4;
- page_size = 5;
+ week_view->month_scroll_by_week = calendar_config_get_month_scroll_by_week ();
+
+ if (!week_view->scroll_by_week_notif_id)
+ week_view->scroll_by_week_notif_id = calendar_config_add_notification_month_scroll_by_week (month_scrol_by_week_changed_cb, week_view);
+
+ if (week_view->month_scroll_by_week) {
+ page_increment = 1;
+ page_size = 1;
+ } else {
+ page_increment = 4;
+ page_size = 5;
+ }
} else {
gtk_widget_hide (week_view->titles_canvas);
page_increment = page_size = 1;
+
+ if (week_view->scroll_by_week_notif_id) {
+ calendar_config_remove_notification (week_view->scroll_by_week_notif_id);
+ week_view->scroll_by_week_notif_id = 0;
+ }
}
adjustment = GTK_RANGE (week_view->vscrollbar)->adjustment;
@@ -1732,8 +1767,13 @@ e_week_view_set_weeks_shown (EWeekView *week_view,
week_view->weeks_shown = weeks_shown;
if (week_view->multi_week_view) {
- page_increment = 4;
- page_size = 5;
+ if (week_view->month_scroll_by_week) {
+ page_increment = 1;
+ page_size = 1;
+ } else {
+ page_increment = 4;
+ page_size = 5;
+ }
adjustment = GTK_RANGE (week_view->vscrollbar)->adjustment;
adjustment->page_increment = page_increment;
diff --git a/calendar/gui/e-week-view.h b/calendar/gui/e-week-view.h
index 132857c712..2458efcdd1 100644
--- a/calendar/gui/e-week-view.h
+++ b/calendar/gui/e-week-view.h
@@ -203,6 +203,10 @@ struct _EWeekView
one week is shown, with a different layout. */
gboolean multi_week_view;
+ /* TRUE when requires scrolling by a week in a multi_week_view */
+ gboolean month_scroll_by_week;
+ guint scroll_by_week_notif_id;
+
gboolean update_base_date;
/* How many weeks we are showing. This is only relevant if
diff --git a/calendar/gui/gnome-cal.c b/calendar/gui/gnome-cal.c
index 7e685dcf91..2217cd5b0e 100644
--- a/calendar/gui/gnome-cal.c
+++ b/calendar/gui/gnome-cal.c
@@ -628,7 +628,7 @@ get_times_for_views (GnomeCalendar *gcal, GnomeCalendarViewType view_type, time_
/* FIXME We should be using the same day of the week enum every where */
display_start = (E_WEEK_VIEW (priv->views[view_type])->display_start_day + 1) % 7;
- if (!priv->range_selected)
+ if (!priv->range_selected && (!E_WEEK_VIEW (priv->views[view_type])->multi_week_view || !E_WEEK_VIEW (priv->views[view_type])->month_scroll_by_week))
*start_time = time_month_begin_with_zone (*start_time, priv->zone);
*start_time = time_week_begin_with_zone (*start_time, display_start, priv->zone);
*end_time = time_add_week_with_zone (*start_time, shown, priv->zone);