summaryrefslogtreecommitdiffstats
path: root/rbutil/rbutilqt/installtalkwindow.cpp
diff options
context:
space:
mode:
authorDominik Riebeling <Dominik.Riebeling@gmail.com>2012-10-06 11:30:26 +0200
committerDominik Riebeling <Dominik.Riebeling@gmail.com>2012-10-06 13:53:09 +0200
commita2dd1625bcfb1272cb711dc35896924817af3c0c (patch)
tree03db39ad5a2f3ff120dd89dd1a91865b80c44e66 /rbutil/rbutilqt/installtalkwindow.cpp
parent4d96b4c7b0a7560edd1cbb47f4f31938541a53dd (diff)
downloadrockbox-a2dd1625bcfb1272cb711dc35896924817af3c0c.tar.gz
rockbox-a2dd1625bcfb1272cb711dc35896924817af3c0c.tar.bz2
rockbox-a2dd1625bcfb1272cb711dc35896924817af3c0c.zip
Check selection before trying to create talk files.
This prevents users from accidentially trying to create talk files for nothing. Change-Id: I92eae0e0dc14a772c786bcdad67f404fe3786376
Diffstat (limited to 'rbutil/rbutilqt/installtalkwindow.cpp')
-rw-r--r--rbutil/rbutilqt/installtalkwindow.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/rbutil/rbutilqt/installtalkwindow.cpp b/rbutil/rbutilqt/installtalkwindow.cpp
index f6e67720f5..95aad659ed 100644
--- a/rbutil/rbutilqt/installtalkwindow.cpp
+++ b/rbutil/rbutilqt/installtalkwindow.cpp
@@ -87,12 +87,20 @@ void InstallTalkWindow::change()
void InstallTalkWindow::accept()
{
+ saveSettings();
+ QStringList foldersToTalk
+ = RbSettings::value(RbSettings::TalkFolders).toStringList();
+ if(foldersToTalk.size() == 0) {
+ QMessageBox::information(this, tr("Empty selection"),
+ tr("No files or folders selected. Please select files or "
+ "folders first."));
+ return;
+ }
+
logger = new ProgressLoggerGui(this);
- saveSettings();
connect(logger,SIGNAL(closed()),this,SLOT(close()));
logger->show();
- saveSettings();
talkcreator->setMountPoint(RbSettings::value(RbSettings::Mountpoint).toString());
@@ -108,8 +116,6 @@ void InstallTalkWindow::accept()
connect(talkcreator, SIGNAL(logProgress(int, int)), logger, SLOT(setProgress(int, int)));
connect(logger,SIGNAL(aborted()),talkcreator,SLOT(abort()));
- QStringList foldersToTalk
- = RbSettings::value(RbSettings::TalkFolders).toStringList();
for(int i = 0; i < foldersToTalk.size(); i++) {
qDebug() << "[InstallTalkWindow] creating talk files for folder"
<< foldersToTalk.at(i);