diff options
author | Dominik Riebeling <Dominik.Riebeling@gmail.com> | 2013-04-03 23:36:13 +0200 |
---|---|---|
committer | Dominik Riebeling <Dominik.Riebeling@gmail.com> | 2013-04-04 22:42:22 +0200 |
commit | 801f3bbec49eb7d6ff2c0a8142acc991a322765a (patch) | |
tree | 08f94eea4444f46c5992ebe7db80bca4b4b64dac /rbutil | |
parent | 7271ff603d67585d281839fe58e198275c851e75 (diff) | |
download | rockbox-801f3bbec49eb7d6ff2c0a8142acc991a322765a.tar.gz rockbox-801f3bbec49eb7d6ff2c0a8142acc991a322765a.zip |
Rename "interface" parameter.
Current MinGW #defines interface, causing the preprocessor messing up the
function parameter. Rename it to avoid this.
Change-Id: Id49edbfc056a42456d88c9e260e54844e8b1ca07
Diffstat (limited to 'rbutil')
-rw-r--r-- | rbutil/rbutilqt/encttscfggui.cpp | 65 | ||||
-rw-r--r-- | rbutil/rbutilqt/encttscfggui.h | 17 |
2 files changed, 41 insertions, 41 deletions
diff --git a/rbutil/rbutilqt/encttscfggui.cpp b/rbutil/rbutilqt/encttscfggui.cpp index 7fd89ee5f1..6a51869318 100644 --- a/rbutil/rbutilqt/encttscfggui.cpp +++ b/rbutil/rbutilqt/encttscfggui.cpp | |||
@@ -33,11 +33,12 @@ | |||
33 | #include <QProgressDialog> | 33 | #include <QProgressDialog> |
34 | #include "encttscfggui.h" | 34 | #include "encttscfggui.h" |
35 | 35 | ||
36 | EncTtsCfgGui::EncTtsCfgGui(QDialog* parent,EncTtsSettingInterface* interface,QString name) : QDialog(parent) | 36 | EncTtsCfgGui::EncTtsCfgGui(QDialog* parent, EncTtsSettingInterface* iface, QString name) |
37 | : QDialog(parent) | ||
37 | { | 38 | { |
38 | m_settingInterface = interface; | 39 | m_settingInterface = iface; |
39 | 40 | ||
40 | m_busyCnt=0; | 41 | m_busyCnt=0; |
41 | // create a busy Dialog | 42 | // create a busy Dialog |
42 | m_busyDlg= new QProgressDialog("", "", 0, 0,this); | 43 | m_busyDlg= new QProgressDialog("", "", 0, 0,this); |
43 | m_busyDlg->setWindowTitle(tr("Waiting for engine...")); | 44 | m_busyDlg->setWindowTitle(tr("Waiting for engine...")); |
@@ -45,8 +46,8 @@ EncTtsCfgGui::EncTtsCfgGui(QDialog* parent,EncTtsSettingInterface* interface,QSt | |||
45 | m_busyDlg->setLabel(0); | 46 | m_busyDlg->setLabel(0); |
46 | m_busyDlg->setCancelButton(0); | 47 | m_busyDlg->setCancelButton(0); |
47 | m_busyDlg->hide(); | 48 | m_busyDlg->hide(); |
48 | connect(interface,SIGNAL(busy()),this,SLOT(showBusy())); | 49 | connect(iface,SIGNAL(busy()),this,SLOT(showBusy())); |
49 | connect(interface,SIGNAL(busyEnd()),this,SLOT(hideBusy())); | 50 | connect(iface,SIGNAL(busyEnd()),this,SLOT(hideBusy())); |
50 | 51 | ||
51 | //setup the window | 52 | //setup the window |
52 | setWindowTitle(name); | 53 | setWindowTitle(name); |
@@ -56,10 +57,10 @@ EncTtsCfgGui::EncTtsCfgGui(QDialog* parent,EncTtsSettingInterface* interface,QSt | |||
56 | void EncTtsCfgGui::setUpWindow() | 57 | void EncTtsCfgGui::setUpWindow() |
57 | { | 58 | { |
58 | m_settingsList = m_settingInterface->getSettings(); | 59 | m_settingsList = m_settingInterface->getSettings(); |
59 | 60 | ||
60 | // layout | 61 | // layout |
61 | QVBoxLayout *mainLayout = new QVBoxLayout; | 62 | QVBoxLayout *mainLayout = new QVBoxLayout; |
62 | 63 | ||
63 | // groupbox | 64 | // groupbox |
64 | QGroupBox *groupBox = new QGroupBox(this); | 65 | QGroupBox *groupBox = new QGroupBox(this); |
65 | QGridLayout *gridLayout = new QGridLayout(groupBox); | 66 | QGridLayout *gridLayout = new QGridLayout(groupBox); |
@@ -85,10 +86,10 @@ void EncTtsCfgGui::setUpWindow() | |||
85 | 86 | ||
86 | groupBox->setLayout(gridLayout); | 87 | groupBox->setLayout(gridLayout); |
87 | mainLayout->addWidget(groupBox); | 88 | mainLayout->addWidget(groupBox); |
88 | 89 | ||
89 | // connect browse btn | 90 | // connect browse btn |
90 | connect(&m_browseBtnMap,SIGNAL(mapped(QObject*)),this,SLOT(browse(QObject*))); | 91 | connect(&m_browseBtnMap,SIGNAL(mapped(QObject*)),this,SLOT(browse(QObject*))); |
91 | 92 | ||
92 | // ok - cancel buttons | 93 | // ok - cancel buttons |
93 | QPushButton* okBtn = new QPushButton(tr("Ok"),this); | 94 | QPushButton* okBtn = new QPushButton(tr("Ok"),this); |
94 | okBtn->setDefault(true); | 95 | okBtn->setDefault(true); |
@@ -97,14 +98,14 @@ void EncTtsCfgGui::setUpWindow() | |||
97 | cancelBtn->setIcon(QIcon(":icons/process-stop.png")); | 98 | cancelBtn->setIcon(QIcon(":icons/process-stop.png")); |
98 | connect(okBtn,SIGNAL(clicked()),this,SLOT(accept())); | 99 | connect(okBtn,SIGNAL(clicked()),this,SLOT(accept())); |
99 | connect(cancelBtn,SIGNAL(clicked()),this,SLOT(reject())); | 100 | connect(cancelBtn,SIGNAL(clicked()),this,SLOT(reject())); |
100 | 101 | ||
101 | QHBoxLayout *btnbox = new QHBoxLayout; | 102 | QHBoxLayout *btnbox = new QHBoxLayout; |
102 | btnbox->addWidget(okBtn); | 103 | btnbox->addWidget(okBtn); |
103 | btnbox->addWidget(cancelBtn); | 104 | btnbox->addWidget(cancelBtn); |
104 | btnbox->insertStretch(0,1); | 105 | btnbox->insertStretch(0,1); |
105 | 106 | ||
106 | mainLayout->addLayout(btnbox); | 107 | mainLayout->addLayout(btnbox); |
107 | 108 | ||
108 | this->setLayout(mainLayout); | 109 | this->setLayout(mainLayout); |
109 | } | 110 | } |
110 | 111 | ||
@@ -177,14 +178,14 @@ QWidget* EncTtsCfgGui::createWidgets(EncTtsSetting* setting) | |||
177 | break; | 178 | break; |
178 | } | 179 | } |
179 | } | 180 | } |
180 | 181 | ||
181 | // remember widget | 182 | // remember widget |
182 | if(value != NULL) | 183 | if(value != NULL) |
183 | { | 184 | { |
184 | m_settingsWidgetsMap.insert(setting,value); | 185 | m_settingsWidgetsMap.insert(setting,value); |
185 | connect(setting,SIGNAL(updateGui()),this,SLOT(updateWidget())); | 186 | connect(setting,SIGNAL(updateGui()),this,SLOT(updateWidget())); |
186 | } | 187 | } |
187 | 188 | ||
188 | return value; | 189 | return value; |
189 | } | 190 | } |
190 | 191 | ||
@@ -216,8 +217,8 @@ void EncTtsCfgGui::updateSetting() | |||
216 | if(widget == NULL) return; | 217 | if(widget == NULL) return; |
217 | // get the corresponding setting | 218 | // get the corresponding setting |
218 | EncTtsSetting* setting = m_settingsWidgetsMap.key(widget); | 219 | EncTtsSetting* setting = m_settingsWidgetsMap.key(widget); |
219 | 220 | ||
220 | // update widget based on setting type | 221 | // update widget based on setting type |
221 | switch(setting->type()) | 222 | switch(setting->type()) |
222 | { | 223 | { |
223 | case EncTtsSetting::eDOUBLE: | 224 | case EncTtsSetting::eDOUBLE: |
@@ -253,7 +254,7 @@ void EncTtsCfgGui::updateSetting() | |||
253 | { | 254 | { |
254 | qDebug() << "unknown Settingtype !!"; | 255 | qDebug() << "unknown Settingtype !!"; |
255 | break; | 256 | break; |
256 | } | 257 | } |
257 | } | 258 | } |
258 | } | 259 | } |
259 | 260 | ||
@@ -264,7 +265,7 @@ void EncTtsCfgGui::updateWidget() | |||
264 | if(setting == NULL) return; | 265 | if(setting == NULL) return; |
265 | // get corresponding widget | 266 | // get corresponding widget |
266 | QWidget* widget = m_settingsWidgetsMap.value(setting); | 267 | QWidget* widget = m_settingsWidgetsMap.value(setting); |
267 | 268 | ||
268 | // update Widget based on setting type | 269 | // update Widget based on setting type |
269 | switch(setting->type()) | 270 | switch(setting->type()) |
270 | { | 271 | { |
@@ -291,7 +292,7 @@ void EncTtsCfgGui::updateWidget() | |||
291 | case EncTtsSetting::eSTRING: | 292 | case EncTtsSetting::eSTRING: |
292 | { | 293 | { |
293 | QLineEdit* lineedit = (QLineEdit*) widget; | 294 | QLineEdit* lineedit = (QLineEdit*) widget; |
294 | 295 | ||
295 | lineedit->blockSignals(true); | 296 | lineedit->blockSignals(true); |
296 | lineedit->setText(setting->current().toString()); | 297 | lineedit->setText(setting->current().toString()); |
297 | lineedit->blockSignals(false); | 298 | lineedit->blockSignals(false); |
@@ -300,7 +301,7 @@ void EncTtsCfgGui::updateWidget() | |||
300 | case EncTtsSetting::eREADONLYSTRING: | 301 | case EncTtsSetting::eREADONLYSTRING: |
301 | { | 302 | { |
302 | QLabel* label = (QLabel*) widget; | 303 | QLabel* label = (QLabel*) widget; |
303 | 304 | ||
304 | label->blockSignals(true); | 305 | label->blockSignals(true); |
305 | label->setText(setting->current().toString()); | 306 | label->setText(setting->current().toString()); |
306 | label->blockSignals(false); | 307 | label->blockSignals(false); |
@@ -309,20 +310,20 @@ void EncTtsCfgGui::updateWidget() | |||
309 | case EncTtsSetting::eSTRINGLIST: | 310 | case EncTtsSetting::eSTRINGLIST: |
310 | { | 311 | { |
311 | QComboBox* combobox = (QComboBox*) widget; | 312 | QComboBox* combobox = (QComboBox*) widget; |
312 | 313 | ||
313 | combobox->blockSignals(true); | 314 | combobox->blockSignals(true); |
314 | combobox->clear(); | 315 | combobox->clear(); |
315 | combobox->addItems(setting->list()); | 316 | combobox->addItems(setting->list()); |
316 | int index = combobox->findText(setting->current().toString()); | 317 | int index = combobox->findText(setting->current().toString()); |
317 | combobox->setCurrentIndex(index); | 318 | combobox->setCurrentIndex(index); |
318 | combobox->blockSignals(false); | 319 | combobox->blockSignals(false); |
319 | 320 | ||
320 | break; | 321 | break; |
321 | } | 322 | } |
322 | case EncTtsSetting::eBOOL: | 323 | case EncTtsSetting::eBOOL: |
323 | { | 324 | { |
324 | QCheckBox* checkbox = (QCheckBox*) widget; | 325 | QCheckBox* checkbox = (QCheckBox*) widget; |
325 | 326 | ||
326 | checkbox->blockSignals(true); | 327 | checkbox->blockSignals(true); |
327 | checkbox->setCheckState(setting->current().toBool() == true ? Qt::Checked : Qt::Unchecked); | 328 | checkbox->setCheckState(setting->current().toBool() == true ? Qt::Checked : Qt::Unchecked); |
328 | checkbox->blockSignals(false); | 329 | checkbox->blockSignals(false); |
@@ -332,25 +333,25 @@ void EncTtsCfgGui::updateWidget() | |||
332 | { | 333 | { |
333 | qDebug() << "unknown EncTTsSetting"; | 334 | qDebug() << "unknown EncTTsSetting"; |
334 | break; | 335 | break; |
335 | } | 336 | } |
336 | } | 337 | } |
337 | } | 338 | } |
338 | 339 | ||
339 | void EncTtsCfgGui::showBusy() | 340 | void EncTtsCfgGui::showBusy() |
340 | { | 341 | { |
341 | if(m_busyCnt == 0) m_busyDlg->show(); | 342 | if(m_busyCnt == 0) m_busyDlg->show(); |
342 | 343 | ||
343 | m_busyCnt++; | 344 | m_busyCnt++; |
344 | } | 345 | } |
345 | 346 | ||
346 | void EncTtsCfgGui::hideBusy() | 347 | void EncTtsCfgGui::hideBusy() |
347 | { | 348 | { |
348 | m_busyCnt--; | 349 | m_busyCnt--; |
349 | 350 | ||
350 | if(m_busyCnt == 0) m_busyDlg->hide(); | 351 | if(m_busyCnt == 0) m_busyDlg->hide(); |
351 | } | 352 | } |
352 | 353 | ||
353 | 354 | ||
354 | void EncTtsCfgGui::accept(void) | 355 | void EncTtsCfgGui::accept(void) |
355 | { | 356 | { |
356 | m_settingInterface->saveSettings(); | 357 | m_settingInterface->saveSettings(); |
@@ -368,7 +369,7 @@ void EncTtsCfgGui::browse(QObject* settingObj) | |||
368 | // cast top setting | 369 | // cast top setting |
369 | EncTtsSetting* setting= qobject_cast<EncTtsSetting*>(settingObj); | 370 | EncTtsSetting* setting= qobject_cast<EncTtsSetting*>(settingObj); |
370 | if(setting == NULL) return; | 371 | if(setting == NULL) return; |
371 | 372 | ||
372 | //current path | 373 | //current path |
373 | QString curPath = setting->current().toString(); | 374 | QString curPath = setting->current().toString(); |
374 | // show file dialog | 375 | // show file dialog |
@@ -379,5 +380,3 @@ void EncTtsCfgGui::browse(QObject* settingObj) | |||
379 | setting->setCurrent(exe); | 380 | setting->setCurrent(exe); |
380 | } | 381 | } |
381 | 382 | ||
382 | |||
383 | |||
diff --git a/rbutil/rbutilqt/encttscfggui.h b/rbutil/rbutilqt/encttscfggui.h index 36aec54637..80af86dabc 100644 --- a/rbutil/rbutilqt/encttscfggui.h +++ b/rbutil/rbutilqt/encttscfggui.h | |||
@@ -17,31 +17,32 @@ | |||
17 | * KIND, either express or implied. | 17 | * KIND, either express or implied. |
18 | * | 18 | * |
19 | ****************************************************************************/ | 19 | ****************************************************************************/ |
20 | 20 | ||
21 | #ifndef ENCTTSCFGGUI_H | 21 | #ifndef ENCTTSCFGGUI_H |
22 | #define ENCTTSCFGGUI_H | 22 | #define ENCTTSCFGGUI_H |
23 | 23 | ||
24 | #include <QDialog> | 24 | #include <QDialog> |
25 | #include <QString> | ||
25 | #include <QProgressDialog> | 26 | #include <QProgressDialog> |
26 | #include "encttssettings.h" | 27 | #include "encttssettings.h" |
27 | 28 | ||
28 | //! \brief Shows and manages a configuration gui for encoders and tts enignes | 29 | //! \brief Shows and manages a configuration gui for encoders and tts enignes |
29 | //! | 30 | //! |
30 | class EncTtsCfgGui: public QDialog | 31 | class EncTtsCfgGui: public QDialog |
31 | { | 32 | { |
32 | Q_OBJECT | 33 | Q_OBJECT |
33 | public: | 34 | public: |
34 | //! Creates the UI. give it a endoer or tts engine with already set config. uses show() or exec() to show it. | 35 | //! Creates the UI. give it a endoer or tts engine with already set config. uses show() or exec() to show it. |
35 | EncTtsCfgGui(QDialog* parent, EncTtsSettingInterface* interface,QString name); | 36 | EncTtsCfgGui(QDialog* parent, EncTtsSettingInterface* iface, QString name); |
36 | 37 | ||
37 | private slots: | 38 | private slots: |
38 | //! accept current configuration values and close window | 39 | //! accept current configuration values and close window |
39 | void accept(void); | 40 | void accept(void); |
40 | //! close window and dont save configuration | 41 | //! close window and dont save configuration |
41 | void reject(void); | 42 | void reject(void); |
42 | //! updates the corresponding setting from the sending Widget | 43 | //! updates the corresponding setting from the sending Widget |
43 | void updateSetting(); | 44 | void updateSetting(); |
44 | //! updates corresponding Widget from the sending Setting. | 45 | //! updates corresponding Widget from the sending Setting. |
45 | void updateWidget(); | 46 | void updateWidget(); |
46 | //! shows a busy dialog. counts calls. | 47 | //! shows a busy dialog. counts calls. |
47 | void showBusy(); | 48 | void showBusy(); |
@@ -49,7 +50,7 @@ private slots: | |||
49 | void hideBusy(); | 50 | void hideBusy(); |
50 | //! used via the SignalMapper for all Browse buttons | 51 | //! used via the SignalMapper for all Browse buttons |
51 | void browse(QObject*); | 52 | void browse(QObject*); |
52 | 53 | ||
53 | private: | 54 | private: |
54 | //! creates all dynamic window content | 55 | //! creates all dynamic window content |
55 | void setUpWindow(); | 56 | void setUpWindow(); |
@@ -69,7 +70,7 @@ private: | |||
69 | QMap<EncTtsSetting*,QWidget*> m_settingsWidgetsMap; | 70 | QMap<EncTtsSetting*,QWidget*> m_settingsWidgetsMap; |
70 | //! Maps all browse buttons to the corresponding Setting | 71 | //! Maps all browse buttons to the corresponding Setting |
71 | QSignalMapper m_browseBtnMap; | 72 | QSignalMapper m_browseBtnMap; |
72 | //! counter how often busyShow() is called, | 73 | //! counter how often busyShow() is called, |
73 | int m_busyCnt; | 74 | int m_busyCnt; |
74 | }; | 75 | }; |
75 | 76 | ||