From ff65b6ea2f9299bc460d4c3f0dae9736286fc6ac Mon Sep 17 00:00:00 2001 From: Christophe Dumez Date: Sun, 3 Jan 2010 14:59:14 +0000 Subject: [PATCH] - Adapt torrent addition dialog size when the torrent is a magnet link (since we don't display torrent content) --- src/torrentadditiondlg.h | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/torrentadditiondlg.h b/src/torrentadditiondlg.h index aebfb5ffb..31499f4f9 100644 --- a/src/torrentadditiondlg.h +++ b/src/torrentadditiondlg.h @@ -95,7 +95,7 @@ public: addInPause->setEnabled(false); } #ifndef LIBTORRENT_0_15 - addInSeed->setEnabled(false); + addInSeed->setVisible(false); #endif } @@ -138,6 +138,7 @@ public: } void saveSettings() { + if(is_magnet) return; QSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent")); QVariantList contentColsWidths; // -1 because we hid PROGRESS column @@ -150,11 +151,16 @@ public: } void showLoadMagnetURI(QString magnet_uri) { + show(); is_magnet = true; this->from_url = magnet_uri; + int hidden_height = 0; // Disable useless widgets + hidden_height += torrentContentList->height(); torrentContentList->setVisible(false); + hidden_height += torrentContentLbl->height(); torrentContentLbl->setVisible(false); + hidden_height += collapseAllButton->height(); collapseAllButton->setVisible(false); expandAllButton->setVisible(false); // Get torrent hash @@ -177,7 +183,9 @@ public: comboLabel->addItem(label); } // Show dialog - show(); + //show(); + setMinimumSize(0, 0); + resize(width(), height()-hidden_height); } void showLoad(QString filePath, QString from_url=QString::null){