aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/print.c
diff options
context:
space:
mode:
authorDamon Chaplin <damon@ximian.com>2001-10-28 10:26:21 +0800
committerDamon Chaplin <damon@src.gnome.org>2001-10-28 10:26:21 +0800
commit70708440caf29c52e8d2a07872304a4874590fbe (patch)
tree58df4f77409063261c3e1dcadd8ac47685f24714 /calendar/gui/print.c
parent27c2d8fee607bab0431bc5673d092d30bc9a4a76 (diff)
downloadgsoc2013-evolution-70708440caf29c52e8d2a07872304a4874590fbe.tar
gsoc2013-evolution-70708440caf29c52e8d2a07872304a4874590fbe.tar.gz
gsoc2013-evolution-70708440caf29c52e8d2a07872304a4874590fbe.tar.bz2
gsoc2013-evolution-70708440caf29c52e8d2a07872304a4874590fbe.tar.lz
gsoc2013-evolution-70708440caf29c52e8d2a07872304a4874590fbe.tar.xz
gsoc2013-evolution-70708440caf29c52e8d2a07872304a4874590fbe.tar.zst
gsoc2013-evolution-70708440caf29c52e8d2a07872304a4874590fbe.zip
when the week start day is set to Sunday, we have to be careful to make
2001-10-27 Damon Chaplin <damon@ximian.com> * gui/print.c (print_week_view): (range_selector_new): when the week start day is set to Sunday, we have to be careful to make sure we print the correct week, since the previous Saturday is actually printed first. Fixes bug #13687. (print_week_summary): always set compress_weekend to true if multi_week_view is FALSE (i.e. we are printing the week view). Fixes bug #13688. * gui/e-itip-control.c (send_freebusy): use the timezones from the DTSTART and DTEND. (write_label_piece): output the date-time and the timezone after it. Note that we may want to convert it to the current timezone and display that as well. Also converted COMPLETED to the current timezone. And fixed all uses of old timezone functions. * gui/dialogs/comp-editor.c (commit_all_fields): added function to set the focus in the window to NULL, so all fields lose their focus, so they emit "changed" signals and update their values if needed. We call this when most menu commands are used, e.g. 'Save and Close', 'Print' etc. Fixes bug #11434. In future we should also check fields are valid and show dialogs if they are not. * gui/calendar-model.c (get_completed): use the completed value properly. Fixes bug #13694. * cal-util/timeutil.c (icaltimetype_to_tm_with_zone): don't check from_zone and to_zone != NULL. A NULL zone is valid, it is for floating times. svn path=/trunk/; revision=14266
Diffstat (limited to 'calendar/gui/print.c')
-rw-r--r--calendar/gui/print.c27
1 files changed, 21 insertions, 6 deletions
diff --git a/calendar/gui/print.c b/calendar/gui/print.c
index c9cca5667b..ba96781ccf 100644
--- a/calendar/gui/print.c
+++ b/calendar/gui/print.c
@@ -1495,7 +1495,10 @@ print_week_summary (GnomePrintContext *pc, GnomeCalendar *gcal,
psi.month = month;
/* Get a few config settings. */
- psi.compress_weekend = calendar_config_get_compress_weekend ();
+ if (multi_week_view)
+ psi.compress_weekend = calendar_config_get_compress_weekend ();
+ else
+ psi.compress_weekend = TRUE;
psi.use_24_hour_format = calendar_config_get_24_hour_format ();
/* We convert this from (0 = Sun, 6 = Sat) to (0 = Mon, 6 = Sun). */
@@ -1837,9 +1840,15 @@ range_selector_new (GtkWidget *dialog, time_t at, int *view)
week_start_day = calendar_config_get_week_start_day ();
week_begin = time_week_begin_with_zone (at, week_start_day, zone);
/* If the week starts on a Sunday, we have to show the Saturday first,
- since the weekend is compressed. */
- if (week_start_day == 0)
- week_begin = time_add_day_with_zone (week_begin, -1, zone);
+ since the weekend is compressed. If the original date passed in was
+ a Saturday, we need to move on to the next Saturday, else we move
+ back to the last one. */
+ if (week_start_day == 0) {
+ if (tm.tm_wday == 6)
+ week_begin = time_add_day_with_zone (week_begin, 6, zone);
+ else
+ week_begin = time_add_day_with_zone (week_begin, -1, zone);
+ }
week_end = time_add_day_with_zone (week_begin, 6, zone);
week_begin_tm = *convert_timet_to_struct_tm (week_begin, zone);
@@ -1955,18 +1964,24 @@ print_week_view (GnomePrintContext *pc, GnomeCalendar *gcal, time_t date,
char buf[100];
time_t when;
gint week_start_day;
+ struct tm tm;
header = top - HEADER_HEIGHT;
/* FIXME: What is the name supposed to be for? */
gnome_print_beginpage (pc, "Calendar Week View");
+ tm = *convert_timet_to_struct_tm (date, zone);
week_start_day = calendar_config_get_week_start_day ();
when = time_week_begin_with_zone (date, week_start_day, zone);
/* If the week starts on a Sunday, we have to show the Saturday first,
since the weekend is compressed. */
- if (week_start_day == 0)
- when = time_add_day_with_zone (when, -1, zone);
+ if (week_start_day == 0) {
+ if (tm.tm_wday == 6)
+ when = time_add_day_with_zone (when, 6, zone);
+ else
+ when = time_add_day_with_zone (when, -1, zone);
+ }
/* Print the main week view. */
print_week_summary (pc, gcal, when, FALSE, 1, 0,