Move categories from map to vector
This commit is contained in:
@@ -117,29 +117,23 @@ void KissCount::DeleteAccount(struct Account ac)
|
||||
_user->_accounts.erase(_user->_accounts.begin()+i);
|
||||
}
|
||||
|
||||
void KissCount::AddCategory(wxString name, wxColour colour)
|
||||
wxString KissCount::AddCategory(struct category category)
|
||||
{
|
||||
return _db->AddCategory(_user, category);
|
||||
}
|
||||
|
||||
void KissCount::UpdateCategory(wxString oldName, struct category category)
|
||||
{
|
||||
wxString color;
|
||||
color = _("#") ;
|
||||
color += wxString::Format(_("%02X"), colour.Red());
|
||||
color += wxString::Format(_("%02X"), colour.Green());
|
||||
color += wxString::Format(_("%02X"), colour.Blue());
|
||||
color += wxString::Format(_("%02X"), category.color.Red());
|
||||
color += wxString::Format(_("%02X"), category.color.Green());
|
||||
color += wxString::Format(_("%02X"), category.color.Blue());
|
||||
|
||||
_db->AddCategory(_user, name, color);
|
||||
_db->UpdateCategory(_user, oldName, category.name, color);
|
||||
}
|
||||
|
||||
void KissCount::UpdateCategory(wxString oldName, wxString name, wxColour colour)
|
||||
void KissCount::DeleteCategory(struct category category)
|
||||
{
|
||||
wxString color;
|
||||
color = _("#") ;
|
||||
color += wxString::Format(_("%02X"), colour.Red());
|
||||
color += wxString::Format(_("%02X"), colour.Green());
|
||||
color += wxString::Format(_("%02X"), colour.Blue());
|
||||
|
||||
_db->UpdateCategory(_user, oldName, name, color);
|
||||
}
|
||||
|
||||
void KissCount::DeleteCategory(wxString name)
|
||||
{
|
||||
_db->DeleteCategory(_user, name);
|
||||
_db->DeleteCategory(_user, category);
|
||||
}
|
||||
|
@@ -32,9 +32,9 @@ class KissCount
|
||||
void UpdateAccount(struct Account ac);
|
||||
void DeleteAccount(struct Account ac);
|
||||
|
||||
void AddCategory(wxString name, wxColour colour);
|
||||
void UpdateCategory(wxString oldName, wxString name, wxColour colour);
|
||||
void DeleteCategory(wxString name);
|
||||
wxString AddCategory(struct category category);
|
||||
void UpdateCategory(wxString oldName, struct category category);
|
||||
void DeleteCategory(struct category category);
|
||||
|
||||
private:
|
||||
wxUI* _wxUI;
|
||||
|
Reference in New Issue
Block a user