Commit 67be4201 authored by Orgad Shaneh's avatar Orgad Shaneh Committed by hjk

Attach to Core: Correctly enable OK button

Task-number: QTCREATORBUG-7683

Change-Id: I9dae6836a010e18d781a0b26eeb447470ac16a28
Reviewed-by: default avatarhjk <qthjk@ovi.com>
parent 3a097c29
......@@ -297,9 +297,11 @@ AttachCoreDialog::AttachCoreDialog(QWidget *parent)
connect(d->selectRemoteCoreButton, SIGNAL(clicked()), SLOT(selectRemoteCoreFile()));
connect(d->remoteCoreFileName, SIGNAL(textChanged(QString)), SLOT(changed()));
connect(d->localCoreFileName, SIGNAL(changed(QString)), SLOT(changed()));
connect(d->kitChooser, SIGNAL(activated(int)), SLOT(changed()));
connect(d->buttonBox, SIGNAL(rejected()), SLOT(reject()));
connect(d->buttonBox, SIGNAL(accepted()), SLOT(accept()));
changed();
}
AttachCoreDialog::~AttachCoreDialog()
......@@ -321,19 +323,20 @@ bool AttachCoreDialog::isLocal() const
void AttachCoreDialog::changed()
{
bool isValid = d->kitChooser->currentIndex() >= 0
&& !localCoreFile().isEmpty();
d->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(isValid);
bool isValid = d->kitChooser->currentIndex() >= 0;
if (isLocal()) {
d->localCoreFileName->setVisible(true);
d->remoteCoreFileName->setVisible(false);
d->selectRemoteCoreButton->setVisible(false);
isValid &= d->localCoreFileName->isValid();
} else {
d->remoteCoreFileName->setVisible(true);
d->selectRemoteCoreButton->setVisible(true);
d->localCoreFileName->setVisible(false);
isValid &= !remoteCoreFile().isEmpty();
}
d->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(isValid);
}
void AttachCoreDialog::selectRemoteCoreFile()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment