Merge branch 'maint'

This commit is contained in:
Geert Janssens 2017-01-30 19:34:29 +01:00
commit 5cbdc5d816
13 changed files with 1588 additions and 1346 deletions

View File

@ -1404,35 +1404,7 @@ then
webkit)
PKG_CHECK_MODULES(WEBKIT, webkit-1.0 >= "1.2")
case "$platform" in
win32)
# 1.1.90 has both functions
AC_DEFINE(HAVE_WEBKIT_WEB_VIEW_LOAD_URI,1,[webkit_web_view_load_uri exists])
AC_DEFINE(HAVE_WEBKIT_WEB_FRAME_PRINT_FULL,1,[webkit_web_frame_print_full exists])
;;
*)
# Unsure - check functions exist
oLIBS="$LIBS"
LIBS="$LIBS ${WEBKIT_LIBS}"
AC_CHECK_FUNCS(webkit_web_view_load_uri)
LIBS="$oLIBS"
AC_MSG_CHECKING(for webkit_web_frame_print_full)
saved_CFLAGS="${CFLAGS}"
saved_LIBS="${LIBS}"
CFLAGS="${CFLAGS} ${WEBKIT_CFLAGS}"
LIBS="${LIBS} ${WEBKIT_LIBS}"
AC_LINK_IFELSE(
[AC_LANG_PROGRAM(
[[#include <webkit/webkit.h>]],
[[webkit_web_frame_print_full( 0, 0, 0, 0 );]])],
[AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_WEBKIT_WEB_FRAME_PRINT_FULL,1,[webkit_web_frame_print_full exists])],
[AC_MSG_RESULT(no)])
CFLAGS="${saved_CFLAGS}"
LIBS="${saved_LIBS}"
;;
esac
;;
;;
*) AC_MSG_ERROR([Invalid HTML engine: must be webkit]) ;;
esac

2667
po/pt.po

File diff suppressed because it is too large Load Diff

View File

@ -112,9 +112,6 @@ IF(GLIB2_VERSION VERSION_GREATER 2.38.0 OR GLIB2_VERSION VERSION_EQUAL 2.38.0)
SET(HAVE_GLIB_2_38 1)
ENDIF()
SET(HAVE_WEBKIT_WEB_FRAME_PRINT_FULL 1)
SET(HAVE_WEBKIT_WEB_VIEW_LOAD_URI 1)
IF(DISABLE_DEPRECATED_GNOME)
SET(GNOME_DISABLE_DEPRECATED 1)
ENDIF(DISABLE_DEPRECATED_GNOME)

View File

@ -263,12 +263,6 @@
/* Define to 1 if you have the <wctype.h> header file. */
#cmakedefine HAVE_WCTYPE_H 1
/* webkit_web_frame_print_full exists */
#cmakedefine HAVE_WEBKIT_WEB_FRAME_PRINT_FULL 1
/* Define to 1 if you have the `webkit_web_view_load_uri' function. */
#cmakedefine HAVE_WEBKIT_WEB_VIEW_LOAD_URI 1
/* Define to 1 if you have the <X11/Xlib.h> header file. */
#cmakedefine HAVE_X11_XLIB_H 1

View File

@ -96,7 +96,9 @@ test_transaction_reversal_SOURCES = test-transaction-reversal.cpp
test_transaction_voiding_SOURCES = test-transaction-voiding.cpp
$(SCM_TESTS): %: $(srcdir)/%.scm Makefile .scm-links
echo '${GUILE} --debug -l $(srcdir)/$*.scm -c "(exit (run-test))"' > $@
echo 'export GNC_BUILDDIR="${abs_top_builddir}";' > $@
echo 'export GNC_UNINSTALLED=yes;' >> $@
echo '${GUILE} --debug -l $(srcdir)/$*.scm -c "(exit (run-test))"' >> $@
chmod a+x $@
TESTS_ENVIRONMENT = \

View File

@ -1221,6 +1221,7 @@ gnc_preferences_dialog_create(void)
gnc_builder_add_from_file (builder, "dialog-preferences.glade", "autosave_interval_minutes_adj");
gnc_builder_add_from_file (builder, "dialog-preferences.glade", "save_on_close_adj");
gnc_builder_add_from_file (builder, "dialog-preferences.glade", "date_backmonth_adj");
gnc_builder_add_from_file (builder, "dialog-preferences.glade", "default_zoom_adj");
gnc_builder_add_from_file (builder, "dialog-preferences.glade", "max_transactions_adj");
gnc_builder_add_from_file (builder, "dialog-preferences.glade", "key_length_adj");
gnc_builder_add_from_file (builder, "dialog-preferences.glade", "new_search_limit_adj");

View File

@ -1181,6 +1181,8 @@ gnc_dense_cal_button_press(GtkWidget *widget,
GtkAllocation alloc;
gint doc;
GncDenseCal *dcal = GNC_DENSE_CAL(widget);
gint win_xpos = evt->x_root + 5;
gint win_ypos = evt->y_root + 5;
doc = wheres_this(dcal, evt->x, evt->y);
dcal->showPopup = ~(dcal->showPopup);
@ -1200,11 +1202,13 @@ gnc_dense_cal_button_press(GtkWidget *widget,
gtk_widget_queue_resize(GTK_WIDGET(dcal->transPopup));
gtk_widget_show_all(GTK_WIDGET(dcal->transPopup));
if ((evt->x_root + 5 + alloc.width > gdk_screen_get_width(screen))||
(evt->y_root + 5 + alloc.height > gdk_screen_get_height(screen)))
gtk_window_move(GTK_WINDOW(dcal->transPopup), evt->x_root - 2 - alloc.width, evt->y_root - 2 - alloc.height);
else
gtk_window_move(GTK_WINDOW(dcal->transPopup), evt->x_root + 5, evt->y_root + 5);
if (evt->x_root + 5 + alloc.width > gdk_screen_get_width(screen))
win_xpos = evt->x_root - 2 - alloc.width;
if (evt->y_root + 5 + alloc.height > gdk_screen_get_height(screen))
win_ypos = evt->y_root - 2 - alloc.height;
gtk_window_move(GTK_WINDOW(dcal->transPopup), win_xpos, win_ypos);
}
else
gtk_widget_hide(GTK_WIDGET(dcal->transPopup));
@ -1221,6 +1225,8 @@ gnc_dense_cal_motion_notify(GtkWidget *widget,
gint doc;
int unused;
GdkModifierType unused2;
gint win_xpos = event->x_root + 5;
gint win_ypos = event->y_root + 5;
dcal = GNC_DENSE_CAL(widget);
if (!dcal->showPopup)
@ -1238,13 +1244,15 @@ gnc_dense_cal_motion_notify(GtkWidget *widget,
gtk_widget_get_allocation(GTK_WIDGET(dcal->transPopup), &alloc);
gtk_widget_show_all(GTK_WIDGET(dcal->transPopup));
gtk_widget_show_all(GTK_WIDGET(dcal->transPopup));
if ((event->x_root + 5 + alloc.width > gdk_screen_get_width(screen))||
(event->y_root + 5 + alloc.height > gdk_screen_get_height(screen)))
gtk_window_move(GTK_WINDOW(dcal->transPopup), event->x_root - 2 - alloc.width, event->y_root - 2 - alloc.height);
else
gtk_window_move(GTK_WINDOW(dcal->transPopup), event->x_root + 5, event->y_root + 5);
if (event->x_root + 5 + alloc.width > gdk_screen_get_width(screen))
win_xpos = event->x_root - 2 - alloc.width;
if (event->y_root + 5 + alloc.height > gdk_screen_get_height(screen))
win_ypos = event->y_root - 2 - alloc.height;
gtk_window_move(GTK_WINDOW(dcal->transPopup), win_xpos, win_ypos);
}
else
gtk_widget_hide(GTK_WIDGET(dcal->transPopup));

View File

@ -51,6 +51,13 @@
</row>
</data>
</object>
<object class="GtkAdjustment" id="default_zoom_adj">
<property name="lower">1</property>
<property name="upper">10</property>
<property name="value">1</property>
<property name="step_increment">0.10000000000000001</property>
<property name="page_increment">1</property>
</object>
<object class="GtkAdjustment" id="key_length_adj">
<property name="lower">1</property>
<property name="upper">999</property>
@ -1936,15 +1943,6 @@ many months before the current month:</property>
<property name="x_padding">12</property>
</packing>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<object class="GtkLabel" id="label84">
<property name="visible">True</property>
@ -3201,7 +3199,7 @@ many months before the current month:</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="border_width">6</property>
<property name="n_rows">6</property>
<property name="n_rows">10</property>
<property name="n_columns">4</property>
<child>
<placeholder/>
@ -3215,6 +3213,33 @@ many months before the current month:</property>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<object class="GtkLabel" id="locale_currency2">
<property name="visible">True</property>
@ -3369,6 +3394,84 @@ many months before the current month:</property>
<child>
<placeholder/>
</child>
<child>
<object class="GtkLabel" id="label20">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">&lt;b&gt;Default zoom level&lt;/b&gt;</property>
<property name="use_markup">True</property>
</object>
<packing>
<property name="top_attach">7</property>
<property name="bottom_attach">8</property>
<property name="x_options">GTK_FILL</property>
<property name="y_options"/>
</packing>
</child>
<child>
<object class="GtkHBox" id="hbox5">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkSpinButton" id="pref/general.report/default-zoom">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="tooltip_text" translatable="yes">On high resolution screens reports tend to be hard to read.
This option allows you to scale reports up by the set factor.
For example setting this to 2.0 will display reports at twice their typical size.</property>
<property name="max_length">4</property>
<property name="invisible_char">●</property>
<property name="primary_icon_activatable">False</property>
<property name="secondary_icon_activatable">False</property>
<property name="primary_icon_sensitive">True</property>
<property name="secondary_icon_sensitive">True</property>
<property name="adjustment">default_zoom_adj</property>
<property name="digits">1</property>
<property name="snap_to_ticks">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<placeholder/>
</child>
</object>
<packing>
<property name="top_attach">8</property>
<property name="bottom_attach">9</property>
<property name="x_options">GTK_FILL</property>
<property name="y_options">GTK_FILL</property>
<property name="x_padding">12</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label21">
<property name="visible">True</property>
<property name="can_focus">False</property>
</object>
<packing>
<property name="top_attach">6</property>
<property name="bottom_attach">7</property>
<property name="x_options">GTK_FILL</property>
<property name="y_options"/>
</packing>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
</object>
<packing>
<property name="position">7</property>

View File

@ -338,6 +338,11 @@
<summary>Default currency for new reports</summary>
<description>This setting controls the default currency used for reports. If set to "locale" then GnuCash will retrieve the default currency from the user's locale setting. If set to "other", GnuCash will use the setting specified by the currency-other key.</description>
</key>
<key name="default-zoom" type="d">
<default>1.0</default>
<summary>Zoom factor to use by default for reports.</summary>
<description>On high-resolution displays the reports will be unreadable by default. Setting a zoom factor to a number bigger than 1.0 can help improve this situation.</description>
</key>
<child name="pdf-export" schema="org.gnucash.general.report.pdf-export"/>
</schema>
<schema id="org.gnucash.general.report.pdf-export" path="/org/gnucash/general/report/pdf-export/">

View File

@ -46,6 +46,7 @@
#include <webkit/webkit.h>
#include "Account.h"
#include "gnc-prefs.h"
#include "gnc-gui-query.h"
#include "gnc-engine.h"
#include "gnc-html.h"
@ -85,6 +86,7 @@ static char error_404_title[] = N_("Not found");
static char error_404_body[] = N_("The specified URL could not be loaded.");
#define BASE_URI_NAME "base-uri"
#define GNC_PREF_RPT_DFLT_ZOOM "default-zoom"
static WebKitNavigationResponse webkit_navigation_requested_cb(
WebKitWebView* web_view,
@ -114,6 +116,7 @@ static gboolean impl_webkit_export_to_file( GncHtml* self, const gchar* filepath
static void impl_webkit_print( GncHtml* self, const gchar* jobname, gboolean export_pdf );
static void impl_webkit_cancel( GncHtml* self );
static void impl_webkit_set_parent( GncHtml* self, GtkWindow* parent );
static void impl_webkit_default_zoom_changed(gpointer prefs, gchar *pref, gpointer user_data);
static void
gnc_html_webkit_init( GncHtmlWebkit* self )
@ -123,6 +126,7 @@ gnc_html_webkit_init( GncHtmlWebkit* self )
WebKitWebSettings* webkit_settings = NULL;
const char* default_font_family = NULL;
gdouble zoom = 1.0;
new_priv = g_realloc( GNC_HTML(self)->priv, sizeof(GncHtmlWebkitPrivate) );
priv = self->priv = new_priv;
@ -131,6 +135,7 @@ gnc_html_webkit_init( GncHtmlWebkit* self )
priv->html_string = NULL;
priv->web_view = WEBKIT_WEB_VIEW(webkit_web_view_new());
/* Get the default font family from GtkStyle of a GtkWidget(priv-web_view). */
default_font_family = pango_font_description_get_family( gtk_rc_get_style(GTK_WIDGET(priv->web_view))->font_desc );
@ -148,6 +153,11 @@ gnc_html_webkit_init( GncHtmlWebkit* self )
NULL);
PINFO("webkit_settings: Set default font to [%s]", default_font_family);
}
/* Scale everything up */
zoom = gnc_prefs_get_float (GNC_PREFS_GROUP_GENERAL_REPORT, GNC_PREF_RPT_DFLT_ZOOM);
webkit_web_view_set_full_content_zoom (priv->web_view, TRUE);
webkit_web_view_set_zoom_level (priv->web_view, zoom);
gtk_container_add( GTK_CONTAINER(priv->base.container),
GTK_WIDGET(priv->web_view) );
@ -185,6 +195,11 @@ gnc_html_webkit_init( GncHtmlWebkit* self )
self);
#endif
gnc_prefs_register_cb (GNC_PREFS_GROUP_GENERAL_REPORT,
GNC_PREF_RPT_DFLT_ZOOM,
impl_webkit_default_zoom_changed,
self);
LEAVE("retval %p", self);
}
@ -226,6 +241,11 @@ gnc_html_webkit_dispose( GObject* obj )
priv->html_string = NULL;
}
gnc_prefs_remove_cb_by_func (GNC_PREFS_GROUP_GENERAL_REPORT,
GNC_PREF_RPT_DFLT_ZOOM,
impl_webkit_default_zoom_changed,
obj);
G_OBJECT_CLASS(gnc_html_webkit_parent_class)->dispose( obj );
}
@ -728,12 +748,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) );
@ -742,7 +760,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
@ -757,9 +774,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("");
}
@ -1097,23 +1111,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)
@ -1288,10 +1295,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
@ -1305,3 +1308,17 @@ impl_webkit_set_parent( GncHtml* self, GtkWindow* parent )
priv = GNC_HTML_WEBKIT_GET_PRIVATE(self);
priv->base.parent = GTK_WIDGET(parent);
}
static void
impl_webkit_default_zoom_changed(gpointer prefs, gchar *pref, gpointer user_data)
{
gdouble zoom = 1.0;
GncHtmlWebkit* self = GNC_HTML_WEBKIT(user_data);
GncHtmlWebkitPrivate* priv = GNC_HTML_WEBKIT_GET_PRIVATE(self);
g_return_if_fail(user_data != NULL);
zoom = gnc_prefs_get_float (GNC_PREFS_GROUP_GENERAL_REPORT, GNC_PREF_RPT_DFLT_ZOOM);
webkit_web_view_set_zoom_level (priv->web_view, zoom);
}

View File

@ -3,9 +3,9 @@
;;
;; updated by J. Alex Aycinena, July 2008, October 2009
;;
;; This report prints transaction detail and account totals for Tax-related
;; accounts sorted by form/schedule, copy, line and tax code, and exports TXF
;; files for import to TaxCut, TurboTax, etc.
;; This report prints transaction details and account totals for accounts
;; relevant to United States taxes, sorted by form/schedule, copy, line
;; and tax code, and exports TXF files for import to TaxCut, TurboTax, etc.
;;
;; For this to work, the user has to segregate taxable and not taxable
;; income to different accounts, as well as deductible and non-

View File

@ -58,7 +58,9 @@ GNC_TEST_DEPS = --gnc-module-dir ${top_builddir}/src/engine \
--library-dir ${top_builddir}/src/gnc-module
$(SCM_TESTS): %: $(srcdir)/%.scm Makefile .scm-links
echo '${GUILE} --debug -l $(srcdir)/$*.scm -c "(exit (run-test))"' > $@
echo 'export GNC_BUILDDIR="${abs_top_builddir}";' > $@
echo 'export GNC_UNINSTALLED=yes;' >> $@
echo '${GUILE} --debug -l $(srcdir)/$*.scm -c "(exit (run-test))"' >> $@
chmod a+x $@
TESTS_ENVIRONMENT = \

View File

@ -46,7 +46,9 @@ GNC_TEST_DEPS = \
--library-dir ${top_builddir}/src/gnc-module
$(SCM_TESTS): %: $(srcdir)/%.scm Makefile .scm-links
echo '${GUILE} --debug -l $(srcdir)/$*.scm -c "(exit (run-test))"' > $@
echo 'export GNC_BUILDDIR="${abs_top_builddir}";' > $@
echo 'export GNC_UNINSTALLED=yes;' >> $@
echo '${GUILE} --debug -l $(srcdir)/$*.scm -c "(exit (run-test))"' >> $@
chmod a+x $@
TESTS_ENVIRONMENT = \