mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Add a Cancel button to the dialog that is invoked when a register
containing a modified transaction is closed via the window manager close button. #105742 git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@8665 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
14
ChangeLog
14
ChangeLog
@@ -23,6 +23,20 @@
|
||||
* src/report/standard-reports/register.scm: Show the running
|
||||
balance column by default. #92052.
|
||||
|
||||
* src/gnome/window-register.c: Annotate the window title to
|
||||
indicate whether a register is for a single account or it includes
|
||||
all subaccounts. #107927
|
||||
|
||||
* src/gnome/gnc-split-reg.c: Change the register close dialog to
|
||||
include a cancel option. #105742
|
||||
|
||||
* src/gnome/window-register.c: Don't close the register if the
|
||||
user cancelled. #105742
|
||||
|
||||
* src/engine/Scrub.c (xaccSplitScrub): Change a warning message to
|
||||
an info. This clause is hit every time a user saves a changed
|
||||
transaction by clicking on another transaction.
|
||||
|
||||
2003-06-22 David Hampton <hampton@employees.org>
|
||||
|
||||
* src/gnome-utils/dialog-commodity.[ch]: Clean up usage of the
|
||||
|
||||
@@ -243,7 +243,11 @@ xaccSplitScrub (Split *split)
|
||||
return;
|
||||
}
|
||||
|
||||
PWARN ("Adjusted split with mismatched values, desc=\"%s\" memo=\"%s\""
|
||||
/*
|
||||
* This will be hit every time you answer yes to the dialog "The
|
||||
* current transaction has changed. Would you like to record it.
|
||||
*/
|
||||
PINFO ("Adjusted split with mismatched values, desc=\"%s\" memo=\"%s\""
|
||||
" old amount %s %s, new amount %s",
|
||||
trans->description, split->memo,
|
||||
gnc_numeric_to_string (split->amount),
|
||||
|
||||
@@ -911,25 +911,34 @@ gnc_split_reg_ld_destroy( GNCLedgerDisplay *ledger )
|
||||
gboolean
|
||||
gnc_split_reg_check_close( GNCSplitReg *gsr )
|
||||
{
|
||||
GNCVerifyResult result;
|
||||
gboolean pending_changes;
|
||||
SplitRegister *reg;
|
||||
const char *message = _("The current transaction has been changed.\n"
|
||||
"Would you like to record it?");
|
||||
|
||||
reg = gnc_ledger_display_get_split_register( gsr->ledger );
|
||||
pending_changes = gnc_split_register_changed( reg );
|
||||
if ( !pending_changes )
|
||||
return FALSE;
|
||||
return TRUE;
|
||||
|
||||
result = gnc_verify_cancel_dialog_parented(gsr->window, GNC_VERIFY_YES,
|
||||
message);
|
||||
switch (result)
|
||||
{
|
||||
const char *message = _("The current transaction has been changed.\n"
|
||||
"Would you like to record it?");
|
||||
if ( gnc_verify_dialog_parented( gsr->window, TRUE, message) ) {
|
||||
case GNC_VERIFY_YES:
|
||||
case GNC_VERIFY_OK:
|
||||
gnc_split_reg_record_trans_cb( gsr->window, gsr );
|
||||
return TRUE;
|
||||
} else {
|
||||
|
||||
case GNC_VERIFY_NO:
|
||||
gnc_split_register_cancel_cursor_trans_changes( reg );
|
||||
return TRUE;
|
||||
|
||||
case GNC_VERIFY_CANCEL:
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
@@ -278,6 +278,13 @@ void gnc_split_reg_set_double_line( GNCSplitReg *gsr, gboolean doubleLine );
|
||||
**/
|
||||
void gnc_split_reg_use_extended_popup( GNCSplitReg *gsr );
|
||||
|
||||
/**
|
||||
* Check if its OK to close this register window. Gives the register
|
||||
* a chance to abort the close if there are roblems, e.g. an open
|
||||
* transaction.
|
||||
*
|
||||
* @return TRUE if the register may be closed, FALSE if not.
|
||||
**/
|
||||
gboolean gnc_split_reg_check_close( GNCSplitReg *gsr );
|
||||
|
||||
void gnc_split_reg_raise( GNCSplitReg *gsr );
|
||||
|
||||
@@ -722,8 +722,10 @@ gnc_register_delete_cb(GtkWidget *widget, GdkEvent *event, gpointer data)
|
||||
gnc_reg_save_size( regData );
|
||||
}
|
||||
|
||||
gnc_split_reg_check_close(regData->gsr);
|
||||
gnc_ledger_display_close (regData->ledger);
|
||||
if (gnc_split_reg_check_close(regData->gsr) != FALSE) {
|
||||
gnc_ledger_display_close (regData->ledger);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
return TRUE; /* don't close */
|
||||
}
|
||||
@@ -1551,8 +1553,9 @@ void
|
||||
gnc_register_close_cb (GtkWidget *widget, gpointer data)
|
||||
{
|
||||
RegWindow *regData = data;
|
||||
gnc_split_reg_check_close( GNC_SPLIT_REG(regData->gsr) );
|
||||
gnc_ledger_display_close( regData->ledger );
|
||||
|
||||
if (gnc_split_reg_check_close(regData->gsr) != FALSE)
|
||||
gnc_ledger_display_close( regData->ledger );
|
||||
}
|
||||
|
||||
static int
|
||||
|
||||
Reference in New Issue
Block a user