|
|
@ -54,16 +54,16 @@ TorrentCreatorDialog::TorrentCreatorDialog(QWidget *parent, const QString &defau |
|
|
|
, m_storeStartSeeding(SETTINGS_KEY("StartSeeding")) |
|
|
|
, m_storeStartSeeding(SETTINGS_KEY("StartSeeding")) |
|
|
|
, m_storeIgnoreRatio(SETTINGS_KEY("IgnoreRatio")) |
|
|
|
, m_storeIgnoreRatio(SETTINGS_KEY("IgnoreRatio")) |
|
|
|
#if (LIBTORRENT_VERSION_NUM >= 20000) |
|
|
|
#if (LIBTORRENT_VERSION_NUM >= 20000) |
|
|
|
, m_storeTorrentFormat(SETTINGS_KEY("TorrentFormat"), 1) |
|
|
|
, m_storeTorrentFormat(SETTINGS_KEY("TorrentFormat")) |
|
|
|
#else |
|
|
|
#else |
|
|
|
, m_storeOptimizeAlignment(SETTINGS_KEY("OptimizeAlignment"), true) |
|
|
|
, m_storeOptimizeAlignment(SETTINGS_KEY("OptimizeAlignment")) |
|
|
|
, m_paddedFileSizeLimit(SETTINGS_KEY("PaddedFileSizeLimit"), -1) |
|
|
|
, m_paddedFileSizeLimit(SETTINGS_KEY("PaddedFileSizeLimit")) |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
, m_storeLastAddPath(SETTINGS_KEY("LastAddPath"), QDir::homePath()) |
|
|
|
, m_storeLastAddPath(SETTINGS_KEY("LastAddPath")) |
|
|
|
, m_storeTrackerList(SETTINGS_KEY("TrackerList")) |
|
|
|
, m_storeTrackerList(SETTINGS_KEY("TrackerList")) |
|
|
|
, m_storeWebSeedList(SETTINGS_KEY("WebSeedList")) |
|
|
|
, m_storeWebSeedList(SETTINGS_KEY("WebSeedList")) |
|
|
|
, m_storeComments(SETTINGS_KEY("Comments")) |
|
|
|
, m_storeComments(SETTINGS_KEY("Comments")) |
|
|
|
, m_storeLastSavePath(SETTINGS_KEY("LastSavePath"), QDir::homePath()) |
|
|
|
, m_storeLastSavePath(SETTINGS_KEY("LastSavePath")) |
|
|
|
, m_storeSource(SETTINGS_KEY("Source")) |
|
|
|
, m_storeSource(SETTINGS_KEY("Source")) |
|
|
|
{ |
|
|
|
{ |
|
|
|
m_ui->setupUi(this); |
|
|
|
m_ui->setupUi(this); |
|
|
@ -184,7 +184,7 @@ void TorrentCreatorDialog::onCreateButtonClicked() |
|
|
|
input = fi.canonicalFilePath(); |
|
|
|
input = fi.canonicalFilePath(); |
|
|
|
|
|
|
|
|
|
|
|
// get save path
|
|
|
|
// get save path
|
|
|
|
const QString savePath = QString(m_storeLastSavePath) + QLatin1Char('/') + fi.fileName() + QLatin1String(".torrent"); |
|
|
|
const QString savePath = m_storeLastSavePath.get(QDir::homePath()) + QLatin1Char('/') + fi.fileName() + QLatin1String(".torrent"); |
|
|
|
QString destination = QFileDialog::getSaveFileName(this, tr("Select where to save the new torrent"), savePath, tr("Torrent Files (*.torrent)")); |
|
|
|
QString destination = QFileDialog::getSaveFileName(this, tr("Select where to save the new torrent"), savePath, tr("Torrent Files (*.torrent)")); |
|
|
|
if (destination.isEmpty()) |
|
|
|
if (destination.isEmpty()) |
|
|
|
return; |
|
|
|
return; |
|
|
@ -324,7 +324,7 @@ void TorrentCreatorDialog::saveSettings() |
|
|
|
|
|
|
|
|
|
|
|
void TorrentCreatorDialog::loadSettings() |
|
|
|
void TorrentCreatorDialog::loadSettings() |
|
|
|
{ |
|
|
|
{ |
|
|
|
m_ui->textInputPath->setText(m_storeLastAddPath); |
|
|
|
m_ui->textInputPath->setText(m_storeLastAddPath.get(QDir::homePath())); |
|
|
|
|
|
|
|
|
|
|
|
m_ui->comboPieceSize->setCurrentIndex(m_storePieceSize); |
|
|
|
m_ui->comboPieceSize->setCurrentIndex(m_storePieceSize); |
|
|
|
m_ui->checkPrivate->setChecked(m_storePrivateTorrent); |
|
|
|
m_ui->checkPrivate->setChecked(m_storePrivateTorrent); |
|
|
@ -332,10 +332,10 @@ void TorrentCreatorDialog::loadSettings() |
|
|
|
m_ui->checkIgnoreShareLimits->setChecked(m_storeIgnoreRatio); |
|
|
|
m_ui->checkIgnoreShareLimits->setChecked(m_storeIgnoreRatio); |
|
|
|
m_ui->checkIgnoreShareLimits->setEnabled(m_ui->checkStartSeeding->isChecked()); |
|
|
|
m_ui->checkIgnoreShareLimits->setEnabled(m_ui->checkStartSeeding->isChecked()); |
|
|
|
#if (LIBTORRENT_VERSION_NUM >= 20000) |
|
|
|
#if (LIBTORRENT_VERSION_NUM >= 20000) |
|
|
|
m_ui->comboTorrentFormat->setCurrentIndex(m_storeTorrentFormat); |
|
|
|
m_ui->comboTorrentFormat->setCurrentIndex(m_storeTorrentFormat.get(1)); |
|
|
|
#else |
|
|
|
#else |
|
|
|
m_ui->checkOptimizeAlignment->setChecked(m_storeOptimizeAlignment); |
|
|
|
m_ui->checkOptimizeAlignment->setChecked(m_storeOptimizeAlignment.get(true)); |
|
|
|
m_ui->spinPaddedFileSizeLimit->setValue(m_paddedFileSizeLimit); |
|
|
|
m_ui->spinPaddedFileSizeLimit->setValue(m_paddedFileSizeLimit.get(-1)); |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
m_ui->trackersList->setPlainText(m_storeTrackerList); |
|
|
|
m_ui->trackersList->setPlainText(m_storeTrackerList); |
|
|
|