Changeset 14599


Ignore:
Timestamp:
Nov 14, 2015, 2:22:57 PM (7 years ago)
Author:
mikedld
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/qt/MainWindow.cc

    r14590 r14599  
    11471147  d->setAttribute (Qt::WA_DeleteOnClose);
    11481148
    1149   QCheckBox * b = new QCheckBox (tr ("Show &options dialog"));
    1150   b->setChecked (myPrefs.getBool (Prefs::OPTIONS_PROMPT));
    1151   b->setObjectName (SHOW_OPTIONS_CHECKBOX_NAME);
    1152   auto l = qobject_cast<QGridLayout*> (d->layout ());
    1153   if (l == nullptr)
    1154     {
    1155       l = new QGridLayout;
    1156       d->setLayout (l);
    1157     }
    1158   l->addWidget (b, l->rowCount(), 0, 1, -1, Qt::AlignLeft);
     1149  const auto l = qobject_cast<QGridLayout*> (d->layout ());
     1150  if (l != nullptr)
     1151    {
     1152      QCheckBox * b = new QCheckBox (tr ("Show &options dialog"));
     1153      b->setChecked (myPrefs.getBool (Prefs::OPTIONS_PROMPT));
     1154      b->setObjectName (SHOW_OPTIONS_CHECKBOX_NAME);
     1155      l->addWidget (b, l->rowCount(), 0, 1, -1, Qt::AlignLeft);
     1156    }
    11591157
    11601158  connect (d, SIGNAL (filesSelected (QStringList)),
    11611159           this, SLOT (addTorrents (QStringList)));
    11621160
    1163   d->show ();
     1161  d->open ();
    11641162}
    11651163
Note: See TracChangeset for help on using the changeset viewer.