* Add percents to month stats

* Remove version from translation
* Update TODO
This commit is contained in:
2010-08-14 22:04:03 +02:00
parent 0336b6620e
commit 023b1def9d
9 changed files with 50 additions and 45 deletions

View File

@@ -27,6 +27,8 @@ along with KissCount. If not, see <http://www.gnu.org/licenses/>.
#include <model/model.h>
#include <view/wxUI.h>
#define APP_VERSION "v0.1 beta"
class wxUI;
class KissCount
{

View File

@@ -449,7 +449,7 @@ void AccountPanel::UpdateStats()
int i;
User* user = _kiss->GetUser();
std::vector<Operation>::iterator it;
double curCredit, curDebit, totalCredit, totalDebit, remains, value;
double curCredit, curDebit, totalCredit, totalDebit, remains, value, percents;
std::map<wxString, double> curAccountAmount, finalAccountAmount;
std::map<wxString, double>::iterator doubleIt;
std::map<wxString, int>::iterator intIt;
@@ -503,7 +503,10 @@ void AccountPanel::UpdateStats()
_statsGrid->SetCellValue(REMAINS, 1, wxString::Format(wxT("%.2lf"), remains));
for(i=0; i<user->GetCategoriesNumber()+1; i++)
_statsGrid->SetCellValue(CATS_STATS+i, 1, wxString::Format(wxT("%.2lf"), _categoriesValues[i]));
{
percents = ((double) (_categoriesValues[i]*100))/totalDebit;
_statsGrid->SetCellValue(CATS_STATS+i, 1, wxString::Format(wxT("%.2lf (%d %%)"), _categoriesValues[i], (int)percents));
}
for (i=0, accountIt=user->_accounts.begin(); accountIt!=user->_accounts.end(); accountIt++, i++)
{
@@ -514,6 +517,8 @@ void AccountPanel::UpdateStats()
_accountsGrid->SetCellValue(i, ACCOUNT_FINAL, wxString::Format(wxT("%.2lf"), value));
}
_statsGrid->AutoSizeColumn(1, true);
_pie->DatasetChanged(_dataset);
}

View File

@@ -93,8 +93,8 @@ void ButtonPanel::OnButtonChangeUser(wxCommandEvent& event)
void ButtonPanel::OnButtonAbout(wxCommandEvent& event)
{
wxMessageBox( _("KissCount v0.1\n\nPersonal accounting software\n\nCopyright (C) 2010 Grégory Soutadé"),
wxT("KissCount"),
wxMessageBox( _("Personal accounting software\n\nCopyright (C) 2010 Grégory Soutadé"),
wxT("KissCount " APP_VERSION "\n\n"),
wxOK | wxICON_INFORMATION, _wxUI );
}