qBittorrent
|
#include <addnewtorrentdialog.h>
Public Member Functions | |
~AddNewTorrentDialog () override | |
Static Public Member Functions | |
static bool | isEnabled () |
static void | setEnabled (bool value) |
static bool | isTopLevel () |
static void | setTopLevel (bool value) |
static int | savePathHistoryLength () |
static void | setSavePathHistoryLength (int value) |
static void | show (const QString &source, const BitTorrent::AddTorrentParams &inParams, QWidget *parent) |
static void | show (const QString &source, QWidget *parent) |
Static Public Attributes | |
static const int | minPathHistoryLength = 0 |
static const int | maxPathHistoryLength = 99 |
Private Slots | |
void | displayContentTreeMenu (const QPoint &) |
void | updateDiskSpaceLabel () |
void | onSavePathChanged (const QString &newPath) |
void | onDownloadPathChanged (const QString &newPath) |
void | onUseDownloadPathChanged (bool checked) |
void | updateMetadata (const BitTorrent::TorrentInfo &metadata) |
void | handleDownloadFinished (const Net::DownloadResult &downloadResult) |
void | TMMChanged (int index) |
void | categoryChanged (int index) |
void | contentLayoutChanged (int index) |
void | doNotDeleteTorrentClicked (bool checked) |
void | renameSelectedFile () |
void | accept () override |
void | reject () override |
Private Member Functions | |
AddNewTorrentDialog (const BitTorrent::AddTorrentParams &inParams, QWidget *parent) | |
bool | loadTorrentFile (const QString &torrentPath) |
bool | loadTorrentImpl () |
bool | loadMagnet (const BitTorrent::MagnetUri &magnetUri) |
void | populateSavePaths () |
void | loadState () |
void | saveState () |
void | setMetadataProgressIndicator (bool visibleIndicator, const QString &labelText={}) |
void | setupTreeview () |
void | saveTorrentFile () |
bool | hasMetadata () const |
void | showEvent (QShowEvent *event) override |
Private Attributes | |
Ui::AddNewTorrentDialog * | m_ui |
TorrentContentFilterModel * | m_contentModel = nullptr |
PropListDelegate * | m_contentDelegate = nullptr |
BitTorrent::MagnetUri | m_magnetURI |
BitTorrent::TorrentInfo | m_torrentInfo |
int | m_savePathIndex = -1 |
int | m_downloadPathIndex = -1 |
bool | m_useDownloadPath = false |
std::unique_ptr< TorrentFileGuard > | m_torrentGuard |
BitTorrent::AddTorrentParams | m_torrentParams |
SettingValue< QSize > | m_storeDialogSize |
SettingValue< QString > | m_storeDefaultCategory |
SettingValue< bool > | m_storeRememberLastSavePath |
SettingValue< QByteArray > | m_storeTreeHeaderState |
SettingValue< QByteArray > | m_storeSplitterState |
Definition at line 59 of file addnewtorrentdialog.h.
|
override |
Definition at line 249 of file addnewtorrentdialog.cpp.
References m_contentDelegate, m_ui, and saveState().
|
explicitprivate |
Definition at line 167 of file addnewtorrentdialog.cpp.
References BitTorrent::AddTorrentParams::addPaused, asConst(), TorrentFileGuard::autoDeleteMode(), BitTorrent::AddTorrentParams::category, BitTorrent::AddTorrentParams::contentLayout, contentLayoutChanged(), FileSystemPathEdit::DirectorySave, doNotDeleteTorrentClicked(), BitTorrent::AddTorrentParams::firstLastPiecePriority, BitTorrent::Session::instance(), loadState(), m_storeDefaultCategory, m_storeRememberLastSavePath, m_torrentParams, m_ui, TorrentFileGuard::Never, onDownloadPathChanged(), onSavePathChanged(), onUseDownloadPathChanged(), renameSelectedFile(), saveTorrentFile(), FileSystemPathEdit::selectedPathChanged(), BitTorrent::AddTorrentParams::sequential, and BitTorrent::AddTorrentParams::skipChecking.
Referenced by show().
|
overrideprivateslot |
Definition at line 758 of file addnewtorrentdialog.cpp.
References BitTorrent::AddTorrentParams::addPaused, BitTorrent::Session::addTorrent(), BitTorrent::AddTorrentParams::category, BitTorrent::AddTorrentParams::contentLayout, BitTorrent::AddTorrentParams::downloadPath, BitTorrent::AddTorrentParams::filePriorities, BitTorrent::AddTorrentParams::firstLastPiecePriority, TorrentContentModel::getFilePriorities(), hasMetadata(), BitTorrent::Session::instance(), anonymous_namespace{addnewtorrentdialog.cpp}::KEY_DOWNLOADPATHHISTORY, anonymous_namespace{addnewtorrentdialog.cpp}::KEY_SAVEPATHHISTORY, m_contentModel, m_magnetURI, m_storeDefaultCategory, m_storeRememberLastSavePath, m_torrentGuard, m_torrentInfo, m_torrentParams, m_ui, TorrentContentFilterModel::model(), BitTorrent::AddTorrentParams::savePath, savePathHistoryLength(), BitTorrent::AddTorrentParams::sequential, setEnabled(), BitTorrent::AddTorrentParams::skipChecking, anonymous_namespace{addnewtorrentdialog.cpp}::updatePathHistory(), BitTorrent::AddTorrentParams::useAutoTMM, and BitTorrent::AddTorrentParams::useDownloadPath.
|
privateslot |
Definition at line 510 of file addnewtorrentdialog.cpp.
References BitTorrent::Session::instance(), m_ui, Utils::Fs::toNativePath(), and updateDiskSpaceLabel().
|
privateslot |
Definition at line 531 of file addnewtorrentdialog.cpp.
References BitTorrent::applyContentLayout(), TorrentContentModel::clear(), BitTorrent::detectContentLayout(), BitTorrent::AddTorrentParams::filePaths, BitTorrent::TorrentInfo::filePaths(), Utils::Fs::findRootFolder(), TorrentContentModel::getFilePriorities(), hasMetadata(), m_contentModel, m_torrentInfo, m_torrentParams, m_ui, TorrentContentFilterModel::model(), TorrentContentModel::setupModelData(), and TorrentContentModel::updateFilesPriorities().
Referenced by AddNewTorrentDialog().
|
privateslot |
Definition at line 659 of file addnewtorrentdialog.cpp.
References BitTorrent::High, BitTorrent::Ignored, UIThemeManager::instance(), m_contentModel, m_ui, BitTorrent::Maximum, BitTorrent::Normal, PRIORITY, and renameSelectedFile().
Referenced by setupTreeview().
|
privateslot |
Definition at line 972 of file addnewtorrentdialog.cpp.
References m_torrentGuard.
Referenced by AddNewTorrentDialog().
|
privateslot |
Definition at line 906 of file addnewtorrentdialog.cpp.
References RaisedMessageBox::critical(), Net::DownloadResult::data, Net::DownloadResult::errorString, BitTorrent::TorrentInfo::load(), loadMagnet(), loadTorrentImpl(), m_torrentGuard, m_torrentInfo, Net::DownloadResult::magnet, Net::RedirectedToMagnet, Net::DownloadResult::status, Net::Success, and Net::DownloadResult::url.
Referenced by show().
|
private |
Definition at line 580 of file addnewtorrentdialog.cpp.
References BitTorrent::TorrentInfo::isValid(), and m_torrentInfo.
Referenced by accept(), contentLayoutChanged(), reject(), renameSelectedFile(), saveTorrentFile(), setupTreeview(), and updateDiskSpaceLabel().
|
static |
Definition at line 257 of file addnewtorrentdialog.cpp.
References anonymous_namespace{addnewtorrentdialog.cpp}::KEY_ENABLED, SettingsStorage::loadValue(), and anonymous_namespace{addnewtorrentdialog.cpp}::settings().
Referenced by SearchJobWidget::addTorrentToSession(), MainWindow::downloadFromURLList(), RSSWidget::downloadSelectedTorrents(), MainWindow::dropEvent(), MainWindow::keyPressEvent(), OptionsDialog::loadOptions(), MainWindow::on_actionOpen_triggered(), and Application::processParams().
|
static |
Definition at line 267 of file addnewtorrentdialog.cpp.
References anonymous_namespace{addnewtorrentdialog.cpp}::KEY_TOPLEVEL, SettingsStorage::loadValue(), and anonymous_namespace{addnewtorrentdialog.cpp}::settings().
Referenced by OptionsDialog::loadOptions(), and showEvent().
|
private |
Definition at line 396 of file addnewtorrentdialog.cpp.
References BitTorrent::Torrent::addTrackers(), BitTorrent::Torrent::addUrlSeeds(), RaisedMessageBox::critical(), BitTorrent::Session::downloadMetadata(), BitTorrent::Session::findTorrent(), BitTorrent::TorrentID::fromInfoHash(), BitTorrent::MagnetUri::infoHash(), RaisedMessageBox::information(), BitTorrent::Session::instance(), BitTorrent::Torrent::isPrivate(), BitTorrent::MagnetUri::isValid(), Digest32< N >::isValid(), m_magnetURI, m_torrentGuard, m_ui, BitTorrent::Session::metadataDownloaded(), BitTorrent::MagnetUri::name(), BitTorrent::Torrent::name(), setMetadataProgressIndicator(), setupTreeview(), TMMChanged(), Digest32< N >::toString(), BitTorrent::MagnetUri::trackers(), updateMetadata(), BitTorrent::MagnetUri::urlSeeds(), BitTorrent::InfoHash::v1(), BitTorrent::InfoHash::v2(), and RaisedMessageBox::warning().
Referenced by handleDownloadFinished().
|
private |
Definition at line 296 of file addnewtorrentdialog.cpp.
References m_storeDialogSize, m_storeSplitterState, m_ui, and Utils::Gui::resize().
Referenced by AddNewTorrentDialog().
|
private |
Definition at line 339 of file addnewtorrentdialog.cpp.
References RaisedMessageBox::critical(), BitTorrent::TorrentInfo::loadFromFile(), loadTorrentImpl(), m_torrentGuard, m_torrentInfo, and Utils::Fs::toNativePath().
|
private |
Definition at line 360 of file addnewtorrentdialog.cpp.
References BitTorrent::Torrent::addTrackers(), BitTorrent::Torrent::addUrlSeeds(), BitTorrent::Session::findTorrent(), BitTorrent::TorrentID::fromInfoHash(), BitTorrent::TorrentInfo::infoHash(), RaisedMessageBox::information(), BitTorrent::Session::instance(), BitTorrent::TorrentInfo::isPrivate(), BitTorrent::Torrent::isPrivate(), Digest32< N >::isValid(), m_torrentInfo, m_ui, BitTorrent::Torrent::name(), setupTreeview(), TMMChanged(), Digest32< N >::toString(), BitTorrent::TorrentInfo::trackers(), BitTorrent::TorrentInfo::urlSeeds(), BitTorrent::InfoHash::v1(), BitTorrent::InfoHash::v2(), and RaisedMessageBox::warning().
Referenced by handleDownloadFinished(), and loadTorrentFile().
|
privateslot |
Definition at line 495 of file addnewtorrentdialog.cpp.
References m_downloadPathIndex, and m_ui.
Referenced by AddNewTorrentDialog().
|
privateslot |
Definition at line 487 of file addnewtorrentdialog.cpp.
References m_savePathIndex, m_ui, and updateDiskSpaceLabel().
Referenced by AddNewTorrentDialog().
|
privateslot |
Definition at line 504 of file addnewtorrentdialog.cpp.
References m_downloadPathIndex, m_ui, and m_useDownloadPath.
Referenced by AddNewTorrentDialog().
|
private |
Definition at line 585 of file addnewtorrentdialog.cpp.
References BitTorrent::AddTorrentParams::downloadPath, BitTorrent::Session::instance(), anonymous_namespace{addnewtorrentdialog.cpp}::KEY_DOWNLOADPATHHISTORY, anonymous_namespace{addnewtorrentdialog.cpp}::KEY_SAVEPATHHISTORY, SettingsStorage::loadValue(), m_downloadPathIndex, m_savePathIndex, m_storeRememberLastSavePath, m_torrentParams, m_ui, m_useDownloadPath, BitTorrent::AddTorrentParams::savePath, anonymous_namespace{addnewtorrentdialog.cpp}::setPath(), anonymous_namespace{addnewtorrentdialog.cpp}::settings(), and BitTorrent::AddTorrentParams::useDownloadPath.
Referenced by TMMChanged().
|
overrideprivateslot |
Definition at line 809 of file addnewtorrentdialog.cpp.
References BitTorrent::Session::cancelDownloadMetadata(), hasMetadata(), BitTorrent::MagnetUri::infoHash(), BitTorrent::Session::instance(), m_magnetURI, setMetadataProgressIndicator(), and BitTorrent::InfoHash::toTorrentID().
|
privateslot |
Definition at line 977 of file addnewtorrentdialog.cpp.
References BitTorrent::AddTorrentParams::filePaths, hasMetadata(), m_torrentInfo, m_torrentParams, and m_ui.
Referenced by AddNewTorrentDialog(), and displayContentTreeMenu().
|
static |
Definition at line 277 of file addnewtorrentdialog.cpp.
References anonymous_namespace{addnewtorrentdialog.cpp}::KEY_SAVEPATHHISTORYLENGTH, SettingsStorage::loadValue(), maxPathHistoryLength, minPathHistoryLength, anonymous_namespace{addnewtorrentdialog.cpp}::settings(), and anonymous_namespace{preferences.cpp}::value().
Referenced by accept(), AdvancedSettings::loadAdvancedSettings(), and setSavePathHistoryLength().
|
private |
Definition at line 302 of file addnewtorrentdialog.cpp.
References m_contentModel, m_storeDialogSize, m_storeSplitterState, m_storeTreeHeaderState, and m_ui.
Referenced by ~AddNewTorrentDialog().
|
private |
Definition at line 556 of file addnewtorrentdialog.cpp.
References C_TORRENT_FILE_EXTENSION, hasMetadata(), m_torrentInfo, BitTorrent::TorrentInfo::name(), and BitTorrent::TorrentInfo::saveToFile().
Referenced by AddNewTorrentDialog().
|
static |
Definition at line 262 of file addnewtorrentdialog.cpp.
References anonymous_namespace{addnewtorrentdialog.cpp}::KEY_ENABLED, anonymous_namespace{addnewtorrentdialog.cpp}::settings(), SettingsStorage::storeValue(), and anonymous_namespace{preferences.cpp}::value().
Referenced by accept(), and OptionsDialog::saveOptions().
|
private |
Definition at line 844 of file addnewtorrentdialog.cpp.
References m_ui.
Referenced by loadMagnet(), reject(), and updateMetadata().
|
static |
Definition at line 284 of file addnewtorrentdialog.cpp.
References anonymous_namespace{addnewtorrentdialog.cpp}::KEY_SAVEPATHHISTORY, anonymous_namespace{addnewtorrentdialog.cpp}::KEY_SAVEPATHHISTORYLENGTH, maxPathHistoryLength, minPathHistoryLength, savePathHistoryLength(), anonymous_namespace{addnewtorrentdialog.cpp}::settings(), SettingsStorage::storeValue(), and anonymous_namespace{preferences.cpp}::value().
Referenced by AdvancedSettings::saveAdvancedSettings().
|
static |
Definition at line 272 of file addnewtorrentdialog.cpp.
References anonymous_namespace{addnewtorrentdialog.cpp}::KEY_TOPLEVEL, anonymous_namespace{addnewtorrentdialog.cpp}::settings(), SettingsStorage::storeValue(), and anonymous_namespace{preferences.cpp}::value().
Referenced by OptionsDialog::saveOptions().
|
private |
Definition at line 852 of file addnewtorrentdialog.cpp.
References BitTorrent::applyContentLayout(), AVAILABILITY, BitTorrent::TorrentInfo::comment(), BitTorrent::TorrentInfo::creationDate(), BitTorrent::detectContentLayout(), displayContentTreeMenu(), BitTorrent::AddTorrentParams::filePaths, BitTorrent::TorrentInfo::filePaths(), TorrentContentModel::filteredFilesChanged(), Utils::Fs::findRootFolder(), hasMetadata(), m_contentDelegate, m_contentModel, m_storeTreeHeaderState, m_torrentInfo, m_torrentParams, m_ui, TorrentContentFilterModel::model(), BitTorrent::TorrentInfo::name(), Utils::Misc::parseHtmlLinks(), PROGRESS, REMAINING, TorrentContentModel::setupModelData(), anonymous_namespace{session.cpp}::toString(), and updateDiskSpaceLabel().
Referenced by loadMagnet(), loadTorrentImpl(), and updateMetadata().
|
static |
Definition at line 310 of file addnewtorrentdialog.cpp.
References AddNewTorrentDialog(), Net::DownloadManager::download(), handleDownloadFinished(), Net::DownloadManager::hasSupportedScheme(), Net::DownloadManager::instance(), BitTorrent::MagnetUri::isValid(), MAX_TORRENT_SIZE, and anonymous_namespace{misc.cpp}::source.
Referenced by SearchJobWidget::addTorrentToSession(), MainWindow::downloadFromURLList(), RSSWidget::downloadSelectedTorrents(), MainWindow::dropEvent(), MainWindow::keyPressEvent(), MainWindow::on_actionOpen_triggered(), Application::processParams(), and show().
|
static |
Definition at line 334 of file addnewtorrentdialog.cpp.
References show(), and anonymous_namespace{misc.cpp}::source.
|
overrideprivate |
Definition at line 449 of file addnewtorrentdialog.cpp.
References isTopLevel().
|
privateslot |
Definition at line 942 of file addnewtorrentdialog.cpp.
References BitTorrent::Session::instance(), m_ui, populateSavePaths(), and updateDiskSpaceLabel().
Referenced by loadMagnet(), and loadTorrentImpl().
|
privateslot |
Definition at line 458 of file addnewtorrentdialog.cpp.
References BitTorrent::TorrentInfo::filesCount(), BitTorrent::TorrentInfo::fileSize(), Utils::Fs::freeDiskSpaceOnPath(), Utils::Misc::friendlyUnit(), TorrentContentModel::getFilePriorities(), hasMetadata(), BitTorrent::Ignored, m_contentModel, m_torrentInfo, m_ui, TorrentContentFilterModel::model(), and BitTorrent::TorrentInfo::totalSize().
Referenced by categoryChanged(), onSavePathChanged(), setupTreeview(), and TMMChanged().
|
privateslot |
Definition at line 820 of file addnewtorrentdialog.cpp.
References BitTorrent::MagnetUri::infoHash(), BitTorrent::TorrentInfo::infoHash(), BitTorrent::Session::instance(), BitTorrent::TorrentInfo::isValid(), Digest32< N >::isValid(), m_magnetURI, m_torrentInfo, m_ui, BitTorrent::Session::metadataDownloaded(), setMetadataProgressIndicator(), setupTreeview(), and BitTorrent::InfoHash::v2().
Referenced by loadMagnet().
|
private |
Definition at line 114 of file addnewtorrentdialog.h.
Referenced by setupTreeview(), and ~AddNewTorrentDialog().
|
private |
Definition at line 113 of file addnewtorrentdialog.h.
Referenced by accept(), contentLayoutChanged(), displayContentTreeMenu(), saveState(), setupTreeview(), and updateDiskSpaceLabel().
|
private |
Definition at line 118 of file addnewtorrentdialog.h.
Referenced by onDownloadPathChanged(), onUseDownloadPathChanged(), and populateSavePaths().
|
private |
Definition at line 115 of file addnewtorrentdialog.h.
Referenced by accept(), loadMagnet(), reject(), and updateMetadata().
|
private |
Definition at line 117 of file addnewtorrentdialog.h.
Referenced by onSavePathChanged(), and populateSavePaths().
|
private |
Definition at line 124 of file addnewtorrentdialog.h.
Referenced by accept(), and AddNewTorrentDialog().
|
private |
Definition at line 123 of file addnewtorrentdialog.h.
Referenced by loadState(), and saveState().
|
private |
Definition at line 125 of file addnewtorrentdialog.h.
Referenced by accept(), AddNewTorrentDialog(), and populateSavePaths().
|
private |
Definition at line 127 of file addnewtorrentdialog.h.
Referenced by loadState(), and saveState().
|
private |
Definition at line 126 of file addnewtorrentdialog.h.
Referenced by saveState(), and setupTreeview().
|
private |
Definition at line 120 of file addnewtorrentdialog.h.
Referenced by accept(), doNotDeleteTorrentClicked(), handleDownloadFinished(), loadMagnet(), and loadTorrentFile().
|
private |
Definition at line 116 of file addnewtorrentdialog.h.
Referenced by accept(), contentLayoutChanged(), handleDownloadFinished(), hasMetadata(), loadTorrentFile(), loadTorrentImpl(), renameSelectedFile(), saveTorrentFile(), setupTreeview(), updateDiskSpaceLabel(), and updateMetadata().
|
private |
Definition at line 121 of file addnewtorrentdialog.h.
Referenced by accept(), AddNewTorrentDialog(), contentLayoutChanged(), populateSavePaths(), renameSelectedFile(), and setupTreeview().
|
private |
Definition at line 112 of file addnewtorrentdialog.h.
Referenced by accept(), AddNewTorrentDialog(), categoryChanged(), contentLayoutChanged(), displayContentTreeMenu(), loadMagnet(), loadState(), loadTorrentImpl(), onDownloadPathChanged(), onSavePathChanged(), onUseDownloadPathChanged(), populateSavePaths(), renameSelectedFile(), saveState(), setMetadataProgressIndicator(), setupTreeview(), TMMChanged(), updateDiskSpaceLabel(), updateMetadata(), and ~AddNewTorrentDialog().
|
private |
Definition at line 119 of file addnewtorrentdialog.h.
Referenced by onUseDownloadPathChanged(), and populateSavePaths().
|
static |
Definition at line 66 of file addnewtorrentdialog.h.
Referenced by AdvancedSettings::loadAdvancedSettings(), savePathHistoryLength(), and setSavePathHistoryLength().
|
static |
Definition at line 65 of file addnewtorrentdialog.h.
Referenced by AdvancedSettings::loadAdvancedSettings(), savePathHistoryLength(), and setSavePathHistoryLength().