r22351 - gnucash/trunk/src/register/ledger-core - Bug #344869 - No warning when you change a reconciled split from another
Geert Janssens
gjanssens at code.gnucash.org
Wed Aug 29 16:09:17 EDT 2012
Author: gjanssens
Date: 2012-08-29 16:09:16 -0400 (Wed, 29 Aug 2012)
New Revision: 22351
Trac: http://svn.gnucash.org/trac/changeset/22351
Modified:
gnucash/trunk/src/register/ledger-core/split-register-model.c
Log:
Bug #344869 - No warning when you change a reconciled split from another
account in basic ledger mode
This patch brings up a dialogue when any field in a transaction/split is
changed when the transaction has a reconciled split. Exceptions are the
notes, action and memo fields. Those can be changed at all times.
This patch will not be backported as it introduces new translatable
strings.
Author: Robert Fewell <14ubobit at gmail.com>
Modified: gnucash/trunk/src/register/ledger-core/split-register-model.c
===================================================================
--- gnucash/trunk/src/register/ledger-core/split-register-model.c 2012-08-25 19:28:12 UTC (rev 22350)
+++ gnucash/trunk/src/register/ledger-core/split-register-model.c 2012-08-29 20:09:16 UTC (rev 22351)
@@ -1920,6 +1920,8 @@
Transaction *trans;
Split *split;
char recn;
+ const char *cell_name;
+ gboolean change_ok;
/* This assumes we reset the flag whenever we change splits.
* This happens in gnc_split_register_move_cursor(). */
@@ -1939,15 +1941,34 @@
else
recn = xaccSplitGetReconcile (split);
- if (recn == YREC)
+ /* What Cell are we in */
+ cell_name = gnc_table_get_cell_name (reg->table, virt_loc);
+
+ /* These cells can be changed */
+ change_ok = (g_strcmp0(cell_name, "notes") == 0) || (g_strcmp0(cell_name, "memo") == 0) || (g_strcmp0(cell_name, "action") == 0);
+
+ if ((recn == YREC || xaccTransHasReconciledSplits (trans)) && !change_ok)
{
GtkWidget *dialog, *window;
gint response;
- const gchar *title = _("Change reconciled split?");
- const gchar *message =
- _("You are about to change a reconciled split. Doing so might make "
- "future reconciliation difficult! Continue with this change?");
+ const gchar *title;
+ const gchar *message;
+ if(recn == YREC)
+ {
+ title = _("Change reconciled split?");
+ message =
+ _("You are about to change a reconciled split. Doing so might make "
+ "future reconciliation difficult! Continue with this change?");
+ }
+ else
+ {
+ title = _("Change split linked to a reconciled split?");
+ message =
+ _("You are about to change a split that is linked to a reconciled split. "
+ "Doing so might make future reconciliation difficult! Continue with this change?");
+ }
+
/* Does the user want to be warned? */
window = gnc_split_register_get_parent(reg);
dialog =
More information about the gnucash-changes
mailing list