mirror of
https://github.com/Gnucash/gnucash.git
synced 2026-07-29 23:58:03 -05: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:
@@ -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 */
|
||||
|
||||
Reference in New Issue
Block a user