/*
Copyright 2010-2012 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 .
*/
#ifndef PREFERENCESPANEL_H
#define PREFERENCESPANEL_H
#include
#include "SupportedLanguages.hpp"
#include "view.hpp"
#include
class PreferencesPanel: public KissPanel
{
Q_OBJECT;
public:
PreferencesPanel(KissCount* kiss, wxUI *parent, bool lowResolution);
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);
void OnAccountHiddenClicked(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);
void OnCategoryModified(int row, int col);
void OnChangeName();
void OnChangePassword();
void OnOperationOrderChange(int index);
void OnLanguageChange(int);
void OnKillMe();
private:
QTableWidget* _accountsGrid;
QTableWidget* _categoriesGrid;
QLineEdit* _name;
QListWidget* _language;
QComboBox* _operationOrder;
QListWidget* _sharedWith;
int _curAccountRow;
std::map _sharedOwners;
QSignalMapper _defaultSignalMapper, _virtualSignalMapper, _blockedSignalMapper, _deleteAccountSignalMapper, _hiddenAccountSignalMapper, _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