diff options
author | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
---|---|---|
committer | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
commit | 84da08d7b7fcda12c85caeb5a10b4903770a6f69 (patch) | |
tree | 2a6aea76f2dfffb4cc04bb907c4725af94f70e72 /atlantikdesigner/designer/group.h | |
download | tdeaddons-84da08d7b7fcda12c85caeb5a10b4903770a6f69.tar.gz tdeaddons-84da08d7b7fcda12c85caeb5a10b4903770a6f69.zip |
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdeaddons@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'atlantikdesigner/designer/group.h')
-rw-r--r-- | atlantikdesigner/designer/group.h | 99 |
1 files changed, 99 insertions, 0 deletions
diff --git a/atlantikdesigner/designer/group.h b/atlantikdesigner/designer/group.h new file mode 100644 index 0000000..b1ebf99 --- /dev/null +++ b/atlantikdesigner/designer/group.h @@ -0,0 +1,99 @@ +#ifndef GROUP_H +#define GROUP_H + +#include <qcolor.h> +#include <qptrlist.h> + +#include <kdialogbase.h> + +#include <atlantic/estategroup.h> + +class KColorButton; +class KLineEdit; +class KListBox; +class KPushButton; + +class QComboBox; +class QListBoxItem; +class QSpinBox; +class QVGroupBox; + +class ConfigEstateGroup +{ + public: + ConfigEstateGroup() { init(); } + ConfigEstateGroup(const QString &name) { setName(name); init(); } + void init() { setHousePrice(0); setGlobalPrice(0); } + + void setHousePrice(int newPrice) { m_housePrice = newPrice; } + int housePrice()const { return m_housePrice; } + void setGlobalPrice(int newGlobalPrice) { m_globalPrice = newGlobalPrice; } + int globalPrice()const { return m_globalPrice; } + const QString &rentMath() { return m_rentMath; } + void setRentMath(const QString &newMath) { m_rentMath = newMath; } + bool dynamicRent()const { return !m_rentMath.isEmpty(); } + void setName(const QString &name) { m_name = name; } + const QString &name() { return m_name; } + + const QColor &fgColor() { return m_fgColor; } + void setFgColor(const QColor &color) { m_fgColor = color; } + const QColor &bgColor() { return m_bgColor; } + void setBgColor(const QColor &color) { m_bgColor = color; } + + private: + QColor m_fgColor; + QColor m_bgColor; + QString m_rentMath; + int m_housePrice; + int m_globalPrice; + QString m_name; +}; +typedef QValueList<ConfigEstateGroup> ConfigEstateGroupList; + +class GroupEditor : public KDialogBase +{ + Q_OBJECT + + public: + GroupEditor(ConfigEstateGroupList *, QWidget *parent=0); + + signals: + void changed(); + void update(); + + protected slots: + virtual void slotOk(); + virtual void slotApply(); + + private slots: + void updateSettings(QListBoxItem *item); + void fgChanged(const QColor &); + void bgChanged(const QColor &); + void housePriceChanged(int); + void globalPriceChanged(int); + void rentMathChanged(const QString &); + void add(); + void remove(); + void selectionChanged(); + + private: + KListBox *groups; + KLineEdit *rentMathEdit; + KColorButton *fgButton; + KColorButton *bgButton; + QWidget *pricesWidget; + QWidget *mathWidget; + QSpinBox *housePrice; + QSpinBox *globalPrice; + QVGroupBox *colorGroupBox; + QVGroupBox *pricesGroupBox; + QVGroupBox *dynamicGroupBox; + KPushButton *removeB; + + ConfigEstateGroupList *list; + ConfigEstateGroupList mylist; + + ConfigEstateGroup *currentGroup(); +}; + +#endif |