QSapecNG
 All Classes Functions Enumerations Properties
configpage.h
00001 /*
00002     QSapecNG - Qt based SapecNG GUI front-end
00003     Copyright (C) 2009, Michele Caini
00004 
00005     This program is free software: you can redistribute it and/or modify
00006     it under the terms of the GNU General Public License as published by
00007     the Free Software Foundation, either version 3 of the License, or
00008     (at your option) any later version.
00009 
00010     This program is distributed in the hope that it will be useful,
00011     but WITHOUT ANY WARRANTY; without even the implied warranty of
00012     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013     GNU General Public License for more details.
00014 
00015     You should have received a copy of the GNU General Public License
00016     along with this program.  If not, see <http://www.gnu.org/licenses/>.
00017 */
00018 
00019 
00020 #ifndef CONFIGPAGE_H
00021 #define CONFIGPAGE_H
00022 
00023 
00024 #include <QtGui/QWidget>
00025 
00026 
00027 class QComboBox;
00028 class QFontDialog;
00029 class QPushButton;
00030 
00031 class QSignalMapper;
00032 
00033 
00034 namespace qsapecng
00035 {
00036 
00037 
00038 class ConfigPage: public QWidget
00039 {
00040 
00041   Q_OBJECT
00042 
00043 public:
00044   ConfigPage(QWidget* parent = 0)
00045     : QWidget(parent) { setWindowTitle("[*]"); }
00046 
00047   void setPageModified(bool modified)
00048     { setWindowModified(modified); }
00049   bool isPageModified()
00050     { return isWindowModified(); }
00051 
00052   virtual void apply() = 0;
00053 
00054 };
00055 
00056 
00057 class GeneralPage: public ConfigPage
00058 {
00059 
00060   Q_OBJECT
00061 
00062 public:
00063   GeneralPage(QWidget* parent = 0);
00064 
00065   void apply();
00066 
00067 private slots:
00068   void changeColor(int id);
00069   void levelChanged();
00070 
00071 private:
00072   QComboBox* logLevel_;
00073 
00074   QSignalMapper* colorMapper_;
00075   QPushButton* debugColor_;
00076   QPushButton* infoColor_;
00077   QPushButton* warningColor_;
00078   QPushButton* errorColor_;
00079   QPushButton* fatalColor_;
00080 
00081 };
00082 
00083 
00084 class FontPage: public ConfigPage
00085 {
00086 
00087   Q_OBJECT
00088 
00089 public:
00090   FontPage(QWidget* parent = 0);
00091 
00092   void apply();
00093 
00094 private slots:
00095   void currentFontChanged();
00096 
00097 private:
00098   QFontDialog* fontPage_;
00099 
00100 };
00101 
00102 
00103 }
00104 
00105 
00106 #endif // CONFIGDIALOG_H
 All Classes Functions Enumerations Properties