Fix bugs with new users

This commit is contained in:
Grégory Soutadé 2010-08-24 22:23:56 +02:00
parent fb1007bfcb
commit dd5f231f20
4 changed files with 4 additions and 18 deletions

View File

@ -286,6 +286,8 @@ void KissCount::NewUser(const wxString& name)
cat.parent = wxT("0") ; cat.name = _("Other") ; cat.color = OWN_GREEN; cat.parent = wxT("0") ; cat.name = _("Other") ; cat.color = OWN_GREEN;
AddCategory(cat); AddCategory(cat);
SetOperationOrder(wxT("ASC"));
_db->GenerateMonth(_user, -1, -1, (int)curDate.GetMonth(), curDate.GetYear()); _db->GenerateMonth(_user, -1, -1, (int)curDate.GetMonth(), curDate.GetYear());
} }

View File

@ -957,23 +957,6 @@ void Database::NewUser(const wxString& name)
set.Finalize(); set.Finalize();
req = wxT("SELECT * FROM default_preference");
EXECUTE_SQL_QUERY(req, set,);
while (set.NextRow())
{
req = wxT("INSERT INTO preference ('user', 'name', 'value') VALUES ('") ;
req += id + wxT("'");
req += wxT(", '") + set.GetAsString(wxT("type")) + wxT("'");
req += wxT(", '") + set.GetAsString(wxT("value")) + wxT("'");
req += wxT(")");
EXECUTE_SQL_UPDATE(req, );
}
set.Finalize();
return ; return ;
} }

View File

@ -71,6 +71,8 @@ UsersDialog::UsersDialog(KissCount* kiss, wxUI *parent) : wxDialog(&(*parent), -
if (users_list.size() == 0) if (users_list.size() == 0)
OnNewUser(event); OnNewUser(event);
else
ShowModal();
} }
void UsersDialog::OnOK(wxCommandEvent& event) void UsersDialog::OnOK(wxCommandEvent& event)

View File

@ -143,7 +143,6 @@ void wxUI::ShowPreferences()
void wxUI::ChangeUser() void wxUI::ChangeUser()
{ {
UsersDialog u(_kiss, this); UsersDialog u(_kiss, this);
u.ShowModal();
} }
void wxUI::LoadUser() void wxUI::LoadUser()