KissCount/src/view/PreferencesPanel.hpp

99 lines
3.1 KiB
C++
Raw Normal View History

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>
2017-10-15 11:36:27 +02:00
#include <QListWidgetItem>
#include <QTableWidget>
#include <QComboBox>
#include <QSpinBox>
2011-12-18 13:51:04 +01:00
#include "SupportedLanguages.hpp"
#include "view.hpp"
#include <model/model.hpp>
class PreferencesPanel: public KissPanel
{
Q_OBJECT;
public:
PreferencesPanel(KissCount* kiss, wxUI *parent, bool lowResolution);
2011-12-18 13:51:04 +01:00
KissPanel* CreatePanel();
QString GetToolTip();
void OnShow();
void ChangeUser();
private slots:
void OnAccountDefaultClicked(int id);
void OnAccountVirtualClicked(int id);
void OnAccountBlockedClicked(int id);
void OnAccountDeleteClicked(int id);
2012-02-01 12:43:43 +01:00
void OnAccountHiddenClicked(int id);
2011-12-18 13:51:04 +01:00
void OnCategoryDeleteClicked(int id);
2014-11-10 11:54:28 +01:00
void OnTagDeleteClicked(int id);
2011-12-18 13:51:04 +01:00
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 OnSharedChanged(QListWidgetItem *item);
void OnCategoryModified(int row, int col);
2014-11-10 11:54:28 +01:00
void OnTagModified(int row, int col);
2011-12-18 13:51:04 +01:00
void OnChangeName();
void OnChangePassword();
void OnOperationOrderChanged(int index);
void OnLanguageChanged(int);
2011-12-18 13:51:04 +01:00
void OnKillMe();
void OnAccountLimitChanged(int val);
void OnAccountLimitColorClicked(void);
2011-12-18 13:51:04 +01:00
private:
QTableWidget* _accountsGrid;
QTableWidget* _categoriesGrid;
2014-11-10 11:54:28 +01:00
QTableWidget* _tagsGrid;
2011-12-18 13:51:04 +01:00
QLineEdit* _name;
QListWidget* _language;
QComboBox* _operationOrder;
QSpinBox* _accountLimit;
2011-12-18 13:51:04 +01:00
QListWidget* _sharedWith;
int _curAccountRow;
std::map<QString, QString> _sharedOwners;
2014-11-10 11:54:28 +01:00
QSignalMapper _defaultSignalMapper, _virtualSignalMapper, _blockedSignalMapper, _deleteAccountSignalMapper, _hiddenAccountSignalMapper, _deleteCategorySignalMapper, _deleteTagSignalMapper, _backgroundColorSignalMapper, _foregroundColorSignalMapper, _fontSignalMapper;
2011-12-18 13:51:04 +01:00
bool _inModification;
2011-12-18 13:51:04 +01:00
void InitAccounts(User* user);
void InitCategories(User* user);
2014-11-10 11:54:28 +01:00
void InitTags(User* user);
2011-12-18 13:51:04 +01:00
void InitLanguage(User* user);
void InitOperationOrder(User* user);
void InsertCenteredWidget(QTableWidget* table, int line, int column,
QWidget* widget, int margins=3);
QWidget* GetCenteredWidget(QTableWidget* table, int line, int column);
2011-12-18 13:51:04 +01:00
void AddAccount(int line, Account ac);
void AddCategory(int line, Category cat);
2014-11-10 11:54:28 +01:00
void AddTag(int line, Tag tag);
2011-12-18 13:51:04 +01:00
};
#endif