aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/calendar-commands.c
diff options
context:
space:
mode:
authorFederico Mena Quintero <federico@helixcode.com>2000-09-08 14:39:05 +0800
committerFederico Mena Quintero <federico@src.gnome.org>2000-09-08 14:39:05 +0800
commita38d76bc2e91964b73ffac3efcb043db54bf2189 (patch)
tree8ed2564db7ff3ff60a50b162fc3a75039e322d3e /calendar/gui/calendar-commands.c
parent0a8b44f162e3d1db26967e972b99a39e174369e6 (diff)
downloadgsoc2013-evolution-a38d76bc2e91964b73ffac3efcb043db54bf2189.tar.gz
gsoc2013-evolution-a38d76bc2e91964b73ffac3efcb043db54bf2189.tar.zst
gsoc2013-evolution-a38d76bc2e91964b73ffac3efcb043db54bf2189.zip
Fall equinox cleanup!
2000-09-08 Federico Mena Quintero <federico@helixcode.com> Fall equinox cleanup! OK, I know the equinox is not here yet, but weather has changed enough to warrant it. Sigh. This place is definitely not the tropics. * gui/gnome-cal.c (obj_updated_cb): Renamed from gnome_calendar_object_updated_cb(); fixed prototype. (obj_removed_cb): Renamed from gnome_calendar_object_removed_cb(); fixed prototype. (GnomeCalendarPrivate): Moved all the GnomeCalendar fields to a private structure so I don't have to rebuild the whole calendar GUI directory every time something changes in the object. (GnomeCalendarPrivate): Removed the property bag and the control fields; they are local to the control-factory now. (gnome_calendar_update_view_buttons): Remove the ignore_view_button_clicks mess and just block the signal. (gnome_calendar_set_view): Added a "focus" argument to indicate whether we want the main widget in the specified view to grab the focus. (gnome_calendar_set_view_internal): Handle the focus argument here. (gnome_calendar_set_view_buttons): Temporary hack to notify the calendar about its buttons. (gnome_calendar_get_selected_time_range): New function. (gnome_calendar_get_cal_client): New function. * gui/control-factory.c (calendar_properties_init): Keep the property bag local to here; it does not need to be in the calendar object yet. (control_factory_fn): Renamed from control_factory(). Just use control_factory_new_control(). (control_factory_new_control): Moved the stuff over from create_control(), and keep the control local to here. Check the return value of bonobo_control_new(). * gui/calendar-commands.c (show_day_view_clicked): Remove the ignore_view_button_clicks mess. (new_calendar): Removed the useless "page" argument. (calendar_control_activate): Use gnome_calendar_set_view_buttons() for now. svn path=/trunk/; revision=5255
Diffstat (limited to 'calendar/gui/calendar-commands.c')
-rw-r--r--calendar/gui/calendar-commands.c58
1 files changed, 14 insertions, 44 deletions
diff --git a/calendar/gui/calendar-commands.c b/calendar/gui/calendar-commands.c
index e5e04dbf8b..40928530af 100644
--- a/calendar/gui/calendar-commands.c
+++ b/calendar/gui/calendar-commands.c
@@ -323,12 +323,7 @@ show_day_view_clicked (BonoboUIHandler *uih, void *user_data, const char *path)
{
GnomeCalendar *gcal = GNOME_CALENDAR (user_data);
- /* If we are setting up a view internally we just ignore the clicks. */
- if (gcal->ignore_view_button_clicks)
- return;
-
- gnome_calendar_set_view (gcal, "dayview", FALSE);
- gtk_widget_grab_focus (gcal->day_view);
+ gnome_calendar_set_view (gcal, "dayview", FALSE, TRUE);
}
static void
@@ -336,12 +331,7 @@ show_work_week_view_clicked (BonoboUIHandler *uih, void *user_data, const char *
{
GnomeCalendar *gcal = GNOME_CALENDAR (user_data);
- /* If we are setting up a view internally we just ignore the clicks. */
- if (gcal->ignore_view_button_clicks)
- return;
-
- gnome_calendar_set_view (gcal, "workweekview", FALSE);
- gtk_widget_grab_focus (gcal->work_week_view);
+ gnome_calendar_set_view (gcal, "workweekview", FALSE, TRUE);
}
static void
@@ -349,12 +339,7 @@ show_week_view_clicked (BonoboUIHandler *uih, void *user_data, const char *path)
{
GnomeCalendar *gcal = GNOME_CALENDAR (user_data);
- /* If we are setting up a view internally we just ignore the clicks. */
- if (gcal->ignore_view_button_clicks)
- return;
-
- gnome_calendar_set_view (gcal, "weekview", FALSE);
- gtk_widget_grab_focus (gcal->week_view);
+ gnome_calendar_set_view (gcal, "weekview", FALSE, TRUE);
}
static void
@@ -362,19 +347,14 @@ show_month_view_clicked (BonoboUIHandler *uih, void *user_data, const char *path
{
GnomeCalendar *gcal = GNOME_CALENDAR (user_data);
- /* If we are setting up a view internally we just ignore the clicks. */
- if (gcal->ignore_view_button_clicks)
- return;
-
- gnome_calendar_set_view (gcal, "monthview", FALSE);
- gtk_widget_grab_focus (gcal->month_view);
+ gnome_calendar_set_view (gcal, "monthview", FALSE, TRUE);
}
static void
new_calendar_cmd (BonoboUIHandler *uih, void *user_data, const char *path)
{
- new_calendar (full_name, NULL, NULL, FALSE);
+ new_calendar (full_name, NULL, FALSE);
}
static void
@@ -422,7 +402,7 @@ open_ok (GtkWidget *widget, GtkFileSelection *fs)
#warning "FIXME: find out who owns this calendar and use that name"
#endif
/*
- new_calendar ("Somebody", gtk_file_selection_get_filename (fs), NULL, NULL, FALSE);
+ new_calendar ("Somebody", gtk_file_selection_get_filename (fs), NULL, FALSE);
*/
gtk_widget_destroy (GTK_WIDGET (fs));
}
@@ -604,10 +584,11 @@ calendar_control_activate (BonoboControl *control,
/* Note that these indices should correspond with the button indices
in the gnome_toolbar_view_buttons UIINFO struct. */
- cal->day_button = gnome_toolbar_view_buttons[0].widget;
- cal->work_week_button = gnome_toolbar_view_buttons[1].widget;
- cal->week_button = gnome_toolbar_view_buttons[2].widget;
- cal->month_button = gnome_toolbar_view_buttons[3].widget;
+ gnome_calendar_set_view_buttons (cal,
+ gnome_toolbar_view_buttons[0].widget,
+ gnome_toolbar_view_buttons[1].widget,
+ gnome_toolbar_view_buttons[2].widget,
+ gnome_toolbar_view_buttons[3].widget);
/* This makes the appropriate radio button in the toolbar active. */
gnome_calendar_update_view_buttons (cal);
@@ -706,29 +687,18 @@ calendar_close_event (GtkWidget *widget, GdkEvent *event, GnomeCalendar *gcal)
GnomeCalendar *
-new_calendar (char *full_name, char *geometry, char *page, gboolean hidden)
+new_calendar (char *full_name, char *geometry, gboolean hidden)
{
GtkWidget *toplevel;
- char title[128];
int xpos, ypos, width, height;
+ toplevel = gnome_calendar_new ();
- /* i18n: This "%s%s" indicates possession. Languages where the order is
- * the inverse should translate it to "%2$s%1$s".
- */
- g_snprintf(title, 128, _("%s%s"), full_name, _("'s calendar"));
-
- toplevel = gnome_calendar_new (title);
-
- if (gnome_parse_geometry (geometry, &xpos, &ypos, &width, &height)){
+ if (gnome_parse_geometry (geometry, &xpos, &ypos, &width, &height)) {
if (xpos != -1)
gtk_widget_set_uposition (toplevel, xpos, ypos);
}
- if (page)
- gnome_calendar_set_view (GNOME_CALENDAR (toplevel), page,
- FALSE);
-
gtk_signal_connect (GTK_OBJECT (toplevel), "delete_event",
GTK_SIGNAL_FUNC(calendar_close_event), toplevel);