1 /***************************************************************************
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
9 * Copyright (C) 2007 by Dominik Riebeling
12 * All files in this archive are subject to the GNU General Public License.
13 * See the file COPYING in the source tree root for full license agreement.
15 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
16 * KIND, either express or implied.
18 ****************************************************************************/
23 #include "configure.h"
24 #include "autodetection.h"
25 #include "ui_configurefrm.h"
26 #include "browsedirtree.h"
30 #include "encttscfggui.h"
31 #include "rbsettings.h"
34 #if defined(Q_OS_WIN32)
42 #define DEFAULT_LANG "English (en)"
43 #define DEFAULT_LANG_CODE "en"
45 Config::Config(QWidget
*parent
,int index
) : QDialog(parent
)
47 programPath
= qApp
->applicationDirPath() + "/";
49 ui
.tabConfiguration
->setCurrentIndex(index
);
50 ui
.radioManualProxy
->setChecked(true);
51 QRegExpValidator
*proxyValidator
= new QRegExpValidator(this);
52 QRegExp
validate("[0-9]*");
53 proxyValidator
->setRegExp(validate
);
54 ui
.proxyPort
->setValidator(proxyValidator
);
55 #if !defined(Q_OS_LINUX) && !defined(Q_OS_WIN32)
56 ui
.radioSystemProxy
->setEnabled(false); // not on macox for now
58 // build language list and sort alphabetically
59 QStringList langs
= findLanguageFiles();
60 for(int i
= 0; i
< langs
.size(); ++i
)
61 lang
.insert(languageName(langs
.at(i
))
62 + QString(" (%1)").arg(langs
.at(i
)), langs
.at(i
));
63 lang
.insert(DEFAULT_LANG
, DEFAULT_LANG_CODE
);
64 QMap
<QString
, QString
>::const_iterator i
= lang
.constBegin();
65 while (i
!= lang
.constEnd()) {
66 ui
.listLanguages
->addItem(i
.key());
69 ui
.listLanguages
->setSelectionMode(QAbstractItemView::SingleSelection
);
70 ui
.proxyPass
->setEchoMode(QLineEdit::Password
);
71 ui
.treeDevices
->setAlternatingRowColors(true);
72 ui
.listLanguages
->setAlternatingRowColors(true);
74 /* Explicitly set some widgets to have left-to-right layout */
75 ui
.treeDevices
->setLayoutDirection(Qt::LeftToRight
);
76 ui
.mountPoint
->setLayoutDirection(Qt::LeftToRight
);
77 ui
.proxyHost
->setLayoutDirection(Qt::LeftToRight
);
78 ui
.proxyPort
->setLayoutDirection(Qt::LeftToRight
);
79 ui
.proxyUser
->setLayoutDirection(Qt::LeftToRight
);
80 ui
.proxyPass
->setLayoutDirection(Qt::LeftToRight
);
81 ui
.listLanguages
->setLayoutDirection(Qt::LeftToRight
);
82 ui
.cachePath
->setLayoutDirection(Qt::LeftToRight
);
86 connect(ui
.buttonOk
, SIGNAL(clicked()), this, SLOT(accept()));
87 connect(ui
.buttonCancel
, SIGNAL(clicked()), this, SLOT(abort()));
88 connect(ui
.radioNoProxy
, SIGNAL(toggled(bool)), this, SLOT(setNoProxy(bool)));
89 connect(ui
.radioSystemProxy
, SIGNAL(toggled(bool)), this, SLOT(setSystemProxy(bool)));
90 connect(ui
.browseMountPoint
, SIGNAL(clicked()), this, SLOT(browseFolder()));
91 connect(ui
.buttonAutodetect
,SIGNAL(clicked()),this,SLOT(autodetect()));
92 connect(ui
.buttonCacheBrowse
, SIGNAL(clicked()), this, SLOT(browseCache()));
93 connect(ui
.buttonCacheClear
, SIGNAL(clicked()), this, SLOT(cacheClear()));
94 connect(ui
.configTts
, SIGNAL(clicked()), this, SLOT(configTts()));
95 connect(ui
.configEncoder
, SIGNAL(clicked()), this, SLOT(configEnc()));
96 connect(ui
.comboTts
, SIGNAL(currentIndexChanged(int)), this, SLOT(updateTtsState(int)));
97 connect(ui
.treeDevices
, SIGNAL(itemSelectionChanged()), this, SLOT(updateEncState()));
98 connect(ui
.testTTS
,SIGNAL(clicked()),this,SLOT(testTts()));
104 void Config::accept()
106 qDebug() << "[Config] checking configuration";
107 QString errormsg
= tr("The following errors occurred:") + "<ul>";
110 // proxy: save entered proxy values, not displayed.
111 if(ui
.radioManualProxy
->isChecked()) {
112 proxy
.setScheme("http");
113 proxy
.setUserName(ui
.proxyUser
->text());
114 proxy
.setPassword(ui
.proxyPass
->text());
115 proxy
.setHost(ui
.proxyHost
->text());
116 proxy
.setPort(ui
.proxyPort
->text().toInt());
119 RbSettings::setValue(RbSettings::Proxy
, proxy
.toString());
120 qDebug() << "[Config] setting proxy to:" << proxy
;
123 if(ui
.radioNoProxy
->isChecked()) proxyType
= "none";
124 else if(ui
.radioSystemProxy
->isChecked()) proxyType
= "system";
125 else proxyType
= "manual";
126 RbSettings::setValue(RbSettings::ProxyType
, proxyType
);
129 if(RbSettings::value(RbSettings::Language
).toString() != language
130 && !language
.isEmpty()) {
131 QMessageBox::information(this, tr("Language changed"),
132 tr("You need to restart the application for the changed language to take effect."));
133 RbSettings::setValue(RbSettings::Language
, language
);
137 QString mp
= ui
.mountPoint
->text();
139 errormsg
+= "<li>" + tr("No mountpoint given") + "</li>";
142 else if(!QFileInfo(mp
).exists()) {
143 errormsg
+= "<li>" + tr("Mountpoint does not exist") + "</li>";
146 else if(!QFileInfo(mp
).isDir()) {
147 errormsg
+= "<li>" + tr("Mountpoint is not a directory.") + "</li>";
150 else if(!QFileInfo(mp
).isWritable()) {
151 errormsg
+= "<li>" + tr("Mountpoint is not writeable") + "</li>";
155 RbSettings::setValue(RbSettings::Mountpoint
, QDir::fromNativeSeparators(mp
));
160 if(ui
.treeDevices
->selectedItems().size() != 0) {
161 nplat
= ui
.treeDevices
->selectedItems().at(0)->data(0, Qt::UserRole
).toString();
162 RbSettings::setValue(RbSettings::Platform
, nplat
);
165 errormsg
+= "<li>" + tr("No player selected") + "</li>";
170 if(QFileInfo(ui
.cachePath
->text()).isDir()) {
171 if(!QFileInfo(ui
.cachePath
->text()).isWritable()) {
172 errormsg
+= "<li>" + tr("Cache path not writeable. Leave path empty "
173 "to default to systems temporary path.") + "</li>";
177 RbSettings::setValue(RbSettings::CachePath
, ui
.cachePath
->text());
179 else // default to system temp path
180 RbSettings::setValue(RbSettings::CachePath
, QDir::tempPath());
181 RbSettings::setValue(RbSettings::CacheDisabled
, ui
.cacheDisable
->isChecked());
182 RbSettings::setValue(RbSettings::CacheOffline
, ui
.cacheOfflineMode
->isChecked());
185 int i
= ui
.comboTts
->currentIndex();
186 RbSettings::setValue(RbSettings::Tts
, ui
.comboTts
->itemData(i
).toString());
188 RbSettings::setValue(RbSettings::RbutilVersion
, PUREVERSION
);
191 errormsg
+= tr("You need to fix the above errors before you can continue.");
194 QMessageBox::critical(this, tr("Configuration error"), errormsg
);
200 emit
settingsUpdated();
207 qDebug() << "[Config] aborted.";
212 void Config::setUserSettings()
215 proxy
= RbSettings::value(RbSettings::Proxy
).toString();
218 ui
.proxyPort
->setText(QString("%1").arg(proxy
.port()));
219 else ui
.proxyPort
->setText("");
220 ui
.proxyHost
->setText(proxy
.host());
221 ui
.proxyUser
->setText(proxy
.userName());
222 ui
.proxyPass
->setText(proxy
.password());
224 QString proxyType
= RbSettings::value(RbSettings::ProxyType
).toString();
225 if(proxyType
== "manual") ui
.radioManualProxy
->setChecked(true);
226 else if(proxyType
== "system") ui
.radioSystemProxy
->setChecked(true);
227 else ui
.radioNoProxy
->setChecked(true);
229 // set language selection
230 QList
<QListWidgetItem
*> a
;
232 // find key for lang value
233 QMap
<QString
, QString
>::const_iterator i
= lang
.constBegin();
234 QString l
= RbSettings::value(RbSettings::Language
).toString();
236 l
= QLocale::system().name();
237 while (i
!= lang
.constEnd()) {
242 else if(l
.startsWith(i
.value(), Qt::CaseInsensitive
)) {
243 // check if there is a base language (en -> en_US, etc.)
249 a
= ui
.listLanguages
->findItems(b
, Qt::MatchExactly
);
251 ui
.listLanguages
->setCurrentItem(a
.at(0));
252 // don't connect before language list has been set up to prevent
253 // triggering the signal by selecting the saved language.
254 connect(ui
.listLanguages
, SIGNAL(itemSelectionChanged()), this, SLOT(updateLanguage()));
257 ui
.mountPoint
->setText(QDir::toNativeSeparators(RbSettings::value(RbSettings::Mountpoint
).toString()));
260 if(!QFileInfo(RbSettings::value(RbSettings::CachePath
).toString()).isDir())
261 RbSettings::setValue(RbSettings::CachePath
, QDir::tempPath());
262 ui
.cachePath
->setText(QDir::toNativeSeparators(RbSettings::value(RbSettings::CachePath
).toString()));
263 ui
.cacheDisable
->setChecked(RbSettings::value(RbSettings::CacheDisabled
).toBool());
264 ui
.cacheOfflineMode
->setChecked(RbSettings::value(RbSettings::CacheOffline
).toBool());
265 updateCacheInfo(RbSettings::value(RbSettings::CachePath
).toString());
269 void Config::updateCacheInfo(QString path
)
272 fs
= QDir(path
+ "/rbutil-cache/").entryInfoList(QDir::Files
| QDir::NoDotAndDotDot
);
274 for(int i
= 0; i
< fs
.size(); i
++) {
275 sz
+= fs
.at(i
).size();
277 ui
.cacheSize
->setText(tr("Current cache size is %L1 kiB.")
282 void Config::setDevices()
285 // setup devices table
286 qDebug() << "[Config] setting up devices list";
288 QStringList platformList
= RbSettings::platforms();
290 QMap
<QString
, QString
> manuf
;
291 QMap
<QString
, QString
> devcs
;
292 for(int it
= 0; it
< platformList
.size(); it
++)
294 QString curname
= RbSettings::name(platformList
.at(it
));
295 QString curbrand
= RbSettings::brand(platformList
.at(it
));
296 manuf
.insertMulti(curbrand
, platformList
.at(it
));
297 devcs
.insert(platformList
.at(it
), curname
);
301 platform
= devcs
.value(RbSettings::value(RbSettings::Platform
).toString());
303 // set up devices table
304 ui
.treeDevices
->header()->hide();
305 ui
.treeDevices
->expandAll();
306 ui
.treeDevices
->setColumnCount(1);
307 QList
<QTreeWidgetItem
*> items
;
310 QStringList brands
= manuf
.uniqueKeys();
313 QTreeWidgetItem
*w3
= 0;
314 for(int c
= 0; c
< brands
.size(); c
++) {
315 w
= new QTreeWidgetItem();
316 w
->setFlags(Qt::ItemIsEnabled
);
317 w
->setText(0, brands
.at(c
));
320 // go through platforms again for sake of order
321 for(int it
= 0; it
< platformList
.size(); it
++) {
323 QString curname
= RbSettings::name(platformList
.at(it
));
324 QString curbrand
= RbSettings::brand(platformList
.at(it
));
326 if(curbrand
!= brands
.at(c
)) continue;
327 qDebug() << "[Config] add supported device:" << brands
.at(c
) << curname
;
328 w2
= new QTreeWidgetItem(w
, QStringList(curname
));
329 w2
->setData(0, Qt::UserRole
, platformList
.at(it
));
331 if(platform
.contains(curname
)) {
332 w2
->setSelected(true);
333 w
->setExpanded(true);
334 w3
= w2
; // save pointer to hilight old selection
339 ui
.treeDevices
->insertTopLevelItems(0, items
);
341 ui
.treeDevices
->setCurrentItem(w3
); // hilight old selection
349 QStringList ttslist
= TTSBase::getTTSList();
350 for(int a
= 0; a
< ttslist
.size(); a
++)
351 ui
.comboTts
->addItem(TTSBase::getTTSName(ttslist
.at(a
)), ttslist
.at(a
));
352 //update index of combobox
353 int index
= ui
.comboTts
->findData(RbSettings::value(RbSettings::Tts
).toString());
354 if(index
< 0) index
= 0;
355 ui
.comboTts
->setCurrentIndex(index
);
356 updateTtsState(index
);
361 void Config::updateTtsState(int index
)
363 QString ttsName
= ui
.comboTts
->itemData(index
).toString();
364 TTSBase
* tts
= TTSBase::getTTS(this,ttsName
);
368 ui
.configTTSstatus
->setText(tr("Configuration OK"));
369 ui
.configTTSstatusimg
->setPixmap(QPixmap(QString::fromUtf8(":/icons/go-next.png")));
373 ui
.configTTSstatus
->setText(tr("Configuration INVALID"));
374 ui
.configTTSstatusimg
->setPixmap(QPixmap(QString::fromUtf8(":/icons/dialog-error.png")));
378 void Config::updateEncState()
380 if(ui
.treeDevices
->selectedItems().size() == 0)
383 QString devname
= ui
.treeDevices
->selectedItems().at(0)->data(0, Qt::UserRole
).toString();
384 QString encoder
= RbSettings::platformValue(devname
,
385 RbSettings::CurEncoder
).toString();
386 ui
.encoderName
->setText(EncBase::getEncoderName(RbSettings::platformValue(devname
,
387 RbSettings::CurEncoder
).toString()));
389 EncBase
* enc
= EncBase::getEncoder(this,encoder
);
393 ui
.configEncstatus
->setText(tr("Configuration OK"));
394 ui
.configEncstatusimg
->setPixmap(QPixmap(QString::fromUtf8(":/icons/go-next.png")));
398 ui
.configEncstatus
->setText(tr("Configuration INVALID"));
399 ui
.configEncstatusimg
->setPixmap(QPixmap(QString::fromUtf8(":/icons/dialog-error.png")));
404 void Config::setNoProxy(bool checked
)
407 ui
.proxyPort
->setEnabled(i
);
408 ui
.proxyHost
->setEnabled(i
);
409 ui
.proxyUser
->setEnabled(i
);
410 ui
.proxyPass
->setEnabled(i
);
414 void Config::setSystemProxy(bool checked
)
417 ui
.proxyPort
->setEnabled(i
);
418 ui
.proxyHost
->setEnabled(i
);
419 ui
.proxyUser
->setEnabled(i
);
420 ui
.proxyPass
->setEnabled(i
);
422 // save values in input box
423 proxy
.setScheme("http");
424 proxy
.setUserName(ui
.proxyUser
->text());
425 proxy
.setPassword(ui
.proxyPass
->text());
426 proxy
.setHost(ui
.proxyHost
->text());
427 proxy
.setPort(ui
.proxyPort
->text().toInt());
428 // show system values in input box
429 QUrl envproxy
= System::systemProxy();
431 ui
.proxyHost
->setText(envproxy
.host());
433 ui
.proxyPort
->setText(QString("%1").arg(envproxy
.port()));
434 ui
.proxyUser
->setText(envproxy
.userName());
435 ui
.proxyPass
->setText(envproxy
.password());
439 ui
.proxyHost
->setText(proxy
.host());
441 ui
.proxyPort
->setText(QString("%1").arg(proxy
.port()));
442 else ui
.proxyPort
->setText("");
443 ui
.proxyUser
->setText(proxy
.userName());
444 ui
.proxyPass
->setText(proxy
.password());
450 QStringList
Config::findLanguageFiles()
452 QDir
dir(programPath
);
453 QStringList fileNames
;
455 fileNames
= dir
.entryList(QStringList("*.qm"), QDir::Files
, QDir::Name
);
457 QDir
resDir(":/lang");
458 fileNames
+= resDir
.entryList(QStringList("*.qm"), QDir::Files
, QDir::Name
);
460 QRegExp
exp("^rbutil_(.*)\\.qm");
461 for(int i
= 0; i
< fileNames
.size(); i
++) {
462 QString a
= fileNames
.at(i
);
463 a
.replace(exp
, "\\1");
467 qDebug() << "[Config] available lang files:" << langs
;
473 QString
Config::languageName(const QString
&qmFile
)
475 QTranslator translator
;
477 QString file
= "rbutil_" + qmFile
;
478 if(!translator
.load(file
, programPath
))
479 translator
.load(file
, ":/lang");
481 return translator
.translate("Configure", "English",
482 "This is the localized language name, i.e. your language.");
486 void Config::updateLanguage()
488 qDebug() << "[Config] update selected language";
489 QList
<QListWidgetItem
*> a
= ui
.listLanguages
->selectedItems();
491 language
= lang
.value(a
.at(0)->text());
492 qDebug() << "[Config] new language:" << language
;
496 void Config::browseFolder()
498 browser
= new BrowseDirtree(this,tr("Select your device"));
499 #if defined(Q_OS_LINUX) || defined(Q_OS_MACX)
500 browser
->setFilter(QDir::AllDirs
| QDir::NoDotAndDotDot
| QDir::NoSymLinks
);
501 #elif defined(Q_OS_WIN32)
502 browser
->setFilter(QDir::Drives
);
504 #if defined(Q_OS_MACX)
505 browser
->setRoot("/Volumes");
506 #elif defined(Q_OS_LINUX)
507 browser
->setDir("/media");
509 if( ui
.mountPoint
->text() != "" )
511 browser
->setDir(ui
.mountPoint
->text());
514 connect(browser
, SIGNAL(itemChanged(QString
)), this, SLOT(setMountpoint(QString
)));
518 void Config::browseCache()
520 cbrowser
= new BrowseDirtree(this);
521 #if defined(Q_OS_LINUX) || defined(Q_OS_MACX)
522 cbrowser
->setFilter(QDir::AllDirs
| QDir::NoDotAndDotDot
| QDir::NoSymLinks
);
523 #elif defined(Q_OS_WIN32)
524 cbrowser
->setFilter(QDir::Drives
| QDir::AllDirs
| QDir::NoDotAndDotDot
);
526 cbrowser
->setDir(ui
.cachePath
->text());
527 connect(cbrowser
, SIGNAL(itemChanged(QString
)), this, SLOT(setCache(QString
)));
533 void Config::setMountpoint(QString m
)
535 ui
.mountPoint
->setText(m
);
539 void Config::setCache(QString c
)
541 ui
.cachePath
->setText(c
);
546 void Config::autodetect()
548 Autodetection
detector(this);
549 // disable tree during detection as "working" feedback.
550 // TODO: replace the tree view with a splash screen during this time.
551 ui
.treeDevices
->setEnabled(false);
552 this->setCursor(Qt::WaitCursor
);
553 QCoreApplication::processEvents();
555 if(detector
.detect()) //let it detect
557 QString devicename
= detector
.getDevice();
558 // deexpand all items
559 for(int a
= 0; a
< ui
.treeDevices
->topLevelItemCount(); a
++)
560 ui
.treeDevices
->topLevelItem(a
)->setExpanded(false);
561 //deselect the selected item(s)
562 for(int a
= 0; a
< ui
.treeDevices
->selectedItems().size(); a
++)
563 ui
.treeDevices
->selectedItems().at(a
)->setSelected(false);
566 // enumerate all platform items
567 QList
<QTreeWidgetItem
*> itmList
= ui
.treeDevices
->findItems("*",Qt::MatchWildcard
);
568 for(int i
=0; i
< itmList
.size();i
++)
570 //enumerate device items
571 for(int j
=0;j
< itmList
.at(i
)->childCount();j
++)
573 QString data
= itmList
.at(i
)->child(j
)->data(0, Qt::UserRole
).toString();
575 if(devicename
== data
) // item found
577 itmList
.at(i
)->child(j
)->setSelected(true); //select the item
578 itmList
.at(i
)->setExpanded(true); //expand the platform item
579 //ui.treeDevices->indexOfTopLevelItem(itmList.at(i)->child(j));
586 if(!detector
.errdev().isEmpty()) {
588 if(detector
.errdev() == "sansae200")
589 text
= tr("Sansa e200 in MTP mode found!\n"
590 "You need to change your player to MSC mode for installation. ");
591 if(detector
.errdev() == "h10")
592 text
= tr("H10 20GB in MTP mode found!\n"
593 "You need to change your player to UMS mode for installation. ");
594 text
+= tr("Unless you changed this installation will fail!");
596 QMessageBox::critical(this, tr("Fatal error"), text
, QMessageBox::Ok
);
599 if(!detector
.incompatdev().isEmpty()) {
601 text
= tr("Detected an unsupported player:\n%1\n"
602 "Sorry, Rockbox doesn't run on your player.")
603 .arg(RbSettings::platformValue(detector
.incompatdev(),
604 RbSettings::CurName
).toString());
606 QMessageBox::critical(this, tr("Fatal: player incompatible"),
607 text
, QMessageBox::Ok
);
611 if(detector
.getMountPoint() != "" )
613 ui
.mountPoint
->setText(QDir::toNativeSeparators(detector
.getMountPoint()));
617 QMessageBox::warning(this, tr("Autodetection"),
618 tr("Could not detect a Mountpoint.\n"
619 "Select your Mountpoint manually."),
620 QMessageBox::Ok
,QMessageBox::Ok
);
626 QMessageBox::warning(this, tr("Autodetection"),
627 tr("Could not detect a device.\n"
628 "Select your device and Mountpoint manually."),
629 QMessageBox::Ok
,QMessageBox::Ok
);
632 ui
.treeDevices
->setEnabled(true);
636 void Config::cacheClear()
638 if(QMessageBox::critical(this, tr("Really delete cache?"),
639 tr("Do you really want to delete the cache? "
640 "Make absolutely sure this setting is correct as it will "
641 "remove <b>all</b> files in this folder!").arg(ui
.cachePath
->text()),
642 QMessageBox::Yes
| QMessageBox::No
) != QMessageBox::Yes
)
645 QString cache
= ui
.cachePath
->text() + "/rbutil-cache/";
646 if(!QFileInfo(cache
).isDir()) {
647 QMessageBox::critical(this, tr("Path wrong!"),
648 tr("The cache path is invalid. Aborting."), QMessageBox::Ok
);
653 fn
= dir
.entryList(QStringList("*"), QDir::Files
, QDir::Name
);
655 for(int i
= 0; i
< fn
.size(); i
++) {
656 QString f
= cache
+ fn
.at(i
);
659 updateCacheInfo(RbSettings::value(RbSettings::CachePath
).toString());
663 void Config::configTts()
665 int index
= ui
.comboTts
->currentIndex();
666 TTSBase
* tts
= TTSBase::getTTS(this,ui
.comboTts
->itemData(index
).toString());
668 EncTtsCfgGui
gui(this,tts
,TTSBase::getTTSName(ui
.comboTts
->itemData(index
).toString()));
670 updateTtsState(ui
.comboTts
->currentIndex());
673 void Config::testTts()
676 int index
= ui
.comboTts
->currentIndex();
677 TTSBase
* tts
= TTSBase::getTTS(this,ui
.comboTts
->itemData(index
).toString());
680 QMessageBox::warning(this,tr("TTS configuration invalid"),
681 tr("TTS configuration invalid. \n Please configure TTS engine."));
685 if(!tts
->start(&errstr
))
687 QMessageBox::warning(this,tr("Could not start TTS engine."),
688 tr("Could not start TTS engine.\n") + errstr
689 + tr("\nPlease configure TTS engine."));
693 QTemporaryFile
file(this);
695 QString filename
= file
.fileName();
698 if(tts
->voice(tr("Rockbox Utility Voice Test"),filename
,&errstr
) == FatalError
)
701 QMessageBox::warning(this,tr("Could not voice test string."),
702 tr("Could not voice test string.\n") + errstr
703 + tr("\nPlease configure TTS engine."));
707 #if defined(Q_OS_LINUX)
708 QString exe
= findExecutable("aplay");
709 if(exe
== "") exe
= findExecutable("play");
712 QProcess::execute(exe
+" "+filename
);
715 QSound::play(filename
);
719 void Config::configEnc()
721 if(ui
.treeDevices
->selectedItems().size() == 0)
724 QString devname
= ui
.treeDevices
->selectedItems().at(0)->data(0, Qt::UserRole
).toString();
725 QString encoder
= RbSettings::platformValue(devname
,
726 RbSettings::CurEncoder
).toString();
727 ui
.encoderName
->setText(EncBase::getEncoderName(RbSettings::platformValue(devname
,
728 RbSettings::CurEncoder
).toString()));
731 EncBase
* enc
= EncBase::getEncoder(this,encoder
);
733 EncTtsCfgGui
gui(this,enc
,EncBase::getEncoderName(encoder
));