aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/gnome-cal.c
diff options
context:
space:
mode:
Diffstat (limited to 'calendar/gui/gnome-cal.c')
-rw-r--r--calendar/gui/gnome-cal.c149
1 files changed, 132 insertions, 17 deletions
diff --git a/calendar/gui/gnome-cal.c b/calendar/gui/gnome-cal.c
index 876af5fe28..83e9c75bfe 100644
--- a/calendar/gui/gnome-cal.c
+++ b/calendar/gui/gnome-cal.c
@@ -25,6 +25,7 @@
#include "event-editor.h"
#include "gnome-cal.h"
#include "calendar-commands.h"
+#include "calendar-config.h"
@@ -136,6 +137,7 @@ static void gnome_calendar_update_date_navigator (GnomeCalendar *gcal);
static void gnome_calendar_on_date_navigator_style_set (GtkWidget *widget,
GtkStyle *previous_style,
gpointer data);
+static void gnome_calendar_update_paned_quanta (GnomeCalendar *gcal);
static void gnome_calendar_on_date_navigator_size_allocate (GtkWidget *widget,
GtkAllocation *allocation,
gpointer data);
@@ -274,6 +276,8 @@ setup_widgets (GnomeCalendar *gcal)
gtk_widget_show (priv->month_view);
gtk_notebook_append_page (GTK_NOTEBOOK (priv->notebook),
priv->month_view, gtk_label_new (""));
+
+ gnome_calendar_update_config_settings (gcal, TRUE);
}
/* Object initialization function for the gnome calendar */
@@ -296,14 +300,6 @@ gnome_calendar_init (GnomeCalendar *gcal)
priv->selection_start_time = time_day_begin (time (NULL));
priv->selection_end_time = time_add_day (priv->selection_start_time, 1);
- /* Set the default pane positions. These will eventually come from
- gconf settings. They are multiples of calendar month widths &
- heights in the date navigator. */
- priv->hpane_pos = 1.0;
- priv->vpane_pos = 1.0;
- priv->hpane_pos_month_view = 0.0;
- priv->vpane_pos_month_view = 1.0;
-
setup_widgets (gcal);
}
@@ -1606,9 +1602,119 @@ gnome_calendar_tag_calendar (GnomeCalendar *gcal, ECalendar *ecal)
}
+/* Tells the calendar to reload all config settings.
+ If initializing is TRUE it sets the pane positions as well. (We don't
+ want to reset the pane positions after the user clicks 'Apply' in the
+ preferences dialog.) */
+void
+gnome_calendar_update_config_settings (GnomeCalendar *gcal,
+ gboolean initializing)
+{
+ GnomeCalendarPrivate *priv;
+ CalWeekdays working_days;
+ gint week_start_day, time_divisions;
+ gint start_hour, start_minute, end_hour, end_minute;
+ gboolean use_24_hour, show_event_end, compress_weekend;
+ gboolean dnav_show_week_no;
+
+ g_return_if_fail (GNOME_IS_CALENDAR (gcal));
+
+ priv = gcal->priv;
+
+ working_days = calendar_config_get_working_days ();
+ /* CalWeekdays and EDayViewDays use the same bit-masks, so we can
+ use the same value. */
+ e_day_view_set_working_days (E_DAY_VIEW (priv->day_view),
+ (EDayViewDays) working_days);
+ e_day_view_set_working_days (E_DAY_VIEW (priv->work_week_view),
+ (EDayViewDays) working_days);
+
+ /* Note that this is 0 (Sun) to 6 (Sat). */
+ week_start_day = calendar_config_get_week_start_day ();
+ /* FIXME: Add support for these. */
+#if 0
+ e_day_view_set_week_start_day (E_DAY_VIEW (priv->day_view),
+ week_start_day);
+ e_day_view_set_week_start_day (E_DAY_VIEW (priv->work_week_view),
+ week_start_day);
+ e_week_view_set_week_start_day (E_WEEK_VIEW (priv->week_view),
+ week_start_day);
+ e_week_view_set_week_start_day (E_WEEK_VIEW (priv->month_view),
+ week_start_day);
+#endif
+ gnome_canvas_item_set (GNOME_CANVAS_ITEM (E_CALENDAR (priv->date_navigator)->calitem),
+ "week_start_day", (week_start_day + 6) % 7,
+ NULL);
+
+ start_hour = calendar_config_get_day_start_hour ();
+ start_minute = calendar_config_get_day_start_minute ();
+ end_hour = calendar_config_get_day_end_hour ();
+ end_minute = calendar_config_get_day_end_minute ();
+ e_day_view_set_working_day (E_DAY_VIEW (priv->day_view),
+ start_hour, start_minute,
+ end_hour, end_minute);
+ e_day_view_set_working_day (E_DAY_VIEW (priv->work_week_view),
+ start_hour, start_minute,
+ end_hour, end_minute);
+
+ use_24_hour = calendar_config_get_24_hour_format ();
+ e_day_view_set_24_hour_format (E_DAY_VIEW (priv->day_view),
+ use_24_hour);
+ e_day_view_set_24_hour_format (E_DAY_VIEW (priv->work_week_view),
+ use_24_hour);
+ /* FIXME: Add support for these. */
+#if 0
+ e_week_view_set_24_hour_format (E_WEEK_VIEW (priv->week_view),
+ use_24_hour);
+ e_week_view_set_24_hour_format (E_WEEK_VIEW (priv->month_view),
+ use_24_hour);
+#endif
+
+ time_divisions = calendar_config_get_time_divisions ();
+ e_day_view_set_mins_per_row (E_DAY_VIEW (priv->day_view),
+ time_divisions);
+ e_day_view_set_mins_per_row (E_DAY_VIEW (priv->work_week_view),
+ time_divisions);
+
+ show_event_end = calendar_config_get_show_event_end ();
+ /* FIXME: Add support for these. */
+#if 0
+ e_day_view_set_show_event_end (E_DAY_VIEW (priv->day_view),
+ show_event_end);
+ e_day_view_set_show_event_end (E_DAY_VIEW (priv->work_week_view),
+ show_event_end);
+ e_week_view_set_show_event_end (E_WEEK_VIEW (priv->week_view),
+ show_event_end);
+ e_week_view_set_show_event_end (E_WEEK_VIEW (priv->month_view),
+ show_event_end);
+#endif
+
+ compress_weekend = calendar_config_get_compress_weekend ();
+ e_week_view_set_compress_weekend (E_WEEK_VIEW (priv->month_view),
+ compress_weekend);
+
+ dnav_show_week_no = calendar_config_get_dnav_show_week_no ();
+ gnome_canvas_item_set (GNOME_CANVAS_ITEM (E_CALENDAR (priv->date_navigator)->calitem),
+ "show_week_numbers", dnav_show_week_no,
+ NULL);
+
+ if (initializing) {
+ priv->hpane_pos = calendar_config_get_hpane_pos ();
+ priv->vpane_pos = calendar_config_get_vpane_pos ();
+ priv->hpane_pos_month_view = calendar_config_get_month_hpane_pos ();
+ priv->vpane_pos_month_view = calendar_config_get_month_vpane_pos ();
+ } else {
+ gnome_calendar_update_paned_quanta (gcal);
+ }
+}
+
+
+/*
+ * FIXME: These are for the old config code and will be removed eventually.
+ */
+
/* This is called when the day begin & end times, the AM/PM flag, or the
- week_starts_on_monday flags are changed.
- FIXME: Which of these options do we want the new views to support? */
+ week_starts_on_monday flags are changed. */
void
gnome_calendar_time_format_changed (GnomeCalendar *gcal)
{
@@ -1641,6 +1747,8 @@ gnome_calendar_todo_properties_changed (GnomeCalendar *gcal)
}
+
+
void
gnome_calendar_set_selected_time_range (GnomeCalendar *gcal,
time_t start_time,
@@ -2005,21 +2113,23 @@ gnome_calendar_on_date_navigator_style_set (GtkWidget *widget,
GtkStyle *previous_style,
gpointer data)
{
- GnomeCalendar *gcal;
+ gnome_calendar_update_paned_quanta (GNOME_CALENDAR (data));
+}
+
+
+static void
+gnome_calendar_update_paned_quanta (GnomeCalendar *gcal)
+{
GnomeCalendarPrivate *priv;
- ECalendar *ecal;
gint row_height, col_width;
gint top_border, bottom_border, left_border, right_border;
- ecal = E_CALENDAR (widget);
-
- gcal = GNOME_CALENDAR (data);
priv = gcal->priv;
e_calendar_get_border_size (priv->date_navigator,
&top_border, &bottom_border,
&left_border, &right_border);
- gtk_object_get (GTK_OBJECT (ecal->calitem),
+ gtk_object_get (GTK_OBJECT (priv->date_navigator->calitem),
"row_height", &row_height,
"column_width", &col_width,
NULL);
@@ -2085,12 +2195,17 @@ gnome_calendar_on_date_navigator_size_allocate (GtkWidget *widget,
hpane_pos = (gfloat) width / col_width;
vpane_pos = (gfloat) height / row_height;
- if (priv->current_view_type == VIEW_MONTH && !priv->range_selected) {
+ if (priv->current_view_type == VIEW_MONTH
+ && !priv->range_selected) {
priv->hpane_pos_month_view = hpane_pos;
priv->vpane_pos_month_view = vpane_pos;
+ calendar_config_set_month_hpane_pos (hpane_pos);
+ calendar_config_set_month_vpane_pos (vpane_pos);
} else {
priv->hpane_pos = hpane_pos;
priv->vpane_pos = vpane_pos;
+ calendar_config_set_hpane_pos (hpane_pos);
+ calendar_config_set_vpane_pos (vpane_pos);
}
}
}
t/security/p5-IO-Socket-SSL?id=4fea3efb1be8026e2f0930029d6ecda495e94e77'>Remove Perl core modulesSunpoet Po-Chuan Hsieh2017-07-011-5/+4 * - update to 2.044Philippe Audeoud2017-01-312-4/+4 * - Update to 2.043Philippe Audeoud2017-01-162-4/+4 * - Update to 2.038Philippe Audeoud2016-09-212-4/+4 * - Update to 2.037Philippe Audeoud2016-08-242-4/+4 * - Update to 2.036Philippe Audeoud2016-08-162-4/+4 * - Update to 2.034Philippe Audeoud2016-08-102-4/+4 * - Update to 2.033Philippe Audeoud2016-08-032-4/+4 * - Update to 2.029Philippe Audeoud2016-06-282-4/+4 * - Update to 2.027Philippe Audeoud2016-05-242-3/+4 * - Update to 2.025Philippe Audeoud2016-04-112-3/+3 * Remove ${PORTSDIR}/ from dependencies, categories r, s, t, and u.Mathieu Arnold2016-04-011-5/+5 * - Update to 2.024Philippe Audeoud2016-02-112-3/+3 * - Update to 2.023Philippe Audeoud2016-02-012-3/+3 * - Update to 2.022Philippe Audeoud2016-01-122-3/+3 * - Update to 2.021Philippe Audeoud2015-12-072-3/+3 * - Update to 0.020Philippe Audeoud2015-11-022-3/+3 * - Update to 2.016Philippe Audeoud2015-06-032-3/+3 * - Update to 2.012Philippe Audeoud2015-02-202-3/+3 * - Update to 2.009Philippe Audeoud2015-01-132-3/+3 * - Update to 2.008Philippe Audeoud2015-01-052-3/+3 * - Update to 2.007Philippe Audeoud2014-11-282-4/+3 * Change the way Perl modules are installed, update the default Perl to 5.18.Mathieu Arnold2014-11-262-1/+1 * - Update to 2.006Philippe Audeoud2014-11-253-9/+3 * - Update to 2.002Philippe Audeoud2014-10-292-3/+3 * - Update to 1.998Philippe Audeoud2014-09-082-4/+3 * - Add p5-Mozilla-CA as dependencyPhilippe Audeoud2014-07-221-2/+3 * - Use p5-IO-Socket-IP>=0.31 because of a bug with version 0.30Philippe Audeoud2014-07-181-1/+2 * - Update to 1.997Philippe Audeoud2014-07-152-3/+3 * - Update to 1.994Philippe Audeoud2014-06-232-3/+3 * - Update to 1.993Philippe Audeoud2014-06-163-3/+4 * - Update to 1.992Philippe Audeoud2014-06-022-3/+3 * - Update to 1.991Philippe Audeoud2014-05-282-3/+3 * - Update to 1.988Philippe Audeoud2014-05-192-3/+3 * - Update to 1.985Philippe Audeoud2014-05-162-3/+3 * - Update to 1.984Philippe Audeoud2014-05-132-4/+4 * - Update to 1.981Philippe Audeoud2014-04-233-4/+5 * - Fix shebangPhilippe Audeoud2014-04-041-15/+8 * - Update to 1.975Philippe Audeoud2014-04-032-3/+3 * - Update to 1.972Philippe Audeoud2014-03-242-3/+3 * - Update to 1.970Philippe Audeoud2014-03-192-3/+3 * - Update to 1.969Philippe Audeoud2014-03-182-3/+3 * - fix issue with interactivityPhilippe Audeoud2014-03-141-0/+2 * - Update to 1.968Philippe Audeoud2014-03-142-3/+3 * - Update to 1.967Philippe Audeoud2014-02-072-3/+5 * - Update to 1.962Philippe Audeoud2013-11-292-3/+3 * - Update to 1.961Philippe Audeoud2013-11-272-3/+3 * - Update to 1.960Philippe Audeoud2013-11-152-3/+3 * - Update to 1.958Philippe Audeoud2013-11-122-3/+3 * - Update to 1.955Philippe Audeoud2013-10-313-8/+8 * Add NO_STAGE all over the place in preparation for the staging support (cat: ...Baptiste Daroussin2013-09-211-0/+1 * - Update to 1.953Philippe Audeoud2013-07-312-4/+6 * - Update to 1.94Philippe Audeoud2013-06-133-4/+8 * - Update to 1.84Philippe Audeoud2013-03-142-3/+3 * - Update to 1.83Philippe Audeoud2013-02-052-3/+3 * - Update to 1.82Philippe Audeoud2013-01-302-3/+3 * - Update to 1.81Philippe Audeoud2012-12-122-3/+3 * - Update to 1.80Philippe Audeoud2012-12-042-3/+3 * - Update to 1.77Philippe Audeoud2012-11-162-8/+4 * - Update to 1.76Sunpoet Po-Chuan Hsieh2012-06-282-19/+18 * - Convert all remaining instances of BUILD_DEPENDS=${RUN_DEPENDS} orSteve Wills2012-06-111-1/+1 * - Remove SITE_PERL from *_DEPENDS [1]Philippe Audeoud2012-06-051-5/+8 * - Update to 1.74Philippe Audeoud2012-05-142-3/+3 * - Update to 1.72Philippe Audeoud2012-05-112-3/+3 * - Update to 1.70Philippe Audeoud2012-05-092-3/+3 * - Update to 1.66Philippe Audeoud2012-05-042-3/+3 * - Revert ports/165605 as requested by portmgr@Philip M. Gollucci2012-03-141-0/+3 * - Update to 1.59Philippe Audeoud2012-03-102-3/+3 * - Remove ports that only work with < perl 5.12 (devel/p5-B-Size, devel/p5-Dev...Philip M. Gollucci2012-03-091-3/+0 * - Update to 1.58Philippe Audeoud2012-03-052-3/+3 * - Update to 1.56Philippe Audeoud2012-02-232-3/+3 * - Update to 1.55Philippe Audeoud2012-02-222-3/+3 * - Update to 1.54Philippe Audeoud2012-02-092-3/+3 * - Update to 1.53Philippe Audeoud2011-12-132-3/+3 * - Update to 1.52Philippe Audeoud2011-12-092-3/+3 * - Update to 1.49Philippe Audeoud2011-10-312-3/+3 * - Update to 1.48Philippe Audeoud2011-10-272-3/+3 * - Update to 1.47Philippe Audeoud2011-10-242-3/+3 * - Update to 1.46Philippe Audeoud2011-10-202-3/+3 * - Update to 1.45Philippe Audeoud2011-10-182-3/+3 * - Replace ../../authors in MASTER_SITE_SUBDIR with CPAN:CPANID macro.Andrej Zverev2011-06-201-1/+1 * - Update to 1.44Philippe Audeoud2011-05-312-3/+3 * - Update to 1.43Philippe Audeoud2011-05-132-3/+3 * - Update to 1.40Philippe Audeoud2011-05-042-3/+3 * - Update to 1.39Philippe Audeoud2011-03-072-3/+3 * - Fix CPAN locationPhilippe Audeoud2011-01-231-0/+1 * - Update to 1.38Steve Wills2011-01-222-3/+3 * - Add forgotten INSTALL_TARGET to not append perllocal.podPhilippe Audeoud2010-12-271-0/+1 * - Update to 1.37Philippe Audeoud2010-12-223-7/+10 * - Update to 1.35Philippe Audeoud2010-12-073-5/+9 * - Update to 1.34Philippe Audeoud2010-11-032-4/+4 * - only 13% of the p5- ports embed @comment $FreeBSD$:Philip M. Gollucci2010-09-241-1/+0 * - Update to 1.33Philippe Audeoud2010-05-052-4/+4 * - Update to 1.31Philippe Audeoud2009-09-292-4/+4 * - Update to 1.30Philippe Audeoud2009-08-242-4/+4 * - Update to 1.27Philippe Audeoud2009-07-272-4/+4 * - lang/perl5.6 is dead, remove PERL_LEVEL/PERL_VERSION < 500801 checksPhilip M. Gollucci2009-07-231-7/+1 * - Update to 1.26Philippe Audeoud2009-07-062-4/+4 * - Update to 1.25Philippe Audeoud2009-07-032-5/+5 * Update to 1.24Mathieu Arnold2009-04-082-4/+4 * Update to 1.23Mathieu Arnold2009-02-262-4/+4 * - Update to 1.22Gabor Kovesdan2009-02-022-4/+4 * - update to 1.19Yen-Ming Lee2009-01-082-4/+10 * - update to 1.18Yen-Ming Lee2008-11-192-4/+5 * - update to 1.17Yen-Ming Lee2008-10-182-4/+4 * - Update to 1.16Martin Wilke2008-09-232-4/+4 * - update to 1.15Yen-Ming Lee2008-08-303-13/+8 * Update to 1.14Erwin Lansing2008-07-193-4/+5 * - Update to 1.13Yen-Ming Lee2008-02-082-4/+4 * Update to 1.12Mathieu Arnold2007-10-292-4/+4 * Update to 1.11Erwin Lansing2007-10-162-4/+4 * - Update to 1.10Cheng-Lung Sung2007-10-102-4/+4 * - Update to 1.09Martin Wilke2007-09-172-4/+4 * - Update to 1.08Cheng-Lung Sung2007-08-142-6/+5 * - update to 1.07Yen-Ming Lee2007-06-132-4/+4 * - Update to 1.06Cheng-Lung Sung2007-05-012-4/+4 * - update to 1.05Yen-Ming Lee2007-04-182-4/+4 * - Update to 1.04Cheng-Lung Sung2007-03-292-4/+4 * - Update to 1.03Cheng-Lung Sung2007-03-072-4/+4 * - update to 1.02Yen-Ming Lee2006-12-022-4/+4 * - Update to 1.01Yen-Ming Lee2006-09-223-10/+27 * SHA256ifyEdwin Groothuis2006-01-24