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 | c90c389a8a8d9d8661e9772ec4144c5cf2039f23 (patch) | |
tree | 6d8391395bce9eaea4ad78958617edb20c6a7573 /libksirtet/lib/miscui.cpp | |
download | tdegames-c90c389a8a8d9d8661e9772ec4144c5cf2039f23.tar.gz tdegames-c90c389a8a8d9d8661e9772ec4144c5cf2039f23.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/kdegames@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'libksirtet/lib/miscui.cpp')
-rw-r--r-- | libksirtet/lib/miscui.cpp | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/libksirtet/lib/miscui.cpp b/libksirtet/lib/miscui.cpp new file mode 100644 index 00000000..28f00914 --- /dev/null +++ b/libksirtet/lib/miscui.cpp @@ -0,0 +1,58 @@ +#include "miscui.h" +#include "miscui.moc" + +#include <qlayout.h> + +#include <klocale.h> + + +//----------------------------------------------------------------------------- +MeetingCheckBox::MeetingCheckBox(Type type, bool owner, bool server, + QWidget *parent) + : QWidget(parent, "meeting_check_box") +{ + QVBoxLayout *vbox = new QVBoxLayout(this); + + _ready = new QCheckBox(i18n("Ready"), this); + vbox->addWidget(_ready); + _ready->setEnabled(owner); + connect(_ready, SIGNAL(clicked()), SLOT(changedSlot())); + + _excluded = new QCheckBox(i18n("Excluded"), this); + vbox->addWidget(_excluded); + _excluded->setEnabled(server); + connect(_excluded, SIGNAL(clicked()), SLOT(changedSlot())); + + setType(type); +} + +void MeetingCheckBox::setType(Type type) +{ + _ready->setChecked( type==Ready ); + _excluded->setChecked( type==Excluded ); +} + +MeetingCheckBox::Type MeetingCheckBox::type() const +{ + if ( _excluded->isChecked() ) return Excluded; + if ( _ready->isChecked() ) return Ready; + return NotReady; +} + +void MeetingCheckBox::changedSlot() +{ + emit changed(type()); +} + +//----------------------------------------------------------------------------- +PlayerComboBox::PlayerComboBox(Type type, bool canBeEmpty, bool acceptAI, + QWidget *parent) + : QComboBox(parent, "player_combo_box") +{ + insertItem(i18n("Human")); + if (acceptAI) insertItem(i18n("AI")); + if (canBeEmpty) insertItem(i18n("None")); + setCurrentItem(type); + + connect(this, SIGNAL(activated(int)), SIGNAL(changed(int))); +} |