Skip to content

Commit fd6ce16

Browse files
committed
Readd the Export To Pdf function for Webkit1 based builds
1 parent 5f51fc5 commit fd6ce16

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

gnucash/report/report-gnome/gnc-plugin-page-report.c

+14-1
Original file line numberDiff line numberDiff line change
@@ -420,6 +420,7 @@ gnc_plugin_page_report_create_widget( GncPluginPage *page )
420420
GncPluginPageReportPrivate *priv;
421421
GncMainWindow *window;
422422
GtkWindow *topLvl;
423+
GtkAction *action;
423424
URLType type;
424425
char * id_name;
425426
char * child_name;
@@ -428,6 +429,13 @@ gnc_plugin_page_report_create_widget( GncPluginPage *page )
428429

429430
ENTER("page %p", page);
430431

432+
#ifndef WEBKIT1
433+
/* Hide the ExportPdf action for Webkit2 */
434+
action = gnc_plugin_page_get_action (page, "FilePrintPDFAction");
435+
gtk_action_set_sensitive (action, FALSE);
436+
gtk_action_set_visible (action, FALSE);
437+
#endif
438+
431439
report = GNC_PLUGIN_PAGE_REPORT(page);
432440
priv = GNC_PLUGIN_PAGE_REPORT_GET_PRIVATE(report);
433441

@@ -458,7 +466,7 @@ gnc_plugin_page_report_create_widget( GncPluginPage *page )
458466
gnc_html_set_urltype_cb(priv->html, gnc_plugin_page_report_check_urltype);
459467
gnc_html_set_load_cb(priv->html, gnc_plugin_page_report_load_cb, report);
460468

461-
/* We need to call the load call back so the report appears to of been run
469+
/* We need to call the load call back so the report appears to have been run
462470
so it will get saved properly if the report is not realized in session */
463471
id_name = g_strdup_printf("id=%d", priv->reportId );
464472
child_name = gnc_build_url( URL_TYPE_REPORT, id_name, NULL );
@@ -1166,6 +1174,11 @@ gnc_plugin_page_report_constr_init(GncPluginPageReport *plugin_page, gint report
11661174
N_("Print the current report"),
11671175
G_CALLBACK(gnc_plugin_page_report_print_cb)
11681176
},
1177+
{
1178+
"FilePrintPDFAction", GNC_ICON_PDF_EXPORT, N_("Export as P_DF..."), NULL,
1179+
N_("Export the current report as a PDF document"),
1180+
G_CALLBACK(gnc_plugin_page_report_exportpdf_cb)
1181+
},
11691182

11701183
{
11711184
"EditCutAction", "edit-cut", N_("Cu_t"), "<primary>X",

0 commit comments

Comments
 (0)