// Copyright (C) 2009 by Arnaud Dupuis // a.dupuis@infinityperl.org // http://www.infinityperl.org // // This program 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. // // This program 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 this program; if not, write to the // Free Software Foundation, Inc., // 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA #ifndef ASSUMACONFIGWIDGET_H #define ASSUMACONFIGWIDGET_H #include <QtGui/QTabWidget> #include <QtCore/QMutex> #include "ui_assuma_configwidget.h" #include "assuma_configmanager.h" class QString; class QHttp; class AssumaAddonInstance; /*! \class AssumaConfigWidget * \brief The configuration widget of the application. * * This class is the configuration widget used by Association Subscribers Manager. * It is not very probable that you have to use this class in your own programs since it * is completly designed for the Association Subscribers Manager main window. * In the other hand you will certainly need to use the public API of this class. * AssumaConfigWidget inherits from QTabWidget. */ class AssumaConfigWidget : public QTabWidget, public Ui::AssumaConfigWidget{ Q_OBJECT public: // enum Severity { // Info, // Critical, // Warning // }; //! Configuration token enumeration. /*! This enum contains all configuration tokens. * Configuration tokens are used with the getConfigToken() and setConfigToken() functions. * \sa setConfigToken getConfigToken */ // enum Token { // TrimesterCount = 1, // StaticCost = 2, // Federation = 3, // UpdateServer = 4, // UpdatesOnStart = 5, // Currency = 6, // CurrenciesList = 7, // ContactsList = 8, // CoursesList = 9, // Language = 10, // Encoding = 11, // AssociationName = 12, // Email = 13, // SmtpServer = 14, // SmtpLogin = 15, // SmtpPassword = 16, // ProxyServer = 17, // ProxyLogin = 18, // ProxyPassword = 19, // ProxyEnabled = 20, // DataDir = 21, // FederationList = 22, // LanguageList = 23, // Country = 24, // ActivatedAddonList = 25, // Theme = 26, // }; QTranslator *translator; AssumaConfigWidget(QWidget *parent = 0); QString getConfigToken(AssumaConfigManager::Token); public slots: void setConfigToken(AssumaConfigManager::Token, QString); // void addActivity(const QString); void updateAddonList(); void setLoadedAddonsList(QList<AssumaAddonInstance*>); void loadThemeList( const QString & ); void loadTheme( const QString & themeName = "default" ); signals: void configMessage( const QString & , AssumaConfigManager::Severity ); void languageChanged( const QString & ); void themeChanged( const QString & ); private: QMutex m_mutex; QString escapeXml( const QString & ); bool removeDirectory(const QString &); bool saveCurrentFederation(); QHttp *http; int passwordCheckId; QList<AssumaAddonInstance*> _addonsList; bool m_dontUpdateToken; bool m_isInitializing ; private slots: // Slots about config manager forwarding void on_emailLineEdit_textChanged(const QString &); void on_updateServerLineEdit_textChanged(const QString & ); void on_checkUpdatesOnStartCheckBox_stateChanged ( int ); void on_languageComboBox_currentIndexChanged ( const QString & ); void on_encodingComboBox_currentIndexChanged ( const QString & ); void on_smtpServerEdit_textChanged(const QString & ); void on_smtpServerLoginEdit_textChanged(const QString & ); void on_smtpServerPasswordEdit_textChanged(const QString & ); void on_proxyServerLineEdit_textChanged(const QString & ); void on_proxyLoginLineEdit_textChanged(const QString & ); void on_proxyPasswordLineEdit_textChanged(const QString & ); void on_proxyGroupBox_toggled ( bool ); void on_dataDirLineEdit_textChanged(const QString & ); void on_citiesComboBox_currentIndexChanged ( const QString & ); void on_addonListTreeWidget_itemChanged ( QTreeWidgetItem * , int ); void on_currencyComboBox_currentIndexChanged ( const QString & ); void on_themeComboBox_currentIndexChanged ( const QString & ); // Other management private slots void updateConfiguration( AssumaConfigManager::Token, const QVariant & ); void currentTabChanged(int); void on_languageComboBox_currentIndexChanged ( int ); void on_dataDirToolButton_clicked(); void on_deleteAddonPushButton_clicked(); void on_cancelAddonDeletionButton_clicked(); void on_confirmAddonDeletionButton_clicked(); void on_addCurrencyToolButton_clicked(); void on_removeCurrencyToolButton_clicked(); }; #endif