Don't force-add "Show options dialog" checkbox when opening a torrent

If open file dialog is a native one, setting the layout will do more harm
than good. Specifically, on Windows with Qt 5 the dialog becomes completely
unusable.
This commit is contained in:
Mike Gelfand 2015-11-14 14:22:57 +00:00
parent 3f86b77068
commit 4434c900e3
1 changed files with 7 additions and 9 deletions

View File

@ -1146,21 +1146,19 @@ MainWindow::openTorrent ()
d->setFileMode (QFileDialog::ExistingFiles);
d->setAttribute (Qt::WA_DeleteOnClose);
QCheckBox * b = new QCheckBox (tr ("Show &options dialog"));
b->setChecked (myPrefs.getBool (Prefs::OPTIONS_PROMPT));
b->setObjectName (SHOW_OPTIONS_CHECKBOX_NAME);
auto l = qobject_cast<QGridLayout*> (d->layout ());
if (l == nullptr)
const auto l = qobject_cast<QGridLayout*> (d->layout ());
if (l != nullptr)
{
l = new QGridLayout;
d->setLayout (l);
QCheckBox * b = new QCheckBox (tr ("Show &options dialog"));
b->setChecked (myPrefs.getBool (Prefs::OPTIONS_PROMPT));
b->setObjectName (SHOW_OPTIONS_CHECKBOX_NAME);
l->addWidget (b, l->rowCount(), 0, 1, -1, Qt::AlignLeft);
}
l->addWidget (b, l->rowCount(), 0, 1, -1, Qt::AlignLeft);
connect (d, SIGNAL (filesSelected (QStringList)),
this, SLOT (addTorrents (QStringList)));
d->show ();
d->open ();
}
void