mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-01-10 23:07:59 +00:00
Don't set parent of "Add new torrent dialog" on macOS
PR #19494. Closes #12849. Closes #12852. Closes #19072. --------- Co-authored-by: Vladimir Golovnev <glassez@yandex.ru>
This commit is contained in:
parent
e045b4678d
commit
9a73a21f3f
@ -181,7 +181,16 @@ bool GUIAddTorrentManager::processTorrent(const QString &source, const BitTorren
|
|||||||
if (!hasMetadata)
|
if (!hasMetadata)
|
||||||
btSession()->downloadMetadata(torrentDescr);
|
btSession()->downloadMetadata(torrentDescr);
|
||||||
|
|
||||||
|
#ifndef Q_OS_MACOS
|
||||||
auto *dlg = new AddNewTorrentDialog(torrentDescr, params, app()->mainWindow());
|
auto *dlg = new AddNewTorrentDialog(torrentDescr, params, app()->mainWindow());
|
||||||
|
#else
|
||||||
|
// By not setting a parent to the "AddNewTorrentDialog", all those dialogs
|
||||||
|
// will be displayed on top and will not overlap with the main window.
|
||||||
|
auto *dlg = new AddNewTorrentDialog(torrentDescr, params, nullptr);
|
||||||
|
// Qt::Window is required to avoid showing only two dialog on top (see #12852).
|
||||||
|
dlg->setWindowFlags(Qt::Window);
|
||||||
|
#endif
|
||||||
|
|
||||||
dlg->setAttribute(Qt::WA_DeleteOnClose);
|
dlg->setAttribute(Qt::WA_DeleteOnClose);
|
||||||
m_dialogs[infoHash] = dlg;
|
m_dialogs[infoHash] = dlg;
|
||||||
connect(dlg, &QDialog::finished, this, [this, source, infoHash, dlg](int result)
|
connect(dlg, &QDialog::finished, this, [this, source, infoHash, dlg](int result)
|
||||||
|
Loading…
Reference in New Issue
Block a user