gnucash maint: Multiple changes pushed
Geert Janssens
gjanssens at code.gnucash.org
Wed Jul 4 12:01:52 EDT 2018
Updated via https://github.com/Gnucash/gnucash/commit/463b551d (commit)
via https://github.com/Gnucash/gnucash/commit/3d4201f1 (commit)
from https://github.com/Gnucash/gnucash/commit/b79c9d15 (commit)
commit 463b551db984aa3ada81f2dc20631cf8f4ed92a1
Author: Geert Janssens <geert at kobaltwit.be>
Date: Wed Jul 4 17:58:53 2018 +0200
Bug 771667 - Different warnings when changing reconciled splits vs. splits linked to reconciled splits
This is the final bit that ensures a warning is only presented if a previous warning
didn't already include the change we're about to warn about.
This should prevent two warnings popping up when only one is sufficient. For example
when the user first edits a protection field the warning will notify the user all
reconciled splits will be unreconciled. If the user then continues to edit a
(previously) a protected split field before leaving the transaction, no extra warning
is needed.
diff --git a/gnucash/register/ledger-core/split-register-model.c b/gnucash/register/ledger-core/split-register-model.c
index b579548..80fea42 100644
--- a/gnucash/register/ledger-core/split-register-model.c
+++ b/gnucash/register/ledger-core/split-register-model.c
@@ -2060,6 +2060,24 @@ xaccTransWarnReadOnly (GtkWidget *parent, const Transaction *trans)
return FALSE;
}
+static gboolean reg_trans_has_reconciled_splits (SplitRegister *reg, Transaction *trans)
+{
+ GList *node;
+
+ for (node = xaccTransGetSplitList (trans); node; node = node->next)
+ {
+ Split *split = node->data;
+
+ if (!xaccTransStillHasSplit(trans, split))
+ continue;
+
+ if ((xaccSplitGetReconcile (split) == YREC) &&
+ (g_list_index (reg->unrecn_splits, split) == -1))
+ return TRUE;
+ }
+
+ return FALSE;
+}
static gboolean
gnc_split_register_confirm (VirtualLocation virt_loc, gpointer user_data)
@@ -2087,12 +2105,14 @@ gnc_split_register_confirm (VirtualLocation virt_loc, gpointer user_data)
if (xaccTransWarnReadOnly(gnc_split_register_get_parent(reg), trans))
return FALSE;
- if (!xaccTransHasReconciledSplits (trans))
+ if (!reg_trans_has_reconciled_splits (reg, trans))
return TRUE;
if (gnc_table_layout_get_cell_changed (reg->table->layout, RECN_CELL, FALSE))
recn = gnc_recn_cell_get_flag
((RecnCell *) gnc_table_layout_get_cell (reg->table->layout, RECN_CELL));
+ else if (g_list_index (reg->unrecn_splits, split) != -1)
+ recn = NREC; /* A previous run of this function marked this split for unreconciling */
else
recn = xaccSplitGetReconcile (split);
@@ -2186,7 +2206,12 @@ gnc_split_register_confirm (VirtualLocation virt_loc, gpointer user_data)
if (recn == YREC && protected_split_cell)
{
if (g_list_index (reg->unrecn_splits, split) == -1)
+ {
reg->unrecn_splits = g_list_append (reg->unrecn_splits, split);
+ gnc_recn_cell_set_flag
+ ((RecnCell *) gnc_table_layout_get_cell (reg->table->layout, RECN_CELL),
+ NREC);
+ }
}
if (protected_trans_cell)
commit 3d4201f172ea3e4c87872d6f710ce85edb31b6aa
Author: Geert Janssens <geert at kobaltwit.be>
Date: Wed Jul 4 17:50:50 2018 +0200
Adjust icon installation regex a bit more
This will only exclude apps and actions if they are directories.
diff --git a/data/pixmaps/CMakeLists.txt b/data/pixmaps/CMakeLists.txt
index 57a66a2..e44e9b4 100644
--- a/data/pixmaps/CMakeLists.txt
+++ b/data/pixmaps/CMakeLists.txt
@@ -16,22 +16,22 @@ file(COPY ${CMAKE_CURRENT_SOURCE_DIR}
)
install(
DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/hicolor DESTINATION ${CMAKE_INSTALL_DATADIR}/gnucash/icons
- REGEX "hicolor/.*/apps.*" EXCLUDE
+ REGEX "hicolor/.*/apps/.*" EXCLUDE
)
file(
COPY ${CMAKE_CURRENT_SOURCE_DIR}/hicolor
DESTINATION ${DATADIR_BUILD}/gnucash/icons
- REGEX "hicolor/.*/apps.*" EXCLUDE
+ REGEX "hicolor/.*/apps/.*" EXCLUDE
)
install(
DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/hicolor DESTINATION ${CMAKE_INSTALL_DATADIR}/icons
- REGEX "hicolor/.*/actions.*" EXCLUDE
+ REGEX "hicolor/.*/actions/.*" EXCLUDE
)
file(
COPY ${CMAKE_CURRENT_SOURCE_DIR}/hicolor
DESTINATION ${DATADIR_BUILD}/icons
- REGEX "hicolor/.*/actions.*" EXCLUDE
+ REGEX "hicolor/.*/actions/.*" EXCLUDE
)
set(gncpixmap_DATA
Summary of changes:
data/pixmaps/CMakeLists.txt | 8 +++----
.../register/ledger-core/split-register-model.c | 27 +++++++++++++++++++++-
2 files changed, 30 insertions(+), 5 deletions(-)
More information about the gnucash-changes
mailing list