6 #include <QNetworkInterface>
19 gc->setLabel(QObject::tr(
"This server is the Master Backend"));
21 gc->setHelpText(QObject::tr(
22 "Enable this if this is the only backend or is the "
23 "master backend server. If enabled, all frontend and "
24 "non-master backend machines "
25 "will connect to this server. To change to a new master "
26 "backend, run setup on that server and select it as "
34 gc->setLabel(QObject::tr(
"Master Backend Name"));
37 gc->setReadOnly(
true);
38 gc->setHelpText(QObject::tr(
39 "Host name of Master Backend. This is set by selecting "
40 "\"This server is the Master Backend\" on that server."));
47 gc->setLabel(QObject::tr(
"Allow Connections from all Subnets"));
49 gc->setHelpText(QObject::tr(
50 "Allow this backend to receive connections from any IP "
51 "address on the internet. NOT recommended for most users. "
52 "Use this only if you have secure IPV4 and IPV6 " "firewalls."));
59 gc->setLabel(QObject::tr(
"IPv4 address"));
60 QList<QHostAddress> list = QNetworkInterface::allAddresses();
61 QList<QHostAddress>::iterator it;
62 for (it = list.begin(); it != list.end(); ++it)
64 if ((*it).protocol() == QAbstractSocket::IPv4Protocol)
65 gc->addSelection((*it).toString(), (*it).toString());
68 gc->setValue(
"127.0.0.1");
69 gc->setHelpText(QObject::tr(
"Enter the IP address of this machine. "
70 "Use an externally accessible address (ie, not "
71 "127.0.0.1) if you are going to be running a frontend "
72 "on a different machine than this one. Note, in IPv6 "
73 "setups, this is still required for certain extras "
81 gc->setLabel(QObject::tr(
"Listen on IPv6 address"));
82 QList<QHostAddress> list = QNetworkInterface::allAddresses();
83 QList<QHostAddress>::iterator it;
84 for (it = list.begin(); it != list.end(); ++it)
86 if ((*it).protocol() == QAbstractSocket::IPv6Protocol)
90 it->setScopeId(QString());
91 gc->addSelection((*it).toString(), (*it).toString());
97 gc->setEnabled(
false);
102 if (list.contains(QHostAddress(
"::1")))
106 gc->setHelpText(QObject::tr(
"Enter the IPv6 address of this machine. "
107 "Use an externally accessible address (ie, not "
108 "::1) if you are going to be running a frontend "
109 "on a different machine than this one."));
116 hc->setLabel(QObject::tr(
"Listen on Link-Local addresses"));
118 hc->setHelpText(QObject::tr(
"Enable servers on this machine to listen on "
119 "link-local addresses. These are auto-configured "
120 "addresses and not accessible outside the local network. "
121 "This must be enabled for anything requiring Bonjour to "
134 setLabel(BackendSettings::tr(
"Listen on All IP Addresses"));
136 setHelpText(BackendSettings::tr(
"Allow this backend to receive "
137 "connections on any IP Address assigned to it. "
138 "Recommended for most users for ease and "
159 gc->setLabel(QObject::tr(
"Port"));
160 gc->setValue(
"6543");
161 gc->setHelpText(QObject::tr(
"Unless you've got good reason, don't "
171 gc->setLabel(QObject::tr(
"Status port"));
172 gc->setValue(
"6544");
173 gc->setHelpText(QObject::tr(
"Port on which the server will listen for "
174 "HTTP requests, including backend status and MythXML "
182 gc->setLabel(QObject::tr(
"Primary IP address / DNS name"));
183 gc->setValue(
"127.0.0.1");
184 gc->setHelpText(QObject::tr(
"The Primary IP address of this backend "
185 "server. You can select an IP "
186 "address from the list or type a DNS name "
187 "or host name. Other systems will contact this "
188 "server using this address. "
189 "If you use a host name make sure it is assigned "
190 "an ip address other than 127.0.0.1 in the hosts "
199 gc->setLabel(QObject::tr(
"IP address"));
200 gc->setValue(
"127.0.0.1");
208 gc->setLabel(QObject::tr(
"Port"));
209 gc->setValue(
"6543");
216 gc->setLabel(QObject::tr(
"Security PIN (required)"));
218 gc->setHelpText(QObject::tr(
"PIN code required for a frontend to connect "
219 "to the backend. Blank prevents all "
220 "connections; 0000 allows any client to "
228 gc->setLabel(QObject::tr(
"TV format"));
231 for (
const QString& item : qAsConst(list))
232 gc->addSelection(item);
234 gc->setHelpText(QObject::tr(
"The TV standard to use for viewing TV."));
241 gc->setLabel(QObject::tr(
"VBI format"));
242 gc->addSelection(
"None");
243 gc->addSelection(
"PAL teletext");
244 gc->addSelection(
"NTSC closed caption");
245 gc->setHelpText(QObject::tr(
"The VBI (Vertical Blanking Interval) is "
246 "used to carry Teletext or Closed Captioning "
254 gc->setLabel(QObject::tr(
"Channel frequency table"));
257 gc->addSelection(list.name);
259 gc->setHelpText(QObject::tr(
"Select the appropriate frequency table for "
260 "your system. If you have an antenna, use a \"-bcast\" "
268 gc->setLabel(QObject::tr(
"Save original files after transcoding (globally)"));
270 gc->setHelpText(QObject::tr(
"If enabled and the transcoder is active, the "
271 "original files will be renamed to .old once the "
272 "transcoding is complete."));
279 hc->setLabel(QObject::tr(
"Delete files slowly"));
281 hc->setHelpText(QObject::tr(
"Some filesystems use a lot of resources when "
282 "deleting large files. If enabled, this option makes "
283 "MythTV delete files slowly on this backend to lessen the "
291 gc->setLabel(QObject::tr(
"Follow symbolic links when deleting files"));
293 gc->setHelpText(QObject::tr(
"If enabled, MythTV will follow symlinks "
294 "when recordings and related files are deleted, instead "
295 "of deleting the symlink and leaving the actual file."));
302 "HDRingbufferSize", 25*188, 500*188, 25*188);
303 bs->setLabel(QObject::tr(
"HD ringbuffer size (kB)"));
304 bs->setHelpText(QObject::tr(
"The HD device ringbuffer allows the "
305 "backend to weather moments of stress. "
306 "The larger the ringbuffer (in kilobytes), the longer "
307 "the moments of stress can be. However, "
308 "setting the size too large can cause "
309 "swapping, which is detrimental."));
310 bs->setValue(50*188);
317 gc->setLabel(QObject::tr(
"Storage Group disk scheduler"));
318 gc->addSelection(QObject::tr(
"Balanced free space"),
"BalancedFreeSpace");
319 gc->addSelection(QObject::tr(
"Balanced percent free space"),
"BalancedPercFreeSpace");
320 gc->addSelection(QObject::tr(
"Balanced disk I/O"),
"BalancedDiskIO");
321 gc->addSelection(QObject::tr(
"Combination"),
"Combination");
322 gc->setValue(
"BalancedFreeSpace");
323 gc->setHelpText(QObject::tr(
"This setting controls how the Storage Group "
324 "scheduling code will balance new recordings across "
325 "directories. 'Balanced Free Space' is the recommended "
326 "method for most users." ));
333 gc->setLabel(QObject::tr(
"Disable automatic database backup"));
335 gc->setHelpText(QObject::tr(
"If enabled, MythTV will not backup the "
336 "database before upgrades. You should "
337 "therefore have your own database backup "
338 "strategy in place."));
345 hc->setLabel(QObject::tr(
"Disable FireWire reset"));
348 "By default, MythTV resets the FireWire bus when a "
349 "FireWire recorder stops responding to commands. If "
350 "this causes problems, you can disable this behavior "
359 he->setLabel(QObject::tr(
"Miscellaneous status application"));
361 he->setHelpText(QObject::tr(
"External application or script that outputs "
362 "extra information for inclusion in the "
363 "backend status page. See http://www.mythtv."
364 "org/wiki/Miscellaneous_Status_Information"));
371 gc->setLabel(QObject::tr(
"EIT transport timeout (mins)"));
373 QString helpText = QObject::tr(
374 "Maximum time to spend waiting (in minutes) for listings data "
375 "on one digital TV channel before checking for new listings data "
376 "on the next channel.");
377 gc->setHelpText(helpText);
384 gc->setLabel(QObject::tr(
"Master backend override"));
386 gc->setHelpText(QObject::tr(
"If enabled, the master backend will stream and"
387 " delete files if it finds them in a storage directory. "
388 "Useful if you are using a central storage location, like "
389 "a NFS share, and your slave backend isn't running."));
396 gc->setLabel(QObject::tr(
"Backend idle before EIT crawl (secs)"));
398 QString
help = QObject::tr(
399 "The minimum number of seconds after a recorder becomes idle "
400 "to wait before MythTV begins collecting EIT listings data.");
401 gc->setHelpText(
help);
408 gc->setLabel(QObject::tr(
"Delay between wake attempts (secs)"));
410 gc->setHelpText(QObject::tr(
"Length of time the frontend waits between "
411 "tries to wake up the master backend. This should be the "
412 "time your master backend needs to startup. Set to 0 to "
420 gc->setLabel(QObject::tr(
"Wake attempts"));
421 gc->setHelpText(QObject::tr(
"Number of times the frontend will try to wake "
422 "up the master backend."));
430 gc->setLabel(QObject::tr(
"Wake command"));
432 gc->setHelpText(QObject::tr(
"The command used to wake up your master "
433 "backend server (e.g. wakeonlan 00:00:00:00:00:00)."));
440 gc->setLabel(QObject::tr(
"Sleep command"));
442 gc->setHelpText(QObject::tr(
"The command used to put this slave to sleep. "
443 "If set, the master backend will use this command to put "
444 "this slave to sleep when it is not needed for recording."));
451 gc->setLabel(QObject::tr(
"Wake command"));
453 gc->setHelpText(QObject::tr(
"The command used to wake up this slave "
454 "from sleep. This setting is not used on the master "
462 gc->setLabel(QObject::tr(
"Backend stop command"));
463 gc->setValue(
"killall mythbackend");
464 gc->setHelpText(QObject::tr(
"The command used to stop the backend"
465 " when running on the master backend server "
466 "(e.g. sudo /etc/init.d/mythtv-backend stop)"));
473 gc->setLabel(QObject::tr(
"Backend start command"));
474 gc->setValue(
"mythbackend");
475 gc->setHelpText(QObject::tr(
"The command used to start the backend"
476 " when running on the master backend server "
477 "(e.g. sudo /etc/init.d/mythtv-backend start)."));
484 gc->setLabel(QObject::tr(
"Idle shutdown timeout (secs)"));
486 gc->setHelpText(QObject::tr(
"The number of seconds the master backend "
487 "idles before it shuts down all other backends. Set to 0 to "
488 "disable automatic shutdown."));
495 gc->setLabel(QObject::tr(
"Maximum wait for recording (mins)"));
497 gc->setHelpText(QObject::tr(
"The number of minutes the master backend "
498 "waits for a recording. If the backend is idle but a "
499 "recording starts within this time period, it won't "
507 gc->setLabel(QObject::tr(
"Startup before recording (secs)"));
509 gc->setHelpText(QObject::tr(
"The number of seconds the master backend "
510 "will be woken up before a recording starts."));
517 gc->setLabel(QObject::tr(
"Wakeup time format"));
518 gc->setValue(
"hh:mm yyyy-MM-dd");
519 gc->setHelpText(QObject::tr(
"The format of the time string passed to the "
520 "'Command to set wakeup time' as $time. See "
521 "QT::QDateTime.toString() for details. Set to 'time_t' for "
522 "seconds since epoch."));
529 gc->setLabel(QObject::tr(
"Command to set wakeup time"));
531 gc->setHelpText(QObject::tr(
"The command used to set the wakeup time "
532 "(passed as $time) for the Master Backend"));
539 gc->setLabel(QObject::tr(
"Server halt command"));
540 gc->setValue(
"sudo /sbin/halt -p");
541 gc->setHelpText(QObject::tr(
"The command used to halt the backends."));
548 gc->setLabel(QObject::tr(
"Pre-shutdown-check command"));
550 gc->setHelpText(QObject::tr(
"A command executed before the backend would "
551 "shutdown. The return value determines if "
552 "the backend can shutdown. 0 - yes, "
553 "1 - restart idling, "
554 "2 - reset the backend to wait for a frontend."));
561 gc->setLabel(QObject::tr(
"Block shutdown before client connected"));
563 gc->setHelpText(QObject::tr(
"If enabled, the automatic shutdown routine will "
564 "be disabled until a client connects."));
571 gc->setLabel(QObject::tr(
"Startup command"));
573 gc->setHelpText(QObject::tr(
"This command is executed right after starting "
574 "the BE. As a parameter '$status' is replaced by either "
575 "'auto' if the machine was started automatically or "
576 "'user' if a user switched it on."));
583 gc->setLabel(QObject::tr(
"Maximum simultaneous jobs on this backend"));
584 gc->setHelpText(QObject::tr(
"The Job Queue will be limited to running "
585 "this many simultaneous jobs on this backend."));
593 gc->setLabel(QObject::tr(
"Job Queue check frequency (secs)"));
594 gc->setHelpText(QObject::tr(
"When looking for new jobs to process, the "
595 "Job Queue will wait this many seconds between checks."));
603 gc->setLabel(QObject::tr(
"CPU usage"));
604 gc->addSelection(QObject::tr(
"Low"),
"0");
605 gc->addSelection(QObject::tr(
"Medium"),
"1");
606 gc->addSelection(QObject::tr(
"High"),
"2");
607 gc->setHelpText(QObject::tr(
"This setting controls approximately how "
608 "much CPU jobs in the queue may consume. "
609 "On 'High', all available CPU time may be used, "
610 "which could cause problems on slower systems." ));
617 gc->setLabel(QObject::tr(
"Job Queue start time"));
618 gc->setHelpText(QObject::tr(
"This setting controls the start of the "
619 "Job Queue time window, which determines when new jobs "
620 "will be started."));
627 gc->setLabel(QObject::tr(
"Job Queue end time"));
628 gc->setHelpText(QObject::tr(
"This setting controls the end of the "
629 "Job Queue time window, which determines when new jobs "
630 "will be started."));
637 gc->setLabel(QObject::tr(
"Run jobs only on original recording backend"));
639 gc->setHelpText(QObject::tr(
"If enabled, jobs in the queue will be required "
640 "to run on the backend that made the "
641 "original recording."));
648 gc->setLabel(QObject::tr(
"Run transcode jobs before auto commercial "
651 gc->setHelpText(QObject::tr(
"If enabled, and if both auto-transcode and "
652 "commercial detection are turned ON for a "
653 "recording, transcoding will run first; "
654 "otherwise, commercial detection runs first."));
661 gc->setLabel(QObject::tr(
"Start auto-commercial-detection jobs when the "
662 "recording starts"));
664 gc->setHelpText(QObject::tr(
"If enabled, and Auto Commercial Detection is "
665 "ON for a recording, the flagging job will be "
666 "started as soon as the recording starts. NOT "
667 "recommended on underpowered systems."));
674 gc->setLabel(QObject::tr(
"User Job #%1 command").arg(job_num));
676 gc->setHelpText(QObject::tr(
"The command to run whenever this User Job "
677 "number is scheduled."));
685 gc->setLabel(QObject::tr(
"User Job #%1 description").arg(job_num));
686 gc->setValue(QObject::tr(
"User Job #%1").arg(job_num));
687 gc->setHelpText(QObject::tr(
"The description for this User Job."));
694 gc->setLabel(QObject::tr(
"Allow metadata lookup 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 commercial-detection 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 transcoding jobs"));
716 gc->setHelpText(QObject::tr(
"If enabled, allow jobs of this type to "
717 "run on this backend."));
724 gc->setLabel(QObject::tr(
"Allow preview jobs"));
726 gc->setHelpText(QObject::tr(
"If enabled, allow jobs of this type to "
727 "run on this backend."));
734 gc->setLabel(QObject::tr(
"Transcoder command"));
735 gc->setValue(
"mythtranscode");
736 gc->setHelpText(QObject::tr(
"The program used to transcode recordings. "
737 "The default is 'mythtranscode' if this setting is empty."));
744 gc->setLabel(QObject::tr(
"Commercial-detection command"));
745 gc->setValue(
"mythcommflag");
746 gc->setHelpText(QObject::tr(
"The program used to detect commercials in a "
747 "recording. The default is 'mythcommflag' "
748 "if this setting is empty."));
754 QString dbStr = QString(
"JobAllowUserJob%1").arg(job_num);
756 QString label = QObject::tr(
"Allow %1 jobs").arg(desc);
768 bc->setHelpText(QObject::tr(
"If enabled, allow jobs of this type to "
769 "run on this backend."));
777 gc->
setLabel(QObject::tr(
"Include recordings in video list"));
779 gc->
setHelpText(QObject::tr(
"If enabled, the master backend will include"
780 " the list of recorded shows in the list of videos. "
781 " This is mainly to accommodate UPnP players which do not"
782 " allow more than 1 video section." ));
790 gc->
setLabel(QObject::tr(
"Video content to show a WMP client"));
791 gc->addSelection(QObject::tr(
"Recordings"),
"0");
792 gc->addSelection(QObject::tr(
"Videos"),
"1");
794 gc->
setHelpText(QObject::tr(
"Which tree to show a Windows Media Player "
795 "client when it requests a list of videos."));
802 bc->setLabel(QObject::tr(
"Automatically update program listings"));
804 bc->setHelpText(QObject::tr(
"If enabled, the guide data program "
805 "will be run automatically."));
812 bs->setLabel(QObject::tr(
"Guide data program execution start"));
814 bs->setHelpText(QObject::tr(
"This setting and the following one define a "
815 "time period when the guide data program is allowed "
816 "to run. For example, setting start to 11 and "
817 "end to 13 would mean that the program would only "
818 "run between 11:00 AM and 1:59 PM."));
825 bs->setLabel(QObject::tr(
"Guide data program execution end"));
827 bs->setHelpText(QObject::tr(
"This setting and the preceding one define a "
828 "time period when the guide data program is allowed "
829 "to run. For example, setting start to 11 and "
830 "end to 13 would mean that the program would only "
831 "run between 11:00 AM and 1:59 PM."));
838 bc->setLabel(QObject::tr(
"Run guide data program at time suggested by the "
841 bc->setHelpText(QObject::tr(
"If enabled, allow a guide data "
842 "provider to specify the next download time in order "
843 "to distribute load on their servers. Guide data program "
844 "execution start/end times are also ignored."));
851 be->setLabel(QObject::tr(
"Guide data program"));
852 be->setValue(
"mythfilldatabase");
853 be->setHelpText(QObject::tr(
854 "Use 'mythfilldatabase' or the name of a custom "
855 "script that will populate the program guide info "
856 "for all your video sources."));
863 be->setLabel(QObject::tr(
"Guide data arguments"));
865 be->setHelpText(QObject::tr(
"Any arguments you want passed to the "
866 "guide data program."));
875 setLabel(QObject::tr(
"Program Schedule Downloading Options"));
897 server->setLabel(tr(
"Host Address Backend Setup"));
927 locale->setLabel(QObject::tr(
"Locale Settings"));
934 group2->setLabel(QObject::tr(
"Miscellaneous Settings"));
937 fm->setLabel(QObject::tr(
"File Management Settings"));
943 group2->addChild(fm);
945 upnp->setLabel(QObject::tr(
"UPnP Server Settings"));
948 group2->addChild(upnp);
955 group2a1->setLabel(QObject::tr(
"EIT Scanner Options"));
961 group3->setLabel(QObject::tr(
"Shutdown/Wakeup Options"));
974 group4->setLabel(QObject::tr(
"Backend Wakeup settings"));
977 backend->setLabel(QObject::tr(
"Master Backend"));
981 group4->addChild(backend);
984 slaveBackend->setLabel(QObject::tr(
"Slave Backends"));
987 group4->addChild(slaveBackend);
991 backendControl->setLabel(QObject::tr(
"Backend Control"));
997 group5->setLabel(QObject::tr(
"Job Queue (Backend-Specific)"));
1014 group6->setLabel(QObject::tr(
"Job Queue (Global)"));
1024 group7->setLabel(QObject::tr(
"Job Queue (Job Commands)"));
1045 if (ismasterchecked)
1060 QList<QHostAddress> list = QNetworkInterface::allAddresses();
1061 QList<QHostAddress>::iterator it;
1062 for (it = list.begin(); it != list.end(); ++it)
1064 it->setScopeId(QString());
1080 if (addr.setAddress(currentsetting))
1090 else if (! currentsetting.isEmpty())
1115 bool newInstall=
false;
1116 if (mastername.isEmpty())