aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gncal-week-view.c
diff options
context:
space:
mode:
authorMiguel de Icaza <miguel@nuclecu.unam.mx>1998-04-22 08:16:43 +0800
committerArturo Espinosa <unammx@src.gnome.org>1998-04-22 08:16:43 +0800
commit45abc2cbefa6d1dfafeb6a8351c35d5c841f87c8 (patch)
treee24787b60f3fd2cb7a66a71d2d4f6a11d36232bb /calendar/gncal-week-view.c
parentb707ff2b15af01713ebac9a572b798485bb4b288 (diff)
downloadgsoc2013-evolution-45abc2cbefa6d1dfafeb6a8351c35d5c841f87c8.tar.gz
gsoc2013-evolution-45abc2cbefa6d1dfafeb6a8351c35d5c841f87c8.tar.zst
gsoc2013-evolution-45abc2cbefa6d1dfafeb6a8351c35d5c841f87c8.zip
Lots of changes:
Lots of changes: 1998-04-21 Miguel de Icaza <miguel@nuclecu.unam.mx> 1. gEdit got Gnomified: gnome-stock, gnome-app, i18n tretment + integration into gnome-utils compilation. Original configure.in is still there for Alex/Evans to redistribute as Gtk App (I tried to ifdef gnome code). 2. gHex: warning fixes + crash fixes + i18n fixes. 3. GnCal: week view shows date range (needs some fixing); changed the day view order; other stuff I dont remember 4. GTop: more i18n treatmnet. 5. Updated Spanish translation. svn path=/trunk/; revision=178
Diffstat (limited to 'calendar/gncal-week-view.c')
-rw-r--r--calendar/gncal-week-view.c38
1 files changed, 28 insertions, 10 deletions
diff --git a/calendar/gncal-week-view.c b/calendar/gncal-week-view.c
index e73c0ccf25..7de8899cb3 100644
--- a/calendar/gncal-week-view.c
+++ b/calendar/gncal-week-view.c
@@ -29,7 +29,7 @@ gncal_week_view_get_type (void)
(GtkArgGetFunc) NULL
};
- week_view_type = gtk_type_unique (gtk_table_get_type (), &week_view_info);
+ week_view_type = gtk_type_unique (gtk_vbox_get_type (), &week_view_info);
}
return week_view_type;
@@ -93,30 +93,33 @@ GtkWidget *
gncal_week_view_new (GnomeCalendar *calendar, time_t start_of_week)
{
GncalWeekView *wview;
+ GtkWidget *table;
int i;
g_return_val_if_fail (calendar != NULL, NULL);
wview = gtk_type_new (gncal_week_view_get_type ());
- gtk_table_set_homogeneous (GTK_TABLE (wview), TRUE);
-
+ table = gtk_table_new (0, 0, 0);
+ gtk_table_set_homogeneous (GTK_TABLE (table), TRUE);
+ wview->label = gtk_label_new ("");
+ gtk_box_pack_start (GTK_BOX (wview), wview->label, 0, 0, 0);
+ gtk_box_pack_start (GTK_BOX (wview), table, 1, 1, 0);
wview->calendar = calendar;
-
for (i = 0; i < 7; i++) {
wview->days[i] = GNCAL_DAY_VIEW (gncal_day_view_new (calendar, 0, 0));
gtk_signal_connect (GTK_OBJECT (wview->days [i]), "button_press_event",
GTK_SIGNAL_FUNC(double_click_on_weekday), wview);
if (i < 5)
- gtk_table_attach (GTK_TABLE (wview), GTK_WIDGET (wview->days[i]),
+ gtk_table_attach (GTK_TABLE (table), GTK_WIDGET (wview->days[i]),
i, i + 1,
0, 1,
GTK_EXPAND | GTK_FILL | GTK_SHRINK,
GTK_EXPAND | GTK_FILL | GTK_SHRINK,
0, 0);
else
- gtk_table_attach (GTK_TABLE (wview), GTK_WIDGET (wview->days[i]),
+ gtk_table_attach (GTK_TABLE (table), GTK_WIDGET (wview->days[i]),
i - 2, i - 1,
1, 2,
GTK_EXPAND | GTK_FILL | GTK_SHRINK,
@@ -135,7 +138,7 @@ gncal_week_view_new (GnomeCalendar *calendar, time_t start_of_week)
gtk_calendar_display_options (wview->gtk_calendar,
GTK_CALENDAR_SHOW_HEADING | GTK_CALENDAR_SHOW_DAY_NAMES);
- gtk_table_attach (GTK_TABLE (wview), GTK_WIDGET (wview->gtk_calendar),
+ gtk_table_attach (GTK_TABLE (table), GTK_WIDGET (wview->gtk_calendar),
0, 3,
1, 2,
GTK_EXPAND | GTK_FILL | GTK_SHRINK,
@@ -172,7 +175,7 @@ gncal_week_view_update (GncalWeekView *wview, iCalObject *ico, int flags)
void
gncal_week_view_set (GncalWeekView *wview, time_t start_of_week)
{
- struct tm tm;
+ struct tm tm, start;
time_t day_start, day_end;
int i;
@@ -192,7 +195,8 @@ gncal_week_view_set (GncalWeekView *wview, time_t start_of_week)
tm.tm_sec = 0;
day_start = mktime (&tm);
-
+ start = tm;
+
/* Calendar */
gtk_calendar_select_month (wview->gtk_calendar, tm.tm_mon, tm.tm_year + 1900);
@@ -207,6 +211,20 @@ gncal_week_view_set (GncalWeekView *wview, time_t start_of_week)
day_start = day_end;
}
-
+
update (wview, FALSE, NULL, 0);
+
+ /* The label */
+ {
+ char buf [80];
+ int len;
+
+ strftime (buf, sizeof (buf), "%A %d %Y - ", &start);
+ len = strlen (buf);
+
+ strftime (buf + len, sizeof (buf) - len, "%A %d %Y", &tm);
+ gtk_label_set (GTK_LABEL (wview->label), buf);
+
+ }
}
+