summaryrefslogtreecommitdiffstats
path: root/rbutil/rbutilqt/installtalkwindow.cpp
diff options
context:
space:
mode:
authorDominik Wenger <domonoky@googlemail.com>2007-08-07 17:49:35 +0000
committerDominik Wenger <domonoky@googlemail.com>2007-08-07 17:49:35 +0000
commit2ee205ae0de2c8dc6db150465175e737cfa79784 (patch)
tree3c7da4b2fca32b6d37a19ec95ea919bacd14dae5 /rbutil/rbutilqt/installtalkwindow.cpp
parent3a4e540c3db4309990965455b0686230345be002 (diff)
downloadrockbox-2ee205ae0de2c8dc6db150465175e737cfa79784.tar.gz
rockbox-2ee205ae0de2c8dc6db150465175e737cfa79784.tar.bz2
rockbox-2ee205ae0de2c8dc6db150465175e737cfa79784.zip
rbutilqt: use the new dirbrowser in the talkfile generation. Also little changes to the dirbrowser to run it statically and without signals.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14234 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'rbutil/rbutilqt/installtalkwindow.cpp')
-rw-r--r--rbutil/rbutilqt/installtalkwindow.cpp78
1 files changed, 48 insertions, 30 deletions
diff --git a/rbutil/rbutilqt/installtalkwindow.cpp b/rbutil/rbutilqt/installtalkwindow.cpp
index 4d1cdb1491..82efa20a88 100644
--- a/rbutil/rbutilqt/installtalkwindow.cpp
+++ b/rbutil/rbutilqt/installtalkwindow.cpp
@@ -20,6 +20,8 @@
#include "installtalkwindow.h"
#include "ui_installtalkfrm.h"
+#include "browsedirtree.h"
+
InstallTalkWindow::InstallTalkWindow(QWidget *parent) : QDialog(parent)
{
ui.setupUi(this);
@@ -43,18 +45,23 @@ InstallTalkWindow::InstallTalkWindow(QWidget *parent) : QDialog(parent)
void InstallTalkWindow::browseFolder()
{
- QFileDialog browser(this);
+ BrowseDirtree browser(this);
+ browser.setFilter(QDir::AllDirs | QDir::NoDotAndDotDot | QDir::NoSymLinks);
+
if(QFileInfo(ui.lineTalkFolder->text()).isDir())
- browser.setDirectory(ui.lineTalkFolder->text());
+ {
+ QDir d(ui.lineTalkFolder->text());
+ browser.setDir(d);
+ }
else
- browser.setDirectory("/media");
- browser.setReadOnly(true);
- browser.setFileMode(QFileDialog::DirectoryOnly);
- browser.setAcceptMode(QFileDialog::AcceptOpen);
- if(browser.exec()) {
- qDebug() << browser.directory();
- QStringList files = browser.selectedFiles();
- setTalkFolder(files.at(0));
+ {
+ QDir d("/media");
+ browser.setDir(d);
+ }
+ if(browser.exec() == QDialog::Accepted)
+ {
+ qDebug() << browser.getSelected();
+ setTalkFolder(browser.getSelected());
}
}
@@ -66,19 +73,25 @@ void InstallTalkWindow::setTalkFolder(QString folder)
void InstallTalkWindow::browseTTS()
{
- QFileDialog browser(this);
+ BrowseDirtree browser(this);
+ browser.setFilter(QDir::Dirs | QDir::Files | QDir::NoDotAndDotDot);
+
if(QFileInfo(ui.TTSpath->text()).isDir())
- browser.setDirectory(ui.TTSpath->text());
+ {
+ QDir d(ui.TTSpath->text());
+ browser.setDir(d);
+ }
else
- browser.setDirectory("/media");
- browser.setReadOnly(true);
- browser.setFileMode(QFileDialog::ExistingFile);
- browser.setAcceptMode(QFileDialog::AcceptOpen);
- if(browser.exec()) {
- qDebug() << browser.directory();
- QStringList files = browser.selectedFiles();
- setTTSExec(files.at(0));
+ {
+ QDir d("/media");
+ browser.setDir(d);
+ }
+ if(browser.exec() == QDialog::Accepted)
+ {
+ qDebug() << browser.getSelected();
+ setTTSExec(browser.getSelected());
}
+
}
void InstallTalkWindow::setTTSExec(QString path)
@@ -89,18 +102,23 @@ void InstallTalkWindow::setTTSExec(QString path)
void InstallTalkWindow::browseEncoder()
{
- QFileDialog browser(this);
+ BrowseDirtree browser(this);
+ browser.setFilter(QDir::Dirs | QDir::Files | QDir::NoDotAndDotDot);
+
if(QFileInfo(ui.Encoderpath->text()).isDir())
- browser.setDirectory(ui.Encoderpath->text());
+ {
+ QDir d(ui.Encoderpath->text());
+ browser.setDir(d);
+ }
else
- browser.setDirectory("/media");
- browser.setReadOnly(true);
- browser.setFileMode(QFileDialog::ExistingFile);
- browser.setAcceptMode(QFileDialog::AcceptOpen);
- if(browser.exec()) {
- qDebug() << browser.directory();
- QStringList files = browser.selectedFiles();
- setEncoderExec(files.at(0));
+ {
+ QDir d("/media");
+ browser.setDir(d);
+ }
+ if(browser.exec() == QDialog::Accepted)
+ {
+ qDebug() << browser.getSelected();
+ setEncoderExec(browser.getSelected());
}
}