From 082ff760d6c317582453c09041621c4e86232af1 Mon Sep 17 00:00:00 2001 From: Andrzej Kapolka Date: Tue, 6 May 2014 11:47:35 -0700 Subject: [PATCH] Un-default the "OK" button so that we can press enter on the URL field. --- interface/src/ui/AttachmentsDialog.cpp | 10 ++++++++++ interface/src/ui/AttachmentsDialog.h | 3 +++ 2 files changed, 13 insertions(+) diff --git a/interface/src/ui/AttachmentsDialog.cpp b/interface/src/ui/AttachmentsDialog.cpp index 9fa26a2f00..bd531b1b46 100644 --- a/interface/src/ui/AttachmentsDialog.cpp +++ b/interface/src/ui/AttachmentsDialog.cpp @@ -50,10 +50,20 @@ AttachmentsDialog::AttachmentsDialog() : QDialogButtonBox* buttons = new QDialogButtonBox(QDialogButtonBox::Ok); layout->addWidget(buttons); connect(buttons, SIGNAL(accepted()), SLOT(deleteLater())); + _ok = buttons->button(QDialogButtonBox::Ok); setMinimumSize(600, 600); } +void AttachmentsDialog::setVisible(bool visible) { + QDialog::setVisible(visible); + + // un-default the OK button + if (visible) { + _ok->setDefault(false); + } +} + void AttachmentsDialog::updateAttachmentData() { QVector data; for (int i = 0; i < _attachments->count() - 1; i++) { diff --git a/interface/src/ui/AttachmentsDialog.h b/interface/src/ui/AttachmentsDialog.h index 663a831462..4e67ae8882 100644 --- a/interface/src/ui/AttachmentsDialog.h +++ b/interface/src/ui/AttachmentsDialog.h @@ -30,6 +30,8 @@ public: AttachmentsDialog(); + virtual void setVisible(bool visible); + public slots: void updateAttachmentData(); @@ -41,6 +43,7 @@ private slots: private: QVBoxLayout* _attachments; + QPushButton* _ok; }; /// A panel controlling a single attachment.