|
|
@ -1420,15 +1420,11 @@ void OptionsDialog::on_browseExportDirFinButton_clicked() |
|
|
|
|
|
|
|
|
|
|
|
void OptionsDialog::on_browseFilterButton_clicked() |
|
|
|
void OptionsDialog::on_browseFilterButton_clicked() |
|
|
|
{ |
|
|
|
{ |
|
|
|
const QString filter_path = Utils::Fs::expandPathAbs(m_ui->textFilterPath->text()); |
|
|
|
QDir lastDir(Utils::Fs::fromNativePath(m_ui->textFilterPath->text())); |
|
|
|
QDir filterDir(filter_path); |
|
|
|
QString lastPath = lastDir.exists() ? lastDir.absolutePath() : QDir::homePath(); |
|
|
|
QString ipfilter; |
|
|
|
QString newPath = QFileDialog::getOpenFileName(this, tr("Choose an IP filter file"), lastPath, tr("All supported filters") + QString(" (*.dat *.p2p *.p2b);;.dat (*.dat);;.p2p (*.p2p);;.p2b (*.p2b)")); |
|
|
|
if (!filter_path.isEmpty() && filterDir.exists()) |
|
|
|
if (!newPath.isEmpty()) |
|
|
|
ipfilter = QFileDialog::getOpenFileName(this, tr("Choose an IP filter file"), filterDir.absolutePath(), tr("Filters") + QString(" (*.dat *.p2p *.p2b)")); |
|
|
|
m_ui->textFilterPath->setText(Utils::Fs::toNativePath(newPath)); |
|
|
|
else |
|
|
|
|
|
|
|
ipfilter = QFileDialog::getOpenFileName(this, tr("Choose an IP filter file"), QDir::homePath(), tr("Filters") + QString(" (*.dat *.p2p *.p2b)")); |
|
|
|
|
|
|
|
if (!ipfilter.isNull()) |
|
|
|
|
|
|
|
m_ui->textFilterPath->setText(Utils::Fs::toNativePath(ipfilter)); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Display dialog to choose save dir
|
|
|
|
// Display dialog to choose save dir
|
|
|
|