mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Don't allow the user to delete the last entry from a tax table
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@6964 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
parent
f55d4caaa1
commit
851ca85300
@ -536,6 +536,13 @@ tax_table_delete_entry_cb (GtkButton *button, TaxTableWindow *ttw)
|
||||
if (!ttw->current_table || !ttw->current_entry)
|
||||
return;
|
||||
|
||||
if (g_list_length (gncTaxTableGetEntries (ttw->current_table)) <= 1) {
|
||||
char *message = _("You cannot remove the last entry from the tax table.\n"
|
||||
"Try deleting the tax table if you want to do that.");
|
||||
gnc_error_dialog_parented (GTK_WINDOW (ttw->dialog), message);
|
||||
return;
|
||||
}
|
||||
|
||||
if (gnc_verify_dialog_parented (ttw->dialog, FALSE,
|
||||
_("Are you sure you want to delete this entry?"))) {
|
||||
/* Ok, let's remove it */
|
||||
|
Loading…
Reference in New Issue
Block a user