From 4434c900e31b9d154384d1237c4ccd859908b233 Mon Sep 17 00:00:00 2001 From: Mike Gelfand Date: Sat, 14 Nov 2015 14:22:57 +0000 Subject: [PATCH] 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. --- qt/MainWindow.cc | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/qt/MainWindow.cc b/qt/MainWindow.cc index bb12a86f5..aa65e2d4e 100644 --- a/qt/MainWindow.cc +++ b/qt/MainWindow.cc @@ -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 (d->layout ()); - if (l == nullptr) + const auto l = qobject_cast (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