mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2024-12-26 17:58:19 +03:00
Correctly adjust "Add New torrent" dialog position in all the cases
PR #20457. Closes #20449.
This commit is contained in:
parent
cfa7a6db46
commit
361741d677
2 changed files with 4 additions and 6 deletions
|
@ -551,7 +551,10 @@ void AddNewTorrentDialog::show(const QString &source, const BitTorrent::AddTorre
|
|||
// Qt::Window is required to avoid showing only two dialog on top (see #12852).
|
||||
// Also improves the general convenience of adding multiple torrents.
|
||||
if (!attached)
|
||||
{
|
||||
dlg->setWindowFlags(Qt::Window);
|
||||
adjustDialogGeometry(dlg, parent);
|
||||
}
|
||||
dlg->setAttribute(Qt::WA_DeleteOnClose);
|
||||
|
||||
if (Net::DownloadManager::hasSupportedScheme(source))
|
||||
|
@ -570,14 +573,9 @@ void AddNewTorrentDialog::show(const QString &source, const BitTorrent::AddTorre
|
|||
: dlg->loadTorrentFile(source);
|
||||
|
||||
if (isLoaded)
|
||||
{
|
||||
adjustDialogGeometry(dlg, parent);
|
||||
dlg->QDialog::show();
|
||||
}
|
||||
else
|
||||
{
|
||||
delete dlg;
|
||||
}
|
||||
}
|
||||
|
||||
void AddNewTorrentDialog::show(const QString &source, QWidget *parent)
|
||||
|
|
|
@ -292,7 +292,7 @@ void SearchJobWidget::addTorrentToSession(const QString &source, const AddTorren
|
|||
if (source.isEmpty()) return;
|
||||
|
||||
if ((option == AddTorrentOption::ShowDialog) || ((option == AddTorrentOption::Default) && AddNewTorrentDialog::isEnabled()))
|
||||
AddNewTorrentDialog::show(source, this);
|
||||
AddNewTorrentDialog::show(source, window());
|
||||
else
|
||||
BitTorrent::Session::instance()->addTorrent(source);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue