diff options
author | Federico Mena Quintero <federico@nuclecu.unam.mx> | 1998-04-21 08:29:06 +0800 |
---|---|---|
committer | Arturo Espinosa <unammx@src.gnome.org> | 1998-04-21 08:29:06 +0800 |
commit | 65dbe3a3855c8419715f5c9cb898c3326878e97b (patch) | |
tree | bb5dfa04cdafeae4562c9171bada953ccd8fe68a /calendar | |
parent | e9a7215277ccb59d126cd0981d148744068ed148 (diff) | |
download | gsoc2013-evolution-65dbe3a3855c8419715f5c9cb898c3326878e97b.tar gsoc2013-evolution-65dbe3a3855c8419715f5c9cb898c3326878e97b.tar.gz gsoc2013-evolution-65dbe3a3855c8419715f5c9cb898c3326878e97b.tar.bz2 gsoc2013-evolution-65dbe3a3855c8419715f5c9cb898c3326878e97b.tar.lz gsoc2013-evolution-65dbe3a3855c8419715f5c9cb898c3326878e97b.tar.xz gsoc2013-evolution-65dbe3a3855c8419715f5c9cb898c3326878e97b.tar.zst gsoc2013-evolution-65dbe3a3855c8419715f5c9cb898c3326878e97b.zip |
Made it use the new paint_row function instead of painting everything
1998-04-20 Federico Mena Quintero <federico@nuclecu.unam.mx>
* gncal-full-day.c (paint_back): Made it use the new paint_row
function instead of painting everything directly. We calculate
areas in a smarter way so there is even less flicker than before,
especially when selecting regions.
* eventedit.c: Sensitize recurrence widgets properly.
svn path=/trunk/; revision=171
Diffstat (limited to 'calendar')
-rw-r--r-- | calendar/ChangeLog | 7 | ||||
-rw-r--r-- | calendar/TODO | 8 | ||||
-rw-r--r-- | calendar/eventedit.c | 64 | ||||
-rw-r--r-- | calendar/eventedit.h | 3 | ||||
-rw-r--r-- | calendar/gncal-full-day.c | 263 | ||||
-rw-r--r-- | calendar/gui/eventedit.c | 64 | ||||
-rw-r--r-- | calendar/gui/eventedit.h | 3 | ||||
-rw-r--r-- | calendar/gui/gncal-full-day.c | 263 | ||||
-rw-r--r-- | calendar/gui/main.c | 56 | ||||
-rw-r--r-- | calendar/gui/view-utils.c | 2 | ||||
-rw-r--r-- | calendar/main.c | 56 | ||||
-rw-r--r-- | calendar/view-utils.c | 2 |
12 files changed, 417 insertions, 374 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog index c89a0336a1..c2c1472a0d 100644 --- a/calendar/ChangeLog +++ b/calendar/ChangeLog @@ -1,5 +1,12 @@ 1998-04-20 Federico Mena Quintero <federico@nuclecu.unam.mx> + * gncal-full-day.c (paint_back): Made it use the new paint_row + function instead of painting everything directly. We calculate + areas in a smarter way so there is even less flicker than before, + especially when selecting regions. + + * eventedit.c: Sensitize recurrence widgets properly. + * calobj.c (duration_callback): Pass the correct pointer type to is_date_in_list(). diff --git a/calendar/TODO b/calendar/TODO index d9f4592125..9b42850111 100644 --- a/calendar/TODO +++ b/calendar/TODO @@ -8,14 +8,10 @@ Gnome date selection widget: - Make the displayed date be localized properly -- use strftime(). -Event editor dialog: - -- Resize the window and fix whatever is resized in an ugly fashion. - -- Don't allow deleting exceptions when there are none in the list. - Full day view widget: +- Eliminate flicker when dragging a selection. + - Display alarm/whatever flags somewhere. - Layout the children nicely like M$ Schedule or Netscape Calendar do diff --git a/calendar/eventedit.c b/calendar/eventedit.c index d711be4055..f14a159fda 100644 --- a/calendar/eventedit.c +++ b/calendar/eventedit.c @@ -520,7 +520,7 @@ ee_store_recur_rule_to_ical (EventEditor *ee) i = g_slist_length (ee->recur_rr_group) - i - 1; /* buttons are stored in reverse order of insertion */ - /* NOne selected, no rule to be stored */ + /* None selected, no rule to be stored */ if (i == 0) return 0; @@ -933,6 +933,12 @@ recur_month_enable_date (GtkToggleButton *button, EventEditor *ee) } static void +desensitize_on_toggle (GtkToggleButton *toggle, gpointer data) +{ + gtk_widget_set_sensitive (GTK_WIDGET (data), !toggle->active); +} + +static void ee_rp_init_rule (EventEditor *ee) { static char *day_names [] = { N_("Mon"), N_("Tue"), N_("Wed"), N_("Thu"), N_("Fri"), N_("Sat"), N_("Sun") }; @@ -1029,6 +1035,11 @@ ee_rp_init_rule (EventEditor *ee) gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON (r), i == page); gtk_signal_connect (GTK_OBJECT (r), "toggled", GTK_SIGNAL_FUNC (recurrence_toggled), ee); gtk_box_pack_start (GTK_BOX (vbox), r, FALSE, FALSE, 0); + + if (i == 0) + gtk_signal_connect (GTK_OBJECT (r), "toggled", + (GtkSignalFunc) desensitize_on_toggle, + ee->recur_hbox); } ee->recur_rr_group = group; @@ -1141,13 +1152,15 @@ ee_rp_init_rule (EventEditor *ee) gtk_notebook_set_page (notebook, page); - /* Attach to the main table */ + /* Attach to the main box */ - gtk_table_attach (GTK_TABLE (ee->recur_table), f, - 0, 2, 0, 1, - GTK_FILL | GTK_SHRINK, - GTK_FILL | GTK_SHRINK, - 0, 0); + gtk_box_pack_start (GTK_BOX (ee->recur_vbox), f, FALSE, FALSE, 0); +} + +static void +sensitize_on_toggle (GtkToggleButton *toggle, gpointer data) +{ + gtk_widget_set_sensitive (GTK_WIDGET (data), toggle->active); } static void @@ -1190,6 +1203,7 @@ ee_rp_init_ending_date (EventEditor *ee) gtk_box_pack_start (GTK_BOX (hbox), radio1, FALSE, FALSE, 0); ihbox = gtk_hbox_new (FALSE, 4); + gtk_widget_set_sensitive (ihbox, FALSE); gtk_box_pack_start (GTK_BOX (hbox), ihbox, FALSE, FALSE, 0); if (ee->ical->recur) @@ -1200,6 +1214,10 @@ ee_rp_init_ending_date (EventEditor *ee) ee->recur_ed_end_on = widget = gnome_date_edit_new (enddate, FALSE); gtk_box_pack_start (GTK_BOX (ihbox), widget, FALSE, FALSE, 0); + gtk_signal_connect (GTK_OBJECT (radio1), "toggled", + (GtkSignalFunc) sensitize_on_toggle, + ihbox); + /* end after n occurrences */ hbox = gtk_hbox_new (FALSE, 0); @@ -1210,6 +1228,7 @@ ee_rp_init_ending_date (EventEditor *ee) gtk_box_pack_start (GTK_BOX (hbox), radio2, FALSE, FALSE, 0); ihbox = gtk_hbox_new (FALSE, 4); + gtk_widget_set_sensitive (ihbox, FALSE); gtk_box_pack_start (GTK_BOX (hbox), ihbox, FALSE, FALSE, 0); if (ee->ical->recur && ee->ical->recur->duration) @@ -1223,6 +1242,10 @@ ee_rp_init_ending_date (EventEditor *ee) widget = gtk_label_new (_("occurrence(s)")); gtk_box_pack_start (GTK_BOX (ihbox), widget, FALSE, FALSE, 0); + gtk_signal_connect (GTK_OBJECT (radio2), "toggled", + (GtkSignalFunc) sensitize_on_toggle, + ihbox); + /* Activate appropriate item */ if (ee->ical->recur) { @@ -1244,11 +1267,7 @@ ee_rp_init_ending_date (EventEditor *ee) ee->recur_ed_group = group; - gtk_table_attach (GTK_TABLE (ee->recur_table), frame, - 0, 1, 1, 2, - GTK_FILL | GTK_SHRINK, - GTK_FILL | GTK_SHRINK, - 0, 0); + gtk_box_pack_start (GTK_BOX (ee->recur_hbox), frame, FALSE, FALSE, 0); } static char * @@ -1380,27 +1399,28 @@ ee_rp_init_exceptions (EventEditor *ee) /* Done, add to main table */ - gtk_table_attach (GTK_TABLE (ee->recur_table), frame, - 1, 2, 1, 2, - GTK_EXPAND | GTK_FILL | GTK_SHRINK, - GTK_FILL | GTK_SHRINK, - 0, 0); + gtk_box_pack_start (GTK_BOX (ee->recur_hbox), frame, TRUE, TRUE, 0); } static void ee_init_recurrence_page (EventEditor *ee) { - ee->recur_table = gtk_table_new (2, 2, FALSE); - gtk_container_border_width (GTK_CONTAINER (ee->recur_table), 4); - gtk_table_set_row_spacings (GTK_TABLE (ee->recur_table), 4); - gtk_table_set_col_spacings (GTK_TABLE (ee->recur_table), 4); + ee->recur_vbox = gtk_vbox_new (FALSE, 4); + gtk_container_border_width (GTK_CONTAINER (ee->recur_vbox), 4); + + ee->recur_hbox = gtk_hbox_new (FALSE, 4); + gtk_widget_set_sensitive (ee->recur_hbox, FALSE); ee->recur_page_label = gtk_label_new (_("Recurrence")); - gtk_notebook_append_page (GTK_NOTEBOOK (ee->notebook), ee->recur_table, + gtk_notebook_append_page (GTK_NOTEBOOK (ee->notebook), ee->recur_vbox, ee->recur_page_label); ee_rp_init_rule (ee); + + /* pack here so that the box gets inserted after the recurrence rule frame */ + gtk_box_pack_start (GTK_BOX (ee->recur_vbox), ee->recur_hbox, FALSE, FALSE, 0); + ee_rp_init_ending_date (ee); ee_rp_init_exceptions (ee); } diff --git a/calendar/eventedit.h b/calendar/eventedit.h index c7aa5a8405..73dd677d44 100644 --- a/calendar/eventedit.h +++ b/calendar/eventedit.h @@ -33,7 +33,8 @@ typedef struct { GtkWidget *general_radios; GtkWidget *recur_page_label; - GtkWidget *recur_table; + GtkWidget *recur_vbox; + GtkWidget *recur_hbox; GSList *recur_rr_group; GtkWidget *recur_rr_notebook; diff --git a/calendar/gncal-full-day.c b/calendar/gncal-full-day.c index 28815bbfe6..8db460e689 100644 --- a/calendar/gncal-full-day.c +++ b/calendar/gncal-full-day.c @@ -15,6 +15,7 @@ #include "view-utils.h" #include "main.h" + #define TEXT_BORDER 2 #define HANDLE_SIZE 8 #define MIN_WIDTH 300 @@ -998,180 +999,176 @@ gncal_full_day_unrealize (GtkWidget *widget) (* GTK_WIDGET_CLASS (parent_class)->unrealize) (widget); } -static void -paint_back (GncalFullDay *fullday, GdkRectangle *area) -{ +struct paint_info { GtkWidget *widget; - GdkRectangle rect, dest, aarea; struct drag_info *di; + GdkRectangle *area; int x1, y1, width, height; int labels_width; - int f_rows, row_height; - int i, y; - GdkGC *gc; - struct tm tm; - char buf [40]; - - widget = GTK_WIDGET (fullday); + int row_height; + struct tm start_tm; +}; - if (!area) { - area = &aarea; +static void +paint_row (GncalFullDay *fullday, int row, struct paint_info *p) +{ + GdkRectangle rect, dest; + GdkGC *left_gc, *right_gc, *text_gc; + int begin_row, end_row; + struct tm tm; + char buf[40]; - area->x = 0; - area->y = 0; - area->width = widget->allocation.width; - area->height = widget->allocation.height; + begin_row = (day_begin * 60) / fullday->interval; + end_row = (day_end * 60) / fullday->interval; + + /* See which GCs we will use */ + + if ((p->di->sel_rows_used != 0) + && (row >= p->di->sel_start_row) + && (row < (p->di->sel_start_row + p->di->sel_rows_used))) { + left_gc = p->widget->style->bg_gc[GTK_STATE_SELECTED]; + right_gc = left_gc; + text_gc = p->widget->style->fg_gc[GTK_STATE_SELECTED]; + } else if ((row < begin_row) || (row >= end_row)) { + left_gc = p->widget->style->bg_gc[GTK_STATE_NORMAL]; + right_gc = left_gc; + text_gc = p->widget->style->fg_gc[GTK_STATE_NORMAL]; + } else { + left_gc = p->widget->style->bg_gc[GTK_STATE_NORMAL]; + right_gc = p->widget->style->bg_gc[GTK_STATE_PRELIGHT]; + text_gc = p->widget->style->fg_gc[GTK_STATE_NORMAL]; } - x1 = widget->style->klass->xthickness; - y1 = widget->style->klass->ythickness; - width = widget->allocation.width - 2 * x1; - height = widget->allocation.height - 2 * y1; - - di = fullday->drag_info; - labels_width = calc_labels_width (fullday); - row_height = calc_row_height (fullday); - get_tm_range (fullday, fullday->lower, fullday->upper, &tm, NULL, NULL, &f_rows); - - /* Frame shadow */ - - gtk_widget_draw_focus (widget); - - /* Area for labels before selection */ + /* Left background and text */ - rect.x = x1; - rect.y = y1; - rect.width = 2 * TEXT_BORDER + labels_width; + rect.x = p->x1; + rect.y = p->y1 + row * p->row_height; + rect.width = 2 * TEXT_BORDER + p->labels_width; + rect.height = p->row_height - 1; - if (di->sel_rows_used == 0) - rect.height = height; - else - rect.height = row_height * di->sel_start_row; - - if (gdk_rectangle_intersect (&rect, area, &dest)) - gdk_draw_rectangle (widget->window, - widget->style->bg_gc[GTK_STATE_NORMAL], + if (gdk_rectangle_intersect (&rect, p->area, &dest)) { + gdk_draw_rectangle (p->widget->window, + left_gc, TRUE, dest.x, dest.y, dest.width, dest.height); - /* Blank area before selection */ + tm = p->start_tm; + tm.tm_min += row * fullday->interval; + mktime (&tm); - rect.x += rect.width + widget->style->klass->xthickness; - rect.width = width - (rect.x - x1); + if (am_pm_flag) + strftime (buf, sizeof (buf), "%I:%M%p", &tm); + else + strftime (buf, sizeof (buf), "%H:%M", &tm); + + gdk_draw_string (p->widget->window, + p->widget->style->font, + text_gc, + rect.x + TEXT_BORDER, + rect.y + TEXT_BORDER + p->widget->style->font->ascent, + buf); + } - if (gdk_rectangle_intersect (&rect, area, &dest)) - gdk_draw_rectangle (widget->window, - widget->style->bg_gc[GTK_STATE_PRELIGHT], + /* Right background */ + + rect.x += rect.width + p->widget->style->klass->xthickness; + rect.width = p->width - (rect.x - p->x1); + + if (gdk_rectangle_intersect (&rect, p->area, &dest)) + gdk_draw_rectangle (p->widget->window, + right_gc, TRUE, dest.x, dest.y, dest.width, dest.height); - /* Selection area */ - - if (di->sel_rows_used != 0) { - rect.x = x1; - rect.y = y1 + row_height * di->sel_start_row; - rect.width = width; - rect.height = row_height * di->sel_rows_used; - - if (gdk_rectangle_intersect (&rect, area, &dest)) - gdk_draw_rectangle (widget->window, - widget->style->bg_gc[GTK_STATE_SELECTED], - TRUE, - dest.x, dest.y, - dest.width, dest.height); - } + /* Horizontal division at bottom of row */ - /* Areas under selection */ + rect.x = p->x1; + rect.y += rect.height; + rect.width = p->width; + rect.height = 1; - if (di->sel_rows_used != 0) { - /* Area for labels */ + if (gdk_rectangle_intersect (&rect, p->area, &dest)) + gdk_draw_line (p->widget->window, + p->widget->style->black_gc, + rect.x, rect.y, + rect.x + rect.width - 1, rect.y); +} - rect.x = x1; - rect.y = y1 + row_height * (di->sel_start_row + di->sel_rows_used); - rect.width = 2 * TEXT_BORDER + labels_width; - rect.height = height - rect.y; +static void +paint_back (GncalFullDay *fullday, GdkRectangle *area) +{ + struct paint_info p; + int start_row, end_row; + int i; + GdkRectangle rect, dest, aarea; + int f_rows; - if (gdk_rectangle_intersect (&rect, area, &dest)) - gdk_draw_rectangle (widget->window, - widget->style->bg_gc[GTK_STATE_NORMAL], - TRUE, - dest.x, dest.y, - dest.width, dest.height); + p.widget = GTK_WIDGET (fullday); + p.di = fullday->drag_info; - /* Blank area */ + if (!area) { + area = &aarea; - rect.x += rect.width + widget->style->klass->xthickness; - rect.width = width - (rect.x - x1); - - if (gdk_rectangle_intersect (&rect, area, &dest)) - gdk_draw_rectangle (widget->window, - widget->style->bg_gc[GTK_STATE_PRELIGHT], - TRUE, - dest.x, dest.y, - dest.width, dest.height); + area->x = 0; + area->y = 0; + area->width = p.widget->allocation.width; + area->height = p.widget->allocation.height; } + p.area = area; - /* Vertical division */ + p.x1 = p.widget->style->klass->xthickness; + p.y1 = p.widget->style->klass->ythickness; + p.width = p.widget->allocation.width - 2 * p.x1; + p.height = p.widget->allocation.height - 2 * p.y1; - gtk_draw_vline (widget->style, widget->window, - GTK_STATE_NORMAL, - y1, - y1 + height - 1, - x1 + 2 * TEXT_BORDER + labels_width); + p.labels_width = calc_labels_width (fullday); + p.row_height = calc_row_height (fullday); + get_tm_range (fullday, fullday->lower, fullday->upper, &p.start_tm, NULL, NULL, &f_rows); - /* Horizontal divisions */ + /* Frame shadow */ - y = y1 + row_height - 1; + gtk_widget_draw_focus (p.widget); - for (i = 1; i < f_rows; i++) { - gdk_draw_line (widget->window, - widget->style->black_gc, - x1, y, - x1 + width - 1, y); + /* Rows */ - y += row_height; - } + start_row = (area->y - p.y1) / p.row_height; + end_row = (area->y + area->height - 1 - p.y1) / p.row_height; - /* Labels */ + if (end_row >= f_rows) + end_row = f_rows - 1; - y = y1 + ((row_height - 1) - (widget->style->font->ascent + widget->style->font->descent)) / 2; + for (i = start_row; i <= end_row; i++) + paint_row (fullday, i, &p); - rect.x = x1; - rect.y = y1; - rect.width = 2 * TEXT_BORDER + labels_width; - rect.height = row_height - 1; + /* Slack area at bottom of widget */ - for (i = 0; i < f_rows; i++) { - mktime (&tm); + rect.x = p.x1; + rect.y = p.y1 + f_rows * p.row_height; + rect.width = p.width; + rect.height = p.height - (rect.y - p.y1); - if (gdk_rectangle_intersect (&rect, area, &dest)) { - if (am_pm_flag) - strftime (buf, sizeof (buf), "%I:%M%p", &tm); - else - strftime (buf, sizeof (buf), "%H:%M", &tm); + if (gdk_rectangle_intersect (&rect, area, &dest)) + gdk_draw_rectangle (p.widget->window, + p.widget->style->bg_gc[GTK_STATE_NORMAL], + TRUE, + dest.x, dest.y, + dest.width, dest.height); - if ((di->sel_rows_used != 0) - && (i >= di->sel_start_row) - && (i < (di->sel_start_row + di->sel_rows_used))) - gc = widget->style->fg_gc[GTK_STATE_SELECTED]; - else - gc = widget->style->fg_gc[GTK_STATE_NORMAL]; - - gdk_draw_string (widget->window, - widget->style->font, - gc, - x1 + TEXT_BORDER, - y + widget->style->font->ascent, - buf); - } + /* Vertical division */ - rect.y += row_height; - y += row_height; + rect.x = p.x1 + 2 * TEXT_BORDER + p.labels_width; + rect.y = p.y1; + rect.width = p.widget->style->klass->xthickness; + rect.height = p.height; - tm.tm_min += fullday->interval; - } + if (gdk_rectangle_intersect (&rect, area, &dest)) + gtk_draw_vline (p.widget->style, p.widget->window, + GTK_STATE_NORMAL, + rect.y, + rect.y + rect.height - 1, + rect.x); } static void diff --git a/calendar/gui/eventedit.c b/calendar/gui/eventedit.c index d711be4055..f14a159fda 100644 --- a/calendar/gui/eventedit.c +++ b/calendar/gui/eventedit.c @@ -520,7 +520,7 @@ ee_store_recur_rule_to_ical (EventEditor *ee) i = g_slist_length (ee->recur_rr_group) - i - 1; /* buttons are stored in reverse order of insertion */ - /* NOne selected, no rule to be stored */ + /* None selected, no rule to be stored */ if (i == 0) return 0; @@ -933,6 +933,12 @@ recur_month_enable_date (GtkToggleButton *button, EventEditor *ee) } static void +desensitize_on_toggle (GtkToggleButton *toggle, gpointer data) +{ + gtk_widget_set_sensitive (GTK_WIDGET (data), !toggle->active); +} + +static void ee_rp_init_rule (EventEditor *ee) { static char *day_names [] = { N_("Mon"), N_("Tue"), N_("Wed"), N_("Thu"), N_("Fri"), N_("Sat"), N_("Sun") }; @@ -1029,6 +1035,11 @@ ee_rp_init_rule (EventEditor *ee) gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON (r), i == page); gtk_signal_connect (GTK_OBJECT (r), "toggled", GTK_SIGNAL_FUNC (recurrence_toggled), ee); gtk_box_pack_start (GTK_BOX (vbox), r, FALSE, FALSE, 0); + + if (i == 0) + gtk_signal_connect (GTK_OBJECT (r), "toggled", + (GtkSignalFunc) desensitize_on_toggle, + ee->recur_hbox); } ee->recur_rr_group = group; @@ -1141,13 +1152,15 @@ ee_rp_init_rule (EventEditor *ee) gtk_notebook_set_page (notebook, page); - /* Attach to the main table */ + /* Attach to the main box */ - gtk_table_attach (GTK_TABLE (ee->recur_table), f, - 0, 2, 0, 1, - GTK_FILL | GTK_SHRINK, - GTK_FILL | GTK_SHRINK, - 0, 0); + gtk_box_pack_start (GTK_BOX (ee->recur_vbox), f, FALSE, FALSE, 0); +} + +static void +sensitize_on_toggle (GtkToggleButton *toggle, gpointer data) +{ + gtk_widget_set_sensitive (GTK_WIDGET (data), toggle->active); } static void @@ -1190,6 +1203,7 @@ ee_rp_init_ending_date (EventEditor *ee) gtk_box_pack_start (GTK_BOX (hbox), radio1, FALSE, FALSE, 0); ihbox = gtk_hbox_new (FALSE, 4); + gtk_widget_set_sensitive (ihbox, FALSE); gtk_box_pack_start (GTK_BOX (hbox), ihbox, FALSE, FALSE, 0); if (ee->ical->recur) @@ -1200,6 +1214,10 @@ ee_rp_init_ending_date (EventEditor *ee) ee->recur_ed_end_on = widget = gnome_date_edit_new (enddate, FALSE); gtk_box_pack_start (GTK_BOX (ihbox), widget, FALSE, FALSE, 0); + gtk_signal_connect (GTK_OBJECT (radio1), "toggled", + (GtkSignalFunc) sensitize_on_toggle, + ihbox); + /* end after n occurrences */ hbox = gtk_hbox_new (FALSE, 0); @@ -1210,6 +1228,7 @@ ee_rp_init_ending_date (EventEditor *ee) gtk_box_pack_start (GTK_BOX (hbox), radio2, FALSE, FALSE, 0); ihbox = gtk_hbox_new (FALSE, 4); + gtk_widget_set_sensitive (ihbox, FALSE); gtk_box_pack_start (GTK_BOX (hbox), ihbox, FALSE, FALSE, 0); if (ee->ical->recur && ee->ical->recur->duration) @@ -1223,6 +1242,10 @@ ee_rp_init_ending_date (EventEditor *ee) widget = gtk_label_new (_("occurrence(s)")); gtk_box_pack_start (GTK_BOX (ihbox), widget, FALSE, FALSE, 0); + gtk_signal_connect (GTK_OBJECT (radio2), "toggled", + (GtkSignalFunc) sensitize_on_toggle, + ihbox); + /* Activate appropriate item */ if (ee->ical->recur) { @@ -1244,11 +1267,7 @@ ee_rp_init_ending_date (EventEditor *ee) ee->recur_ed_group = group; - gtk_table_attach (GTK_TABLE (ee->recur_table), frame, - 0, 1, 1, 2, - GTK_FILL | GTK_SHRINK, - GTK_FILL | GTK_SHRINK, - 0, 0); + gtk_box_pack_start (GTK_BOX (ee->recur_hbox), frame, FALSE, FALSE, 0); } static char * @@ -1380,27 +1399,28 @@ ee_rp_init_exceptions (EventEditor *ee) /* Done, add to main table */ - gtk_table_attach (GTK_TABLE (ee->recur_table), frame, - 1, 2, 1, 2, - GTK_EXPAND | GTK_FILL | GTK_SHRINK, - GTK_FILL | GTK_SHRINK, - 0, 0); + gtk_box_pack_start (GTK_BOX (ee->recur_hbox), frame, TRUE, TRUE, 0); } static void ee_init_recurrence_page (EventEditor *ee) { - ee->recur_table = gtk_table_new (2, 2, FALSE); - gtk_container_border_width (GTK_CONTAINER (ee->recur_table), 4); - gtk_table_set_row_spacings (GTK_TABLE (ee->recur_table), 4); - gtk_table_set_col_spacings (GTK_TABLE (ee->recur_table), 4); + ee->recur_vbox = gtk_vbox_new (FALSE, 4); + gtk_container_border_width (GTK_CONTAINER (ee->recur_vbox), 4); + + ee->recur_hbox = gtk_hbox_new (FALSE, 4); + gtk_widget_set_sensitive (ee->recur_hbox, FALSE); ee->recur_page_label = gtk_label_new (_("Recurrence")); - gtk_notebook_append_page (GTK_NOTEBOOK (ee->notebook), ee->recur_table, + gtk_notebook_append_page (GTK_NOTEBOOK (ee->notebook), ee->recur_vbox, ee->recur_page_label); ee_rp_init_rule (ee); + + /* pack here so that the box gets inserted after the recurrence rule frame */ + gtk_box_pack_start (GTK_BOX (ee->recur_vbox), ee->recur_hbox, FALSE, FALSE, 0); + ee_rp_init_ending_date (ee); ee_rp_init_exceptions (ee); } diff --git a/calendar/gui/eventedit.h b/calendar/gui/eventedit.h index c7aa5a8405..73dd677d44 100644 --- a/calendar/gui/eventedit.h +++ b/calendar/gui/eventedit.h @@ -33,7 +33,8 @@ typedef struct { GtkWidget *general_radios; GtkWidget *recur_page_label; - GtkWidget *recur_table; + GtkWidget *recur_vbox; + GtkWidget *recur_hbox; GSList *recur_rr_group; GtkWidget *recur_rr_notebook; diff --git a/calendar/gui/gncal-full-day.c b/calendar/gui/gncal-full-day.c index 28815bbfe6..8db460e689 100644 --- a/calendar/gui/gncal-full-day.c +++ b/calendar/gui/gncal-full-day.c @@ -15,6 +15,7 @@ #include "view-utils.h" #include "main.h" + #define TEXT_BORDER 2 #define HANDLE_SIZE 8 #define MIN_WIDTH 300 @@ -998,180 +999,176 @@ gncal_full_day_unrealize (GtkWidget *widget) (* GTK_WIDGET_CLASS (parent_class)->unrealize) (widget); } -static void -paint_back (GncalFullDay *fullday, GdkRectangle *area) -{ +struct paint_info { GtkWidget *widget; - GdkRectangle rect, dest, aarea; struct drag_info *di; + GdkRectangle *area; int x1, y1, width, height; int labels_width; - int f_rows, row_height; - int i, y; - GdkGC *gc; - struct tm tm; - char buf [40]; - - widget = GTK_WIDGET (fullday); + int row_height; + struct tm start_tm; +}; - if (!area) { - area = &aarea; +static void +paint_row (GncalFullDay *fullday, int row, struct paint_info *p) +{ + GdkRectangle rect, dest; + GdkGC *left_gc, *right_gc, *text_gc; + int begin_row, end_row; + struct tm tm; + char buf[40]; - area->x = 0; - area->y = 0; - area->width = widget->allocation.width; - area->height = widget->allocation.height; + begin_row = (day_begin * 60) / fullday->interval; + end_row = (day_end * 60) / fullday->interval; + + /* See which GCs we will use */ + + if ((p->di->sel_rows_used != 0) + && (row >= p->di->sel_start_row) + && (row < (p->di->sel_start_row + p->di->sel_rows_used))) { + left_gc = p->widget->style->bg_gc[GTK_STATE_SELECTED]; + right_gc = left_gc; + text_gc = p->widget->style->fg_gc[GTK_STATE_SELECTED]; + } else if ((row < begin_row) || (row >= end_row)) { + left_gc = p->widget->style->bg_gc[GTK_STATE_NORMAL]; + right_gc = left_gc; + text_gc = p->widget->style->fg_gc[GTK_STATE_NORMAL]; + } else { + left_gc = p->widget->style->bg_gc[GTK_STATE_NORMAL]; + right_gc = p->widget->style->bg_gc[GTK_STATE_PRELIGHT]; + text_gc = p->widget->style->fg_gc[GTK_STATE_NORMAL]; } - x1 = widget->style->klass->xthickness; - y1 = widget->style->klass->ythickness; - width = widget->allocation.width - 2 * x1; - height = widget->allocation.height - 2 * y1; - - di = fullday->drag_info; - labels_width = calc_labels_width (fullday); - row_height = calc_row_height (fullday); - get_tm_range (fullday, fullday->lower, fullday->upper, &tm, NULL, NULL, &f_rows); - - /* Frame shadow */ - - gtk_widget_draw_focus (widget); - - /* Area for labels before selection */ + /* Left background and text */ - rect.x = x1; - rect.y = y1; - rect.width = 2 * TEXT_BORDER + labels_width; + rect.x = p->x1; + rect.y = p->y1 + row * p->row_height; + rect.width = 2 * TEXT_BORDER + p->labels_width; + rect.height = p->row_height - 1; - if (di->sel_rows_used == 0) - rect.height = height; - else - rect.height = row_height * di->sel_start_row; - - if (gdk_rectangle_intersect (&rect, area, &dest)) - gdk_draw_rectangle (widget->window, - widget->style->bg_gc[GTK_STATE_NORMAL], + if (gdk_rectangle_intersect (&rect, p->area, &dest)) { + gdk_draw_rectangle (p->widget->window, + left_gc, TRUE, dest.x, dest.y, dest.width, dest.height); - /* Blank area before selection */ + tm = p->start_tm; + tm.tm_min += row * fullday->interval; + mktime (&tm); - rect.x += rect.width + widget->style->klass->xthickness; - rect.width = width - (rect.x - x1); + if (am_pm_flag) + strftime (buf, sizeof (buf), "%I:%M%p", &tm); + else + strftime (buf, sizeof (buf), "%H:%M", &tm); + + gdk_draw_string (p->widget->window, + p->widget->style->font, + text_gc, + rect.x + TEXT_BORDER, + rect.y + TEXT_BORDER + p->widget->style->font->ascent, + buf); + } - if (gdk_rectangle_intersect (&rect, area, &dest)) - gdk_draw_rectangle (widget->window, - widget->style->bg_gc[GTK_STATE_PRELIGHT], + /* Right background */ + + rect.x += rect.width + p->widget->style->klass->xthickness; + rect.width = p->width - (rect.x - p->x1); + + if (gdk_rectangle_intersect (&rect, p->area, &dest)) + gdk_draw_rectangle (p->widget->window, + right_gc, TRUE, dest.x, dest.y, dest.width, dest.height); - /* Selection area */ - - if (di->sel_rows_used != 0) { - rect.x = x1; - rect.y = y1 + row_height * di->sel_start_row; - rect.width = width; - rect.height = row_height * di->sel_rows_used; - - if (gdk_rectangle_intersect (&rect, area, &dest)) - gdk_draw_rectangle (widget->window, - widget->style->bg_gc[GTK_STATE_SELECTED], - TRUE, - dest.x, dest.y, - dest.width, dest.height); - } + /* Horizontal division at bottom of row */ - /* Areas under selection */ + rect.x = p->x1; + rect.y += rect.height; + rect.width = p->width; + rect.height = 1; - if (di->sel_rows_used != 0) { - /* Area for labels */ + if (gdk_rectangle_intersect (&rect, p->area, &dest)) + gdk_draw_line (p->widget->window, + p->widget->style->black_gc, + rect.x, rect.y, + rect.x + rect.width - 1, rect.y); +} - rect.x = x1; - rect.y = y1 + row_height * (di->sel_start_row + di->sel_rows_used); - rect.width = 2 * TEXT_BORDER + labels_width; - rect.height = height - rect.y; +static void +paint_back (GncalFullDay *fullday, GdkRectangle *area) +{ + struct paint_info p; + int start_row, end_row; + int i; + GdkRectangle rect, dest, aarea; + int f_rows; - if (gdk_rectangle_intersect (&rect, area, &dest)) - gdk_draw_rectangle (widget->window, - widget->style->bg_gc[GTK_STATE_NORMAL], - TRUE, - dest.x, dest.y, - dest.width, dest.height); + p.widget = GTK_WIDGET (fullday); + p.di = fullday->drag_info; - /* Blank area */ + if (!area) { + area = &aarea; - rect.x += rect.width + widget->style->klass->xthickness; - rect.width = width - (rect.x - x1); - - if (gdk_rectangle_intersect (&rect, area, &dest)) - gdk_draw_rectangle (widget->window, - widget->style->bg_gc[GTK_STATE_PRELIGHT], - TRUE, - dest.x, dest.y, - dest.width, dest.height); + area->x = 0; + area->y = 0; + area->width = p.widget->allocation.width; + area->height = p.widget->allocation.height; } + p.area = area; - /* Vertical division */ + p.x1 = p.widget->style->klass->xthickness; + p.y1 = p.widget->style->klass->ythickness; + p.width = p.widget->allocation.width - 2 * p.x1; + p.height = p.widget->allocation.height - 2 * p.y1; - gtk_draw_vline (widget->style, widget->window, - GTK_STATE_NORMAL, - y1, - y1 + height - 1, - x1 + 2 * TEXT_BORDER + labels_width); + p.labels_width = calc_labels_width (fullday); + p.row_height = calc_row_height (fullday); + get_tm_range (fullday, fullday->lower, fullday->upper, &p.start_tm, NULL, NULL, &f_rows); - /* Horizontal divisions */ + /* Frame shadow */ - y = y1 + row_height - 1; + gtk_widget_draw_focus (p.widget); - for (i = 1; i < f_rows; i++) { - gdk_draw_line (widget->window, - widget->style->black_gc, - x1, y, - x1 + width - 1, y); + /* Rows */ - y += row_height; - } + start_row = (area->y - p.y1) / p.row_height; + end_row = (area->y + area->height - 1 - p.y1) / p.row_height; - /* Labels */ + if (end_row >= f_rows) + end_row = f_rows - 1; - y = y1 + ((row_height - 1) - (widget->style->font->ascent + widget->style->font->descent)) / 2; + for (i = start_row; i <= end_row; i++) + paint_row (fullday, i, &p); - rect.x = x1; - rect.y = y1; - rect.width = 2 * TEXT_BORDER + labels_width; - rect.height = row_height - 1; + /* Slack area at bottom of widget */ - for (i = 0; i < f_rows; i++) { - mktime (&tm); + rect.x = p.x1; + rect.y = p.y1 + f_rows * p.row_height; + rect.width = p.width; + rect.height = p.height - (rect.y - p.y1); - if (gdk_rectangle_intersect (&rect, area, &dest)) { - if (am_pm_flag) - strftime (buf, sizeof (buf), "%I:%M%p", &tm); - else - strftime (buf, sizeof (buf), "%H:%M", &tm); + if (gdk_rectangle_intersect (&rect, area, &dest)) + gdk_draw_rectangle (p.widget->window, + p.widget->style->bg_gc[GTK_STATE_NORMAL], + TRUE, + dest.x, dest.y, + dest.width, dest.height); - if ((di->sel_rows_used != 0) - && (i >= di->sel_start_row) - && (i < (di->sel_start_row + di->sel_rows_used))) - gc = widget->style->fg_gc[GTK_STATE_SELECTED]; - else - gc = widget->style->fg_gc[GTK_STATE_NORMAL]; - - gdk_draw_string (widget->window, - widget->style->font, - gc, - x1 + TEXT_BORDER, - y + widget->style->font->ascent, - buf); - } + /* Vertical division */ - rect.y += row_height; - y += row_height; + rect.x = p.x1 + 2 * TEXT_BORDER + p.labels_width; + rect.y = p.y1; + rect.width = p.widget->style->klass->xthickness; + rect.height = p.height; - tm.tm_min += fullday->interval; - } + if (gdk_rectangle_intersect (&rect, area, &dest)) + gtk_draw_vline (p.widget->style, p.widget->window, + GTK_STATE_NORMAL, + rect.y, + rect.y + rect.height - 1, + rect.x); } static void diff --git a/calendar/gui/main.c b/calendar/gui/main.c index 00c13edb16..14a4a183a1 100644 --- a/calendar/gui/main.c +++ b/calendar/gui/main.c @@ -51,7 +51,7 @@ static char *load_file; /* If set, show events for the specified date and quit */ static int show_events; -void +static void init_username (void) { char *p; @@ -74,7 +74,7 @@ init_username (void) endpwent (); } -int +static int range_check_hour (int hour) { if (hour < 0) @@ -88,7 +88,7 @@ range_check_hour (int hour) /* * Initializes the calendar internal variables, loads defaults */ -void +static void init_calendar (void) { init_username (); @@ -107,9 +107,9 @@ init_calendar (void) gnome_config_pop_prefix (); } -void save_calendar_cmd (GtkWidget *widget, void *data); +static void save_calendar_cmd (GtkWidget *widget, void *data); -void +static void about_calendar_cmd (GtkWidget *widget, void *data) { GtkWidget *about; @@ -128,7 +128,7 @@ about_calendar_cmd (GtkWidget *widget, void *data) gtk_widget_show (about); } -void +static void display_objedit (GtkWidget *widget, GnomeCalendar *gcal) { GtkWidget *ee; @@ -137,7 +137,7 @@ display_objedit (GtkWidget *widget, GnomeCalendar *gcal) gtk_widget_show (ee); } -void +static void close_cmd (GtkWidget *widget, GnomeCalendar *gcal) { all_calendars = g_list_remove (all_calendars, gcal); @@ -155,7 +155,7 @@ close_cmd (GtkWidget *widget, GnomeCalendar *gcal) gtk_main_quit (); } -void +static void quit_cmd (GtkWidget *widget, GnomeCalendar *gcal) { while (all_calendars){ @@ -165,25 +165,25 @@ quit_cmd (GtkWidget *widget, GnomeCalendar *gcal) } } -void +static void previous_clicked (GtkWidget *widget, GnomeCalendar *gcal) { gnome_calendar_previous (gcal); } -void +static void next_clicked (GtkWidget *widget, GnomeCalendar *gcal) { gnome_calendar_next (gcal); } -void +static void today_clicked (GtkWidget *widget, GnomeCalendar *gcal) { gnome_calendar_goto (gcal, time (NULL)); } -void +static void new_calendar_cmd (GtkWidget *widget, void *data) { new_calendar (full_name, NULL); @@ -198,7 +198,7 @@ open_ok (GtkWidget *widget, GtkFileSelection *fs) gtk_widget_destroy (GTK_WIDGET (fs)); } -void +static void open_calendar_cmd (GtkWidget *widget, void *data) { GtkFileSelection *fs; @@ -238,7 +238,7 @@ close_save (GtkWidget *w) return TRUE; } -void +static void save_as_calendar_cmd (GtkWidget *widget, void *data) { GtkFileSelection *fs; @@ -261,7 +261,7 @@ save_as_calendar_cmd (GtkWidget *widget, void *data) gtk_widget_destroy (GTK_WIDGET (fs)); } -void +static void save_calendar_cmd (GtkWidget *widget, void *data) { GnomeCalendar *gcal = data; @@ -272,7 +272,7 @@ save_calendar_cmd (GtkWidget *widget, void *data) save_as_calendar_cmd (widget, data); } -GnomeUIInfo gnome_cal_file_menu [] = { +static GnomeUIInfo gnome_cal_file_menu [] = { { GNOME_APP_UI_ITEM, N_("New calendar"), NULL, new_calendar_cmd, NULL, NULL, GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_NEW }, @@ -295,36 +295,38 @@ GnomeUIInfo gnome_cal_file_menu [] = { GNOMEUIINFO_END }; -GnomeUIInfo gnome_cal_about_menu [] = { +static GnomeUIInfo gnome_cal_about_menu [] = { { GNOME_APP_UI_ITEM, N_("About"), NULL, about_calendar_cmd, NULL, NULL, GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_ABOUT }, GNOMEUIINFO_HELP ("cal"), GNOMEUIINFO_END }; -GnomeUIInfo gnome_cal_edit_menu [] = { +static GnomeUIInfo gnome_cal_edit_menu [] = { { GNOME_APP_UI_ITEM, N_("New appointment"), NULL, display_objedit }, GNOMEUIINFO_END }; -GnomeUIInfo gnome_cal_menu [] = { +static GnomeUIInfo gnome_cal_menu [] = { { GNOME_APP_UI_SUBTREE, N_("File"), NULL, &gnome_cal_file_menu }, { GNOME_APP_UI_SUBTREE, N_("Calendar"), NULL, &gnome_cal_edit_menu }, { GNOME_APP_UI_SUBTREE, N_("Help"), NULL, &gnome_cal_about_menu }, GNOMEUIINFO_END }; -GnomeUIInfo gnome_toolbar [] = { - { GNOME_APP_UI_ITEM, N_("New"), NULL, display_objedit, 0, 0, - GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_PIXMAP_NEW },\ +static GnomeUIInfo gnome_toolbar [] = { + { GNOME_APP_UI_ITEM, N_("New"), N_("Create a new appointment"), display_objedit, 0, 0, + GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_PIXMAP_NEW }, + + GNOMEUIINFO_SEPARATOR, - { GNOME_APP_UI_ITEM, N_("Prev"), NULL, previous_clicked, 0, 0, + { GNOME_APP_UI_ITEM, N_("Prev"), N_("Go back in time"), previous_clicked, 0, 0, GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_BACK }, - { GNOME_APP_UI_ITEM, N_("Today"), NULL, today_clicked, 0, 0, + { GNOME_APP_UI_ITEM, N_("Today"), N_("Go to present time"), today_clicked, 0, 0, GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_PIXMAP_HOME }, - { GNOME_APP_UI_ITEM, N_("Next"), NULL, next_clicked, 0, 0, + { GNOME_APP_UI_ITEM, N_("Next"), N_("Go forward in time"), next_clicked, 0, 0, GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_FORWARD }, GNOMEUIINFO_END @@ -387,7 +389,7 @@ static struct argp_option argp_options [] = { { NULL, 0, NULL, 0, NULL, 0 }, }; -int +static int same_day (struct tm *a, struct tm *b) { return (a->tm_mday == b->tm_mday && @@ -395,7 +397,7 @@ same_day (struct tm *a, struct tm *b) a->tm_year == b->tm_year); } -void +static void dump_events (void) { Calendar *cal; diff --git a/calendar/gui/view-utils.c b/calendar/gui/view-utils.c index a6c7676885..62cb86fc7c 100644 --- a/calendar/gui/view-utils.c +++ b/calendar/gui/view-utils.c @@ -11,7 +11,7 @@ int am_pm_flag = 0; -char * +static char * nicetime (struct tm *tm) { static char buf [20]; diff --git a/calendar/main.c b/calendar/main.c index 00c13edb16..14a4a183a1 100644 --- a/calendar/main.c +++ b/calendar/main.c @@ -51,7 +51,7 @@ static char *load_file; /* If set, show events for the specified date and quit */ static int show_events; -void +static void init_username (void) { char *p; @@ -74,7 +74,7 @@ init_username (void) endpwent (); } -int +static int range_check_hour (int hour) { if (hour < 0) @@ -88,7 +88,7 @@ range_check_hour (int hour) /* * Initializes the calendar internal variables, loads defaults */ -void +static void init_calendar (void) { init_username (); @@ -107,9 +107,9 @@ init_calendar (void) gnome_config_pop_prefix (); } -void save_calendar_cmd (GtkWidget *widget, void *data); +static void save_calendar_cmd (GtkWidget *widget, void *data); -void +static void about_calendar_cmd (GtkWidget *widget, void *data) { GtkWidget *about; @@ -128,7 +128,7 @@ about_calendar_cmd (GtkWidget *widget, void *data) gtk_widget_show (about); } -void +static void display_objedit (GtkWidget *widget, GnomeCalendar *gcal) { GtkWidget *ee; @@ -137,7 +137,7 @@ display_objedit (GtkWidget *widget, GnomeCalendar *gcal) gtk_widget_show (ee); } -void +static void close_cmd (GtkWidget *widget, GnomeCalendar *gcal) { all_calendars = g_list_remove (all_calendars, gcal); @@ -155,7 +155,7 @@ close_cmd (GtkWidget *widget, GnomeCalendar *gcal) gtk_main_quit (); } -void +static void quit_cmd (GtkWidget *widget, GnomeCalendar *gcal) { while (all_calendars){ @@ -165,25 +165,25 @@ quit_cmd (GtkWidget *widget, GnomeCalendar *gcal) } } -void +static void previous_clicked (GtkWidget *widget, GnomeCalendar *gcal) { gnome_calendar_previous (gcal); } -void +static void next_clicked (GtkWidget *widget, GnomeCalendar *gcal) { gnome_calendar_next (gcal); } -void +static void today_clicked (GtkWidget *widget, GnomeCalendar *gcal) { gnome_calendar_goto (gcal, time (NULL)); } -void +static void new_calendar_cmd (GtkWidget *widget, void *data) { new_calendar (full_name, NULL); @@ -198,7 +198,7 @@ open_ok (GtkWidget *widget, GtkFileSelection *fs) gtk_widget_destroy (GTK_WIDGET (fs)); } -void +static void open_calendar_cmd (GtkWidget *widget, void *data) { GtkFileSelection *fs; @@ -238,7 +238,7 @@ close_save (GtkWidget *w) return TRUE; } -void +static void save_as_calendar_cmd (GtkWidget *widget, void *data) { GtkFileSelection *fs; @@ -261,7 +261,7 @@ save_as_calendar_cmd (GtkWidget *widget, void *data) gtk_widget_destroy (GTK_WIDGET (fs)); } -void +static void save_calendar_cmd (GtkWidget *widget, void *data) { GnomeCalendar *gcal = data; @@ -272,7 +272,7 @@ save_calendar_cmd (GtkWidget *widget, void *data) save_as_calendar_cmd (widget, data); } -GnomeUIInfo gnome_cal_file_menu [] = { +static GnomeUIInfo gnome_cal_file_menu [] = { { GNOME_APP_UI_ITEM, N_("New calendar"), NULL, new_calendar_cmd, NULL, NULL, GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_NEW }, @@ -295,36 +295,38 @@ GnomeUIInfo gnome_cal_file_menu [] = { GNOMEUIINFO_END }; -GnomeUIInfo gnome_cal_about_menu [] = { +static GnomeUIInfo gnome_cal_about_menu [] = { { GNOME_APP_UI_ITEM, N_("About"), NULL, about_calendar_cmd, NULL, NULL, GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_ABOUT }, GNOMEUIINFO_HELP ("cal"), GNOMEUIINFO_END }; -GnomeUIInfo gnome_cal_edit_menu [] = { +static GnomeUIInfo gnome_cal_edit_menu [] = { { GNOME_APP_UI_ITEM, N_("New appointment"), NULL, display_objedit }, GNOMEUIINFO_END }; -GnomeUIInfo gnome_cal_menu [] = { +static GnomeUIInfo gnome_cal_menu [] = { { GNOME_APP_UI_SUBTREE, N_("File"), NULL, &gnome_cal_file_menu }, { GNOME_APP_UI_SUBTREE, N_("Calendar"), NULL, &gnome_cal_edit_menu }, { GNOME_APP_UI_SUBTREE, N_("Help"), NULL, &gnome_cal_about_menu }, GNOMEUIINFO_END }; -GnomeUIInfo gnome_toolbar [] = { - { GNOME_APP_UI_ITEM, N_("New"), NULL, display_objedit, 0, 0, - GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_PIXMAP_NEW },\ +static GnomeUIInfo gnome_toolbar [] = { + { GNOME_APP_UI_ITEM, N_("New"), N_("Create a new appointment"), display_objedit, 0, 0, + GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_PIXMAP_NEW }, + + GNOMEUIINFO_SEPARATOR, - { GNOME_APP_UI_ITEM, N_("Prev"), NULL, previous_clicked, 0, 0, + { GNOME_APP_UI_ITEM, N_("Prev"), N_("Go back in time"), previous_clicked, 0, 0, GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_BACK }, - { GNOME_APP_UI_ITEM, N_("Today"), NULL, today_clicked, 0, 0, + { GNOME_APP_UI_ITEM, N_("Today"), N_("Go to present time"), today_clicked, 0, 0, GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_PIXMAP_HOME }, - { GNOME_APP_UI_ITEM, N_("Next"), NULL, next_clicked, 0, 0, + { GNOME_APP_UI_ITEM, N_("Next"), N_("Go forward in time"), next_clicked, 0, 0, GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_FORWARD }, GNOMEUIINFO_END @@ -387,7 +389,7 @@ static struct argp_option argp_options [] = { { NULL, 0, NULL, 0, NULL, 0 }, }; -int +static int same_day (struct tm *a, struct tm *b) { return (a->tm_mday == b->tm_mday && @@ -395,7 +397,7 @@ same_day (struct tm *a, struct tm *b) a->tm_year == b->tm_year); } -void +static void dump_events (void) { Calendar *cal; diff --git a/calendar/view-utils.c b/calendar/view-utils.c index a6c7676885..62cb86fc7c 100644 --- a/calendar/view-utils.c +++ b/calendar/view-utils.c @@ -11,7 +11,7 @@ int am_pm_flag = 0; -char * +static char * nicetime (struct tm *tm) { static char buf [20]; |