diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-02-19 18:17:02 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-02-19 18:17:02 +0000 |
commit | f867212c1762e156553d039319b904a17f7b563d (patch) | |
tree | 461c1a743b3ff8291e03360742dbbfb4cc0087e4 /src/knutprefdlg.h | |
download | knutclient-f867212c1762e156553d039319b904a17f7b563d.tar.gz knutclient-f867212c1762e156553d039319b904a17f7b563d.zip |
Added KDE3 version of knutclient
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/knutclient@1092914 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/knutprefdlg.h')
-rw-r--r-- | src/knutprefdlg.h | 359 |
1 files changed, 359 insertions, 0 deletions
diff --git a/src/knutprefdlg.h b/src/knutprefdlg.h new file mode 100644 index 0000000..0628abd --- /dev/null +++ b/src/knutprefdlg.h @@ -0,0 +1,359 @@ +/*************************************************************************** + knutprefdlg.h - description + ------------------- + begin : Tue Aug 21 2001 + copyright : (C) 2001 by Daniel Prynych + email : Daniel.Prynych@alo.cz + ***************************************************************************/ + +/*************************************************************************** + * * + * 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 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifndef KNUTPREFDLG_H +#define KNUTPREFDLG_H + +#include "knutnewupsdlg.h" +#include "knutupsdata.h" +#include "knutvardata.h" +#include "knutconst.h" + + +#include <kdialogbase.h> +#include <kpushbutton.h> +#include <klistbox.h> +#include <klocale.h> +#include <kfontdialog.h> +#include <kcolorbtn.h> +#include <kcombobox.h> + +#include <qwidget.h> + +class QLabel; +class QFont; +class QCheckBox; +class QRadioButton; +class QSpinBox; + + +/** + *@author Daniel Prynych + */ + +/** + * This class makes configure dialog + * Tato trida je vytvari konfiguracni dialog. + * @author Daniel Prynych + * @short Konfiguracni dialog + * @version 0.8 + */ +class KNutPrefDlg : public KDialogBase +{ + Q_OBJECT + public: + +enum changePref { + ChangeCountCols = 0x1, //1, + ChangeCustomBColor = 0x2, //2, + ChangeMBColor = 0x4, //4, + ChangeVoltage = 0x8, // 8, + ChangeFrequency = 0x10, // 16, + ChangeXFer = 0x20, // 32, + + ChangeUpsSetting = 0x40, // 64, + ChangeUpsCount = 0x80, // 128, + + ChangeMainPanelSetting = 0x100, // 256, + ChangeCustomMPanelBColor = 0x200, // 512, + ChangeMPBColor = 0x400, // 1024, + + ChangeAnalogFont = 0x800, // 2048, + ChangePanelFont = 0x1000, // 4096, + + ChangeCustomAPanelBColor = 0x2000, // 8192, + ChangeAPBColor = 0x4000, // 16384, + + ChangeCustomAPanelOColor = 0x8000, // 32768, + ChangeAPOColor = 0x10000, // 65536, + + ChangeCustomKIconColor = 0x20000, // 131072, + ChangeKIconBColor = 0x40000, // 262144, + + ChangeToolTip = 0x80000, // 524288, + + ChangeTypeOfKIcon = 0x100000, // 1048576 + + ChangeTypeOfDigProcessing = 0x200000, // 1048576 *2 + + ChangeSomeThing = 0x400000 // 1048576 *4 + + + }; + + + + +/** + * Constructor makes configure dialog. + * Konstruktor vytvori konfiguracni dialog. + * + * @param upsData Is pointer on instance of class of KNutUpsData, which manage informations about UPSes. + * @param analogData Is pointer on instance of class of KNutVarData, which manages data about analog panels. + * @param settingData Is pointer on struct, which contain values is setted in dialog. + * @param upsName Is name of active UPS. + * + * @param upsData Je odkaz na instanci tridy KNutUpsData, ktera spravuje informace o UPS-kach. + * @param analogData Je odkaz na na instanci tridy KNutVarData, ktera spravuje data o analogovych panelech. + * @param settingData Je odkaz na strukturu ktera obsahuje hodnoty nastavovane v dialogu. + * @param upsName Je jmeno aktivni UPS-ky. + * + * @since 0.5 + **/ + KNutPrefDlg(KNutUpsData* const upsData, KNutVarData* const analogData, KNutVarData::SettingDataDef* const settingData, const QString upsName, QWidget* parent = 0, const char* name = 0, const bool modal = true); + +/** + * @since 0.3 + **/ + ~KNutPrefDlg(); + + signals: + +/** + * Signal is emited when statement is changed same pages. + * Signal je aktivovan pokud je zmenen udaj na kterekoliv strance. + * + * @param changeSetting Declare, what item was changed. + * @param changeSetting Udava, ktery prvek byl zmenen. + * + * @since 0.2 + **/ + void signalChangeConfig (unsigned int changeSetting ); + + + + private slots: + +/** + * @internal + */ + virtual void slotDefault(); + +/** + * @internal + */ + virtual void slotApply(); + +/** + * @internal + */ + virtual void slotOk(); + +/** + * @internal + */ + void slotChangeSettingFont(int index); + +/** + * @internal + */ + void slotSetPictureKI (bool on); + + +/** + * @internal + */ + void slotEnableVoltage(bool enable); + + +/** + * @internal + */ + void slotEnableFrequency(bool enable); + + +/** + * @internal + */ + void slotUseCustomBColor(bool enable); + +/** + * @internal + */ + void slotUseCustomBPanelColor(bool enable); + +/** + * @internal + */ +void slotUseCustomBAnalogColor(bool enable); + + +/** + * @internal + */ +void slotUseCustomOAnalogColor(bool enable); + +/** + * @internal + */ +void slotUseCustomBIconColor(bool enable); + + +/** + * @internal + */ + void slotNewUps(); + +/** + * @internal + */ + void slotEditUps(); + +/** + * @internal + */ + void slotDeleteUps(); + + + private: + + enum Page { + mainSettingPage =0, + upsSettingPage, + panelSettingPage, + fontSettingPage, + analogSettingPage, + kickerSettingPage + }; + +/** + * @internal + */ + void initSetting(); + +/** + * @internal + */ + void initUps(); + +/** + * @internal + */ + void initPanel(); + +/** + * @internal + */ + void initFonts(); + +/** + * @internal + */ + void initAnalog (); + +/** + * @internal + */ + void initDock (); + + + +// Private values + QString m_activeUpsName; // name of UPS which is active + KNutUpsData* m_myUpsData; + KNutVarData* m_myAnalogData; + KNutVarData::SettingDataDef* m_settingData; + KNutNewUpsDlg* newUpsDlg; + + KListBox* m_listBox2; // uses in part UPS, contain name of UPS + + bool m_checked; //it's settted when, definition(parameters) of UPS were chaged // nastaveno kdyz doslo k zmene v definici UPS + bool m_checkedActiveUps; //it's setted when, parameters of active UPS were changed // nastaveno pokud doslo ke zmene na aktivni UPS + + QSpinBox *m_numberOfColumns; + KColorButton *m_BGButton; + QCheckBox *m_checkBoxCbc; + QCheckBox *m_checkBoxAys; +// QCheckBox *m_checkBoxMW; + QCheckBox *m_checkBoxMesW; + KComboBox *m_comboBoxMainWindow; + QCheckBox *m_xfer; + + QCheckBox *m_checkBoxOver; + QCheckBox *m_checkBoxBL; + QCheckBox *m_checkBoxRB; + QCheckBox *m_checkBoxCal; + QCheckBox *m_checkBoxMFRM; + QCheckBox *m_checkBoxMFR; + QCheckBox *m_checkBoxModel; + QCheckBox *m_checkBoxSerial; + QCheckBox *m_checkBoxFirm; + QCheckBox *m_checkBoxRun; + QCheckBox *m_checkBoxCbpc; + QCheckBox* m_checkBoxCbac; + QCheckBox* m_checkBoxCoac; + QCheckBox *m_checkBoxCbi; + QCheckBox *m_checkBoxTTMFR; + QCheckBox *m_checkBoxTTModel; + QCheckBox *m_checkBoxTTSerial; + QCheckBox *m_checkBoxTTFirm; + QCheckBox *m_checkBoxTTRun; + QCheckBox *m_checkBoxTTCharge; + QCheckBox *m_checkBoxTTLoad; + + QLabel *m_panelBackgroundColorLabel; + QLabel *m_mainBackgroundColorLabel; + QLabel *m_analogBackgroundColorLabel; + QLabel *m_dockBackgroundColorLabel; + QLabel *m_analogPointerColorLabel; + QLabel *m_analogOKColorLabel; + QLabel *m_analogWarningColorLabel; + QLabel *m_analogErrorColorLabel; + QLabel *m_analogScaleColorLabel; + QLabel *m_analogFontColorLabel; + QLabel *m_digitalProcessingLabel; + QLabel *m_iconDockLabel; + + QRadioButton *m_vRadioButton1; + QRadioButton *m_vRadioButton2; + QRadioButton *m_fRadioButton1; + QRadioButton *m_fRadioButton2; + QRadioButton *m_iconRadioButton1; + QRadioButton *m_iconRadioButton2; + + KColorButton *m_BGPButton; + KColorButton* m_BGAButton; + KColorButton* m_AFingerButton; + KColorButton* m_AOKButton; + KColorButton* m_AWarnningButton; + KColorButton* m_AErrorButton; + KColorButton* m_AScaleButton; + KColorButton* m_AFontButton; + KColorButton *m_BGIButton; + + KComboBox* m_digitalProcesingOfPointers; + + QButtonGroup *m_voltageGroup; + QButtonGroup *m_frequencyGroup; + + QCheckBox* m_customFont; // User's font + KFontChooser *m_fontWidget; + + QFont m_aPanelFont; // Analog panel font + QFont m_mPanelFont; // Main panel font + + int m_settingFont; // which font is setted (selected) + + QPixmap m_panelPix; + QPixmap m_mSetPix; + QPixmap m_upsesPix; + QPixmap m_analogPix; + QPixmap m_dockPix; + +}; + +#endif |