fbda6371af03b398c5c34413fc54f4ab8f65011e
[pierogi] / forms / pircameraform.cpp
1 #include "pircameraform.h"
2 #include "ui_pircameraform.h"
3
4 #include "mainwindow.h"
5 #include "pirkeysetmanager.h"
6
7 /*
8 PIRCameraForm::PIRCameraForm(QWidget *parent) :
9   QWidget(parent),
10   ui(new Ui::PIRCameraForm)
11 {
12   ui->setupUi(this);
13 }
14 */
15
16
17 PIRCameraForm::PIRCameraForm(
18   MainWindow *mw)
19   : QWidget(0),
20     ui(new Ui::PIRCameraForm),
21     mainWindow(mw)
22 {
23   ui->setupUi(this);
24 }
25
26
27 PIRCameraForm::~PIRCameraForm()
28 {
29   delete ui;
30 }
31
32
33 void PIRCameraForm::enableButtons(
34   const PIRKeysetManager *km,
35   unsigned int id)
36 {
37   emit openShutterEnabled(km->hasKey(id, OpenShutter_Key));
38   emit delayedOpenShutterEnabled(km->hasKey(id, DelayedOpenShutter_Key));
39 }
40
41
42 void PIRCameraForm::on_delayedShutterButton_pressed()
43 {
44   mainWindow->startRepeating(DelayedOpenShutter_Key);
45 }
46
47 void PIRCameraForm::on_delayedShutterButton_released()
48 {
49   mainWindow->stopRepeating();
50 }
51
52 void PIRCameraForm::on_openShutterButton_pressed()
53 {
54   mainWindow->startRepeating(OpenShutter_Key);
55 }
56
57 void PIRCameraForm::on_openShutterButton_released()
58 {
59   mainWindow->stopRepeating();
60 }