diff options
author | Dominik Riebeling <Dominik.Riebeling@gmail.com> | 2008-07-06 19:57:22 +0000 |
---|---|---|
committer | Dominik Riebeling <Dominik.Riebeling@gmail.com> | 2008-07-06 19:57:22 +0000 |
commit | b39c20e55734884b062ac76b8f3169c5da5d512a (patch) | |
tree | 2a176cf943509954a43c0618b7cc4363e0dcd039 /rbutil | |
parent | 341f831310f3716a1e7d011c39edd5bb0302563c (diff) | |
download | rockbox-b39c20e55734884b062ac76b8f3169c5da5d512a.tar.gz rockbox-b39c20e55734884b062ac76b8f3169c5da5d512a.zip |
Make encoder selection update on device change. This includes a workaround as the settings object currently doesn't allow getting the encoder for any other than the selected device.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17968 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'rbutil')
-rw-r--r-- | rbutil/rbutilqt/configure.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/rbutil/rbutilqt/configure.cpp b/rbutil/rbutilqt/configure.cpp index a34f3b985f..0aedf32998 100644 --- a/rbutil/rbutilqt/configure.cpp +++ b/rbutil/rbutilqt/configure.cpp | |||
@@ -80,6 +80,7 @@ Config::Config(QWidget *parent,int index) : QDialog(parent) | |||
80 | connect(ui.configTts, SIGNAL(clicked()), this, SLOT(configTts())); | 80 | connect(ui.configTts, SIGNAL(clicked()), this, SLOT(configTts())); |
81 | connect(ui.configEncoder, SIGNAL(clicked()), this, SLOT(configEnc())); | 81 | connect(ui.configEncoder, SIGNAL(clicked()), this, SLOT(configEnc())); |
82 | connect(ui.comboTts, SIGNAL(currentIndexChanged(int)), this, SLOT(updateTtsState(int))); | 82 | connect(ui.comboTts, SIGNAL(currentIndexChanged(int)), this, SLOT(updateTtsState(int))); |
83 | connect(ui.treeDevices, SIGNAL(itemSelectionChanged()), this, SLOT(updateEncState())); | ||
83 | 84 | ||
84 | } | 85 | } |
85 | 86 | ||
@@ -319,8 +320,19 @@ void Config::updateTtsState(int index) | |||
319 | 320 | ||
320 | void Config::updateEncState() | 321 | void Config::updateEncState() |
321 | { | 322 | { |
322 | ui.encoderName->setText(EncBase::getEncoderName(settings->curEncoder())); | 323 | // FIXME: this is a workaround to make the encoder follow the device selection |
324 | // even with the settings (and thus the device) being saved. Needs to be redone | ||
325 | // properly later by extending the settings object | ||
326 | if(ui.treeDevices->selectedItems().size() == 0) | ||
327 | return; | ||
328 | |||
329 | QString devname = ui.treeDevices->selectedItems().at(0)->data(0, Qt::UserRole).toString(); | ||
330 | QString olddevice = settings->curPlatform(); | ||
331 | settings->setCurPlatform(devname); | ||
323 | QString encoder = settings->curEncoder(); | 332 | QString encoder = settings->curEncoder(); |
333 | ui.encoderName->setText(EncBase::getEncoderName(settings->curEncoder())); | ||
334 | settings->setCurPlatform(olddevice); | ||
335 | |||
324 | EncBase* enc = EncBase::getEncoder(encoder); | 336 | EncBase* enc = EncBase::getEncoder(encoder); |
325 | enc->setCfg(settings); | 337 | enc->setCfg(settings); |
326 | 338 | ||