Advanced Settings Panel
[pierogi] / forms / pirtvform.cpp
1 #include "pirtvform.h"
2 #include "ui_pirtvform.h"
3
4 #include "mainwindow.h"
5 #include "pirkeysetmanager.h"
6
7 PIRTVForm::PIRTVForm(MainWindow *mw) :
8   QWidget(0),
9   ui(new Ui::PIRTVForm),
10   mainWindow(mw)
11 {
12   ui->setupUi(this);
13 }
14
15 PIRTVForm::~PIRTVForm()
16 {
17   delete ui;
18 }
19
20
21 void PIRTVForm::enableButtons(
22   const PIRKeysetManager *km,
23   unsigned int id)
24 {
25   emit teletextEnabled(km->hasKey(id, Teletext_Key));
26   emit teletextSizeEnabled(km->hasKey(id, TeletextSize_Key));
27   emit favoritesEnabled(km->hasKey(id, Favorites_Key));
28   emit pageUpEnabled(km->hasKey(id, PageUp_Key));
29   emit teletextHoldEnabled(km->hasKey(id, TeletextHold_Key));
30   emit teletextRevealEnabled(km->hasKey(id, TeletextReveal_Key));
31   emit liveTVEnabled(km->hasKey(id, LiveTV_Key));
32   emit pageDownEnabled(km->hasKey(id, PageDown_Key));
33   emit pipEnabled(km->hasKey(id, PIP_Key));
34   emit pipSwapEnabled(km->hasKey(id, PIPSwap_Key));
35   emit pipMoveEnabled(km->hasKey(id, PIPMove_Key));
36   emit pipSourceEnabled(km->hasKey(id, PIPSource_Key));
37   emit pipChannelUpEnabled(km->hasKey(id, PIPChannelUp_Key));
38   emit pipChannelDownEnabled(km->hasKey(id, PIPChannelDown_Key));
39   emit pipPauseEnabled(km->hasKey(id, PIPPause_Key));
40   emit pipSizeEnabled(km->hasKey(id, PIPSize_Key));
41 }
42
43
44 void PIRTVForm::on_teletextButton_pressed()
45 {
46   mainWindow->startRepeating(Teletext_Key);
47 }
48
49 void PIRTVForm::on_teletextButton_released()
50 {
51   mainWindow->stopRepeating();
52 }
53
54 void PIRTVForm::on_teletextSizeButton_pressed()
55 {
56   mainWindow->startRepeating(TeletextSize_Key);
57 }
58
59 void PIRTVForm::on_teletextSizeButton_released()
60 {
61   mainWindow->stopRepeating();
62 }
63
64 void PIRTVForm::on_favoritesButton_pressed()
65 {
66   mainWindow->startRepeating(Favorites_Key);
67 }
68
69 void PIRTVForm::on_favoritesButton_released()
70 {
71   mainWindow->stopRepeating();
72 }
73
74 void PIRTVForm::on_pageUpButton_pressed()
75 {
76   mainWindow->startRepeating(PageUp_Key);
77 }
78
79 void PIRTVForm::on_pageUpButton_released()
80 {
81   mainWindow->stopRepeating();
82 }
83
84 void PIRTVForm::on_teletextHoldButton_pressed()
85 {
86   mainWindow->startRepeating(TeletextHold_Key);
87 }
88
89 void PIRTVForm::on_teletextHoldButton_released()
90 {
91   mainWindow->stopRepeating();
92 }
93
94 void PIRTVForm::on_teletextRevealButton_pressed()
95 {
96   mainWindow->startRepeating(TeletextReveal_Key);
97 }
98
99 void PIRTVForm::on_teletextRevealButton_released()
100 {
101   mainWindow->stopRepeating();
102 }
103
104 void PIRTVForm::on_liveTVButton_pressed()
105 {
106   mainWindow->startRepeating(LiveTV_Key);
107 }
108
109 void PIRTVForm::on_liveTVButton_released()
110 {
111   mainWindow->stopRepeating();
112 }
113
114 void PIRTVForm::on_pageDownButton_pressed()
115 {
116   mainWindow->startRepeating(PageDown_Key);
117 }
118
119 void PIRTVForm::on_pageDownButton_released()
120 {
121   mainWindow->stopRepeating();
122 }
123
124 void PIRTVForm::on_pipButton_pressed()
125 {
126   mainWindow->startRepeating(PIP_Key);
127 }
128
129 void PIRTVForm::on_pipButton_released()
130 {
131   mainWindow->stopRepeating();
132 }
133
134 void PIRTVForm::on_pipSwapButton_pressed()
135 {
136   mainWindow->startRepeating(PIPSwap_Key);
137 }
138
139 void PIRTVForm::on_pipSwapButton_released()
140 {
141   mainWindow->stopRepeating();
142 }
143
144 void PIRTVForm::on_pipMoveButton_pressed()
145 {
146   mainWindow->startRepeating(PIPMove_Key);
147 }
148
149 void PIRTVForm::on_pipMoveButton_released()
150 {
151   mainWindow->stopRepeating();
152 }
153
154 void PIRTVForm::on_pipSourceButton_pressed()
155 {
156   mainWindow->startRepeating(PIPSource_Key);
157 }
158
159 void PIRTVForm::on_pipSourceButton_released()
160 {
161   mainWindow->stopRepeating();
162 }
163
164 void PIRTVForm::on_pipChannelUpButton_pressed()
165 {
166   mainWindow->startRepeating(PIPChannelUp_Key);
167 }
168
169 void PIRTVForm::on_pipChannelUpButton_released()
170 {
171   mainWindow->stopRepeating();
172 }
173
174 void PIRTVForm::on_pipChannelDownButton_pressed()
175 {
176   mainWindow->startRepeating(PIPChannelDown_Key);
177 }
178
179 void PIRTVForm::on_pipChannelDownButton_released()
180 {
181   mainWindow->stopRepeating();
182 }
183
184 void PIRTVForm::on_pipPauseButton_pressed()
185 {
186   mainWindow->startRepeating(PIPPause_Key);
187 }
188
189 void PIRTVForm::on_pipPauseButton_released()
190 {
191   mainWindow->stopRepeating();
192 }
193
194 void PIRTVForm::on_pipSizeButton_pressed()
195 {
196   mainWindow->startRepeating(PIPSize_Key);
197 }
198
199 void PIRTVForm::on_pipSizeButton_released()
200 {
201   mainWindow->stopRepeating();
202 }