void EditFontDialog::ConnectToSignals() { //Connect signal and slots connect(ui->createNewRadioButton, SIGNAL(clicked()), this, SLOT(OnRadioButtonClicked())); connect(ui->applyToAllRadioButton, SIGNAL(clicked()), this, SLOT(OnRadioButtonClicked())); UpdateLineEditWidgetWithPropertyValue(ui->fontPresetNameLlineEdit); UpdateSpinBoxWidgetWithPropertyValue(ui->fontSizeSpinBox); UpdatePushButtonWidgetWithPropertyValue(ui->fontSelectButton); UpdateSpinBoxWidgetWithPropertyValue(ui->localizedFontSizeSpinBox); UpdatePushButtonWidgetWithPropertyValue(ui->localizedFontSelectButton); UpdateComboBoxWidgetWithPropertyValue(ui->selectLocaleComboBox); connect(ui->fontSelectButton, SIGNAL(clicked()), this, SLOT(OnPushButtonClicked())); connect(ui->fontSizeSpinBox, SIGNAL(valueChanged(int)), this, SLOT(OnSpinBoxValueChanged(int))); connect(ui->selectLocaleComboBox, SIGNAL(currentIndexChanged(QString)), this, SLOT(OnComboBoxValueChanged(QString))); connect(ui->resetFontForLocalePushButton, SIGNAL(clicked()), this, SLOT(OnPushButtonClicked())); connect(ui->localizedFontSelectButton, SIGNAL(clicked()), this, SLOT(OnPushButtonClicked())); connect(ui->localizedFontSizeSpinBox, SIGNAL(valueChanged(int)), this, SLOT(OnSpinBoxValueChanged(int))); connect(ui->buttonBox->button(QDialogButtonBox::Ok), SIGNAL(clicked()), this, SLOT(OnOkButtonClicked())); }
void EditFontDialog::DisconnectFromSignals() { disconnect(ui->createNewRadioButton, SIGNAL(clicked()), this, SLOT(OnRadioButtonClicked())); disconnect(ui->applyToAllRadioButton, SIGNAL(clicked()), this, SLOT(OnRadioButtonClicked())); disconnect(ui->fontSelectButton, SIGNAL(clicked()), this, SLOT(OnPushButtonClicked())); disconnect(ui->fontSizeSpinBox, SIGNAL(valueChanged(int)), this, SLOT(OnSpinBoxValueChanged(int))); disconnect(ui->selectLocaleComboBox, SIGNAL(currentIndexChanged(QString)), this, SLOT(OnComboBoxValueChanged(QString))); disconnect(ui->localizedFontSelectButton, SIGNAL(clicked()), this, SLOT(OnPushButtonClicked())); disconnect(ui->localizedFontSizeSpinBox, SIGNAL(valueChanged(int)), this, SLOT(OnSpinBoxValueChanged(int))); disconnect(ui->buttonBox, SIGNAL(clicked(QAbstractButton*)), this, SLOT(OnButtonBoxButtonClicked(QAbstractButton*))); }
LRESULT CTaskDialog::OnButtonClicked(UINT /* nCode */, int nID, HWND /* hWnd */) { if (nID == IDC_CHECK) return OnVerificationChecked(); for (DWORD cButton = 0; cButton < config_.cRadioButtons; cButton++) { if (nID == config_.pRadioButtons[cButton].nButtonID) return OnRadioButtonClicked(nID); } for (DWORD cButton = 0; cButton < config_.cButtons; cButton++) { if (nID == config_.pButtons[cButton].nButtonID) return OnButtonClicked(nID); } if (nID >= IDOK && nID <= IDCLOSE) return OnButtonClicked(nID); return 0L; }