diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2009-05-02 12:23:30 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2009-05-02 12:23:30 +0800 |
commit | 15af330cacae649e86d4d89a7a8c7f1795baa7ca (patch) | |
tree | a48cfb7dde57642378b33b649eca944b59cebcbe /calendar/gui/dialogs | |
parent | 5f55aba5b052fb7284973f50009f8b369334d084 (diff) | |
download | gsoc2013-evolution-15af330cacae649e86d4d89a7a8c7f1795baa7ca.tar gsoc2013-evolution-15af330cacae649e86d4d89a7a8c7f1795baa7ca.tar.gz gsoc2013-evolution-15af330cacae649e86d4d89a7a8c7f1795baa7ca.tar.bz2 gsoc2013-evolution-15af330cacae649e86d4d89a7a8c7f1795baa7ca.tar.lz gsoc2013-evolution-15af330cacae649e86d4d89a7a8c7f1795baa7ca.tar.xz gsoc2013-evolution-15af330cacae649e86d4d89a7a8c7f1795baa7ca.tar.zst gsoc2013-evolution-15af330cacae649e86d4d89a7a8c7f1795baa7ca.zip |
Add a "Print Preview" menu item to CompEditor.
Diffstat (limited to 'calendar/gui/dialogs')
-rw-r--r-- | calendar/gui/dialogs/comp-editor.c | 27 |
1 files changed, 21 insertions, 6 deletions
diff --git a/calendar/gui/dialogs/comp-editor.c b/calendar/gui/dialogs/comp-editor.c index 9d7e2f38ef..cf8d77668c 100644 --- a/calendar/gui/dialogs/comp-editor.c +++ b/calendar/gui/dialogs/comp-editor.c @@ -137,7 +137,10 @@ static const gchar *ui = " <menubar action='main-menu'>" " <menu action='file-menu'>" " <menuitem action='save'/>" +" <separator/>" +" <menuitem action='print-preview'/>" " <menuitem action='print'/>" +" <separator/>" " <menuitem action='close'/>" " </menu>" " <menu action='edit-menu'>" @@ -703,17 +706,22 @@ action_print_cb (GtkAction *action, CompEditor *editor) { CompEditorPrivate *priv = editor->priv; + GtkPrintOperationAction print_action; ECalComponent *comp; GList *l; - icalcomponent *icalcomp = e_cal_component_get_icalcomponent (priv->comp); + icalcomponent *component; + icalcomponent *clone; comp = e_cal_component_new (); - e_cal_component_set_icalcomponent (comp, icalcomponent_new_clone (icalcomp)); + component = e_cal_component_get_icalcomponent (priv->comp); + clone = icalcomponent_new_clone (component); + e_cal_component_set_icalcomponent (comp, clone); for (l = priv->pages; l != NULL; l = l->next) comp_editor_page_fill_component (l->data, comp); - print_comp (comp, priv->client, GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG); + print_action = GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG; + print_comp (comp, priv->client, print_action); g_object_unref (comp); } @@ -723,15 +731,22 @@ action_print_preview_cb (GtkAction *action, CompEditor *editor) { CompEditorPrivate *priv = editor->priv; + GtkPrintOperationAction print_action; ECalComponent *comp; GList *l; - icalcomponent *icalcomp = e_cal_component_get_icalcomponent (priv->comp); + icalcomponent *component; + icalcomponent *clone; comp = e_cal_component_new (); - e_cal_component_set_icalcomponent (comp, icalcomponent_new_clone (icalcomp)); + component = e_cal_component_get_icalcomponent (priv->comp); + clone = icalcomponent_new_clone (component); + e_cal_component_set_icalcomponent (comp, clone); + for (l = priv->pages; l != NULL; l = l->next) comp_editor_page_fill_component (l->data, comp); - print_comp (comp, priv->client, TRUE); + + print_action = GTK_PRINT_OPERATION_ACTION_PREVIEW; + print_comp (comp, priv->client, print_action); g_object_unref (comp); } |