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 "
136 setLabel(BackendSettings::tr(
"Listen on All IP Addresses"));
138 setHelpText(BackendSettings::tr(
"Allow this backend to receive "
139 "connections on any IP Address assigned to it. "
140 "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 : std::as_const(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(
"EIT scan period (mins)"));
410 QString helpText = QObject::tr(
411 "Time to do EIT scanning on one capture card before moving "
412 "to the next capture card in the same input group that is "
413 "configured for EIT scanning. This can happen with multiple "
414 "satellite LNBs connected via a DiSEqC switch.");
415 gc->setHelpText(helpText);
422 gc->setLabel(QObject::tr(
"EIT event chunk size"));
424 QString helpText = QObject::tr(
425 "Maximum number of DB inserts per ProcessEvents call. "
426 "This limits the rate at which EIT events are processed "
427 "in the backend so that there is always enough processing "
428 "capacity for the other backend tasks.");
429 gc->setHelpText(helpText);
436 gc->setLabel(QObject::tr(
"EIT cache persistent"));
438 QString helpText = QObject::tr(
439 "Save the content of the EIT cache in the database "
440 "and use that at the next start of the backend. "
441 "This reduces EIT event processing at a restart of the backend but at the "
442 "cost of updating the copy of the EIT cache in the database continuously.");
443 gc->setHelpText(helpText);
450 gc->setLabel(QObject::tr(
"Delay between wake attempts (secs)"));
452 gc->setHelpText(QObject::tr(
"Length of time the frontend waits between "
453 "tries to wake up the master backend. This should be the "
454 "time your master backend needs to startup. Set to 0 to "
462 gc->setLabel(QObject::tr(
"Wake attempts"));
463 gc->setHelpText(QObject::tr(
"Number of times the frontend will try to wake "
464 "up the master backend."));
472 gc->setLabel(QObject::tr(
"Wake command"));
474 gc->setHelpText(QObject::tr(
"The command used to wake up your master "
475 "backend server (e.g. wakeonlan 00:00:00:00:00:00)."));
482 gc->setLabel(QObject::tr(
"Sleep command"));
484 gc->setHelpText(QObject::tr(
"The command used to put this slave to sleep. "
485 "If set, the master backend will use this command to put "
486 "this slave to sleep when it is not needed for recording."));
493 gc->setLabel(QObject::tr(
"Wake command"));
495 gc->setHelpText(QObject::tr(
"The command used to wake up this slave "
496 "from sleep. This setting is not used on the master "
504 gc->setLabel(QObject::tr(
"Backend stop command"));
505 gc->setValue(
"killall mythbackend");
506 gc->setHelpText(QObject::tr(
"The command used to stop the backend"
507 " when running on the master backend server "
508 "(e.g. sudo /etc/init.d/mythtv-backend stop)"));
515 gc->setLabel(QObject::tr(
"Backend start command"));
516 gc->setValue(
"mythbackend");
517 gc->setHelpText(QObject::tr(
"The command used to start the backend"
518 " when running on the master backend server "
519 "(e.g. sudo /etc/init.d/mythtv-backend start)."));
526 gc->setLabel(QObject::tr(
"Idle shutdown timeout (secs)"));
528 gc->setHelpText(QObject::tr(
"The number of seconds the master backend "
529 "idles before it shuts down all other backends. Set to 0 to "
530 "disable automatic shutdown."));
537 gc->setLabel(QObject::tr(
"Maximum wait for recording (mins)"));
539 gc->setHelpText(QObject::tr(
"The number of minutes the master backend "
540 "waits for a recording. If the backend is idle but a "
541 "recording starts within this time period, it won't "
549 gc->setLabel(QObject::tr(
"Startup before recording (secs)"));
551 gc->setHelpText(QObject::tr(
"The number of seconds the master backend "
552 "will be woken up before a recording starts."));
559 gc->setLabel(QObject::tr(
"Wakeup time format"));
560 gc->setValue(
"hh:mm yyyy-MM-dd");
561 gc->setHelpText(QObject::tr(
"The format of the time string passed to the "
562 "'Command to set wakeup time' as $time. See "
563 "QT::QDateTime.toString() for details. Set to 'time_t' for "
564 "seconds since epoch."));
571 gc->setLabel(QObject::tr(
"Command to set wakeup time"));
573 gc->setHelpText(QObject::tr(
"The command used to set the wakeup time "
574 "(passed as $time) for the Master Backend"));
581 gc->setLabel(QObject::tr(
"Server halt command"));
582 gc->setValue(
"sudo /sbin/halt -p");
583 gc->setHelpText(QObject::tr(
"The command used to halt the backends."));
590 gc->setLabel(QObject::tr(
"Pre-shutdown-check command"));
592 gc->setHelpText(QObject::tr(
"A command executed before the backend would "
593 "shutdown. The return value determines if "
594 "the backend can shutdown. 0 - yes, "
595 "1 - restart idling, "
596 "2 - reset the backend to wait for a frontend."));
603 gc->setLabel(QObject::tr(
"Block shutdown before client connected"));
605 gc->setHelpText(QObject::tr(
"If enabled, the automatic shutdown routine will "
606 "be disabled until a client connects."));
613 gc->setLabel(QObject::tr(
"Startup command"));
615 gc->setHelpText(QObject::tr(
"This command is executed right after starting "
616 "the BE. As a parameter '$status' is replaced by either "
617 "'auto' if the machine was started automatically or "
618 "'user' if a user switched it on."));
625 gc->setLabel(QObject::tr(
"Maximum simultaneous jobs on this backend"));
626 gc->setHelpText(QObject::tr(
"The Job Queue will be limited to running "
627 "this many simultaneous jobs on this backend."));
635 gc->setLabel(QObject::tr(
"Job Queue check frequency (secs)"));
636 gc->setHelpText(QObject::tr(
"When looking for new jobs to process, the "
637 "Job Queue will wait this many seconds between checks."));
645 gc->setLabel(QObject::tr(
"CPU usage"));
646 gc->addSelection(QObject::tr(
"Low"),
"0");
647 gc->addSelection(QObject::tr(
"Medium"),
"1");
648 gc->addSelection(QObject::tr(
"High"),
"2");
649 gc->setHelpText(QObject::tr(
"This setting controls approximately how "
650 "much CPU jobs in the queue may consume. "
651 "On 'High', all available CPU time may be used, "
652 "which could cause problems on slower systems." ));
659 gc->setLabel(QObject::tr(
"Job Queue start time"));
660 gc->setHelpText(QObject::tr(
"This setting controls the start of the "
661 "Job Queue time window, which determines when new jobs "
662 "will be started."));
669 gc->setLabel(QObject::tr(
"Job Queue end time"));
670 gc->setHelpText(QObject::tr(
"This setting controls the end of the "
671 "Job Queue time window, which determines when new jobs "
672 "will be started."));
679 gc->setLabel(QObject::tr(
"Run jobs only on original recording backend"));
681 gc->setHelpText(QObject::tr(
"If enabled, jobs in the queue will be required "
682 "to run on the backend that made the "
683 "original recording."));
690 gc->setLabel(QObject::tr(
"Run transcode jobs before auto commercial "
693 gc->setHelpText(QObject::tr(
"If enabled, and if both auto-transcode and "
694 "commercial detection are turned ON for a "
695 "recording, transcoding will run first; "
696 "otherwise, commercial detection runs first."));
703 gc->setLabel(QObject::tr(
"Start auto-commercial-detection jobs when the "
704 "recording starts"));
706 gc->setHelpText(QObject::tr(
"If enabled, and Auto Commercial Detection is "
707 "ON for a recording, the flagging job will be "
708 "started as soon as the recording starts. NOT "
709 "recommended on underpowered systems."));
716 gc->setLabel(QObject::tr(
"User Job #%1 command").arg(job_num));
718 gc->setHelpText(QObject::tr(
"The command to run whenever this User Job "
719 "number is scheduled."));
727 gc->setLabel(QObject::tr(
"User Job #%1 description").arg(job_num));
728 gc->setValue(QObject::tr(
"User Job #%1").arg(job_num));
729 gc->setHelpText(QObject::tr(
"The description for this User Job."));
736 gc->setLabel(QObject::tr(
"Allow metadata lookup jobs"));
738 gc->setHelpText(QObject::tr(
"If enabled, allow jobs of this type to "
739 "run on this backend."));
746 gc->setLabel(QObject::tr(
"Allow commercial-detection jobs"));
748 gc->setHelpText(QObject::tr(
"If enabled, allow jobs of this type to "
749 "run on this backend."));
756 gc->setLabel(QObject::tr(
"Allow transcoding jobs"));
758 gc->setHelpText(QObject::tr(
"If enabled, allow jobs of this type to "
759 "run on this backend."));
766 gc->setLabel(QObject::tr(
"Allow preview jobs"));
768 gc->setHelpText(QObject::tr(
"If enabled, allow jobs of this type to "
769 "run on this backend."));
776 gc->setLabel(QObject::tr(
"Transcoder command"));
777 gc->setValue(
"mythtranscode");
778 gc->setHelpText(QObject::tr(
"The program used to transcode recordings. "
779 "The default is 'mythtranscode' if this setting is empty."));
786 gc->setLabel(QObject::tr(
"Commercial-detection command"));
787 gc->setValue(
"mythcommflag");
788 gc->setHelpText(QObject::tr(
"The program used to detect commercials in a "
789 "recording. The default is 'mythcommflag' "
790 "if this setting is empty."));
796 QString dbStr = QString(
"JobAllowUserJob%1").arg(job_num);
798 QString label = QObject::tr(
"Allow %1 jobs").arg(desc);
810 bc->setHelpText(QObject::tr(
"If enabled, allow jobs of this type to "
811 "run on this backend."));
819 gc->
setLabel(QObject::tr(
"Include recordings in video list"));
821 gc->
setHelpText(QObject::tr(
"If enabled, the master backend will include"
822 " the list of recorded shows in the list of videos. "
823 " This is mainly to accommodate UPnP players which do not"
824 " allow more than 1 video section." ));
832 gc->
setLabel(QObject::tr(
"Video content to show a WMP client"));
833 gc->addSelection(QObject::tr(
"Recordings"),
"0");
834 gc->addSelection(QObject::tr(
"Videos"),
"1");
836 gc->
setHelpText(QObject::tr(
"Which tree to show a Windows Media Player "
837 "client when it requests a list of videos."));
844 bc->setLabel(QObject::tr(
"Automatically update program listings"));
846 bc->setHelpText(QObject::tr(
"If enabled, the guide data program "
847 "will be run automatically."));
854 bs->setLabel(QObject::tr(
"Guide data program execution start"));
856 bs->setHelpText(QObject::tr(
"This setting and the following one define a "
857 "time period when the guide data program is allowed "
858 "to run. For example, setting start to 11 and "
859 "end to 13 would mean that the program would only "
860 "run between 11:00 AM and 1:59 PM."));
867 bs->setLabel(QObject::tr(
"Guide data program execution end"));
869 bs->setHelpText(QObject::tr(
"This setting and the preceding one define a "
870 "time period when the guide data program is allowed "
871 "to run. For example, setting start to 11 and "
872 "end to 13 would mean that the program would only "
873 "run between 11:00 AM and 1:59 PM."));
880 bc->setLabel(QObject::tr(
"Run guide data program at time suggested by the "
883 bc->setHelpText(QObject::tr(
"If enabled, allow a guide data "
884 "provider to specify the next download time in order "
885 "to distribute load on their servers. Guide data program "
886 "execution start/end times are also ignored."));
893 be->setLabel(QObject::tr(
"Guide data program"));
894 be->setValue(
"mythfilldatabase");
895 be->setHelpText(QObject::tr(
896 "Use 'mythfilldatabase' or the name of a custom "
897 "script that will populate the program guide info "
898 "for all your video sources."));
905 be->setLabel(QObject::tr(
"Guide data arguments"));
907 be->setHelpText(QObject::tr(
"Any arguments you want passed to the "
908 "guide data program."));
917 setLabel(QObject::tr(
"Program Schedule Downloading Options"));
932 m_localServerPort(LocalServerPort()),
943 server->setLabel(tr(
"Host Address Backend Setup"));
968 locale->setLabel(QObject::tr(
"Locale Settings"));
975 group2->setLabel(QObject::tr(
"Miscellaneous Settings"));
978 fm->setLabel(QObject::tr(
"File Management Settings"));
984 group2->addChild(fm);
986 upnp->setLabel(QObject::tr(
"UPnP Server Settings"));
989 group2->addChild(upnp);
996 group2a1->setLabel(QObject::tr(
"EIT Scanner Options"));
1005 group3->setLabel(QObject::tr(
"Shutdown/Wakeup Options"));
1018 group4->setLabel(QObject::tr(
"Backend Wakeup settings"));
1021 backend->setLabel(QObject::tr(
"Master Backend"));
1025 group4->addChild(backend);
1028 slaveBackend->setLabel(QObject::tr(
"Slave Backends"));
1031 group4->addChild(slaveBackend);
1035 backendControl->setLabel(QObject::tr(
"Backend Control"));
1041 group5->setLabel(QObject::tr(
"Job Queue (Backend-Specific)"));
1058 group6->setLabel(QObject::tr(
"Job Queue (Global)"));
1068 group7->setLabel(QObject::tr(
"Job Queue (Job Commands)"));
1089 if (ismasterchecked)
1104 QList<QHostAddress> list = QNetworkInterface::allAddresses();
1105 QList<QHostAddress>::iterator it;
1106 for (it = list.begin(); it != list.end(); ++it)
1108 it->setScopeId(QString());
1124 if (addr.setAddress(currentsetting))
1134 else if (! currentsetting.isEmpty())
1161 bool newInstall=
false;
1162 if (mastername.isEmpty())