diff options
author | Kevin Smith <git@kismith.co.uk> | 2010-05-21 15:59:57 (GMT) |
---|---|---|
committer | Kevin Smith <git@kismith.co.uk> | 2010-05-21 15:59:57 (GMT) |
commit | dc80d6baf01d1a4c69e5204887d430ad5f6daaec (patch) | |
tree | 69b8ffb0f1ab2f702cdebab15b880203894b2d92 /Swift/QtUI/EventViewer/QtEventWindow.cpp | |
parent | fbd54ef16ef202b6273f89f0d7b50fdd6b6dec68 (diff) | |
download | swift-contrib-dc80d6baf01d1a4c69e5204887d430ad5f6daaec.zip swift-contrib-dc80d6baf01d1a4c69e5204887d430ad5f6daaec.tar.bz2 |
Disable the notice button until a notice is selected.
Resolves: #350
Diffstat (limited to 'Swift/QtUI/EventViewer/QtEventWindow.cpp')
-rw-r--r-- | Swift/QtUI/EventViewer/QtEventWindow.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/Swift/QtUI/EventViewer/QtEventWindow.cpp b/Swift/QtUI/EventViewer/QtEventWindow.cpp index 9458f67..567ac94 100644 --- a/Swift/QtUI/EventViewer/QtEventWindow.cpp +++ b/Swift/QtUI/EventViewer/QtEventWindow.cpp @@ -42,11 +42,13 @@ QtEventWindow::QtEventWindow(UIEventStream* eventStream, QWidget* parent) : QWid view_->setIndentation(0); view_->setRootIsDecorated(true); - QPushButton* readButton = new QPushButton("Read Notice", this); - layout->addWidget(readButton); - connect(readButton, SIGNAL(clicked()), this, SLOT(handleReadClicked())); - + readButton_ = new QPushButton("Read Notice", this); + layout->addWidget(readButton_); + readButton_->setEnabled(false); + connect(readButton_, SIGNAL(clicked()), this, SLOT(handleReadClicked())); + connect(view_, SIGNAL(clicked(const QModelIndex&)), this, SLOT(handleItemClicked(const QModelIndex&))); connect(view_, SIGNAL(activated(const QModelIndex&)), this, SLOT(handleItemActivated(const QModelIndex&))); + } QtEventWindow::~QtEventWindow() { @@ -55,6 +57,10 @@ QtEventWindow::~QtEventWindow() { /* Not view_ because this is the parent */ } +void QtEventWindow::handleItemClicked(const QModelIndex&) { + readButton_->setEnabled(true); +} + void QtEventWindow::handleReadClicked() { QModelIndex index = view_->currentIndex(); if (!index.isValid()) { |