void ConfigPanelWidget::posittionChanged() { ScreenPosition sp = ui->comboBox_position->itemData( ui->comboBox_position->currentIndex()).value<ScreenPosition>(); bool updateAlig = (sp.position == IRazorPanel::PositionTop || sp.position == IRazorPanel::PositionBottom) != (mPosition == IRazorPanel::PositionTop || mPosition == IRazorPanel::PositionBottom); int oldMax = getMaxLength(); mPosition = sp.position; mScreenNum = sp.screen; int newMax = getMaxLength(); if (ui->comboBox_lenghtType->currentIndex() == 1 && oldMax != newMax) { // Pixels ............................... int v = ui->spinBox_length->value() * 1.0 * newMax / oldMax; ui->spinBox_length->setMaximum(newMax); ui->spinBox_length->setValue(v); } if (updateAlig) fillComboBox_alignment(); editChanged(); }
bool SearchInputDialog::Create(void) { if (!LoadWindowFromXML("schedule-ui.xml", "searchpopup", this)) return false; MythUIText *messageText = NULL; MythUIButton *okButton = NULL; MythUIButton *cancelButton = NULL; bool err = false; UIUtilE::Assign(this, m_textEdit, "input", &err); UIUtilE::Assign(this, messageText, "message", &err); UIUtilE::Assign(this, okButton, "ok", &err); UIUtilW::Assign(this, cancelButton, "cancel"); if (err) { LOG(VB_GENERAL, LOG_ERR, "Cannot load screen 'searchpopup'"); return false; } if (cancelButton) connect(cancelButton, SIGNAL(Clicked()), SLOT(Close())); connect(okButton, SIGNAL(Clicked()), SLOT(sendResult())); m_textEdit->SetFilter(m_filter); m_textEdit->SetText(m_defaultValue); m_textEdit->SetPassword(m_isPassword); connect(m_textEdit, SIGNAL(valueChanged()), SLOT(editChanged())); BuildFocusList(); return true; }