1
0
mirror of https://github.com/d47081/qBittorrent.git synced 2025-01-11 07:18:08 +00:00

Use native file dialogs

This commit is contained in:
Christophe Dumez 2011-01-27 17:30:27 +00:00
parent 2d5612435c
commit 9aae8040ef
2 changed files with 4 additions and 18 deletions

View File

@ -702,15 +702,8 @@ void PropertiesWidget::on_changeSavePathButton_clicked() {
new_path = QFileDialog::getSaveFileName(this, tr("Choose save path"), h.firstFileSavePath());
} else {
const QDir saveDir(TorrentPersistentData::getSavePath(h.hash()));
QFileDialog dlg(this, tr("Choose save path"), saveDir.absolutePath());
dlg.setConfirmOverwrite(false);
dlg.setFileMode(QFileDialog::Directory);
dlg.setOption(QFileDialog::ShowDirsOnly, true);
dlg.setFilter(QDir::AllDirs);
dlg.setAcceptMode(QFileDialog::AcceptSave);
dlg.setNameFilterDetailsVisible(false);
if(dlg.exec())
new_path = dlg.selectedFiles().first();
new_path = QFileDialog::getExistingDirectory(this, tr("Choose save path"), saveDir.absolutePath(),
QFileDialog::DontConfirmOverwrite|QFileDialog::ShowDirsOnly|QFileDialog::HideNameFilterDetails);
}
if(!new_path.isEmpty()){
// Check if savePath exists

View File

@ -218,15 +218,8 @@ void TransferListWidget::setSelectedTorrentsLocation() {
QString dir;
const QDir saveDir(TorrentPersistentData::getSavePath(hashes.first()));
qDebug("Old save path is %s", qPrintable(saveDir.absolutePath()));
QFileDialog dlg(this, tr("Choose save path"), saveDir.absolutePath());
dlg.setConfirmOverwrite(false);
dlg.setFileMode(QFileDialog::Directory);
dlg.setOption(QFileDialog::ShowDirsOnly, true);
dlg.setFilter(QDir::AllDirs);
dlg.setAcceptMode(QFileDialog::AcceptSave);
dlg.setNameFilterDetailsVisible(false);
if(dlg.exec())
dir = dlg.selectedFiles().first();
dir = QFileDialog::getExistingDirectory(this, tr("Choose save path"), saveDir.absolutePath(),
QFileDialog::DontConfirmOverwrite|QFileDialog::ShowDirsOnly|QFileDialog::HideNameFilterDetails);
if(!dir.isNull()) {
qDebug("New path is %s", qPrintable(dir));
// Check if savePath exists