aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--calendar/gui/e-calendar-view.c44
-rw-r--r--calendar/gui/print.c10
-rw-r--r--modules/calendar/e-cal-shell-view-actions.c45
3 files changed, 15 insertions, 84 deletions
diff --git a/calendar/gui/e-calendar-view.c b/calendar/gui/e-calendar-view.c
index 27a3d6d678..59138cce2c 100644
--- a/calendar/gui/e-calendar-view.c
+++ b/calendar/gui/e-calendar-view.c
@@ -1206,24 +1206,6 @@ on_new_task (EPopup *ep, EPopupItem *pitem, gpointer data)
}
static void
-on_goto_date (EPopup *ep, EPopupItem *pitem, gpointer data)
-{
- ECalendarView *cal_view = data;
-
- goto_dialog (cal_view->priv->calendar);
-}
-
-static void
-on_goto_today (EPopup *ep, EPopupItem *pitem, gpointer data)
-{
-#if 0 /* KILL-BONOBO */
- ECalendarView *cal_view = data;
-
- gnome_calendar_goto_today (cal_view->priv->calendar);
-#endif
-}
-
-static void
on_edit_appointment (EPopup *ep, EPopupItem *pitem, gpointer data)
{
ECalendarView *cal_view = data;
@@ -1283,28 +1265,6 @@ on_save_as (EPopup *ep, EPopupItem *pitem, gpointer data)
}
static void
-on_print_event (EPopup *ep, EPopupItem *pitem, gpointer data)
-{
- ECalendarView *cal_view = data;
- GList *selected;
- ECalendarViewEvent *event;
- ECalComponent *comp;
-
- selected = e_calendar_view_get_selected_events (cal_view);
- if (!selected)
- return;
-
- event = (ECalendarViewEvent *) selected->data;
-
- comp = e_cal_component_new ();
- e_cal_component_set_icalcomponent (comp, icalcomponent_new_clone (event->comp_data->icalcomp));
- print_comp (comp, event->comp_data->client, GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG);
-
- g_object_unref (comp);
- g_list_free (selected);
-}
-
-static void
transfer_item_to (ECalendarViewEvent *event, ECal *dest_client, gboolean remove_item)
{
const gchar *uid;
@@ -1733,15 +1693,11 @@ static EPopupItem ecv_main_items [] = {
{ E_POPUP_BAR, (gchar *) "60." },
/* FIXME: hook in this somehow */
{ E_POPUP_SUBMENU, (gchar *) "60.view", (gchar *) N_("_Current View") },
-
- { E_POPUP_ITEM, (gchar *) "61.today", (gchar *) N_("Select T_oday"), on_goto_today, NULL, (gchar *) "go-today" },
- { E_POPUP_ITEM, (gchar *) "62.todate", (gchar *) N_("_Select Date..."), on_goto_date, NULL, (gchar *) GTK_STOCK_JUMP_TO },
};
static EPopupItem ecv_child_items [] = {
{ E_POPUP_ITEM, (gchar *) "00.open", (gchar *) N_("_Open"), on_edit_appointment, NULL, (gchar *) GTK_STOCK_OPEN, 0, E_CAL_POPUP_SELECT_NOTEDITING },
{ E_POPUP_ITEM, (gchar *) "10.saveas", (gchar *) N_("_Save As..."), on_save_as, NULL, (gchar *) GTK_STOCK_SAVE_AS, 0, E_CAL_POPUP_SELECT_NOTEDITING },
- { E_POPUP_ITEM, (gchar *) "20.print", (gchar *) N_("Pri_nt..."), on_print_event, NULL, (gchar *) GTK_STOCK_PRINT, 0, E_CAL_POPUP_SELECT_NOTEDITING },
{ E_POPUP_BAR, (gchar *) "30." },
diff --git a/calendar/gui/print.c b/calendar/gui/print.c
index fb68435769..1a8e5a1d76 100644
--- a/calendar/gui/print.c
+++ b/calendar/gui/print.c
@@ -575,7 +575,6 @@ print_month_small (GtkPrintContext *context, GnomeCalendar *gcal, time_t month,
gint titleflags, time_t greystart, time_t greyend,
gint bordertitle)
{
-#if 0 /* KILL-BONOBO */
icaltimezone *zone = calendar_config_get_icaltimezone ();
PangoFontDescription *font, *font_bold, *font_normal;
time_t now, next;
@@ -701,7 +700,6 @@ print_month_small (GtkPrintContext *context, GnomeCalendar *gcal, time_t month,
}
pango_font_description_free (font_normal);
pango_font_description_free (font_bold);
-#endif
}
/* wraps text into the print context, not taking up more than its allowed space */
@@ -1240,7 +1238,6 @@ static void
print_day_details (GtkPrintContext *context, GnomeCalendar *gcal, time_t whence,
double left, double right, double top, double bottom)
{
-#if 0 /* KILL-BONOBO */
icaltimezone *zone = calendar_config_get_icaltimezone ();
EDayViewEvent *event;
PangoFontDescription *font;
@@ -1358,7 +1355,6 @@ print_day_details (GtkPrintContext *context, GnomeCalendar *gcal, time_t whence,
g_array_free (pdi.long_events, TRUE);
free_event_array (pdi.events[0]);
g_array_free (pdi.events[0], TRUE);
-#endif
}
/* Returns TRUE if the event is a one-day event (i.e. not a long event). */
@@ -1729,7 +1725,6 @@ print_week_summary (GtkPrintContext *context, GnomeCalendar *gcal,
gint month, double font_size,
double left, double right, double top, double bottom)
{
-#if 0 /* KILL-BONOBO */
icaltimezone *zone = calendar_config_get_icaltimezone ();
EWeekViewEvent *event;
struct psinfo psi;
@@ -1822,7 +1817,6 @@ print_week_summary (GtkPrintContext *context, GnomeCalendar *gcal,
}
g_array_free (psi.events, TRUE);
g_array_free (spans, TRUE);
-#endif
}
/* XXX Evolution doesn't have a "year" view. */
@@ -2379,7 +2373,6 @@ print_calendar_draw_page (GtkPrintOperation *operation,
gint page_nr,
PrintCalItem *pcali)
{
-#if 0 /* KILL-BONOBO */
switch (gnome_calendar_get_view (pcali->gcal)) {
case GNOME_CAL_DAY_VIEW:
print_day_view (context, pcali->gcal, pcali->start);
@@ -2394,14 +2387,12 @@ print_calendar_draw_page (GtkPrintOperation *operation,
default:
g_return_if_reached ();
}
-#endif
}
void
print_calendar (GnomeCalendar *gcal, GtkPrintOperationAction action,
time_t start)
{
-#if 0 /* KILL-BONOBO */
GtkPrintOperation *operation;
PrintCalItem pcali;
@@ -2421,7 +2412,6 @@ print_calendar (GnomeCalendar *gcal, GtkPrintOperationAction action,
gtk_print_operation_run (operation, action, NULL, NULL);
g_object_unref (operation);
-#endif
}
/* returns number of required pages, when page_nr is -1 */
diff --git a/modules/calendar/e-cal-shell-view-actions.c b/modules/calendar/e-cal-shell-view-actions.c
index f3ed11e33d..bb8ee69893 100644
--- a/modules/calendar/e-cal-shell-view-actions.c
+++ b/modules/calendar/e-cal-shell-view-actions.c
@@ -48,14 +48,16 @@ static void
action_calendar_delete_cb (GtkAction *action,
ECalShellView *cal_shell_view)
{
-#if 0
ECalShellContent *cal_shell_content;
ECalShellSidebar *cal_shell_sidebar;
+ EShellBackend *shell_backend;
EShellWindow *shell_window;
EShellView *shell_view;
ECalendarView *calendar_view;
GnomeCalendarViewType view_type;
+ GnomeCalendar *calendar;
ECalModel *model;
+ ECal *client;
ESourceSelector *selector;
ESourceGroup *source_group;
ESourceList *source_list;
@@ -66,14 +68,15 @@ action_calendar_delete_cb (GtkAction *action,
shell_view = E_SHELL_VIEW (cal_shell_view);
shell_window = e_shell_view_get_shell_window (shell_view);
+ shell_backend = e_shell_view_get_shell_backend (shell_view);
- cal_shell_content = cal_shell_content->priv->cal_shell_content;
- view_type = e_cal_shell_content_get_current_view (cal_shell_content);
- calendar_view = e_cal_shell_content_get_calendar_view (
- cal_shell_content, view_type);
+ cal_shell_content = cal_shell_view->priv->cal_shell_content;
+ calendar = e_cal_shell_content_get_calendar (cal_shell_content);
+ view_type = gnome_calendar_get_view (calendar);
+ calendar_view = gnome_calendar_get_calendar_view (calendar, view_type);
model = e_calendar_view_get_model (calendar_view);
- cal_shell_sidebar = cal_shell_sidebar->priv->cal_shell_sidebar;
+ cal_shell_sidebar = cal_shell_view->priv->cal_shell_sidebar;
selector = e_cal_shell_sidebar_get_selector (cal_shell_sidebar);
source = e_source_selector_peek_primary_selection (selector);
g_return_if_fail (E_IS_SOURCE (source));
@@ -109,19 +112,18 @@ action_calendar_delete_cb (GtkAction *action,
source_group = e_source_peek_group (source);
e_source_group_remove_source (source_group, source);
- source_list = cal_shell_view->priv->source_list;
+ source_list = e_cal_shell_backend_get_source_list (
+ E_CAL_SHELL_BACKEND (shell_backend));
if (!e_source_list_sync (source_list, &error)) {
g_warning ("%s", error->message);
g_error_free (error);
}
-#endif
}
static void
action_calendar_go_back_cb (GtkAction *action,
ECalShellView *cal_shell_view)
{
-#if 0
ECalShellContent *cal_shell_content;
GnomeCalendar *calendar;
@@ -129,14 +131,12 @@ action_calendar_go_back_cb (GtkAction *action,
calendar = e_cal_shell_content_get_calendar (cal_shell_content);
gnome_calendar_previous (calendar);
-#endif
}
static void
action_calendar_go_forward_cb (GtkAction *action,
ECalShellView *cal_shell_view)
{
-#if 0
ECalShellContent *cal_shell_content;
GnomeCalendar *calendar;
@@ -144,14 +144,12 @@ action_calendar_go_forward_cb (GtkAction *action,
calendar = e_cal_shell_content_get_calendar (cal_shell_content);
gnome_calendar_next (calendar);
-#endif
}
static void
action_calendar_go_today_cb (GtkAction *action,
ECalShellView *cal_shell_view)
{
-#if 0
ECalShellContent *cal_shell_content;
GnomeCalendar *calendar;
@@ -159,14 +157,12 @@ action_calendar_go_today_cb (GtkAction *action,
calendar = e_cal_shell_content_get_calendar (cal_shell_content);
gnome_calendar_goto_today (calendar);
-#endif
}
static void
action_calendar_jump_to_cb (GtkAction *action,
ECalShellView *cal_shell_view)
{
-#if 0
ECalShellContent *cal_shell_content;
GnomeCalendar *calendar;
@@ -174,28 +170,24 @@ action_calendar_jump_to_cb (GtkAction *action,
calendar = e_cal_shell_content_get_calendar (cal_shell_content);
goto_dialog (calendar);
-#endif
}
static void
action_calendar_new_cb (GtkAction *action,
ECalShellView *cal_shell_view)
{
-#if 0
EShellView *shell_view;
EShellWindow *shell_window;
shell_view = E_SHELL_VIEW (cal_shell_view);
shell_window = e_shell_view_get_shell_window (shell_view);
calendar_setup_new_calendar (GTK_WINDOW (shell_window));
-#endif
}
static void
action_calendar_print_cb (GtkAction *action,
ECalShellView *cal_shell_view)
{
-#if 0
ECalShellContent *cal_shell_content;
GnomeCalendarViewType view_type;
GnomeCalendar *calendar;
@@ -214,21 +206,19 @@ action_calendar_print_cb (GtkAction *action,
list_view = E_CAL_LIST_VIEW (view);
table = e_table_scrolled_get_table (list_view->table_scrolled);
- print_table (table, _("Print"), _("Calendar"), action);
+ print_table (table, _("Print"), _("Calendar"), print_action);
} else {
time_t start;
gnome_calendar_get_current_time_range (calendar, &start, NULL);
- print_calendar (calendar, action, start);
+ print_calendar (calendar, print_action, start);
}
-#endif
}
static void
action_calendar_print_preview_cb (GtkAction *action,
ECalShellView *cal_shell_view)
{
-#if 0
ECalShellContent *cal_shell_content;
GnomeCalendarViewType view_type;
GnomeCalendar *calendar;
@@ -247,21 +237,19 @@ action_calendar_print_preview_cb (GtkAction *action,
list_view = E_CAL_LIST_VIEW (view);
table = e_table_scrolled_get_table (list_view->table_scrolled);
- print_table (table, _("Print"), _("Calendar"), action);
+ print_table (table, _("Print"), _("Calendar"), print_action);
} else {
time_t start;
gnome_calendar_get_current_time_range (calendar, &start, NULL);
- print_calendar (calendar, action, start);
+ print_calendar (calendar, print_action, start);
}
-#endif
}
static void
action_calendar_properties_cb (GtkAction *action,
ECalShellView *cal_shell_view)
{
-#if 0
ECalShellSidebar *cal_shell_sidebar;
EShellView *shell_view;
EShellWindow *shell_window;
@@ -277,7 +265,6 @@ action_calendar_properties_cb (GtkAction *action,
g_return_if_fail (E_IS_SOURCE (source));
calendar_setup_edit_calendar (GTK_WINDOW (shell_window), source);
-#endif
}
static void
@@ -556,7 +543,6 @@ static void
action_event_open_cb (GtkAction *action,
ECalShellView *cal_shell_view)
{
-#if 0
ECalShellContent *cal_shell_content;
GnomeCalendarViewType view_type;
GnomeCalendar *calendar;
@@ -568,7 +554,6 @@ action_event_open_cb (GtkAction *action,
view = gnome_calendar_get_calendar_view (calendar, view_type);
e_calendar_view_open_event (view);
-#endif
}
static void