2011-12-18 13:51:04 +01:00
|
|
|
/*
|
2012-02-01 11:02:54 +01:00
|
|
|
Copyright 2010-2012 Grégory Soutadé
|
2011-12-18 13:51:04 +01: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 PREFERENCESPANEL_H
|
|
|
|
#define PREFERENCESPANEL_H
|
|
|
|
|
|
|
|
#include <QtGui>
|
|
|
|
|
|
|
|
#include "SupportedLanguages.hpp"
|
|
|
|
#include "view.hpp"
|
|
|
|
#include <model/model.hpp>
|
|
|
|
|
|
|
|
class PreferencesPanel: public KissPanel
|
|
|
|
{
|
|
|
|
Q_OBJECT;
|
|
|
|
|
|
|
|
public:
|
|
|
|
PreferencesPanel(KissCount* kiss, wxUI *parent);
|
|
|
|
|
|
|
|
KissPanel* CreatePanel();
|
|
|
|
QPushButton* GetButton();
|
|
|
|
QString GetToolTip();
|
|
|
|
void OnShow();
|
|
|
|
|
|
|
|
void ChangeUser();
|
|
|
|
|
|
|
|
private slots:
|
|
|
|
void OnAccountDefaultClicked(int id);
|
|
|
|
void OnAccountVirtualClicked(int id);
|
|
|
|
void OnAccountBlockedClicked(int id);
|
|
|
|
void OnAccountDeleteClicked(int id);
|
|
|
|
void OnCategoryDeleteClicked(int id);
|
|
|
|
void OnBackgroundColorClicked(int id);
|
|
|
|
void OnForegroundClicked(int id);
|
|
|
|
void OnFontClicked(int id);
|
|
|
|
void OnAccountModified(int row, int col);
|
|
|
|
void OnAccountCellChanged(int row, int col, int, int);
|
|
|
|
void OnSharedChange(QListWidgetItem *item);
|
2012-01-07 09:21:22 +01:00
|
|
|
void OnCategoryModified(int row, int col);
|
2011-12-18 13:51:04 +01:00
|
|
|
void OnChangeName();
|
|
|
|
void OnChangePassword();
|
|
|
|
void OnOperationOrderChange(int index);
|
|
|
|
void OnLanguageChange();
|
|
|
|
void OnKillMe();
|
|
|
|
|
|
|
|
private:
|
|
|
|
QTableWidget* _accountsGrid;
|
|
|
|
QTableWidget* _categoriesGrid;
|
|
|
|
QLineEdit* _name;
|
|
|
|
QListWidget* _language;
|
|
|
|
QComboBox* _operationOrder;
|
|
|
|
QListWidget* _sharedWith;
|
|
|
|
int _curAccountRow;
|
|
|
|
std::map<QString, QString> _sharedOwners;
|
|
|
|
QSignalMapper _defaultSignalMapper, _virtualSignalMapper, _blockedSignalMapper, _deleteAccountSignalMapper, _deleteCategorySignalMapper, _backgroundColorSignalMapper, _foregroundColorSignalMapper, _fontSignalMapper;
|
|
|
|
bool _inModification;
|
|
|
|
void InitAccounts(User* user);
|
|
|
|
void InitCategories(User* user);
|
|
|
|
void InitLanguage(User* user);
|
|
|
|
void InitOperationOrder(User* user);
|
|
|
|
|
|
|
|
void AddAccount(int line, Account ac);
|
|
|
|
void AddCategory(int line, Category cat);
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|