gnucash maint: Multiple changes pushed
Geert Janssens
gjanssens at code.gnucash.org
Wed Nov 23 08:17:14 EST 2016
Updated via https://github.com/Gnucash/gnucash/commit/bc33d564 (commit)
via https://github.com/Gnucash/gnucash/commit/a56f031d (commit)
via https://github.com/Gnucash/gnucash/commit/a67b4922 (commit)
via https://github.com/Gnucash/gnucash/commit/5ce88787 (commit)
via https://github.com/Gnucash/gnucash/commit/d56c3d3a (commit)
via https://github.com/Gnucash/gnucash/commit/12562bcc (commit)
via https://github.com/Gnucash/gnucash/commit/da0b3b51 (commit)
via https://github.com/Gnucash/gnucash/commit/74091fbc (commit)
via https://github.com/Gnucash/gnucash/commit/372b3cc8 (commit)
via https://github.com/Gnucash/gnucash/commit/371222cb (commit)
via https://github.com/Gnucash/gnucash/commit/49014f47 (commit)
via https://github.com/Gnucash/gnucash/commit/891dcbc3 (commit)
via https://github.com/Gnucash/gnucash/commit/51277bcd (commit)
via https://github.com/Gnucash/gnucash/commit/12994ca6 (commit)
via https://github.com/Gnucash/gnucash/commit/62e449f3 (commit)
via https://github.com/Gnucash/gnucash/commit/1b2f89e1 (commit)
via https://github.com/Gnucash/gnucash/commit/d7648a2b (commit)
from https://github.com/Gnucash/gnucash/commit/1339c116 (commit)
commit bc33d564a8f6533936521d3276ce9c300b56afdd
Author: Robert Fewell <14uBobIT at gmail.com>
Date: Wed Nov 16 19:23:58 2016 +0000
Changed the default value for date format
Set the default value to the new 'No Fancy Date Format'.
diff --git a/src/gnome/gschemas/org.gnucash.dialogs.checkprinting.gschema.xml.in.in b/src/gnome/gschemas/org.gnucash.dialogs.checkprinting.gschema.xml.in.in
index 887aa3d..9ca5dc8 100644
--- a/src/gnome/gschemas/org.gnucash.dialogs.checkprinting.gschema.xml.in.in
+++ b/src/gnome/gschemas/org.gnucash.dialogs.checkprinting.gschema.xml.in.in
@@ -16,7 +16,7 @@
<description>Number of checks to print on the first page.</description>
</key>
<key name="date-format" type="i">
- <default>0</default>
+ <default>7</default>
<summary>Date format to use</summary>
<description>This is the numerical identifier of the predefined date format to use.</description>
</key>
commit a56f031d4591b610e468fcc305ac091ed410198e
Author: Robert Fewell <14uBobIT at gmail.com>
Date: Wed Nov 16 19:22:21 2016 +0000
Fix check printing custom preference value
The scheme option is 'date-format-user' so corrected here.
diff --git a/src/gnome/dialog-print-check.c b/src/gnome/dialog-print-check.c
index 6d6a7c4..fa3d150 100644
--- a/src/gnome/dialog-print-check.c
+++ b/src/gnome/dialog-print-check.c
@@ -68,7 +68,7 @@ G_GNUC_UNUSED static QofLogModule log_module = "gnc.printing.checks";
#define GNC_PREF_CHECK_FORMAT_GUID "check-format-guid"
#define GNC_PREF_CHECK_POSITION "check-position"
#define GNC_PREF_FIRST_PAGE_COUNT "first-page-count"
-#define GNC_PREF_DATE_FORMAT_USER "date-format-custom"
+#define GNC_PREF_DATE_FORMAT_USER "date-format-user"
#define GNC_PREF_CUSTOM_PAYEE "custom-payee"
#define GNC_PREF_CUSTOM_DATE "custom-date"
#define GNC_PREF_CUSTOM_WORDS "custom-amount-words"
commit a67b4922c250004a16457dd58d7f21003cb7d9b4
Author: Robert Fewell <14uBobIT at gmail.com>
Date: Wed Nov 16 19:20:15 2016 +0000
Correct the default options if default invalid
The default value should be a list and have set the default to the new
"No Fancy Date Format" option.
diff --git a/src/app-utils/options.scm b/src/app-utils/options.scm
index e9120be..86b1734 100644
--- a/src/app-utils/options.scm
+++ b/src/app-utils/options.scm
@@ -1319,7 +1319,7 @@
(define (def-value)
(if (list? default-value)
default-value
- '(locale number #t "")))
+ (list 'unset 'number #t "")))
(let* ((value (def-value))
(value->string (lambda ()
commit 5ce8878764a47f0ff9f98f5bc7cc50858229fd72
Author: Robert Fewell <14uBobIT at gmail.com>
Date: Wed Nov 16 19:13:50 2016 +0000
Add an unset option to date-format
Added an option of "No Fancy Date Format" to date-format so it can be
the default. In this position, the format returned is that of what ever
the preference date is set to.
diff --git a/src/gnome-utils/gnc-date-format.c b/src/gnome-utils/gnc-date-format.c
index 27fabba..f5c4696 100644
--- a/src/gnome-utils/gnc-date-format.c
+++ b/src/gnome-utils/gnc-date-format.c
@@ -188,7 +188,7 @@ gnc_date_format_init (GNCDateFormat *gdf)
priv->sample_label = GTK_WIDGET(gtk_builder_get_object (builder, "sample_label"));
/* Set initial format to gnucash default */
- gnc_date_format_set_format(gdf, qof_date_format_get());
+ gnc_date_format_set_format(gdf, QOF_DATE_FORMAT_UNSET);
/* pull in the dialog and table widgets and play the reconnect game */
dialog = GTK_WIDGET(gtk_builder_get_object (builder, "GNC Date Format"));
diff --git a/src/gnome-utils/gtkbuilder/gnc-date-format.glade b/src/gnome-utils/gtkbuilder/gnc-date-format.glade
index 6e7469d..6c2dbb4 100644
--- a/src/gnome-utils/gtkbuilder/gnc-date-format.glade
+++ b/src/gnome-utils/gtkbuilder/gnc-date-format.glade
@@ -305,14 +305,17 @@
<col id="0" translatable="yes">ISO (2001-12-31)</col>
</row>
<row>
- <col id="0" translatable="yes">UTC</col>
+ <col id="0" translatable="yes">Locale</col>
</row>
<row>
- <col id="0" translatable="yes">Locale</col>
+ <col id="0" translatable="yes">UTC - Coordinated Universal Time</col>
</row>
<row>
<col id="0" translatable="yes">Custom</col>
</row>
+ <row>
+ <col id="0" translatable="yes">No Fancy Date Format</col>
+ </row>
</data>
</object>
</interface>
diff --git a/src/libqof/qof/gnc-date.c b/src/libqof/qof/gnc-date.c
index 5f4133c..d23d197 100644
--- a/src/libqof/qof/gnc-date.c
+++ b/src/libqof/qof/gnc-date.c
@@ -456,6 +456,8 @@ gnc_date_dateformat_to_string(QofDateFormat format)
return "locale";
case QOF_DATE_FORMAT_CUSTOM:
return "custom";
+ case QOF_DATE_FORMAT_UNSET:
+ return "unset";
default:
return NULL;
}
@@ -481,6 +483,8 @@ gnc_date_string_to_dateformat(const char* fmt_str, QofDateFormat *format)
*format = QOF_DATE_FORMAT_LOCALE;
else if (!strcmp(fmt_str, "custom"))
*format = QOF_DATE_FORMAT_CUSTOM;
+ else if (!strcmp(fmt_str, "unset"))
+ *format = QOF_DATE_FORMAT_UNSET;
else
return TRUE;
@@ -769,6 +773,8 @@ const gchar *qof_date_format_get_string(QofDateFormat df)
return "%Y-%m-%dT%H:%M:%SZ";
case QOF_DATE_FORMAT_ISO:
return "%Y-%m-%d";
+ case QOF_DATE_FORMAT_UNSET: // use global
+ return qof_date_format_get_string (dateFormat);
case QOF_DATE_FORMAT_LOCALE:
default:
break;
@@ -798,6 +804,8 @@ const gchar *qof_date_text_format_get_string(QofDateFormat df)
return "%Y-%m-%dT%H:%M:%SZ";
case QOF_DATE_FORMAT_ISO:
return "%Y-%b-%d";
+ case QOF_DATE_FORMAT_UNSET: // use global
+ return qof_date_text_format_get_string (dateFormat);
case QOF_DATE_FORMAT_LOCALE:
default:
break;
diff --git a/src/libqof/qof/gnc-date.h b/src/libqof/qof/gnc-date.h
index 51fa353..acdbe65 100644
--- a/src/libqof/qof/gnc-date.h
+++ b/src/libqof/qof/gnc-date.h
@@ -122,7 +122,8 @@ typedef enum
QOF_DATE_FORMAT_ISO, /**< ISO: yyyy-mm-dd */
QOF_DATE_FORMAT_LOCALE, /**< Take from locale information */
QOF_DATE_FORMAT_UTC, /**< UTC: 2004-12-12T23:39:11Z */
- QOF_DATE_FORMAT_CUSTOM /**< Used by the check printing code */
+ QOF_DATE_FORMAT_CUSTOM, /**< Used by the check printing code */
+ QOF_DATE_FORMAT_UNSET /**< No Fancy Date Format, use Global */
} QofDateFormat;
#define DATE_FORMAT_FIRST QOF_DATE_FORMAT_US
diff --git a/src/libqof/qof/test/test-gnc-date.c b/src/libqof/qof/test/test-gnc-date.c
index fa3625d..6aefd3f 100644
--- a/src/libqof/qof/test/test-gnc-date.c
+++ b/src/libqof/qof/test/test-gnc-date.c
@@ -361,6 +361,7 @@ test_gnc_date_dateformat_to_string (void)
g_assert_cmpstr (gnc_date_dateformat_to_string (QOF_DATE_FORMAT_UTC), ==, "utc");
g_assert_cmpstr (gnc_date_dateformat_to_string (QOF_DATE_FORMAT_LOCALE), ==, "locale");
g_assert_cmpstr (gnc_date_dateformat_to_string (QOF_DATE_FORMAT_CUSTOM), ==, "custom");
+ g_assert_cmpstr (gnc_date_dateformat_to_string (QOF_DATE_FORMAT_UNSET), ==, "unset");
}
/* gnc_date_string_to_dateformat
@@ -387,6 +388,8 @@ test_gnc_date_string_to_dateformat (void)
g_assert_cmpint (fmt, ==, QOF_DATE_FORMAT_LOCALE);
g_assert (!gnc_date_string_to_dateformat ("custom", &fmt));
g_assert_cmpint (fmt, ==, QOF_DATE_FORMAT_CUSTOM);
+ g_assert (!gnc_date_string_to_dateformat ("unset", &fmt));
+ g_assert_cmpint (fmt, ==, QOF_DATE_FORMAT_UNSET);
fmt = 123;
g_assert (gnc_date_string_to_dateformat ("", &fmt));
g_assert_cmpint (fmt, ==, 123);
commit d56c3d3ac801251c60a8371e873d773ac3dee81a
Author: Robert Fewell <14uBobIT at gmail.com>
Date: Tue Nov 15 15:59:44 2016 +0000
Added a default currency to the currency option
This was causing an error when the dialog options was raised.
diff --git a/src/report/business-reports/taxinvoice.scm b/src/report/business-reports/taxinvoice.scm
index 982039a..16a925e 100644
--- a/src/report/business-reports/taxinvoice.scm
+++ b/src/report/business-reports/taxinvoice.scm
@@ -160,7 +160,10 @@
"a" "" (lambda () '())
#f)) ;customers-only)) ;-- see above
-(add-option (gnc:make-currency-option gnc:pagename-general optname-report-currency "b" "" ""))
+ (add-option
+ (gnc:make-currency-option
+ gnc:pagename-general optname-report-currency
+ "b" "" (gnc-default-report-currency)))
;; Elements page options
(add-option (gnc:make-simple-boolean-option elementspage optname-col-date "a" (N_ "Display the date?") #t))
commit 12562bcc0ccc5ae3f05f65fc74e14291d73ecec3
Author: Robert Fewell <14uBobIT at gmail.com>
Date: Tue Nov 15 15:24:38 2016 +0000
Add plot size option for future compatibility
This is really just a copy of the number-range-option with some tests
for the saved value being a pair which is used in later versions. If the
pair is a pixel setting, then that value will be used, otherwise the
default value is used. Should any report get saved, the saved values
will be over written in the old format.
diff --git a/src/app-utils/app-utils.scm b/src/app-utils/app-utils.scm
index 0afe7eb..0a490af 100644
--- a/src/app-utils/app-utils.scm
+++ b/src/app-utils/app-utils.scm
@@ -110,6 +110,7 @@
(export gnc:options-make-date-interval!)
(export gnc:make-number-range-option)
+(export gnc:make-number-plot-size-option)
(export gnc:make-internal-option)
(export gnc:make-query-option)
(export gnc:make-color-option)
diff --git a/src/app-utils/options.scm b/src/app-utils/options.scm
index 276174d..e9120be 100644
--- a/src/app-utils/options.scm
+++ b/src/app-utils/options.scm
@@ -1143,6 +1143,48 @@
(list lower-bound upper-bound num-decimals step-size)
#f #f #f)))
+
+;; plot size options use the option-data as a list whose
+;; elements are: (lower-bound upper-bound num-decimals step-size)
+(define (gnc:make-number-plot-size-option
+ section
+ name
+ sort-tag
+ documentation-string
+ default-value
+ lower-bound
+ upper-bound
+ num-decimals
+ step-size)
+ (let* ((value default-value)
+ (value->string (lambda () (number->string value))))
+ (gnc:make-option
+ section name sort-tag 'number-range documentation-string
+ (lambda () value)
+ (lambda (x)
+ (cond ((and (pair? x) ;; new pair value
+ (eq? 'pixels (car x)))
+ (set! value (cdr x)))
+ (else (set! value default-value)))
+
+ (if (number? x) ;; old single value
+ (set! value x)))
+ (lambda () default-value)
+ (gnc:restore-form-generator value->string)
+ (lambda (f p) (kvp-frame-set-slot-path-gslist f value p))
+ (lambda (f p)
+ (let ((v (kvp-frame-get-slot-path-gslist f p)))
+ (if (and v (number? v))
+ (set! value v))))
+ (lambda (x)
+ (cond ((not (number? x)) (list #f "number-plot-size-option: not a number"))
+ ((and (>= value lower-bound)
+ (<= value upper-bound))
+ (list #t x))
+ (else (list #f "number-plot-size-option: out of range"))))
+ (list lower-bound upper-bound num-decimals step-size)
+ #f #f #f)))
+
(define (gnc:make-internal-option
section
name
diff --git a/src/gnome-utils/dialog-options.c b/src/gnome-utils/dialog-options.c
index 3b7bab7..0233c44 100644
--- a/src/gnome-utils/dialog-options.c
+++ b/src/gnome-utils/dialog-options.c
@@ -1981,6 +1981,71 @@ gnc_option_set_ui_widget_number_range (GNCOption *option, GtkBox *page_box,
}
static GtkWidget *
+gnc_option_set_ui_widget_plot_size (GNCOption *option, GtkBox *page_box,
+ char *name, char *documentation,
+ /* Return values */
+ GtkWidget **enclosing, gboolean *packed)
+{
+ GtkWidget *value;
+ GtkWidget *label;
+ gchar *colon_name;
+ GtkAdjustment *adj;
+ gdouble lower_bound = G_MINDOUBLE;
+ gdouble upper_bound = G_MAXDOUBLE;
+ gdouble step_size = 1.0;
+ int num_decimals = 0;
+
+ colon_name = g_strconcat(name, ":", NULL);
+ label = gtk_label_new(colon_name);
+ gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5);
+ g_free(colon_name);
+
+ *enclosing = gtk_hbox_new(FALSE, 5);
+
+ gnc_option_get_range_info(option, &lower_bound, &upper_bound,
+ &num_decimals, &step_size);
+ adj = GTK_ADJUSTMENT(gtk_adjustment_new(lower_bound, lower_bound,
+ upper_bound, step_size,
+ step_size * 5.0,
+ 0));
+ value = gtk_spin_button_new(adj, step_size, num_decimals);
+ gtk_spin_button_set_numeric(GTK_SPIN_BUTTON(value), TRUE);
+
+ {
+ gdouble biggest;
+ gint num_digits;
+
+ biggest = ABS(lower_bound);
+ biggest = MAX(biggest, ABS(upper_bound));
+
+ num_digits = 0;
+ while (biggest >= 1)
+ {
+ num_digits++;
+ biggest = biggest / 10;
+ }
+
+ if (num_digits == 0)
+ num_digits = 1;
+
+ num_digits += num_decimals;
+
+ gtk_entry_set_width_chars(GTK_ENTRY(value), num_digits);
+ }
+
+ gnc_option_set_widget (option, value);
+ gnc_option_set_ui_value(option, FALSE);
+
+ g_signal_connect(G_OBJECT(value), "changed",
+ G_CALLBACK(gnc_option_changed_widget_cb), option);
+
+ gtk_box_pack_start(GTK_BOX(*enclosing), label, FALSE, FALSE, 0);
+ gtk_box_pack_start(GTK_BOX(*enclosing), value, FALSE, FALSE, 0);
+ gtk_widget_show_all(*enclosing);
+ return value;
+}
+
+static GtkWidget *
gnc_option_set_ui_widget_color (GNCOption *option, GtkBox *page_box,
char *name, char *documentation,
/* Return values */
@@ -2469,6 +2534,25 @@ gnc_option_set_ui_value_number_range (GNCOption *option, gboolean use_default,
}
static gboolean
+gnc_option_set_ui_value_plot_size (GNCOption *option, gboolean use_default,
+ GtkWidget *widget, SCM value)
+{
+ GtkSpinButton *spinner;
+ gdouble d_value;;
+
+ spinner = GTK_SPIN_BUTTON(widget);
+
+ if (scm_is_number(value))
+ {
+ d_value = scm_to_double(value);
+ gtk_spin_button_set_value(spinner, d_value);
+ return FALSE;
+ }
+ else
+ return TRUE;
+}
+
+static gboolean
gnc_option_set_ui_value_color (GNCOption *option, gboolean use_default,
GtkWidget *widget, SCM value)
{
@@ -2863,6 +2947,19 @@ gnc_option_get_ui_value_number_range (GNCOption *option, GtkWidget *widget)
}
static SCM
+gnc_option_get_ui_value_plot_size (GNCOption *option, GtkWidget *widget)
+{
+ GtkSpinButton *spinner;
+ gdouble value;
+
+ spinner = GTK_SPIN_BUTTON(widget);
+
+ value = gtk_spin_button_get_value(spinner);
+
+ return (scm_from_double (value));
+}
+
+static SCM
gnc_option_get_ui_value_color (GNCOption *option, GtkWidget *widget)
{
SCM result;
@@ -2996,6 +3093,10 @@ static void gnc_options_initialize_options (void)
gnc_option_set_ui_value_number_range, gnc_option_get_ui_value_number_range
},
{
+ "plot-size", gnc_option_set_ui_widget_plot_size,
+ gnc_option_set_ui_value_plot_size, gnc_option_get_ui_value_plot_size
+ },
+ {
"color", gnc_option_set_ui_widget_color,
gnc_option_set_ui_value_color, gnc_option_get_ui_value_color
},
diff --git a/src/report/report-system/options-utilities.scm b/src/report/report-system/options-utilities.scm
index f5e288f..c901851 100644
--- a/src/report/report-system/options-utilities.scm
+++ b/src/report/report-system/options-utilities.scm
@@ -193,7 +193,7 @@
default-width default-height)
(gnc:register-option
options
- (gnc:make-number-range-option
+ (gnc:make-number-plot-size-option
pagename name-width
(string-append sort-tag "a")
(N_ "Width of plot in pixels.") default-width
@@ -201,7 +201,7 @@
(gnc:register-option
options
- (gnc:make-number-range-option
+ (gnc:make-number-plot-size-option
pagename name-height
(string-append sort-tag "b")
(N_ "Height of plot in pixels.") default-height
commit da0b3b51313080ebf9d61f3a66f88a342788d790
Author: Robert Fewell <14uBobIT at gmail.com>
Date: Tue Nov 15 12:12:30 2016 +0000
Fix warning from glib when saving reports.
Glib complains about an already initialised pointer, there is no need
to initialise when used with gtk_tree_model_get_value.
diff --git a/src/report/report-gnome/dialog-custom-report.c b/src/report/report-gnome/dialog-custom-report.c
index b4277bc..a048a89 100644
--- a/src/report/report-gnome/dialog-custom-report.c
+++ b/src/report/report-gnome/dialog-custom-report.c
@@ -145,7 +145,6 @@ update_report_list(GtkListStore *store, CustomReportDialog *crd)
{
GValue value = { 0, };
GncGUID *row_guid;
- g_value_init ( &value, G_TYPE_POINTER);
gtk_tree_model_get_value (model, &iter, COL_NUM, &value);
row_guid = (GncGUID *) g_value_get_pointer (&value);
guid_free (row_guid);
@@ -578,7 +577,6 @@ void gnc_ui_custom_report_edit_name (GncMainWindow * window, SCM scm_guid)
{
GValue value = { 0, };
GncGUID *row_guid;
- g_value_init (&value, G_TYPE_POINTER);
gtk_tree_model_get_value (model, &iter, COL_NUM, &value);
row_guid = (GncGUID *) g_value_get_pointer (&value);
commit 74091fbcfab4e5d731bb6283c07c38ccc58326e1
Author: Robert Fewell <14uBobIT at gmail.com>
Date: Tue Nov 15 12:05:13 2016 +0000
Change report resizing when not in view
When you have reports open but they are not selected, resizing the
window does not always resize the hidden report views properly. Use
the expose call back so the reports are reloaded on expose event.
diff --git a/src/report/report-gnome/gnc-plugin-page-report.c b/src/report/report-gnome/gnc-plugin-page-report.c
index d756029..728ea2d 100644
--- a/src/report/report-gnome/gnc-plugin-page-report.c
+++ b/src/report/report-gnome/gnc-plugin-page-report.c
@@ -119,9 +119,6 @@ typedef struct GncPluginPageReportPrivate
* the window is closed. */
SCM edited_reports;
- /* This is set to mark the fact that we need to reload the html */
- gboolean need_reload;
-
/* The page is in the process of reloading the html */
gboolean reloading;
@@ -132,6 +129,9 @@ typedef struct GncPluginPageReportPrivate
// keep the view size
gint view_width, view_height;
+ // This is set to mark that we need to reload the html
+ gboolean need_reload;
+
/// the container the above HTML widget is in.
GtkContainer *container;
} GncPluginPageReportPrivate;
@@ -160,7 +160,7 @@ static int gnc_plugin_page_report_check_urltype(URLType t);
static void gnc_plugin_page_report_load_cb(GncHtml * html, URLType type,
const gchar * location, const gchar * label,
gpointer data);
-static void gnc_plugin_page_report_expose_event_cb(GtkWidget *unused, GdkEventExpose *unused1, gpointer data);
+static gboolean gnc_plugin_page_report_expose_event_cb(GtkWidget *widget, GdkEventExpose *event, gpointer user_data);
static void gnc_plugin_page_report_refresh (gpointer data);
static void gnc_plugin_page_report_set_fwd_button(GncPluginPageReport * page, int enabled);
static void gnc_plugin_page_report_set_back_button(GncPluginPageReport * page, int enabled);
@@ -333,8 +333,7 @@ gnc_plugin_page_report_view_size (GtkWidget *widget, GtkAllocation *allocation,
if ((allocation->width != priv->view_width)||(allocation->height != priv->view_height))
{
- gnc_html_reload (priv->html, FALSE); //reload by view
-
+ priv->need_reload = TRUE;
priv->view_width = allocation->width;
priv->view_height = allocation->height;
}
@@ -427,6 +426,7 @@ gnc_plugin_page_report_create_widget( GncPluginPage *page )
priv->view_width = 0; // default
priv->view_height = 0; // default
+ priv->need_reload = FALSE;
gnc_html_history_set_node_destroy_cb(gnc_html_get_history(priv->html),
gnc_plugin_page_report_history_destroy_cb,
@@ -453,8 +453,8 @@ gnc_plugin_page_report_create_widget( GncPluginPage *page )
/* load uri when view idle */
g_idle_add ((GSourceFunc)gnc_plugin_page_report_load_uri, page);
-// g_signal_connect(priv->container, "expose_event",
-// G_CALLBACK(gnc_plugin_page_report_expose_event_cb), report);
+ g_signal_connect(priv->container, "expose-event",
+ G_CALLBACK(gnc_plugin_page_report_expose_event_cb), report);
gtk_widget_show_all( GTK_WIDGET(priv->container) );
@@ -688,11 +688,6 @@ gnc_plugin_page_report_option_change_cb(gpointer data)
/* it's probably already dirty, but make sure */
scm_call_2(dirty_report, priv->cur_report, SCM_BOOL_T);
- /* Now queue the fact that we need to reload this report */
- priv->need_reload = TRUE;
- // jsled: this doesn't seem to cause any effect.
- gtk_widget_queue_draw( GTK_WIDGET(priv->container) );
- // jsled: this does.
// this sets the window for the progressbar
gnc_window_set_progressbar_window( GNC_WINDOW(page->window) );
@@ -737,27 +732,25 @@ gnc_plugin_page_report_history_destroy_cb(gnc_html_history_node * node,
}
/* We got a draw event. See if we need to reload the report */
-static void
-gnc_plugin_page_report_expose_event_cb(GtkWidget *unused, GdkEventExpose *unused1, gpointer data)
+static gboolean
+gnc_plugin_page_report_expose_event_cb(GtkWidget *widget, GdkEventExpose *event, gpointer user_data)
{
- GncPluginPageReport *page = data;
+ GncPluginPageReport *page = user_data;
GncPluginPageReportPrivate *priv;
- g_return_if_fail(GNC_IS_PLUGIN_PAGE_REPORT(page));
+ g_return_val_if_fail(GNC_IS_PLUGIN_PAGE_REPORT(page), FALSE);
priv = GNC_PLUGIN_PAGE_REPORT_GET_PRIVATE(page);
ENTER( "report_draw" );
if (!priv->need_reload)
{
LEAVE( "no reload needed" );
- return;
+ return FALSE;
}
-
priv->need_reload = FALSE;
- gnc_window_set_progressbar_window( GNC_WINDOW(GNC_PLUGIN_PAGE(page)->window) );
- gnc_html_reload (priv->html, FALSE); //reload by view
- gnc_window_set_progressbar_window( NULL );
+ gnc_html_reload(priv->html, FALSE);
LEAVE( "reload forced" );
+ return FALSE;
}
// @param data is actually GncPluginPageReportPrivate
@@ -1386,14 +1379,9 @@ gnc_plugin_page_report_reload_cb( GtkAction *action, GncPluginPageReport *report
dirty_report = scm_c_eval_string("gnc:report-set-dirty?!");
scm_call_2(dirty_report, priv->cur_report, SCM_BOOL_T);
- priv->need_reload = TRUE;
/* now queue the fact that we need to reload this report */
-
- // this doens't seem to do anything...
- gtk_widget_queue_draw( GTK_WIDGET(priv->container) );
-
- // this does...
priv->reloading = TRUE;
+
// this sets the window for the progressbar
gnc_window_set_progressbar_window( GNC_WINDOW(page->window) );
commit 372b3cc8226704ed747de693bdfde0ddc8e55a1b
Author: Robert Fewell <14uBobIT at gmail.com>
Date: Tue Nov 15 12:03:55 2016 +0000
Forgot to add the png file to previous commit
diff --git a/src/pixmaps/gnc-account-report-16.png b/src/pixmaps/gnc-account-report-16.png
new file mode 100644
index 0000000..5ef812d
Binary files /dev/null and b/src/pixmaps/gnc-account-report-16.png differ
diff --git a/src/pixmaps/gnc-account-report.png b/src/pixmaps/gnc-account-report.png
new file mode 100644
index 0000000..d4f2055
Binary files /dev/null and b/src/pixmaps/gnc-account-report.png differ
commit 371222cb6af4929a9bdcd875db13f4cfcb608a27
Author: Robert Fewell <14uBobIT at gmail.com>
Date: Tue Nov 15 11:29:37 2016 +0000
Add an image for the report tab
There was an entry in plugin-page-report about a missing image for the
report tab so have created one and added it.
diff --git a/src/gnome-utils/gnc-icons.c b/src/gnome-utils/gnc-icons.c
index a76239b..6d56719 100644
--- a/src/gnome-utils/gnc-icons.c
+++ b/src/gnome-utils/gnc-icons.c
@@ -55,6 +55,7 @@ typedef struct _item_file
static item_file item_files[] =
{
{ GNC_STOCK_ACCOUNT, "gnc-account.png", "gnc-account-16.png"},
+ { GNC_STOCK_ACCOUNT_REPORT, "gnc-account-report.png", "gnc-account-report-16.png"},
{ GNC_STOCK_DELETE_ACCOUNT, "gnc-account-delete.png", "gnc-account-delete-16.png"},
{ GNC_STOCK_EDIT_ACCOUNT, "gnc-account-edit.png", "gnc-account-edit-16.png"},
{ GNC_STOCK_NEW_ACCOUNT, "gnc-account-new.png", "gnc-account-new-16.png"},
diff --git a/src/gnome-utils/gnc-icons.h b/src/gnome-utils/gnc-icons.h
index 2015c9c..395a9dd 100644
--- a/src/gnome-utils/gnc-icons.h
+++ b/src/gnome-utils/gnc-icons.h
@@ -30,6 +30,7 @@
G_BEGIN_DECLS
#define GNC_STOCK_ACCOUNT "gnc-account"
+#define GNC_STOCK_ACCOUNT_REPORT "gnc-account-report"
#define GNC_STOCK_DELETE_ACCOUNT "gnc-delete-account"
#define GNC_STOCK_EDIT_ACCOUNT "gnc-edit-account"
#define GNC_STOCK_NEW_ACCOUNT "gnc-new-account"
diff --git a/src/pixmaps/Makefile.am b/src/pixmaps/Makefile.am
index 183ae79..eea54e7 100644
--- a/src/pixmaps/Makefile.am
+++ b/src/pixmaps/Makefile.am
@@ -11,6 +11,8 @@ gncpixmap_DATA = \
gnc-account-open-16.png \
gnc-account-open.png \
gnc-account.png \
+ gnc-account-report-16.png \
+ gnc-account-report.png \
gnc-gnome-pdf-16.png \
gnc-gnome-pdf-24.png \
gnc-invoice-16.png \
diff --git a/src/report/report-gnome/gnc-plugin-page-report.c b/src/report/report-gnome/gnc-plugin-page-report.c
index 44162b8..d756029 100644
--- a/src/report/report-gnome/gnc-plugin-page-report.c
+++ b/src/report/report-gnome/gnc-plugin-page-report.c
@@ -277,8 +277,7 @@ gnc_plugin_page_report_class_init (GncPluginPageReportClass *klass)
object_class->set_property = gnc_plugin_page_report_set_property;
object_class->get_property = gnc_plugin_page_report_get_property;
- // FIXME: stock reporting icon?
- //gnc_plugin_page_class->tab_icon = GNC_STOCK_ACCOUNT;
+ gnc_plugin_page_class->tab_icon = GNC_STOCK_ACCOUNT_REPORT;
gnc_plugin_page_class->plugin_name = GNC_PLUGIN_PAGE_REPORT_NAME;
gnc_plugin_page_class->create_widget = gnc_plugin_page_report_create_widget;
commit 49014f4714adb31d860b4ef18aab08989585cc55
Author: Robert Fewell <14uBobIT at gmail.com>
Date: Tue Nov 15 11:27:51 2016 +0000
Change the reload to include using web_view_reload
In the resize call backs, use the webkit view reload function instead of
recreating the report.
diff --git a/src/html/gnc-html-webkit.c b/src/html/gnc-html-webkit.c
index 98e80ec..af1d36b 100644
--- a/src/html/gnc-html-webkit.c
+++ b/src/html/gnc-html-webkit.c
@@ -104,7 +104,7 @@ static void impl_webkit_show_url( GncHtml* self, URLType type,
const gchar* location, const gchar* label,
gboolean new_window_hint );
static void impl_webkit_show_data( GncHtml* self, const gchar* data, int datalen );
-static void impl_webkit_reload( GncHtml* self );
+static void impl_webkit_reload( GncHtml* self, gboolean force_rebuild );
static void impl_webkit_copy_to_clipboard( GncHtml* self );
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 );
@@ -952,10 +952,12 @@ impl_webkit_show_url( GncHtml* self, URLType type,
/********************************************************************
* gnc_html_reload
* reload the current page
+ * if force_rebuild is TRUE, the report is recreated, if FALSE, report
+ * is reloaded by webkit
********************************************************************/
static void
-impl_webkit_reload( GncHtml* self )
+impl_webkit_reload( GncHtml* self, gboolean force_rebuild )
{
gnc_html_history_node * n;
GncHtmlWebkitPrivate* priv;
@@ -965,10 +967,14 @@ impl_webkit_reload( GncHtml* self )
priv = GNC_HTML_WEBKIT_GET_PRIVATE(self);
n = gnc_html_history_get_current( priv->base.history );
- if ( n != NULL )
+
+ if ( force_rebuild )
{
- gnc_html_show_url( self, n->type, n->location, n->label, 0 );
+ if ( n != NULL )
+ gnc_html_show_url( self, n->type, n->location, n->label, 0 );
}
+ else
+ webkit_web_view_reload( priv->web_view );
}
diff --git a/src/html/gnc-html.c b/src/html/gnc-html.c
index 4046d09..13a2c98 100644
--- a/src/html/gnc-html.c
+++ b/src/html/gnc-html.c
@@ -98,7 +98,7 @@ static void
gnc_html_scroll_vis_cb( GtkWidget *widget, gpointer user_data )
{
GncHtml* self = user_data;
- gnc_html_reload( self );
+ gnc_html_reload( self, FALSE ); //reload by view
}
static void
@@ -391,17 +391,19 @@ gnc_html_show_url( GncHtml* self, URLType type,
/********************************************************************
* gnc_html_reload
* reload the current page
+ * if force_rebuild is TRUE, the report is recreated, if FALSE, report
+ * is reloaded ib the view
********************************************************************/
void
-gnc_html_reload( GncHtml* self )
+gnc_html_reload( GncHtml* self, gboolean force_rebuild )
{
g_return_if_fail( self != NULL );
g_return_if_fail( GNC_IS_HTML(self) );
if ( GNC_HTML_GET_CLASS(self)->reload != NULL )
{
- GNC_HTML_GET_CLASS(self)->reload( self );
+ GNC_HTML_GET_CLASS(self)->reload( self, force_rebuild );
}
else
{
diff --git a/src/html/gnc-html.h b/src/html/gnc-html.h
index 8e77e9f..5ec7db1 100644
--- a/src/html/gnc-html.h
+++ b/src/html/gnc-html.h
@@ -132,7 +132,7 @@ struct _GncHtmlClass
const gchar* label,
gboolean new_window_hint );
void (*show_data)( GncHtml* html, const gchar* data, int datalen );
- void (*reload)( GncHtml* html );
+ void (*reload)( GncHtml* html, gboolean force_rebuild );
void (*copy_to_clipboard)( GncHtml* html );
gboolean (*export_to_file)( GncHtml* html, const gchar* file );
void (*print)( GncHtml* html, const gchar* jobname, gboolean export_pdf );
@@ -176,8 +176,9 @@ void gnc_html_show_data( GncHtml* html, const gchar* data, int datalen );
* Reloads the current GncHtml object.
*
* @param html GncHtml object
+ * @param view if TRUE, view is reloaded, if FALSE, report is recreated
*/
-void gnc_html_reload( GncHtml* html );
+void gnc_html_reload( GncHtml* html, gboolean view );
/**
* Copies the html to the clipboard
diff --git a/src/report/report-gnome/gnc-plugin-page-report.c b/src/report/report-gnome/gnc-plugin-page-report.c
index e67f13c..44162b8 100644
--- a/src/report/report-gnome/gnc-plugin-page-report.c
+++ b/src/report/report-gnome/gnc-plugin-page-report.c
@@ -334,7 +334,7 @@ gnc_plugin_page_report_view_size (GtkWidget *widget, GtkAllocation *allocation,
if ((allocation->width != priv->view_width)||(allocation->height != priv->view_height))
{
- gnc_html_reload (priv->html);
+ gnc_html_reload (priv->html, FALSE); //reload by view
priv->view_width = allocation->width;
priv->view_height = allocation->height;
@@ -700,7 +700,7 @@ gnc_plugin_page_report_option_change_cb(gpointer data)
// this sets the minimum size of the progressbar to that allocated
gnc_plugin_page_report_set_progressbar( page, TRUE );
- gnc_html_reload( priv->html );
+ gnc_html_reload( priv->html, TRUE ); //reload by rebuild
gnc_plugin_page_report_set_progressbar( page, FALSE );
@@ -756,7 +756,7 @@ gnc_plugin_page_report_expose_event_cb(GtkWidget *unused, GdkEventExpose *unused
priv->need_reload = FALSE;
gnc_window_set_progressbar_window( GNC_WINDOW(GNC_PLUGIN_PAGE(page)->window) );
- gnc_html_reload(priv->html);
+ gnc_html_reload (priv->html, FALSE); //reload by view
gnc_window_set_progressbar_window( NULL );
LEAVE( "reload forced" );
}
@@ -1401,7 +1401,7 @@ gnc_plugin_page_report_reload_cb( GtkAction *action, GncPluginPageReport *report
// this sets the minimum size of the progressbar to that allocated
gnc_plugin_page_report_set_progressbar( page, TRUE );
- gnc_html_reload( priv->html );
+ gnc_html_reload( priv->html, TRUE ); //reload by rebuild
gnc_plugin_page_report_set_progressbar( page, FALSE );
commit 891dcbc339567eb857491f4593548d72a9a265ff
Author: Robert Fewell <14uBobIT at gmail.com>
Date: Tue Nov 15 11:18:44 2016 +0000
Track visibility of the view scroll bars
When the scroll bars show they can affect the chart so force a reload
when they show.
diff --git a/src/html/gnc-html.c b/src/html/gnc-html.c
index d3fa6bd..4046d09 100644
--- a/src/html/gnc-html.c
+++ b/src/html/gnc-html.c
@@ -95,15 +95,30 @@ gnc_html_class_init( GncHtmlClass* klass )
}
static void
+gnc_html_scroll_vis_cb( GtkWidget *widget, gpointer user_data )
+{
+ GncHtml* self = user_data;
+ gnc_html_reload( self );
+}
+
+static void
gnc_html_init( GncHtml* self )
{
GncHtmlPrivate* priv;
+ GtkWidget *vscroll, *hscroll;
priv = self->priv = g_new0( GncHtmlPrivate, 1 );
priv->container = gtk_scrolled_window_new( NULL, NULL );
gtk_scrolled_window_set_policy( GTK_SCROLLED_WINDOW(priv->container),
GTK_POLICY_AUTOMATIC,
GTK_POLICY_AUTOMATIC );
+
+ vscroll = GTK_WIDGET(gtk_scrolled_window_get_vscrollbar(GTK_SCROLLED_WINDOW(priv->container)));
+ hscroll = GTK_WIDGET(gtk_scrolled_window_get_hscrollbar(GTK_SCROLLED_WINDOW(priv->container)));
+
+ g_signal_connect(GTK_WIDGET(vscroll), "show", G_CALLBACK(gnc_html_scroll_vis_cb), self);
+ g_signal_connect(GTK_WIDGET(hscroll), "show", G_CALLBACK(gnc_html_scroll_vis_cb), self);
+
priv->request_info = g_hash_table_new( g_str_hash, g_str_equal );
priv->history = gnc_html_history_new();
}
commit 51277bcd81c806a327c17265bd46c2dc7d4464e4
Author: Robert Fewell <14uBobIT at gmail.com>
Date: Tue Nov 15 11:16:36 2016 +0000
Add progress bar updates for reload / Update
Added progress bar updates for refresh/reload button press and also for
when the options change. Created a new function to set progress bar
height from previous commit to be used for above changes.
diff --git a/src/report/report-gnome/gnc-plugin-page-report.c b/src/report/report-gnome/gnc-plugin-page-report.c
index 2759475..e67f13c 100644
--- a/src/report/report-gnome/gnc-plugin-page-report.c
+++ b/src/report/report-gnome/gnc-plugin-page-report.c
@@ -341,12 +341,27 @@ gnc_plugin_page_report_view_size (GtkWidget *widget, GtkAllocation *allocation,
}
}
+static void
+gnc_plugin_page_report_set_progressbar (GncPluginPage *page, gboolean set)
+{
+ GtkWidget *progressbar;
+ GtkAllocation allocation;
+
+ progressbar = gnc_window_get_progressbar (GNC_WINDOW(page->window));
+ gtk_widget_get_allocation (GTK_WIDGET(progressbar), &allocation);
+
+ // this sets the minimum size of the progressbar to that allocated
+ if (set)
+ gtk_widget_set_size_request (GTK_WIDGET(progressbar), -1, allocation.height);
+ else
+ gtk_widget_set_size_request (GTK_WIDGET(progressbar), -1, -1); //reset
+}
+
static gboolean
gnc_plugin_page_report_load_uri (GncPluginPage *page)
{
GncPluginPageReport *report;
GncPluginPageReportPrivate *priv;
- GtkWidget *progressbar;
GtkAllocation allocation;
URLType type;
char * id_name;
@@ -379,14 +394,14 @@ gnc_plugin_page_report_load_uri (GncPluginPage *page)
// this sets the window for the progressbar
gnc_window_set_progressbar_window( GNC_WINDOW(page->window) );
- progressbar = gnc_window_get_progressbar (GNC_WINDOW(page->window));
- gtk_widget_get_allocation (GTK_WIDGET(progressbar), &allocation);
-
// this sets the minimum size of the progressbar to that allocated
- gtk_widget_set_size_request (GTK_WIDGET(progressbar), -1, allocation.height);
+ gnc_plugin_page_report_set_progressbar( page, TRUE );
gnc_html_show_url(priv->html, type, url_location, url_label, 0);
g_free(url_location);
+
+ gnc_plugin_page_report_set_progressbar( page, FALSE );
+
// this resets the window for the progressbar to NULL
gnc_window_set_progressbar_window( NULL );
@@ -639,6 +654,7 @@ gnc_plugin_page_report_load_cb(GncHtml * html, URLType type,
static void
gnc_plugin_page_report_option_change_cb(gpointer data)
{
+ GncPluginPage *page;
GncPluginPageReport *report;
GncPluginPageReportPrivate *priv;
SCM dirty_report = scm_c_eval_string("gnc:report-set-dirty?!");
@@ -649,6 +665,7 @@ gnc_plugin_page_report_option_change_cb(gpointer data)
g_return_if_fail(GNC_IS_PLUGIN_PAGE_REPORT(data));
report = GNC_PLUGIN_PAGE_REPORT(data);
priv = GNC_PLUGIN_PAGE_REPORT_GET_PRIVATE(report);
+ page = GNC_PLUGIN_PAGE(report);
DEBUG( "option_change" );
if (priv->cur_report == SCM_BOOL_F)
@@ -677,7 +694,18 @@ gnc_plugin_page_report_option_change_cb(gpointer data)
// jsled: this doesn't seem to cause any effect.
gtk_widget_queue_draw( GTK_WIDGET(priv->container) );
// jsled: this does.
+ // this sets the window for the progressbar
+ gnc_window_set_progressbar_window( GNC_WINDOW(page->window) );
+
+ // this sets the minimum size of the progressbar to that allocated
+ gnc_plugin_page_report_set_progressbar( page, TRUE );
+
gnc_html_reload( priv->html );
+
+ gnc_plugin_page_report_set_progressbar( page, FALSE );
+
+ // this resets the window for the progressbar to NULL
+ gnc_window_set_progressbar_window( NULL );
}
/* FIXME: This function does... nothing. */
@@ -1345,10 +1373,12 @@ gnc_plugin_page_report_back_cb( GtkAction *action, GncPluginPageReport *report )
static void
gnc_plugin_page_report_reload_cb( GtkAction *action, GncPluginPageReport *report )
{
+ GncPluginPage *page;
GncPluginPageReportPrivate *priv;
SCM dirty_report;
DEBUG( "reload" );
+ page = GNC_PLUGIN_PAGE(report);
priv = GNC_PLUGIN_PAGE_REPORT_GET_PRIVATE(report);
if (priv->cur_report == SCM_BOOL_F)
return;
@@ -1365,7 +1395,18 @@ gnc_plugin_page_report_reload_cb( GtkAction *action, GncPluginPageReport *report
// this does...
priv->reloading = TRUE;
+ // this sets the window for the progressbar
+ gnc_window_set_progressbar_window( GNC_WINDOW(page->window) );
+
+ // this sets the minimum size of the progressbar to that allocated
+ gnc_plugin_page_report_set_progressbar( page, TRUE );
+
gnc_html_reload( priv->html );
+
+ gnc_plugin_page_report_set_progressbar( page, FALSE );
+
+ // this resets the window for the progressbar to NULL
+ gnc_window_set_progressbar_window( NULL );
priv->reloading = FALSE;
}
commit 12994ca6e77cba58cf9de5a2f6b2b3f4323e77b3
Author: Robert Fewell <14uBobIT at gmail.com>
Date: Tue Nov 15 11:15:23 2016 +0000
Add call back to track page size changes
Add call back to track size-allocate events for the webkit view. Also
commented out expose event as that may not be required.
diff --git a/src/report/report-gnome/gnc-plugin-page-report.c b/src/report/report-gnome/gnc-plugin-page-report.c
index f99c596..2759475 100644
--- a/src/report/report-gnome/gnc-plugin-page-report.c
+++ b/src/report/report-gnome/gnc-plugin-page-report.c
@@ -129,6 +129,9 @@ typedef struct GncPluginPageReportPrivate
// gnc_html *html;
GncHtml *html;
+ // keep the view size
+ gint view_width, view_height;
+
/// the container the above HTML widget is in.
GtkContainer *container;
} GncPluginPageReportPrivate;
@@ -324,6 +327,20 @@ gnc_plugin_page_report_finalize (GObject *object)
LEAVE(" ");
}
+static void
+gnc_plugin_page_report_view_size (GtkWidget *widget, GtkAllocation *allocation, gpointer user_data)
+{
+ GncPluginPageReportPrivate *priv = user_data;
+
+ if ((allocation->width != priv->view_width)||(allocation->height != priv->view_height))
+ {
+ gnc_html_reload (priv->html);
+
+ priv->view_width = allocation->width;
+ priv->view_height = allocation->height;
+ }
+}
+
static gboolean
gnc_plugin_page_report_load_uri (GncPluginPage *page)
{
@@ -340,6 +357,14 @@ gnc_plugin_page_report_load_uri (GncPluginPage *page)
report = GNC_PLUGIN_PAGE_REPORT(page);
priv = GNC_PLUGIN_PAGE_REPORT_GET_PRIVATE(report);
+ gtk_widget_get_allocation (GTK_WIDGET(gnc_html_get_widget(priv->html)), &allocation);
+
+ priv->view_width = allocation.width;
+ priv->view_height = allocation.height;
+
+ g_signal_connect(GTK_WIDGET(gnc_html_get_widget(priv->html)), "size-allocate",
+ G_CALLBACK(gnc_plugin_page_report_view_size), priv);
+
id_name = g_strdup_printf("id=%d", priv->reportId );
child_name = gnc_build_url( URL_TYPE_REPORT, id_name, NULL );
type = gnc_html_parse_url( priv->html, child_name, &url_location, &url_label);
@@ -386,6 +411,9 @@ gnc_plugin_page_report_create_widget( GncPluginPage *page )
priv->html = gnc_html_factory_create_html();
gnc_html_set_parent( priv->html, topLvl );
+ priv->view_width = 0; // default
+ priv->view_height = 0; // default
+
gnc_html_history_set_node_destroy_cb(gnc_html_get_history(priv->html),
gnc_plugin_page_report_history_destroy_cb,
(gpointer)priv);
@@ -411,8 +439,8 @@ gnc_plugin_page_report_create_widget( GncPluginPage *page )
/* load uri when view idle */
g_idle_add ((GSourceFunc)gnc_plugin_page_report_load_uri, page);
- g_signal_connect(priv->container, "expose_event",
- G_CALLBACK(gnc_plugin_page_report_expose_event_cb), report);
+// g_signal_connect(priv->container, "expose_event",
+// G_CALLBACK(gnc_plugin_page_report_expose_event_cb), report);
gtk_widget_show_all( GTK_WIDGET(priv->container) );
commit 62e449f37b227ca0c954f39249c5d22cbc2a42d4
Author: Robert Fewell <14uBobIT at gmail.com>
Date: Tue Nov 15 11:09:43 2016 +0000
Stop the progress bar changing height
When the report is run and the progress bar is updated, the height
changes and then changes back forcing the webkit view to change height
and ultimately use the wrong value.
diff --git a/src/gnome-utils/gnc-window.c b/src/gnome-utils/gnc-window.c
index 0d9dceb..c6549a0 100644
--- a/src/gnome-utils/gnc-window.c
+++ b/src/gnome-utils/gnc-window.c
@@ -88,7 +88,7 @@ gnc_window_get_statusbar (GncWindow *window)
return GNC_WINDOW_GET_IFACE (window)->get_statusbar (window);
}
-static GtkWidget *
+GtkWidget *
gnc_window_get_progressbar (GncWindow *window)
{
g_return_val_if_fail(GNC_WINDOW (window), NULL);
diff --git a/src/gnome-utils/gnc-window.h b/src/gnome-utils/gnc-window.h
index 3e5f42d..3173142 100644
--- a/src/gnome-utils/gnc-window.h
+++ b/src/gnome-utils/gnc-window.h
@@ -76,6 +76,7 @@ void gnc_window_set_status (GncWindow *window, GncPluginPage *page, co
void gnc_window_set_progressbar_window (GncWindow *window);
GncWindow *gnc_window_get_progressbar_window (void);
+GtkWidget *gnc_window_get_progressbar (GncWindow *window);
void gnc_window_show_progress (const char *message, double percentage);
G_END_DECLS
diff --git a/src/report/report-gnome/gnc-plugin-page-report.c b/src/report/report-gnome/gnc-plugin-page-report.c
index 253a5b2..f99c596 100644
--- a/src/report/report-gnome/gnc-plugin-page-report.c
+++ b/src/report/report-gnome/gnc-plugin-page-report.c
@@ -329,6 +329,8 @@ gnc_plugin_page_report_load_uri (GncPluginPage *page)
{
GncPluginPageReport *report;
GncPluginPageReportPrivate *priv;
+ GtkWidget *progressbar;
+ GtkAllocation allocation;
URLType type;
char * id_name;
char * child_name;
@@ -348,9 +350,19 @@ gnc_plugin_page_report_load_uri (GncPluginPage *page)
g_free(id_name);
g_free(child_name);
+
+ // this sets the window for the progressbar
gnc_window_set_progressbar_window( GNC_WINDOW(page->window) );
+
+ progressbar = gnc_window_get_progressbar (GNC_WINDOW(page->window));
+ gtk_widget_get_allocation (GTK_WIDGET(progressbar), &allocation);
+
+ // this sets the minimum size of the progressbar to that allocated
+ gtk_widget_set_size_request (GTK_WIDGET(progressbar), -1, allocation.height);
+
gnc_html_show_url(priv->html, type, url_location, url_label, 0);
g_free(url_location);
+ // this resets the window for the progressbar to NULL
gnc_window_set_progressbar_window( NULL );
return FALSE;
commit 1b2f89e1948b9bff9406da45b639a2ecaa14647e
Author: Robert Fewell <14uBobIT at gmail.com>
Date: Tue Nov 15 11:07:42 2016 +0000
Add idle function to load report
The reason for webkit not using the full report area is that this area
has not been realized when the report is created and so webkit does not
know the correct size. By using the idle function, the page is created
and realized before loading the report with the added advantage the
progress bar updates on the blank report page.
diff --git a/src/report/report-gnome/gnc-plugin-page-report.c b/src/report/report-gnome/gnc-plugin-page-report.c
index 4dc1a90..253a5b2 100644
--- a/src/report/report-gnome/gnc-plugin-page-report.c
+++ b/src/report/report-gnome/gnc-plugin-page-report.c
@@ -324,19 +324,46 @@ gnc_plugin_page_report_finalize (GObject *object)
LEAVE(" ");
}
-static
-GtkWidget*
-gnc_plugin_page_report_create_widget( GncPluginPage *page )
+static gboolean
+gnc_plugin_page_report_load_uri (GncPluginPage *page)
{
GncPluginPageReport *report;
GncPluginPageReportPrivate *priv;
- GtkWindow *topLvl;
URLType type;
char * id_name;
char * child_name;
char * url_location = NULL;
char * url_label = NULL;
+ report = GNC_PLUGIN_PAGE_REPORT(page);
+ priv = GNC_PLUGIN_PAGE_REPORT_GET_PRIVATE(report);
+
+ id_name = g_strdup_printf("id=%d", priv->reportId );
+ child_name = gnc_build_url( URL_TYPE_REPORT, id_name, NULL );
+ type = gnc_html_parse_url( priv->html, child_name, &url_location, &url_label);
+ DEBUG( "passing id_name=[%s] child_name=[%s] type=[%s], location=[%s], label=[%s]",
+ id_name, child_name ? child_name : "(null)",
+ type ? type : "(null)", url_location ? url_location : "(null)",
+ url_label ? url_label : "(null)" );
+
+ g_free(id_name);
+ g_free(child_name);
+ gnc_window_set_progressbar_window( GNC_WINDOW(page->window) );
+ gnc_html_show_url(priv->html, type, url_location, url_label, 0);
+ g_free(url_location);
+ gnc_window_set_progressbar_window( NULL );
+
+ return FALSE;
+}
+
+static
+GtkWidget*
+gnc_plugin_page_report_create_widget( GncPluginPage *page )
+{
+ GncPluginPageReport *report;
+ GncPluginPageReportPrivate *priv;
+ GtkWindow *topLvl;
+
ENTER("page %p", page);
report = GNC_PLUGIN_PAGE_REPORT(page);
@@ -368,20 +395,9 @@ gnc_plugin_page_report_create_widget( GncPluginPage *page )
// FIXME. This is f^-1(f(x)), isn't it?
DEBUG( "id=%d", priv->reportId );
- id_name = g_strdup_printf("id=%d", priv->reportId );
- child_name = gnc_build_url( URL_TYPE_REPORT, id_name, NULL );
- type = gnc_html_parse_url( priv->html, child_name, &url_location, &url_label);
- DEBUG( "passing id_name=[%s] child_name=[%s] type=[%s], location=[%s], label=[%s]",
- id_name, child_name ? child_name : "(null)",
- type ? type : "(null)", url_location ? url_location : "(null)",
- url_label ? url_label : "(null)" );
- g_free(id_name);
- g_free(child_name);
- gnc_window_set_progressbar_window( GNC_WINDOW(page->window) );
- gnc_html_show_url(priv->html, type, url_location, url_label, 0);
- g_free(url_location);
- gnc_window_set_progressbar_window( NULL );
+ /* load uri when view idle */
+ g_idle_add ((GSourceFunc)gnc_plugin_page_report_load_uri, page);
g_signal_connect(priv->container, "expose_event",
G_CALLBACK(gnc_plugin_page_report_expose_event_cb), report);
commit d7648a2ba72354348b03a3bc6dfcc97fa1fdec52
Author: Robert Fewell <14uBobIT at gmail.com>
Date: Tue Nov 15 10:44:14 2016 +0000
Remove macros/as-scrub-include.m4 from makefile
This has already been removed in previous commit.
diff --git a/Makefile.am b/Makefile.am
index 00baca8..0e507e7 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -54,7 +54,6 @@ dist_doc_DATA = \
EXTRA_DIST = \
$(SWIG_DIST_FAIL) \
make-gnucash-potfiles.in \
- macros/as-scrub-include.m4 \
macros/binreloc.m4 \
macros/compiler-flags.m4 \
macros/ax_pkg_swig.m4 \
Summary of changes:
Makefile.am | 1 -
src/app-utils/app-utils.scm | 1 +
src/app-utils/options.scm | 44 +++++-
src/gnome-utils/dialog-options.c | 101 ++++++++++++
src/gnome-utils/gnc-date-format.c | 2 +-
src/gnome-utils/gnc-icons.c | 1 +
src/gnome-utils/gnc-icons.h | 1 +
src/gnome-utils/gnc-window.c | 2 +-
src/gnome-utils/gnc-window.h | 1 +
src/gnome-utils/gtkbuilder/gnc-date-format.glade | 7 +-
src/gnome/dialog-print-check.c | 2 +-
...gnucash.dialogs.checkprinting.gschema.xml.in.in | 2 +-
src/html/gnc-html-webkit.c | 14 +-
src/html/gnc-html.c | 21 ++-
src/html/gnc-html.h | 5 +-
src/libqof/qof/gnc-date.c | 8 +
src/libqof/qof/gnc-date.h | 3 +-
src/libqof/qof/test/test-gnc-date.c | 3 +
src/pixmaps/Makefile.am | 2 +
src/pixmaps/gnc-account-report-16.png | Bin 0 -> 417 bytes
src/pixmaps/gnc-account-report.png | Bin 0 -> 359 bytes
src/report/business-reports/taxinvoice.scm | 5 +-
src/report/report-gnome/dialog-custom-report.c | 2 -
src/report/report-gnome/gnc-plugin-page-report.c | 174 +++++++++++++++------
src/report/report-system/options-utilities.scm | 4 +-
25 files changed, 339 insertions(+), 67 deletions(-)
create mode 100644 src/pixmaps/gnc-account-report-16.png
create mode 100644 src/pixmaps/gnc-account-report.png
More information about the gnucash-changes
mailing list