mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2024-11-22 01:06:03 +03:00
Improve GUI behavior when adding multiple torrents
Allows you to bring the main window to the front when one or more "Add new torrent" dialogs are open. Also allows you to minimize/maximize the "Add new torrent" dialog. PR #19670. Closes #17919.
This commit is contained in:
parent
73028f9930
commit
70b438e6d9
1 changed files with 1 additions and 4 deletions
|
@ -181,15 +181,12 @@ 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());
|
|
||||||
#else
|
|
||||||
// By not setting a parent to the "AddNewTorrentDialog", all those dialogs
|
// By not setting a parent to the "AddNewTorrentDialog", all those dialogs
|
||||||
// will be displayed on top and will not overlap with the main window.
|
// will be displayed on top and will not overlap with the main window.
|
||||||
auto *dlg = new AddNewTorrentDialog(torrentDescr, params, nullptr);
|
auto *dlg = new AddNewTorrentDialog(torrentDescr, params, nullptr);
|
||||||
// Qt::Window is required to avoid showing only two dialog on top (see #12852).
|
// Qt::Window is required to avoid showing only two dialog on top (see #12852).
|
||||||
|
// Also improves the general convenience of adding multiple torrents.
|
||||||
dlg->setWindowFlags(Qt::Window);
|
dlg->setWindowFlags(Qt::Window);
|
||||||
#endif
|
|
||||||
|
|
||||||
dlg->setAttribute(Qt::WA_DeleteOnClose);
|
dlg->setAttribute(Qt::WA_DeleteOnClose);
|
||||||
m_dialogs[infoHash] = dlg;
|
m_dialogs[infoHash] = dlg;
|
||||||
|
|
Loading…
Reference in a new issue