Fix a bug with categories (again)

Disable interface during mass update (cursor not changed :()
Resize search icon
This commit is contained in:
Grégory Soutadé 2011-02-24 20:59:30 +01:00
parent 16e90b8fc0
commit 5451d3c4ce
4 changed files with 16 additions and 5 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

View File

@ -1047,6 +1047,7 @@ bool Database::LoadCategory(const wxString& id, const wxString& name, Category&
category.backcolor = wxColour(set.GetAsString(wxT("backcolor")));
category.forecolor = wxColour(set.GetAsString(wxT("forecolor")));
category.font = set.GetAsString(wxT("font"));
category.fix_cost = set.GetBool(wxT("fix_cost"));
ret = true;
}

View File

@ -85,7 +85,7 @@ wxString User::GetCategoryId(const wxString& catName)
Category cat;
for (it=_categories.begin(); it !=_categories.end(); it++)
if (it->name == catName)
if (wxGetTranslation(it->name) == catName)
return it->id;
if ( _db->LoadCategory(wxT(""), catName, cat))

View File

@ -25,14 +25,14 @@
SetCellTextColour(row, i, forecolor); \
}
#define SET_ROW_FONT(row, font) for(int i=0; i<NUMBER_COLS_OPS; i++) \
#define SET_ROW_FONT(row, font) for(int i=0; i<NUMBER_COLS_OPS; i++) \
{ \
SetCellFont(row, i, font); \
SetCellFont(row, i, font); \
}
#define UNESCAPE_CHARS(s) { \
s.Replace(wxT("\\\""), wxT("\""), true); \
s.Replace(wxT("\\\'"), wxT("\'"), true); \
s.Replace(wxT("\\\""), wxT("\""), true); \
s.Replace(wxT("\\\'"), wxT("\'"), true); \
}
BEGIN_EVENT_TABLE(GridAccount, wxGrid)
@ -1492,6 +1492,12 @@ void GridAccount::MassUpdate(std::vector<int>& rows, updateOperationFunc func, v
std::vector<Operation>::iterator it;
Operation op, op2;
_parent->Disable();
_parent->SetCursor(wxCursor(wxCURSOR_ARROWWAIT));
_parent->Update();
if (rows.size())
{
for(i=0; i<(int)rows.size(); i++)
@ -1527,4 +1533,8 @@ void GridAccount::MassUpdate(std::vector<int>& rows, updateOperationFunc func, v
LoadOperations(_operations, false, false, 0, 0);
Layout();
_parent->Enable();
_parent->SetCursor(wxNullCursor);
}