35 #include <QPushButton>
38 #include <QVBoxLayout>
50 BaseWidget(parent,
"RecordSessionWidget",
"Record Session"),
51 mAcquisitionService(base),
52 mInfoLabel(new QLabel(
"")),
53 mStartStopButton(new QPushButton(QIcon(
":/icons/open_icon_library/media-record-3.png"),
"Start")),
54 mCancelButton(new QPushButton(QIcon(
":/icons/open_icon_library/process-stop-7.png"),
"Cancel")),
55 mDescriptionLine(new QLineEdit(defaultDescription)),
56 mRequireUsReady(requireUsReady)
58 QVBoxLayout* layout =
new QVBoxLayout(
this);
60 mDescriptionLabel =
new QLabel(
"Description:");
61 layout->addWidget(mInfoLabel);
62 layout->addWidget(mDescriptionLabel);
63 layout->addWidget(mDescriptionLine);
65 QHBoxLayout* buttonLayout =
new QHBoxLayout();
67 int buttonheight = mStartStopButton->sizeHint().height()*2.5;
68 mStartStopButton->setMinimumHeight(buttonheight);
69 mCancelButton->setMinimumHeight(buttonheight);
71 buttonLayout->addWidget(mStartStopButton);
72 buttonLayout->addWidget(mCancelButton);
73 layout->addLayout(buttonLayout);
77 mStartStopButton->setCheckable(
true);
78 connect(mStartStopButton, &QPushButton::clicked,
this, &RecordSessionWidget::startStopSlot);
79 connect(mCancelButton, &QPushButton::clicked,
this, &RecordSessionWidget::cancelSlot);
81 this->recordStateChangedSlot();
86 this->usReadinessChangedSlot();
93 "<h3>Record session.</h3>"
94 "<p>Lets you record a session of some kind.</p>"
101 this->setEnabled(val);
102 mInfoLabel->setText(text);
107 mDescriptionLine->setVisible(value);
108 mDescriptionLabel->setVisible(value);
116 mDescriptionLine->setText(text);
119 void RecordSessionWidget::usReadinessChangedSlot()
121 this->setEnabled(mAcquisitionService->isReady());
122 mInfoLabel->setText(mAcquisitionService->getInfoText());
125 void RecordSessionWidget::recordStateChangedSlot()
129 mStartStopButton->blockSignals(
true);
134 mStartStopButton->setChecked(
true);
135 mStartStopButton->setText(
"Stop");
136 mStartStopButton->setIcon(QIcon(
":/icons/open_icon_library/media-playback-stop.png"));
137 mStartStopButton->setEnabled(
true);
138 mCancelButton->setEnabled(
true);
141 mStartStopButton->setChecked(
false);
142 mStartStopButton->setText(
"Start");
143 mStartStopButton->setIcon(QIcon(
":/icons/open_icon_library/media-record-3.png"));
144 mStartStopButton->setEnabled(
true);
145 mCancelButton->setEnabled(
false);
148 mStartStopButton->setChecked(
false);
149 mStartStopButton->setText(
"Processing...");
150 mStartStopButton->setIcon(QIcon(
":/icons/open_icon_library/media-record-3.png"));
151 mStartStopButton->setEnabled(
false);
152 mCancelButton->setEnabled(
false);
156 mStartStopButton->blockSignals(
false);
159 void RecordSessionWidget::startStopSlot(
bool checked)
161 mAcquisitionService->toggleRecord();
164 void RecordSessionWidget::cancelSlot()
166 mAcquisitionService->cancelRecord();
boost::shared_ptr< class AcquisitionService > AcquisitionServicePtr
void usReadinessChanged()