sysLocale::sysLocale(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_alternate, SIGNAL(editingFinished()), this, SLOT(sUpdateColors())); connect(_costScale, SIGNAL(valueChanged(int)), this, SLOT(sUpdateSamples())); connect(_country, SIGNAL(newID(int)), this, SLOT(sUpdateSamples())); connect(_currencyScale, SIGNAL(valueChanged(int)), this, SLOT(sUpdateSamples())); connect(_emphasis, SIGNAL(editingFinished()), this, SLOT(sUpdateColors())); connect(_error, SIGNAL(editingFinished()), this, SLOT(sUpdateColors())); connect(_expired, SIGNAL(editingFinished()), this, SLOT(sUpdateColors())); connect(_extPriceScale, SIGNAL(valueChanged(int)), this, SLOT(sUpdateSamples())); connect(_future, SIGNAL(editingFinished()), this, SLOT(sUpdateColors())); connect(_language, SIGNAL(newID(int)), this, SLOT(sUpdateCountries())); connect(_purchPriceScale,SIGNAL(valueChanged(int)), this, SLOT(sUpdateSamples())); connect(_qtyScale, SIGNAL(valueChanged(int)), this, SLOT(sUpdateSamples())); connect(_qtyPerScale, SIGNAL(valueChanged(int)), this, SLOT(sUpdateSamples())); connect(_salesPriceScale,SIGNAL(valueChanged(int)), this, SLOT(sUpdateSamples())); connect(_percentScale, SIGNAL(valueChanged(int)), this, SLOT(sUpdateSamples())); connect(_save, SIGNAL(clicked()), this, SLOT(sSave())); connect(_uomRatioScale, SIGNAL(valueChanged(int)), this, SLOT(sUpdateSamples())); connect(_warning, SIGNAL(editingFinished()), this, SLOT(sUpdateColors())); _localeid = -1; }
void sysLocale::populate() { XSqlQuery popq; popq.prepare( "SELECT * " "FROM locale " "WHERE (locale_id=:locale_id);" ); popq.bindValue(":locale_id", _localeid); popq.exec(); if (popq.first()) { _code->setText(popq.value("locale_code").toString()); _description->setText(popq.value("locale_descrip").toString()); _language->setId(popq.value("locale_lang_id").toInt()); _country->setId(popq.value("locale_country_id").toInt()); _currencyScale->setValue(popq.value("locale_curr_scale").toInt()); _salesPriceScale->setValue(popq.value("locale_salesprice_scale").toInt()); _purchPriceScale->setValue(popq.value("locale_purchprice_scale").toInt()); _extPriceScale->setValue(popq.value("locale_extprice_scale").toInt()); _costScale->setValue(popq.value("locale_cost_scale").toInt()); _qtyScale->setValue(popq.value("locale_qty_scale").toInt()); _qtyPerScale->setValue(popq.value("locale_qtyper_scale").toInt()); _weightScale->setValue(popq.value("locale_weight_scale").toInt()); _uomRatioScale->setValue(popq.value("locale_uomratio_scale").toInt()); _percentScale->setValue(popq.value("locale_percent_scale").toInt()); _comments->setText(popq.value("locale_comments").toString()); _error->setText(popq.value("locale_error_color").toString()); _warning->setText(popq.value("locale_warning_color").toString()); _emphasis->setText(popq.value("locale_emphasis_color").toString()); _alternate->setText(popq.value("locale_altemphasis_color").toString()); _expired->setText(popq.value("locale_expired_color").toString()); _future->setText(popq.value("locale_future_color").toString()); sUpdateSamples(); sUpdateColors(); } if (popq.lastError().type() != QSqlError::NoError) { systemError(this, popq.lastError().databaseText(), __FILE__, __LINE__); return; } }