Fix two bugs (Upper case in database avoiding accents, and cat/account with the same name during modification into PreferencesPanel)

Updating translations
This commit is contained in:
2010-07-16 18:38:13 +02:00
parent 5286926588
commit d9359b2f98
7 changed files with 395 additions and 259 deletions

View File

@@ -19,11 +19,13 @@ along with KissCount. If not, see <http://www.gnu.org/licenses/>.
#include "AccountPanel.h"
enum {SEARCH_ID, GRID_ID};
enum {SEARCH_ID, GRID_ID, CALENDAR_FROM_ID, CALENDAR_TO_ID};
BEGIN_EVENT_TABLE(SearchPanel, wxPanel)
EVT_BUTTON(SEARCH_ID, SearchPanel::OnButtonSearch)
EVT_SHOW(SearchPanel::OnShow)
EVT_CALENDAR_SEL_CHANGED(CALENDAR_FROM_ID, SearchPanel::OnCalendarFromChange)
EVT_CALENDAR_SEL_CHANGED(CALENDAR_TO_ID, SearchPanel::OnCalendarToChange)
END_EVENT_TABLE()
#define SET_ROW_COLOR(row, color) for(int i=0; i<NUMBER_COLS_OPS; i++) \
@@ -47,9 +49,9 @@ SearchPanel::SearchPanel(KissCount* kiss, wxUI *parent) : wxScrolledWindow(&(*pa
wxGridBagSizer *gridBagSizer = new wxGridBagSizer(3, 9);
_calendarFrom = new wxCalendarCtrl(this, wxID_ANY, wxDefaultDateTime, wxDefaultPosition, wxDefaultSize,
_calendarFrom = new wxCalendarCtrl(this, CALENDAR_FROM_ID, wxDefaultDateTime, wxDefaultPosition, wxDefaultSize,
wxCAL_MONDAY_FIRST);
_calendarTo = new wxCalendarCtrl(this, wxID_ANY, wxDefaultDateTime, wxDefaultPosition, wxDefaultSize,
_calendarTo = new wxCalendarCtrl(this, CALENDAR_TO_ID, wxDefaultDateTime, wxDefaultPosition, wxDefaultSize,
wxCAL_MONDAY_FIRST);
@@ -123,7 +125,7 @@ void SearchPanel::OnButtonSearch(wxCommandEvent& event)
if (_calendarFrom->GetDate() > _calendarTo->GetDate())
{
wxMessageBox(_("Invalide date range"), _("Error"), wxICON_ERROR | wxOK);
wxMessageBox(_("Invalid date range"), _("Error"), wxICON_ERROR | wxOK);
return;
}
@@ -133,7 +135,7 @@ void SearchPanel::OnButtonSearch(wxCommandEvent& event)
*amountFrom = _amountFrom->GetLineText(0);
if (!amountFrom->ToDouble(&af))
{
wxMessageBox(_("Invalide amount from"), _("Error"), wxICON_ERROR | wxOK);
wxMessageBox(_("Invalid amount from"), _("Error"), wxICON_ERROR | wxOK);
delete amountFrom;
return;
}
@@ -145,7 +147,7 @@ void SearchPanel::OnButtonSearch(wxCommandEvent& event)
*amountTo = _amountTo->GetLineText(0);
if (!amountTo->ToDouble(&at))
{
wxMessageBox(_("Invalide amount to"), _("Error"), wxICON_ERROR | wxOK);
wxMessageBox(_("Invalid amount to"), _("Error"), wxICON_ERROR | wxOK);
delete amountFrom;
delete amountTo;
return;
@@ -154,7 +156,7 @@ void SearchPanel::OnButtonSearch(wxCommandEvent& event)
if (amountFrom && amountTo && af > at)
{
wxMessageBox(_("Invalide amount range"), _("Error"), wxICON_ERROR | wxOK);
wxMessageBox(_("Invalid amount range"), _("Error"), wxICON_ERROR | wxOK);
delete amountFrom;
delete amountTo;
return;
@@ -224,3 +226,12 @@ void SearchPanel::OnShow(wxShowEvent& event)
_wxUI->SetTitle(_kiss->GetUser()->_name + wxT(" - ") + _("Search"));
}
void SearchPanel::OnCalendarFromChange(wxCalendarEvent& event)
{
_checkDateFrom->SetValue(true);
}
void SearchPanel::OnCalendarToChange(wxCalendarEvent& event)
{
_checkDateTo->SetValue(true);
}