gnucash master: Multiple changes pushed
John Ralls
jralls at code.gnucash.org
Sat Apr 25 18:53:56 EDT 2020
Updated via https://github.com/Gnucash/gnucash/commit/de9ee8de (commit)
via https://github.com/Gnucash/gnucash/commit/18a4824b (commit)
via https://github.com/Gnucash/gnucash/commit/8024f44b (commit)
via https://github.com/Gnucash/gnucash/commit/63232f38 (commit)
via https://github.com/Gnucash/gnucash/commit/e0e7cf7d (commit)
via https://github.com/Gnucash/gnucash/commit/31daba15 (commit)
via https://github.com/Gnucash/gnucash/commit/fee8bb3b (commit)
via https://github.com/Gnucash/gnucash/commit/d7a2fa72 (commit)
via https://github.com/Gnucash/gnucash/commit/62f157d2 (commit)
via https://github.com/Gnucash/gnucash/commit/4cca84bb (commit)
via https://github.com/Gnucash/gnucash/commit/087b3859 (commit)
via https://github.com/Gnucash/gnucash/commit/00cc5785 (commit)
via https://github.com/Gnucash/gnucash/commit/0553576c (commit)
via https://github.com/Gnucash/gnucash/commit/4140569a (commit)
via https://github.com/Gnucash/gnucash/commit/f6cb8031 (commit)
from https://github.com/Gnucash/gnucash/commit/a5553c93 (commit)
commit de9ee8dede1c05954b387fa40c9aff1e66b4365c
Merge: 8024f44bc 18a4824bb
Author: John Ralls <jralls at ceridwen.us>
Date: Sat Apr 25 15:45:59 2020 -0700
Merge branch 'maint'
diff --cc gnucash/register/ledger-core/split-register.c
index 257268438,ef54f42a3..03adb2a1e
--- a/gnucash/register/ledger-core/split-register.c
+++ b/gnucash/register/ledger-core/split-register.c
@@@ -1253,7 -1222,8 +1253,8 @@@ gnc_split_register_delete_current_tran
DEBUG ("committing");
xaccTransCommitEdit (trans);
}
- gnc_resume_gui_refresh();
+ gnc_resume_gui_refresh ();
+ gnc_split_register_redraw (reg);
LEAVE (" ");
}
commit 18a4824bb4af9c0e802770e85e3b05e38c3f2db6
Merge: 63232f388 087b38591
Author: John Ralls <jralls at ceridwen.us>
Date: Sat Apr 25 15:42:26 2020 -0700
Merge Jean Laroche's '797351_zombie_transaction' into maint.
https://github.com/Gnucash/gnucash/pull/705
commit 8024f44bc0c04252e08afb100a40dbab80479086
Author: John Ralls <jralls at ceridwen.us>
Date: Sat Apr 25 15:39:10 2020 -0700
Remove leftover webkit2 conditional.
diff --git a/gnucash/html/gnc-html-webkit2.c b/gnucash/html/gnc-html-webkit2.c
index 7f211e32f..8dfb6d441 100644
--- a/gnucash/html/gnc-html-webkit2.c
+++ b/gnucash/html/gnc-html-webkit2.c
@@ -596,7 +596,6 @@ perform_navigation_policy (WebKitWebView *web_view,
const gchar* uri; // Can't init it here.
gchar *scheme = NULL, *location = NULL, *label = NULL;
gboolean ignore = FALSE;
-#if WEBKIT2_4
WebKitNavigationAction *action =
webkit_navigation_policy_decision_get_navigation_action (decision);
if (webkit_navigation_action_get_navigation_type (action) !=
@@ -606,9 +605,6 @@ perform_navigation_policy (WebKitWebView *web_view,
return TRUE;
}
req = webkit_navigation_action_get_request (action);
-#else
- req = webkit_navigation_policy_decision_get_request (decision);
-#endif
uri = webkit_uri_request_get_uri (req);
scheme = gnc_html_parse_url (self, uri, &location, &label);
if (strcmp (scheme, URL_TYPE_FILE) != 0)
commit 63232f388f15e4a895bfa75e71c781e4cb96b696
Merge: 31daba151 e0e7cf7df
Author: John Ralls <jralls at ceridwen.us>
Date: Sat Apr 25 14:40:57 2020 -0700
Merge Jean Laroche's 'Fix-3-SX-Problems' into maint
https://github.com/Gnucash/gnucash/pull/690
commit e0e7cf7dfb0d34ca8cbbb891474b614bca2fe081
Author: jean <you at example.com>
Date: Mon Apr 13 14:02:03 2020 -0700
Fix 3 problems with the scheduled transactions calculations
This fixes 3 bugs:
- Set a monthly recurrence on the 10th with a start date on the 20th of this month.
The editor correctly shows the next occurrence to be on the 10th of the following month.
The schedule transaction summary dialog incorrectly shows the next occurrence to be on the 10th of this month
(before the start date!)
- Set a monthly recurrence on the 19th, with a start date on the 20th of this month. The editor's
calendar marks incorrectly show the next occurrence to be on the 19th of this month (before the start date).
- Set a monthly recurrence on the 18th, with a start date on the 20th and an end date on the 17 of the following
month. The calendar should show no mark, but fails to erase the marks that were present.
diff --git a/gnucash/gnome-utils/gnc-dense-cal.c b/gnucash/gnome-utils/gnc-dense-cal.c
index 9bd6a872d..ebef9f24d 100644
--- a/gnucash/gnome-utils/gnc-dense-cal.c
+++ b/gnucash/gnome-utils/gnc-dense-cal.c
@@ -1939,10 +1939,13 @@ gdc_model_added_cb(GncDenseCalModel *model, guint added_tag, gpointer user_data)
static void
gdc_model_update_cb(GncDenseCalModel *model, guint update_tag, gpointer user_data)
{
- GncDenseCal *cal = GNC_DENSE_CAL(user_data);
- g_debug("gdc_model_update_cb update for tag [%d]\n", update_tag);
- gdc_mark_remove(cal, update_tag, FALSE);
- gdc_add_tag_markings(cal, update_tag);
+ GncDenseCal *cal = GNC_DENSE_CAL (user_data);
+ gint num_marks = 0;
+ g_debug ("gdc_model_update_cb update for tag [%d]\n", update_tag);
+ num_marks = gnc_dense_cal_model_get_instance_count (cal->model, update_tag);
+ // We need to redraw if there are no mark, to ensure they're all erased.
+ gdc_mark_remove (cal, update_tag, num_marks==0);
+ gdc_add_tag_markings (cal, update_tag);
}
diff --git a/gnucash/gnome/dialog-sx-editor.c b/gnucash/gnome/dialog-sx-editor.c
index ff6704cae..acfca97d0 100644
--- a/gnucash/gnome/dialog-sx-editor.c
+++ b/gnucash/gnome/dialog-sx-editor.c
@@ -1598,7 +1598,6 @@ gnc_sxed_update_cal(GncSxEditorDialog *sxed)
g_date_clear(&start_date, 1);
gnc_frequency_save_to_recurrence(sxed->gncfreq, &recurrences, &start_date);
- g_date_subtract_days(&start_date, 1);
recurrenceListNextInstance(recurrences, &start_date, &first_date);
/* Deal with the fact that this SX may have been run before [the
@@ -1609,10 +1608,10 @@ gnc_sxed_update_cal(GncSxEditorDialog *sxed)
last_sx_inst = xaccSchedXactionGetLastOccurDate(sxed->sx);
if (g_date_valid(last_sx_inst)
&& g_date_valid(&first_date)
- && g_date_compare(last_sx_inst, &first_date) != 0)
+ && g_date_compare(last_sx_inst, &first_date) > 0)
{
/* last occurrence will be passed as initial date to update store
- * later on as well */
+ * later on as well, but only if it's past first_date */
start_date = *last_sx_inst;
recurrenceListNextInstance(recurrences, &start_date, &first_date);
}
diff --git a/gnucash/register/ledger-core/gnc-ledger-display2.c b/gnucash/register/ledger-core/gnc-ledger-display2.c
index 6df238c9b..cfedaec60 100644
--- a/gnucash/register/ledger-core/gnc-ledger-display2.c
+++ b/gnucash/register/ledger-core/gnc-ledger-display2.c
@@ -809,7 +809,6 @@ gnc_ledger_display2_internal (Account *lead_account, Query *q,
ld->use_double_line_default = use_double_line;
- // JEAN: add mismatched_commodities
ld->model = gnc_tree_model_split_reg_new (reg_type, style, use_double_line, is_template, mismatched_commodities);
gnc_tree_model_split_reg_set_data (ld->model, ld, gnc_ledger_display2_parent);
diff --git a/libgnucash/engine/SchedXaction.c b/libgnucash/engine/SchedXaction.c
index fc4ae0e9b..fac52bc9e 100644
--- a/libgnucash/engine/SchedXaction.c
+++ b/libgnucash/engine/SchedXaction.c
@@ -931,13 +931,13 @@ xaccSchedXactionGetNextInstance (const SchedXaction *sx, SXTmpStateData *tsd)
* we're at the beginning. We want to pretend prev_occur is the day before
* the start_date in case the start_date is today so that the SX will fire
* today. If start_date isn't valid either then the SX will fire anyway, no
- * harm done.
+ * harm done. prev_occur cannot be before start_date either.
*/
- if (! g_date_valid( &prev_occur ) && g_date_valid(&sx->start_date))
+ if (g_date_valid (&sx->start_date) && (!g_date_valid ( &prev_occur ) || g_date_compare (&prev_occur, &sx->start_date)<0))
{
/* We must be at the beginning. */
prev_occur = sx->start_date;
- g_date_subtract_days( &prev_occur, 1 );
+ g_date_subtract_days (&prev_occur, 1 );
}
recurrenceListNextInstance(sx->schedule, &prev_occur, &next_occur);
commit 31daba151c59c7d9aa1b9edbd3c31573fcc46120
Merge: fee8bb3b2 62f157d23
Author: John Ralls <jralls at ceridwen.us>
Date: Sat Apr 25 14:17:28 2020 -0700
Merge Jean Laroche's '797670_Xtran_editor_crash' into maint.
https://github.com/Gnucash/gnucash/pull/686
commit fee8bb3b2d535e84e6fe2673470428bb5b9fddc6
Merge: d7a2fa72e 00cc57851
Author: John Ralls <jralls at ceridwen.us>
Date: Sat Apr 25 14:13:52 2020 -0700
Merge Christoph Holtermann's 'python-shell-output-improved' into maint.
https://github.com/Gnucash/gnucash/pull/702
diff --cc gnucash/python/init.py
index 6dabdc6ce,db252b934..bfc319ad5
--- a/gnucash/python/init.py
+++ b/gnucash/python/init.py
@@@ -19,15 -24,17 +23,18 @@@ import pycons.console as con
# Restore the SIGTTOU handler
signal.signal(signal.SIGTTOU, old_sigttou)
+ # output debug information if gnucash has been started with
+ # gnucash --debug --extra
if gnc_prefs_is_extra_enabled() and gnc_prefs_is_debugging_enabled():
- print("Hello from python!")
- print("test", sys.modules.keys())
+ print("Hello from python!\n")
+ print("sys.modules.keys(): ", sys.modules.keys(), "\n")
+ print("dir(_sw_app_utils): ", dir(_sw_app_utils), "\n")
- #root = _sw_app_utils.gnc_get_current_root_account()
+ #session = app_utils.gnc_get_current_session()
+ #root account can later on be accessed by session.get_book().get_root_account()
#print("test", dir(root), root.__class__)
- print("test3", dir(gnucash_core_c))
+ print("dir(gnucash_core_c): ", dir(gnucash_core_c))
#acct = Account(instance = root)
commit d7a2fa72e7c5c90ad0f583a9df8124bbae5fa803
Merge: 8f5094f99 0553576c8
Author: John Ralls <jralls at ceridwen.us>
Date: Sat Apr 25 13:43:54 2020 -0700
Merge Christoph Holtermann's 'python-app-utils-2' into maint.
https://github.com/Gnucash/gnucash/pull/701
commit 62f157d2385314798f544396d4beabb263131245
Author: jean <you at example.com>
Date: Sat Apr 18 10:28:34 2020 -0700
Added same code to transaction matcher
diff --git a/gnucash/gnome/dialog-sx-editor.c b/gnucash/gnome/dialog-sx-editor.c
index eb559ab1e..ff6704cae 100644
--- a/gnucash/gnome/dialog-sx-editor.c
+++ b/gnucash/gnome/dialog-sx-editor.c
@@ -1124,7 +1124,7 @@ gnc_ui_scheduled_xaction_editor_dialog_create (GtkWindow *parent,
GtkBuilder *builder;
GtkWidget *button;
int i;
- gint id;
+ int id;
GList *dlgExists = NULL;
static struct widgetSignalCallback
@@ -1211,11 +1211,11 @@ gnc_ui_scheduled_xaction_editor_dialog_create (GtkWindow *parent,
}
id = gnc_register_gui_component( DIALOG_SCHEDXACTION_EDITOR_CM_CLASS,
- NULL, /* no refresh handler */
- sxed_close_handler,
- sxed );
+ NULL, /* no refresh handler */
+ sxed_close_handler,
+ sxed );
// This ensure this dialog is closed when the session is closed.
- gnc_gui_component_set_session (id,gnc_get_current_session());
+ gnc_gui_component_set_session (id, gnc_get_current_session());
g_signal_connect( sxed->dialog, "delete_event",
G_CALLBACK(sxed_delete_event), sxed );
diff --git a/gnucash/import-export/import-main-matcher.c b/gnucash/import-export/import-main-matcher.c
index 16aca2779..8851da8b2 100644
--- a/gnucash/import-export/import-main-matcher.c
+++ b/gnucash/import-export/import-main-matcher.c
@@ -51,9 +51,10 @@
#include "import-pending-matches.h"
#include "gnc-component-manager.h"
#include "guid.h"
+#include "gnc-session.h"
#define GNC_PREFS_GROUP "dialogs.import.generic.transaction-list"
-
+#define IMPORT_MAIN_MATCHER_CM_CLASS "transaction-matcher-dialog"
struct _main_matcher_info
{
@@ -923,6 +924,7 @@ GNCImportMainMatcher *gnc_gen_trans_list_new (GtkWidget *parent,
GtkStyleContext *stylectxt;
GdkRGBA color;
GtkWidget *button;
+ gint id;
info = g_new0 (GNCImportMainMatcher, 1);
info->pending_matches = gnc_import_PendingMatches_new();
@@ -977,7 +979,14 @@ GNCImportMainMatcher *gnc_gen_trans_list_new (GtkWidget *parent,
gtk_builder_connect_signals_full (builder, gnc_builder_connect_full_func, info);
g_object_unref (G_OBJECT(builder));
-
+
+ // Register this UI, it needs to be closed when the session is closed.
+ id = gnc_register_gui_component (IMPORT_MAIN_MATCHER_CM_CLASS,
+ NULL, /* no refresh handler */
+ (GNCComponentCloseHandler)gnc_gen_trans_list_delete,
+ info);
+ // This ensure this dialog is closed when the session is closed.
+ gnc_gui_component_set_session (id, gnc_get_current_session());
return info;
}
commit 4cca84bb32839a0a02dbdcbfeaba5a9221ebccf0
Author: jean <you at example.com>
Date: Sat Apr 18 10:28:07 2020 -0700
Bug 797670 - scheduled transaction editor can remain open when switching file, which causes seg fault when later closed
diff --git a/gnucash/gnome/dialog-sx-editor.c b/gnucash/gnome/dialog-sx-editor.c
index 2f2c7c439..eb559ab1e 100644
--- a/gnucash/gnome/dialog-sx-editor.c
+++ b/gnucash/gnome/dialog-sx-editor.c
@@ -62,6 +62,7 @@
#include "gnc-ui.h"
#include "gnc-ui-util.h"
#include "gnucash-sheet.h"
+#include "gnc-session.h"
#include "gnc-split-reg.h"
@@ -1123,6 +1124,7 @@ gnc_ui_scheduled_xaction_editor_dialog_create (GtkWindow *parent,
GtkBuilder *builder;
GtkWidget *button;
int i;
+ gint id;
GList *dlgExists = NULL;
static struct widgetSignalCallback
@@ -1208,10 +1210,12 @@ gnc_ui_scheduled_xaction_editor_dialog_create (GtkWindow *parent,
TRUE, TRUE, 0 );
}
- gnc_register_gui_component( DIALOG_SCHEDXACTION_EDITOR_CM_CLASS,
+ id = gnc_register_gui_component( DIALOG_SCHEDXACTION_EDITOR_CM_CLASS,
NULL, /* no refresh handler */
sxed_close_handler,
sxed );
+ // This ensure this dialog is closed when the session is closed.
+ gnc_gui_component_set_session (id,gnc_get_current_session());
g_signal_connect( sxed->dialog, "delete_event",
G_CALLBACK(sxed_delete_event), sxed );
commit 087b38591e08df62208ec8e099f058b0c3b250b1
Author: jean <you at example.com>
Date: Fri Apr 24 22:03:39 2020 -0700
Bug 797351 - General ledger register transaction becomes "zombie" after deletion
This issue arises every time a pending transaction is deleted (it does not arise if blank splits are deleted)
This PR fixes the issue by calling gnc_split_register_redraw once the pending transaction has be deleted.
diff --git a/gnucash/register/ledger-core/gnc-ledger-display2.c b/gnucash/register/ledger-core/gnc-ledger-display2.c
index 6df238c9b..cfedaec60 100644
--- a/gnucash/register/ledger-core/gnc-ledger-display2.c
+++ b/gnucash/register/ledger-core/gnc-ledger-display2.c
@@ -809,7 +809,6 @@ gnc_ledger_display2_internal (Account *lead_account, Query *q,
ld->use_double_line_default = use_double_line;
- // JEAN: add mismatched_commodities
ld->model = gnc_tree_model_split_reg_new (reg_type, style, use_double_line, is_template, mismatched_commodities);
gnc_tree_model_split_reg_set_data (ld->model, ld, gnc_ledger_display2_parent);
diff --git a/gnucash/register/ledger-core/split-register.c b/gnucash/register/ledger-core/split-register.c
index f7b919bcf..ef54f42a3 100644
--- a/gnucash/register/ledger-core/split-register.c
+++ b/gnucash/register/ledger-core/split-register.c
@@ -1223,6 +1223,7 @@ gnc_split_register_delete_current_trans (SplitRegister* reg)
xaccTransCommitEdit (trans);
}
gnc_resume_gui_refresh();
+ gnc_split_register_redraw (reg);
LEAVE (" ");
}
commit 00cc578511166aba64d54fc7964c59bb52bf3429
Author: c-holtermann <mail at c-holtermann.net>
Date: Mon Apr 20 20:31:59 2020 +0200
improve output and explain code for python shell
diff --git a/gnucash/python/init.py b/gnucash/python/init.py
index bd8e383dd..db252b934 100644
--- a/gnucash/python/init.py
+++ b/gnucash/python/init.py
@@ -7,8 +7,12 @@ require_version('Gtk', '3.0')
from gi.repository import Gtk
import os
sys.path.append(os.path.dirname(__file__))
+
+# output file location if gnucash has been started with
+# gnucash --extra
if gnc_prefs_is_extra_enabled():
- print("woop", os.path.dirname(__file__))
+ print("Python shell init file: %s" % (__file__))
+
# Importing the console class causes SIGTTOU to be thrown if GnuCash is
# started in the background. This causes a hang if it is not handled,
# so ignore it for the duration
@@ -20,15 +24,17 @@ import pycons.console as cons
# Restore the SIGTTOU handler
signal.signal(signal.SIGTTOU, old_sigttou)
+# output debug information if gnucash has been started with
+# gnucash --debug --extra
if gnc_prefs_is_extra_enabled() and gnc_prefs_is_debugging_enabled():
- print("Hello from python!")
- print("test", sys.modules.keys())
- print("test2", dir(_sw_app_utils))
+ print("Hello from python!\n")
+ print("sys.modules.keys(): ", sys.modules.keys(), "\n")
+ print("dir(_sw_app_utils): ", dir(_sw_app_utils), "\n")
#root = _sw_app_utils.gnc_get_current_root_account()
#print("test", dir(root), root.__class__)
- print("test3", dir(gnucash_core_c))
+ print("dir(gnucash_core_c): ", dir(gnucash_core_c))
#acct = Account(instance = root)
commit 0553576c818758d2af6560bafc80dc3dace17c9c
Author: c-holtermann <mail at c-holtermann.net>
Date: Mon Apr 20 16:03:27 2020 +0200
restructure info so that python help will display it
diff --git a/bindings/python/app_utils.py b/bindings/python/app_utils.py
index 82d809ce6..7af679911 100644
--- a/bindings/python/app_utils.py
+++ b/bindings/python/app_utils.py
@@ -4,13 +4,14 @@
## @file
# @brief High level python wrapper for app-utils
# @ingroup python_bindings
+#
+# further functions in _sw_app_utils that have not been included:
+# _gnc_get_current_book is available through Session.get_book()
+# _gnc_get_current_root_account is available through Book.get_root_account()
+
from gnucash import _sw_app_utils
def gnc_get_current_session():
from gnucash import Session
return Session(instance=_sw_app_utils.gnc_get_current_session())
-
-# further functions in _sw_app_utils
-# _gnc_get_current_book is availabe through Session.get_book()
-# _gnc_get_current_root_account is available through Session.get_root_account()
commit 4140569ac080015add843d522a2131e91a1afd53
Author: c-holtermann <mail at c-holtermann.net>
Date: Mon Apr 20 15:58:42 2020 +0200
utilize app_utils wrapper
diff --git a/gnucash/python/init.py b/gnucash/python/init.py
index bd8e383dd..6dabdc6ce 100644
--- a/gnucash/python/init.py
+++ b/gnucash/python/init.py
@@ -1,5 +1,4 @@
import sys
-import gnucash._sw_app_utils as _sw_app_utils
from gnucash import *
from gnucash._sw_core_utils import gnc_prefs_is_extra_enabled, gnc_prefs_is_debugging_enabled
from gi import require_version
@@ -23,9 +22,9 @@ signal.signal(signal.SIGTTOU, old_sigttou)
if gnc_prefs_is_extra_enabled() and gnc_prefs_is_debugging_enabled():
print("Hello from python!")
print("test", sys.modules.keys())
- print("test2", dir(_sw_app_utils))
- #root = _sw_app_utils.gnc_get_current_root_account()
+ #session = app_utils.gnc_get_current_session()
+ #root account can later on be accessed by session.get_book().get_root_account()
#print("test", dir(root), root.__class__)
print("test3", dir(gnucash_core_c))
commit f6cb8031928972dde155ab7fd3b9816817b829ef
Author: c-holtermann <mail at c-holtermann.net>
Date: Mon Apr 20 15:23:14 2020 +0200
app_utils needs to be imported to module gnucash to be accessible
diff --git a/bindings/python/__init__.py b/bindings/python/__init__.py
index 1c874734e..16b72fba9 100644
--- a/bindings/python/__init__.py
+++ b/bindings/python/__init__.py
@@ -4,6 +4,7 @@
# instead of
# >>> from gnucash.gnucash_core import thingy
from gnucash.gnucash_core import *
+from . import app_utils
## @file
# @brief helper file for the importing of gnucash
# @author Mark Jenkins, ParIT Worker Co-operative <mark at parit.ca>
Summary of changes:
bindings/python/__init__.py | 1 +
bindings/python/app_utils.py | 9 +++++----
gnucash/gnome-utils/gnc-dense-cal.c | 11 +++++++----
gnucash/gnome/dialog-sx-editor.c | 17 ++++++++++-------
gnucash/html/gnc-html-webkit2.c | 4 ----
gnucash/import-export/import-main-matcher.c | 14 ++++++++++++--
gnucash/python/init.py | 20 +++++++++++++-------
gnucash/register/ledger-core/gnc-ledger-display2.c | 1 -
gnucash/register/ledger-core/split-register.c | 1 +
libgnucash/engine/SchedXaction.c | 6 +++---
10 files changed, 52 insertions(+), 32 deletions(-)
More information about the gnucash-changes
mailing list