Use class enums and constants rather than global enums and define
Fix a bug : virtual transferts must not be considered as a debit
This commit is contained in:
parent
6d0fe8ec7b
commit
08ba72664c
|
@ -1,9 +1,10 @@
|
|||
v0.3 (06/08/2011)
|
||||
v0.3 (16/08/2011)
|
||||
** User **
|
||||
Install KissCount into /usr/local instead of /usr
|
||||
|
||||
** Bugs **
|
||||
Fix a bug in language settings
|
||||
Virtual transferts must not be considered as a debit
|
||||
|
||||
v0.2 (04/07/2011)
|
||||
|
||||
|
|
|
@ -354,17 +354,17 @@ void KissCount::NewUser(const wxString& name)
|
|||
|
||||
AddAccount(ac);
|
||||
|
||||
cat.parent = wxT("0") ; cat.name = wxT("Fix") ; cat.backcolor = OWN_YELLOW ; cat.forecolor = *wxBLACK; cat.fix_cost = true;
|
||||
cat.parent = wxT("0") ; cat.name = wxT("Fix") ; cat.backcolor = view::OWN_YELLOW ; cat.forecolor = *wxBLACK; cat.fix_cost = true;
|
||||
AddCategory(cat);
|
||||
cat.parent = wxT("0") ; cat.name = wxT("Groceries") ; cat.backcolor = OWN_GREEN; cat.forecolor = *wxBLACK; cat.fix_cost = false;
|
||||
cat.parent = wxT("0") ; cat.name = wxT("Groceries") ; cat.backcolor = view::OWN_GREEN; cat.forecolor = *wxBLACK; cat.fix_cost = false;
|
||||
AddCategory(cat);
|
||||
cat.parent = wxT("0") ; cat.name = wxT("Hobbies") ; cat.backcolor = OWN_GREEN; cat.forecolor = *wxBLACK; cat.fix_cost = false;
|
||||
cat.parent = wxT("0") ; cat.name = wxT("Hobbies") ; cat.backcolor = view::OWN_GREEN; cat.forecolor = *wxBLACK; cat.fix_cost = false;
|
||||
AddCategory(cat);
|
||||
cat.parent = wxT("0") ; cat.name = wxT("Car") ; cat.backcolor = OWN_GREEN; cat.forecolor = *wxBLACK; cat.fix_cost = false;
|
||||
cat.parent = wxT("0") ; cat.name = wxT("Car") ; cat.backcolor = view::OWN_GREEN; cat.forecolor = *wxBLACK; cat.fix_cost = false;
|
||||
AddCategory(cat);
|
||||
cat.parent = wxT("0") ; cat.name = wxT("Unexpected") ; cat.backcolor = OWN_GREEN; cat.forecolor = *wxBLACK; cat.fix_cost = false;
|
||||
cat.parent = wxT("0") ; cat.name = wxT("Unexpected") ; cat.backcolor = view::OWN_GREEN; cat.forecolor = *wxBLACK; cat.fix_cost = false;
|
||||
AddCategory(cat);
|
||||
cat.parent = wxT("0") ; cat.name = wxT("Other") ; cat.backcolor = OWN_GREEN; cat.forecolor = *wxBLACK; cat.fix_cost = false;
|
||||
cat.parent = wxT("0") ; cat.name = wxT("Other") ; cat.backcolor = view::OWN_GREEN; cat.forecolor = *wxBLACK; cat.fix_cost = false;
|
||||
AddCategory(cat);
|
||||
|
||||
SetOperationOrder(wxT("ASC"));
|
||||
|
@ -427,9 +427,9 @@ bool KissCount::SearchPreviousOperation(Operation* res, Operation& op, int month
|
|||
date = new wxDateTime(0, (wxDateTime::Month)month, year);
|
||||
|
||||
if (limitToType)
|
||||
operations = _db->Search(_user, &op.description, date, 0, 0, 0, v, op.fix_cost ? FIX_OP : NON_FIX_OP, v, false);
|
||||
operations = _db->Search(_user, &op.description, date, 0, 0, 0, v, op.fix_cost ? +Database::FIX_OP : +Database::NON_FIX_OP, v, false);
|
||||
else
|
||||
operations = _db->Search(_user, &op.description, date, 0, 0, 0, v, ALL_OP, v, false);
|
||||
operations = _db->Search(_user, &op.description, date, 0, 0, 0, v, Database::ALL_OP, v, false);
|
||||
|
||||
|
||||
delete date;
|
||||
|
|
|
@ -1757,7 +1757,7 @@ void Database::UpdateImportPattern(User* user)
|
|||
it != user->_importPatterns.end();
|
||||
it++)
|
||||
{
|
||||
if (it->second.pattern == NULL_IMPORT_PATTERN) continue;
|
||||
if (it->second.pattern == ImportEngine::NULL_IMPORT_PATTERN) continue;
|
||||
|
||||
key = ImportEngine::RemoveUnused(it->first);
|
||||
|
||||
|
|
|
@ -33,16 +33,9 @@
|
|||
#include <controller/KissCount.h>
|
||||
#include "model.h"
|
||||
|
||||
#define DATABASE_VERSION 2
|
||||
|
||||
#define BDD_FILE "/.kisscount/kc.bdd"
|
||||
#define INIT_SCRIPT RESSOURCES_ROOT "init.sql"
|
||||
|
||||
#define FIX_OP (1 << 0)
|
||||
#define NON_FIX_OP (1 << 1)
|
||||
#define CHECKED_OP (1 << 2)
|
||||
#define NOT_CHECKED_OP (1 << 3)
|
||||
#define ALL_OP (~0)
|
||||
|
||||
// if (!_db.CheckSyntax(req))
|
||||
// {
|
||||
|
@ -96,6 +89,14 @@ class User;
|
|||
class Database
|
||||
{
|
||||
public:
|
||||
static const int FIX_OP = 1;//(1 << 0);
|
||||
static const int NON_FIX_OP = 2;//(1 << 1);
|
||||
static const int CHECKED_OP = (1 << 2);
|
||||
static const int NOT_CHECKED_OP = (1 << 3);
|
||||
static const int ALL_OP = (~0);
|
||||
|
||||
static const int VERSION = 2;
|
||||
|
||||
Database(const char* filename, KissCount* kiss);
|
||||
|
||||
std::list<wxString> GetUsers();
|
||||
|
|
|
@ -91,9 +91,9 @@ void Database::CheckDatabaseVersion()
|
|||
ON_ERROR("Invalid database version");
|
||||
}
|
||||
|
||||
if (version == DATABASE_VERSION) return;
|
||||
if (version == Database::VERSION) return;
|
||||
|
||||
if (version > DATABASE_VERSION)
|
||||
if (version > Database::VERSION)
|
||||
{
|
||||
ON_ERROR("Your current version of KissCount is too old and can't load this database. Please upgrade KissCount");
|
||||
}
|
||||
|
@ -101,7 +101,7 @@ void Database::CheckDatabaseVersion()
|
|||
version--;
|
||||
|
||||
// Maybe one update is impossible
|
||||
for(i=version; i<DATABASE_VERSION-1; i++)
|
||||
for(i=version; i<Database::VERSION-1; i++)
|
||||
{
|
||||
if (!updates[i])
|
||||
{
|
||||
|
@ -117,12 +117,12 @@ void Database::CheckDatabaseVersion()
|
|||
|
||||
try
|
||||
{
|
||||
for(i=version; i<DATABASE_VERSION-1; i++)
|
||||
for(i=version; i<Database::VERSION-1; i++)
|
||||
{
|
||||
updates[i](_db);
|
||||
}
|
||||
|
||||
req = wxT("UPDATE kisscount SET db_version='") + wxString::Format(wxT("%d"), DATABASE_VERSION) + wxT("'");
|
||||
req = wxT("UPDATE kisscount SET db_version='") + wxString::Format(wxT("%d"), Database::VERSION) + wxT("'");
|
||||
|
||||
EXECUTE_SQL_UPDATE_WITH_CODE(req, , throw std::string("Unable to set new database version"), {});
|
||||
}
|
||||
|
|
|
@ -56,7 +56,7 @@ Category User::GetCategory(const wxString& catId)
|
|||
cat.parent = wxT("0");
|
||||
cat.name = _("Unknown");
|
||||
cat.font = wxT("");
|
||||
cat.backcolor = OWN_GREEN;
|
||||
cat.backcolor = view::OWN_GREEN;
|
||||
cat.forecolor = wxColour(0x00, 0x00, 0x00);
|
||||
|
||||
return cat;
|
||||
|
|
|
@ -97,7 +97,7 @@ void GrisbiImportEngine::LoadCategory(GrisbiImportEngine* _this, const char** at
|
|||
cat.id = id;
|
||||
cat.name = name;
|
||||
cat.parent = wxT("0");
|
||||
cat.backcolor = OWN_GREEN ;
|
||||
cat.backcolor = view::OWN_GREEN ;
|
||||
cat.forecolor = *wxBLACK;
|
||||
cat.fix_cost = false;
|
||||
_this->_unresolvedCategories.push_back(cat);
|
||||
|
|
|
@ -19,6 +19,8 @@
|
|||
|
||||
#include "ImportEngine.h"
|
||||
|
||||
wxString ImportEngine::NULL_IMPORT_PATTERN = wxT("(nil)");
|
||||
|
||||
ImportEngine::ImportEngine()
|
||||
{
|
||||
}
|
||||
|
|
|
@ -33,10 +33,10 @@ public:
|
|||
wxString category;
|
||||
} ;
|
||||
|
||||
#define NULL_IMPORT_PATTERN wxT("(nil)")
|
||||
|
||||
class ImportEngine {
|
||||
public:
|
||||
static wxString NULL_IMPORT_PATTERN;
|
||||
|
||||
ImportEngine();
|
||||
~ImportEngine();
|
||||
|
||||
|
|
|
@ -59,7 +59,7 @@ AccountPanel::AccountPanel(KissCount* kiss, wxUI *parent) : KissPanel(kiss, pare
|
|||
|
||||
SetSizer(hbox);
|
||||
|
||||
ColorScheme* colorScheme = new ColorScheme(categoryColors, WXSIZEOF(categoryColors));
|
||||
ColorScheme* colorScheme = new ColorScheme(wxUI::categoryColors, WXSIZEOF(wxUI::categoryColors));
|
||||
|
||||
_pie = new PiePlot();
|
||||
_calendar = new wxCalendarCtrl(this, CALENDAR_ID, wxDefaultDateTime, wxDefaultPosition, wxDefaultSize,
|
||||
|
@ -85,7 +85,7 @@ AccountPanel::AccountPanel(KissCount* kiss, wxUI *parent) : KissPanel(kiss, pare
|
|||
_categoriesIndexes[categoryIt->name] = i;
|
||||
}
|
||||
|
||||
nbCategories = (user->GetCategoriesNumber() <= MAX_CATEGORY) ? user->GetCategoriesNumber() : MAX_CATEGORY;
|
||||
nbCategories = (user->GetCategoriesNumber() <= wxUI::MAX_CATEGORY) ? user->GetCategoriesNumber() : wxUI::MAX_CATEGORY;
|
||||
|
||||
_categoriesValues = new double[user->GetCategoriesNumber()];
|
||||
for(i=0; i<user->GetCategoriesNumber(); i++)
|
||||
|
@ -283,7 +283,7 @@ void AccountPanel::ChangeUser()
|
|||
else
|
||||
{
|
||||
curNode = _tree.AppendItem(rootNode, wxString::Format(wxT("%d"), curDate.GetYear()));
|
||||
_tree.AppendItem(curNode, months[(int)curDate.GetYear()]);
|
||||
_tree.AppendItem(curNode, wxUI::months[(int)curDate.GetYear()]);
|
||||
Fit();
|
||||
}
|
||||
}
|
||||
|
@ -316,10 +316,10 @@ void AccountPanel::LoadYear(int year, bool showMonth)
|
|||
if (curMonth == -1 || (year == curDate.GetYear() && *it <= curDate.GetMonth()))
|
||||
{
|
||||
curMonth = *it;
|
||||
curMonthNode = _tree.AppendItem(parentNode, months[*it]);
|
||||
curMonthNode = _tree.AppendItem(parentNode, wxUI::months[*it]);
|
||||
}
|
||||
else
|
||||
_tree.AppendItem(parentNode, months[*it]);
|
||||
_tree.AppendItem(parentNode, wxUI::months[*it]);
|
||||
}
|
||||
|
||||
_tree.Expand(parentNode);
|
||||
|
@ -371,7 +371,7 @@ void AccountPanel::ShowMonth(int month, int year)
|
|||
|
||||
_curYear = year;
|
||||
_curMonth = month;
|
||||
_wxUI->SetTitle(user->_name + wxT(" - ") + months[month] + wxT(" ") + wxString::Format(wxT("%d"), year));
|
||||
_wxUI->SetTitle(user->_name + wxT(" - ") + wxUI::months[month] + wxT(" ") + wxString::Format(wxT("%d"), year));
|
||||
_calendar->Enable(true);
|
||||
|
||||
if (_grid->GetNumberRows() > 1)
|
||||
|
@ -529,7 +529,7 @@ void AccountPanel::UpdateStats()
|
|||
if (!op.transfert.Length() && user->GetCategoryName(op.category) != _("Unknown"))
|
||||
_categoriesValues[_categoriesIndexes[user->GetCategoryName(op.category)]] += -op.amount ;
|
||||
|
||||
if (!op.transfert.Length() || op._virtual)
|
||||
if (!op.transfert.Length())
|
||||
totalDebit += -op.amount;
|
||||
|
||||
if (blocked_account)
|
||||
|
@ -537,7 +537,7 @@ void AccountPanel::UpdateStats()
|
|||
|
||||
if (day >= op.day)
|
||||
{
|
||||
if (!op.transfert.Length() || op._virtual)
|
||||
if (!op.transfert.Length())
|
||||
curDebit += -op.amount;
|
||||
curAccountAmount[op.account] += op.amount;
|
||||
}
|
||||
|
@ -748,7 +748,7 @@ void AccountPanel::OnTreeChange(wxTreeEvent& event)
|
|||
|
||||
monthString = _tree.GetItemText(event.GetItem());
|
||||
for (i=0; i<12; i++)
|
||||
if (monthString == months[i])
|
||||
if (monthString == wxUI::months[i])
|
||||
{
|
||||
month = i;
|
||||
break;
|
||||
|
@ -804,7 +804,7 @@ void AccountPanel::GetTreeSelection(int* month, int* year)
|
|||
|
||||
monthString = _tree.GetItemText(_tree.GetSelection());
|
||||
for (i=0; i<12; i++)
|
||||
if (monthString == months[i])
|
||||
if (monthString == wxUI::months[i])
|
||||
{
|
||||
*month = i;
|
||||
break;
|
||||
|
@ -873,7 +873,7 @@ void AccountPanel::OnMenuDelete(wxCommandEvent& event)
|
|||
|
||||
message = _("Are you sure want to delete ");
|
||||
if (month != -1)
|
||||
message += months[month] + wxT(" ");
|
||||
message += wxUI::months[month] + wxT(" ");
|
||||
message += wxString::Format(wxT("%d"), year);
|
||||
|
||||
message += _(" operations ?");
|
||||
|
@ -920,7 +920,7 @@ void AccountPanel::GenerateMonth(int month, int year)
|
|||
|
||||
root = _tree.GetRootItem();
|
||||
yearString = wxString::Format(wxT("%d"), year);
|
||||
monthString = months[month];
|
||||
monthString = wxUI::months[month];
|
||||
|
||||
ops = _kiss->GetAllOperations();
|
||||
|
||||
|
@ -985,7 +985,7 @@ void AccountPanel::GenerateMonth(int month, int year)
|
|||
void AccountPanel::OnShow(wxShowEvent& event)
|
||||
{
|
||||
if (_curMonth != -1)
|
||||
_wxUI->SetTitle(_kiss->GetUser()->_name + wxT(" - ") + months[_curMonth] + wxT(" ") + wxString::Format(wxT("%d"), _curYear));
|
||||
_wxUI->SetTitle(_kiss->GetUser()->_name + wxT(" - ") + wxUI::months[_curMonth] + wxT(" ") + wxString::Format(wxT("%d"), _curYear));
|
||||
else
|
||||
_wxUI->SetTitle(_kiss->GetUser()->_name);
|
||||
}
|
||||
|
@ -1104,7 +1104,7 @@ void AccountPanel::OnUpdateNextMonths(wxCommandEvent& event)
|
|||
end:
|
||||
if (accounts_updated)
|
||||
{
|
||||
wxString message = _("Accounts updated until ") + months[last_month];
|
||||
wxString message = _("Accounts updated until ") + wxUI::months[last_month];
|
||||
|
||||
message += wxT(" ") + wxString::Format(wxT("%d"), last_year);
|
||||
|
||||
|
|
|
@ -83,7 +83,7 @@ GenerateDialog::GenerateDialog(KissCount* kiss, wxUI *parent, int month, int yea
|
|||
{
|
||||
for(i=0; i<(int)_monthFrom->GetCount(); i++)
|
||||
{
|
||||
if (_monthFrom->GetString(i) == months[month])
|
||||
if (_monthFrom->GetString(i) == wxUI::months[month])
|
||||
{
|
||||
toSelect = i;
|
||||
break;
|
||||
|
@ -158,7 +158,7 @@ void GenerateDialog::OnYearFromChange(wxCommandEvent& event)
|
|||
year = wxAtoi(years);
|
||||
|
||||
for(it=_ops[year].begin(); it!=_ops[year].end(); it++)
|
||||
_monthFrom->Append(months[*it]);
|
||||
_monthFrom->Append(wxUI::months[*it]);
|
||||
_monthFrom->Select(0);
|
||||
|
||||
Layout();
|
||||
|
@ -184,7 +184,7 @@ void GenerateDialog::OnYearToChange(wxCommandEvent& event)
|
|||
}
|
||||
}
|
||||
if (ok)
|
||||
_monthTo->Append(months[i]);
|
||||
_monthTo->Append(wxUI::months[i]);
|
||||
}
|
||||
|
||||
_monthTo->Select(0);
|
||||
|
@ -205,7 +205,7 @@ void GenerateDialog::OnOK(wxCommandEvent& event)
|
|||
{
|
||||
for (i=0; i<12; i++)
|
||||
{
|
||||
if (months[i] == _monthFrom->GetString(_monthFrom->GetCurrentSelection()))
|
||||
if (wxUI::months[i] == _monthFrom->GetString(_monthFrom->GetCurrentSelection()))
|
||||
{
|
||||
monthFrom = i;
|
||||
break;
|
||||
|
@ -216,7 +216,7 @@ void GenerateDialog::OnOK(wxCommandEvent& event)
|
|||
|
||||
for (i=0; i<12; i++)
|
||||
{
|
||||
if (months[i] == _monthTo->GetString(_monthTo->GetCurrentSelection()))
|
||||
if (wxUI::months[i] == _monthTo->GetString(_monthTo->GetCurrentSelection()))
|
||||
{
|
||||
monthTo = i;
|
||||
break;
|
||||
|
|
|
@ -344,7 +344,7 @@ void PreferencesPanel::AddCategory(int line, Category cat)
|
|||
_categoriesGrid->SetReadOnly(line, CATEGORY_FOREGROUND_COLOR, true);
|
||||
_categoriesGrid->SetReadOnly(line, CATEGORY_FONT, true);
|
||||
_categoriesGrid->SetReadOnly(line, CATEGORY_DELETE, true);
|
||||
SET_ROW_COLOR(line, OWN_GREEN, *wxBLACK);
|
||||
SET_ROW_COLOR(line, view::OWN_GREEN, *wxBLACK);
|
||||
|
||||
_categoriesGrid->AutoSizeColumns(true);
|
||||
}
|
||||
|
@ -354,10 +354,10 @@ void PreferencesPanel::InitLanguage(User* user)
|
|||
{
|
||||
int i, select=0;
|
||||
|
||||
for (i=0; i<NB_SUPPORTED_LANGUAGES; i++)
|
||||
for (i=0; i<SupportedLanguages::NB_SUPPORTED_LANGUAGES; i++)
|
||||
{
|
||||
_language->Append(languages[i].name, wxBitmap(languages[i].icon, wxBITMAP_TYPE_PNG));
|
||||
if (languages[i].language == _wxUI->_language)
|
||||
_language->Append(SupportedLanguages::languages[i].name, wxBitmap(SupportedLanguages::languages[i].icon, wxBITMAP_TYPE_PNG));
|
||||
if (SupportedLanguages::languages[i].language == _wxUI->_language)
|
||||
select = i;
|
||||
}
|
||||
|
||||
|
@ -816,7 +816,7 @@ void PreferencesPanel::OnOperationOrderChange(wxCommandEvent& event)
|
|||
|
||||
void PreferencesPanel::OnLanguageChange(wxCommandEvent& event)
|
||||
{
|
||||
wxLanguage language = languages[_language->GetSelection()].language;
|
||||
wxLanguage language = SupportedLanguages::languages[_language->GetSelection()].language;
|
||||
if (_wxUI->SetLanguage(language) || language == wxLANGUAGE_ENGLISH)
|
||||
{
|
||||
_wxUI->NeedReload();
|
||||
|
|
|
@ -183,10 +183,10 @@ std::vector<Operation> * SearchBanner::Search()
|
|||
if (_category->IsChecked(i))
|
||||
categories.push_back((i) ? user->_categories[i-1].id : wxT("0"));
|
||||
|
||||
types |= (_optype->IsChecked(0)) ? FIX_OP : 0;
|
||||
types |= (_optype->IsChecked(1)) ? NON_FIX_OP : 0;
|
||||
types |= (_optype->IsChecked(2)) ? CHECKED_OP : 0;
|
||||
types |= (_optype->IsChecked(3)) ? NOT_CHECKED_OP : 0;
|
||||
types |= (_optype->IsChecked(0)) ? Database::FIX_OP : 0;
|
||||
types |= (_optype->IsChecked(1)) ? Database::NON_FIX_OP : 0;
|
||||
types |= (_optype->IsChecked(2)) ? Database::CHECKED_OP : 0;
|
||||
types |= (_optype->IsChecked(3)) ? Database::NOT_CHECKED_OP : 0;
|
||||
|
||||
for(i=0; i<user->GetAccountsNumber(); i++)
|
||||
if (_account->IsChecked(i))
|
||||
|
|
|
@ -42,9 +42,9 @@ StatsPanel::StatsPanel(KissCount* kiss, wxUI *parent) : KissPanel(kiss, parent),
|
|||
|
||||
SetSizer(vbox);
|
||||
|
||||
_monthFrom = new wxChoice (this, RANGE_ID, wxDefaultPosition, wxDefaultSize, 12, months);
|
||||
_monthFrom = new wxChoice (this, RANGE_ID, wxDefaultPosition, wxDefaultSize, 12, wxUI::months);
|
||||
_yearFrom = new wxChoice (this, RANGE_ID);
|
||||
_monthTo = new wxChoice (this, RANGE_ID, wxDefaultPosition, wxDefaultSize, 12, months);
|
||||
_monthTo = new wxChoice (this, RANGE_ID, wxDefaultPosition, wxDefaultSize, 12, wxUI::months);
|
||||
_yearTo = new wxChoice (this, RANGE_ID);
|
||||
|
||||
operations = _kiss->GetAllOperations();
|
||||
|
@ -122,10 +122,10 @@ StatsPanel::StatsPanel(KissCount* kiss, wxUI *parent) : KissPanel(kiss, parent),
|
|||
|
||||
_pie = new PiePlot();
|
||||
|
||||
nbCategories = (user->GetCategoriesNumber() <= MAX_CATEGORY) ? user->GetCategoriesNumber() : MAX_CATEGORY;
|
||||
nbCategories = (user->GetCategoriesNumber() <= wxUI::MAX_CATEGORY) ? user->GetCategoriesNumber() : wxUI::MAX_CATEGORY;
|
||||
|
||||
_dataset = new CategorySimpleDataset(_categories, nbCategories);
|
||||
ColorScheme* colorScheme = new ColorScheme(categoryColors, WXSIZEOF(categoryColors));
|
||||
ColorScheme* colorScheme = new ColorScheme(wxUI::categoryColors, WXSIZEOF(wxUI::categoryColors));
|
||||
|
||||
_categoriesValues = new double[user->GetCategoriesNumber()];
|
||||
for(i=0; i<user->GetCategoriesNumber(); i++)
|
||||
|
|
|
@ -1,26 +0,0 @@
|
|||
/*
|
||||
Copyright 2010-2011 Grégory Soutadé
|
||||
|
||||
This file is part of KissCount.
|
||||
|
||||
KissCount is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
KissCount is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with KissCount. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "SupportedLanguages.h"
|
||||
|
||||
language languages[NB_SUPPORTED_LANGUAGES] = {
|
||||
{ wxT("English"), wxT(ICONS_PATH "/United Kingdom.png"), wxLANGUAGE_ENGLISH},
|
||||
{ wxT("Français"), wxT(ICONS_PATH "/France.png"), wxLANGUAGE_FRENCH}
|
||||
};
|
||||
|
|
@ -22,15 +22,22 @@
|
|||
|
||||
#include <wx/wx.h>
|
||||
|
||||
namespace SupportedLanguages {
|
||||
#define ICONS_PATH RESSOURCES_ROOT "icons/"
|
||||
|
||||
typedef struct {
|
||||
wxString name;
|
||||
wxString icon;
|
||||
wxLanguage language;
|
||||
} language ;
|
||||
|
||||
#define NB_SUPPORTED_LANGUAGES 2
|
||||
#define ICONS_PATH RESSOURCES_ROOT "icons/"
|
||||
const int NB_SUPPORTED_LANGUAGES = 2;
|
||||
|
||||
static const language languages[NB_SUPPORTED_LANGUAGES] = {
|
||||
{ wxT("English"), wxT(ICONS_PATH "/United Kingdom.png"), wxLANGUAGE_ENGLISH},
|
||||
{ wxT("Français"), wxT(ICONS_PATH "/France.png"), wxLANGUAGE_FRENCH}
|
||||
};
|
||||
}
|
||||
|
||||
extern language languages[NB_SUPPORTED_LANGUAGES];
|
||||
|
||||
#endif
|
||||
|
|
|
@ -64,7 +64,7 @@ GridAccount::GridAccount(KissCount* kiss, wxWindow *parent, wxWindowID id,
|
|||
for(i=0; i<NUMBER_COLS_OPS; i++)
|
||||
{
|
||||
SetCellValue(0, i, colsName[i]);
|
||||
SetCellBackgroundColour(0, i, OWN_CYAN);
|
||||
SetCellBackgroundColour(0, i, view::OWN_CYAN);
|
||||
SetCellFont(0, i, font);
|
||||
SetReadOnly(0, i, true);
|
||||
SetCellAlignment(0, i, wxALIGN_CENTRE, wxALIGN_CENTRE);
|
||||
|
@ -372,7 +372,7 @@ void GridAccount::InsertOperation(User* user, Operation& op, int line, bool fix,
|
|||
if (op.category.Length())
|
||||
color = cat.backcolor;
|
||||
else
|
||||
color = OWN_GREEN;
|
||||
color = view::OWN_GREEN;
|
||||
|
||||
if (op.checked)
|
||||
{
|
||||
|
@ -421,11 +421,11 @@ void GridAccount::InsertOperation(User* user, Operation& op, int line, bool fix,
|
|||
|
||||
if (fix)
|
||||
{
|
||||
SET_ROW_COLOR(line, OWN_YELLOW, *wxBLACK);
|
||||
SET_ROW_COLOR(line, view::OWN_YELLOW, *wxBLACK);
|
||||
}
|
||||
else
|
||||
{
|
||||
SET_ROW_COLOR(line, OWN_GREEN, *wxBLACK);
|
||||
SET_ROW_COLOR(line, view::OWN_GREEN, *wxBLACK);
|
||||
}
|
||||
|
||||
SetReadOnly(line, CHECKED, true);
|
||||
|
@ -962,7 +962,7 @@ void GridAccount::OnOperationModified(wxGridEvent& event)
|
|||
|
||||
DEFAULT_FONT(font);
|
||||
|
||||
SET_ROW_COLOR(row, OWN_YELLOW, *wxBLACK);
|
||||
SET_ROW_COLOR(row, view::OWN_YELLOW, *wxBLACK);
|
||||
SET_ROW_FONT(row, font);
|
||||
|
||||
new_op.id = _kiss->AddOperation(new_op);
|
||||
|
@ -1061,7 +1061,7 @@ void GridAccount::OnOperationModified(wxGridEvent& event)
|
|||
|
||||
DEFAULT_FONT(font);
|
||||
|
||||
SET_ROW_COLOR(row, OWN_GREEN, *wxBLACK);
|
||||
SET_ROW_COLOR(row, view::OWN_GREEN, *wxBLACK);
|
||||
SET_ROW_FONT(row, font);
|
||||
|
||||
new_op.id = _kiss->AddOperation(new_op);
|
||||
|
@ -1093,7 +1093,7 @@ void GridAccount::OnOperationModified(wxGridEvent& event)
|
|||
if (new_op.category.Length())
|
||||
color = cat.backcolor;
|
||||
else
|
||||
color = OWN_GREEN;
|
||||
color = view::OWN_GREEN;
|
||||
|
||||
if (new_op.checked)
|
||||
{
|
||||
|
|
|
@ -20,13 +20,15 @@
|
|||
#ifndef VIEW_H
|
||||
#define VIEW_H
|
||||
|
||||
#define OWN_CYAN wxColour(0x99, 0xCC, 0xFF)
|
||||
#define OWN_YELLOW wxColour(0xFF, 0xFF, 0x99)
|
||||
#define OWN_GREEN wxColour(0x3D, 0xEB, 0x3D)
|
||||
namespace view {
|
||||
const wxColour OWN_CYAN(0x99, 0xCC, 0xFF);
|
||||
const wxColour OWN_YELLOW(0xFF, 0xFF, 0x99);
|
||||
const wxColour OWN_GREEN(0x3D, 0xEB, 0x3D);
|
||||
const wxString DEFAULT_FONT_NAME(wxT("Liberation Sans"));
|
||||
const int DEFAULT_FONT_SIZE = 12;
|
||||
|
||||
#define DEFAULT_FONT_NAME wxT("Liberation Sans")
|
||||
#define DEFAULT_FONT_SIZE 12
|
||||
#define DEFAULT_FONT(font_name) wxFont font_name(DEFAULT_FONT_SIZE, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL, false, DEFAULT_FONT_NAME);
|
||||
#define DEFAULT_FONT(font_name) wxFont font_name(view::DEFAULT_FONT_SIZE, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL, false, view::DEFAULT_FONT_NAME);
|
||||
};
|
||||
|
||||
#define DELETE_ICON RESSOURCES_ROOT "icons/process-stop.png"
|
||||
#define CHECKED_ICON RESSOURCES_ROOT "icons/tick-icon.png"
|
||||
|
|
|
@ -27,8 +27,8 @@ EVT_BUTTON(BUTTON_ABOUT_ID, wxUI::OnButtonAbout)
|
|||
EVT_BUTTON(BUTTON_QUIT_ID, wxUI::OnButtonQuit)
|
||||
END_EVENT_TABLE()
|
||||
|
||||
wxString months[12] ;
|
||||
wxColour categoryColors[MAX_CATEGORY] = {wxColour(0x00, 0x45, 0x86),
|
||||
wxString wxUI::months[12] ;
|
||||
wxColour wxUI::categoryColors[MAX_CATEGORY] = {wxColour(0x00, 0x45, 0x86),
|
||||
wxColour(0xFF, 0x3E, 0x0E),
|
||||
wxColour(0xFF, 0xD3, 0x20),
|
||||
wxColour(0x58, 0x9D, 0x1B),
|
||||
|
|
|
@ -46,14 +46,12 @@ class KissCount;
|
|||
class AccountPanel;
|
||||
class PreferencesPanel;
|
||||
|
||||
extern wxString months[12];
|
||||
extern wxColour categoryColors[12];
|
||||
|
||||
#define MAX_CATEGORY 12
|
||||
|
||||
class wxUI: public wxFrame
|
||||
{
|
||||
public:
|
||||
static const int MAX_CATEGORY = 12;
|
||||
static wxString months[MAX_CATEGORY];
|
||||
static wxColour categoryColors[MAX_CATEGORY];
|
||||
|
||||
wxUI(KissCount* kiss, const wxString& title, const wxPoint& pos, const wxSize& size);
|
||||
~wxUI();
|
||||
|
|
Loading…
Reference in New Issue
Block a user