mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-12 08:16:16 -07:00
Avoid race conditions between dialogs on startup
This commit is contained in:
parent
7f40602da9
commit
15515200ee
2 changed files with 18 additions and 17 deletions
|
@ -758,6 +758,24 @@ try
|
|||
const MainWindow::State windowState = (!m_startupProgressDialog || (m_startupProgressDialog->windowState() & Qt::WindowMinimized))
|
||||
? MainWindow::Minimized : MainWindow::Normal;
|
||||
m_window = new MainWindow(this, windowState);
|
||||
delete m_startupProgressDialog;
|
||||
#ifdef Q_OS_WIN
|
||||
auto *pref = Preferences::instance();
|
||||
if (!pref->neverCheckFileAssoc() && (!Preferences::isTorrentFileAssocSet() || !Preferences::isMagnetLinkAssocSet()))
|
||||
{
|
||||
if (QMessageBox::question(m_window, tr("Torrent file association")
|
||||
, tr("qBittorrent is not the default application for opening torrent files or Magnet links.\nDo you want to make qBittorrent the default application for these?")
|
||||
, QMessageBox::Yes | QMessageBox::No, QMessageBox::Yes) == QMessageBox::Yes)
|
||||
{
|
||||
pref->setTorrentFileAssoc(true);
|
||||
pref->setMagnetLinkAssoc(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
pref->setNeverCheckFileAssoc();
|
||||
}
|
||||
}
|
||||
#endif // Q_OS_WIN
|
||||
#endif // DISABLE_GUI
|
||||
|
||||
#ifndef DISABLE_WEBUI
|
||||
|
@ -838,7 +856,6 @@ void Application::createStartupProgressDialog()
|
|||
});
|
||||
|
||||
connect(BitTorrent::Session::instance(), &BitTorrent::Session::startupProgressUpdated, m_startupProgressDialog, &QProgressDialog::setValue);
|
||||
connect(BitTorrent::Session::instance(), &BitTorrent::Session::restored, m_startupProgressDialog, &QObject::deleteLater);
|
||||
|
||||
connect(m_desktopIntegration, &DesktopIntegration::activationRequested, m_startupProgressDialog, [this]()
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue