Fix a bug with passwords

Fix a bug in search (wildcards)
Fix a bug in wxUI (tooltips not translated)
Update translation
Update TODO
This commit is contained in:
Grégory Soutadé 2010-08-29 09:29:34 +02:00
parent ceb942e3ee
commit 41617afc10
10 changed files with 50 additions and 31 deletions

30
TODO
View File

@ -1,28 +1,34 @@
Version 0.1 Version 0.1
Statistics (need to add months/years label on graph) Statistics (need to add months/years label on graph)
Copy and paste Multiples operations into one (operation fusion)
Import/Export module Auto completion (already up into wxwidgets 2.9)
Using tabulation to navigate throw interface (Search Panel) Using tabulation to navigate throw interface (Search Panel)
Improve Scrolled Windows Improve Scrolled Windows and widgets placement
Fix some bugs (especially when closing, and one when switching between SearchPanel and AccountPanel) Fix some bugs (especially when closing, and one when switching between SearchPanel and AccountPanel). Is there bugs ??
Can type a letter with a comboboxes Can type a letter with a comboboxes
Windows version Windows version
Need packaging Need packaging
Better build system for wxFreeChart (hacked by me) Better build system for wxFreeChart (hacked by me)
Others translation
Handle bad SQL return Handle bad SQL return
Category color/font Category color/font
Button tooltip not translated Shared accounts
Documentation (en)
Cool for 0.1:
Database auto saving at startup
Use caches for created panels (avoid destroying/creating panels for nothing)
=============================================================== ===============================================================
Next version Next version
More translations
Formulas Formulas
Multiples operations into one (operation fusion) Import/Export module
Auto completion (already up into wxwidgets 2.9)
Undo/redo Undo/redo
Database auto saving at startup Printing (maybe in html)
Documentation
Use caches for created panels (avoid destroying/creating panels for nothing) ===============================================================
Printing Will not be implemented
Copy and paste

Binary file not shown.

View File

@ -256,7 +256,7 @@ msgstr "De"
#: src/view/GenerateDialog.cpp:45 #: src/view/GenerateDialog.cpp:45
msgid "From " msgid "From "
msgstr "De" msgstr "A partir de "
#: src/view/GenerateDialog.cpp:31 #: src/view/GenerateDialog.cpp:31
#: src/view/AccountPanel.cpp:833 #: src/view/AccountPanel.cpp:833
@ -460,7 +460,7 @@ msgstr "A"
#: src/view/GenerateDialog.cpp:52 #: src/view/GenerateDialog.cpp:52
msgid "To " msgid "To "
msgstr "A" msgstr "Vers "
#: src/view/AccountPanel.cpp:171 #: src/view/AccountPanel.cpp:171
msgid "Total Credit" msgid "Total Credit"

View File

@ -320,7 +320,7 @@ std::vector<Operation>* KissCount::Search(wxString* description, wxDateTime* dat
std::vector<wxString> categories, std::vector<wxString> accounts) std::vector<wxString> categories, std::vector<wxString> accounts)
{ {
return _db->Search(_user, description, dateFrom, dateTo, amountFrom, amountTo, categories, accounts); return _db->Search(_user, description, dateFrom, dateTo, amountFrom, amountTo, categories, accounts, true);
} }
bool KissCount::SearchPreviousOperation(Operation* res, wxString& description, int month, int year) bool KissCount::SearchPreviousOperation(Operation* res, wxString& description, int month, int year)
@ -339,7 +339,7 @@ bool KissCount::SearchPreviousOperation(Operation* res, wxString& description, i
date = new wxDateTime(0, (wxDateTime::Month)month, year); date = new wxDateTime(0, (wxDateTime::Month)month, year);
operations = Search(&description, date, NULL, NULL, NULL, v, v); operations = _db->Search(_user, &description, date, NULL, NULL, NULL, v, v, false);
delete date; delete date;

View File

@ -173,7 +173,7 @@ wxString Database::HashPassword(const wxString& password)
wxString wxSHA; wxString wxSHA;
blk_SHA1_Init(&sha_ctx); blk_SHA1_Init(&sha_ctx);
blk_SHA1_Update(&sha_ctx, password.c_str(), password.Length()); blk_SHA1_Update(&sha_ctx, password.mb_str(), password.Length());
blk_SHA1_Final(sha, &sha_ctx); blk_SHA1_Final(sha, &sha_ctx);
for(int i=0; i<20; i++) for(int i=0; i<20; i++)
@ -1039,7 +1039,7 @@ void Database::UpdatePreference(User* user, const wxString& preference)
std::vector<Operation>* Database::Search(User* user, wxString* description, wxDateTime* dateFrom, wxDateTime* dateTo, std::vector<Operation>* Database::Search(User* user, wxString* description, wxDateTime* dateFrom, wxDateTime* dateTo,
wxString* amountFrom, wxString* amountTo, wxString* amountFrom, wxString* amountTo,
std::vector<wxString> categories, std::vector<wxString> accounts) std::vector<wxString> categories, std::vector<wxString> accounts, bool wildcards)
{ {
wxSQLite3ResultSet set; wxSQLite3ResultSet set;
wxString req; wxString req;
@ -1069,6 +1069,9 @@ std::vector<Operation>* Database::Search(User* user, wxString* description, wxDa
if (description) if (description)
{ {
if (wildcards)
req += wxT("description LIKE '%") + *description + wxT("%'");
else
req += wxT("description='") + *description + wxT("'"); req += wxT("description='") + *description + wxT("'");
firstCond = true; firstCond = true;
} }

View File

@ -70,7 +70,7 @@ public:
std::vector<Operation>* Search(User* user, wxString* description, wxDateTime* dateFrom, wxDateTime* dateTo, std::vector<Operation>* Search(User* user, wxString* description, wxDateTime* dateFrom, wxDateTime* dateTo,
wxString* amountFrom, wxString* amountTo, wxString* amountFrom, wxString* amountTo,
std::vector<wxString> categories, std::vector<wxString> accounts); std::vector<wxString> categories, std::vector<wxString> accounts, bool wildcards);
void GetStats(User* user, const wxString& monthFrom, const wxString& yearFrom, const wxString& monthTo, void GetStats(User* user, const wxString& monthFrom, const wxString& yearFrom, const wxString& monthTo,
const wxString& yearTo, std::map<wxString, std::map<int, std::map<int, double> > >* accountAmounts, const wxString& yearTo, std::map<wxString, std::map<int, std::map<int, double> > >* accountAmounts,

View File

@ -44,14 +44,6 @@ ButtonPanel::ButtonPanel(KissCount* kiss, wxUI *parent) : wxPanel(&(*parent)), _
SetSizer(hbox); SetSizer(hbox);
_account->SetToolTip(_("Operations"));
_stats->SetToolTip(_("Statistics"));
_search->SetToolTip(_("Search"));
_prefs->SetToolTip(_("Preferences"));
_changeUser->SetToolTip(_("Change user"));
_about->SetToolTip(_("About"));
_quit->SetToolTip(_("Quit"));
hbox->Add(_account); hbox->Add(_account);
hbox->Add(_stats); hbox->Add(_stats);
hbox->Add(_search); hbox->Add(_search);
@ -72,6 +64,17 @@ ButtonPanel::~ButtonPanel()
delete _changeUser; delete _changeUser;
} }
void ButtonPanel::SetToolTips()
{
_account->SetToolTip(_("Operations"));
_stats->SetToolTip(_("Statistics"));
_search->SetToolTip(_("Search"));
_prefs->SetToolTip(_("Preferences"));
_changeUser->SetToolTip(_("Change user"));
_about->SetToolTip(_("About"));
_quit->SetToolTip(_("Quit"));
}
void ButtonPanel::OnButtonAccount(wxCommandEvent& event) void ButtonPanel::OnButtonAccount(wxCommandEvent& event)
{ {
_wxUI->ShowAccount(); _wxUI->ShowAccount();

View File

@ -38,6 +38,8 @@ public:
ButtonPanel(KissCount* kiss, wxUI *parent); ButtonPanel(KissCount* kiss, wxUI *parent);
~ButtonPanel(); ~ButtonPanel();
void SetToolTips();
void OnButtonAccount(wxCommandEvent& event); void OnButtonAccount(wxCommandEvent& event);
void OnButtonStats(wxCommandEvent& event); void OnButtonStats(wxCommandEvent& event);
void OnButtonSearch(wxCommandEvent& event); void OnButtonSearch(wxCommandEvent& event);

View File

@ -34,11 +34,11 @@ wxColour categoryColors[12] = {wxColour(0x00, 0x45, 0x86),
wxColour(0x00, 0x84, 0xD1)}; wxColour(0x00, 0x84, 0xD1)};
wxUI::wxUI(KissCount* kiss, const wxString& title, const wxPoint& pos, const wxSize& size) wxUI::wxUI(KissCount* kiss, const wxString& title, const wxPoint& pos, const wxSize& size)
: wxFrame(NULL, wxID_ANY, title, pos, size), _kiss(kiss), _accountPanel(NULL), _statsPanel(NULL), : wxFrame(NULL, wxID_ANY, title, pos, size), _kiss(kiss), _buttonPanel(NULL), _accountPanel(NULL), _statsPanel(NULL),
_searchPanel(NULL), _preferencesPanel(NULL), _curPanel(NULL), _locale(NULL), _needReload(false) _searchPanel(NULL), _preferencesPanel(NULL), _curPanel(NULL), _locale(NULL), _needReload(false)
{ {
_hbox = new wxBoxSizer(wxVERTICAL); _hbox = new wxBoxSizer(wxVERTICAL);
ButtonPanel* buttons = new ButtonPanel(_kiss, this); _buttonPanel = new ButtonPanel(_kiss, this);
// wxMenu *menuFile = new wxMenu; // wxMenu *menuFile = new wxMenu;
// menuFile->Append( ID_About, wxT("&About...") ); // menuFile->Append( ID_About, wxT("&About...") );
@ -55,7 +55,7 @@ wxUI::wxUI(KissCount* kiss, const wxString& title, const wxPoint& pos, const wxS
SetSizer(_hbox); SetSizer(_hbox);
_hbox->Add(buttons); _hbox->Add(_buttonPanel);
} }
wxUI::~wxUI() wxUI::~wxUI()
@ -117,6 +117,9 @@ bool wxUI::SetLanguage(long language)
months[10] = _("november"); months[10] = _("november");
months[11] = _("december") ; months[11] = _("december") ;
if (_buttonPanel)
_buttonPanel->SetToolTips();
return res; return res;
} }

View File

@ -31,6 +31,7 @@
#include <controller/KissCount.h> #include <controller/KissCount.h>
class KissCount; class KissCount;
class ButtonPanel;
class AccountPanel; class AccountPanel;
class PreferencesPanel; class PreferencesPanel;
class StatsPanel; class StatsPanel;
@ -66,6 +67,7 @@ public:
private: private:
KissCount *_kiss; KissCount *_kiss;
wxBoxSizer *_hbox; wxBoxSizer *_hbox;
ButtonPanel *_buttonPanel;
AccountPanel *_accountPanel; AccountPanel *_accountPanel;
StatsPanel *_statsPanel; StatsPanel *_statsPanel;
SearchPanel *_searchPanel; SearchPanel *_searchPanel;