|
|
@ -90,7 +90,7 @@ options_imp::options_imp(QWidget *parent):QDialog(parent){ |
|
|
|
locales << "nl_NL"; |
|
|
|
locales << "nl_NL"; |
|
|
|
comboI18n->addItem((QIcon(QString::fromUtf8(":/Icons/flags/spain.png"))), QString::fromUtf8("Español")); |
|
|
|
comboI18n->addItem((QIcon(QString::fromUtf8(":/Icons/flags/spain.png"))), QString::fromUtf8("Español")); |
|
|
|
locales << "es_ES"; |
|
|
|
locales << "es_ES"; |
|
|
|
comboI18n->addItem((QIcon(QString::fromUtf8(":/Icons/flags/spain_catalunya.png"))), QString::fromUtf8("Català")); |
|
|
|
comboI18n->addItem((QIcon(QString::fromUtf8(":/Icons/flags/spain_catalunya.png"))), QString::fromUtf8("Català ")); |
|
|
|
locales << "ca_ES"; |
|
|
|
locales << "ca_ES"; |
|
|
|
comboI18n->addItem((QIcon(QString::fromUtf8(":/Icons/flags/portugal.png"))), QString::fromUtf8("Português")); |
|
|
|
comboI18n->addItem((QIcon(QString::fromUtf8(":/Icons/flags/portugal.png"))), QString::fromUtf8("Português")); |
|
|
|
locales << "pt_PT"; |
|
|
|
locales << "pt_PT"; |
|
|
@ -110,7 +110,7 @@ options_imp::options_imp(QWidget *parent):QDialog(parent){ |
|
|
|
locales << "ro_RO"; |
|
|
|
locales << "ro_RO"; |
|
|
|
comboI18n->addItem((QIcon(QString::fromUtf8(":/Icons/flags/turkey.png"))), QString::fromUtf8("Türkçe")); |
|
|
|
comboI18n->addItem((QIcon(QString::fromUtf8(":/Icons/flags/turkey.png"))), QString::fromUtf8("Türkçe")); |
|
|
|
locales << "tr_TR"; |
|
|
|
locales << "tr_TR"; |
|
|
|
comboI18n->addItem((QIcon(QString::fromUtf8(":/Icons/flags/saoudi_arabia.png"))), QString::fromUtf8("عربي")); |
|
|
|
comboI18n->addItem((QIcon(QString::fromUtf8(":/Icons/flags/saoudi_arabia.png"))), QString::fromUtf8("عربي")); |
|
|
|
locales << "ar_SA"; |
|
|
|
locales << "ar_SA"; |
|
|
|
comboI18n->addItem((QIcon(QString::fromUtf8(":/Icons/flags/greece.png"))), QString::fromUtf8("Ελληνικά")); |
|
|
|
comboI18n->addItem((QIcon(QString::fromUtf8(":/Icons/flags/greece.png"))), QString::fromUtf8("Ελληνικά")); |
|
|
|
locales << "el_GR"; |
|
|
|
locales << "el_GR"; |
|
|
@ -126,7 +126,7 @@ comboI18n->addItem((QIcon(QString::fromUtf8(":/Icons/flags/saoudi_arabia.png"))) |
|
|
|
locales << "bg_BG"; |
|
|
|
locales << "bg_BG"; |
|
|
|
comboI18n->addItem((QIcon(QString::fromUtf8(":/Icons/flags/ukraine.png"))), QString::fromUtf8("Українська")); |
|
|
|
comboI18n->addItem((QIcon(QString::fromUtf8(":/Icons/flags/ukraine.png"))), QString::fromUtf8("Українська")); |
|
|
|
locales << "uk_UA"; |
|
|
|
locales << "uk_UA"; |
|
|
|
comboI18n->addItem((QIcon(QString::fromUtf8(":/Icons/flags/russia.png"))), QString::fromUtf8("Русский")); |
|
|
|
comboI18n->addItem((QIcon(QString::fromUtf8(":/Icons/flags/russia.png"))), QString::fromUtf8("РуÑ<EFBFBD>Ñ<EFBFBD>кий")); |
|
|
|
locales << "ru_RU"; |
|
|
|
locales << "ru_RU"; |
|
|
|
comboI18n->addItem((QIcon(QString::fromUtf8(":/Icons/flags/japan.png"))), QString::fromUtf8("日本語")); |
|
|
|
comboI18n->addItem((QIcon(QString::fromUtf8(":/Icons/flags/japan.png"))), QString::fromUtf8("日本語")); |
|
|
|
locales << "ja_JP"; |
|
|
|
locales << "ja_JP"; |
|
|
@ -391,9 +391,17 @@ void options_imp::saveOptions(){ |
|
|
|
settings.endGroup(); |
|
|
|
settings.endGroup(); |
|
|
|
// Downloads preferences
|
|
|
|
// Downloads preferences
|
|
|
|
settings.beginGroup("Downloads"); |
|
|
|
settings.beginGroup("Downloads"); |
|
|
|
settings.setValue(QString::fromUtf8("SavePath"), getSavePath()); |
|
|
|
QString save_path = getSavePath(); |
|
|
|
|
|
|
|
#ifdef Q_WS_WIN |
|
|
|
|
|
|
|
save_path = save_path.replace("\\", "/"); |
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
settings.setValue(QString::fromUtf8("SavePath"), save_path); |
|
|
|
settings.setValue(QString::fromUtf8("TempPathEnabled"), isTempPathEnabled()); |
|
|
|
settings.setValue(QString::fromUtf8("TempPathEnabled"), isTempPathEnabled()); |
|
|
|
settings.setValue(QString::fromUtf8("TempPath"), getTempPath()); |
|
|
|
QString temp_path = getTempPath(); |
|
|
|
|
|
|
|
#ifdef Q_WS_WIN |
|
|
|
|
|
|
|
temp_path = temp_path.replace("\\", "/"); |
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
settings.setValue(QString::fromUtf8("TempPath"), temp_path); |
|
|
|
settings.setValue(QString::fromUtf8("AppendLabel"), checkAppendLabel->isChecked()); |
|
|
|
settings.setValue(QString::fromUtf8("AppendLabel"), checkAppendLabel->isChecked()); |
|
|
|
#ifdef LIBTORRENT_0_15 |
|
|
|
#ifdef LIBTORRENT_0_15 |
|
|
|
settings.setValue(QString::fromUtf8("UseIncompleteExtension"), checkAppendqB->isChecked()); |
|
|
|
settings.setValue(QString::fromUtf8("UseIncompleteExtension"), checkAppendqB->isChecked()); |
|
|
@ -403,7 +411,11 @@ void options_imp::saveOptions(){ |
|
|
|
settings.setValue(QString::fromUtf8("StartInPause"), addTorrentsInPause()); |
|
|
|
settings.setValue(QString::fromUtf8("StartInPause"), addTorrentsInPause()); |
|
|
|
ScanFoldersModel::instance()->makePersistent(settings); |
|
|
|
ScanFoldersModel::instance()->makePersistent(settings); |
|
|
|
addedScanDirs.clear(); |
|
|
|
addedScanDirs.clear(); |
|
|
|
Preferences::setExportDir(getExportDir()); |
|
|
|
QString export_dir = getExportDir(); |
|
|
|
|
|
|
|
#ifdef Q_WS_WIN |
|
|
|
|
|
|
|
export_dir = export_dir.replace("\\", "/"); |
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
Preferences::setExportDir(export_dir); |
|
|
|
settings.setValue(QString::fromUtf8("DblClOnTorDl"), getActionOnDblClOnTorrentDl()); |
|
|
|
settings.setValue(QString::fromUtf8("DblClOnTorDl"), getActionOnDblClOnTorrentDl()); |
|
|
|
settings.setValue(QString::fromUtf8("DblClOnTorFn"), getActionOnDblClOnTorrentFn()); |
|
|
|
settings.setValue(QString::fromUtf8("DblClOnTorFn"), getActionOnDblClOnTorrentFn()); |
|
|
|
// End Downloads preferences
|
|
|
|
// End Downloads preferences
|
|
|
@ -489,7 +501,11 @@ void options_imp::saveOptions(){ |
|
|
|
settings.beginGroup("IPFilter"); |
|
|
|
settings.beginGroup("IPFilter"); |
|
|
|
settings.setValue(QString::fromUtf8("Enabled"), isFilteringEnabled()); |
|
|
|
settings.setValue(QString::fromUtf8("Enabled"), isFilteringEnabled()); |
|
|
|
if(isFilteringEnabled()){ |
|
|
|
if(isFilteringEnabled()){ |
|
|
|
settings.setValue(QString::fromUtf8("File"), textFilterPath->text()); |
|
|
|
QString filter_path = textFilterPath->text(); |
|
|
|
|
|
|
|
#ifdef Q_WS_WIN |
|
|
|
|
|
|
|
filter_path = filter_path.replace("\\", "/"); |
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
settings.setValue(QString::fromUtf8("File"), filter_path); |
|
|
|
} |
|
|
|
} |
|
|
|
// End IPFilter preferences
|
|
|
|
// End IPFilter preferences
|
|
|
|
settings.endGroup(); |
|
|
|
settings.endGroup(); |
|
|
@ -609,7 +625,11 @@ void options_imp::loadOptions(){ |
|
|
|
} |
|
|
|
} |
|
|
|
// End General preferences
|
|
|
|
// End General preferences
|
|
|
|
// Downloads preferences
|
|
|
|
// Downloads preferences
|
|
|
|
textSavePath->setText(Preferences::getSavePath()); |
|
|
|
QString save_path = Preferences::getSavePath(); |
|
|
|
|
|
|
|
#ifdef Q_WS_WIN |
|
|
|
|
|
|
|
save_path = save_path.replace("/", "\\"); |
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
textSavePath->setText(save_path); |
|
|
|
if(Preferences::isTempPathEnabled()) { |
|
|
|
if(Preferences::isTempPathEnabled()) { |
|
|
|
// enable
|
|
|
|
// enable
|
|
|
|
checkTempFolder->setChecked(true); |
|
|
|
checkTempFolder->setChecked(true); |
|
|
@ -618,7 +638,11 @@ void options_imp::loadOptions(){ |
|
|
|
checkTempFolder->setChecked(false); |
|
|
|
checkTempFolder->setChecked(false); |
|
|
|
enableTempPathInput(checkTempFolder->isChecked()); |
|
|
|
enableTempPathInput(checkTempFolder->isChecked()); |
|
|
|
} |
|
|
|
} |
|
|
|
textTempPath->setText(Preferences::getTempPath()); |
|
|
|
QString temp_path = Preferences::getTempPath(); |
|
|
|
|
|
|
|
#ifdef Q_WS_WIN |
|
|
|
|
|
|
|
temp_path = temp_path.replace("/", "\\"); |
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
textTempPath->setText(temp_path); |
|
|
|
checkAppendLabel->setChecked(Preferences::appendTorrentLabel()); |
|
|
|
checkAppendLabel->setChecked(Preferences::appendTorrentLabel()); |
|
|
|
#ifdef LIBTORRENT_0_15 |
|
|
|
#ifdef LIBTORRENT_0_15 |
|
|
|
checkAppendqB->setChecked(Preferences::useIncompleteFilesExtension()); |
|
|
|
checkAppendqB->setChecked(Preferences::useIncompleteFilesExtension()); |
|
|
@ -635,6 +659,9 @@ void options_imp::loadOptions(){ |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
// enable
|
|
|
|
// enable
|
|
|
|
checkExportDir->setChecked(true); |
|
|
|
checkExportDir->setChecked(true); |
|
|
|
|
|
|
|
#ifdef Q_WS_WIN |
|
|
|
|
|
|
|
strValue = strValue.replace("/", "\\"); |
|
|
|
|
|
|
|
#endif |
|
|
|
textExportDir->setText(strValue); |
|
|
|
textExportDir->setText(strValue); |
|
|
|
enableTorrentExport(checkExportDir->isChecked()); |
|
|
|
enableTorrentExport(checkExportDir->isChecked()); |
|
|
|
} |
|
|
|
} |
|
|
@ -1023,16 +1050,12 @@ float options_imp::getDeleteRatio() const{ |
|
|
|
|
|
|
|
|
|
|
|
// Return Save Path
|
|
|
|
// Return Save Path
|
|
|
|
QString options_imp::getSavePath() const{ |
|
|
|
QString options_imp::getSavePath() const{ |
|
|
|
|
|
|
|
if(textSavePath->text().trimmed().isEmpty()){ |
|
|
|
|
|
|
|
QString save_path = Preferences::getSavePath(); |
|
|
|
#ifdef Q_WS_WIN |
|
|
|
#ifdef Q_WS_WIN |
|
|
|
QString home = QDir::rootPath(); |
|
|
|
save_path = save_path.replace("/", "\\"); |
|
|
|
#else |
|
|
|
|
|
|
|
QString home = QDir::homePath(); |
|
|
|
|
|
|
|
#endif |
|
|
|
#endif |
|
|
|
if(home[home.length()-1] != QDir::separator()){ |
|
|
|
textSavePath->setText(save_path); |
|
|
|
home += QDir::separator(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if(textSavePath->text().trimmed().isEmpty()){ |
|
|
|
|
|
|
|
textSavePath->setText(home+QString::fromUtf8("qBT_dir")); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
return misc::expandPath(textSavePath->text()); |
|
|
|
return misc::expandPath(textSavePath->text()); |
|
|
|
} |
|
|
|
} |
|
|
@ -1428,6 +1451,9 @@ void options_imp::on_browseExportDirButton_clicked() { |
|
|
|
dir = QFileDialog::getExistingDirectory(this, tr("Choose export directory"), QDir::homePath()); |
|
|
|
dir = QFileDialog::getExistingDirectory(this, tr("Choose export directory"), QDir::homePath()); |
|
|
|
} |
|
|
|
} |
|
|
|
if(!dir.isNull()){ |
|
|
|
if(!dir.isNull()){ |
|
|
|
|
|
|
|
#ifdef Q_WS_WIN |
|
|
|
|
|
|
|
dir = dir.replace("/", "\\"); |
|
|
|
|
|
|
|
#endif |
|
|
|
textExportDir->setText(dir); |
|
|
|
textExportDir->setText(dir); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -1442,6 +1468,9 @@ void options_imp::on_browseFilterButton_clicked() { |
|
|
|
ipfilter = QFileDialog::getOpenFileName(this, tr("Choose an ip filter file"), QDir::homePath(), tr("Filters")+QString(" (*.dat *.p2p *.p2b)")); |
|
|
|
ipfilter = QFileDialog::getOpenFileName(this, tr("Choose an ip filter file"), QDir::homePath(), tr("Filters")+QString(" (*.dat *.p2p *.p2b)")); |
|
|
|
} |
|
|
|
} |
|
|
|
if(!ipfilter.isNull()){ |
|
|
|
if(!ipfilter.isNull()){ |
|
|
|
|
|
|
|
#ifdef Q_WS_WIN |
|
|
|
|
|
|
|
ipfilter = ipfilter.replace("/", "\\"); |
|
|
|
|
|
|
|
#endif |
|
|
|
textFilterPath->setText(ipfilter); |
|
|
|
textFilterPath->setText(ipfilter); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -1457,6 +1486,9 @@ void options_imp::on_browseSaveDirButton_clicked(){ |
|
|
|
dir = QFileDialog::getExistingDirectory(this, tr("Choose a save directory"), QDir::homePath()); |
|
|
|
dir = QFileDialog::getExistingDirectory(this, tr("Choose a save directory"), QDir::homePath()); |
|
|
|
} |
|
|
|
} |
|
|
|
if(!dir.isNull()){ |
|
|
|
if(!dir.isNull()){ |
|
|
|
|
|
|
|
#ifdef Q_WS_WIN |
|
|
|
|
|
|
|
dir = dir.replace("/", "\\"); |
|
|
|
|
|
|
|
#endif |
|
|
|
textSavePath->setText(dir); |
|
|
|
textSavePath->setText(dir); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -1471,6 +1503,9 @@ void options_imp::on_browseTempDirButton_clicked(){ |
|
|
|
dir = QFileDialog::getExistingDirectory(this, tr("Choose a save directory"), QDir::homePath()); |
|
|
|
dir = QFileDialog::getExistingDirectory(this, tr("Choose a save directory"), QDir::homePath()); |
|
|
|
} |
|
|
|
} |
|
|
|
if(!dir.isNull()){ |
|
|
|
if(!dir.isNull()){ |
|
|
|
|
|
|
|
#ifdef Q_WS_WIN |
|
|
|
|
|
|
|
dir = dir.replace("/", "\\"); |
|
|
|
|
|
|
|
#endif |
|
|
|
textTempPath->setText(dir); |
|
|
|
textTempPath->setText(dir); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|