summaryrefslogtreecommitdiff
path: root/rbutil/rbutilqt/configure.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'rbutil/rbutilqt/configure.cpp')
-rw-r--r--rbutil/rbutilqt/configure.cpp31
1 files changed, 29 insertions, 2 deletions
diff --git a/rbutil/rbutilqt/configure.cpp b/rbutil/rbutilqt/configure.cpp
index dafa9997a4..1f433d8903 100644
--- a/rbutil/rbutilqt/configure.cpp
+++ b/rbutil/rbutilqt/configure.cpp
@@ -99,6 +99,7 @@ Config::Config(QWidget *parent,int index) : QDialog(parent)
99 connect(ui.comboTts, SIGNAL(currentIndexChanged(int)), this, SLOT(updateTtsState(int))); 99 connect(ui.comboTts, SIGNAL(currentIndexChanged(int)), this, SLOT(updateTtsState(int)));
100 connect(ui.treeDevices, SIGNAL(itemSelectionChanged()), this, SLOT(updateEncState())); 100 connect(ui.treeDevices, SIGNAL(itemSelectionChanged()), this, SLOT(updateEncState()));
101 connect(ui.testTTS,SIGNAL(clicked()),this,SLOT(testTts())); 101 connect(ui.testTTS,SIGNAL(clicked()),this,SLOT(testTts()));
102 connect(ui.showDisabled, SIGNAL(toggled(bool)), this, SLOT(showDisabled(bool)));
102 setUserSettings(); 103 setUserSettings();
103 setDevices(); 104 setDevices();
104} 105}
@@ -282,20 +283,38 @@ void Config::updateCacheInfo(QString path)
282} 283}
283 284
284 285
286void Config::showDisabled(bool show)
287{
288 qDebug() << "[Config] disabled targets shown:" << show;
289 if(show)
290 QMessageBox::warning(this, tr("Showing disabled targets"),
291 tr("You just enabled showing targets that are marked disabled. "
292 "Disabled targets are not recommended to end users. Please "
293 "use this option only if you know what you are doing."));
294 setDevices();
295
296}
297
298
285void Config::setDevices() 299void Config::setDevices()
286{ 300{
287 301
288 // setup devices table 302 // setup devices table
289 qDebug() << "[Config] setting up devices list"; 303 qDebug() << "[Config] setting up devices list";
290 304
291 QStringList platformList = SystemInfo::platforms(); 305 QStringList platformList;
306 if(ui.showDisabled->isChecked())
307 platformList = SystemInfo::platforms(SystemInfo::PlatformAllDisabled);
308 else
309 platformList = SystemInfo::platforms(SystemInfo::PlatformAll);
292 310
293 QMap <QString, QString> manuf; 311 QMap <QString, QString> manuf;
294 QMap <QString, QString> devcs; 312 QMap <QString, QString> devcs;
295 for(int it = 0; it < platformList.size(); it++) 313 for(int it = 0; it < platformList.size(); it++)
296 { 314 {
297 QString curname = SystemInfo::name(platformList.at(it)) + 315 QString curname = SystemInfo::name(platformList.at(it)) +
298 " (" +ServerInfo::platformValue(platformList.at(it),ServerInfo::CurStatus).toString() + ")"; 316 " (" +ServerInfo::platformValue(platformList.at(it),
317 ServerInfo::CurStatus).toString() + ")";
299 QString curbrand = SystemInfo::brand(platformList.at(it)); 318 QString curbrand = SystemInfo::brand(platformList.at(it));
300 manuf.insertMulti(curbrand, platformList.at(it)); 319 manuf.insertMulti(curbrand, platformList.at(it));
301 devcs.insert(platformList.at(it), curname); 320 devcs.insert(platformList.at(it), curname);
@@ -341,6 +360,14 @@ void Config::setDevices()
341 items.append(w2); 360 items.append(w2);
342 } 361 }
343 } 362 }
363 // remove any old items in list
364 QTreeWidgetItem* widgetitem;
365 do {
366 widgetitem = ui.treeDevices->takeTopLevelItem(0);
367 delete widgetitem;
368 }
369 while(widgetitem);
370 // add new items
344 ui.treeDevices->insertTopLevelItems(0, items); 371 ui.treeDevices->insertTopLevelItems(0, items);
345 if(w3 != 0) 372 if(w3 != 0)
346 ui.treeDevices->setCurrentItem(w3); // hilight old selection 373 ui.treeDevices->setCurrentItem(w3); // hilight old selection