2011-09-04 19:25:53 +02:00
|
|
|
/*
|
2012-02-01 11:02:54 +01:00
|
|
|
Copyright 2010-2012 Grégory Soutadé
|
2011-09-04 19:25:53 +02:00
|
|
|
|
|
|
|
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/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef ACCOUNTPANEL_H
|
|
|
|
#define ACCOUNTPANEL_H
|
|
|
|
|
2011-09-04 21:01:32 +02:00
|
|
|
#include <QTreeWidget>
|
2011-09-06 19:47:02 +02:00
|
|
|
#include <QCalendarWidget>
|
2011-09-13 21:39:22 +02:00
|
|
|
#include <QTableWidget>
|
|
|
|
#include <QRadioButton>
|
2011-09-21 20:47:54 +02:00
|
|
|
#include <QStandardItemModel>
|
2011-09-04 21:01:32 +02:00
|
|
|
|
2011-09-04 19:25:53 +02:00
|
|
|
#include "view.hpp"
|
|
|
|
|
|
|
|
#include <model/model.hpp>
|
2011-10-20 11:11:59 +02:00
|
|
|
#include "grid/GridAccount.hpp"
|
2013-02-26 12:17:35 +01:00
|
|
|
#include "CostRepartitionBanner.hpp"
|
2011-09-04 19:25:53 +02:00
|
|
|
|
|
|
|
class GridAccount;
|
|
|
|
|
|
|
|
class AccountPanel: public KissPanel
|
|
|
|
{
|
|
|
|
Q_OBJECT;
|
|
|
|
|
|
|
|
public:
|
2012-06-29 20:33:33 +02:00
|
|
|
AccountPanel(KissCount* kiss, wxUI *parent, bool lowResolution);
|
|
|
|
AccountPanel(KissCount* kiss, wxUI *parent, bool lowResolution, int month, int year, int mode);
|
2011-09-04 19:25:53 +02:00
|
|
|
~AccountPanel();
|
|
|
|
|
2012-06-29 20:33:33 +02:00
|
|
|
void Init(KissCount* kiss, wxUI *parent, int curMode);
|
|
|
|
|
2011-09-04 19:25:53 +02:00
|
|
|
KissPanel* CreatePanel();
|
|
|
|
QString GetToolTip();
|
|
|
|
void OnShow();
|
|
|
|
|
|
|
|
void ChangeUser();
|
|
|
|
void LoadYear(int year, bool showMonth=true);
|
|
|
|
void ShowMonth(int month, int year);
|
|
|
|
void GenerateMonth(int month, int year);
|
2011-11-01 18:01:17 +01:00
|
|
|
void UpdateStats();
|
2011-09-04 19:25:53 +02:00
|
|
|
|
2011-09-21 20:47:54 +02:00
|
|
|
int _curMonth, _curYear;
|
|
|
|
|
|
|
|
private slots:
|
2011-09-04 19:25:53 +02:00
|
|
|
void OnOperationModified();
|
2011-10-30 09:27:03 +01:00
|
|
|
void OnAccountModified(int row, int column);
|
2011-10-31 09:15:37 +01:00
|
|
|
void OnTreeRightClick(const QPoint & pos);
|
2011-10-24 21:05:12 +02:00
|
|
|
void OnTreeChange (QTreeWidgetItem * item, int column);
|
2011-09-04 19:25:53 +02:00
|
|
|
void OnMenuGenerate();
|
|
|
|
void OnMenuDelete();
|
|
|
|
void OnCalendarChange();
|
|
|
|
void OnModeChange();
|
|
|
|
void OnGroup();
|
|
|
|
void OnUnGroup();
|
|
|
|
void OnUpdateNextMonths();
|
2012-03-20 20:57:45 +01:00
|
|
|
void OnSnapshots();
|
2011-09-04 19:25:53 +02:00
|
|
|
|
|
|
|
private:
|
2011-09-04 21:01:32 +02:00
|
|
|
QTreeWidget *_tree;
|
2011-09-06 19:47:02 +02:00
|
|
|
QCalendarWidget* _calendar;
|
2011-10-20 11:11:59 +02:00
|
|
|
GridAccount* _grid;
|
2011-09-13 21:39:22 +02:00
|
|
|
QTableWidget* _accountsGrid, *_statsGrid;
|
2013-02-26 12:17:35 +01:00
|
|
|
CostRepartitionBanner* _costRepartitionBanner;
|
2012-04-30 21:15:51 +02:00
|
|
|
int *_categoriesValues;
|
2011-09-04 19:25:53 +02:00
|
|
|
// wxRadioBox *_radioMode;
|
|
|
|
std::map<QString, int> _categoriesIndexes;
|
|
|
|
std::vector<Operation>* _curOperations;
|
|
|
|
QString* _categories, *_accounts;
|
2012-04-30 21:15:51 +02:00
|
|
|
std::map<int, int> _accountsInitValues;
|
2011-09-04 19:25:53 +02:00
|
|
|
int _fixCosts;
|
2011-09-13 21:39:22 +02:00
|
|
|
QRadioButton *_virtual, *_real, *_check;
|
2011-11-01 18:01:17 +01:00
|
|
|
bool _inModification;
|
2011-09-04 19:25:53 +02:00
|
|
|
|
|
|
|
void InitStatsGrid(User* user);
|
|
|
|
void InitAccountsGrid(User* user, int month, int year);
|
|
|
|
void InsertOperation(User* user, Operation* op, int line, bool fix);
|
|
|
|
void GetTreeSelection(int* month, int* year);
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|