Implement gateway for adding new torrents

PR #19355.
This commit is contained in:
Vladimir Golovnev 2023-08-14 18:17:56 +03:00 committed by GitHub
parent e4313d6651
commit dcf3e97291
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
42 changed files with 933 additions and 639 deletions

View file

@ -110,8 +110,7 @@ namespace
// Constructor
OptionsDialog::OptionsDialog(IGUIApplication *app, QWidget *parent)
: QDialog(parent)
, GUIApplicationComponent(app)
: GUIApplicationComponent(app, parent)
, m_ui {new Ui::OptionsDialog}
, m_storeDialogSize {SETTINGS_KEY(u"Size"_s)}
, m_storeHSplitterSize {SETTINGS_KEY(u"HorizontalSplitterSizes"_s)}
@ -484,8 +483,8 @@ void OptionsDialog::loadDownloadsTabOptions()
const auto *pref = Preferences::instance();
const auto *session = BitTorrent::Session::instance();
m_ui->checkAdditionDialog->setChecked(AddNewTorrentDialog::isEnabled());
m_ui->checkAdditionDialogFront->setChecked(AddNewTorrentDialog::isTopLevel());
m_ui->checkAdditionDialog->setChecked(pref->isAddNewTorrentDialogEnabled());
m_ui->checkAdditionDialogFront->setChecked(pref->isAddNewTorrentDialogTopLevel());
m_ui->contentLayoutComboBox->setCurrentIndex(static_cast<int>(session->torrentContentLayout()));
m_ui->checkAddToQueueTop->setChecked(session->isAddTorrentToQueueTop());
@ -686,8 +685,8 @@ void OptionsDialog::saveDownloadsTabOptions() const
auto *pref = Preferences::instance();
auto *session = BitTorrent::Session::instance();
AddNewTorrentDialog::setEnabled(useAdditionDialog());
AddNewTorrentDialog::setTopLevel(m_ui->checkAdditionDialogFront->isChecked());
pref->setAddNewTorrentDialogEnabled(useAdditionDialog());
pref->setAddNewTorrentDialogTopLevel(m_ui->checkAdditionDialogFront->isChecked());
session->setTorrentContentLayout(static_cast<BitTorrent::TorrentContentLayout>(m_ui->contentLayoutComboBox->currentIndex()));