Skip to content

Commit

Permalink
Remove some references to webkit
Browse files Browse the repository at this point in the history
  • Loading branch information
Bob-IT committed Jan 11, 2024
1 parent 7a17b24 commit 1d94ec3
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 72 deletions.
25 changes: 0 additions & 25 deletions gnucash/gnome/gnc-plugin-page-report.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,6 @@ typedef struct GncPluginPageReportPrivate
/// the gnc_html abstraction this PluginPage contains
// gnc_html *html;
GncHtml *html;
gboolean webkit2;

/// the container the above HTML widget is in.
GtkContainer *container;
Expand Down Expand Up @@ -519,11 +518,6 @@ gnc_plugin_page_report_create_widget( GncPluginPage *page )
report = GNC_PLUGIN_PAGE_REPORT(page);
priv = GNC_PLUGIN_PAGE_REPORT_GET_PRIVATE(report);

#ifndef WEBKIT1
/* Hide the ExportPdf action for Webkit2 */
priv->webkit2 = TRUE;
#endif

topLvl = gnc_ui_get_main_window (nullptr);
// priv->html = gnc_html_new( topLvl );
priv->html = gnc_html_factory_create_html();
Expand Down Expand Up @@ -1249,8 +1243,6 @@ gnc_plugin_page_report_menu_update (GncPluginPage *plugin_page,
static void
gnc_plugin_page_report_menu_updates (GncPluginPage *plugin_page)
{
GncPluginPageReportPrivate *priv;
GncPluginPageReport *report;
GncMainWindow *window;
action_toolbar_labels tooltip_list[3];
GAction *action;
Expand All @@ -1263,9 +1255,6 @@ gnc_plugin_page_report_menu_updates (GncPluginPage *plugin_page)
_("Add the current report's configuration to the 'Reports->Saved Report Configurations' menu. "
"The report configuration will be saved in the file %s."), saved_reports_path);

report = GNC_PLUGIN_PAGE_REPORT(plugin_page);
priv = GNC_PLUGIN_PAGE_REPORT_GET_PRIVATE(report);

window = (GncMainWindow*)gnc_plugin_page_get_window (GNC_PLUGIN_PAGE(plugin_page));

tooltip_list[0] = { "ReportSaveAction", N_("Save _Report Configuration"), report_save_str };
Expand All @@ -1278,11 +1267,6 @@ gnc_plugin_page_report_menu_updates (GncPluginPage *plugin_page)
action = gnc_main_window_find_action (window, "FilePrintAction");
g_simple_action_set_enabled (G_SIMPLE_ACTION(action), true);

if (priv->webkit2)
{
GtkWidget *pdf_item = gnc_main_window_menu_find_menu_item (window, "FilePrintPDFAction");
gtk_widget_hide (pdf_item);
}
g_free (saved_reports_path);
g_free (report_save_str);
g_free (report_saveas_str);
Expand All @@ -1299,7 +1283,6 @@ gnc_plugin_page_report_constr_init (GncPluginPageReport *plugin_page, gint repor
DEBUG("property reportId=%d", reportId);
priv = GNC_PLUGIN_PAGE_REPORT_GET_PRIVATE(plugin_page);
priv->reportId = reportId;
priv->webkit2 = FALSE;

gnc_plugin_page_report_setup( GNC_PLUGIN_PAGE(plugin_page));

Expand Down Expand Up @@ -1991,11 +1974,7 @@ gnc_plugin_page_report_print_cb (GSimpleAction *simple,

//g_warning("Setting job name=%s", job_name);

#ifdef WEBKIT1
gnc_html_print (priv->html, job_name, FALSE);
#else
gnc_html_print (priv->html, job_name);
#endif

g_free (job_name);
}
Expand Down Expand Up @@ -2037,11 +2016,7 @@ gnc_plugin_page_report_exportpdf_cb (GSimpleAction *simple,

//g_warning("Setting job name=%s", job_name);

#ifdef WEBKIT1
gnc_html_print (priv->html, job_name, TRUE);
#else
gnc_html_print (priv->html, job_name);
#endif

if (owner)
{
Expand Down
15 changes: 0 additions & 15 deletions gnucash/html/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ set (html_HEADERS
gnc-html-p.h
gnc-html-factory.h
gnc-html-extras.h
gnc-html-webkit-p.h
gnc-html-webkit.h
)

# Command to generate the swig-gnc-html.c wrapper file
Expand All @@ -21,18 +19,6 @@ set (html_SOURCES
gnc-html-factory.c
)

if (WEBKIT1)
list(APPEND html_HEADERS gnc-html-webkit1.h)
list(APPEND html_SOURCES gnc-html-webkit1.c)
set(html_EXTRA_DIST gnc-html-webkit2.h gnc-html-webkit2.c)
else ()
list(APPEND html_HEADERS gnc-html-webkit2.h)
list(APPEND html_SOURCES gnc-html-webkit2.c)
set(html_EXTRA_DIST gnc-html-webkit1.h gnc-html-webkit1.c)
endif()



set (gnc_html_SCHEME html.scm)

set(GUILE_OUTPUT_DIR gnucash)
Expand All @@ -57,7 +43,6 @@ target_link_libraries(gnc-html
gnc-engine
gnc-gnome-utils
PkgConfig::GTK3
PkgConfig::WEBKIT
${GUILE_LDFLAGS})

target_compile_definitions(gnc-html PRIVATE -DG_LOG_DOMAIN=\"gnc.html\")
Expand Down
1 change: 0 additions & 1 deletion gnucash/html/gnc-html-factory.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
#include <gtk/gtk.h>

#include "gnc-html.h"
#include "gnc-html-webkit.h"
#include "qoflog.h"
#include "gnc-engine.h"

Expand Down
16 changes: 2 additions & 14 deletions gnucash/html/gnc-html.c
Original file line number Diff line number Diff line change
Expand Up @@ -528,25 +528,17 @@ gnc_html_export_to_file( GncHtml* self, const gchar* filepath )
return FALSE;
}
}
#ifdef WEBKIT1
void
gnc_html_print (GncHtml* self, const char *jobname, gboolean export_pdf)
#else

void
gnc_html_print (GncHtml* self, const char *jobname)
#endif
{
g_return_if_fail( self != NULL );
g_return_if_fail( jobname != NULL );
g_return_if_fail( GNC_IS_HTML(self) );

if ( GNC_HTML_GET_CLASS(self)->print != NULL )
{
#ifdef WEBKIT1
GNC_HTML_GET_CLASS(self)->print (self, jobname, export_pdf);
#else
GNC_HTML_GET_CLASS(self)->print (self, jobname);
#endif
}
else
{
Expand Down Expand Up @@ -589,17 +581,13 @@ gnc_html_get_webview( GncHtml* self )

if (sw_list) // the scroll window has only one child
{
#ifdef WEBKIT1
webview = sw_list->data;
#else
GList *vp_list = gtk_container_get_children (GTK_CONTAINER(sw_list->data));

if (vp_list) // the viewport has only one child
{
webview = vp_list->data;
g_list_free (vp_list);
}
#endif
}
g_list_free (sw_list);
return webview;
Expand Down
18 changes: 1 addition & 17 deletions gnucash/html/gnc-html.h
Original file line number Diff line number Diff line change
Expand Up @@ -138,11 +138,7 @@ struct _GncHtmlClass
void (*reload)( GncHtml* html, gboolean force_rebuild );
void (*copy_to_clipboard)( GncHtml* html );
gboolean (*export_to_file)( GncHtml* html, const gchar* file );
#ifdef WEBKIT1
void (*print) (GncHtml* html, const gchar* jobname, gboolean export_pdf);
#else
void (*print) (GncHtml* html, const gchar* jobname);
#endif
void (*cancel)( GncHtml* html );
URLType (*parse_url)( GncHtml* html, const gchar* url,
gchar** url_location, gchar** url_label );
Expand Down Expand Up @@ -203,25 +199,13 @@ void gnc_html_copy_to_clipboard( GncHtml* html );
*/
gboolean gnc_html_export_to_file( GncHtml* html, const gchar* filename );

#ifdef WEBKIT1
/**
* Prints the report.
*
* @param html GncHtml object
* @param jobname A jobname for identifying the print job or to provide
* an output filename.
* @param export_pdf If TRUE write a PDF file using the jobname for a
* filename; otherwise put up a print dialog.
*/
void gnc_html_print (GncHtml* html, const char* jobname, gboolean export_pdf);
#else
/**
* Prints the report.
*
* @param html GncHtml object
*/
void gnc_html_print (GncHtml* html, const char* jobname);
#endif

/**
* Cancels the current operation
*
Expand Down

0 comments on commit 1d94ec3

Please sign in to comment.