/****************************************************************************** * Request a change in the checked status. * The status is only actually changed when the alarm daemon run state changes. */ void AlarmEnableAction::setChecked(bool check) { kdDebug(5950) << "AlarmEnableAction::setChecked(" << check << ")\n"; if (check != isChecked()) { if (check) Daemon::allowRegisterFailMsg(); emit userClicked(check); } }
int GuiPushButton::qt_metacall(QMetaObject::Call _c, int _id, void **_a) { _id = QPushButton::qt_metacall(_c, _id, _a); if (_id < 0) return _id; if (_c == QMetaObject::InvokeMetaMethod) { switch (_id) { case 0: newGui((*reinterpret_cast< QString(*)>(_a[1])),(*reinterpret_cast< QString(*)>(_a[2])),(*reinterpret_cast< ASguiForm::creationOptions(*)>(_a[3]))); break; case 1: userClicked(); break; case 2: onGeneralMessage((*reinterpret_cast< QString(*)>(_a[1]))); break; case 3: requestEnabled((*reinterpret_cast< const bool(*)>(_a[1]))); break; case 4: launchGui((*reinterpret_cast< QString(*)>(_a[1])),(*reinterpret_cast< QString(*)>(_a[2])),(*reinterpret_cast< ASguiForm::creationOptions(*)>(_a[3]))); break; default: ; } _id -= 5; } return _id; }
/* Update what is presented to the user. Either an element select button, a 'current element' label, or both */ void QEPeriodic::updatePresentationOptions() { // Create the button if it is required and not there // Delete the button if it is not required and is present if( presentationOption == PRESENTATION_BUTTON_AND_LABEL || presentationOption == PRESENTATION_BUTTON_ONLY ) { if( !writeButton ) { writeButton = new QPushButton(); writeButton->setParent( this ); layout->addWidget( writeButton ); writeButton->setSizePolicy( QSizePolicy(QSizePolicy::MinimumExpanding,QSizePolicy::MinimumExpanding) ); // If a label is already present, and will still be required, // Ensure the button appears to the left of the label if( presentationOption == PRESENTATION_BUTTON_AND_LABEL && readbackLabel ) { layout->removeWidget( readbackLabel ); layout->addWidget( readbackLabel ); } writeButton->setAutoDefault( false ); writeButton->setEnabled( true ); // Valid if no PVs. When PVs are set button is disabled to reflect initial disconnected state writeButton->setText( "--" ); // Use push button signals QObject::connect( writeButton, SIGNAL( clicked() ), this, SLOT( userClicked() ) ); } } else { if( writeButton ) { delete writeButton; writeButton = NULL; } } // Create the label if it is required and not there // Delete the label if it is not required and is present if( presentationOption == PRESENTATION_BUTTON_AND_LABEL || presentationOption == PRESENTATION_LABEL_ONLY ) { if( !readbackLabel ) { readbackLabel = new QLabel(); readbackLabel->setParent( this ); readbackLabel->setAlignment( Qt::AlignCenter); readbackLabel->setSizePolicy( QSizePolicy(QSizePolicy::MinimumExpanding,QSizePolicy::MinimumExpanding) ); layout->addWidget( readbackLabel ); readbackLabel->setEnabled( false ); // Reflects initial disconnected state readbackLabel->setText( "--" ); } } else { if( readbackLabel ) { delete readbackLabel; readbackLabel = NULL; } } }