9 #include <QNetworkInterface>
15 gc->setLabel(QObject::tr(
"This server is the Master Backend"));
17 gc->setHelpText(QObject::tr(
18 "Enable this if this is the only backend or is the "
19 "master backend server. If enabled, all frontend and "
20 "non-master backend machines "
21 "will connect to this server. To change to a new master "
22 "backend, run setup on that server and select it as "
30 gc->setLabel(QObject::tr(
"Master Backend Name"));
33 gc->setReadOnly(
true);
34 gc->setHelpText(QObject::tr(
35 "Host name of Master Backend. This is set by selecting "
36 "\"This server is the Master Backend\" on that server."));
43 gc->setLabel(QObject::tr(
"Allow Connections from all Subnets"));
45 gc->setHelpText(QObject::tr(
46 "Allow this backend to receive connections from any IP "
47 "address on the internet. NOT recommended for most users. "
48 "Use this only if you have secure IPV4 and IPV6 " "firewalls."));
55 gc->setLabel(QObject::tr(
"IPv4 address"));
56 QList<QHostAddress> list = QNetworkInterface::allAddresses();
57 QList<QHostAddress>::iterator it;
58 for (it = list.begin(); it != list.end(); ++it)
60 if ((*it).protocol() == QAbstractSocket::IPv4Protocol)
61 gc->addSelection((*it).toString(), (*it).toString());
64 gc->setValue(
"127.0.0.1");
65 gc->setHelpText(QObject::tr(
"Enter the IP address of this machine. "
66 "Use an externally accessible address (ie, not "
67 "127.0.0.1) if you are going to be running a frontend "
68 "on a different machine than this one. Note, in IPv6 "
69 "setups, this is still required for certain extras "
77 gc->setLabel(QObject::tr(
"Listen on IPv6 address"));
78 QList<QHostAddress> list = QNetworkInterface::allAddresses();
79 QList<QHostAddress>::iterator it;
80 for (it = list.begin(); it != list.end(); ++it)
82 if ((*it).protocol() == QAbstractSocket::IPv6Protocol)
86 it->setScopeId(QString());
87 gc->addSelection((*it).toString(), (*it).toString());
93 gc->setEnabled(
false);
98 if (list.contains(QHostAddress(
"::1")))
102 gc->setHelpText(QObject::tr(
"Enter the IPv6 address of this machine. "
103 "Use an externally accessible address (ie, not "
104 "::1) if you are going to be running a frontend "
105 "on a different machine than this one."));
112 hc->setLabel(QObject::tr(
"Listen on Link-Local addresses"));
114 hc->setHelpText(QObject::tr(
"Enable servers on this machine to listen on "
115 "link-local addresses. These are auto-configured "
116 "addresses and not accessible outside the local network. "
117 "This must be enabled for anything requiring Bonjour to "
130 setLabel(BackendSettings::tr(
"Listen on All IP Addresses"));
132 setHelpText(BackendSettings::tr(
"Allow this backend to receive "
133 "connections on any IP Address assigned to it. "
134 "Recommended for most users for ease and "
151 gc->setLabel(QObject::tr(
"Port"));
152 gc->setValue(
"6543");
153 gc->setHelpText(QObject::tr(
"Unless you've got good reason, don't "
161 gc->setLabel(QObject::tr(
"Status port"));
162 gc->setValue(
"6544");
163 gc->setHelpText(QObject::tr(
"Port on which the server will listen for "
164 "HTTP requests, including backend status and MythXML "
172 gc->setLabel(QObject::tr(
"Primary IP address / DNS name"));
173 gc->setValue(
"127.0.0.1");
174 gc->setHelpText(QObject::tr(
"The Primary IP address of this backend "
175 "server. You can select an IP "
176 "address from the list or type a DNS name "
177 "or host name. Other systems will contact this "
178 "server using this address. "
179 "If you use a host name make sure it is assigned "
180 "an ip address other than 127.0.0.1 in the hosts "
189 gc->setLabel(QObject::tr(
"IP address"));
190 gc->setValue(
"127.0.0.1");
198 gc->setLabel(QObject::tr(
"Port"));
199 gc->setValue(
"6543");
206 gc->setLabel(QObject::tr(
"Security PIN (required)"));
208 gc->setHelpText(QObject::tr(
"PIN code required for a frontend to connect "
209 "to the backend. Blank prevents all "
210 "connections; 0000 allows any client to "
218 gc->setLabel(QObject::tr(
"TV format"));
221 for (
int i = 0; i < list.size(); i++)
222 gc->addSelection(list[i]);
224 gc->setHelpText(QObject::tr(
"The TV standard to use for viewing TV."));
231 gc->setLabel(QObject::tr(
"VBI format"));
232 gc->addSelection(
"None");
233 gc->addSelection(
"PAL teletext");
234 gc->addSelection(
"NTSC closed caption");
235 gc->setHelpText(QObject::tr(
"The VBI (Vertical Blanking Interval) is "
236 "used to carry Teletext or Closed Captioning "
244 gc->setLabel(QObject::tr(
"Channel frequency table"));
247 gc->addSelection(list.name);
249 gc->setHelpText(QObject::tr(
"Select the appropriate frequency table for "
250 "your system. If you have an antenna, use a \"-bcast\" "
258 gc->setLabel(QObject::tr(
"Save original files after transcoding (globally)"));
260 gc->setHelpText(QObject::tr(
"If enabled and the transcoder is active, the "
261 "original files will be renamed to .old once the "
262 "transcoding is complete."));
269 hc->setLabel(QObject::tr(
"Delete files slowly"));
271 hc->setHelpText(QObject::tr(
"Some filesystems use a lot of resources when "
272 "deleting large files. If enabled, this option makes "
273 "MythTV delete files slowly on this backend to lessen the "
281 gc->setLabel(QObject::tr(
"Follow symbolic links when deleting files"));
283 gc->setHelpText(QObject::tr(
"If enabled, MythTV will follow symlinks "
284 "when recordings and related files are deleted, instead "
285 "of deleting the symlink and leaving the actual file."));
292 "HDRingbufferSize", 25*188, 512*188, 25*188);
293 bs->setLabel(QObject::tr(
"HD ringbuffer size (kB)"));
294 bs->setHelpText(QObject::tr(
"The HD device ringbuffer allows the "
295 "backend to weather moments of stress. "
296 "The larger the ringbuffer (in kilobytes), the longer "
297 "the moments of stress can be. However, "
298 "setting the size too large can cause "
299 "swapping, which is detrimental."));
300 bs->setValue(50*188);
307 gc->setLabel(QObject::tr(
"Storage Group disk scheduler"));
308 gc->addSelection(QObject::tr(
"Balanced free space"),
"BalancedFreeSpace");
309 gc->addSelection(QObject::tr(
"Balanced percent free space"),
"BalancedPercFreeSpace");
310 gc->addSelection(QObject::tr(
"Balanced disk I/O"),
"BalancedDiskIO");
311 gc->addSelection(QObject::tr(
"Combination"),
"Combination");
312 gc->setValue(
"BalancedFreeSpace");
313 gc->setHelpText(QObject::tr(
"This setting controls how the Storage Group "
314 "scheduling code will balance new recordings across "
315 "directories. 'Balanced Free Space' is the recommended "
316 "method for most users." ));
323 gc->setLabel(QObject::tr(
"Disable automatic database backup"));
325 gc->setHelpText(QObject::tr(
"If enabled, MythTV will not backup the "
326 "database before upgrades. You should "
327 "therefore have your own database backup "
328 "strategy in place."));
335 hc->setLabel(QObject::tr(
"Disable FireWire reset"));
338 "By default, MythTV resets the FireWire bus when a "
339 "FireWire recorder stops responding to commands. If "
340 "this causes problems, you can disable this behavior "
349 he->setLabel(QObject::tr(
"Miscellaneous status application"));
351 he->setHelpText(QObject::tr(
"External application or script that outputs "
352 "extra information for inclusion in the "
353 "backend status page. See http://www.mythtv."
354 "org/wiki/Miscellaneous_Status_Information"));
361 gc->setLabel(QObject::tr(
"EIT transport timeout (mins)"));
363 QString helpText = QObject::tr(
364 "Maximum time to spend waiting (in minutes) for listings data "
365 "on one digital TV channel before checking for new listings data "
366 "on the next channel.");
367 gc->setHelpText(helpText);
374 gc->setLabel(QObject::tr(
"Master backend override"));
376 gc->setHelpText(QObject::tr(
"If enabled, the master backend will stream and"
377 " delete files if it finds them in a storage directory. "
378 "Useful if you are using a central storage location, like "
379 "a NFS share, and your slave backend isn't running."));
386 gc->setLabel(QObject::tr(
"Backend idle before EIT crawl (secs)"));
388 QString
help = QObject::tr(
389 "The minimum number of seconds after a recorder becomes idle "
390 "to wait before MythTV begins collecting EIT listings data.");
391 gc->setHelpText(
help);
398 gc->setLabel(QObject::tr(
"Delay between wake attempts (secs)"));
400 gc->setHelpText(QObject::tr(
"Length of time the frontend waits between "
401 "tries to wake up the master backend. This should be the "
402 "time your master backend needs to startup. Set to 0 to "
410 gc->setLabel(QObject::tr(
"Wake attempts"));
411 gc->setHelpText(QObject::tr(
"Number of times the frontend will try to wake "
412 "up the master backend."));
420 gc->setLabel(QObject::tr(
"Wake command"));
422 gc->setHelpText(QObject::tr(
"The command used to wake up your master "
423 "backend server (e.g. wakeonlan 00:00:00:00:00:00)."));
430 gc->setLabel(QObject::tr(
"Sleep command"));
432 gc->setHelpText(QObject::tr(
"The command used to put this slave to sleep. "
433 "If set, the master backend will use this command to put "
434 "this slave to sleep when it is not needed for recording."));
441 gc->setLabel(QObject::tr(
"Wake command"));
443 gc->setHelpText(QObject::tr(
"The command used to wake up this slave "
444 "from sleep. This setting is not used on the master "
452 gc->setLabel(QObject::tr(
"Backend stop command"));
453 gc->setValue(
"killall mythbackend");
454 gc->setHelpText(QObject::tr(
"The command used to stop the backend"
455 " when running on the master backend server "
456 "(e.g. sudo /etc/init.d/mythtv-backend stop)"));
463 gc->setLabel(QObject::tr(
"Backend start command"));
464 gc->setValue(
"mythbackend");
465 gc->setHelpText(QObject::tr(
"The command used to start the backend"
466 " when running on the master backend server "
467 "(e.g. sudo /etc/init.d/mythtv-backend start)."));
474 gc->setLabel(QObject::tr(
"Idle shutdown timeout (secs)"));
476 gc->setHelpText(QObject::tr(
"The number of seconds the master backend "
477 "idles before it shuts down all other backends. Set to 0 to "
478 "disable automatic shutdown."));
485 gc->setLabel(QObject::tr(
"Maximum wait for recording (mins)"));
487 gc->setHelpText(QObject::tr(
"The number of minutes the master backend "
488 "waits for a recording. If the backend is idle but a "
489 "recording starts within this time period, it won't "
497 gc->setLabel(QObject::tr(
"Startup before recording (secs)"));
499 gc->setHelpText(QObject::tr(
"The number of seconds the master backend "
500 "will be woken up before a recording starts."));
507 gc->setLabel(QObject::tr(
"Wakeup time format"));
508 gc->setValue(
"hh:mm yyyy-MM-dd");
509 gc->setHelpText(QObject::tr(
"The format of the time string passed to the "
510 "'Command to set wakeup time' as $time. See "
511 "QT::QDateTime.toString() for details. Set to 'time_t' for "
512 "seconds since epoch."));
519 gc->setLabel(QObject::tr(
"Command to set wakeup time"));
521 gc->setHelpText(QObject::tr(
"The command used to set the wakeup time "
522 "(passed as $time) for the Master Backend"));
529 gc->setLabel(QObject::tr(
"Server halt command"));
530 gc->setValue(
"sudo /sbin/halt -p");
531 gc->setHelpText(QObject::tr(
"The command used to halt the backends."));
538 gc->setLabel(QObject::tr(
"Pre-shutdown-check command"));
540 gc->setHelpText(QObject::tr(
"A command executed before the backend would "
541 "shutdown. The return value determines if "
542 "the backend can shutdown. 0 - yes, "
543 "1 - restart idling, "
544 "2 - reset the backend to wait for a frontend."));
551 gc->setLabel(QObject::tr(
"Block shutdown before client connected"));
553 gc->setHelpText(QObject::tr(
"If enabled, the automatic shutdown routine will "
554 "be disabled until a client connects."));
561 gc->setLabel(QObject::tr(
"Startup command"));
563 gc->setHelpText(QObject::tr(
"This command is executed right after starting "
564 "the BE. As a parameter '$status' is replaced by either "
565 "'auto' if the machine was started automatically or "
566 "'user' if a user switched it on."));
573 gc->setLabel(QObject::tr(
"Maximum simultaneous jobs on this backend"));
574 gc->setHelpText(QObject::tr(
"The Job Queue will be limited to running "
575 "this many simultaneous jobs on this backend."));
583 gc->setLabel(QObject::tr(
"Job Queue check frequency (secs)"));
584 gc->setHelpText(QObject::tr(
"When looking for new jobs to process, the "
585 "Job Queue will wait this many seconds between checks."));
593 gc->setLabel(QObject::tr(
"CPU usage"));
594 gc->addSelection(QObject::tr(
"Low"),
"0");
595 gc->addSelection(QObject::tr(
"Medium"),
"1");
596 gc->addSelection(QObject::tr(
"High"),
"2");
597 gc->setHelpText(QObject::tr(
"This setting controls approximately how "
598 "much CPU jobs in the queue may consume. "
599 "On 'High', all available CPU time may be used, "
600 "which could cause problems on slower systems." ));
607 gc->setLabel(QObject::tr(
"Job Queue start time"));
608 gc->setHelpText(QObject::tr(
"This setting controls the start of the "
609 "Job Queue time window, which determines when new jobs "
610 "will be started."));
617 gc->setLabel(QObject::tr(
"Job Queue end time"));
618 gc->setHelpText(QObject::tr(
"This setting controls the end of the "
619 "Job Queue time window, which determines when new jobs "
620 "will be started."));
627 gc->setLabel(QObject::tr(
"Run jobs only on original recording backend"));
629 gc->setHelpText(QObject::tr(
"If enabled, jobs in the queue will be required "
630 "to run on the backend that made the "
631 "original recording."));
638 gc->setLabel(QObject::tr(
"Run transcode jobs before auto commercial "
641 gc->setHelpText(QObject::tr(
"If enabled, and if both auto-transcode and "
642 "commercial detection are turned ON for a "
643 "recording, transcoding will run first; "
644 "otherwise, commercial detection runs first."));
651 gc->setLabel(QObject::tr(
"Start auto-commercial-detection jobs when the "
652 "recording starts"));
654 gc->setHelpText(QObject::tr(
"If enabled, and Auto Commercial Detection is "
655 "ON for a recording, the flagging job will be "
656 "started as soon as the recording starts. NOT "
657 "recommended on underpowered systems."));
664 gc->setLabel(QObject::tr(
"User Job #%1 command").arg(job_num));
666 gc->setHelpText(QObject::tr(
"The command to run whenever this User Job "
667 "number is scheduled."));
675 gc->setLabel(QObject::tr(
"User Job #%1 description").arg(job_num));
676 gc->setValue(QObject::tr(
"User Job #%1").arg(job_num));
677 gc->setHelpText(QObject::tr(
"The description for this User Job."));
684 gc->setLabel(QObject::tr(
"Allow metadata lookup jobs"));
686 gc->setHelpText(QObject::tr(
"If enabled, allow jobs of this type to "
687 "run on this backend."));
694 gc->setLabel(QObject::tr(
"Allow commercial-detection jobs"));
696 gc->setHelpText(QObject::tr(
"If enabled, allow jobs of this type to "
697 "run on this backend."));
704 gc->setLabel(QObject::tr(
"Allow transcoding jobs"));
706 gc->setHelpText(QObject::tr(
"If enabled, allow jobs of this type to "
707 "run on this backend."));
714 gc->setLabel(QObject::tr(
"Allow preview jobs"));
716 gc->setHelpText(QObject::tr(
"If enabled, allow jobs of this type to "
717 "run on this backend."));
724 gc->setLabel(QObject::tr(
"Transcoder command"));
725 gc->setValue(
"mythtranscode");
726 gc->setHelpText(QObject::tr(
"The program used to transcode recordings. "
727 "The default is 'mythtranscode' if this setting is empty."));
734 gc->setLabel(QObject::tr(
"Commercial-detection command"));
735 gc->setValue(
"mythcommflag");
736 gc->setHelpText(QObject::tr(
"The program used to detect commercials in a "
737 "recording. The default is 'mythcommflag' "
738 "if this setting is empty."));
744 QString dbStr = QString(
"JobAllowUserJob%1").arg(job_num);
746 QString label = QObject::tr(
"Allow %1 jobs").arg(desc);
758 bc->setHelpText(QObject::tr(
"If enabled, allow jobs of this type to "
759 "run on this backend."));
767 gc->
setLabel(QObject::tr(
"Include recordings in video list"));
769 gc->
setHelpText(QObject::tr(
"If enabled, the master backend will include"
770 " the list of recorded shows in the list of videos. "
771 " This is mainly to accommodate UPnP players which do not"
772 " allow more than 1 video section." ));
780 gc->
setLabel(QObject::tr(
"Video content to show a WMP client"));
781 gc->addSelection(QObject::tr(
"Recordings"),
"0");
782 gc->addSelection(QObject::tr(
"Videos"),
"1");
784 gc->
setHelpText(QObject::tr(
"Which tree to show a Windows Media Player "
785 "client when it requests a list of videos."));
792 bc->setLabel(QObject::tr(
"Automatically update program listings"));
794 bc->setHelpText(QObject::tr(
"If enabled, the guide data program "
795 "will be run automatically."));
802 bs->setLabel(QObject::tr(
"Guide data program execution start"));
804 bs->setHelpText(QObject::tr(
"This setting and the following one define a "
805 "time period when the guide data program is allowed "
806 "to run. For example, setting start to 11 and "
807 "end to 13 would mean that the program would only "
808 "run between 11:00 AM and 1:59 PM."));
815 bs->setLabel(QObject::tr(
"Guide data program execution end"));
817 bs->setHelpText(QObject::tr(
"This setting and the preceding one define a "
818 "time period when the guide data program is allowed "
819 "to run. For example, setting start to 11 and "
820 "end to 13 would mean that the program would only "
821 "run between 11:00 AM and 1:59 PM."));
828 bc->setLabel(QObject::tr(
"Run guide data program at time suggested by the "
831 bc->setHelpText(QObject::tr(
"If enabled, allow a guide data "
832 "provider to specify the next download time in order "
833 "to distribute load on their servers. Guide data program "
834 "execution start/end times are also ignored."));
841 be->setLabel(QObject::tr(
"Guide data program"));
842 be->setValue(
"mythfilldatabase");
843 be->setHelpText(QObject::tr(
844 "Use 'mythfilldatabase' or the name of a custom "
845 "script that will populate the program guide info "
846 "for all your video sources."));
853 be->setLabel(QObject::tr(
"Guide data arguments"));
855 be->setHelpText(QObject::tr(
"Any arguments you want passed to the "
856 "guide data program."));
865 setLabel(QObject::tr(
"Program Schedule Downloading Options"));
887 server->setLabel(tr(
"Host Address Backend Setup"));
917 locale->setLabel(QObject::tr(
"Locale Settings"));
924 group2->setLabel(QObject::tr(
"Miscellaneous Settings"));
927 fm->setLabel(QObject::tr(
"File Management Settings"));
933 group2->addChild(fm);
935 upnp->setLabel(QObject::tr(
"UPnP Server Settings"));
938 group2->addChild(upnp);
945 group2a1->setLabel(QObject::tr(
"EIT Scanner Options"));
951 group3->setLabel(QObject::tr(
"Shutdown/Wakeup Options"));
964 group4->setLabel(QObject::tr(
"Backend Wakeup settings"));
967 backend->setLabel(QObject::tr(
"Master Backend"));
971 group4->addChild(backend);
974 slaveBackend->setLabel(QObject::tr(
"Slave Backends"));
977 group4->addChild(slaveBackend);
981 backendControl->setLabel(QObject::tr(
"Backend Control"));
987 group5->setLabel(QObject::tr(
"Job Queue (Backend-Specific)"));
1004 group6->setLabel(QObject::tr(
"Job Queue (Global)"));
1014 group7->setLabel(QObject::tr(
"Job Queue (Job Commands)"));
1035 if (ismasterchecked)
1050 QList<QHostAddress> list = QNetworkInterface::allAddresses();
1051 QList<QHostAddress>::iterator it;
1052 for (it = list.begin(); it != list.end(); ++it)
1054 it->setScopeId(QString());
1070 if (addr.setAddress(currentsetting))
1080 else if (! currentsetting.isEmpty())
1105 bool newInstall=
false;
1106 if (mastername.isEmpty())