1 | #include <cstdio> |
---|
2 | |
---|
3 | #include "backendsettings.h" |
---|
4 | #include "libmyth/mythcontext.h" |
---|
5 | #include "libmyth/settings.h" |
---|
6 | #include <unistd.h> |
---|
7 | |
---|
8 | |
---|
9 | static HostLineEdit *LocalServerIP() |
---|
10 | { |
---|
11 | HostLineEdit *gc = new HostLineEdit("BackendServerIP"); |
---|
12 | gc->setLabel(QObject::tr("IP address for") + QString(" ") + |
---|
13 | gContext->GetHostName()); |
---|
14 | gc->setValue("127.0.0.1"); |
---|
15 | gc->setHelpText(QObject::tr("Enter the IP address of this machine. " |
---|
16 | "Use an externally accessible address (ie, not " |
---|
17 | "127.0.0.1) if you are going to be running a frontend " |
---|
18 | "on a different machine than this one.")); |
---|
19 | return gc; |
---|
20 | }; |
---|
21 | |
---|
22 | static HostLineEdit *LocalServerPort() |
---|
23 | { |
---|
24 | HostLineEdit *gc = new HostLineEdit("BackendServerPort"); |
---|
25 | gc->setLabel(QObject::tr("Port the server runs on")); |
---|
26 | gc->setValue("6543"); |
---|
27 | gc->setHelpText(QObject::tr("Unless you've got good reason to, don't " |
---|
28 | "change this.")); |
---|
29 | return gc; |
---|
30 | }; |
---|
31 | |
---|
32 | static HostLineEdit *LocalStatusPort() |
---|
33 | { |
---|
34 | HostLineEdit *gc = new HostLineEdit("BackendStatusPort"); |
---|
35 | gc->setLabel(QObject::tr("Port the server shows status on")); |
---|
36 | gc->setValue("6544"); |
---|
37 | gc->setHelpText(QObject::tr("Port which the server will listen to for " |
---|
38 | "HTTP requests. Currently, it shows a little status " |
---|
39 | "information.")); |
---|
40 | return gc; |
---|
41 | }; |
---|
42 | |
---|
43 | static GlobalLineEdit *MasterServerIP() |
---|
44 | { |
---|
45 | GlobalLineEdit *gc = new GlobalLineEdit("MasterServerIP"); |
---|
46 | gc->setLabel(QObject::tr("Master Server IP address")); |
---|
47 | gc->setValue("127.0.0.1"); |
---|
48 | gc->setHelpText(QObject::tr("The IP address of the master backend " |
---|
49 | "server. All frontend and non-master backend machines " |
---|
50 | "will connect to this server. If you only have one " |
---|
51 | "backend, this should be the same IP address as " |
---|
52 | "above.")); |
---|
53 | return gc; |
---|
54 | }; |
---|
55 | |
---|
56 | static GlobalLineEdit *MasterServerPort() |
---|
57 | { |
---|
58 | GlobalLineEdit *gc = new GlobalLineEdit("MasterServerPort"); |
---|
59 | gc->setLabel(QObject::tr("Port the master server runs on")); |
---|
60 | gc->setValue("6543"); |
---|
61 | gc->setHelpText(QObject::tr("Unless you've got good reason to, " |
---|
62 | "don't change this.")); |
---|
63 | return gc; |
---|
64 | }; |
---|
65 | |
---|
66 | static HostLineEdit *RecordFilePrefix() |
---|
67 | { |
---|
68 | HostLineEdit *gc = new HostLineEdit("RecordFilePrefix"); |
---|
69 | gc->setLabel(QObject::tr("Directory to hold recordings")); |
---|
70 | gc->setValue("/mnt/store/"); |
---|
71 | gc->setHelpText(QObject::tr("All recordings get stored in this " |
---|
72 | "directory.")); |
---|
73 | return gc; |
---|
74 | }; |
---|
75 | |
---|
76 | static GlobalComboBox *TVFormat() |
---|
77 | { |
---|
78 | GlobalComboBox *gc = new GlobalComboBox("TVFormat"); |
---|
79 | gc->setLabel(QObject::tr("TV format")); |
---|
80 | gc->addSelection("NTSC"); |
---|
81 | gc->addSelection("ATSC"); |
---|
82 | gc->addSelection("PAL"); |
---|
83 | gc->addSelection("SECAM"); |
---|
84 | gc->addSelection("PAL-NC"); |
---|
85 | gc->addSelection("PAL-M"); |
---|
86 | gc->addSelection("PAL-N"); |
---|
87 | gc->addSelection("PAL-BG"); |
---|
88 | gc->addSelection("PAL-DK"); |
---|
89 | gc->addSelection("PAL-I"); |
---|
90 | gc->addSelection("PAL-60"); |
---|
91 | gc->addSelection("NTSC-JP"); |
---|
92 | gc->setHelpText(QObject::tr("The TV standard to use for viewing TV.")); |
---|
93 | return gc; |
---|
94 | }; |
---|
95 | |
---|
96 | static GlobalComboBox *VbiFormat() |
---|
97 | { |
---|
98 | GlobalComboBox *gc = new GlobalComboBox("VbiFormat"); |
---|
99 | gc->setLabel(QObject::tr("VBI format")); |
---|
100 | gc->addSelection("None"); |
---|
101 | gc->addSelection("PAL Teletext"); |
---|
102 | gc->addSelection("NTSC Closed Caption"); |
---|
103 | gc->setHelpText(QObject::tr("VBI stands for Vertical Blanking Interrupt. " |
---|
104 | "VBI is used to carry Teletext and Closed Captioning " |
---|
105 | "data.")); |
---|
106 | return gc; |
---|
107 | }; |
---|
108 | |
---|
109 | static GlobalComboBox *FreqTable() |
---|
110 | { |
---|
111 | GlobalComboBox *gc = new GlobalComboBox("FreqTable"); |
---|
112 | gc->setLabel(QObject::tr("Channel frequency table")); |
---|
113 | gc->addSelection("Singapore-PAL-BG"); |
---|
114 | gc->addSelection("us-cable"); |
---|
115 | gc->addSelection("us-bcast"); |
---|
116 | gc->addSelection("us-cable-hrc"); |
---|
117 | gc->addSelection("us-cable-irc"); |
---|
118 | gc->addSelection("japan-bcast"); |
---|
119 | gc->addSelection("japan-cable"); |
---|
120 | gc->addSelection("europe-west"); |
---|
121 | gc->addSelection("europe-east"); |
---|
122 | gc->addSelection("italy"); |
---|
123 | gc->addSelection("newzealand"); |
---|
124 | gc->addSelection("australia"); |
---|
125 | gc->addSelection("ireland"); |
---|
126 | gc->addSelection("france"); |
---|
127 | gc->addSelection("china-bcast"); |
---|
128 | gc->addSelection("southafrica"); |
---|
129 | gc->addSelection("argentina"); |
---|
130 | gc->addSelection("australia-optus"); |
---|
131 | gc->setHelpText(QObject::tr("Select the appropriate frequency table for " |
---|
132 | "your system. If you have an antenna, use a \"-bcast\" " |
---|
133 | "frequency.")); |
---|
134 | return gc; |
---|
135 | }; |
---|
136 | |
---|
137 | static GlobalCheckBox *SaveTranscoding() |
---|
138 | { |
---|
139 | GlobalCheckBox *gc = new GlobalCheckBox("SaveTranscoding"); |
---|
140 | gc->setLabel(QObject::tr("Save original files after transcoding (globally)")); |
---|
141 | gc->setValue(false); |
---|
142 | gc->setHelpText(QObject::tr("When set and the transcoder is active, the " |
---|
143 | "original files will be renamed to .old once the " |
---|
144 | "transcoding is complete.")); |
---|
145 | return gc; |
---|
146 | }; |
---|
147 | |
---|
148 | static GlobalCheckBox *DeletesFollowLinks() |
---|
149 | { |
---|
150 | GlobalCheckBox *gc = new GlobalCheckBox("DeletesFollowLinks"); |
---|
151 | gc->setLabel(QObject::tr("Follow symbolic links when deleting files")); |
---|
152 | gc->setValue(false); |
---|
153 | gc->setHelpText(QObject::tr("This will cause Myth to follow symlinks " |
---|
154 | "when recordings and related files are deleted, instead " |
---|
155 | "of deleting the symlink and leaving the actual file.")); |
---|
156 | return gc; |
---|
157 | }; |
---|
158 | |
---|
159 | static GlobalComboBox *TimeOffset() |
---|
160 | { |
---|
161 | GlobalComboBox *gc = new GlobalComboBox("TimeOffset"); |
---|
162 | gc->setLabel(QObject::tr("Time offset for XMLTV listings")); |
---|
163 | gc->addSelection("None"); |
---|
164 | gc->addSelection("Auto"); |
---|
165 | gc->addSelection("+0030"); |
---|
166 | gc->addSelection("+0100"); |
---|
167 | gc->addSelection("+0130"); |
---|
168 | gc->addSelection("+0200"); |
---|
169 | gc->addSelection("+0230"); |
---|
170 | gc->addSelection("+0300"); |
---|
171 | gc->addSelection("+0330"); |
---|
172 | gc->addSelection("+0400"); |
---|
173 | gc->addSelection("+0430"); |
---|
174 | gc->addSelection("+0500"); |
---|
175 | gc->addSelection("+0530"); |
---|
176 | gc->addSelection("+0600"); |
---|
177 | gc->addSelection("+0630"); |
---|
178 | gc->addSelection("+0700"); |
---|
179 | gc->addSelection("+0730"); |
---|
180 | gc->addSelection("+0800"); |
---|
181 | gc->addSelection("+0830"); |
---|
182 | gc->addSelection("+0900"); |
---|
183 | gc->addSelection("+0930"); |
---|
184 | gc->addSelection("+1000"); |
---|
185 | gc->addSelection("+1030"); |
---|
186 | gc->addSelection("+1100"); |
---|
187 | gc->addSelection("+1130"); |
---|
188 | gc->addSelection("+1200"); |
---|
189 | gc->addSelection("-1100"); |
---|
190 | gc->addSelection("-1030"); |
---|
191 | gc->addSelection("-1000"); |
---|
192 | gc->addSelection("-0930"); |
---|
193 | gc->addSelection("-0900"); |
---|
194 | gc->addSelection("-0830"); |
---|
195 | gc->addSelection("-0800"); |
---|
196 | gc->addSelection("-0730"); |
---|
197 | gc->addSelection("-0700"); |
---|
198 | gc->addSelection("-0630"); |
---|
199 | gc->addSelection("-0600"); |
---|
200 | gc->addSelection("-0530"); |
---|
201 | gc->addSelection("-0500"); |
---|
202 | gc->addSelection("-0430"); |
---|
203 | gc->addSelection("-0400"); |
---|
204 | gc->addSelection("-0330"); |
---|
205 | gc->addSelection("-0300"); |
---|
206 | gc->addSelection("-0230"); |
---|
207 | gc->addSelection("-0200"); |
---|
208 | gc->addSelection("-0130"); |
---|
209 | gc->addSelection("-0100"); |
---|
210 | gc->addSelection("-0030"); |
---|
211 | gc->setHelpText(QObject::tr("Adjust the relative timezone of the XMLTV EPG data read " |
---|
212 | "by mythfilldatabase. 'Auto' converts the XMLTV time to local time " |
---|
213 | "using your computer's timezone. 'None' ignores the " |
---|
214 | "XMLTV timezone, interpreting times as local.")); |
---|
215 | return gc; |
---|
216 | }; |
---|
217 | |
---|
218 | static GlobalSpinBox *EITTransportTimeout() |
---|
219 | { |
---|
220 | GlobalSpinBox *gc = new GlobalSpinBox("EITTransportTimeout", 1, 15, 1); |
---|
221 | gc->setLabel(QObject::tr("EIT Transport Timeout (mins)")); |
---|
222 | gc->setValue(5); |
---|
223 | QString helpText = QObject::tr( |
---|
224 | "Maximum time to spend waiting for listings data on one DTV channel " |
---|
225 | "before checking for new listings data on the next channel."); |
---|
226 | gc->setHelpText(helpText); |
---|
227 | return gc; |
---|
228 | } |
---|
229 | |
---|
230 | static GlobalCheckBox *MasterBackendOverride() |
---|
231 | { |
---|
232 | GlobalCheckBox *gc = new GlobalCheckBox("MasterBackendOverride"); |
---|
233 | gc->setLabel(QObject::tr("Master Backend Override")); |
---|
234 | gc->setValue(true); |
---|
235 | gc->setHelpText(QObject::tr("If enabled, the master backend will stream and" |
---|
236 | " delete files if it finds them in the video directory. " |
---|
237 | "Useful if you are using a central storage location, like " |
---|
238 | "a NFS share, and your slave backend isn't running.")); |
---|
239 | return gc; |
---|
240 | }; |
---|
241 | |
---|
242 | static GlobalSpinBox *WOLbackendReconnectWaitTime() |
---|
243 | { |
---|
244 | GlobalSpinBox *gc = new GlobalSpinBox("WOLbackendReconnectWaitTime", 0, 1200, 5); |
---|
245 | gc->setLabel(QObject::tr("Reconnect wait time (secs)")); |
---|
246 | gc->setValue(0); |
---|
247 | gc->setHelpText(QObject::tr("Length of time the frontend waits between the " |
---|
248 | "tries to wake up the master backend. This should be the " |
---|
249 | "time your masterbackend needs to startup. Set 0 to " |
---|
250 | "disable.")); |
---|
251 | return gc; |
---|
252 | }; |
---|
253 | |
---|
254 | static GlobalSpinBox *WOLbackendConnectRetry() |
---|
255 | { |
---|
256 | GlobalSpinBox *gc = new GlobalSpinBox("WOLbackendConnectRetry", 1, 60, 1); |
---|
257 | gc->setLabel(QObject::tr("Count of reconnect tries")); |
---|
258 | gc->setHelpText(QObject::tr("Number of times the frontend will try to wake " |
---|
259 | "up the master backend.")); |
---|
260 | gc->setValue(5); |
---|
261 | return gc; |
---|
262 | }; |
---|
263 | |
---|
264 | static GlobalLineEdit *WOLbackendCommand() |
---|
265 | { |
---|
266 | GlobalLineEdit *gc = new GlobalLineEdit("WOLbackendCommand"); |
---|
267 | gc->setLabel(QObject::tr("Wake Command")); |
---|
268 | gc->setValue(""); |
---|
269 | gc->setHelpText(QObject::tr("The command used to wake up your master " |
---|
270 | "backend server.")); |
---|
271 | return gc; |
---|
272 | }; |
---|
273 | |
---|
274 | static GlobalLineEdit *WOLslaveBackendsCommand() |
---|
275 | { |
---|
276 | GlobalLineEdit *gc = new GlobalLineEdit("WOLslaveBackendsCommand"); |
---|
277 | gc->setLabel(QObject::tr("Wake command for slaves")); |
---|
278 | gc->setValue(""); |
---|
279 | gc->setHelpText(QObject::tr("The command used to wakeup your slave " |
---|
280 | "backends. Leave empty to disable.")); |
---|
281 | return gc; |
---|
282 | }; |
---|
283 | |
---|
284 | static GlobalSpinBox *idleTimeoutSecs() |
---|
285 | { |
---|
286 | GlobalSpinBox *gc = new GlobalSpinBox("idleTimeoutSecs", 0, 1200, 5); |
---|
287 | gc->setLabel(QObject::tr("Idle timeout (secs)")); |
---|
288 | gc->setValue(0); |
---|
289 | gc->setHelpText(QObject::tr("The amount of time the master backend idles " |
---|
290 | "before it shuts down all backends. Set to 0 to disable " |
---|
291 | "auto shutdown.")); |
---|
292 | return gc; |
---|
293 | }; |
---|
294 | |
---|
295 | static GlobalSpinBox *idleWaitForRecordingTime() |
---|
296 | { |
---|
297 | GlobalSpinBox *gc = new GlobalSpinBox("idleWaitForRecordingTime", 0, 120, 1); |
---|
298 | gc->setLabel(QObject::tr("Max. wait for recording (min)")); |
---|
299 | gc->setValue(15); |
---|
300 | gc->setHelpText(QObject::tr("The amount of time the master backend waits " |
---|
301 | "for a recording. If it's idle but a recording starts " |
---|
302 | "within this time period, the backends won't shut down.")); |
---|
303 | return gc; |
---|
304 | }; |
---|
305 | |
---|
306 | static GlobalSpinBox *StartupSecsBeforeRecording() |
---|
307 | { |
---|
308 | GlobalSpinBox *gc = new GlobalSpinBox("StartupSecsBeforeRecording", 0, 1200, 5); |
---|
309 | gc->setLabel(QObject::tr("Startup before rec. (secs)")); |
---|
310 | gc->setValue(120); |
---|
311 | gc->setHelpText(QObject::tr("The amount of time the master backend will be " |
---|
312 | "woken up before a recording starts.")); |
---|
313 | return gc; |
---|
314 | }; |
---|
315 | |
---|
316 | static GlobalLineEdit *WakeupTimeFormat() |
---|
317 | { |
---|
318 | GlobalLineEdit *gc = new GlobalLineEdit("WakeupTimeFormat"); |
---|
319 | gc->setLabel(QObject::tr("Wakeup time format")); |
---|
320 | gc->setValue("hh:mm yyyy-MM-dd"); |
---|
321 | gc->setHelpText(QObject::tr("The format of the time string passed to the " |
---|
322 | "\'setWakeuptime Command\' as $time. See " |
---|
323 | "QT::QDateTime.toString() for details. Set to 'time_t' for " |
---|
324 | "seconds since epoch.")); |
---|
325 | return gc; |
---|
326 | }; |
---|
327 | |
---|
328 | static GlobalLineEdit *SetWakeuptimeCommand() |
---|
329 | { |
---|
330 | GlobalLineEdit *gc = new GlobalLineEdit("SetWakeuptimeCommand"); |
---|
331 | gc->setLabel(QObject::tr("Set wakeuptime command")); |
---|
332 | gc->setValue(""); |
---|
333 | gc->setHelpText(QObject::tr("The command used to set the time (passed as " |
---|
334 | "$time) to wake up the masterbackend")); |
---|
335 | return gc; |
---|
336 | }; |
---|
337 | |
---|
338 | static GlobalLineEdit *ServerHaltCommand() |
---|
339 | { |
---|
340 | GlobalLineEdit *gc = new GlobalLineEdit("ServerHaltCommand"); |
---|
341 | gc->setLabel(QObject::tr("Server halt command")); |
---|
342 | gc->setValue("sudo /sbin/halt -p"); |
---|
343 | gc->setHelpText(QObject::tr("The command used to halt the backends.")); |
---|
344 | return gc; |
---|
345 | }; |
---|
346 | |
---|
347 | static GlobalLineEdit *preSDWUCheckCommand() |
---|
348 | { |
---|
349 | GlobalLineEdit *gc = new GlobalLineEdit("preSDWUCheckCommand"); |
---|
350 | gc->setLabel(QObject::tr("Pre Shutdown check-command")); |
---|
351 | gc->setValue(""); |
---|
352 | gc->setHelpText(QObject::tr("A command executed before the backend would " |
---|
353 | "shutdown. The return value determines if " |
---|
354 | "the backend can shutdown. 0 - yes, " |
---|
355 | "1 - restart idleing, " |
---|
356 | "2 - reset the backend to wait for a frontend.")); |
---|
357 | return gc; |
---|
358 | }; |
---|
359 | |
---|
360 | static GlobalCheckBox *blockSDWUwithoutClient() |
---|
361 | { |
---|
362 | GlobalCheckBox *gc = new GlobalCheckBox("blockSDWUwithoutClient"); |
---|
363 | gc->setLabel(QObject::tr("Block shutdown before client connected")); |
---|
364 | gc->setValue(true); |
---|
365 | gc->setHelpText(QObject::tr("If set, the automatic shutdown routine will " |
---|
366 | "be disabled until a client connects.")); |
---|
367 | return gc; |
---|
368 | }; |
---|
369 | |
---|
370 | static GlobalLineEdit *startupCommand() |
---|
371 | { |
---|
372 | GlobalLineEdit *gc = new GlobalLineEdit("startupCommand"); |
---|
373 | gc->setLabel(QObject::tr("Startup command")); |
---|
374 | gc->setValue(""); |
---|
375 | gc->setHelpText(QObject::tr("This command is executed right after starting " |
---|
376 | "the BE. As a parameter \'$status\' is replaced by either " |
---|
377 | "\'auto\' if the machine was started automatically or " |
---|
378 | "\'user\' if a user switched it on.")); |
---|
379 | return gc; |
---|
380 | }; |
---|
381 | |
---|
382 | static HostSpinBox *JobQueueMaxSimultaneousJobs() |
---|
383 | { |
---|
384 | HostSpinBox *gc = new HostSpinBox("JobQueueMaxSimultaneousJobs", 1, 10, 1); |
---|
385 | gc->setLabel(QObject::tr("Maximum simultaneous jobs on this backend")); |
---|
386 | gc->setHelpText(QObject::tr("The Job Queue will be limited to running " |
---|
387 | "this many simultaneous jobs on this backend.")); |
---|
388 | gc->setValue(1); |
---|
389 | return gc; |
---|
390 | }; |
---|
391 | |
---|
392 | static HostSpinBox *JobQueueCheckFrequency() |
---|
393 | { |
---|
394 | HostSpinBox *gc = new HostSpinBox("JobQueueCheckFrequency", 5, 300, 5); |
---|
395 | gc->setLabel(QObject::tr("Job Queue Check frequency (in seconds)")); |
---|
396 | gc->setHelpText(QObject::tr("When looking for new jobs to process, the " |
---|
397 | "Job Queue will wait this long between checks.")); |
---|
398 | gc->setValue(60); |
---|
399 | return gc; |
---|
400 | }; |
---|
401 | |
---|
402 | static HostComboBox *JobQueueCPU() |
---|
403 | { |
---|
404 | HostComboBox *gc = new HostComboBox("JobQueueCPU"); |
---|
405 | gc->setLabel(QObject::tr("CPU Usage")); |
---|
406 | gc->addSelection(QObject::tr("Low"), "0"); |
---|
407 | gc->addSelection(QObject::tr("Medium"), "1"); |
---|
408 | gc->addSelection(QObject::tr("High"), "2"); |
---|
409 | gc->setHelpText(QObject::tr("This setting controls approximately how " |
---|
410 | "much CPU jobs in the queue may consume. " |
---|
411 | "On 'High', all available CPU time may be used " |
---|
412 | "which could cause problems on slower systems." )); |
---|
413 | return gc; |
---|
414 | }; |
---|
415 | |
---|
416 | static HostTimeBox *JobQueueWindowStart() |
---|
417 | { |
---|
418 | HostTimeBox *gc = new HostTimeBox("JobQueueWindowStart", "00:00"); |
---|
419 | gc->setLabel(QObject::tr("Job Queue Start Time")); |
---|
420 | gc->setHelpText(QObject::tr("This setting controls the start of the " |
---|
421 | "Job Queue time window which determines when new jobs will " |
---|
422 | "be started.")); |
---|
423 | return gc; |
---|
424 | }; |
---|
425 | |
---|
426 | static HostTimeBox *JobQueueWindowEnd() |
---|
427 | { |
---|
428 | HostTimeBox *gc = new HostTimeBox("JobQueueWindowEnd", "23:59"); |
---|
429 | gc->setLabel(QObject::tr("Job Queue End Time")); |
---|
430 | gc->setHelpText(QObject::tr("This setting controls the end of the " |
---|
431 | "Job Queue time window which determines when new jobs will " |
---|
432 | "be started.")); |
---|
433 | return gc; |
---|
434 | }; |
---|
435 | |
---|
436 | static GlobalCheckBox *JobsRunOnRecordHost() |
---|
437 | { |
---|
438 | GlobalCheckBox *gc = new GlobalCheckBox("JobsRunOnRecordHost"); |
---|
439 | gc->setLabel(QObject::tr("Run Jobs only on original recording host")); |
---|
440 | gc->setValue(false); |
---|
441 | gc->setHelpText(QObject::tr("If set, jobs in the queue will be required " |
---|
442 | "to run on the backend that made the " |
---|
443 | "original recording.")); |
---|
444 | return gc; |
---|
445 | }; |
---|
446 | |
---|
447 | static GlobalCheckBox *AutoTranscodeBeforeAutoCommflag() |
---|
448 | { |
---|
449 | GlobalCheckBox *gc = new GlobalCheckBox("AutoTranscodeBeforeAutoCommflag"); |
---|
450 | gc->setLabel(QObject::tr("Run Transcode Jobs before Auto-Commercial Flagging")); |
---|
451 | gc->setValue(false); |
---|
452 | gc->setHelpText(QObject::tr("If set, if both auto-transcode and " |
---|
453 | "auto commercial flagging are turned ON for a " |
---|
454 | "recording, transcoding will run first, " |
---|
455 | "otherwise, commercial flagging runs first.")); |
---|
456 | return gc; |
---|
457 | }; |
---|
458 | |
---|
459 | static GlobalCheckBox *AutoCommflagWhileRecording() |
---|
460 | { |
---|
461 | GlobalCheckBox *gc = new GlobalCheckBox("AutoCommflagWhileRecording"); |
---|
462 | gc->setLabel(QObject::tr("Start Auto-Commercial Flagging jobs when the " |
---|
463 | "recording starts")); |
---|
464 | gc->setValue(false); |
---|
465 | gc->setHelpText(QObject::tr("If set and Auto Commercial Flagging is ON for " |
---|
466 | "a recording, the flagging job will be started " |
---|
467 | "as soon as the recording starts. NOT " |
---|
468 | "recommended on underpowered systems.")); |
---|
469 | return gc; |
---|
470 | }; |
---|
471 | |
---|
472 | static GlobalLineEdit *UserJobDesc1() |
---|
473 | { |
---|
474 | GlobalLineEdit *gc = new GlobalLineEdit("UserJobDesc1"); |
---|
475 | gc->setLabel(QObject::tr("User Job #1 Description")); |
---|
476 | gc->setValue("User Job #1"); |
---|
477 | gc->setHelpText(QObject::tr("The Description for this User Job.")); |
---|
478 | return gc; |
---|
479 | }; |
---|
480 | |
---|
481 | static GlobalLineEdit *UserJob1() |
---|
482 | { |
---|
483 | GlobalLineEdit *gc = new GlobalLineEdit("UserJob1"); |
---|
484 | gc->setLabel(QObject::tr("User Job #1 Command")); |
---|
485 | gc->setValue(""); |
---|
486 | gc->setHelpText(QObject::tr("The command to run whenever this User Job " |
---|
487 | "number is scheduled.")); |
---|
488 | return gc; |
---|
489 | }; |
---|
490 | |
---|
491 | static GlobalLineEdit *UserJobDesc2() |
---|
492 | { |
---|
493 | GlobalLineEdit *gc = new GlobalLineEdit("UserJobDesc2"); |
---|
494 | gc->setLabel(QObject::tr("User Job #2 Description")); |
---|
495 | gc->setValue("User Job #2"); |
---|
496 | gc->setHelpText(QObject::tr("The Description for this User Job.")); |
---|
497 | return gc; |
---|
498 | }; |
---|
499 | |
---|
500 | static GlobalLineEdit *UserJob2() |
---|
501 | { |
---|
502 | GlobalLineEdit *gc = new GlobalLineEdit("UserJob2"); |
---|
503 | gc->setLabel(QObject::tr("User Job #2 Command")); |
---|
504 | gc->setValue(""); |
---|
505 | gc->setHelpText(QObject::tr("The command to run whenever this User Job " |
---|
506 | "number is scheduled.")); |
---|
507 | return gc; |
---|
508 | }; |
---|
509 | |
---|
510 | static GlobalLineEdit *UserJobDesc3() |
---|
511 | { |
---|
512 | GlobalLineEdit *gc = new GlobalLineEdit("UserJobDesc3"); |
---|
513 | gc->setLabel(QObject::tr("User Job #3 Description")); |
---|
514 | gc->setValue("User Job #3"); |
---|
515 | gc->setHelpText(QObject::tr("The Description for this User Job.")); |
---|
516 | return gc; |
---|
517 | }; |
---|
518 | |
---|
519 | static GlobalLineEdit *UserJob3() |
---|
520 | { |
---|
521 | GlobalLineEdit *gc = new GlobalLineEdit("UserJob3"); |
---|
522 | gc->setLabel(QObject::tr("User Job #3 Command")); |
---|
523 | gc->setValue(""); |
---|
524 | gc->setHelpText(QObject::tr("The command to run whenever this User Job " |
---|
525 | "number is scheduled.")); |
---|
526 | return gc; |
---|
527 | }; |
---|
528 | |
---|
529 | static GlobalLineEdit *UserJobDesc4() |
---|
530 | { |
---|
531 | GlobalLineEdit *gc = new GlobalLineEdit("UserJobDesc4"); |
---|
532 | gc->setLabel(QObject::tr("User Job #4 Description")); |
---|
533 | gc->setValue("User Job #4"); |
---|
534 | gc->setHelpText(QObject::tr("The Description for this User Job.")); |
---|
535 | return gc; |
---|
536 | }; |
---|
537 | |
---|
538 | static GlobalLineEdit *UserJob4() |
---|
539 | { |
---|
540 | GlobalLineEdit *gc = new GlobalLineEdit("UserJob4"); |
---|
541 | gc->setLabel(QObject::tr("User Job #4 Command")); |
---|
542 | gc->setValue(""); |
---|
543 | gc->setHelpText(QObject::tr("The command to run whenever this User Job " |
---|
544 | "number is scheduled.")); |
---|
545 | return gc; |
---|
546 | }; |
---|
547 | |
---|
548 | static HostCheckBox *JobAllowCommFlag() |
---|
549 | { |
---|
550 | HostCheckBox *gc = new HostCheckBox("JobAllowCommFlag"); |
---|
551 | gc->setLabel(QObject::tr("Allow Commercial Detection jobs")); |
---|
552 | gc->setValue(true); |
---|
553 | gc->setHelpText(QObject::tr("Allow jobs of this type to run on this " |
---|
554 | "backend.")); |
---|
555 | return gc; |
---|
556 | }; |
---|
557 | |
---|
558 | static HostCheckBox *JobAllowTranscode() |
---|
559 | { |
---|
560 | HostCheckBox *gc = new HostCheckBox("JobAllowTranscode"); |
---|
561 | gc->setLabel(QObject::tr("Allow Transcoding jobs")); |
---|
562 | gc->setValue(true); |
---|
563 | gc->setHelpText(QObject::tr("Allow jobs of this type to run on this " |
---|
564 | "backend.")); |
---|
565 | return gc; |
---|
566 | }; |
---|
567 | |
---|
568 | static HostCheckBox *JobAllowUserJob1() |
---|
569 | { |
---|
570 | HostCheckBox *gc = new HostCheckBox("JobAllowUserJob1"); |
---|
571 | gc->setLabel(QObject::tr("Allow 'User Job #1' jobs")); |
---|
572 | gc->setValue(false); |
---|
573 | gc->setHelpText(QObject::tr("Allow jobs of this type to run on this " |
---|
574 | "backend.")); |
---|
575 | return gc; |
---|
576 | }; |
---|
577 | |
---|
578 | static HostCheckBox *JobAllowUserJob2() |
---|
579 | { |
---|
580 | HostCheckBox *gc = new HostCheckBox("JobAllowUserJob2"); |
---|
581 | gc->setLabel(QObject::tr("Allow 'User Job #2' jobs")); |
---|
582 | gc->setValue(false); |
---|
583 | gc->setHelpText(QObject::tr("Allow jobs of this type to run on this " |
---|
584 | "backend.")); |
---|
585 | return gc; |
---|
586 | }; |
---|
587 | |
---|
588 | static HostCheckBox *JobAllowUserJob3() |
---|
589 | { |
---|
590 | HostCheckBox *gc = new HostCheckBox("JobAllowUserJob3"); |
---|
591 | gc->setLabel(QObject::tr("Allow 'User Job #3' jobs")); |
---|
592 | gc->setValue(false); |
---|
593 | gc->setHelpText(QObject::tr("Allow jobs of this type to run on this " |
---|
594 | "backend.")); |
---|
595 | return gc; |
---|
596 | }; |
---|
597 | |
---|
598 | static HostCheckBox *JobAllowUserJob4() |
---|
599 | { |
---|
600 | HostCheckBox *gc = new HostCheckBox("JobAllowUserJob4"); |
---|
601 | gc->setLabel(QObject::tr("Allow 'User Job #4' jobs")); |
---|
602 | gc->setValue(false); |
---|
603 | gc->setHelpText(QObject::tr("Allow jobs of this type to run on this " |
---|
604 | "backend.")); |
---|
605 | return gc; |
---|
606 | }; |
---|
607 | |
---|
608 | |
---|
609 | BackendSettings::BackendSettings() { |
---|
610 | VerticalConfigurationGroup* server = new VerticalConfigurationGroup(false); |
---|
611 | server->setLabel(QObject::tr("Host Address Backend Setup")); |
---|
612 | server->addChild(LocalServerIP()); |
---|
613 | server->addChild(LocalServerPort()); |
---|
614 | server->addChild(LocalStatusPort()); |
---|
615 | server->addChild(MasterServerIP()); |
---|
616 | server->addChild(MasterServerPort()); |
---|
617 | addChild(server); |
---|
618 | |
---|
619 | VerticalConfigurationGroup* group1 = new VerticalConfigurationGroup(false); |
---|
620 | group1->setLabel(QObject::tr("Host-specific Backend Setup")); |
---|
621 | group1->addChild(RecordFilePrefix()); |
---|
622 | group1->addChild(SaveTranscoding()); |
---|
623 | addChild(group1); |
---|
624 | |
---|
625 | VerticalConfigurationGroup* group2 = new VerticalConfigurationGroup(false); |
---|
626 | group2->setLabel(QObject::tr("Global Backend Setup")); |
---|
627 | group2->addChild(TVFormat()); |
---|
628 | group2->addChild(VbiFormat()); |
---|
629 | group2->addChild(FreqTable()); |
---|
630 | group2->addChild(TimeOffset()); |
---|
631 | group2->addChild(EITTransportTimeout()); |
---|
632 | group2->addChild(MasterBackendOverride()); |
---|
633 | group2->addChild(DeletesFollowLinks()); |
---|
634 | addChild(group2); |
---|
635 | |
---|
636 | VerticalConfigurationGroup* group3 = new VerticalConfigurationGroup(false); |
---|
637 | group3->setLabel(QObject::tr("Shutdown/Wakeup Options")); |
---|
638 | group3->addChild(startupCommand()); |
---|
639 | group3->addChild(blockSDWUwithoutClient()); |
---|
640 | group3->addChild(idleTimeoutSecs()); |
---|
641 | group3->addChild(idleWaitForRecordingTime()); |
---|
642 | group3->addChild(StartupSecsBeforeRecording()); |
---|
643 | group3->addChild(WakeupTimeFormat()); |
---|
644 | group3->addChild(SetWakeuptimeCommand()); |
---|
645 | group3->addChild(ServerHaltCommand()); |
---|
646 | group3->addChild(preSDWUCheckCommand()); |
---|
647 | addChild(group3); |
---|
648 | |
---|
649 | VerticalConfigurationGroup* group4 = new VerticalConfigurationGroup(false); |
---|
650 | group4->setLabel(QObject::tr("WakeOnLan settings")); |
---|
651 | |
---|
652 | VerticalConfigurationGroup* backend = new VerticalConfigurationGroup(); |
---|
653 | backend->setLabel(QObject::tr("MasterBackend")); |
---|
654 | backend->addChild(WOLbackendReconnectWaitTime()); |
---|
655 | backend->addChild(WOLbackendConnectRetry()); |
---|
656 | backend->addChild(WOLbackendCommand()); |
---|
657 | group4->addChild(backend); |
---|
658 | |
---|
659 | group4->addChild(WOLslaveBackendsCommand()); |
---|
660 | addChild(group4); |
---|
661 | |
---|
662 | VerticalConfigurationGroup* group5 = new VerticalConfigurationGroup(false); |
---|
663 | group5->setLabel(QObject::tr("Job Queue (Host-Specific)")); |
---|
664 | group5->addChild(JobQueueMaxSimultaneousJobs()); |
---|
665 | group5->addChild(JobQueueCheckFrequency()); |
---|
666 | |
---|
667 | HorizontalConfigurationGroup* group5a = |
---|
668 | new HorizontalConfigurationGroup(false, false); |
---|
669 | VerticalConfigurationGroup* group5a1 = |
---|
670 | new VerticalConfigurationGroup(false, false); |
---|
671 | group5a1->addChild(JobQueueWindowStart()); |
---|
672 | group5a1->addChild(JobQueueWindowEnd()); |
---|
673 | group5a1->addChild(JobQueueCPU()); |
---|
674 | group5a1->addChild(JobAllowCommFlag()); |
---|
675 | group5a1->addChild(JobAllowTranscode()); |
---|
676 | group5a->addChild(group5a1); |
---|
677 | |
---|
678 | VerticalConfigurationGroup* group5a2 = |
---|
679 | new VerticalConfigurationGroup(false, false); |
---|
680 | group5a2->addChild(JobAllowUserJob1()); |
---|
681 | group5a2->addChild(JobAllowUserJob2()); |
---|
682 | group5a2->addChild(JobAllowUserJob3()); |
---|
683 | group5a2->addChild(JobAllowUserJob4()); |
---|
684 | group5a->addChild(group5a2); |
---|
685 | group5->addChild(group5a); |
---|
686 | addChild(group5); |
---|
687 | |
---|
688 | VerticalConfigurationGroup* group6 = new VerticalConfigurationGroup(false); |
---|
689 | group6->setLabel(QObject::tr("Job Queue (Global)")); |
---|
690 | group6->addChild(JobsRunOnRecordHost()); |
---|
691 | group6->addChild(AutoTranscodeBeforeAutoCommflag()); |
---|
692 | group6->addChild(AutoCommflagWhileRecording()); |
---|
693 | addChild(group6); |
---|
694 | |
---|
695 | VerticalConfigurationGroup* group7 = new VerticalConfigurationGroup(false); |
---|
696 | group7->setLabel(QObject::tr("Job Queue (Job Commands)")); |
---|
697 | group7->addChild(UserJobDesc1()); |
---|
698 | group7->addChild(UserJob1()); |
---|
699 | group7->addChild(UserJobDesc2()); |
---|
700 | group7->addChild(UserJob2()); |
---|
701 | group7->addChild(UserJobDesc3()); |
---|
702 | group7->addChild(UserJob3()); |
---|
703 | group7->addChild(UserJobDesc4()); |
---|
704 | group7->addChild(UserJob4()); |
---|
705 | addChild(group7); |
---|
706 | } |
---|