mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-08-21 22:04:56 -06:00
HomeBudget: Fixed crash in category update, fixed disabling category grid when delete last group (thanks porto and mr_ped!)
git-svn-id: svn://ultimatepp.org/upp/trunk@2771 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
d5f2a72424
commit
ee2c657d8c
1 changed files with 5 additions and 3 deletions
|
|
@ -295,15 +295,14 @@ void HomeBudget::RemoveGroup()
|
|||
if(categories.IsEmpty())
|
||||
{
|
||||
SQL & Delete(GROUPS).Where(ID == groups(ID));
|
||||
if(groups.GetCount() == 1)
|
||||
categories.Disable();
|
||||
}
|
||||
else
|
||||
{
|
||||
PromptOK(t_("You can't remove this group. It is not empty."));
|
||||
groups.CancelRemove();
|
||||
}
|
||||
|
||||
if(groups.GetCount() == 1)
|
||||
categories.Disable();
|
||||
}
|
||||
|
||||
struct AddNewCat : WithNewCategoryLayout<TopWindow>
|
||||
|
|
@ -745,6 +744,9 @@ void HomeBudget::SetRest(StaticText &rest, float r)
|
|||
|
||||
void HomeBudget::UpdateValue()
|
||||
{
|
||||
if(money.IsEmpty())
|
||||
return;
|
||||
|
||||
try
|
||||
{
|
||||
SQL & Select(DEFVALUE).From(CATEGORIES).Where(ID == money.Get(CAT_ID));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue