Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

### Experiment ### Use browser instaed of Webkit #1849

Open
wants to merge 3 commits into
base: stable
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
22 changes: 7 additions & 15 deletions gnucash/html/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@ set (html_HEADERS
gnc-html-p.h
gnc-html-factory.h
gnc-html-extras.h
gnc-html-webkit-p.h
gnc-html-webkit.h
gnc-html-browser-p.h
gnc-html-browser.h
gnc-ws-server.h
gnc-ws-protocol.h
)

# Command to generate the swig-gnc-html.c wrapper file
Expand All @@ -19,20 +21,11 @@ set (html_SOURCES
gnc-html.c
gnc-html-history.c
gnc-html-factory.c
gnc-html-browser.c
gnc-ws-server.c
gnc-ws-protocol.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 +50,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
40 changes: 40 additions & 0 deletions gnucash/html/gnc-html-browser-p.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/********************************************************************
* gnc-html-browser-p.h -- display html with gnc special tags *
* Copyright (C) 2024 Bob Fewell *
* *
* This program is free software; you can redistribute it and/or *
* modify it under the terms of the GNU General Public License as *
* published by the Free Software Foundation; either version 2 of *
* the License, or (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License*
* along with this program; if not, contact: *
* *
* Free Software Foundation Voice: +1-617-542-5942 *
* 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 *
* Boston, MA 02110-1301, USA gnu@gnu.org *
\********************************************************************/

#ifndef GNC_HTML_BROWSER_P_H
#define GNC_HTML_BROWSER_P_H

#include "gnc-html-p.h"

struct _GncHtmlBrowserPrivate
{
struct _GncHtmlPrivate base;

GtkWidget *web_view;
gchar* html_string; /* html string being displayed */

GncWsServer *gws;

const gchar *file_name;
};

#endif
Loading
Loading