|
|
|
|
@ -724,12 +724,10 @@ static void
|
|
|
|
|
impl_webkit_show_data( GncHtml* self, const gchar* data, int datalen )
|
|
|
|
|
{
|
|
|
|
|
GncHtmlWebkitPrivate* priv;
|
|
|
|
|
#if HAVE(WEBKIT_WEB_VIEW_LOAD_URI)
|
|
|
|
|
#define TEMPLATE_REPORT_FILE_NAME "gnc-report-XXXXXX.html"
|
|
|
|
|
int fd;
|
|
|
|
|
gchar* uri;
|
|
|
|
|
gchar *filename;
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
g_return_if_fail( self != NULL );
|
|
|
|
|
g_return_if_fail( GNC_IS_HTML_WEBKIT(self) );
|
|
|
|
|
@ -738,7 +736,6 @@ impl_webkit_show_data( GncHtml* self, const gchar* data, int datalen )
|
|
|
|
|
|
|
|
|
|
priv = GNC_HTML_WEBKIT_GET_PRIVATE(self);
|
|
|
|
|
|
|
|
|
|
#if HAVE(WEBKIT_WEB_VIEW_LOAD_URI)
|
|
|
|
|
/* Export the HTML to a file and load the file URI. On Linux, this seems to get around some
|
|
|
|
|
security problems (otherwise, it can complain that embedded images aren't permitted to be
|
|
|
|
|
viewed because they are local resources). On Windows, this allows the embedded images to
|
|
|
|
|
@ -753,9 +750,6 @@ impl_webkit_show_data( GncHtml* self, const gchar* data, int datalen )
|
|
|
|
|
DEBUG("Loading uri '%s'", uri);
|
|
|
|
|
webkit_web_view_load_uri( priv->web_view, uri );
|
|
|
|
|
g_free( uri );
|
|
|
|
|
#else
|
|
|
|
|
webkit_web_view_load_html_string( priv->web_view, data, BASE_URI_NAME );
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
LEAVE("");
|
|
|
|
|
}
|
|
|
|
|
@ -1093,23 +1087,16 @@ impl_webkit_export_to_file( GncHtml* self, const char *filepath )
|
|
|
|
|
static void
|
|
|
|
|
impl_webkit_print( GncHtml* self, const gchar* jobname, gboolean export_pdf )
|
|
|
|
|
{
|
|
|
|
|
#if !HAVE(WEBKIT_WEB_FRAME_PRINT_FULL)
|
|
|
|
|
extern void webkit_web_frame_print( WebKitWebFrame * frame );
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
gchar *export_filename = NULL;
|
|
|
|
|
GncHtmlWebkitPrivate* priv;
|
|
|
|
|
WebKitWebFrame* frame;
|
|
|
|
|
#if HAVE(WEBKIT_WEB_FRAME_PRINT_FULL)
|
|
|
|
|
GtkPrintOperation* op = gtk_print_operation_new();
|
|
|
|
|
GError* error = NULL;
|
|
|
|
|
GtkPrintSettings *print_settings;
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
priv = GNC_HTML_WEBKIT_GET_PRIVATE(self);
|
|
|
|
|
frame = webkit_web_view_get_main_frame( priv->web_view );
|
|
|
|
|
|
|
|
|
|
#if HAVE(WEBKIT_WEB_FRAME_PRINT_FULL)
|
|
|
|
|
gnc_print_operation_init( op, jobname );
|
|
|
|
|
print_settings = gtk_print_operation_get_print_settings (op);
|
|
|
|
|
if (!print_settings)
|
|
|
|
|
@ -1284,10 +1271,6 @@ impl_webkit_print( GncHtml* self, const gchar* jobname, gboolean export_pdf )
|
|
|
|
|
gnc_print_operation_save_print_settings(op);
|
|
|
|
|
g_object_unref( op );
|
|
|
|
|
g_free(export_filename);
|
|
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
webkit_web_frame_print( frame );
|
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
|