summaryrefslogtreecommitdiffstats
path: root/rbutil/rbutilqt/installtalkwindow.cpp
diff options
context:
space:
mode:
authorDominik Riebeling <Dominik.Riebeling@gmail.com>2010-02-16 21:34:39 +0000
committerDominik Riebeling <Dominik.Riebeling@gmail.com>2010-02-16 21:34:39 +0000
commit7e91332e398db9f344e44df3b2ea29adc94ad56e (patch)
tree5f35421351efa7b816c4745c3d673c53f740ff76 /rbutil/rbutilqt/installtalkwindow.cpp
parentb1908e95e130b766af113a264b145da06bbeeb31 (diff)
downloadrockbox-7e91332e398db9f344e44df3b2ea29adc94ad56e.tar.gz
rockbox-7e91332e398db9f344e44df3b2ea29adc94ad56e.tar.bz2
rockbox-7e91332e398db9f344e44df3b2ea29adc94ad56e.zip
Use QFileDialog::getExistingDirectory() for path selection.
This makes it possible for native dialogs to get used on Windows and OS X. The mountpoint selection dialog needs special handling and still uses the BrowseDirtree class for now. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24703 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'rbutil/rbutilqt/installtalkwindow.cpp')
-rw-r--r--rbutil/rbutilqt/installtalkwindow.cpp23
1 files changed, 10 insertions, 13 deletions
diff --git a/rbutil/rbutilqt/installtalkwindow.cpp b/rbutil/rbutilqt/installtalkwindow.cpp
index fb604e71e2..8c09d684c8 100644
--- a/rbutil/rbutilqt/installtalkwindow.cpp
+++ b/rbutil/rbutilqt/installtalkwindow.cpp
@@ -42,28 +42,24 @@ InstallTalkWindow::InstallTalkWindow(QWidget *parent) : QDialog(parent)
void InstallTalkWindow::browseFolder()
{
- BrowseDirtree browser(this);
- browser.setFilter(QDir::AllDirs | QDir::NoDotAndDotDot | QDir::NoSymLinks);
-
+ QString selected;
+ QString startfolder;
if(QFileInfo(ui.lineTalkFolder->text()).isDir())
{
- browser.setDir(ui.lineTalkFolder->text());
+ startfolder = ui.lineTalkFolder->text();
}
else
{
- browser.setDir("/media"); // FIXME: This looks Linux specific
+ startfolder = "/media"; // FIXME: This looks Linux specific
}
- if(browser.exec() == QDialog::Accepted)
+ selected = QFileDialog::getExistingDirectory(this,
+ tr("Select folder to create talk files"), startfolder);
+ if(!selected.isEmpty())
{
- qDebug() << browser.getSelected();
- setTalkFolder(browser.getSelected());
+ ui.lineTalkFolder->setText(selected);
}
}
-void InstallTalkWindow::setTalkFolder(QString folder)
-{
- ui.lineTalkFolder->setText(folder);
-}
void InstallTalkWindow::change()
{
@@ -145,7 +141,8 @@ void InstallTalkWindow::updateSettings(void)
ui.labelEncProfile->setText(tr("Selected encoder: <b>%1</b>")
.arg("Invalid encoder configuration!"));
- setTalkFolder(RbSettings::value(RbSettings::LastTalkedFolder).toString());
+ ui.lineTalkFolder->setText(
+ RbSettings::value(RbSettings::LastTalkedFolder).toString());
emit settingsUpdated();
}