diff options
| author | Kevin Smith <git@kismith.co.uk> | 2012-06-01 15:29:27 (GMT) |
|---|---|---|
| committer | Kevin Smith <git@kismith.co.uk> | 2012-06-01 15:29:27 (GMT) |
| commit | 1514e787b28ee09ea28d75828bf41049696fd5c7 (patch) | |
| tree | 0101bce765b9769732c2c032920284333a996f99 /Swift/QtUI/QtInviteToChatWindow.cpp | |
| parent | 8b167ce7302d973460cc8ee0790616283114d4c3 (diff) | |
| download | swift-contrib-1514e787b28ee09ea28d75828bf41049696fd5c7.zip swift-contrib-1514e787b28ee09ea28d75828bf41049696fd5c7.tar.bz2 | |
Fix tab order in invite window.
Resolves: #1128
Diffstat (limited to 'Swift/QtUI/QtInviteToChatWindow.cpp')
| -rw-r--r-- | Swift/QtUI/QtInviteToChatWindow.cpp | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/Swift/QtUI/QtInviteToChatWindow.cpp b/Swift/QtUI/QtInviteToChatWindow.cpp index 3b8f1fc..ce6dea0 100644 --- a/Swift/QtUI/QtInviteToChatWindow.cpp +++ b/Swift/QtUI/QtInviteToChatWindow.cpp @@ -26,30 +26,30 @@ QtInviteToChatWindow::QtInviteToChatWindow(QWidget* parent) : QDialog(parent) { layout->addWidget(description); jidsLayout_ = new QBoxLayout(QBoxLayout::TopToBottom); layout->addLayout(jidsLayout_); QLabel* reasonLabel = new QLabel(tr("If you want to provide a reason for the invitation, enter it here")); layout->addWidget(reasonLabel); reason_ = new QLineEdit(this); layout->addWidget(reason_); - addJIDLine(); connect(this, SIGNAL(accepted()), this, SLOT(handleAccepting())); connect(this, SIGNAL(rejected()), this, SLOT(handleRejecting())); - QDialogButtonBox* buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel); + buttonBox_ = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel); - connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept())); - connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject())); + connect(buttonBox_, SIGNAL(accepted()), this, SLOT(accept())); + connect(buttonBox_, SIGNAL(rejected()), this, SLOT(reject())); - layout->addWidget(buttonBox); + layout->addWidget(buttonBox_); + addJIDLine(); jids_[0]->setFocus(); setModal(false); show(); } QtInviteToChatWindow::~QtInviteToChatWindow() { @@ -80,21 +80,27 @@ std::vector<JID> QtInviteToChatWindow::getJIDs() const { } return results; } void QtInviteToChatWindow::addJIDLine() { QLineEdit* jid = new QLineEdit(this); QCompleter* completer = new QCompleter(&completions_, this); completer->setCaseSensitivity(Qt::CaseInsensitive); jid->setCompleter(completer); - jids_.push_back(jid); jidsLayout_->addWidget(jid); connect(jid, SIGNAL(textChanged(const QString&)), this, SLOT(handleJIDTextChanged())); + if (!jids_.empty()) { + setTabOrder(jids_.back(), jid); + } + jids_.push_back(jid); + setTabOrder(jid, reason_); + setTabOrder(reason_, buttonBox_); + //setTabOrder(buttonBox_, jids_[0]); } void QtInviteToChatWindow::handleJIDTextChanged() { bool gotEmpty = false; foreach(QLineEdit* edit, jids_) { if (edit->text().isEmpty()) { gotEmpty = true; } } |
Swift