From 801f3bbec49eb7d6ff2c0a8142acc991a322765a Mon Sep 17 00:00:00 2001 From: Dominik Riebeling Date: Wed, 3 Apr 2013 23:36:13 +0200 Subject: Rename "interface" parameter. Current MinGW #defines interface, causing the preprocessor messing up the function parameter. Rename it to avoid this. Change-Id: Id49edbfc056a42456d88c9e260e54844e8b1ca07 --- rbutil/rbutilqt/encttscfggui.cpp | 65 ++++++++++++++++++++-------------------- rbutil/rbutilqt/encttscfggui.h | 17 ++++++----- 2 files changed, 41 insertions(+), 41 deletions(-) (limited to 'rbutil/rbutilqt') 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 @@ #include #include "encttscfggui.h" -EncTtsCfgGui::EncTtsCfgGui(QDialog* parent,EncTtsSettingInterface* interface,QString name) : QDialog(parent) +EncTtsCfgGui::EncTtsCfgGui(QDialog* parent, EncTtsSettingInterface* iface, QString name) + : QDialog(parent) { - m_settingInterface = interface; - - m_busyCnt=0; + m_settingInterface = iface; + + m_busyCnt=0; // create a busy Dialog m_busyDlg= new QProgressDialog("", "", 0, 0,this); m_busyDlg->setWindowTitle(tr("Waiting for engine...")); @@ -45,8 +46,8 @@ EncTtsCfgGui::EncTtsCfgGui(QDialog* parent,EncTtsSettingInterface* interface,QSt m_busyDlg->setLabel(0); m_busyDlg->setCancelButton(0); m_busyDlg->hide(); - connect(interface,SIGNAL(busy()),this,SLOT(showBusy())); - connect(interface,SIGNAL(busyEnd()),this,SLOT(hideBusy())); + connect(iface,SIGNAL(busy()),this,SLOT(showBusy())); + connect(iface,SIGNAL(busyEnd()),this,SLOT(hideBusy())); //setup the window setWindowTitle(name); @@ -56,10 +57,10 @@ EncTtsCfgGui::EncTtsCfgGui(QDialog* parent,EncTtsSettingInterface* interface,QSt void EncTtsCfgGui::setUpWindow() { m_settingsList = m_settingInterface->getSettings(); - + // layout QVBoxLayout *mainLayout = new QVBoxLayout; - + // groupbox QGroupBox *groupBox = new QGroupBox(this); QGridLayout *gridLayout = new QGridLayout(groupBox); @@ -85,10 +86,10 @@ void EncTtsCfgGui::setUpWindow() groupBox->setLayout(gridLayout); mainLayout->addWidget(groupBox); - + // connect browse btn connect(&m_browseBtnMap,SIGNAL(mapped(QObject*)),this,SLOT(browse(QObject*))); - + // ok - cancel buttons QPushButton* okBtn = new QPushButton(tr("Ok"),this); okBtn->setDefault(true); @@ -97,14 +98,14 @@ void EncTtsCfgGui::setUpWindow() cancelBtn->setIcon(QIcon(":icons/process-stop.png")); connect(okBtn,SIGNAL(clicked()),this,SLOT(accept())); connect(cancelBtn,SIGNAL(clicked()),this,SLOT(reject())); - + QHBoxLayout *btnbox = new QHBoxLayout; btnbox->addWidget(okBtn); btnbox->addWidget(cancelBtn); btnbox->insertStretch(0,1); - + mainLayout->addLayout(btnbox); - + this->setLayout(mainLayout); } @@ -177,14 +178,14 @@ QWidget* EncTtsCfgGui::createWidgets(EncTtsSetting* setting) break; } } - + // remember widget if(value != NULL) - { + { m_settingsWidgetsMap.insert(setting,value); connect(setting,SIGNAL(updateGui()),this,SLOT(updateWidget())); } - + return value; } @@ -216,8 +217,8 @@ void EncTtsCfgGui::updateSetting() if(widget == NULL) return; // get the corresponding setting EncTtsSetting* setting = m_settingsWidgetsMap.key(widget); - - // update widget based on setting type + + // update widget based on setting type switch(setting->type()) { case EncTtsSetting::eDOUBLE: @@ -253,7 +254,7 @@ void EncTtsCfgGui::updateSetting() { qDebug() << "unknown Settingtype !!"; break; - } + } } } @@ -264,7 +265,7 @@ void EncTtsCfgGui::updateWidget() if(setting == NULL) return; // get corresponding widget QWidget* widget = m_settingsWidgetsMap.value(setting); - + // update Widget based on setting type switch(setting->type()) { @@ -291,7 +292,7 @@ void EncTtsCfgGui::updateWidget() case EncTtsSetting::eSTRING: { QLineEdit* lineedit = (QLineEdit*) widget; - + lineedit->blockSignals(true); lineedit->setText(setting->current().toString()); lineedit->blockSignals(false); @@ -300,7 +301,7 @@ void EncTtsCfgGui::updateWidget() case EncTtsSetting::eREADONLYSTRING: { QLabel* label = (QLabel*) widget; - + label->blockSignals(true); label->setText(setting->current().toString()); label->blockSignals(false); @@ -309,20 +310,20 @@ void EncTtsCfgGui::updateWidget() case EncTtsSetting::eSTRINGLIST: { QComboBox* combobox = (QComboBox*) widget; - + combobox->blockSignals(true); combobox->clear(); combobox->addItems(setting->list()); int index = combobox->findText(setting->current().toString()); combobox->setCurrentIndex(index); combobox->blockSignals(false); - + break; } case EncTtsSetting::eBOOL: { QCheckBox* checkbox = (QCheckBox*) widget; - + checkbox->blockSignals(true); checkbox->setCheckState(setting->current().toBool() == true ? Qt::Checked : Qt::Unchecked); checkbox->blockSignals(false); @@ -332,25 +333,25 @@ void EncTtsCfgGui::updateWidget() { qDebug() << "unknown EncTTsSetting"; break; - } + } } } void EncTtsCfgGui::showBusy() { if(m_busyCnt == 0) m_busyDlg->show(); - + m_busyCnt++; } void EncTtsCfgGui::hideBusy() { m_busyCnt--; - + if(m_busyCnt == 0) m_busyDlg->hide(); } - - + + void EncTtsCfgGui::accept(void) { m_settingInterface->saveSettings(); @@ -368,7 +369,7 @@ void EncTtsCfgGui::browse(QObject* settingObj) // cast top setting EncTtsSetting* setting= qobject_cast(settingObj); if(setting == NULL) return; - + //current path QString curPath = setting->current().toString(); // show file dialog @@ -379,5 +380,3 @@ void EncTtsCfgGui::browse(QObject* settingObj) setting->setCurrent(exe); } - - 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 @@ * KIND, either express or implied. * ****************************************************************************/ - + #ifndef ENCTTSCFGGUI_H #define ENCTTSCFGGUI_H #include +#include #include #include "encttssettings.h" //! \brief Shows and manages a configuration gui for encoders and tts enignes -//! +//! class EncTtsCfgGui: public QDialog { Q_OBJECT public: //! Creates the UI. give it a endoer or tts engine with already set config. uses show() or exec() to show it. - EncTtsCfgGui(QDialog* parent, EncTtsSettingInterface* interface,QString name); - + EncTtsCfgGui(QDialog* parent, EncTtsSettingInterface* iface, QString name); + private slots: //! accept current configuration values and close window - void accept(void); + void accept(void); //! close window and dont save configuration void reject(void); //! updates the corresponding setting from the sending Widget void updateSetting(); - //! updates corresponding Widget from the sending Setting. + //! updates corresponding Widget from the sending Setting. void updateWidget(); //! shows a busy dialog. counts calls. void showBusy(); @@ -49,7 +50,7 @@ private slots: void hideBusy(); //! used via the SignalMapper for all Browse buttons void browse(QObject*); - + private: //! creates all dynamic window content void setUpWindow(); @@ -69,7 +70,7 @@ private: QMap m_settingsWidgetsMap; //! Maps all browse buttons to the corresponding Setting QSignalMapper m_browseBtnMap; - //! counter how often busyShow() is called, + //! counter how often busyShow() is called, int m_busyCnt; }; -- cgit v1.2.3