mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2024-12-27 18:28:18 +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
716aca17f8
commit
4beee27701
1 changed files with 3 additions and 4 deletions
|
@ -489,15 +489,14 @@ void AddNewTorrentDialog::saveState()
|
|||
|
||||
void AddNewTorrentDialog::show(const QString &source, const BitTorrent::AddTorrentParams &inParams, QWidget *parent)
|
||||
{
|
||||
#ifndef Q_OS_MACOS
|
||||
auto *dlg = new AddNewTorrentDialog(inParams, parent);
|
||||
#else
|
||||
Q_UNUSED(parent);
|
||||
|
||||
// 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(inParams, nullptr);
|
||||
// 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);
|
||||
#endif
|
||||
dlg->setAttribute(Qt::WA_DeleteOnClose);
|
||||
|
||||
if (Net::DownloadManager::hasSupportedScheme(source))
|
||||
|
|
Loading…
Reference in a new issue