MythTV  0.27pre
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Groups Pages
backendsettings.cpp
Go to the documentation of this file.
1 #include <cstdio>
2 
3 #include "backendsettings.h"
4 #include "frequencies.h"
5 #include "mythcorecontext.h"
6 #include "settings.h"
7 #include "channelsettings.h" // for ChannelTVFormat::GetFormats()
8 #include <unistd.h>
9 
10 #include <QNetworkInterface>
11 
12 
14 {
15  HostComboBox *gc = new HostComboBox("BackendServerIP");
16  gc->setLabel(QObject::tr("IPv4 address"));
17  QList<QHostAddress> list = QNetworkInterface::allAddresses();
18  QList<QHostAddress>::iterator it;
19  for (it = list.begin(); it != list.end(); ++it)
20  {
21  if ((*it).protocol() == QAbstractSocket::IPv4Protocol)
22  gc->addSelection((*it).toString(), (*it).toString());
23  }
24 
25  gc->setValue("127.0.0.1");
26  gc->setHelpText(QObject::tr("Enter the IP address of this machine. "
27  "Use an externally accessible address (ie, not "
28  "127.0.0.1) if you are going to be running a frontend "
29  "on a different machine than this one. Note, in IPv6 "
30  "setups, this is still required for certain extras "
31  "such as UPnP."));
32  return gc;
33 };
34 
36 {
37  HostComboBox *gc = new HostComboBox("BackendServerIP6");
38  gc->setLabel(QObject::tr("IPv6 address"));
39  QList<QHostAddress> list = QNetworkInterface::allAddresses();
40  QList<QHostAddress>::iterator it;
41  for (it = list.begin(); it != list.end(); ++it)
42  {
43  if ((*it).protocol() == QAbstractSocket::IPv6Protocol)
44  gc->addSelection((*it).toString(), (*it).toString());
45  }
46 
47 #if defined(QT_NO_IPV6)
48  gc->setEnabled(false);
49  gc->setValue("");
50 #else
51  if (list.isEmpty())
52  {
53  gc->setEnabled(false);
54  gc->setValue("");
55  }
56  else if (list.contains(QHostAddress("::1")))
57  gc->setValue("::1");
58 #endif
59 
60  gc->setHelpText(QObject::tr("Enter the IPv6 address of this machine. "
61  "Use an externally accessible address (ie, not "
62  "::1) if you are going to be running a frontend "
63  "on a different machine than this one."));
64  return gc;
65 }
66 
68 {
69  HostCheckBox *hc = new HostCheckBox("AllowLinkLocal");
70  hc->setLabel(QObject::tr("Listen on Link-Local addresses"));
71  hc->setValue(true);
72  hc->setHelpText(QObject::tr("Enable servers on this machine to listen on "
73  "link-local addresses. These are auto-configured "
74  "addresses and not accessible outside the local network. "
75  "This must be enabled for anything requiring Bonjour to "
76  "work."));
77  return hc;
78 };
79 
81 {
82  HostLineEdit *gc = new HostLineEdit("BackendServerPort");
83  gc->setLabel(QObject::tr("Port"));
84  gc->setValue("6543");
85  gc->setHelpText(QObject::tr("Unless you've got good reason, don't "
86  "change this."));
87  return gc;
88 };
89 
91 {
92  HostLineEdit *gc = new HostLineEdit("BackendStatusPort");
93  gc->setLabel(QObject::tr("Status port"));
94  gc->setValue("6544");
95  gc->setHelpText(QObject::tr("Port on which the server will listen for "
96  "HTTP requests, including backend status and MythXML "
97  "requests."));
98  return gc;
99 };
100 
102 {
103  GlobalLineEdit *gc = new GlobalLineEdit("MasterServerIP");
104  gc->setLabel(QObject::tr("IP address"));
105  gc->setValue("127.0.0.1");
106  gc->setHelpText(QObject::tr("The IP address of the master backend "
107  "server. All frontend and non-master backend machines "
108  "will connect to this server. If you only have one "
109  "backend, this should be the same IP address as "
110  "above."));
111  return gc;
112 };
113 
115 {
116  GlobalLineEdit *gc = new GlobalLineEdit("MasterServerPort");
117  gc->setLabel(QObject::tr("Port"));
118  gc->setValue("6543");
119  gc->setHelpText(QObject::tr("Unless you've got good reason, "
120  "don't change this."));
121  return gc;
122 };
123 
125 {
126  HostLineEdit *gc = new HostLineEdit("SecurityPin");
127  gc->setLabel(QObject::tr("Security PIN (required)"));
128  gc->setValue("");
129  gc->setHelpText(QObject::tr("PIN code required for a frontend to connect "
130  "to the backend. Blank prevents all "
131  "connections; 0000 allows any client to "
132  "connect."));
133  return gc;
134 };
135 
137 {
138  GlobalComboBox *gc = new GlobalComboBox("TVFormat");
139  gc->setLabel(QObject::tr("TV format"));
140 
141  QStringList list = ChannelTVFormat::GetFormats();
142  for (int i = 0; i < list.size(); i++)
143  gc->addSelection(list[i]);
144 
145  gc->setHelpText(QObject::tr("The TV standard to use for viewing TV."));
146  return gc;
147 };
148 
150 {
151  GlobalComboBox *gc = new GlobalComboBox("VbiFormat");
152  gc->setLabel(QObject::tr("VBI format"));
153  gc->addSelection("None");
154  gc->addSelection("PAL teletext");
155  gc->addSelection("NTSC closed caption");
156  gc->setHelpText(QObject::tr("The VBI (Vertical Blanking Interval) is "
157  "used to carry Teletext or Closed Captioning "
158  "data."));
159  return gc;
160 };
161 
163 {
164  GlobalComboBox *gc = new GlobalComboBox("FreqTable");
165  gc->setLabel(QObject::tr("Channel frequency table"));
166 
167  for (uint i = 0; chanlists[i].name; i++)
168  gc->addSelection(chanlists[i].name);
169 
170  gc->setHelpText(QObject::tr("Select the appropriate frequency table for "
171  "your system. If you have an antenna, use a \"-bcast\" "
172  "frequency."));
173  return gc;
174 };
175 
177 {
178  GlobalCheckBox *gc = new GlobalCheckBox("SaveTranscoding");
179  gc->setLabel(QObject::tr("Save original files after transcoding (globally)"));
180  gc->setValue(false);
181  gc->setHelpText(QObject::tr("If enabled and the transcoder is active, the "
182  "original files will be renamed to .old once the "
183  "transcoding is complete."));
184  return gc;
185 };
186 
188 {
189  HostCheckBox *hc = new HostCheckBox("TruncateDeletesSlowly");
190  hc->setLabel(QObject::tr("Delete files slowly"));
191  hc->setValue(false);
192  hc->setHelpText(QObject::tr("Some filesystems use a lot of resources when "
193  "deleting large files. If enabled, this option makes "
194  "MythTV delete files slowly on this backend to lessen the "
195  "impact."));
196  return hc;
197 };
198 
200 {
201  GlobalCheckBox *gc = new GlobalCheckBox("DeletesFollowLinks");
202  gc->setLabel(QObject::tr("Follow symbolic links when deleting files"));
203  gc->setValue(false);
204  gc->setHelpText(QObject::tr("If enabled, MythTV will follow symlinks "
205  "when recordings and related files are deleted, instead "
206  "of deleting the symlink and leaving the actual file."));
207  return gc;
208 };
209 
211 {
212  GlobalSpinBox *bs = new GlobalSpinBox(
213  "HDRingbufferSize", 25*188, 512*188, 25*188);
214  bs->setLabel(QObject::tr("HD ringbuffer size (kB)"));
215  bs->setHelpText(QObject::tr("The HD device ringbuffer allows the "
216  "backend to weather moments of stress. "
217  "The larger the ringbuffer (in kilobytes), the longer "
218  "the moments of stress can be. However, "
219  "setting the size too large can cause "
220  "swapping, which is detrimental."));
221  bs->setValue(50*188);
222  return bs;
223 }
224 
226 {
227  GlobalComboBox *gc = new GlobalComboBox("StorageScheduler");
228  gc->setLabel(QObject::tr("Storage Group disk scheduler"));
229  gc->addSelection(QObject::tr("Balanced free space"), "BalancedFreeSpace");
230  gc->addSelection(QObject::tr("Balanced percent free space"), "BalancedPercFreeSpace");
231  gc->addSelection(QObject::tr("Balanced disk I/O"), "BalancedDiskIO");
232  gc->addSelection(QObject::tr("Combination"), "Combination");
233  gc->setValue("BalancedFreeSpace");
234  gc->setHelpText(QObject::tr("This setting controls how the Storage Group "
235  "scheduling code will balance new recordings across "
236  "directories. 'Balanced Free Space' is the recommended "
237  "method for most users." ));
238  return gc;
239 };
240 
242 {
243  GlobalCheckBox *gc = new GlobalCheckBox("DisableAutomaticBackup");
244  gc->setLabel(QObject::tr("Disable automatic database backup"));
245  gc->setValue(false);
246  gc->setHelpText(QObject::tr("If enabled, MythTV will not backup the "
247  "database before upgrades. You should "
248  "therefore have your own database backup "
249  "strategy in place."));
250  return gc;
251 };
252 
254 {
255  HostCheckBox *hc = new HostCheckBox("DisableFirewireReset");
256  hc->setLabel(QObject::tr("Disable FireWire reset"));
257  hc->setHelpText(
258  QObject::tr(
259  "By default, MythTV resets the FireWire bus when a "
260  "FireWire recorder stops responding to commands. If "
261  "this causes problems, you can disable this behavior "
262  "here."));
263  hc->setValue(false);
264  return hc;
265 }
266 
268 {
269  HostLineEdit *he = new HostLineEdit("MiscStatusScript");
270  he->setLabel(QObject::tr("Miscellaneous status application"));
271  he->setValue("");
272  he->setHelpText(QObject::tr("External application or script that outputs "
273  "extra information for inclusion in the "
274  "backend status page. See http://www.mythtv."
275  "org/wiki/Miscellaneous_Status_Information"));
276  return he;
277 }
278 
280 {
281  GlobalSpinBox *gc = new GlobalSpinBox("EITTransportTimeout", 1, 15, 1);
282  gc->setLabel(QObject::tr("EIT transport timeout (mins)"));
283  gc->setValue(5);
284  QString helpText = QObject::tr(
285  "Maximum time to spend waiting (in minutes) for listings data "
286  "on one digital TV channel before checking for new listings data "
287  "on the next channel.");
288  gc->setHelpText(helpText);
289  return gc;
290 }
291 
293 {
294  GlobalCheckBox *gc = new GlobalCheckBox("MasterBackendOverride");
295  gc->setLabel(QObject::tr("Master backend override"));
296  gc->setValue(true);
297  gc->setHelpText(QObject::tr("If enabled, the master backend will stream and"
298  " delete files if it finds them in a storage directory. "
299  "Useful if you are using a central storage location, like "
300  "a NFS share, and your slave backend isn't running."));
301  return gc;
302 };
303 
305 {
306  GlobalSpinBox *gc = new GlobalSpinBox("EITCrawIdleStart", 30, 7200, 30);
307  gc->setLabel(QObject::tr("Backend idle before EIT crawl (secs)"));
308  gc->setValue(60);
309  QString help = QObject::tr(
310  "The minimum number of seconds after a recorder becomes idle "
311  "to wait before MythTV begins collecting EIT listings data.");
312  gc->setHelpText(help);
313  return gc;
314 }
315 
317 {
318  GlobalSpinBox *gc = new GlobalSpinBox("WOLbackendReconnectWaitTime", 0, 1200, 5);
319  gc->setLabel(QObject::tr("Delay between wake attempts (secs)"));
320  gc->setValue(0);
321  gc->setHelpText(QObject::tr("Length of time the frontend waits between "
322  "tries to wake up the master backend. This should be the "
323  "time your master backend needs to startup. Set to 0 to "
324  "disable."));
325  return gc;
326 };
327 
329 {
330  GlobalSpinBox *gc = new GlobalSpinBox("WOLbackendConnectRetry", 1, 60, 1);
331  gc->setLabel(QObject::tr("Wake attempts"));
332  gc->setHelpText(QObject::tr("Number of times the frontend will try to wake "
333  "up the master backend."));
334  gc->setValue(5);
335  return gc;
336 };
337 
339 {
340  GlobalLineEdit *gc = new GlobalLineEdit("WOLbackendCommand");
341  gc->setLabel(QObject::tr("Wake command"));
342  gc->setValue("");
343  gc->setHelpText(QObject::tr("The command used to wake up your master "
344  "backend server (e.g. sudo /etc/init.d/mythtv-backend restart)."));
345  return gc;
346 };
347 
349 {
350  HostLineEdit *gc = new HostLineEdit("SleepCommand");
351  gc->setLabel(QObject::tr("Sleep command"));
352  gc->setValue("");
353  gc->setHelpText(QObject::tr("The command used to put this slave to sleep. "
354  "If set, the master backend will use this command to put "
355  "this slave to sleep when it is not needed for recording."));
356  return gc;
357 };
358 
360 {
361  HostLineEdit *gc = new HostLineEdit("WakeUpCommand");
362  gc->setLabel(QObject::tr("Wake command"));
363  gc->setValue("");
364  gc->setHelpText(QObject::tr("The command used to wake up this slave "
365  "from sleep. This setting is not used on the master "
366  "backend."));
367  return gc;
368 };
369 
371 {
372  GlobalLineEdit *gc = new GlobalLineEdit("BackendStopCommand");
373  gc->setLabel(QObject::tr("Backend stop command"));
374  gc->setValue("killall mythbackend");
375  gc->setHelpText(QObject::tr("The command used to stop the backend"
376  " when running on the master backend server "
377  "(e.g. sudo /etc/init.d/mythtv-backend stop)"));
378  return gc;
379 };
380 
382 {
383  GlobalLineEdit *gc = new GlobalLineEdit("BackendStartCommand");
384  gc->setLabel(QObject::tr("Backend start command"));
385  gc->setValue("mythbackend");
386  gc->setHelpText(QObject::tr("The command used to start the backend"
387  " when running on the master backend server "
388  "(e.g. sudo /etc/init.d/mythtv-backend start)."));
389  return gc;
390 };
391 
393 {
394  GlobalSpinBox *gc = new GlobalSpinBox("idleTimeoutSecs", 0, 1200, 5);
395  gc->setLabel(QObject::tr("Idle shutdown timeout (secs)"));
396  gc->setValue(0);
397  gc->setHelpText(QObject::tr("The number of seconds the master backend "
398  "idles before it shuts down all other backends. Set to 0 to "
399  "disable automatic shutdown."));
400  return gc;
401 };
402 
404 {
405  GlobalSpinBox *gc = new GlobalSpinBox("idleWaitForRecordingTime", 0, 300, 1);
406  gc->setLabel(QObject::tr("Maximum wait for recording (mins)"));
407  gc->setValue(15);
408  gc->setHelpText(QObject::tr("The number of minutes the master backend "
409  "waits for a recording. If the backend is idle but a "
410  "recording starts within this time period, it won't "
411  "shut down."));
412  return gc;
413 };
414 
416 {
417  GlobalSpinBox *gc = new GlobalSpinBox("StartupSecsBeforeRecording", 0, 1200, 5);
418  gc->setLabel(QObject::tr("Startup before recording (secs)"));
419  gc->setValue(120);
420  gc->setHelpText(QObject::tr("The number of seconds the master backend "
421  "will be woken up before a recording starts."));
422  return gc;
423 };
424 
426 {
427  GlobalLineEdit *gc = new GlobalLineEdit("WakeupTimeFormat");
428  gc->setLabel(QObject::tr("Wakeup time format"));
429  gc->setValue("hh:mm yyyy-MM-dd");
430  gc->setHelpText(QObject::tr("The format of the time string passed to the "
431  "'Command to set wakeup time' as $time. See "
432  "QT::QDateTime.toString() for details. Set to 'time_t' for "
433  "seconds since epoch."));
434  return gc;
435 };
436 
438 {
439  GlobalLineEdit *gc = new GlobalLineEdit("SetWakeuptimeCommand");
440  gc->setLabel(QObject::tr("Command to set wakeup time"));
441  gc->setValue("");
442  gc->setHelpText(QObject::tr("The command used to set the wakeup time "
443  "(passed as $time) for the Master Backend"));
444  return gc;
445 };
446 
448 {
449  GlobalLineEdit *gc = new GlobalLineEdit("ServerHaltCommand");
450  gc->setLabel(QObject::tr("Server halt command"));
451  gc->setValue("sudo /sbin/halt -p");
452  gc->setHelpText(QObject::tr("The command used to halt the backends."));
453  return gc;
454 };
455 
457 {
458  GlobalLineEdit *gc = new GlobalLineEdit("preSDWUCheckCommand");
459  gc->setLabel(QObject::tr("Pre-shutdown-check command"));
460  gc->setValue("");
461  gc->setHelpText(QObject::tr("A command executed before the backend would "
462  "shutdown. The return value determines if "
463  "the backend can shutdown. 0 - yes, "
464  "1 - restart idling, "
465  "2 - reset the backend to wait for a frontend."));
466  return gc;
467 };
468 
470 {
471  GlobalCheckBox *gc = new GlobalCheckBox("blockSDWUwithoutClient");
472  gc->setLabel(QObject::tr("Block shutdown before client connected"));
473  gc->setValue(true);
474  gc->setHelpText(QObject::tr("If enabled, the automatic shutdown routine will "
475  "be disabled until a client connects."));
476  return gc;
477 };
478 
480 {
481  GlobalLineEdit *gc = new GlobalLineEdit("startupCommand");
482  gc->setLabel(QObject::tr("Startup command"));
483  gc->setValue("");
484  gc->setHelpText(QObject::tr("This command is executed right after starting "
485  "the BE. As a parameter '$status' is replaced by either "
486  "'auto' if the machine was started automatically or "
487  "'user' if a user switched it on."));
488  return gc;
489 };
490 
492 {
493  HostSpinBox *gc = new HostSpinBox("JobQueueMaxSimultaneousJobs", 1, 10, 1);
494  gc->setLabel(QObject::tr("Maximum simultaneous jobs on this backend"));
495  gc->setHelpText(QObject::tr("The Job Queue will be limited to running "
496  "this many simultaneous jobs on this backend."));
497  gc->setValue(1);
498  return gc;
499 };
500 
502 {
503  HostSpinBox *gc = new HostSpinBox("JobQueueCheckFrequency", 5, 300, 5);
504  gc->setLabel(QObject::tr("Job Queue check frequency (secs)"));
505  gc->setHelpText(QObject::tr("When looking for new jobs to process, the "
506  "Job Queue will wait this many seconds between checks."));
507  gc->setValue(60);
508  return gc;
509 };
510 
512 {
513  HostComboBox *gc = new HostComboBox("JobQueueCPU");
514  gc->setLabel(QObject::tr("CPU usage"));
515  gc->addSelection(QObject::tr("Low"), "0");
516  gc->addSelection(QObject::tr("Medium"), "1");
517  gc->addSelection(QObject::tr("High"), "2");
518  gc->setHelpText(QObject::tr("This setting controls approximately how "
519  "much CPU jobs in the queue may consume. "
520  "On 'High', all available CPU time may be used, "
521  "which could cause problems on slower systems." ));
522  return gc;
523 };
524 
526 {
527  HostTimeBox *gc = new HostTimeBox("JobQueueWindowStart", "00:00");
528  gc->setLabel(QObject::tr("Job Queue start time"));
529  gc->setHelpText(QObject::tr("This setting controls the start of the "
530  "Job Queue time window, which determines when new jobs "
531  "will be started."));
532  return gc;
533 };
534 
536 {
537  HostTimeBox *gc = new HostTimeBox("JobQueueWindowEnd", "23:59");
538  gc->setLabel(QObject::tr("Job Queue end time"));
539  gc->setHelpText(QObject::tr("This setting controls the end of the "
540  "Job Queue time window, which determines when new jobs "
541  "will be started."));
542  return gc;
543 };
544 
546 {
547  GlobalCheckBox *gc = new GlobalCheckBox("JobsRunOnRecordHost");
548  gc->setLabel(QObject::tr("Run jobs only on original recording backend"));
549  gc->setValue(false);
550  gc->setHelpText(QObject::tr("If enabled, jobs in the queue will be required "
551  "to run on the backend that made the "
552  "original recording."));
553  return gc;
554 };
555 
557 {
558  GlobalCheckBox *gc = new GlobalCheckBox("AutoTranscodeBeforeAutoCommflag");
559  gc->setLabel(QObject::tr("Run transcode jobs before auto commercial "
560  "detection"));
561  gc->setValue(false);
562  gc->setHelpText(QObject::tr("If enabled, and if both auto-transcode and "
563  "commercial detection are turned ON for a "
564  "recording, transcoding will run first; "
565  "otherwise, commercial detection runs first."));
566  return gc;
567 };
568 
570 {
571  GlobalCheckBox *gc = new GlobalCheckBox("AutoCommflagWhileRecording");
572  gc->setLabel(QObject::tr("Start auto-commercial-detection jobs when the "
573  "recording starts"));
574  gc->setValue(false);
575  gc->setHelpText(QObject::tr("If enabled, and Auto Commercial Detection is "
576  "ON for a recording, the flagging job will be "
577  "started as soon as the recording starts. NOT "
578  "recommended on underpowered systems."));
579  return gc;
580 };
581 
582 static GlobalLineEdit *UserJob(uint job_num)
583 {
584  GlobalLineEdit *gc = new GlobalLineEdit(QString("UserJob%1").arg(job_num));
585  gc->setLabel(QObject::tr("User Job #%1 command").arg(job_num));
586  gc->setValue("");
587  gc->setHelpText(QObject::tr("The command to run whenever this User Job "
588  "number is scheduled."));
589  return gc;
590 };
591 
593 {
594  GlobalLineEdit *gc = new GlobalLineEdit(QString("UserJobDesc%1")
595  .arg(job_num));
596  gc->setLabel(QObject::tr("User Job #%1 description").arg(job_num));
597  gc->setValue(QObject::tr("User Job #%1").arg(job_num));
598  gc->setHelpText(QObject::tr("The description for this User Job."));
599  return gc;
600 };
601 
603 {
604  HostCheckBox *gc = new HostCheckBox("JobAllowMetadata");
605  gc->setLabel(QObject::tr("Allow metadata lookup jobs"));
606  gc->setValue(true);
607  gc->setHelpText(QObject::tr("If enabled, allow jobs of this type to "
608  "run on this backend."));
609  return gc;
610 };
611 
613 {
614  HostCheckBox *gc = new HostCheckBox("JobAllowCommFlag");
615  gc->setLabel(QObject::tr("Allow commercial-detection jobs"));
616  gc->setValue(true);
617  gc->setHelpText(QObject::tr("If enabled, allow jobs of this type to "
618  "run on this backend."));
619  return gc;
620 };
621 
623 {
624  HostCheckBox *gc = new HostCheckBox("JobAllowTranscode");
625  gc->setLabel(QObject::tr("Allow transcoding jobs"));
626  gc->setValue(true);
627  gc->setHelpText(QObject::tr("If enabled, allow jobs of this type to "
628  "run on this backend."));
629  return gc;
630 };
631 
633 {
634  GlobalLineEdit *gc = new GlobalLineEdit("JobQueueTranscodeCommand");
635  gc->setLabel(QObject::tr("Transcoder command"));
636  gc->setValue("mythtranscode");
637  gc->setHelpText(QObject::tr("The program used to transcode recordings. "
638  "The default is 'mythtranscode' if this setting is empty."));
639  return gc;
640 };
641 
643 {
644  GlobalLineEdit *gc = new GlobalLineEdit("JobQueueCommFlagCommand");
645  gc->setLabel(QObject::tr("Commercial-detection command"));
646  gc->setValue("mythcommflag");
647  gc->setHelpText(QObject::tr("The program used to detect commercials in a "
648  "recording. The default is 'mythcommflag' "
649  "if this setting is empty."));
650  return gc;
651 };
652 
654 {
655  QString dbStr = QString("JobAllowUserJob%1").arg(job_num);
656  QString desc = gCoreContext->GetSetting(QString("UserJobDesc%1").arg(job_num));
657  QString label = QObject::tr("Allow %1 jobs").arg(desc);
658 
659  HostCheckBox *bc = new HostCheckBox(dbStr);
660  bc->setLabel(label);
661  bc->setValue(false);
662  // FIXME:
663  // It would be nice to disable inactive jobs,
664  // but enabling them currently requires a restart of mythtv-setup
665  // after entering the job command string. Will improve this logic later:
666  // if (QString(gCoreContext->GetSetting(QString("UserJob%1").arg(job_num)))
667  // .length() == 0)
668  // bc->setEnabled(false);
669  bc->setHelpText(QObject::tr("If enabled, allow jobs of this type to "
670  "run on this backend."));
671  return bc;
672 }
673 
674 #if 0
676 {
677  GlobalCheckBox *gc = new GlobalCheckBox("UPnP/RecordingsUnderVideos");
678  gc->setLabel(QObject::tr("Include recordings in video list"));
679  gc->setValue(false);
680  gc->setHelpText(QObject::tr("If enabled, the master backend will include"
681  " the list of recorded shows in the list of videos. "
682  " This is mainly to accommodate UPnP players which do not"
683  " allow more than 1 video section." ));
684  return gc;
685 };
686 #endif
687 
689 {
690  GlobalComboBox *gc = new GlobalComboBox("UPnP/WMPSource");
691  gc->setLabel(QObject::tr("Video content to show a WMP client"));
692  gc->addSelection(QObject::tr("Recordings"),"0");
693  gc->addSelection(QObject::tr("Videos"),"1");
694  gc->setValue("0");
695  gc->setHelpText(QObject::tr("Which tree to show a Windows Media Player "
696  "client when it requests a list of videos."));
697  return gc;
698 };
699 
701 {
702  GlobalCheckBox *bc = new GlobalCheckBox("MythFillEnabled");
703  bc->setLabel(QObject::tr("Automatically update program listings"));
704  bc->setValue(true);
705  bc->setHelpText(QObject::tr("If enabled, the guide data program "
706  "will be run automatically."));
707  return bc;
708 }
709 
711 {
712  GlobalSpinBox *bs = new GlobalSpinBox("MythFillMinHour", 0, 23, 1);
713  bs->setLabel(QObject::tr("Guide data program execution start"));
714  bs->setValue(0);
715  bs->setHelpText(QObject::tr("This setting and the following one define a "
716  "time period when the guide data program is allowed "
717  "to run. For example, setting start to 11 and "
718  "end to 13 would mean that the program would only "
719  "run between 11:00 AM and 1:59 PM."));
720  return bs;
721 }
722 
724 {
725  GlobalSpinBox *bs = new GlobalSpinBox("MythFillMaxHour", 0, 23, 1);
726  bs->setLabel(QObject::tr("Guide data program execution end"));
727  bs->setValue(23);
728  bs->setHelpText(QObject::tr("This setting and the preceding one define a "
729  "time period when the guide data program is allowed "
730  "to run. For example, setting start to 11 and "
731  "end to 13 would mean that the program would only "
732  "run between 11:00 AM and 1:59 PM."));
733  return bs;
734 }
735 
737 {
738  GlobalCheckBox *bc = new GlobalCheckBox("MythFillGrabberSuggestsTime");
739  bc->setLabel(QObject::tr("Run guide data program at time suggested by the "
740  "grabber."));
741  bc->setValue(true);
742  bc->setHelpText(QObject::tr("If enabled, allow a DataDirect guide data "
743  "provider to specify the next download time in order "
744  "to distribute load on their servers. Guide data program "
745  "execution start/end times are also ignored."));
746  return bc;
747 }
748 
750 {
751  GlobalLineEdit *be = new GlobalLineEdit("MythFillDatabasePath");
752  be->setLabel(QObject::tr("Guide data program"));
753  be->setValue("mythfilldatabase");
754  be->setHelpText(QObject::tr(
755  "Use 'mythfilldatabase' or the name of a custom "
756  "script that will populate the program guide info "
757  "for all your video sources."));
758  return be;
759 }
760 
762 {
763  GlobalLineEdit *be = new GlobalLineEdit("MythFillDatabaseArgs");
764  be->setLabel(QObject::tr("Guide data arguments"));
765  be->setValue("");
766  be->setHelpText(QObject::tr("Any arguments you want passed to the "
767  "guide data program."));
768  return be;
769 }
770 
772 {
773  public:
776  {
777  setLabel(QObject::tr("Program Schedule Downloading Options"));
778  setUseLabel(false);
779 
780  Setting* fillEnabled = MythFillEnabled();
781  addChild(fillEnabled);
782  setTrigger(fillEnabled);
783 
784  ConfigurationGroup* settings = new VerticalConfigurationGroup(false);
785  settings->addChild(MythFillDatabasePath());
786  settings->addChild(MythFillDatabaseArgs());
787  settings->addChild(MythFillMinHour());
788  settings->addChild(MythFillMaxHour());
790  addTarget("1", settings);
791 
792  // show nothing if fillEnabled is off
793  addTarget("0", new VerticalConfigurationGroup(true));
794  };
795 };
796 
799  server->setLabel(QObject::tr("Host Address Backend Setup"));
801  localServer->setLabel(QObject::tr("Local Backend") + " (" +
802  gCoreContext->GetHostName() + ")");
804  new HorizontalConfigurationGroup(false, false, true, true);
805  localIP->addChild(LocalServerIP());
806  localServer->addChild(localIP);
807  HorizontalConfigurationGroup* localIP6 =
808  new HorizontalConfigurationGroup(false, false, true, true);
809  localIP6->addChild(LocalServerIP6());
810  localServer->addChild(localIP6);
811  HorizontalConfigurationGroup *localUseLL =
812  new HorizontalConfigurationGroup(false, false, true, true);
813  localUseLL->addChild(UseLinkLocal());
814  localServer->addChild(localUseLL);
815  HorizontalConfigurationGroup* localPorts =
816  new HorizontalConfigurationGroup(false, false, true, true);
817  localPorts->addChild(LocalServerPort());
818  localPorts->addChild(LocalStatusPort());
819  localServer->addChild(localPorts);
820  HorizontalConfigurationGroup* localPin =
821  new HorizontalConfigurationGroup(false, false, true, true);
822  localPin->addChild(LocalSecurityPin());
823  localServer->addChild(localPin);
825  masterServer->setLabel(QObject::tr("Master Backend"));
827  new HorizontalConfigurationGroup(false, false, true, true);
828  master->addChild(MasterServerIP());
829  master->addChild(MasterServerPort());
830  masterServer->addChild(master);
831  server->addChild(localServer);
832  server->addChild(masterServer);
833  addChild(server);
834 
836  locale->setLabel(QObject::tr("Locale Settings"));
837  locale->addChild(TVFormat());
838  locale->addChild(VbiFormat());
839  locale->addChild(FreqTable());
840  addChild(locale);
841 
843  group2->setLabel(QObject::tr("Miscellaneous Settings"));
844 
846  fm->setLabel(QObject::tr("File Management Settings"));
849  new HorizontalConfigurationGroup(false, false, true, true);
850  fmh1->addChild(DeletesFollowLinks());
851  fmh1->addChild(TruncateDeletes());
852  fm->addChild(fmh1);
853  fm->addChild(HDRingbufferSize());
854  fm->addChild(StorageScheduler());
855  group2->addChild(fm);
857  upnp->setLabel(QObject::tr("UPnP Server Settings"));
858  //upnp->addChild(UPNPShowRecordingUnderVideos());
859  upnp->addChild(UPNPWmpSource());
860  group2->addChild(upnp);
861  group2->addChild(MiscStatusScript());
862  group2->addChild(DisableAutomaticBackup());
863  group2->addChild(DisableFirewireReset());
864  addChild(group2);
865 
867  group2a1->setLabel(QObject::tr("EIT Scanner Options"));
868  group2a1->addChild(EITTransportTimeout());
869  group2a1->addChild(EITCrawIdleStart());
870  addChild(group2a1);
871 
873  group3->setLabel(QObject::tr("Shutdown/Wakeup Options"));
874  group3->addChild(startupCommand());
875  group3->addChild(blockSDWUwithoutClient());
876  group3->addChild(idleTimeoutSecs());
879  group3->addChild(WakeupTimeFormat());
880  group3->addChild(SetWakeuptimeCommand());
881  group3->addChild(ServerHaltCommand());
882  group3->addChild(preSDWUCheckCommand());
883  addChild(group3);
884 
886  group4->setLabel(QObject::tr("Backend Wakeup settings"));
887 
889  backend->setLabel(QObject::tr("Master Backend"));
891  backend->addChild(WOLbackendConnectRetry());
892  backend->addChild(WOLbackendCommand());
893  group4->addChild(backend);
894 
896  slaveBackend->setLabel(QObject::tr("Slave Backends"));
897  slaveBackend->addChild(SleepCommand());
898  slaveBackend->addChild(WakeUpCommand());
899  group4->addChild(slaveBackend);
900  addChild(group4);
901 
903  backendControl->setLabel(QObject::tr("Backend Control"));
904  backendControl->addChild(BackendStopCommand());
905  backendControl->addChild(BackendStartCommand());
906  addChild(backendControl);
907 
909  group5->setLabel(QObject::tr("Job Queue (Backend-Specific)"));
911  group5->addChild(JobQueueCheckFrequency());
912 
914  new HorizontalConfigurationGroup(false, false);
915  VerticalConfigurationGroup* group5a1 =
916  new VerticalConfigurationGroup(false, false);
917  group5a1->addChild(JobQueueWindowStart());
918  group5a1->addChild(JobQueueWindowEnd());
919  group5a1->addChild(JobQueueCPU());
920  group5a1->addChild(JobAllowMetadata());
921  group5a1->addChild(JobAllowCommFlag());
922  group5a1->addChild(JobAllowTranscode());
923  group5a->addChild(group5a1);
924 
925  VerticalConfigurationGroup* group5a2 =
926  new VerticalConfigurationGroup(false, false);
927  group5a2->addChild(JobAllowUserJob(1));
928  group5a2->addChild(JobAllowUserJob(2));
929  group5a2->addChild(JobAllowUserJob(3));
930  group5a2->addChild(JobAllowUserJob(4));
931  group5a->addChild(group5a2);
932  group5->addChild(group5a);
933  addChild(group5);
934 
936  group6->setLabel(QObject::tr("Job Queue (Global)"));
937  group6->addChild(JobsRunOnRecordHost());
942  group6->addChild(SaveTranscoding());
943  addChild(group6);
944 
946  group7->setLabel(QObject::tr("Job Queue (Job Commands)"));
947  group7->addChild(UserJobDesc(1));
948  group7->addChild(UserJob(1));
949  group7->addChild(UserJobDesc(2));
950  group7->addChild(UserJob(2));
951  group7->addChild(UserJobDesc(3));
952  group7->addChild(UserJob(3));
953  group7->addChild(UserJobDesc(4));
954  group7->addChild(UserJob(4));
955  addChild(group7);
956 
957  MythFillSettings *mythfill = new MythFillSettings();
958  addChild(mythfill);
959 
960 }