Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add torrent dialogue bug #11217

Open
Timsonrobl opened this issue Sep 11, 2019 · 1 comment

Comments

@Timsonrobl
Copy link

commented Sep 11, 2019

When you change "Torrent management" to Manual in adding new download dialogue window which causes automatic "Save at" field change the "Free space on disc" information will still display free space on disc designated on Automatic save location instead of current chosen one.
Switching "Save at" location back and forth fixes it.

@glassez glassez added the GUI label Sep 11, 2019

@thalieht

This comment has been minimized.

Copy link
Contributor

commented Sep 12, 2019

I found 2 ways to solve this:

--- a/src/gui/addnewtorrentdialog.cpp
+++ b/src/gui/addnewtorrentdialog.cpp
@@ -669,12 +669,10 @@ void AddNewTorrentDialog::TMMChanged(int index)
     if (index != 1) { // 0 is Manual mode and 1 is Automatic mode. Handle all non 1 values as manual mode.
         populateSavePathComboBox();
         m_ui->groupBoxSavePath->setEnabled(true);
-        m_ui->savePath->blockSignals(false);
         m_ui->savePath->setCurrentIndex(m_oldIndex < m_ui->savePath->count() ? m_oldIndex : m_ui->savePath->count() - 1);
     }
     else {
         m_ui->groupBoxSavePath->setEnabled(false);
-        m_ui->savePath->blockSignals(true);
         m_ui->savePath->clear();
         QString savePath = BitTorrent::Session::instance()->categorySavePath(m_ui->categoryComboBox->currentText());
         m_ui->savePath->addItem(savePath);

--- a/src/gui/addnewtorrentdialog.cpp
+++ b/src/gui/addnewtorrentdialog.cpp
@@ -114,6 +114,10 @@ AddNewTorrentDialog::AddNewTorrentDialog(const BitTorrent::AddTorrentParams &inP
     m_ui->comboTTM->blockSignals(false);
     populateSavePathComboBox();
     connect(m_ui->savePath, &FileSystemPathEdit::selectedPathChanged, this, &AddNewTorrentDialog::onSavePathChanged);
+    connect(m_ui->comboTTM, qOverload<int>(&QComboBox::currentIndexChanged)
+            , this, &AddNewTorrentDialog::updateDiskSpaceLabel);
+    connect(m_ui->categoryComboBox, qOverload<int>(&QComboBox::currentIndexChanged)
+            , this, &AddNewTorrentDialog::updateDiskSpaceLabel);
 
     const bool rememberLastSavePath = settings()->loadValue(KEY_REMEMBERLASTSAVEPATH, false).toBool();
     m_ui->checkBoxRememberLastSavePath->setChecked(rememberLastSavePath);

@glassez do you remember why you introduced these block signals? At the time there were a disconnect() and connect() in on_browse_blicked() but this doesn't exist anymore and i can't find any problem with removing them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.