static void cal_shell_view_notify_view_id_cb (EShellView *shell_view) { GalViewInstance *view_instance; const gchar *view_id; view_id = e_shell_view_get_view_id (shell_view); view_instance = e_shell_view_get_view_instance (shell_view); /* A NULL view ID implies we're in a custom view. But you can * only get to a custom view via the "Define Views" dialog, which * would have already modified the view instance appropriately. * Furthermore, there's no way to refer to a custom view by ID * anyway, since custom views have no IDs. */ if (view_id == NULL) return; gal_view_instance_set_current_view_id (view_instance, view_id); }
static void date_changed_cb (AnnumShellWindow *self, GnomeCalendarViewType view, AnnumShellView *shell_view) { const char *view_id; ECalendar *date_navigator; GDate *today; GDate start; GDate end; if (view != GNOME_CAL_DAY_VIEW) return; /* Week_View also uses GNOME_CAL_DAY_VIEW, so make sure */ view_id = e_shell_view_get_view_id (E_SHELL_VIEW (shell_view)); if (!g_strcmp0 (view_id, "Week_View")) return; /* DAY_VIEW is treated specially, because we only want to have * the button toggled if we are showing today, not any other * day */ date_navigator = annum_shell_sidebar_get_date_navigator (ANNUM_SHELL_SIDEBAR (self->priv->sidebar)); today = g_date_new (); g_date_set_time_t (today, time (NULL)); e_calendar_item_get_selection (date_navigator->calitem, &start, &end); if (g_date_compare (today, &start) || g_date_compare (&start, &end)) { GtkAction *action = gtk_action_group_get_action (self->priv->action_group, "ShowDay"); gtk_radio_action_set_current_value (GTK_RADIO_ACTION (action), ANNUM_VIEW_DAY); } g_date_free (today); }
static void annum_shell_view_notify_view_id_cb (AnnumShellView * self) { AnnumShellContent *shell_content; ECalendar *date_navigator; GnomeCalendar *calendar; const gchar *view_id; GnomeCalendarViewType view_type; GDate gdate_start; GDate gdate_end; view_id = e_shell_view_get_view_id (E_SHELL_VIEW (self)); /* A NULL view ID implies we're in a custom view. But you can * only get to a custom view via the "Define Views" dialog, which * would have already modified the view instance appropriately. * Furthermore, there's no way to refer to a custom view by ID * anyway, since custom views have no IDs. */ if (view_id == NULL) return; view_type = gnome_cal_view_type_from_view_id (view_id); shell_content = self->priv->prox_shell_content; calendar = annum_shell_content_get_calendar (shell_content); gnome_calendar_display_view (calendar, view_type); if (view_type != GNOME_CAL_DAY_VIEW) return; /* Make sure just the day is selected, for this case */ date_navigator = annum_shell_sidebar_get_date_navigator (self->priv->prox_shell_sidebar); e_calendar_item_get_selection (date_navigator->calitem, &gdate_start, &gdate_end); e_calendar_item_set_selection (date_navigator->calitem, &gdate_start, &gdate_start); }
static void mail_shell_view_notify_view_id_cb (EMailShellView *mail_shell_view) { EMailShellContent *mail_shell_content; GalViewInstance *view_instance; EMailView *mail_view; const gchar *view_id; mail_shell_content = mail_shell_view->priv->mail_shell_content; mail_view = e_mail_shell_content_get_mail_view (mail_shell_content); view_instance = e_mail_view_get_view_instance (mail_view); view_id = e_shell_view_get_view_id (E_SHELL_VIEW (mail_shell_view)); /* A NULL view ID implies we're in a custom view. But you can * only get to a custom view via the "Define Views" dialog, which * would have already modified the view instance appropriately. * Furthermore, there's no way to refer to a custom view by ID * anyway, since custom views have no IDs. */ if (view_id == NULL) return; gal_view_instance_set_current_view_id (view_instance, view_id); }