MythTV  master
globalsettings.cpp
Go to the documentation of this file.
1 
2 // -*- Mode: c++ -*-
3 
4 // Standard UNIX C headers
5 #include <unistd.h>
6 #include <fcntl.h>
7 #include <sys/types.h>
8 #include <sys/stat.h>
9 
10 // Qt headers
11 #include <QCoreApplication>
12 #include <QEvent>
13 #include <QFileInfo>
14 #include <QFile>
15 #include <QDialog>
16 #include <QCursor>
17 #include <QDir>
18 #include <QImage>
19 #include <QTextCodec>
20 #include <QFontDatabase>
21 
22 // MythTV headers
23 #include "mythconfig.h"
24 #include "mythcorecontext.h"
25 #include "mythdbcon.h"
26 #include "mythlogging.h"
27 #include "dbsettings.h"
28 #include "mythtranslation.h"
29 #include "iso639.h"
30 #include "playbackbox.h"
31 #include "globalsettings.h"
32 #include "recordingprofile.h"
33 #include "mythdisplay.h"
34 #include "DisplayRes.h"
35 #include "cardutil.h"
36 #include "themeinfo.h"
37 #include "mythdirs.h"
38 #include "mythuihelper.h"
39 #include "mythuidefines.h"
40 #include "langsettings.h"
41 
42 #ifdef USING_AIRPLAY
44 #endif
45 #if defined(Q_OS_MACX)
46 #include "privatedecoder_vda.h"
47 #endif
48 
49 //Use for playBackGroup, to be remove at one point
50 #include "playgroup.h"
51 
53 // was previously *DecodeExtraAudio()
54 {
55  HostSpinBoxSetting *gc = new HostSpinBoxSetting("AudioReadAhead",0,5000,10,10);
56 
57  gc->setLabel(PlaybackSettings::tr("Audio read ahead (ms)"));
58 
59  gc->setValue(100);
60 
61  gc->setHelpText(PlaybackSettings::tr(
62  "Increase this value if audio cuts out frequently. This is more "
63  "likely to occur when adjusting audio sync to a negative value. "
64  "If using high negative audio sync values you may need to set a large "
65  "value here. Default is 100."));
66  return gc;
67 }
68 
69 #if CONFIG_DEBUGTYPE
70 static HostCheckBoxSetting *FFmpegDemuxer()
71 {
72  HostCheckBoxSetting *gc = new HostCheckBoxSetting("FFMPEGTS");
73 
74  gc->setLabel(PlaybackSettings::tr("Use FFmpeg's original MPEG-TS demuxer"));
75 
76  gc->setValue(false);
77 
78  gc->setHelpText(PlaybackSettings::tr("Experimental: Enable this setting to "
79  "use FFmpeg's native demuxer. Things "
80  "will be broken."));
81  return gc;
82 }
83 #endif
84 
86 {
87  HostComboBoxSetting *gc = new HostComboBoxSetting("PIPLocation");
88 
89  gc->setLabel(PlaybackSettings::tr("PIP video location"));
90 
91  for (uint loc = 0; loc < kPIP_END; ++loc)
92  gc->addSelection(toString((PIPLocation) loc), QString::number(loc));
93 
94  gc->setHelpText(PlaybackSettings::tr("Location of PIP Video window."));
95 
96  return gc;
97 }
98 
100 {
101  HostComboBoxSetting *gc = new HostComboBoxSetting("DisplayRecGroup");
102 
103  gc->setLabel(PlaybackSettings::tr("Default group filter to apply"));
104 
105 
106  gc->addSelection(PlaybackSettings::tr("All Programs"), QString("All Programs"));
107  gc->addSelection(QCoreApplication::translate("(Common)", "Default"),
108  QString("Default"));
109 
110  MSqlQuery query(MSqlQuery::InitCon());
111  query.prepare("SELECT DISTINCT recgroup from recorded;");
112 
113  if (query.exec())
114  {
115  while (query.next())
116  {
117  if (query.value(0).toString() != "Default")
118  {
119  QString recgroup = query.value(0).toString();
120  gc->addSelection(recgroup, recgroup);
121  }
122  }
123  }
124 
125  query.prepare("SELECT DISTINCT category from recorded;");
126 
127  if (query.exec())
128  {
129  while (query.next())
130  {
131  QString key = query.value(0).toString();
132  gc->addSelection(key, key);
133  }
134  }
135 
136  gc->setHelpText(PlaybackSettings::tr("Default group filter to apply on the "
137  "View Recordings screen."));
138  return gc;
139 }
140 
142 {
143  HostCheckBoxSetting *gc = new HostCheckBoxSetting("QueryInitialFilter");
144 
145  gc->setLabel(PlaybackSettings::tr("Always prompt for initial group "
146  "filter"));
147 
148  gc->setValue(false);
149 
150  gc->setHelpText(PlaybackSettings::tr("If enabled, always prompt the user "
151  "for the initial filter to apply "
152  "when entering the Watch Recordings "
153  "screen."));
154  return gc;
155 }
156 
158 {
159  HostCheckBoxSetting *gc = new HostCheckBoxSetting("RememberRecGroup");
160 
161  gc->setLabel(PlaybackSettings::tr("Save current group filter when "
162  "changed"));
163 
164  gc->setValue(true);
165 
166  gc->setHelpText(PlaybackSettings::tr("If enabled, remember the last "
167  "selected filter instead of "
168  "displaying the default filter "
169  "whenever you enter the playback "
170  "screen."));
171  return gc;
172 }
173 
175 {
176  HostCheckBoxSetting *gc = new HostCheckBoxSetting("RecGroupsFocusable");
177 
178  gc->setLabel(PlaybackSettings::tr("Change Recording Group using the arrow "
179  "keys"));
180 
181  gc->setValue(false);
182 
183  gc->setHelpText(PlaybackSettings::tr("If enabled, change recording group "
184  "directly using the arrow keys "
185  "instead of having to use < and >. "
186  "Requires theme support for this "
187  "feature."));
188  return gc;
189 }
190 
191 
193 {
194  HostCheckBoxSetting *gc = new HostCheckBoxSetting("PlaybackBoxStartInTitle");
195 
196  gc->setLabel(PlaybackSettings::tr("Start in group list"));
197 
198  gc->setValue(true);
199 
200  gc->setHelpText(PlaybackSettings::tr("If enabled, the focus will start on "
201  "the group list, otherwise the focus "
202  "will default to the recordings."));
203  return gc;
204 }
205 
207 {
208  HostCheckBoxSetting *gc = new HostCheckBoxSetting("SmartForward");
209 
210  gc->setLabel(PlaybackSettings::tr("Smart fast forwarding"));
211 
212  gc->setValue(false);
213 
214  gc->setHelpText(PlaybackSettings::tr("If enabled, then immediately after "
215  "rewinding, only skip forward the "
216  "same amount as skipping backwards."));
217  return gc;
218 }
219 
221 {
222  GlobalComboBoxSetting *bc = new GlobalComboBoxSetting("CommercialSkipMethod");
223 
224  bc->setLabel(GeneralSettings::tr("Commercial detection method"));
225 
226  bc->setHelpText(GeneralSettings::tr("This determines the method used by "
227  "MythTV to detect when commercials "
228  "start and end."));
229 
230  deque<int> tmp = GetPreferredSkipTypeCombinations();
231 
232  for (uint i = 0; i < tmp.size(); ++i)
233  bc->addSelection(SkipTypeToString(tmp[i]), QString::number(tmp[i]));
234 
235  return bc;
236 }
237 
239 {
240  GlobalCheckBoxSetting *gc = new GlobalCheckBoxSetting("CommFlagFast");
241 
242  gc->setLabel(GeneralSettings::tr("Enable experimental speedup of "
243  "commercial detection"));
244 
245  gc->setValue(false);
246 
247  gc->setHelpText(GeneralSettings::tr("If enabled, experimental commercial "
248  "detection speedups will be enabled."));
249  return gc;
250 }
251 
253 {
254  HostComboBoxSetting *gc = new HostComboBoxSetting("AutoCommercialSkip");
255 
256  gc->setLabel(PlaybackSettings::tr("Automatically skip commercials"));
257 
258  gc->addSelection(QCoreApplication::translate("(Common)", "Off"), "0");
259  gc->addSelection(PlaybackSettings::tr("Notify, but do not skip",
260  "Skip commercials"), "2");
261  gc->addSelection(PlaybackSettings::tr("Automatically Skip",
262  "Skip commercials"), "1");
263 
264  gc->setHelpText(PlaybackSettings::tr("Automatically skip commercial breaks "
265  "that have been flagged during "
266  "automatic commercial detection "
267  "or by the mythcommflag program, or "
268  "just notify that a commercial has "
269  "been detected."));
270  return gc;
271 }
272 
274 {
275  GlobalSpinBoxSetting *gs = new GlobalSpinBoxSetting("DeferAutoTranscodeDays", 0, 365, 1);
276 
277  gs->setLabel(GeneralSettings::tr("Deferral days for auto transcode jobs"));
278 
279  gs->setHelpText(GeneralSettings::tr("If non-zero, automatic transcode jobs "
280  "will be scheduled to run this many "
281  "days after a recording completes "
282  "instead of immediately afterwards."));
283 
284  gs->setValue(0);
285 
286  return gs;
287 }
288 
290 {
291  GlobalCheckBoxSetting *bc = new GlobalCheckBoxSetting("AggressiveCommDetect");
292 
293  bc->setLabel(GeneralSettings::tr("Strict commercial detection"));
294 
295  bc->setValue(true);
296 
297  bc->setHelpText(GeneralSettings::tr("Enable stricter commercial detection "
298  "code. Disable if some commercials are "
299  "not being detected."));
300  return bc;
301 }
302 
304 {
305  HostSpinBoxSetting *gs = new HostSpinBoxSetting("CommRewindAmount", 0, 10, 1);
306 
307  gs->setLabel(PlaybackSettings::tr("Commercial skip automatic rewind amount "
308  "(secs)"));
309 
310  gs->setHelpText(PlaybackSettings::tr("MythTV will automatically rewind "
311  "this many seconds after performing a "
312  "commercial skip."));
313 
314  gs->setValue(0);
315 
316  return gs;
317 }
318 
320 {
321  HostSpinBoxSetting *gs = new HostSpinBoxSetting("CommNotifyAmount", 0, 10, 1);
322 
323  gs->setLabel(PlaybackSettings::tr("Commercial skip notify amount (secs)"));
324 
325  gs->setHelpText(PlaybackSettings::tr("MythTV will act like a commercial "
326  "begins this many seconds early. This "
327  "can be useful when commercial "
328  "notification is used in place of "
329  "automatic skipping."));
330 
331  gs->setValue(0);
332 
333  return gs;
334 }
335 
337 {
338  GlobalSpinBoxSetting *bs = new GlobalSpinBoxSetting("MaximumCommercialSkip", 0, 3600, 10);
339 
340  bs->setLabel(PlaybackSettings::tr("Maximum commercial skip (secs)"));
341 
342  bs->setHelpText(PlaybackSettings::tr("MythTV will discourage long manual "
343  "commercial skips. Skips which are "
344  "longer than this will require the "
345  "user to hit the SKIP key twice. "
346  "Automatic commercial skipping is "
347  "not affected by this limit."));
348 
349  bs->setValue(3600);
350 
351  return bs;
352 }
353 
355 {
356  GlobalSpinBoxSetting *bs = new GlobalSpinBoxSetting("MergeShortCommBreaks", 0, 3600, 5);
357 
358  bs->setLabel(PlaybackSettings::tr("Merge short commercial breaks (secs)"));
359 
360  bs->setHelpText(PlaybackSettings::tr("Treat consecutive commercial breaks "
361  "shorter than this as one break when "
362  "skipping forward. Useful if you have "
363  "to skip a few times during breaks. "
364  "Applies to automatic skipping as "
365  "well. Set to 0 to disable."));
366 
367  bs->setValue(0);
368 
369  return bs;
370 }
371 
373 {
374  GlobalSpinBoxSetting *bs = new GlobalSpinBoxSetting("AutoExpireExtraSpace", 0, 200, 1);
375 
376  bs->setLabel(GeneralSettings::tr("Extra disk space (GB)"));
377 
378  bs->setHelpText(GeneralSettings::tr("Extra disk space (in gigabytes) "
379  "beyond what MythTV requires that "
380  "you want to keep free on the "
381  "recording file systems."));
382 
383  bs->setValue(1);
384 
385  return bs;
386 };
387 
388 #if 0
389 static GlobalCheckBoxSetting *AutoExpireInsteadOfDelete()
390 {
391  GlobalCheckBoxSetting *cb = new GlobalCheckBoxSetting("AutoExpireInsteadOfDelete");
392 
393  cb->setLabel(DeletedExpireOptions::tr("Auto-Expire instead of delete recording"));
394 
395  cb->setValue(false);
396 
397  cb->setHelpText(DeletedExpireOptions::tr("If enabled, move deleted recordings to the "
398  "'Deleted' recgroup and turn on autoexpire "
399  "instead of deleting immediately."));
400  return cb;
401 }
402 #endif
403 
405 {
406  GlobalSpinBoxSetting *bs = new GlobalSpinBoxSetting("DeletedMaxAge", -1, 365, 1);
407 
408  bs->setLabel(GeneralSettings::tr("Time to retain deleted recordings "
409  "(days)"));
410 
411  bs->setHelpText(GeneralSettings::tr("Determines the maximum number of days "
412  "before undeleting a recording will "
413  "become impossible. A value of zero "
414  "means the recording will be "
415  "permanently deleted between 5 and 20 "
416  "minutes later. A value of minus one "
417  "means recordings will be retained "
418  "until space is required. A recording "
419  "will always be removed before this "
420  "time if the space is needed for a new "
421  "recording."));
422  bs->setValue(0);
423  return bs;
424 };
425 
426 #if 0
427 // If this is ever reactivated, re-add the translations...
428 class DeletedExpireOptions : public TriggeredConfigurationGroup
429 {
430  public:
431  DeletedExpireOptions() :
432  TriggeredConfigurationGroup(false, false, false, false)
433  {
434  setLabel("DeletedExpireOptions");
435  Setting* enabled = AutoExpireInsteadOfDelete();
436  addChild(enabled);
437  setTrigger(enabled);
438 
439  HorizontalConfigurationGroup* settings =
440  new HorizontalConfigurationGroup(false);
441  settings->addChild(DeletedMaxAge());
442  addTarget("1", settings);
443 
444  // show nothing if fillEnabled is off
445  addTarget("0", new HorizontalConfigurationGroup(true));
446  };
447 };
448 #endif
449 
451 {
452  GlobalComboBoxSetting *bc = new GlobalComboBoxSetting("AutoExpireMethod");
453 
454  bc->setLabel(GeneralSettings::tr("Auto-Expire method"));
455 
456  bc->addSelection(GeneralSettings::tr("Oldest show first"), "1");
457  bc->addSelection(GeneralSettings::tr("Lowest priority first"), "2");
458  bc->addSelection(GeneralSettings::tr("Weighted time/priority combination"),
459  "3");
460 
461  bc->setHelpText(GeneralSettings::tr("Method used to determine which "
462  "recorded shows to delete first. "
463  "Live TV recordings will always "
464  "expire before normal recordings."));
465  bc->setValue(1);
466 
467  return bc;
468 }
469 
471 {
472  GlobalCheckBoxSetting *bc = new GlobalCheckBoxSetting("AutoExpireWatchedPriority");
473 
474  bc->setLabel(GeneralSettings::tr("Watched before unwatched"));
475 
476  bc->setValue(false);
477 
478  bc->setHelpText(GeneralSettings::tr("If enabled, programs that have been "
479  "marked as watched will be expired "
480  "before programs that have not "
481  "been watched."));
482  return bc;
483 }
484 
486 {
487  GlobalSpinBoxSetting *bs = new GlobalSpinBoxSetting("AutoExpireDayPriority", 1, 400, 1);
488 
489  bs->setLabel(GeneralSettings::tr("Priority weight"));
490 
491  bs->setHelpText(GeneralSettings::tr("The number of days bonus a program "
492  "gets for each priority point. This "
493  "is only used when the Weighted "
494  "time/priority Auto-Expire method "
495  "is selected."));
496  bs->setValue(3);
497 
498  return bs;
499 };
500 
502 {
503  GlobalSpinBoxSetting *bs = new GlobalSpinBoxSetting("AutoExpireLiveTVMaxAge", 1, 365, 1);
504 
505  bs->setLabel(GeneralSettings::tr("Live TV max age (days)"));
506 
507  bs->setHelpText(GeneralSettings::tr("Auto-Expire will force expiration of "
508  "Live TV recordings when they are this "
509  "many days old. Live TV recordings may "
510  "also be expired early if necessary to "
511  "free up disk space."));
512  bs->setValue(1);
513 
514  return bs;
515 };
516 
517 #if 0
518 // Translations have been removed, please put back if reactivated...
519 static GlobalSpinBoxSetting *MinRecordDiskThreshold()
520 {
521  GlobalSpinBoxSetting *bs = new GlobalSpinBoxSetting("MinRecordDiskThreshold",
522  0, 1000000, 100);
523  bs->setLabel("New recording free disk space threshold "
524  "(MB)");
525  bs->setHelpText("MythTV will stop scheduling new recordings on "
526  "a backend when its free disk space (in megabytes) falls "
527  "below this value.");
528  bs->setValue(300);
529  return bs;
530 }
531 #endif
532 
534 {
535  GlobalCheckBoxSetting *bc = new GlobalCheckBoxSetting("RerecordWatched");
536 
537  bc->setLabel(GeneralSettings::tr("Re-record watched"));
538 
539  bc->setValue(false);
540 
541  bc->setHelpText(GeneralSettings::tr("If enabled, programs that have been "
542  "marked as watched and are "
543  "Auto-Expired will be re-recorded if "
544  "they are shown again."));
545  return bc;
546 }
547 
549 {
550  GlobalSpinBoxSetting *bs = new GlobalSpinBoxSetting("RecordPreRoll", 0, 600, 60, true);
551 
552  bs->setLabel(GeneralSettings::tr("Time to record before start of show "
553  "(secs)"));
554 
555  bs->setHelpText(GeneralSettings::tr("This global setting allows the "
556  "recorder to start before the "
557  "scheduled start time. It does not "
558  "affect the scheduler. It is ignored "
559  "when two shows have been scheduled "
560  "without enough time in between."));
561  bs->setValue(0);
562 
563  return bs;
564 }
565 
567 {
568  GlobalSpinBoxSetting *bs = new GlobalSpinBoxSetting("RecordOverTime", 0, 1800, 60, true);
569 
570  bs->setLabel(GeneralSettings::tr("Time to record past end of show (secs)"));
571 
572  bs->setValue(0);
573 
574  bs->setHelpText(GeneralSettings::tr("This global setting allows the "
575  "recorder to record beyond the "
576  "scheduled end time. It does not "
577  "affect the scheduler. It is ignored "
578  "when two shows have been scheduled "
579  "without enough time in between."));
580  return bs;
581 }
582 
584 {
585  GlobalComboBoxSetting *gc = new GlobalComboBoxSetting("OverTimeCategory");
586 
587  gc->setLabel(GeneralSettings::tr("Category of shows to be extended"));
588 
589  gc->setHelpText(GeneralSettings::tr("For a special category (e.g. "
590  "\"Sports event\"), request that "
591  "shows be autoextended. Only works "
592  "if a show's category can be "
593  "determined."));
594 
595  MSqlQuery query(MSqlQuery::InitCon());
596 
597  query.prepare("SELECT DISTINCT category FROM program GROUP BY category;");
598 
599  gc->addSelection("", "");
600  if (query.exec())
601  {
602  while (query.next())
603  {
604  QString key = query.value(0).toString();
605  if (!key.trimmed().isEmpty())
606  gc->addSelection(key, key);
607  }
608  }
609 
610  return gc;
611 }
612 
614 {
615  GlobalSpinBoxSetting *bs = new GlobalSpinBoxSetting("CategoryOverTime",
616  0, 180, 60, true);
617 
618  bs->setLabel(GeneralSettings::tr("Record past end of show (mins)"));
619 
620  bs->setValue(30);
621 
622  bs->setHelpText(GeneralSettings::tr("For the specified category, an "
623  "attempt will be made to extend "
624  "the recording by the specified "
625  "number of minutes. It is ignored "
626  "when two shows have been scheduled "
627  "without enough time in-between."));
628  return bs;
629 }
630 
632 {
633  GroupSetting *vcg = new GroupSetting();
634 
635  vcg->setLabel(GeneralSettings::tr("Category record over-time"));
636 
637  vcg->addChild(OverTimeCategory());
638  vcg->addChild(CategoryOverTime());
639 
640  return vcg;
641 }
642 
644  PlaybackProfileConfig *parent, uint idx, ProfileItem &_item) :
645  item(_item), parentConfig(parent), index(idx)
646 {
652  max_cpus = new TransMythUISpinBoxSetting(1, HAVE_THREADS ? 4 : 1, 1, true);
660 
661  const QString rangeHelp(tr(" Valid formats for the setting are "
662  "[nnnn - nnnn], [> nnnn], [>= nnnn], [< nnnn], "
663  "[<= nnnn]. Also [nnnn] for an exact match. "
664  "You can also use more than 1 expression with & between."));
665  const QString rangeHelpDec(tr("Numbers can have up to 3 decimal places."));
666  width_range->setLabel(tr("Width Range"));
667  width_range->setHelpText(tr("Optional setting to restrict this profile "
668  "to videos with a selected width range. ") + rangeHelp);
669  height_range->setLabel(tr("Height Range"));
670  height_range->setHelpText(tr("Optional setting to restrict this profile "
671  "to videos with a selected height range. ") + rangeHelp);
672  codecs->setLabel(tr("Video Formats"));
673  codecs->addSelection("","",true);
674  codecs->addSelection("mpeg2video");
675  codecs->addSelection("mpeg4");
676  codecs->addSelection("h264");
677  codecs->addSelection("hevc");
678  codecs->setHelpText(tr("Optional setting to restrict this profile "
679  "to a video format or formats. You can also type in a format "
680  "or several formats separated by space. "
681  "To find the format for a video use ffprobe and look at the "
682  "word after \"Video:\". Also you can get a complete list "
683  "of available formats with ffmpeg -codecs."));
684  framerate->setLabel(tr("Frame Rate Range"));
685  framerate->setHelpText(tr("Optional setting to restrict this profile "
686  "to a range of frame rates. ") + rangeHelp +" "+rangeHelpDec);
687  decoder->setLabel(tr("Decoder"));
688  max_cpus->setLabel(tr("Max CPUs"));
689  skiploop->setLabel(tr("Deblocking filter"));
690  vidrend->setLabel(tr("Video renderer"));
691  osdrend->setLabel(tr("OSD renderer"));
692  osdfade->setLabel(tr("OSD fade"));
693  deint0->setLabel(tr("Primary deinterlacer"));
694  deint1->setLabel(tr("Fallback deinterlacer"));
695  filters->setLabel(tr("Custom filters"));
696 
698  tr("Maximum number of CPU cores used for video decoding and filtering.") +
699  (HAVE_THREADS ? "" :
700  tr(" Multithreaded decoding disabled-only one CPU "
701  "will be used, please recompile with "
702  "--enable-ffmpeg-pthreads to enable.")));
703 
705  tr("Example custom filter list: 'ivtc,denoise3d'"));
706 
708  tr("When unchecked the deblocking loopfilter will be disabled ") + "\n" +
709  tr("Disabling will significantly reduce the load on the CPU "
710  "when watching HD H.264 but may significantly reduce video quality."));
711 
713  tr("When unchecked the OSD will not fade away but instead "
714  "will disappear abruptly.") + '\n' +
715  tr("Uncheck this if the video studders while the OSD is "
716  "fading away."));
717 
720  addChild(codecs);
722  addChild(decoder);
725  addChild(vidrend);
726  addChild(osdrend);
727  addChild(osdfade);
728 
729  addChild(deint0);
730  addChild(deint1);
731  addChild(filters);
732 
733  connect(width_range, SIGNAL(valueChanged(const QString&)),
734  this, SLOT(widthChanged(const QString&)));
735  connect(height_range, SIGNAL(valueChanged(const QString&)),
736  this, SLOT(heightChanged(const QString&)));
737  connect(codecs, SIGNAL(valueChanged(const QString&)),
738  this, SLOT(InitLabel()));
739  connect(framerate, SIGNAL(valueChanged(const QString&)),
740  this, SLOT(framerateChanged(const QString&)));
741  connect(decoder, SIGNAL(valueChanged(const QString&)),
742  this, SLOT(decoderChanged(const QString&)));
743  connect(vidrend, SIGNAL(valueChanged(const QString&)),
744  this, SLOT(vrenderChanged(const QString&)));
745  connect(osdrend, SIGNAL(valueChanged(const QString&)),
746  this, SLOT(orenderChanged(const QString&)));
747  connect(deint0, SIGNAL(valueChanged(const QString&)),
748  this, SLOT(deint0Changed(const QString&)));
749  connect(deint1, SIGNAL(valueChanged(const QString&)),
750  this, SLOT(deint1Changed(const QString&)));
751 }
752 
754 {
755  return index;
756 }
757 
759 {
760  QString width_value;
761  QString height_value;
762  // pref_cmp0 and pref_cmp1 are no longer used. This code
763  // is here to convery them to the new settings cond_width
764  // and cond_height
765  for (uint i = 0; i < 2; ++i)
766  {
767  QString pcmp = item.Get(QString("pref_cmp%1").arg(i));
768  if (pcmp == "> 0 0")
769  continue;
770  QStringList clist = pcmp.split(" ");
771 
772  if (clist.size() < 3)
773  continue;
774  if (!width_value.isEmpty())
775  {
776  width_value.append("&");
777  height_value.append("&");
778  }
779  width_value.append(clist[0]+clist[1]);
780  height_value.append(clist[0]+clist[2]);
781  }
782 
783  QString tmp = item.Get("cond_width").trimmed();
784  if (!tmp.isEmpty())
785  {
786  if (!width_value.isEmpty())
787  width_value.append("&");
788  width_value.append(tmp);
789  }
790  tmp = item.Get("cond_height").trimmed();
791  if (!tmp.isEmpty())
792  {
793  if (!height_value.isEmpty())
794  height_value.append("&");
795  height_value.append(tmp);
796  }
797 
798  width_range->setValue(width_value);
799  height_range->setValue(height_value);
800  codecs->setValue(item.Get("cond_codecs"));
801  framerate->setValue(item.Get("cond_framerate"));
802 
803  QString pdecoder = item.Get("pref_decoder");
804  QString pmax_cpus = item.Get("pref_max_cpus");
805  QString pskiploop = item.Get("pref_skiploop");
806  QString prenderer = item.Get("pref_videorenderer");
807  QString posd = item.Get("pref_osdrenderer");
808  QString posdfade = item.Get("pref_osdfade");
809  QString pdeint0 = item.Get("pref_deint0");
810  QString pdeint1 = item.Get("pref_deint1");
811  QString pfilter = item.Get("pref_filters");
812  bool found = false;
813 
814  QString dech = VideoDisplayProfile::GetDecoderHelp();
815  QStringList decr = VideoDisplayProfile::GetDecoders();
816  QStringList decn = VideoDisplayProfile::GetDecoderNames();
817  QStringList::const_iterator itr = decr.begin();
818  QStringList::const_iterator itn = decn.begin();
820  for (; (itr != decr.end()) && (itn != decn.end()); ++itr, ++itn)
821  {
822  decoder->addSelection(*itn, *itr, (*itr == pdecoder));
823  found |= (*itr == pdecoder);
824  }
825  if (!found && !pdecoder.isEmpty())
826  {
828  VideoDisplayProfile::GetDecoderName(pdecoder), pdecoder, true);
829  }
831 
832  if (!pmax_cpus.isEmpty())
833  max_cpus->setValue(pmax_cpus.toUInt());
834 
835  skiploop->setValue((!pskiploop.isEmpty()) ? (bool) pskiploop.toInt() : true);
836 
837  if (!prenderer.isEmpty())
838  vidrend->setValue(prenderer);
839  if (!posd.isEmpty())
840  osdrend->setValue(posd);
841 
842  osdfade->setValue((!posdfade.isEmpty()) ? (bool) posdfade.toInt() : true);
843 
844  if (!pdeint0.isEmpty())
845  deint0->setValue(pdeint0);
846  if (!pdeint1.isEmpty())
847  deint1->setValue(pdeint1);
848  if (!pfilter.isEmpty())
849  filters->setValue(pfilter);
850 
852 }
853 
855 {
856  item.Set("pref_cmp0", QString());
857  item.Set("pref_cmp1", QString());
858  item.Set("cond_width", width_range->getValue());
859  item.Set("cond_height", height_range->getValue());
860  item.Set("cond_codecs", codecs->getValue());
861  item.Set("cond_framerate", framerate->getValue());
862  item.Set("pref_decoder", decoder->getValue());
863  item.Set("pref_max_cpus", max_cpus->getValue());
864  item.Set("pref_skiploop", (skiploop->boolValue()) ? "1" : "0");
865  item.Set("pref_videorenderer", vidrend->getValue());
866  item.Set("pref_osdrenderer", osdrend->getValue());
867  item.Set("pref_osdfade", (osdfade->boolValue()) ? "1" : "0");
868  item.Set("pref_deint0", deint0->getValue());
869  item.Set("pref_deint1", deint1->getValue());
870 
871  QString tmp0 = filters->getValue();
872  QString tmp1 = vidrend->getValue();
873  QString tmp3 = VideoDisplayProfile::IsFilterAllowed(tmp1) ? tmp0 : "";
874  item.Set("pref_filters", tmp3);
875 }
876 
878 {
879  bool ok = true;
880  QString oldvalue = item.Get("cond_width");
881  item.Set("cond_width",val);
882  item.checkRange("cond_width", 640, &ok);
883  if (!ok)
884  {
885  ShowOkPopup(tr("Invalid width specification(%1), discarded").arg(val));
886  width_range->setValue(oldvalue);
887  }
888  InitLabel();
889 }
890 
892 {
893  bool ok = true;
894  QString oldvalue = item.Get("cond_height");
895  item.Set("cond_height",val);
896  item.checkRange("cond_height", 480, &ok);
897  if (!ok)
898  {
899  ShowOkPopup(tr("Invalid height specification(%1), discarded").arg(val));
900  height_range->setValue(oldvalue);
901  }
902  InitLabel();
903 }
904 
906 {
907  bool ok = true;
908  QString oldvalue = item.Get("cond_framerate");
909  item.Set("cond_framerate",val);
910  item.checkRange("cond_framerate", 25.0f, &ok);
911  if (!ok)
912  {
913  ShowOkPopup(tr("Invalid frame rate specification(%1), discarded").arg(val));
914  framerate->setValue(oldvalue);
915  }
916  InitLabel();
917 }
918 
920 {
921  QString vrenderer = vidrend->getValue();
922  QStringList renderers = VideoDisplayProfile::GetVideoRenderers(dec);
923  QStringList::const_iterator it;
924 
925  QString prenderer;
926  for (it = renderers.begin(); it != renderers.end(); ++it)
927  prenderer = (*it == vrenderer) ? vrenderer : prenderer;
928  if (prenderer.isEmpty())
930 
932  for (it = renderers.begin(); it != renderers.end(); ++it)
933  {
934  if ((*it != "null") && (*it != "nullvaapi") && (*it != "nullvdpau"))
935  vidrend->addSelection(*it, *it, (*it == prenderer));
936  }
937 
939 
940  InitLabel();
941 }
942 
943 void PlaybackProfileItemConfig::vrenderChanged(const QString &renderer)
944 {
945  QStringList osds = VideoDisplayProfile::GetOSDs(renderer);
946  QStringList deints = VideoDisplayProfile::GetDeinterlacers(renderer);
947  QString losd = osdrend->getValue();
948  QString ldeint0 = deint0->getValue();
949  QString ldeint1 = deint1->getValue();
950  QStringList::const_iterator it;
951 
953  for (it = osds.begin(); it != osds.end(); ++it)
954  osdrend->addSelection(*it, *it, (*it == losd));
955 
957  for (it = deints.begin(); it != deints.end(); ++it)
958  {
960  *it, (*it == ldeint0));
961  }
962 
964  for (it = deints.begin(); it != deints.end(); ++it)
965  {
966  if (!(*it).contains("bobdeint") && !(*it).contains("doublerate") &&
967  !(*it).contains("doubleprocess"))
969  *it, (*it == ldeint1));
970  }
971 
974 
975  InitLabel();
976 }
977 
978 void PlaybackProfileItemConfig::orenderChanged(const QString &renderer)
979 {
981 }
982 
984 {
986  tr("Main deinterlacing method. %1")
988 }
989 
991 {
993  tr("Fallback deinterlacing method. %1")
995 }
996 
998 {
999  QStringList actions;
1000 
1001  if (GetMythMainWindow()->TranslateKeyPress("Global", e, actions))
1002  return true;
1003 
1004  foreach (const QString &action, actions)
1005  {
1006  if (action == "DELETE")
1007  {
1008  ShowDeleteDialog();
1009  return true;
1010  }
1011  }
1012 
1013  return false;
1014 }
1015 
1017 {
1018  QString message = tr("Remove this profile item?");
1019  MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack");
1020  MythConfirmationDialog *confirmDelete =
1021  new MythConfirmationDialog(popupStack, message, true);
1022 
1023  if (confirmDelete->Create())
1024  {
1025  connect(confirmDelete, SIGNAL(haveResult(bool)),
1026  SLOT(DoDeleteSlot(bool)));
1027  popupStack->AddScreen(confirmDelete);
1028  }
1029  else
1030  delete confirmDelete;
1031 }
1032 
1034 {
1035  if (doDelete)
1037 }
1038 
1040 {
1041  parentConfig->swap(index, index + 1);
1042 }
1043 
1045 {
1046  parentConfig->swap(index, index - 1);
1047 }
1048 
1050  StandardSetting *parent) :
1051  profile_name(profilename),
1052  groupid(0)
1053 {
1054  setVisible(false);
1058  InitUI(parent);
1059 }
1060 
1062 {
1063 }
1064 
1066 {
1067  QString andStr = tr("&", "and");
1068  QString str;
1069 
1070  QString width = width_range->getValue();
1071  if (!width.isEmpty())
1072  str += " " + tr("width","video formats") + " " + width;
1073  QString height = height_range->getValue();
1074  if (!height.isEmpty())
1075  str += " " + tr("height","video formats") + " " + height;
1076 
1077  QString codecsval = codecs->getValue();
1078  if (!codecsval.isEmpty())
1079  str += " " + tr("formats","video formats") + " " + codecsval;
1080  QString framerateval = framerate->getValue();
1081  if (!framerateval.isEmpty())
1082  str += " " + tr("framerate") + " " + framerateval;
1083 
1084  str += " -> ";
1085  str += decoder->getValue();
1086  str += " " + andStr + ' ';
1087  str += vidrend->getValue();
1088  str.replace("-blit", "");
1089  str.replace("ivtv " + andStr + " ivtv", "ivtv");
1090  str.replace("xvmc " + andStr + " xvmc", "xvmc");
1091  str.replace("xvmc", "XvMC");
1092  str.replace("xv", "XVideo");
1093 
1094  setLabel(str);
1095 }
1096 
1098 {
1100  m_markForDeletion->setLabel(tr("Mark for deletion"));
1101  m_addNewEntry = new ButtonStandardSetting(tr("Add New Entry"));
1102 
1105 
1106  connect(m_addNewEntry, SIGNAL(clicked()), SLOT(AddNewEntry()));
1107 
1108  for (uint i = 0; i < items.size(); ++i)
1109  InitProfileItem(i, parent);
1110 }
1111 
1113  uint i, StandardSetting *parent)
1114 {
1116  new PlaybackProfileItemConfig(this, i, items[i]);
1117 
1118  items[i].Set("pref_priority", QString::number(i + 1));
1119 
1120  parent->addTargetedChild(profile_name, ppic);
1121  m_profiles.push_back(ppic);
1122  return ppic;
1123 }
1124 
1126 {
1128  {
1131  return;
1132  }
1133 
1135  {
1136  profile->Save();
1137  }
1138 
1140  if (!ok)
1141  {
1142  LOG(VB_GENERAL, LOG_ERR,
1143  "PlaybackProfileConfig::Save() -- failed to delete items");
1144  return;
1145  }
1146 
1148  if (!ok)
1149  {
1150  LOG(VB_GENERAL, LOG_ERR,
1151  "PlaybackProfileConfig::Save() -- failed to save items");
1152  return;
1153  }
1154 }
1155 
1157  PlaybackProfileItemConfig *profileToDelete)
1158 {
1160  {
1161  profile->Save();
1162  }
1163 
1164  uint i = profileToDelete->GetIndex();
1165  del_items.push_back(items[i]);
1166  items.erase(items.begin() + i);
1167 
1168  ReloadSettings();
1169 }
1170 
1172 {
1174  {
1175  profile->Save();
1176  }
1177 
1178  ProfileItem item;
1179 
1180  items.push_back(item);
1181 
1182  ReloadSettings();
1183 }
1184 
1186 {
1189 
1190  foreach (StandardSetting *setting, m_profiles)
1191  {
1193  }
1194  m_profiles.clear();
1195 
1196  InitUI(getParent());
1197 
1198  foreach (StandardSetting *setting, m_profiles)
1199  {
1200  setting->Load();
1201  }
1202 
1203  emit getParent()->settingsChanged();
1204  setChanged(true);
1205 }
1206 
1208 {
1210  {
1211  profile->Save();
1212  }
1213 
1214  QString pri_i = QString::number(items[i].GetPriority());
1215  QString pri_j = QString::number(items[j].GetPriority());
1216 
1217  ProfileItem item = items[j];
1218  items[j] = items[i];
1219  items[i] = item;
1220 
1221  items[i].Set("pref_priority", pri_i);
1222  items[j].Set("pref_priority", pri_j);
1223 
1224  ReloadSettings();
1225 }
1226 
1228 {
1229  HostComboBoxSetting *grouptrigger =
1230  new HostComboBoxSetting("DefaultVideoPlaybackProfile");
1231  grouptrigger->setLabel(
1232  QCoreApplication::translate("PlaybackProfileConfigs",
1233  "Current Video Playback Profile"));
1234 
1235  QString host = gCoreContext->GetHostName();
1237  QStringList profiles = VideoDisplayProfile::GetProfiles(host);
1238 
1240  if (!profiles.contains(profile))
1241  {
1242  profile = (profiles.contains("Normal")) ? "Normal" : profiles[0];
1244  }
1245 
1246  QStringList::const_iterator it;
1247  for (it = profiles.begin(); it != profiles.end(); ++it)
1248  {
1249  grouptrigger->addSelection(ProgramInfo::i18n(*it), *it);
1250  grouptrigger->addTargetedChild(*it,
1251  new PlaybackProfileConfig(*it, grouptrigger));
1252  }
1253 
1254  return grouptrigger;
1255 }
1256 
1258 {
1259  QString msg = tr("Enter Playback Profile Name");
1260 
1261  MythScreenStack *popupStack =
1262  GetMythMainWindow()->GetStack("popup stack");
1263 
1264  MythTextInputDialog *settingdialog =
1265  new MythTextInputDialog(popupStack, msg);
1266 
1267  if (settingdialog->Create())
1268  {
1269  connect(settingdialog, SIGNAL(haveResult(QString)),
1270  SLOT(CreateNewPlaybackProfileSlot(const QString&)));
1271  popupStack->AddScreen(settingdialog);
1272  }
1273  else
1274  delete settingdialog;
1275 }
1276 
1278 {
1279  QString host = gCoreContext->GetHostName();
1280  QStringList not_ok_list = VideoDisplayProfile::GetProfiles(host);
1281 
1282  if (not_ok_list.contains(name) || name.isEmpty())
1283  {
1284  QString msg = (name.isEmpty()) ?
1285  tr("Sorry, playback group\nname cannot be blank.") :
1286  tr("Sorry, playback group name\n"
1287  "'%1' is already being used.").arg(name);
1288 
1289  ShowOkPopup(msg);
1290 
1291  return;
1292  }
1293 
1295  m_playbackProfiles->addTargetedChild(name,
1296  new PlaybackProfileConfig(name, m_playbackProfiles));
1297 
1298  m_playbackProfiles->addSelection(name, name, true);
1299 }
1300 
1302 {
1303  QString str[4] =
1304  {
1305  PlaybackSettings::tr("Sort all sub-titles/multi-titles Ascending"),
1306  PlaybackSettings::tr("Sort all sub-titles/multi-titles Descending"),
1307  PlaybackSettings::tr("Sort sub-titles Descending, multi-titles "
1308  "Ascending"),
1309  PlaybackSettings::tr("Sort sub-titles Ascending, multi-titles Descending"),
1310  };
1311 
1312  QString help = PlaybackSettings::tr("Selects how to sort show episodes. "
1313  "Sub-titles refers to the episodes "
1314  "listed under a specific show title. "
1315  "Multi-title refers to sections (e.g. "
1316  "\"All Programs\") which list multiple "
1317  "titles. Sections in parentheses are "
1318  "not affected.");
1319 
1320  HostComboBoxSetting *gc = new HostComboBoxSetting("PlayBoxOrdering");
1321 
1322  gc->setLabel(PlaybackSettings::tr("Episode sort orderings"));
1323 
1324  for (int i = 0; i < 4; ++i)
1325  gc->addSelection(str[i], QString::number(i));
1326 
1327  gc->setValue(1);
1328  gc->setHelpText(help);
1329 
1330  return gc;
1331 }
1332 
1334 {
1335  HostComboBoxSetting *gc = new HostComboBoxSetting("PlayBoxEpisodeSort");
1336 
1337  gc->setLabel(PlaybackSettings::tr("Sort episodes"));
1338 
1339  gc->addSelection(PlaybackSettings::tr("Record date"), "Date");
1340  gc->addSelection(PlaybackSettings::tr("Season/Episode"), "Season");
1341  gc->addSelection(PlaybackSettings::tr("Original air date"), "OrigAirDate");
1342  gc->addSelection(PlaybackSettings::tr("Program ID"), "Id");
1343 
1344  gc->setHelpText(PlaybackSettings::tr("Selects how to sort a show's "
1345  "episodes"));
1346 
1347  return gc;
1348 }
1349 
1351 {
1352  HostSpinBoxSetting *gs = new HostSpinBoxSetting("FFRewReposTime", 0, 200, 5);
1353 
1354  gs->setLabel(PlaybackSettings::tr("Fast forward/rewind reposition amount"));
1355 
1356  gs->setValue(100);
1357 
1358  gs->setHelpText(PlaybackSettings::tr("When exiting sticky keys fast "
1359  "forward/rewind mode, reposition "
1360  "this many 1/100th seconds before "
1361  "resuming normal playback. This "
1362  "compensates for the reaction time "
1363  "between seeing where to resume "
1364  "playback and actually exiting "
1365  "seeking."));
1366  return gs;
1367 }
1368 
1370 {
1371  HostCheckBoxSetting *gc = new HostCheckBoxSetting("FFRewReverse");
1372 
1373  gc->setLabel(PlaybackSettings::tr("Reverse direction in fast "
1374  "forward/rewind"));
1375 
1376  gc->setValue(true);
1377 
1378  gc->setHelpText(PlaybackSettings::tr("If enabled, pressing the sticky "
1379  "rewind key in fast forward mode "
1380  "switches to rewind mode, and "
1381  "vice versa. If disabled, it will "
1382  "decrease the current speed or "
1383  "switch to play mode if the speed "
1384  "can't be decreased further."));
1385  return gc;
1386 }
1387 
1389 {
1390  HostComboBoxSetting *gc = new HostComboBoxSetting("MenuTheme");
1391 
1392  gc->setLabel(AppearanceSettings::tr("Menu theme"));
1393 
1394  QList<ThemeInfo> themelist = GetMythUI()->GetThemes(THEME_MENU);
1395 
1396  QList<ThemeInfo>::iterator it;
1397  for( it = themelist.begin(); it != themelist.end(); ++it )
1398  {
1399  gc->addSelection((*it).GetName(), (*it).GetDirectoryName(),
1400  (*it).GetDirectoryName() == "defaultmenu");
1401  }
1402 
1403  return gc;
1404 }
1405 
1407 {
1408  QString beVBI = gCoreContext->GetSetting("VbiFormat");
1409  QString fmt = beVBI.toLower().left(4);
1410  int sel = (fmt == "pal ") ? 1 : ((fmt == "ntsc") ? 2 : 0);
1411 
1412  HostComboBoxSetting *gc = new HostComboBoxSetting("DecodeVBIFormat");
1413 
1414  gc->setLabel(OSDSettings::tr("Decode VBI format"));
1415 
1416  gc->addSelection(OSDSettings::tr("None"), "none",
1417  0 == sel);
1418  gc->addSelection(OSDSettings::tr("PAL teletext"), "pal_txt",
1419  1 == sel);
1420  gc->addSelection(OSDSettings::tr("NTSC closed caption"), "ntsc_cc",
1421  2 == sel);
1422 
1423  gc->setHelpText(
1424  OSDSettings::tr("If enabled, this overrides the mythtv-setup setting "
1425  "used during recording when decoding captions."));
1426 
1427  return gc;
1428 }
1429 
1431 {
1432  HostComboBoxSetting *gc = new HostComboBoxSetting("SubtitleCodec");
1433 
1434  gc->setLabel(OSDSettings::tr("Subtitle Codec"));
1435 
1436  QList<QByteArray> list = QTextCodec::availableCodecs();
1437 
1438  for (uint i = 0; i < (uint) list.size(); ++i)
1439  {
1440  QString val = QString(list[i]);
1441  gc->addSelection(val, val, val.toLower() == "utf-8");
1442  }
1443 
1444  return gc;
1445 }
1446 
1448 {
1449  HostComboBoxSetting *gc = new HostComboBoxSetting("ChannelOrdering");
1450 
1451  gc->setLabel(GeneralSettings::tr("Channel ordering"));
1452 
1453  gc->addSelection(GeneralSettings::tr("channel number"), "channum");
1454  gc->addSelection(GeneralSettings::tr("callsign"), "callsign");
1455 
1456  return gc;
1457 }
1458 
1460 {
1461  HostSpinBoxSetting *gs = new HostSpinBoxSetting("VertScanPercentage", -100, 100, 1);
1462 
1463  gs->setLabel(PlaybackSettings::tr("Vertical scaling"));
1464 
1465  gs->setValue(0);
1466 
1467  gs->setHelpText(PlaybackSettings::tr("Adjust this if the image does not "
1468  "fill your screen vertically. Range "
1469  "-100% to 100%"));
1470  return gs;
1471 }
1472 
1474 {
1475  HostSpinBoxSetting *gs = new HostSpinBoxSetting("HorizScanPercentage", -100, 100, 1);
1476 
1477  gs->setLabel(PlaybackSettings::tr("Horizontal scaling"));
1478 
1479  gs->setValue(0);
1480 
1481  gs->setHelpText(PlaybackSettings::tr("Adjust this if the image does not "
1482  "fill your screen horizontally. Range "
1483  "-100% to 100%"));
1484  return gs;
1485 };
1486 
1488 {
1489  HostSpinBoxSetting *gs = new HostSpinBoxSetting("XScanDisplacement", -50, 50, 1);
1490 
1491  gs->setLabel(PlaybackSettings::tr("Scan displacement (X)"));
1492 
1493  gs->setValue(0);
1494 
1495  gs->setHelpText(PlaybackSettings::tr("Adjust this to move the image "
1496  "horizontally."));
1497 
1498  return gs;
1499 }
1500 
1502 {
1503  HostSpinBoxSetting *gs = new HostSpinBoxSetting("YScanDisplacement", -50, 50, 1);
1504 
1505  gs->setLabel(PlaybackSettings::tr("Scan displacement (Y)"));
1506 
1507  gs->setValue(0);
1508 
1509  gs->setHelpText(PlaybackSettings::tr("Adjust this to move the image "
1510  "vertically."));
1511 
1512  return gs;
1513 };
1514 
1516 {
1517  HostCheckBoxSetting *gc = new HostCheckBoxSetting("DefaultCCMode");
1518 
1519  gc->setLabel(OSDSettings::tr("Always display closed captioning or "
1520  "subtitles"));
1521 
1522  gc->setValue(false);
1523 
1524  gc->setHelpText(OSDSettings::tr("If enabled, captions will be displayed "
1525  "when playing back recordings or watching "
1526  "Live TV. Closed Captioning can be turned "
1527  "on or off by pressing \"T\" during"
1528  "playback."));
1529  return gc;
1530 }
1531 
1533 {
1534  HostCheckBoxSetting *gc = new HostCheckBoxSetting("EnableMHEG");
1535 
1536  gc->setLabel(OSDSettings::tr("Enable interactive TV"));
1537 
1538  gc->setValue(false);
1539 
1540  gc->setHelpText(OSDSettings::tr("If enabled, interactive TV applications "
1541  "(MHEG) will be activated. This is used "
1542  "for teletext and logos for radio and "
1543  "channels that are currently off-air."));
1544  return gc;
1545 }
1546 
1548 {
1549  HostCheckBoxSetting *gc = new HostCheckBoxSetting("EnableMHEGic");
1550  gc->setLabel(OSDSettings::tr("Enable network access for interactive TV"));
1551  gc->setValue(true);
1552  gc->setHelpText(OSDSettings::tr("If enabled, interactive TV applications "
1553  "(MHEG) will be able to access interactive "
1554  "content over the Internet. This is used "
1555  "for BBC iPlayer."));
1556  return gc;
1557 }
1558 
1560 {
1561  HostCheckBoxSetting *gc = new HostCheckBoxSetting("PersistentBrowseMode");
1562 
1563  gc->setLabel(OSDSettings::tr("Always use browse mode in Live TV"));
1564 
1565  gc->setValue(true);
1566 
1567  gc->setHelpText(OSDSettings::tr("If enabled, browse mode will "
1568  "automatically be activated whenever "
1569  "you use channel up/down while watching "
1570  "Live TV."));
1571  return gc;
1572 }
1573 
1575 {
1576  HostCheckBoxSetting *gc = new HostCheckBoxSetting("BrowseAllTuners");
1577 
1578  gc->setLabel(OSDSettings::tr("Browse all channels"));
1579 
1580  gc->setValue(false);
1581 
1582  gc->setHelpText(OSDSettings::tr("If enabled, browse mode will show "
1583  "channels on all available recording "
1584  "devices, instead of showing channels "
1585  "on just the current recorder."));
1586  return gc;
1587 }
1588 
1590 {
1591  HostCheckBoxSetting *gc = new HostCheckBoxSetting("ClearSavedPosition");
1592 
1593  gc->setLabel(PlaybackSettings::tr("Clear bookmark on playback"));
1594 
1595  gc->setValue(true);
1596 
1597  gc->setHelpText(PlaybackSettings::tr("If enabled, automatically clear the "
1598  "bookmark on a recording when the "
1599  "recording is played back. If "
1600  "disabled, you can mark the "
1601  "beginning with rewind then save "
1602  "position."));
1603  return gc;
1604 }
1605 
1607 {
1608  HostCheckBoxSetting *gc = new HostCheckBoxSetting("UseProgStartMark");
1609 
1610  gc->setLabel(PlaybackSettings::tr("Playback from start of program"));
1611 
1612  gc->setValue(false);
1613 
1614  gc->setHelpText(PlaybackSettings::tr("If enabled and no bookmark is set, "
1615  "playback starts at the program "
1616  "scheduled start time rather than "
1617  "the beginning of the recording. "
1618  "Useful for automatically skipping "
1619  "'start early' parts of a recording."));
1620  return gc;
1621 }
1622 
1624 {
1625  HostComboBoxSetting *gc = new HostComboBoxSetting("PlaybackExitPrompt");
1626 
1627  gc->setLabel(PlaybackSettings::tr("Action on playback exit"));
1628 
1629  gc->addSelection(PlaybackSettings::tr("Just exit"), "0");
1630  gc->addSelection(PlaybackSettings::tr("Save position and exit"), "2");
1631  gc->addSelection(PlaybackSettings::tr("Always prompt (excluding Live TV)"),
1632  "1");
1633  gc->addSelection(PlaybackSettings::tr("Always prompt (including Live TV)"),
1634  "4");
1635  gc->addSelection(PlaybackSettings::tr("Prompt for Live TV only"), "8");
1636 
1637  gc->setHelpText(PlaybackSettings::tr("If set to prompt, a menu will be "
1638  "displayed when you exit playback "
1639  "mode. The options available will "
1640  "allow you to save your position, "
1641  "delete the recording, or continue "
1642  "watching."));
1643  return gc;
1644 }
1645 
1647 {
1648  HostCheckBoxSetting *gc = new HostCheckBoxSetting("EndOfRecordingExitPrompt");
1649 
1650  gc->setLabel(PlaybackSettings::tr("Prompt at end of recording"));
1651 
1652  gc->setValue(false);
1653 
1654  gc->setHelpText(PlaybackSettings::tr("If enabled, a menu will be displayed "
1655  "allowing you to delete the recording "
1656  "when it has finished playing."));
1657  return gc;
1658 }
1659 
1661 {
1662  HostCheckBoxSetting *gc = new HostCheckBoxSetting("JumpToProgramOSD");
1663 
1664  gc->setLabel(PlaybackSettings::tr("Jump to program OSD"));
1665 
1666  gc->setValue(true);
1667 
1668  gc->setHelpText(PlaybackSettings::tr("Set the choice between viewing the "
1669  "current recording group in the OSD, "
1670  "or showing the 'Watch Recording' "
1671  "screen when 'Jump to Program' is "
1672  "activated. If enabled, the "
1673  "recordings are shown in the OSD"));
1674  return gc;
1675 }
1676 
1678 {
1679  HostCheckBoxSetting *gc = new HostCheckBoxSetting("ContinueEmbeddedTVPlay");
1680 
1681  gc->setLabel(PlaybackSettings::tr("Continue playback when embedded"));
1682 
1683  gc->setValue(false);
1684 
1685  gc->setHelpText(PlaybackSettings::tr("If enabled, TV playback continues "
1686  "when the TV window is embedded in "
1687  "the upcoming program list or "
1688  "recorded list. The default is to "
1689  "pause the recorded show when "
1690  "embedded."));
1691  return gc;
1692 }
1693 
1695 {
1696  HostCheckBoxSetting *gc = new HostCheckBoxSetting("AutomaticSetWatched");
1697 
1698  gc->setLabel(PlaybackSettings::tr("Automatically mark a recording as "
1699  "watched"));
1700 
1701  gc->setValue(false);
1702 
1703  gc->setHelpText(PlaybackSettings::tr("If enabled, when you exit near the "
1704  "end of a recording it will be marked "
1705  "as watched. The automatic detection "
1706  "is not foolproof, so do not enable "
1707  "this setting if you don't want an "
1708  "unwatched recording marked as "
1709  "watched."));
1710  return gc;
1711 }
1712 
1714 {
1715  HostSpinBoxSetting *gs = new HostSpinBoxSetting("LiveTVIdleTimeout", 0, 3600, 1);
1716 
1717  gs->setLabel(PlaybackSettings::tr("Live TV idle timeout (mins)"));
1718 
1719  gs->setValue(0);
1720 
1721  gs->setHelpText(PlaybackSettings::tr("Exit Live TV automatically if left "
1722  "idle for the specified number of "
1723  "minutes. 0 disables the timeout."));
1724  return gs;
1725 }
1726 
1727 // static HostCheckBoxSetting *PlaybackPreview()
1728 // {
1729 // HostCheckBoxSetting *gc = new HostCheckBoxSetting("PlaybackPreview");
1730 //
1731 // gc->setLabel(PlaybackSettings::tr("Display live preview of recordings"));
1732 //
1733 // gc->setValue(true);
1734 //
1735 // gc->setHelpText(PlaybackSettings::tr("If enabled, a preview of the recording "
1736 // "will play in a small window on the \"Watch a "
1737 // "Recording\" menu."));
1738 //
1739 // return gc;
1740 // }
1741 //
1742 // static HostCheckBoxSetting *HWAccelPlaybackPreview()
1743 // {
1744 // HostCheckBoxSetting *gc = new HostCheckBoxSetting("HWAccelPlaybackPreview");
1745 //
1746 // gc->setLabel(PlaybackSettings::tr("Use HW Acceleration for live recording preview"));
1747 //
1748 // gc->setValue(false);
1749 //
1750 // gc->setHelpText(
1751 // PlaybackSettings::tr(
1752 // "If enabled, live recording preview will use hardware "
1753 // "acceleration. The video renderer used is determined by the "
1754 // "selected CPU profile. Disable if playback is sluggish or "
1755 // "causes high CPU load"));
1756 //
1757 // return gc;
1758 // }
1759 
1761 {
1762  HostCheckBoxSetting *gc = new HostCheckBoxSetting("UseVirtualKeyboard");
1763 
1764  gc->setLabel(MainGeneralSettings::tr("Use line edit virtual keyboards"));
1765 
1766  gc->setValue(true);
1767 
1768  gc->setHelpText(MainGeneralSettings::tr("If enabled, you can use a virtual "
1769  "keyboard in MythTV's line edit "
1770  "boxes. To use, hit SELECT (Enter "
1771  "or Space) while a line edit is in "
1772  "focus."));
1773  return gc;
1774 }
1775 
1777 {
1778  HostSpinBoxSetting *gs = new HostSpinBoxSetting("FrontendIdleTimeout", 0, 360, 5);
1779 
1780  gs->setLabel(MainGeneralSettings::tr("Idle time before entering standby "
1781  "mode (minutes)"));
1782 
1783  gs->setValue(90);
1784 
1785  gs->setHelpText(MainGeneralSettings::tr("Number of minutes to wait when "
1786  "the frontend is idle before "
1787  "entering standby mode. Standby "
1788  "mode allows the backend to power "
1789  "down if configured to do so. Any "
1790  "remote or mouse input will cause "
1791  "the countdown to start again "
1792  "and/or exit idle mode. Video "
1793  "playback suspends the countdown. "
1794  "A value of zero prevents the "
1795  "frontend automatically entering "
1796  "standby."));
1797  return gs;
1798 }
1799 
1801 {
1802  HostComboBoxSetting *gc = new HostComboBoxSetting("OverrideExitMenu");
1803 
1804  gc->setLabel(MainGeneralSettings::tr("Customize exit menu options"));
1805 
1806  gc->addSelection(MainGeneralSettings::tr("Default"), "0");
1807  gc->addSelection(MainGeneralSettings::tr("Show quit"), "1");
1808  gc->addSelection(MainGeneralSettings::tr("Show quit and shutdown"), "2");
1809  gc->addSelection(MainGeneralSettings::tr("Show quit, reboot and shutdown"),
1810  "3");
1811  gc->addSelection(MainGeneralSettings::tr("Show shutdown"), "4");
1812  gc->addSelection(MainGeneralSettings::tr("Show reboot"), "5");
1813  gc->addSelection(MainGeneralSettings::tr("Show reboot and shutdown"), "6");
1814  gc->addSelection(MainGeneralSettings::tr("Show standby"), "7");
1815 
1816  gc->setHelpText(
1817  MainGeneralSettings::tr("By default, only remote frontends are shown "
1818  "the shutdown option on the exit menu. Here "
1819  "you can force specific shutdown and reboot "
1820  "options to be displayed."));
1821  return gc;
1822 }
1823 
1825 {
1826  HostTextEditSetting *ge = new HostTextEditSetting("RebootCommand");
1827 
1828  ge->setLabel(MainGeneralSettings::tr("Reboot command"));
1829 
1830  ge->setValue("");
1831 
1832  ge->setHelpText(MainGeneralSettings::tr("Optional. Script to run if you "
1833  "select the reboot option from the "
1834  "exit menu, if the option is "
1835  "displayed. You must configure an "
1836  "exit key to display the exit "
1837  "menu."));
1838  return ge;
1839 }
1840 
1842 {
1843  HostTextEditSetting *ge = new HostTextEditSetting("HaltCommand");
1844 
1845  ge->setLabel(MainGeneralSettings::tr("Halt command"));
1846 
1847  ge->setValue("");
1848 
1849  ge->setHelpText(MainGeneralSettings::tr("Optional. Script to run if you "
1850  "select the shutdown option from "
1851  "the exit menu, if the option is "
1852  "displayed. You must configure an "
1853  "exit key to display the exit "
1854  "menu."));
1855  return ge;
1856 }
1857 
1859 {
1860  HostTextEditSetting *ge = new HostTextEditSetting("LircSocket");
1861 
1862  ge->setLabel(MainGeneralSettings::tr("LIRC daemon socket"));
1863 
1864  /* lircd socket moved from /dev/ to /var/run/lirc/ in lirc 0.8.6 */
1865  QString lirc_socket = "/dev/lircd";
1866 
1867  if (!QFile::exists(lirc_socket))
1868  lirc_socket = "/var/run/lirc/lircd";
1869 
1870  ge->setValue(lirc_socket);
1871 
1872  QString help = MainGeneralSettings::tr("UNIX socket or IP address[:port] "
1873  "to connect in order to communicate "
1874  "with the LIRC Daemon.");
1875  ge->setHelpText(help);
1876 
1877  return ge;
1878 }
1879 
1881 {
1882  HostTextEditSetting *ge = new HostTextEditSetting("ScreenShotPath");
1883 
1884  ge->setLabel(MainGeneralSettings::tr("Screen shot path"));
1885 
1886  ge->setValue("/tmp/");
1887 
1888  ge->setHelpText(MainGeneralSettings::tr("Path to screenshot storage "
1889  "location. Should be writable "
1890  "by the frontend"));
1891 
1892  return ge;
1893 }
1894 
1896 {
1897  HostTextEditSetting *ge = new HostTextEditSetting("SetupPinCode");
1898 
1899  ge->setLabel(MainGeneralSettings::tr("Setup PIN code"));
1900 
1901  ge->setHelpText(MainGeneralSettings::tr("This PIN is used to control "
1902  "access to the setup menus. "
1903  "If you want to use this feature, "
1904  "then setting the value to all "
1905  "numbers will make your life much "
1906  "easier. Set it to blank to "
1907  "disable. If enabled, you will not "
1908  "be able to return to this screen "
1909  "and reset the Setup PIN without "
1910  "first entering the current PIN."));
1911  return ge;
1912 }
1913 
1915 {
1916  HostComboBoxSetting *gc = new HostComboBoxSetting("XineramaScreen", false);
1918 
1919  for (int i=0; i<num; ++i)
1920  gc->addSelection(QString::number(i), QString::number(i));
1921 
1922  gc->addSelection(AppearanceSettings::tr("All"), QString::number(-1));
1923 
1924  gc->setLabel(AppearanceSettings::tr("Display on screen"));
1925 
1926  gc->setValue(0);
1927 
1928  gc->setHelpText(AppearanceSettings::tr("Run on the specified screen or "
1929  "spanning all screens."));
1930  return gc;
1931 }
1932 
1933 
1935 {
1936  HostComboBoxSetting *gc = new HostComboBoxSetting("XineramaMonitorAspectRatio");
1937 
1938  gc->setLabel(AppearanceSettings::tr("Monitor aspect ratio"));
1939 
1940  gc->addSelection(AppearanceSettings::tr("16:9"), "1.7777");
1941  gc->addSelection(AppearanceSettings::tr("16:10"), "1.6");
1942  gc->addSelection(AppearanceSettings::tr("4:3"), "1.3333");
1943 
1944  gc->setHelpText(AppearanceSettings::tr("The aspect ratio of a Xinerama "
1945  "display cannot be queried from "
1946  "the display, so it must be "
1947  "specified."));
1948  return gc;
1949 }
1950 
1952 {
1953  HostComboBoxSetting *gc = new HostComboBoxSetting("LetterboxColour");
1954 
1955  gc->setLabel(PlaybackSettings::tr("Letterboxing color"));
1956 
1957  for (int m = kLetterBoxColour_Black; m < kLetterBoxColour_END; ++m)
1958  gc->addSelection(toString((LetterBoxColour)m), QString::number(m));
1959 
1960  gc->setHelpText(PlaybackSettings::tr("By default MythTV uses black "
1961  "letterboxing to match broadcaster "
1962  "letterboxing, but those with plasma "
1963  "screens may prefer gray to minimize "
1964  "burn-in. Currently only works with "
1965  "XVideo video renderer."));
1966  return gc;
1967 }
1968 
1970 {
1971  HostComboBoxSetting *gc = new HostComboBoxSetting("AspectOverride");
1972 
1973  gc->setLabel(PlaybackSettings::tr("Video aspect override"));
1974 
1975  for (int m = kAspect_Off; m < kAspect_END; ++m)
1976  gc->addSelection(toString((AspectOverrideMode)m), QString::number(m));
1977 
1978  gc->setHelpText(PlaybackSettings::tr("When enabled, these will override "
1979  "the aspect ratio specified by any "
1980  "broadcaster for all video streams."));
1981  return gc;
1982 }
1983 
1985 {
1986  HostComboBoxSetting *gc = new HostComboBoxSetting("AdjustFill");
1987 
1988  gc->setLabel(PlaybackSettings::tr("Zoom"));
1989 
1990  for (int m = kAdjustFill_Off; m < kAdjustFill_END; ++m)
1991  gc->addSelection(toString((AdjustFillMode)m), QString::number(m));
1993  QString::number(kAdjustFill_AutoDetect_DefaultOff));
1995  QString::number(kAdjustFill_AutoDetect_DefaultHalf));
1996 
1997  gc->setHelpText(PlaybackSettings::tr("When enabled, these will apply a "
1998  "predefined zoom to all video "
1999  "playback in MythTV."));
2000  return gc;
2001 }
2002 
2003 // Theme settings
2004 
2006 {
2007  HostSpinBoxSetting *gs = new HostSpinBoxSetting("GuiWidth", 0, 1920, 8, true);
2008 
2009  gs->setLabel(AppearanceSettings::tr("GUI width (pixels)"));
2010 
2011  gs->setValue(0);
2012 
2013  gs->setHelpText(AppearanceSettings::tr("The width of the GUI. Do not make "
2014  "the GUI wider than your actual "
2015  "screen resolution. Set to 0 to "
2016  "automatically scale to "
2017  "fullscreen."));
2018  return gs;
2019 }
2020 
2022 {
2023  HostSpinBoxSetting *gs = new HostSpinBoxSetting("GuiHeight", 0, 1600, 8, true);
2024 
2025  gs->setLabel(AppearanceSettings::tr("GUI height (pixels)"));
2026 
2027  gs->setValue(0);
2028 
2029  gs->setHelpText(AppearanceSettings::tr("The height of the GUI. Do not make "
2030  "the GUI taller than your actual "
2031  "screen resolution. Set to 0 to "
2032  "automatically scale to "
2033  "fullscreen."));
2034  return gs;
2035 }
2036 
2038 {
2039  HostSpinBoxSetting *gs = new HostSpinBoxSetting("GuiOffsetX", -3840, 3840, 32, true);
2040 
2041  gs->setLabel(AppearanceSettings::tr("GUI X offset"));
2042 
2043  gs->setValue(0);
2044 
2045  gs->setHelpText(AppearanceSettings::tr("The horizontal offset where the "
2046  "GUI will be displayed. May only "
2047  "work if run in a window."));
2048  return gs;
2049 }
2050 
2052 {
2053  HostSpinBoxSetting *gs = new HostSpinBoxSetting("GuiOffsetY", -1600, 1600, 8, true);
2054 
2055  gs->setLabel(AppearanceSettings::tr("GUI Y offset"));
2056 
2057  gs->setValue(0);
2058 
2059  gs->setHelpText(AppearanceSettings::tr("The vertical offset where the "
2060  "GUI will be displayed."));
2061  return gs;
2062 }
2063 
2064 #if 0
2065 static HostSpinBoxSetting *DisplaySizeWidth()
2066 {
2067  HostSpinBoxSetting *gs = new HostSpinBoxSetting("DisplaySizeWidth", 0, 10000, 1);
2068 
2069  gs->setLabel(AppearanceSettings::tr("Display size - width"));
2070 
2071  gs->setValue(0);
2072 
2073  gs->setHelpText(AppearanceSettings::tr("Horizontal size of the monitor or TV. Used "
2074  "to calculate the actual aspect ratio of the display. This "
2075  "will override the DisplaySize from the system."));
2076 
2077  return gs;
2078 }
2079 
2080 static HostSpinBoxSetting *DisplaySizeHeight()
2081 {
2082  HostSpinBoxSetting *gs = new HostSpinBoxSetting("DisplaySizeHeight", 0, 10000, 1);
2083 
2084  gs->setLabel(AppearanceSettings::tr("Display size - height"));
2085 
2086  gs->setValue(0);
2087 
2088  gs->setHelpText(AppearanceSettings::tr("Vertical size of the monitor or TV. Used "
2089  "to calculate the actual aspect ratio of the display. This "
2090  "will override the DisplaySize from the system."));
2091 
2092  return gs;
2093 }
2094 #endif
2095 
2097 {
2098  HostCheckBoxSetting *gc = new HostCheckBoxSetting("GuiSizeForTV");
2099 
2100  gc->setLabel(AppearanceSettings::tr("Use GUI size for TV playback"));
2101 
2102  gc->setValue(true);
2103 
2104  gc->setHelpText(AppearanceSettings::tr("If enabled, use the above size for "
2105  "TV, otherwise use full screen."));
2106  return gc;
2107 }
2108 
2109 #if defined(USING_XRANDR) || CONFIG_DARWIN
2111 {
2112  HostCheckBoxSetting *gc = new VideoModeSettings("UseVideoModes");
2113 
2114  gc->setLabel(VideoModeSettings::tr("Separate video modes for GUI and "
2115  "TV playback"));
2116 
2117  gc->setValue(false);
2118 
2119  gc->setHelpText(VideoModeSettings::tr("Switch X Window video modes for TV. "
2120  "Requires \"xrandr\" support."));
2121  return gc;
2122 }
2123 
2125 {
2126  HostSpinBoxSetting *gs =
2127  new HostSpinBoxSetting(QString("VidModeWidth%1").arg(idx),
2128  0, 1920, 16, true);
2129 
2130  gs->setLabel(VideoModeSettings::tr("In X", "Video mode width"));
2131 
2132  gs->setValue(0);
2133 
2134  gs->setHelpText(VideoModeSettings::tr("Horizontal resolution of video "
2135  "which needs a special output "
2136  "resolution."));
2137  return gs;
2138 }
2139 
2141 {
2142  HostSpinBoxSetting *gs =
2143  new HostSpinBoxSetting(QString("VidModeHeight%1").arg(idx),
2144  0, 1080, 16, true);
2145 
2146  gs->setLabel(VideoModeSettings::tr("In Y", "Video mode height"));
2147 
2148  gs->setValue(0);
2149 
2150  gs->setHelpText(VideoModeSettings::tr("Vertical resolution of video "
2151  "which needs a special output "
2152  "resolution."));
2153  return gs;
2154 }
2155 
2157 {
2158  HostComboBoxSetting *gc = new HostComboBoxSetting("GuiVidModeResolution");
2159 
2160  gc->setLabel(VideoModeSettings::tr("GUI"));
2161 
2162  gc->setHelpText(VideoModeSettings::tr("Resolution of screen when not "
2163  "watching a video."));
2164 
2165  const vector<DisplayResScreen> scr = GetVideoModes();
2166  for (uint i=0; i<scr.size(); ++i)
2167  {
2168  int w = scr[i].Width(), h = scr[i].Height();
2169  QString sel = QString("%1x%2").arg(w).arg(h);
2170  gc->addSelection(sel, sel);
2171  }
2172 
2173  // if no resolution setting, set it with a reasonable initial value
2174  if (scr.size() && (gCoreContext->GetSetting("GuiVidModeResolution").isEmpty()))
2175  {
2176  int w = 0, h = 0;
2177  gCoreContext->GetResolutionSetting("GuiVidMode", w, h);
2178  if ((w <= 0) || (h <= 0))
2179  (w = 640), (h = 480);
2180 
2181  DisplayResScreen dscr(w, h, -1, -1, -1.0, 0);
2182  double rate = -1.0;
2183  int i = DisplayResScreen::FindBestMatch(scr, dscr, rate);
2184  gc->setValue((i >= 0) ? i : scr.size()-1);
2185  }
2186 
2187  return gc;
2188 }
2189 
2191 {
2192  QString dhelp = VideoModeSettings::tr("Default screen resolution "
2193  "when watching a video.");
2194  QString ohelp = VideoModeSettings::tr("Screen resolution when watching a "
2195  "video at a specific resolution.");
2196 
2197  QString qstr = (idx<0) ? "TVVidModeResolution" :
2198  QString("TVVidModeResolution%1").arg(idx);
2199  HostComboBoxSetting *gc = new HostComboBoxSetting(qstr);
2200  QString lstr = (idx<0) ? VideoModeSettings::tr("Video output") :
2201  VideoModeSettings::tr("Output");
2202  QString hstr = (idx<0) ? dhelp : ohelp;
2203 
2204  gc->setLabel(lstr);
2205 
2206  gc->setHelpText(hstr);
2207 
2208  const vector<DisplayResScreen> scr = GetVideoModes();
2209 
2210  for (uint i=0; i<scr.size(); ++i)
2211  {
2212  QString sel = QString("%1x%2").arg(scr[i].Width()).arg(scr[i].Height());
2213  gc->addSelection(sel, sel);
2214  }
2215 
2216  return gc;
2217 }
2218 
2220 {
2221  const QString previousValue = getValue();
2222  const bool wasUnchanged = !haveChanged();
2223 
2224  clearSelections();
2225  QString resolution = setting->getValue();
2226  int hz50 = -1, hz60 = -1;
2227  const vector<double> list = GetRefreshRates(resolution);
2228  addSelection(QObject::tr("Auto"), "0");
2229  for (uint i = 0; i < list.size(); ++i)
2230  {
2231  QString sel = QString::number((double) list[i], 'f', 3);
2232  addSelection(sel + " Hz", sel, sel == previousValue);
2233  hz50 = (fabs(50.0 - list[i]) < 0.01) ? i : hz50;
2234  hz60 = (fabs(60.0 - list[i]) < 0.01) ? i : hz60;
2235  }
2236 
2237  // addSelection() will cause setValue() to be called, marking the setting as
2238  // changed even though the previous value might still be available. Mark it
2239  // as unchanged in this case if it wasn't already changed.
2240  if (wasUnchanged && previousValue == getValue())
2241  setChanged(false);
2242  else
2243  {
2244  if ("640x480" == resolution || "720x480" == resolution)
2245  setValue(hz60+1);
2246  if ("640x576" == resolution || "720x576" == resolution)
2247  setValue(hz50+1);
2248  }
2249 
2250  setEnabled(list.size());
2251 }
2252 
2254  const QString &res)
2255 {
2256  QStringList slist = res.split("x");
2257  int w = 0, h = 0;
2258  bool ok0 = false, ok1 = false;
2259  if (2 == slist.size())
2260  {
2261  w = slist[0].toInt(&ok0);
2262  h = slist[1].toInt(&ok1);
2263  }
2264 
2265  DisplayRes *display_res = DisplayRes::GetDisplayRes();
2266  if (display_res && ok0 && ok1)
2267  return display_res->GetRefreshRates(w, h);
2268 
2269  vector<double> list;
2270  return list;
2271 }
2272 
2274 {
2275  QString dhelp = VideoModeSettings::tr("Default refresh rate when watching "
2276  "a video. Leave at \"Auto\" to "
2277  "automatically use the best "
2278  "available");
2279  QString ohelp = VideoModeSettings::tr("Refresh rate when watching a "
2280  "video at a specific resolution. "
2281  "Leave at \"Auto\" to automatically "
2282  "use the best available");
2283 
2284  QString qstr = (idx<0) ? "TVVidModeRefreshRate" :
2285  QString("TVVidModeRefreshRate%1").arg(idx);
2288  QString lstr = VideoModeSettings::tr("Rate");
2289  QString hstr = (idx<0) ? dhelp : ohelp;
2290 
2291  gc->setLabel(lstr);
2292  gc->setHelpText(hstr);
2293  gc->setEnabled(false);
2294  return gc;
2295 }
2296 
2298 {
2299  QString dhelp = VideoModeSettings::tr("Aspect ratio when watching a "
2300  "video. Leave at \"%1\" to "
2301  "use ratio reported by the monitor. "
2302  "Set to 16:9 or 4:3 to force a "
2303  "specific aspect ratio.");
2304 
2305 
2306 
2307  QString ohelp = VideoModeSettings::tr("Aspect ratio when watching a "
2308  "video at a specific resolution. "
2309  "Leave at \"%1\" to use ratio "
2310  "reported by the monitor. Set to "
2311  "16:9 or 4:3 to force a specific "
2312  "aspect ratio.");
2313 
2314  QString qstr = (idx<0) ? "TVVidModeForceAspect" :
2315  QString("TVVidModeForceAspect%1").arg(idx);
2316 
2317  HostComboBoxSetting *gc = new HostComboBoxSetting(qstr);
2318 
2319  gc->setLabel(VideoModeSettings::tr("Aspect"));
2320 
2321  QString hstr = (idx<0) ? dhelp : ohelp;
2322 
2323  gc->setHelpText(hstr.arg(VideoModeSettings::tr("Default")));
2324 
2325  gc->addSelection(VideoModeSettings::tr("Default"), "0.0");
2326  gc->addSelection("16:9", "1.77777777777");
2327  gc->addSelection("4:3", "1.33333333333");
2328 
2329  return gc;
2330 }
2331 
2333 {
2335  item->setDrawArrow(getValue() == "1");
2336 }
2337 
2339 {
2342 
2344  addChild(res);
2345  addChild(rate);
2347  connect(res, SIGNAL(valueChanged(StandardSetting *)),
2348  rate, SLOT(ChangeResolution(StandardSetting *)));
2349 
2350  GroupSetting* overrides = new GroupSetting();
2351 
2352  overrides->setLabel(tr("Overrides for specific video sizes"));
2353 
2354  for (int idx = 0; idx < 3; ++idx)
2355  {
2356  //input side
2357  overrides->addChild(VidModeWidth(idx));
2358  overrides->addChild(VidModeHeight(idx));
2359  // output side
2360  overrides->addChild(res = TVVidModeResolution(idx));
2361  overrides->addChild(rate = TVVidModeRefreshRate(idx));
2362  overrides->addChild(TVVidModeForceAspect(idx));
2363 
2364  connect(res, SIGNAL(valueChanged(StandardSetting *)),
2365  rate, SLOT(ChangeResolution(StandardSetting *)));
2366  }
2367 
2368  addChild(overrides);
2369 };
2370 #endif
2371 
2373 {
2374  HostCheckBoxSetting *gc = new HostCheckBoxSetting("HideMouseCursor");
2375 
2376  gc->setLabel(AppearanceSettings::tr("Hide mouse cursor in MythTV"));
2377 
2378  gc->setValue(false);
2379 
2380  gc->setHelpText(AppearanceSettings::tr("Toggles mouse cursor visibility "
2381  "for touchscreens. By default "
2382  "MythTV will auto-hide the cursor "
2383  "if the mouse doesn't move for a "
2384  "period, this setting disables the "
2385  "cursor entirely."));
2386  return gc;
2387 };
2388 
2389 
2391 {
2392  HostCheckBoxSetting *gc = new HostCheckBoxSetting("RunFrontendInWindow");
2393 
2394  gc->setLabel(AppearanceSettings::tr("Use window border"));
2395 
2396  gc->setValue(false);
2397 
2398  gc->setHelpText(AppearanceSettings::tr("Toggles between windowed and "
2399  "borderless operation."));
2400  return gc;
2401 }
2402 
2404 {
2405  HostCheckBoxSetting *gc = new HostCheckBoxSetting("UseFixedWindowSize");
2406 
2407  gc->setLabel(AppearanceSettings::tr("Use fixed window size"));
2408 
2409  gc->setValue(true);
2410 
2411  gc->setHelpText(AppearanceSettings::tr("If disabled, the video playback "
2412  "window can be resized"));
2413  return gc;
2414 }
2415 
2417 {
2418  HostCheckBoxSetting *gc = new HostCheckBoxSetting("AlwaysOnTop");
2419 
2420  gc->setLabel(AppearanceSettings::tr("Always On Top"));
2421 
2422  gc->setValue(false);
2423 
2424  gc->setHelpText(AppearanceSettings::tr("If enabled, MythTV will always be "
2425  "on top"));
2426  return gc;
2427 }
2428 
2430 {
2431  HostComboBoxSetting *gc = new HostComboBoxSetting("DateFormat");
2432  gc->setLabel(AppearanceSettings::tr("Date format"));
2433 
2434  QDate sampdate = MythDate::current().toLocalTime().date();
2435  QString sampleStr = AppearanceSettings::tr("Samples are shown using "
2436  "today's date.");
2437 
2438  if (sampdate.month() == sampdate.day())
2439  {
2440  sampdate = sampdate.addDays(1);
2441  sampleStr = AppearanceSettings::tr("Samples are shown using "
2442  "tomorrow's date.");
2443  }
2444 
2445  QLocale locale = gCoreContext->GetQLocale();
2446 
2447  gc->addSelection(locale.toString(sampdate, "ddd MMM d"), "ddd MMM d");
2448  gc->addSelection(locale.toString(sampdate, "ddd d MMM"), "ddd d MMM");
2449  gc->addSelection(locale.toString(sampdate, "ddd MMMM d"), "ddd MMMM d");
2450  gc->addSelection(locale.toString(sampdate, "ddd d MMMM"), "ddd d MMMM");
2451  gc->addSelection(locale.toString(sampdate, "dddd MMM d"), "dddd MMM d");
2452  gc->addSelection(locale.toString(sampdate, "dddd d MMM"), "dddd d MMM");
2453  gc->addSelection(locale.toString(sampdate, "MMM d"), "MMM d");
2454  gc->addSelection(locale.toString(sampdate, "d MMM"), "d MMM");
2455  gc->addSelection(locale.toString(sampdate, "MM/dd"), "MM/dd");
2456  gc->addSelection(locale.toString(sampdate, "dd/MM"), "dd/MM");
2457  gc->addSelection(locale.toString(sampdate, "MM.dd"), "MM.dd");
2458  gc->addSelection(locale.toString(sampdate, "dd.MM"), "dd.MM");
2459  gc->addSelection(locale.toString(sampdate, "M/d/yyyy"), "M/d/yyyy");
2460  gc->addSelection(locale.toString(sampdate, "d/M/yyyy"), "d/M/yyyy");
2461  gc->addSelection(locale.toString(sampdate, "MM.dd.yyyy"), "MM.dd.yyyy");
2462  gc->addSelection(locale.toString(sampdate, "dd.MM.yyyy"), "dd.MM.yyyy");
2463  gc->addSelection(locale.toString(sampdate, "yyyy-MM-dd"), "yyyy-MM-dd");
2464  gc->addSelection(locale.toString(sampdate, "ddd MMM d yyyy"), "ddd MMM d yyyy");
2465  gc->addSelection(locale.toString(sampdate, "ddd d MMM yyyy"), "ddd d MMM yyyy");
2466  gc->addSelection(locale.toString(sampdate, "ddd yyyy-MM-dd"), "ddd yyyy-MM-dd");
2467 
2468  QString cn_long = QString("dddd yyyy") + QChar(0x5E74) +
2469  "M" + QChar(0x6708) + "d"+ QChar(0x65E5); // dddd yyyy年M月d日
2470  gc->addSelection(locale.toString(sampdate, cn_long), cn_long);
2471  QString cn_med = QString("dddd ") +
2472  "M" + QChar(0x6708) + "d"+ QChar(0x65E5); // dddd M月d日
2473 
2474  gc->addSelection(locale.toString(sampdate, cn_med), cn_med);
2475 
2476  //: %1 gives additional information regarding the date format
2477  gc->setHelpText(AppearanceSettings::tr("Your preferred date format. %1")
2478  .arg(sampleStr));
2479 
2480  return gc;
2481 }
2482 
2484 {
2485  HostComboBoxSetting *gc = new HostComboBoxSetting("ShortDateFormat");
2486  gc->setLabel(AppearanceSettings::tr("Short date format"));
2487 
2488  QDate sampdate = MythDate::current().toLocalTime().date();
2489 
2490  QString sampleStr = AppearanceSettings::tr("Samples are shown using "
2491  "today's date.");
2492 
2493  if (sampdate.month() == sampdate.day())
2494  {
2495  sampdate = sampdate.addDays(1);
2496  sampleStr = AppearanceSettings::tr("Samples are shown using "
2497  "tomorrow's date.");
2498  }
2499  QLocale locale = gCoreContext->GetQLocale();
2500 
2501  gc->addSelection(locale.toString(sampdate, "M/d"), "M/d");
2502  gc->addSelection(locale.toString(sampdate, "d/M"), "d/M");
2503  gc->addSelection(locale.toString(sampdate, "MM/dd"), "MM/dd");
2504  gc->addSelection(locale.toString(sampdate, "dd/MM"), "dd/MM");
2505  gc->addSelection(locale.toString(sampdate, "MM.dd"), "MM.dd");
2506  gc->addSelection(locale.toString(sampdate, "dd.MM."), "dd.MM.");
2507  gc->addSelection(locale.toString(sampdate, "M.d."), "M.d.");
2508  gc->addSelection(locale.toString(sampdate, "d.M."), "d.M.");
2509  gc->addSelection(locale.toString(sampdate, "MM-dd"), "MM-dd");
2510  gc->addSelection(locale.toString(sampdate, "dd-MM"), "dd-MM");
2511  gc->addSelection(locale.toString(sampdate, "MMM d"), "MMM d");
2512  gc->addSelection(locale.toString(sampdate, "d MMM"), "d MMM");
2513  gc->addSelection(locale.toString(sampdate, "ddd d"), "ddd d");
2514  gc->addSelection(locale.toString(sampdate, "d ddd"), "d ddd");
2515  gc->addSelection(locale.toString(sampdate, "ddd M/d"), "ddd M/d");
2516  gc->addSelection(locale.toString(sampdate, "ddd d/M"), "ddd d/M");
2517  gc->addSelection(locale.toString(sampdate, "ddd d.M"), "ddd d.M");
2518  gc->addSelection(locale.toString(sampdate, "ddd dd.MM"), "ddd dd.MM");
2519  gc->addSelection(locale.toString(sampdate, "M/d ddd"), "M/d ddd");
2520  gc->addSelection(locale.toString(sampdate, "d/M ddd"), "d/M ddd");
2521 
2522  QString cn_short1 = QString("M") + QChar(0x6708) + "d" + QChar(0x65E5); // M月d日
2523 
2524  gc->addSelection(locale.toString(sampdate, cn_short1), cn_short1);
2525 
2526  QString cn_short2 = QString("ddd M") + QChar(0x6708) + "d" + QChar(0x65E5); // ddd M月d日
2527 
2528  gc->addSelection(locale.toString(sampdate, cn_short2), cn_short2);
2529 
2530  //: %1 gives additional information regarding the date format
2531  gc->setHelpText(AppearanceSettings::tr("Your preferred short date format. %1")
2532  .arg(sampleStr));
2533  return gc;
2534 }
2535 
2537 {
2538  HostComboBoxSetting *gc = new HostComboBoxSetting("TimeFormat");
2539 
2540  gc->setLabel(AppearanceSettings::tr("Time format"));
2541 
2542  QTime samptime = QTime::currentTime();
2543 
2544  QLocale locale = gCoreContext->GetQLocale();
2545 
2546  gc->addSelection(locale.toString(samptime, "h:mm AP"), "h:mm AP");
2547  gc->addSelection(locale.toString(samptime, "h:mm ap"), "h:mm ap");
2548  gc->addSelection(locale.toString(samptime, "hh:mm AP"), "hh:mm AP");
2549  gc->addSelection(locale.toString(samptime, "hh:mm ap"), "hh:mm ap");
2550  gc->addSelection(locale.toString(samptime, "h:mm"), "h:mm");
2551  gc->addSelection(locale.toString(samptime, "hh:mm"), "hh:mm");
2552  gc->addSelection(locale.toString(samptime, "hh.mm"), "hh.mm");
2553  gc->addSelection(locale.toString(samptime, "AP h:mm"), "AP h:mm");
2554 
2555  gc->setHelpText(AppearanceSettings::tr("Your preferred time format. You "
2556  "must choose a format with \"AM\" "
2557  "or \"PM\" in it, otherwise your "
2558  "time display will be 24-hour or "
2559  "\"military\" time."));
2560  return gc;
2561 }
2562 
2563 #if ! CONFIG_DARWIN
2565 {
2566  HostComboBoxSetting *gc = new HostComboBoxSetting("ThemePainter");
2567 
2568  gc->setLabel(AppearanceSettings::tr("Paint engine"));
2569 
2570  gc->addSelection(QCoreApplication::translate("(Common)", "Auto", "Automatic"),
2571  AUTO_PAINTER);
2572 #ifdef _WIN32
2573  gc->addSelection(QCoreApplication::translate("(Common)", "Direct3D"),
2574  D3D9_PAINTER);
2575 #endif
2576 #if defined USING_OPENGL && ! defined USING_OPENGLES
2577  gc->addSelection(QCoreApplication::translate("(Common)", "OpenGL 2"),
2578  OPENGL2_PAINTER);
2579  gc->addSelection(QCoreApplication::translate("(Common)", "OpenGL 1"),
2580  OPENGL_PAINTER);
2581 #endif
2582  gc->addSelection(QCoreApplication::translate("(Common)", "Qt"), QT_PAINTER);
2583  gc->setHelpText(
2584  AppearanceSettings::tr("This selects what MythTV uses to draw. "
2585  "Choosing '%1' is recommended, unless running "
2586  "on systems with broken OpenGL implementations "
2587  "(broken hardware or drivers or windowing "
2588  "systems) where only Qt works.")
2589  .arg(QCoreApplication::translate("(Common)", "Auto", "Automatic")));
2590 
2591  return gc;
2592 }
2593 #endif
2594 
2596 {
2597  HostComboBoxSetting *gc = new HostComboBoxSetting("ChannelFormat");
2598 
2599  gc->setLabel(GeneralSettings::tr("Channel format"));
2600 
2601  gc->addSelection(GeneralSettings::tr("number"), "<num>");
2602  gc->addSelection(GeneralSettings::tr("number callsign"), "<num> <sign>");
2603  gc->addSelection(GeneralSettings::tr("number name"), "<num> <name>");
2604  gc->addSelection(GeneralSettings::tr("callsign"), "<sign>");
2605  gc->addSelection(GeneralSettings::tr("name"), "<name>");
2606 
2607  gc->setHelpText(GeneralSettings::tr("Your preferred channel format."));
2608 
2609  gc->setValue(1);
2610 
2611  return gc;
2612 }
2613 
2615 {
2616  HostComboBoxSetting *gc = new HostComboBoxSetting("LongChannelFormat");
2617 
2618  gc->setLabel(GeneralSettings::tr("Long channel format"));
2619 
2620  gc->addSelection(GeneralSettings::tr("number"), "<num>");
2621  gc->addSelection(GeneralSettings::tr("number callsign"), "<num> <sign>");
2622  gc->addSelection(GeneralSettings::tr("number name"), "<num> <name>");
2623  gc->addSelection(GeneralSettings::tr("callsign"), "<sign>");
2624  gc->addSelection(GeneralSettings::tr("name"), "<name>");
2625 
2626  gc->setHelpText(GeneralSettings::tr("Your preferred long channel format."));
2627 
2628  gc->setValue(2);
2629 
2630  return gc;
2631 }
2632 
2634 {
2635  HostCheckBoxSetting *gc = new HostCheckBoxSetting("ChannelGroupRememberLast");
2636 
2637  gc->setLabel(ChannelGroupSettings::tr("Remember last channel group"));
2638 
2639  gc->setHelpText(ChannelGroupSettings::tr("If enabled, the EPG will "
2640  "initially display only the "
2641  "channels from the last channel "
2642  "group selected. Pressing \"4\" "
2643  "will toggle channel group."));
2644 
2645  gc->setValue(false);
2646 
2647  return gc;
2648 }
2649 
2651 {
2652  HostComboBoxSetting *gc = new HostComboBoxSetting("ChannelGroupDefault");
2653 
2654  gc->setLabel(ChannelGroupSettings::tr("Default channel group"));
2655 
2656  ChannelGroupList changrplist;
2657 
2658  changrplist = ChannelGroup::GetChannelGroups();
2659 
2660  gc->addSelection(ChannelGroupSettings::tr("All Channels"), "-1");
2661 
2662  ChannelGroupList::iterator it;
2663 
2664  for (it = changrplist.begin(); it < changrplist.end(); ++it)
2665  gc->addSelection(it->name, QString("%1").arg(it->grpid));
2666 
2667  gc->setHelpText(ChannelGroupSettings::tr("Default channel group to be "
2668  "shown in the EPG. Pressing "
2669  "GUIDE key will toggle channel "
2670  "group."));
2671  gc->setValue(false);
2672 
2673  return gc;
2674 }
2675 
2677 {
2678  HostCheckBoxSetting *gc = new HostCheckBoxSetting("BrowseChannelGroup");
2679 
2680  gc->setLabel(GeneralSettings::tr("Browse/change channels from Channel "
2681  "Group"));
2682 
2683  gc->setHelpText(GeneralSettings::tr("If enabled, Live TV will browse or "
2684  "change channels from the selected "
2685  "channel group. The \"All Channels\" "
2686  "channel group may be selected to "
2687  "browse all channels."));
2688  gc->setValue(false);
2689 
2690  return gc;
2691 }
2692 
2693 // General RecPriorities settings
2694 
2696 {
2697  GlobalComboBoxSetting *bc = new GlobalComboBoxSetting("SchedOpenEnd");
2698 
2699  bc->setLabel(GeneralRecPrioritiesSettings::tr("Avoid back to back "
2700  "recordings"));
2701 
2702  bc->setHelpText(
2703  GeneralRecPrioritiesSettings::tr("Selects the situations where the "
2704  "scheduler will avoid assigning shows "
2705  "to the same card if their end time "
2706  "and start time match. This will be "
2707  "allowed when necessary in order to "
2708  "resolve conflicts."));
2709 
2710  bc->addSelection(GeneralRecPrioritiesSettings::tr("Never"), "0");
2711  bc->addSelection(GeneralRecPrioritiesSettings::tr("Different Channels"),
2712  "1");
2713  bc->addSelection(GeneralRecPrioritiesSettings::tr("Always"), "2");
2714 
2715  bc->setValue(0);
2716 
2717  return bc;
2718 }
2719 
2721 {
2722  GlobalSpinBoxSetting *bs = new GlobalSpinBoxSetting("PrefInputPriority", 1, 99, 1);
2723 
2724  bs->setLabel(GeneralRecPrioritiesSettings::tr("Preferred input priority"));
2725 
2726  bs->setHelpText(GeneralRecPrioritiesSettings::tr("Additional priority when "
2727  "a showing matches the "
2728  "preferred input selected "
2729  "in the 'Scheduling "
2730  "Options' section of the "
2731  "recording rule."));
2732 
2733  bs->setValue(2);
2734  return bs;
2735 }
2736 
2738 {
2739  GlobalSpinBoxSetting *bs = new GlobalSpinBoxSetting("HDTVRecPriority", -99, 99, 1);
2740 
2741  bs->setLabel(GeneralRecPrioritiesSettings::tr("HDTV recording priority"));
2742 
2743  bs->setHelpText(GeneralRecPrioritiesSettings::tr("Additional priority when "
2744  "a showing is marked as an "
2745  "HDTV broadcast in the TV "
2746  "listings."));
2747 
2748  bs->setValue(0);
2749 
2750  return bs;
2751 }
2752 
2754 {
2755  GlobalSpinBoxSetting *bs = new GlobalSpinBoxSetting("WSRecPriority", -99, 99, 1);
2756 
2757  bs->setLabel(GeneralRecPrioritiesSettings::tr("Widescreen recording "
2758  "priority"));
2759 
2760  bs->setHelpText(GeneralRecPrioritiesSettings::tr("Additional priority when "
2761  "a showing is marked as "
2762  "widescreen in the TV "
2763  "listings."));
2764 
2765  bs->setValue(0);
2766 
2767  return bs;
2768 }
2769 
2771 {
2772  GlobalSpinBoxSetting *bs = new GlobalSpinBoxSetting("SignLangRecPriority",
2773  -99, 99, 1);
2774 
2775  bs->setLabel(GeneralRecPrioritiesSettings::tr("Sign language recording "
2776  "priority"));
2777 
2778  bs->setHelpText(GeneralRecPrioritiesSettings::tr("Additional priority "
2779  "when a showing is "
2780  "marked as having "
2781  "in-vision sign "
2782  "language."));
2783 
2784  bs->setValue(0);
2785 
2786  return bs;
2787 }
2788 
2790 {
2791  GlobalSpinBoxSetting *bs = new GlobalSpinBoxSetting("OnScrSubRecPriority",
2792  -99, 99, 1);
2793 
2794  bs->setLabel(GeneralRecPrioritiesSettings::tr("In-vision Subtitles "
2795  "Recording Priority"));
2796 
2797  bs->setHelpText(GeneralRecPrioritiesSettings::tr("Additional priority "
2798  "when a showing is marked "
2799  "as having in-vision "
2800  "subtitles."));
2801 
2802  bs->setValue(0);
2803 
2804  return bs;
2805 }
2806 
2808 {
2809  GlobalSpinBoxSetting *bs = new GlobalSpinBoxSetting("CCRecPriority",
2810  -99, 99, 1);
2811 
2812  bs->setLabel(GeneralRecPrioritiesSettings::tr("Subtitles/CC recording "
2813  "priority"));
2814 
2815  bs->setHelpText(GeneralRecPrioritiesSettings::tr("Additional priority when "
2816  "a showing is marked as "
2817  "having subtitles or "
2818  "closed captioning (CC) "
2819  "available."));
2820 
2821  bs->setValue(0);
2822 
2823  return bs;
2824 }
2825 
2827 {
2828  GlobalSpinBoxSetting *bs = new GlobalSpinBoxSetting("HardHearRecPriority",
2829  -99, 99, 1);
2830 
2831  bs->setLabel(GeneralRecPrioritiesSettings::tr("Hard of hearing priority"));
2832 
2833  bs->setHelpText(GeneralRecPrioritiesSettings::tr("Additional priority when "
2834  "a showing is marked as "
2835  "having support for "
2836  "viewers with impaired "
2837  "hearing."));
2838 
2839  bs->setValue(0);
2840 
2841  return bs;
2842 }
2843 
2845 {
2846  GlobalSpinBoxSetting *bs = new GlobalSpinBoxSetting("AudioDescRecPriority",
2847  -99, 99, 1);
2848 
2849  bs->setLabel(GeneralRecPrioritiesSettings::tr("Audio described priority"));
2850 
2851  bs->setHelpText(GeneralRecPrioritiesSettings::tr("Additional priority when "
2852  "a showing is marked as "
2853  "being Audio Described."));
2854 
2855  bs->setValue(0);
2856 
2857  return bs;
2858 }
2859 
2861 {
2862  HostTextEditSetting *ge = new HostTextEditSetting("DefaultTVChannel");
2863 
2864  ge->setLabel(EPGSettings::tr("Guide starts at channel"));
2865 
2866  ge->setValue("3");
2867 
2868  ge->setHelpText(EPGSettings::tr("The program guide starts on this channel "
2869  "if it is run from outside of Live TV "
2870  "mode. Leave blank to enable Live TV "
2871  "automatic start channel."));
2872 
2873  return ge;
2874 }
2875 
2877 {
2878  HostSpinBoxSetting *gs = new HostSpinBoxSetting("SelChangeRecThreshold", 1, 600, 1);
2879 
2880  gs->setLabel(EPGSettings::tr("Record threshold"));
2881 
2882  gs->setValue(16);
2883 
2884  gs->setHelpText(EPGSettings::tr("Pressing SELECT on a show that is at "
2885  "least this many minutes into the future "
2886  "will schedule a recording."));
2887  return gs;
2888 }
2889 
2891 {
2892  GlobalComboBoxSetting *gc = new GlobalComboBoxSetting("Language");
2893 
2894  gc->setLabel(AppearanceSettings::tr("Language"));
2895 
2896  QMap<QString, QString> langMap = MythTranslation::getLanguages();
2897  QStringList langs = langMap.values();
2898  langs.sort();
2899  QString langCode = gCoreContext->GetSetting("Language").toLower();
2900 
2901  if (langCode.isEmpty())
2902  langCode = "en_US";
2903 
2904  gc->clearSelections();
2905 
2906  for (QStringList::Iterator it = langs.begin(); it != langs.end(); ++it)
2907  {
2908  QString label = *it;
2909  QString value = langMap.key(label);
2910  gc->addSelection(label, value, (value.toLower() == langCode));
2911  }
2912 
2913  gc->setHelpText(AppearanceSettings::tr("Your preferred language for the "
2914  "user interface."));
2915  return gc;
2916 }
2917 
2919 {
2920  widget->clearSelections();
2921  QString q = QString("ISO639Language%1").arg(i);
2922  QString lang = gCoreContext->GetSetting(q, "").toLower();
2923 
2924  if ((lang.isEmpty() || lang == "aar") &&
2925  !gCoreContext->GetSetting("Language", "").isEmpty())
2926  {
2927  lang = iso639_str2_to_str3(gCoreContext->GetLanguage().toLower());
2928  }
2929 
2930  QMap<int,QString>::iterator it = _iso639_key_to_english_name.begin();
2931  QMap<int,QString>::iterator ite = _iso639_key_to_english_name.end();
2932 
2933  for (; it != ite; ++it)
2934  {
2935  QString desc = (*it);
2936  int idx = desc.indexOf(";");
2937  if (idx > 0)
2938  desc = desc.left(idx);
2939 
2940  const QString il = iso639_key_to_str3(it.key());
2941  widget->addSelection(desc, il, il == lang);
2942  }
2943 }
2944 
2946 {
2947  GlobalComboBoxSetting *gc = new GlobalComboBoxSetting(QString("ISO639Language%1").arg(i));
2948 
2949  gc->setLabel(AppearanceSettings::tr("Guide language #%1").arg(i+1));
2950 
2951  // We should try to get language from "MythLanguage"
2952  // then use code 2 to code 3 map in iso639.h
2953  ISO639_fill_selections(gc, i);
2954 
2955  gc->setHelpText(AppearanceSettings::tr("Your #%1 preferred language for "
2956  "Program Guide data and captions.")
2957  .arg(i+1));
2958  return gc;
2959 }
2960 
2962 {
2963  HostCheckBoxSetting *gc = new HostCheckBoxSetting("NetworkControlEnabled");
2964 
2965  gc->setLabel(MainGeneralSettings::tr("Enable Network Remote Control "
2966  "interface"));
2967 
2968  gc->setHelpText(MainGeneralSettings::tr("This enables support for "
2969  "controlling MythFrontend "
2970  "over the network."));
2971 
2972  gc->setValue(false);
2973 
2974  return gc;
2975 }
2976 
2978 {
2979  HostSpinBoxSetting *gs = new HostSpinBoxSetting("NetworkControlPort", 1025, 65535, 1);
2980 
2981  gs->setLabel(MainGeneralSettings::tr("Network Remote Control port"));
2982 
2983  gs->setValue(6546);
2984 
2985  gs->setHelpText(MainGeneralSettings::tr("This specifies what port the "
2986  "Network Remote Control "
2987  "interface will listen on for "
2988  "new connections."));
2989  return gs;
2990 }
2991 
2993 {
2994  HostTextEditSetting *ge = new HostTextEditSetting("UDPNotifyPort");
2995 
2996  ge->setLabel(MainGeneralSettings::tr("UDP notify port"));
2997 
2998  ge->setValue("6948");
2999 
3000  ge->setHelpText(MainGeneralSettings::tr("MythTV will listen for "
3001  "connections from the "
3002  "\"mythutil\" program on "
3003  "this port."));
3004  return ge;
3005 }
3006 
3007 #ifdef USING_AIRPLAY
3008 // AirPlay Settings
3009 static HostCheckBoxSetting *AirPlayEnabled()
3010 {
3011  HostCheckBoxSetting *gc = new HostCheckBoxSetting("AirPlayEnabled");
3012 
3013  gc->setLabel(MainGeneralSettings::tr("Enable AirPlay"));
3014 
3015  gc->setHelpText(MainGeneralSettings::tr("AirPlay lets you wirelessly view "
3016  "content on your TV from your "
3017  "iPhone, iPad, iPod Touch, or "
3018  "iTunes on your computer."));
3019 
3020  gc->setValue(true);
3021 
3022  return gc;
3023 }
3024 
3025 static HostCheckBoxSetting *AirPlayAudioOnly()
3026 {
3027  HostCheckBoxSetting *gc = new HostCheckBoxSetting("AirPlayAudioOnly");
3028 
3029  gc->setLabel(MainGeneralSettings::tr("Only support AirTunes (no video)"));
3030 
3031  gc->setHelpText(MainGeneralSettings::tr("Only stream audio from your "
3032  "iPhone, iPad, iPod Touch, or "
3033  "iTunes on your computer"));
3034 
3035  gc->setValue(false);
3036 
3037  return gc;
3038 }
3039 
3040 static HostCheckBoxSetting *AirPlayPasswordEnabled()
3041 {
3042  HostCheckBoxSetting *gc = new HostCheckBoxSetting("AirPlayPasswordEnabled");
3043 
3044  gc->setLabel(MainGeneralSettings::tr("Require password"));
3045 
3046  gc->setValue(false);
3047 
3048  gc->setHelpText(MainGeneralSettings::tr("Require a password to use "
3049  "AirPlay. Your iPhone, iPad, iPod "
3050  "Touch, or iTunes on your computer "
3051  "will prompt you when required"));
3052  return gc;
3053 }
3054 
3055 static HostTextEditSetting *AirPlayPassword()
3056 {
3057  HostTextEditSetting *ge = new HostTextEditSetting("AirPlayPassword");
3058 
3059  ge->setLabel(MainGeneralSettings::tr("Password"));
3060 
3061  ge->setValue("0000");
3062 
3063  ge->setHelpText(MainGeneralSettings::tr("Your iPhone, iPad, iPod Touch, or "
3064  "iTunes on your computer will "
3065  "prompt you for this password "
3066  "when required"));
3067  return ge;
3068 }
3069 
3070 static GroupSetting *AirPlayPasswordSettings()
3071 {
3072  GroupSetting *hc = new GroupSetting();
3073 
3074  hc->setLabel(MainGeneralSettings::tr("AirPlay - Password"));
3075  hc->addChild(AirPlayPasswordEnabled());
3076  hc->addChild(AirPlayPassword());
3077 
3078  return hc;
3079 }
3080 
3081 static HostCheckBoxSetting *AirPlayFullScreen()
3082 {
3083  HostCheckBoxSetting *gc = new HostCheckBoxSetting("AirPlayFullScreen");
3084 
3085  gc->setLabel(MainGeneralSettings::tr("AirPlay full screen playback"));
3086 
3087  gc->setValue(false);
3088 
3089  gc->setHelpText(MainGeneralSettings::tr("During music playback, displays "
3090  "album cover and various media "
3091  "information in full screen mode"));
3092  return gc;
3093 }
3094 
3095 //static TransLabelSetting *AirPlayInfo()
3096 //{
3097 // TransLabelSetting *ts = new TransLabelSetting();
3098 //
3099 // ts->setValue(MainGeneralSettings::tr("All AirPlay settings take effect "
3100 // "when you restart MythFrontend."));
3101 // return ts;
3102 //}
3103 
3104 //static TransLabelSetting *AirPlayRSAInfo()
3105 //{
3106 // TransLabelSetting *ts = new TransLabelSetting();
3107 //
3108 // if (MythRAOPConnection::LoadKey() == NULL)
3109 // {
3110 // ts->setValue(MainGeneralSettings::tr("AirTunes RSA key couldn't be "
3111 // "loaded. Check http://www.mythtv.org/wiki/AirTunes/AirPlay. "
3112 // "Last Error: %1")
3113 // .arg(MythRAOPConnection::RSALastError()));
3114 // }
3115 // else
3116 // {
3117 // ts->setValue(MainGeneralSettings::tr("AirTunes RSA key successfully "
3118 // "loaded."));
3119 // }
3120 //
3121 // return ts;
3122 //}
3123 #endif
3124 
3126 {
3127  HostCheckBoxSetting *gc = new HostCheckBoxSetting("RealtimePriority");
3128 
3129  gc->setLabel(PlaybackSettings::tr("Enable realtime priority threads"));
3130 
3131  gc->setHelpText(PlaybackSettings::tr("When running mythfrontend with root "
3132  "privileges, some threads can be "
3133  "given enhanced priority. Disable "
3134  "this if MythFrontend freezes during "
3135  "video playback."));
3136  gc->setValue(true);
3137 
3138  return gc;
3139 }
3140 
3142 {
3143  HostTextEditSetting *ge = new HostTextEditSetting("IgnoreDevices");
3144 
3145  ge->setLabel(MainGeneralSettings::tr("Ignore devices"));
3146 
3147  ge->setValue("");
3148 
3149  ge->setHelpText(MainGeneralSettings::tr("If there are any devices that you "
3150  "do not want to be monitored, list "
3151  "them here with commas in-between. "
3152  "The plugins will ignore them. "
3153  "Requires restart."));
3154  return ge;
3155 }
3156 
3158 {
3159  HostComboBoxSetting *gc = new HostComboBoxSetting("DisplayGroupTitleSort");
3160 
3161  gc->setLabel(PlaybackSettings::tr("Sort titles"));
3162 
3163  gc->addSelection(PlaybackSettings::tr("Alphabetically"),
3164  QString::number(PlaybackBox::TitleSortAlphabetical));
3165  gc->addSelection(PlaybackSettings::tr("By recording priority"),
3166  QString::number(PlaybackBox::TitleSortRecPriority));
3167 
3168  gc->setHelpText(PlaybackSettings::tr("Sets the title sorting order when "
3169  "the view is set to Titles only."));
3170  return gc;
3171 }
3172 
3174 {
3175  HostCheckBoxSetting *gc = new HostCheckBoxSetting("PlaybackWatchList");
3176 
3177  gc->setLabel(WatchListSettings::tr("Include the 'Watch List' group"));
3178 
3179  gc->setValue(true);
3180 
3181  gc->setHelpText(WatchListSettings::tr("The 'Watch List' is an abbreviated "
3182  "list of recordings sorted to "
3183  "highlight series and shows that "
3184  "need attention in order to keep up "
3185  "to date."));
3186  return gc;
3187 }
3188 
3190 {
3191  HostCheckBoxSetting *gc = new HostCheckBoxSetting("PlaybackWLStart");
3192 
3193  gc->setLabel(WatchListSettings::tr("Start from the Watch List view"));
3194 
3195  gc->setValue(false);
3196 
3197  gc->setHelpText(WatchListSettings::tr("If enabled, the 'Watch List' will "
3198  "be the initial view each time you "
3199  "enter the Watch Recordings screen"));
3200  return gc;
3201 }
3202 
3204 {
3205  HostCheckBoxSetting *gc = new HostCheckBoxSetting("PlaybackWLAutoExpire");
3206 
3207  gc->setLabel(WatchListSettings::tr("Exclude recordings not set for "
3208  "Auto-Expire"));
3209 
3210  gc->setValue(false);
3211 
3212  gc->setHelpText(WatchListSettings::tr("Set this if you turn off "
3213  "Auto-Expire only for recordings "
3214  "that you've seen and intend to "
3215  "keep. This option will exclude "
3216  "these recordings from the "
3217  "'Watch List'."));
3218  return gc;
3219 }
3220 
3222 {
3223  HostSpinBoxSetting *gs = new HostSpinBoxSetting("PlaybackWLMaxAge", 30, 180, 10);
3224 
3225  gs->setLabel(WatchListSettings::tr("Maximum days counted in the score"));
3226 
3227  gs->setValue(60);
3228 
3229  gs->setHelpText(WatchListSettings::tr("The 'Watch List' scores are based "
3230  "on 1 point equals one day since "
3231  "recording. This option limits the "
3232  "maximum score due to age and "
3233  "affects other weighting factors."));
3234  return gs;
3235 }
3236 
3238 {
3239  HostSpinBoxSetting *gs = new HostSpinBoxSetting("PlaybackWLBlackOut", 0, 5, 1);
3240 
3241  gs->setLabel(WatchListSettings::tr("Days to exclude weekly episodes after "
3242  "delete"));
3243 
3244  gs->setValue(2);
3245 
3246  gs->setHelpText(WatchListSettings::tr("When an episode is deleted or "
3247  "marked as watched, other episodes "
3248  "of the series are excluded from the "
3249  "'Watch List' for this interval of "
3250  "time. Daily shows also have a "
3251  "smaller interval based on this "
3252  "setting."));
3253  return gs;
3254 }
3255 
3257 {
3258  HostCheckBoxSetting *gc = new HostCheckBoxSetting("MonitorDrives");
3259 
3260  gc->setLabel(MainGeneralSettings::tr("Media Monitor"));
3261 
3262  gc->setHelpText(MainGeneralSettings::tr("This enables support for "
3263  "monitoring your CD/DVD drives for "
3264  "new disks and launching the "
3265  "proper plugin to handle them. "
3266  "Requires restart."));
3267 
3268  gc->setValue(false);
3269 
3270  gc->addTargetedChild("1", IgnoreMedia());
3271 
3272  return gc;
3273 }
3274 
3276 {
3277  HostCheckBoxSetting *gc = new HostCheckBoxSetting("LCDShowTime");
3278 
3279  gc->setLabel(LcdSettings::tr("Display time"));
3280 
3281  gc->setHelpText(LcdSettings::tr("Display current time on idle LCD "
3282  "display."));
3283 
3284  gc->setValue(true);
3285 
3286  return gc;
3287 }
3288 
3290 {
3291  HostCheckBoxSetting *gc = new HostCheckBoxSetting("LCDShowRecStatus");
3292 
3293  gc->setLabel(LcdSettings::tr("Display recording status"));
3294 
3295  gc->setHelpText(LcdSettings::tr("Display current recordings information "
3296  "on LCD display."));
3297 
3298  gc->setValue(false);
3299 
3300  return gc;
3301 }
3302 
3304 {
3305  HostCheckBoxSetting *gc = new HostCheckBoxSetting("LCDShowMenu");
3306 
3307  gc->setLabel(LcdSettings::tr("Display menus"));
3308 
3309  gc->setHelpText(LcdSettings::tr("Display selected menu on LCD display. "));
3310 
3311  gc->setValue(true);
3312 
3313  return gc;
3314 }
3315 
3317 {
3318  HostSpinBoxSetting *gs = new HostSpinBoxSetting("LCDPopupTime", 1, 300, 1, true);
3319 
3320  gs->setLabel(LcdSettings::tr("Menu pop-up time"));
3321 
3322  gs->setHelpText(LcdSettings::tr("How many seconds the menu will remain "
3323  "visible after navigation."));
3324 
3325  gs->setValue(5);
3326 
3327  return gs;
3328 }
3329 
3331 {
3332  HostCheckBoxSetting *gc = new HostCheckBoxSetting("LCDShowMusic");
3333 
3334  gc->setLabel(LcdSettings::tr("Display music artist and title"));
3335 
3336  gc->setHelpText(LcdSettings::tr("Display playing artist and song title in "
3337  "MythMusic on LCD display."));
3338 
3339  gc->setValue(true);
3340 
3341  return gc;
3342 }
3343 
3345 {
3346  HostComboBoxSetting *gc = new HostComboBoxSetting("LCDShowMusicItems");
3347 
3348  gc->setLabel(LcdSettings::tr("Items"));
3349 
3350  gc->addSelection(LcdSettings::tr("Artist - Title"), "ArtistTitle");
3351  gc->addSelection(LcdSettings::tr("Artist [Album] Title"),
3352  "ArtistAlbumTitle");
3353 
3354  gc->setHelpText(LcdSettings::tr("Which items to show when playing music."));
3355 
3356  return gc;
3357 }
3358 
3360 {
3361  HostCheckBoxSetting *gc = new HostCheckBoxSetting("LCDShowChannel");
3362 
3363  gc->setLabel(LcdSettings::tr("Display channel information"));
3364 
3365  gc->setHelpText(LcdSettings::tr("Display tuned channel information on LCD "
3366  "display."));
3367 
3368  gc->setValue(true);
3369 
3370  return gc;
3371 }
3372 
3374 {
3375  HostCheckBoxSetting *gc = new HostCheckBoxSetting("LCDShowVolume");
3376 
3377  gc->setLabel(LcdSettings::tr("Display volume information"));
3378 
3379  gc->setHelpText(LcdSettings::tr("Display volume level information "
3380  "on LCD display."));
3381 
3382  gc->setValue(true);
3383 
3384  return gc;
3385 }
3386 
3388 {
3389  HostCheckBoxSetting *gc = new HostCheckBoxSetting("LCDShowGeneric");
3390 
3391  gc->setLabel(LcdSettings::tr("Display generic information"));
3392 
3393  gc->setHelpText(LcdSettings::tr("Display generic information on LCD display."));
3394 
3395  gc->setValue(true);
3396 
3397  return gc;
3398 }
3399 
3401 {
3402  HostCheckBoxSetting *gc = new HostCheckBoxSetting("LCDBacklightOn");
3403 
3404  gc->setLabel(LcdSettings::tr("Backlight always on"));
3405 
3406  gc->setHelpText(LcdSettings::tr("Turn on the backlight permanently on the "
3407  "LCD display."));
3408  gc->setValue(true);
3409 
3410  return gc;
3411 }
3412 
3414 {
3415  HostCheckBoxSetting *gc = new HostCheckBoxSetting("LCDHeartBeatOn");
3416 
3417  gc->setLabel(LcdSettings::tr("Heartbeat always on"));
3418 
3419  gc->setHelpText(LcdSettings::tr("Turn on the LCD heartbeat."));
3420 
3421  gc->setValue(false);
3422 
3423  return gc;
3424 }
3425 
3427 {
3428  HostCheckBoxSetting *gc = new HostCheckBoxSetting("LCDBigClock");
3429 
3430  gc->setLabel(LcdSettings::tr("Display large clock"));
3431 
3432  gc->setHelpText(LcdSettings::tr("On multiline displays try and display the "
3433  "time as large as possible."));
3434 
3435  gc->setValue(false);
3436 
3437  return gc;
3438 }
3439 
3441 {
3442  HostTextEditSetting *ge = new HostTextEditSetting("LCDKeyString");
3443 
3444  ge->setLabel(LcdSettings::tr("LCD key order"));
3445 
3446  ge->setValue("ABCDEF");
3447 
3448  ge->setHelpText(
3449  LcdSettings::tr("Enter the 6 Keypad Return Codes for your LCD keypad "
3450  "in the order in which you want the functions "
3451  "up/down/left/right/yes/no to operate. (See "
3452  "lcdproc/server/drivers/hd44780.c/keyMapMatrix[] "
3453  "or the matrix for your display)"));
3454  return ge;
3455 }
3456 
3458 {
3459  HostCheckBoxSetting *gc = new HostCheckBoxSetting("LCDEnable");
3460 
3461  gc->setLabel(LcdSettings::tr("Enable LCD device"));
3462 
3463  gc->setHelpText(LcdSettings::tr("Use an LCD display to view MythTV status "
3464  "information."));
3465 
3466  gc->setValue(false);
3467  gc->addTargetedChild("1", LCDShowTime());
3468  gc->addTargetedChild("1", LCDShowMenu());
3469  gc->addTargetedChild("1", LCDShowMusic());
3470  gc->addTargetedChild("1", LCDShowMusicItems());
3471  gc->addTargetedChild("1", LCDShowChannel());
3472  gc->addTargetedChild("1", LCDShowRecStatus());
3473  gc->addTargetedChild("1", LCDShowVolume());
3474  gc->addTargetedChild("1", LCDShowGeneric());
3475  gc->addTargetedChild("1", LCDBacklightOn());
3476  gc->addTargetedChild("1", LCDHeartBeatOn());
3477  gc->addTargetedChild("1", LCDBigClock());
3478  gc->addTargetedChild("1", LCDKeyString());
3479  gc->addTargetedChild("1", LCDPopupTime());
3480  return gc;
3481 }
3482 
3483 
3484 #if CONFIG_DARWIN
3485 static HostCheckBoxSetting *MacGammaCorrect()
3486 {
3487  HostCheckBoxSetting *gc = new HostCheckBoxSetting("MacGammaCorrect");
3488 
3489  gc->setLabel(PlaybackSettings::tr("Enable gamma correction for video"));
3490 
3491  gc->setValue(false);
3492 
3493  gc->setHelpText(PlaybackSettings::tr("If enabled, QuickTime will correct "
3494  "the gamma of the video to match "
3495  "your monitor. Turning this off can "
3496  "save some CPU cycles."));
3497  return gc;
3498 }
3499 
3500 static HostCheckBoxSetting *MacScaleUp()
3501 {
3502  HostCheckBoxSetting *gc = new HostCheckBoxSetting("MacScaleUp");
3503 
3504  gc->setLabel(PlaybackSettings::tr("Scale video as necessary"));
3505 
3506  gc->setValue(true);
3507 
3508  gc->setHelpText(PlaybackSettings::tr("If enabled, video will be scaled to "
3509  "fit your window or screen. If "
3510  "unchecked, video will never be made "
3511  "larger than its actual pixel size."));
3512  return gc;
3513 }
3514 
3515 static HostSpinBoxSetting *MacFullSkip()
3516 {
3517  HostSpinBoxSetting *gs = new HostSpinBoxSetting("MacFullSkip", 0, 30, 1, true);
3518 
3519  gs->setLabel(PlaybackSettings::tr("Frames to skip in fullscreen mode"));
3520 
3521  gs->setValue(0);
3522 
3523  gs->setHelpText(PlaybackSettings::tr("Video displayed in fullscreen or "
3524  "non-windowed mode will skip this "
3525  "many frames for each frame drawn. "
3526  "Set to 0 to show every frame. Only "
3527  "valid when either \"Use GUI size for "
3528  "TV playback\" or \"Run the frontend "
3529  "in a window\" is not checked."));
3530  return gs;
3531 }
3532 
3533 static HostCheckBoxSetting *MacMainEnabled()
3534 {
3535  HostCheckBoxSetting *gc = new HostCheckBoxSetting("MacMainEnabled");
3536 
3537  gc->setLabel(MacMainSettings::tr("Video in main window"));
3538 
3539  gc->setValue(true);
3540 
3541  gc->setHelpText(MacMainSettings::tr("If enabled, video will be displayed "
3542  "in the main GUI window. Disable this "
3543  "when you only want video on the "
3544  "desktop or in a floating window. Only "
3545  "valid when \"Use GUI size for TV "
3546  "playback\" and \"Run the frontend in "
3547  "a window\" are checked."));
3548  return gc;
3549 }
3550 
3551 static HostSpinBoxSetting *MacMainSkip()
3552 {
3553  HostSpinBoxSetting *gs = new HostSpinBoxSetting("MacMainSkip", 0, 30, 1, true);
3554 
3555  gs->setLabel(MacMainSettings::tr("Frames to skip"));
3556 
3557  gs->setValue(0);
3558 
3559  gs->setHelpText(MacMainSettings::tr("Video in the main window will skip "
3560  "this many frames for each frame "
3561  "drawn. Set to 0 to show every "
3562  "frame."));
3563  return gs;
3564 }
3565 
3566 static HostSpinBoxSetting *MacMainOpacity()
3567 {
3568  HostSpinBoxSetting *gs = new HostSpinBoxSetting("MacMainOpacity", 0, 100, 5, false);
3569 
3570  gs->setLabel(MacMainSettings::tr("Opacity"));
3571 
3572  gs->setValue(100);
3573 
3574  gs->setHelpText(MacMainSettings::tr("The opacity of the main window. Set "
3575  "to 100 for completely opaque, set "
3576  "to 0 for completely transparent."));
3577  return gs;
3578 }
3579 
3580 static HostCheckBoxSetting *MacFloatEnabled()
3581 {
3582  HostCheckBoxSetting *gc = new HostCheckBoxSetting("MacFloatEnabled");
3583 
3584  gc->setLabel(MacFloatSettings::tr("Video in floating window"));
3585 
3586  gc->setValue(false);
3587 
3588  gc->setHelpText(MacFloatSettings::tr("If enabled, video will be displayed "
3589  "in a floating window. Only valid "
3590  "when \"Use GUI size for TV "
3591  "playback\" and \"Run the frontend "
3592  "in a window\" are checked."));
3593  return gc;
3594 }
3595 
3596 static HostSpinBoxSetting *MacFloatSkip()
3597 {
3598  HostSpinBoxSetting *gs = new HostSpinBoxSetting("MacFloatSkip", 0, 30, 1, true);
3599 
3600  gs->setLabel(MacFloatSettings::tr("Frames to skip"));
3601 
3602  gs->setValue(0);
3603 
3604  gs->setHelpText(MacFloatSettings::tr("Video in the floating window will "
3605  "skip this many frames for each "
3606  "frame drawn. Set to 0 to show "
3607  "every frame."));
3608  return gs;
3609 }
3610 
3611 static HostSpinBoxSetting *MacFloatOpacity()
3612 {
3613  HostSpinBoxSetting *gs = new HostSpinBoxSetting("MacFloatOpacity", 0, 100, 5, false);
3614 
3615  gs->setLabel(MacFloatSettings::tr("Opacity"));
3616 
3617  gs->setValue(100);
3618 
3619  gs->setHelpText(MacFloatSettings::tr("The opacity of the floating window. "
3620  "Set to 100 for completely opaque, "
3621  "set to 0 for completely "
3622  "transparent."));
3623  return gs;
3624 }
3625 
3626 static HostCheckBoxSetting *MacDockEnabled()
3627 {
3628  HostCheckBoxSetting *gc = new HostCheckBoxSetting("MacDockEnabled");
3629 
3630  gc->setLabel(MacDockSettings::tr("Video in the dock"));
3631 
3632  gc->setValue(true);
3633 
3634  gc->setHelpText(MacDockSettings::tr("If enabled, video will be displayed "
3635  "in the application's dock icon. Only "
3636  "valid when \"Use GUI size for TV "
3637  "playback\" and \"Run the frontend in "
3638  "a window\" are checked."));
3639  return gc;
3640 }
3641 
3642 static HostSpinBoxSetting *MacDockSkip()
3643 {
3644  HostSpinBoxSetting *gs = new HostSpinBoxSetting("MacDockSkip", 0, 30, 1, true);
3645 
3646  gs->setLabel(MacDockSettings::tr("Frames to skip"));
3647 
3648  gs->setValue(3);
3649 
3650  gs->setHelpText(MacDockSettings::tr("Video in the dock icon will skip this "
3651  "many frames for each frame drawn. Set "
3652  "to 0 to show every frame."));
3653  return gs;
3654 }
3655 
3656 static HostCheckBoxSetting *MacDesktopEnabled()
3657 {
3658  HostCheckBoxSetting *gc = new HostCheckBoxSetting("MacDesktopEnabled");
3659 
3660  gc->setLabel(MacDesktopSettings::tr("Video on the desktop"));
3661 
3662  gc->setValue(false);
3663 
3664  gc->setHelpText(MacDesktopSettings::tr("If enabled, video will be "
3665  "displayed on the desktop, "
3666  "behind the Finder icons. "
3667  "Only valid when \"Use GUI "
3668  "size for TV playback\" and "
3669  "\"Run the frontend in a "
3670  "window\" are checked."));
3671  return gc;
3672 }
3673 
3674 static HostSpinBoxSetting *MacDesktopSkip()
3675 {
3676  HostSpinBoxSetting *gs = new HostSpinBoxSetting("MacDesktopSkip", 0, 30, 1, true);
3677 
3678  gs->setLabel(MacDesktopSettings::tr("Frames to skip"));
3679 
3680  gs->setValue(0);
3681 
3682  gs->setHelpText(MacDesktopSettings::tr("Video on the desktop will skip "
3683  "this many frames for each frame "
3684  "drawn. Set to 0 to show every "
3685  "frame."));
3686  return gs;
3687 }
3688 #endif
3689 
3690 
3692 {
3693  public:
3695  private slots:
3696  void childChanged(StandardSetting *);
3697  private:
3701 };
3702 
3704  : GroupSetting()
3705 {
3706  setLabel(MainGeneralSettings::tr("Shutdown/Reboot Settings"));
3711  connect(m_overrideExitMenu,SIGNAL(valueChanged(StandardSetting *)),
3712  SLOT(childChanged(StandardSetting *)));
3713 }
3714 
3716 {
3717  switch (m_overrideExitMenu->getValue().toInt())
3718  {
3719  case 2:
3720  case 4:
3721  m_haltCommand->setEnabled(true);
3722  m_rebootCommand->setEnabled(false);
3723  break;
3724  case 3:
3725  case 6:
3726  m_haltCommand->setEnabled(true);
3727  m_rebootCommand->setEnabled(true);
3728  break;
3729  case 5:
3730  m_haltCommand->setEnabled(false);
3731  m_rebootCommand->setEnabled(true);
3732  break;
3733  case 0:
3734  case 1:
3735  default:
3736  m_haltCommand->setEnabled(false);
3737  m_rebootCommand->setEnabled(false);
3738  break;
3739  }
3740 }
3741 
3743 {
3744 // DatabaseSettings::addDatabaseSettings(this);
3745  setLabel(tr("Main Settings"));
3746 
3747  addChild(new DatabaseSettings());
3748 
3749  GroupSetting *pin = new GroupSetting();
3750  pin->setLabel(tr("Settings Access"));
3751  pin->addChild(SetupPinCode());
3752  addChild(pin);
3753 
3754  GroupSetting *general = new GroupSetting();
3755  general->setLabel(tr("General"));
3756  general->addChild(UseVirtualKeyboard());
3757  general->addChild(ScreenShotPath());
3758  addChild(general);
3759 
3761 
3763 
3764  GroupSetting *remotecontrol = new GroupSetting();
3765  remotecontrol->setLabel(tr("Remote Control"));
3766  remotecontrol->addChild(LircDaemonDevice());
3767  remotecontrol->addChild(NetworkControlEnabled());
3768  remotecontrol->addChild(NetworkControlPort());
3769  remotecontrol->addChild(UDPNotifyPort());
3770  addChild(remotecontrol);
3771 
3772 #ifdef USING_AIRPLAY
3773  GroupSetting *airplay = new GroupSetting();
3774  airplay->setLabel(tr("AirPlay Settings"));
3775  airplay->addChild(AirPlayEnabled());
3776  airplay->addChild(AirPlayFullScreen());
3777  airplay->addChild(AirPlayAudioOnly());
3778  airplay->addChild(AirPlayPasswordSettings());
3779 // airplay->addChild(AirPlayInfo());
3780 // airplay->addChild(AirPlayRSAInfo());
3781  addChild(airplay);
3782 #endif
3783 }
3784 
3786 {
3787  QStringList strlist( QString("REFRESH_BACKEND") );
3789 }
3790 
3791 
3793 {
3794  public:
3795  PlayBackScaling();
3796  virtual void updateButton(MythUIButtonListItem *item);
3797 
3798  private slots:
3799  virtual void childChanged(StandardSetting *);
3800 
3801  private:
3806 };
3807 
3809  :GroupSetting()
3810 {
3811  setLabel(tr("Scaling"));
3816  connect(m_VertScan, SIGNAL(valueChanged(StandardSetting *)),
3817  this, SLOT(childChanged(StandardSetting *)));
3818  connect(m_YScan, SIGNAL(valueChanged(StandardSetting *)),
3819  this, SLOT(childChanged(StandardSetting *)));
3820  connect(m_HorizScan, SIGNAL(valueChanged(StandardSetting *)),
3821  this, SLOT(childChanged(StandardSetting *)));
3822  connect(m_XScan,SIGNAL(valueChanged(StandardSetting *)),
3823  this, SLOT(childChanged(StandardSetting *)));
3824 }
3825 
3826 
3828 {
3830  if (m_VertScan->getValue() == "0" &&
3831  m_HorizScan->getValue() == "0" &&
3832  m_YScan->getValue() == "0" &&
3833  m_XScan->getValue() == "0")
3834  item->SetText(tr("No scaling"),"value");
3835  else
3836  item->SetText(QString("%1%x%2%+%3%+%4%")
3837  .arg(m_HorizScan->getValue())
3838  .arg(m_VertScan->getValue())
3839  .arg(m_XScan->getValue())
3840  .arg(m_YScan->getValue()), "value");
3841 }
3842 
3844 {
3845  emit ShouldRedraw(this);
3846 }
3847 
3849  : StandardSettingDialog(stack, "playbacksettings", new PlaybackSettings())
3850 {
3851 }
3852 
3854 {
3856  if (item)
3857  {
3858  PlaybackProfileItemConfig *config =
3859  item->GetData().value<PlaybackProfileItemConfig*>();
3860  if (config)
3862  }
3863 }
3864 
3865 
3867 {
3868  MythMenu *menu = new MythMenu(tr("Playback Profile Menu"), this,
3869  "mainmenu");
3870 
3871  if (m_buttonList->GetItemPos(item) > 2)
3872  menu->AddItem(tr("Move Up"), SLOT(MoveProfileItemUp()));
3873  if (m_buttonList->GetItemPos(item) + 1 < m_buttonList->GetCount())
3874  menu->AddItem(tr("Move Down"), SLOT(MoveProfileItemDown()));
3875 
3876  menu->AddItem(tr("Delete"), SLOT(DeleteProfileItem()));
3877 
3878  MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack");
3879 
3880  MythDialogBox *menuPopup = new MythDialogBox(menu, popupStack,
3881  "menudialog");
3882  menuPopup->SetReturnEvent(this, "mainmenu");
3883 
3884  if (menuPopup->Create())
3885  popupStack->AddScreen(menuPopup);
3886  else
3887  delete menuPopup;
3888 }
3889 
3891 {
3893  if (item)
3894  {
3895  PlaybackProfileItemConfig *config =
3896  item->GetData().value<PlaybackProfileItemConfig*>();
3897  if (config)
3898  {
3899  const int currentPos = m_buttonList->GetCurrentPos();
3900 
3901  config->DecreasePriority();
3902 
3903  m_buttonList->SetItemCurrent(currentPos + 1);
3904  }
3905  }
3906 }
3907 
3909 {
3911  if (item)
3912  {
3913  PlaybackProfileItemConfig *config =
3914  item->GetData().value<PlaybackProfileItemConfig*>();
3915  if (config)
3916  {
3917  const int currentPos = m_buttonList->GetCurrentPos();
3918 
3919  config->IncreasePriority();
3920 
3921  m_buttonList->SetItemCurrent(currentPos - 1);
3922  }
3923  }
3924 }
3925 
3927 {
3928  PlaybackProfileItemConfig *config =
3930  if (config)
3931  config->ShowDeleteDialog();
3932 }
3933 
3935  : m_newPlaybackProfileButton(NULL),
3936  m_playbackProfiles(NULL)
3937 {
3938  setLabel(tr("Playback settings"));
3939 }
3940 
3942 {
3943  GroupSetting* general = new GroupSetting();
3944  general->setLabel(tr("General Playback"));
3945  general->addChild(RealtimePriority());
3946  general->addChild(AudioReadAhead());
3947  general->addChild(JumpToProgramOSD());
3948  general->addChild(ClearSavedPosition());
3949  general->addChild(UseProgStartMark());
3950  general->addChild(AutomaticSetWatched());
3951  general->addChild(ContinueEmbeddedTVPlay());
3952  general->addChild(LiveTVIdleTimeout());
3953 
3954 #if CONFIG_DEBUGTYPE
3955  general->addChild(FFmpegDemuxer());
3956 #endif
3957 
3958  general->addChild(new PlayBackScaling());
3959 
3960  general->addChild(AspectOverride());
3961  general->addChild(AdjustFill());
3962 
3963  general->addChild(LetterboxingColour());
3964  general->addChild(PIPLocationComboBox());
3965  general->addChild(PlaybackExitPrompt());
3966  general->addChild(EndOfRecordingExitPrompt());
3967  addChild(general);
3968 
3971 
3973  new ButtonStandardSetting(tr("Add a new playback profile"));
3975  connect(m_newPlaybackProfileButton, SIGNAL(clicked()),
3976  SLOT(NewPlaybackProfileSlot()));
3977 
3978  GroupSetting* pbox = new GroupSetting();
3979  pbox->setLabel(tr("View Recordings"));
3980  pbox->addChild(PlayBoxOrdering());
3981  pbox->addChild(PlayBoxEpisodeSort());
3982  // Disabled until we re-enable live previews
3983  // pbox->addChild(PlaybackPreview());
3984  // pbox->addChild(HWAccelPlaybackPreview());
3985  pbox->addChild(PBBStartInTitle());
3986 
3987  GroupSetting* pbox2 = new GroupSetting();
3988  pbox2->setLabel(tr("Recording Groups"));
3989  pbox2->addChild(DisplayRecGroup());
3990  pbox2->addChild(QueryInitialFilter());
3991  pbox2->addChild(RememberRecGroup());
3992  pbox2->addChild(RecGroupMod());
3993 
3994  pbox->addChild(pbox2);
3995 
3997 
3998  StandardSetting *playbackWatchList = PlaybackWatchList();
3999  playbackWatchList->addTargetedChild("1", PlaybackWLStart());
4000  playbackWatchList->addTargetedChild("1", PlaybackWLAutoExpire());
4001  playbackWatchList->addTargetedChild("1", PlaybackWLMaxAge());
4002  playbackWatchList->addTargetedChild("1", PlaybackWLBlackOut());
4003  pbox->addChild(playbackWatchList);
4004  addChild(pbox);
4005 
4006  GroupSetting* seek = new GroupSetting();
4007  seek->setLabel(tr("Seeking"));
4008  seek->addChild(SmartForward());
4009  seek->addChild(FFRewReposTime());
4010  seek->addChild(FFRewReverse());
4011 
4012  addChild(seek);
4013 
4014  GroupSetting* comms = new GroupSetting();
4015  comms->setLabel(tr("Commercial Skip"));
4016  comms->addChild(AutoCommercialSkip());
4017  comms->addChild(CommRewindAmount());
4018  comms->addChild(CommNotifyAmount());
4019  comms->addChild(MaximumCommercialSkip());
4020  comms->addChild(MergeShortCommBreaks());
4021 
4022  addChild(comms);
4023 
4024 #if CONFIG_DARWIN
4025  GroupSetting* mac = new GroupSetting();
4026  mac->setLabel(tr("Mac OS X Video Settings"));
4027  mac->addChild(MacGammaCorrect());
4028  mac->addChild(MacScaleUp());
4029  mac->addChild(MacFullSkip());
4030 
4031  StandardSetting *floatEnabled = MacFloatEnabled();
4032  floatEnabled->addTargetedChild("1", MacFloatSkip());
4033  floatEnabled->addTargetedChild("1", MacFloatOpacity());
4034  mac->addChild(floatEnabled);
4035 
4036  StandardSetting *macMainEnabled = MacMainEnabled();
4037  macMainEnabled->addTargetedChild("1", MacMainSkip());
4038  macMainEnabled->addTargetedChild("1", MacMainOpacity());
4039  mac->addChild(macMainEnabled);
4040 
4041  StandardSetting *dockEnabled = MacDockEnabled();
4042  dockEnabled->addTargetedChild("1", MacDockSkip());
4043  mac->addChild(dockEnabled);
4044 
4045  StandardSetting* desktopEnabled = MacDesktopEnabled();
4046  desktopEnabled->addTargetedChild("1", MacDesktopSkip());
4047  mac->addChild(desktopEnabled);
4048 
4049  addChild(mac);
4050 #endif
4051 
4053 }
4054 
4056 {
4057  setLabel(tr("On-screen Display"));
4058 
4059  addChild(EnableMHEG());
4065 
4066  //GroupSetting *cc = new GroupSetting();
4067  //cc->setLabel(tr("Closed Captions"));
4068  //cc->addChild(DecodeVBIFormat());
4069  //addChild(cc);
4070 
4071 #if defined(Q_OS_MACX)
4072  // Any Mac OS-specific OSD stuff would go here.
4073 #endif
4074 }
4075 
4077 {
4078  setLabel(tr("General (Basic)"));
4079  GroupSetting* general = new GroupSetting();
4080  general->setLabel(tr("General (Basic)"));
4081  general->addChild(ChannelOrdering());
4082  general->addChild(ChannelFormat());
4083  general->addChild(LongChannelFormat());
4084 
4085  addChild(general);
4086 
4087  GroupSetting* autoexp = new GroupSetting();
4088 
4089  autoexp->setLabel(tr("General (Auto-Expire)"));
4090 
4091  autoexp->addChild(AutoExpireMethod());
4092 
4093  autoexp->addChild(RerecordWatched());
4094  autoexp->addChild(AutoExpireWatchedPriority());
4095 
4096  autoexp->addChild(AutoExpireLiveTVMaxAge());
4097  autoexp->addChild(AutoExpireDayPriority());
4098  autoexp->addChild(AutoExpireExtraSpace());
4099 
4100 // autoexp->addChild(new DeletedExpireOptions());
4101  autoexp->addChild(DeletedMaxAge());
4102 
4103  addChild(autoexp);
4104 
4105  GroupSetting* jobs = new GroupSetting();
4106 
4107  jobs->setLabel(tr("General (Jobs)"));
4108 
4109  jobs->addChild(CommercialSkipMethod());
4110  jobs->addChild(CommFlagFast());
4111  jobs->addChild(AggressiveCommDetect());
4113 
4114  addChild(jobs);
4115 
4116  GroupSetting* general2 = new GroupSetting();
4117 
4118  general2->setLabel(tr("General (Advanced)"));
4119 
4120  general2->addChild(RecordPreRoll());
4121  general2->addChild(RecordOverTime());
4122  general2->addChild(CategoryOverTimeSettings());
4123  addChild(general2);
4124 
4125  GroupSetting* changrp = new GroupSetting();
4126 
4127  changrp->setLabel(tr("General (Channel Groups)"));
4128 
4129  changrp->addChild(ChannelGroupRememberLast());
4130  changrp->addChild(ChannelGroupDefault());
4131  changrp->addChild(BrowseChannelGroup());
4132 
4133  addChild(changrp);
4134 }
4135 
4137 {
4138  setLabel(tr("Program Guide"));
4139 
4142 }
4143 
4145 {
4146  GroupSetting* sched = new GroupSetting();
4147 
4148  sched->setLabel(tr("Scheduler Options"));
4149 
4150  sched->addChild(GRSchedOpenEnd());
4151  sched->addChild(GRPrefInputRecPriority());
4152  sched->addChild(GRHDTVRecPriority());
4153  sched->addChild(GRWSRecPriority());
4154 
4155  addChild(sched);
4156 
4157  GroupSetting* access = new GroupSetting();
4158 
4159  access->setLabel(tr("Accessibility Options"));
4160 
4161  access->addChild(GRSignLangRecPriority());
4162  access->addChild(GROnScrSubRecPriority());
4163  access->addChild(GRCCRecPriority());
4164  access->addChild(GRHardHearRecPriority());
4165  access->addChild(GRAudioDescRecPriority());
4166 
4167  addChild(access);
4168 }
4169 
4171 {
4172  public:
4173  GuiDimension();
4174  //virtual QString getValue();
4175  virtual void updateButton(MythUIButtonListItem *item);
4176 
4177  private slots:
4178  virtual void childChanged(StandardSetting *);
4179  private:
4184 };
4185 
4187  :GroupSetting()
4188 {
4189  setLabel(AppearanceSettings::tr("GUI dimension"));
4190  addChild(m_width = GuiWidth());
4194  connect(m_width, SIGNAL(valueChanged(StandardSetting *)),
4195  SLOT(childChanged(StandardSetting *)));
4196  connect(m_height, SIGNAL(valueChanged(StandardSetting *)),
4197  SLOT(childChanged(StandardSetting *)));
4198  connect(m_offsetX, SIGNAL(valueChanged(StandardSetting *)),
4199  SLOT(childChanged(StandardSetting *)));
4200  connect(m_offsetY, SIGNAL(valueChanged(StandardSetting *)),
4201  SLOT(childChanged(StandardSetting *)));
4202 }
4203 
4205 {
4207  if ((m_width->getValue() == "0" ||
4208  m_height->getValue() == "0") &&
4209  m_offsetX->getValue() == "0" &&
4210  m_offsetY->getValue() == "0")
4211  item->SetText(AppearanceSettings::tr("Fullscreen"), "value");
4212  else
4213  item->SetText(QString("%1x%2+%3+%4")
4214  .arg(m_width->getValue())
4215  .arg(m_height->getValue())
4216  .arg(m_offsetX->getValue())
4217  .arg(m_offsetY->getValue()), "value");
4218 }
4219 
4221 {
4222  emit ShouldRedraw(this);
4223 }
4224 
4226 {
4227  qApp->processEvents();
4228  GetMythMainWindow()->JumpTo("Reload Theme");
4229 }
4230 
4232 {
4233  GroupSetting* screen = new GroupSetting();
4234  screen->setLabel(tr("Theme / Screen Settings"));
4235  addChild(screen);
4236 
4237 #if ! CONFIG_DARWIN
4238  screen->addChild(ThemePainter());
4239 #endif
4240  screen->addChild(MenuTheme());
4241 
4243  {
4244  screen->addChild(XineramaScreen());
4246  }
4247 
4248 // screen->addChild(DisplaySizeHeight());
4249 // screen->addChild(DisplaySizeWidth());
4250 
4251  screen->addChild(new GuiDimension());
4252 
4253  screen->addChild(GuiSizeForTV());
4254  screen->addChild(HideMouseCursor());
4255  screen->addChild(RunInWindow());
4256  screen->addChild(UseFixedWindowSize());
4257  screen->addChild(AlwaysOnTop());
4258 #ifdef USING_AIRPLAY
4259  screen->addChild(AirPlayFullScreen());
4260 #endif
4261 
4262 #if defined(USING_XRANDR) || CONFIG_DARWIN
4263  const vector<DisplayResScreen> scr = GetVideoModes();
4264  if (!scr.empty())
4266 #endif
4267  GroupSetting* dates = new GroupSetting();
4268 
4269  dates->setLabel(tr("Localization"));
4270 
4271  dates->addChild(MythLanguage());
4272  dates->addChild(ISO639PreferredLanguage(0));
4273  dates->addChild(ISO639PreferredLanguage(1));
4274  dates->addChild(MythDateFormatCB());
4275  dates->addChild(MythShortDateFormat());
4276  dates->addChild(MythTimeFormat());
4277 
4278  addChild(dates);
4279 
4280  addChild(LCDEnable());
4281 }
4282 
4283 /*******************************************************************************
4284 * Channel Groups *
4285 *******************************************************************************/
4286 
4288 {
4289  public:
4291  const QString &channum, const QString &name);
4292  uint getChannelId(){return m_channelId;};
4293  private:
4294  uint m_channelId;
4295 
4296 };
4297 
4299  const QString &channum, const QString &channame)
4301  m_channelId(chanid)
4302 {
4303  setLabel(QString("%1 %2").arg(channum).arg(channame));
4304  setHelpText(tr("Select/Unselect channels for this channel group"));
4305 }
4306 
4308  int groupId = -1)
4309  :GroupSetting(),
4310  m_groupId(groupId),
4311  m_groupName(NULL)
4312 {
4313  setLabel(groupName);//TODO this should be the translated name if Favorite
4314  setValue(groupName);
4316  m_groupName->setLabel(groupName);
4317 }
4318 
4320 {
4321  //Change the name
4322  if ((m_groupName && m_groupName->haveChanged())
4323  || m_groupId == -1)
4324  {
4325  if (m_groupId == -1)//create a new group
4326  {
4327  MSqlQuery query(MSqlQuery::InitCon());
4328  QString qstr =
4329  "INSERT INTO channelgroupnames (name) VALUE (:NEWNAME);";
4330  query.prepare(qstr);
4331  query.bindValue(":NEWNAME", m_groupName->getValue());
4332 
4333  if (!query.exec())
4334  MythDB::DBError("ChannelGroupSetting::Close", query);
4335  else
4336  {
4337  //update m_groupId
4338  QString qstr = "SELECT grpid FROM channelgroupnames "
4339  "WHERE name = :NEWNAME;";
4340  query.prepare(qstr);
4341  query.bindValue(":NEWNAME", m_groupName->getValue());
4342  if (!query.exec())
4343  MythDB::DBError("ChannelGroupSetting::Close", query);
4344  else
4345  if (query.next())
4346  m_groupId = query.value(0).toUInt();
4347  }
4348  }
4349  else
4350  {
4351  MSqlQuery query(MSqlQuery::InitCon());
4352  QString qstr = "UPDATE channelgroupnames set name = :NEWNAME "
4353  " WHERE name = :OLDNAME ;";
4354  query.prepare(qstr);
4355  query.bindValue(":NEWNAME", m_groupName->getValue());
4356  query.bindValue(":OLDNAME", getValue());
4357 
4358  if (!query.exec())
4359  MythDB::DBError("ChannelGroupSetting::Close", query);
4360  else
4361  if (query.next())
4362  m_groupId = query.value(0).toUInt();
4363  }
4364  }
4365 
4366  if (m_groupId == -1)
4367  return;
4368 
4369  QList<StandardSetting *> *children = getSubSettings();
4370  if (!children)
4371  return;
4372 
4373  QList<StandardSetting *>::const_iterator i;
4374  for (i = children->constBegin(); i != children->constEnd(); ++i)
4375  {
4376  if ((*i)->haveChanged())
4377  {
4378  if ((*i) != m_groupName)
4379  {
4380  ChannelCheckBoxSetting *channel =
4381  dynamic_cast<ChannelCheckBoxSetting *>(*i);
4382  if (channel)
4383  {
4384  if (channel->boolValue())
4385  {
4387  m_groupId);
4388  }
4389  else
4390  {
4392  m_groupId);
4393  }
4394  }
4395  }
4396  }
4397  }
4398 }
4399 
4401 {
4402  clearSettings();
4403  //We can not rename the Favorite group
4404  //if (m_groupId!=1)
4405  //{
4407  m_groupName->setLabel(tr("Group name"));
4408 // if (m_groupId > -1)
4412  //}
4413 
4414  MSqlQuery query(MSqlQuery::InitCon());
4415 
4416  QString qstr =
4417  "SELECT channel.chanid, channum, name, grpid FROM channel "
4418  "LEFT JOIN channelgroup "
4419  "ON (channel.chanid = channelgroup.chanid AND grpid = :GRPID) "
4420  "ORDER BY channum+0; "; //to order by numeric value of channel number
4421 
4422  query.prepare(qstr);
4423 
4424  query.bindValue(":GRPID", m_groupId);
4425 
4426  if (!query.exec() || !query.isActive())
4427  MythDB::DBError("ChannelGroupSetting::Load", query);
4428  else
4429  {
4430  while (query.next())
4431  {
4432  ChannelCheckBoxSetting *channelCheckBox =
4433  new ChannelCheckBoxSetting(query.value(0).toUInt(),
4434  query.value(1).toString(),
4435  query.value(2).toString());
4436  channelCheckBox->setValue(!query.value(3).isNull());
4437  addChild(channelCheckBox);
4438  }
4439  }
4440 
4442 }
4443 
4445 {
4446  //can not delete new group or Favorite
4447  return (m_groupId > 1);
4448 }
4449 
4451 {
4452  MSqlQuery query(MSqlQuery::InitCon());
4453  // Delete channels from this group
4454  query.prepare("DELETE FROM channelgroup WHERE grpid = :GRPID;");
4455  query.bindValue(":GRPID", m_groupId);
4456  if (!query.exec())
4457  MythDB::DBError("ChannelGroupSetting::deleteEntry", query);
4458 
4459  // Now delete the group from channelgroupnames
4460  query.prepare("DELETE FROM channelgroupnames WHERE grpid = :GRPID;");
4461  query.bindValue(":GRPID", m_groupId);
4462  if (!query.exec())
4463  MythDB::DBError("ChannelGroupSetting::Close", query);
4464 }
4465 
4466 
4468  : GroupSetting(),
4469  m_addGroupButton(NULL)
4470 {
4471  setLabel(tr("Channel Groups"));
4472 }
4473 
4475 {
4476  clearSettings();
4477  ButtonStandardSetting *newGroup =
4478  new ButtonStandardSetting(tr("(Create New Channel Group)"));
4479  connect(newGroup, SIGNAL(clicked()), SLOT(ShowNewGroupDialog()));
4480  addChild(newGroup);
4481 
4482  addChild(new ChannelGroupSetting(tr("Favorites"), 1));
4483 
4484  MSqlQuery query(MSqlQuery::InitCon());
4485 
4486  QString qstr = "SELECT grpid, name FROM channelgroupnames "
4487  " WHERE grpid <> 1 "
4488  " ORDER BY name ; ";
4489 
4490  query.prepare(qstr);
4491 
4492  if (!query.exec() || !query.isActive())
4493  MythDB::DBError("ChannelGroupsSetting::Load", query);
4494  else
4495  {
4496  while(query.next())
4497  {
4498  addChild(new ChannelGroupSetting(query.value(1).toString(),
4499  query.value(0).toUInt()));
4500  }
4501  }
4502 
4503  //Load all the groups
4505  //TODO select the new one or the edited one
4506  emit settingsChanged(NULL);
4507 }
4508 
4509 
4511 {
4512  MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack");
4513  MythTextInputDialog *settingdialog =
4514  new MythTextInputDialog(popupStack,
4515  tr("Enter the name of the new channel group"));
4516 
4517  if (settingdialog->Create())
4518  {
4519  connect(settingdialog, SIGNAL(haveResult(QString)),
4520  SLOT(CreateNewGroup(QString)));
4521  popupStack->AddScreen(settingdialog);
4522  }
4523  else
4524  {
4525  delete settingdialog;
4526  }
4527 }
4528 
4530 {
4531  ChannelGroupSetting *button = new ChannelGroupSetting(name,-1);
4532  button->setLabel(name);
4533  button->Load();
4534  addChild(button);
4535  emit settingsChanged(this);
4536 }
4537 
4538 
4539 // vim:set sw=4 ts=4 expandtab:
static DisplayRes * GetDisplayRes(bool lock=false)
Factory method that returns a DisplayRes singleton.
Definition: DisplayRes.cpp:18
static HostComboBoxSetting MUNUSED * DecodeVBIFormat()
TriggeredConfigurationGroup(bool uselabel=true, bool useframe=true, bool zeroMargin=false, bool zeroSpace=false, bool stack_uselabel=true, bool stack_useframe=true, bool stack_zeroMargin=false, bool stack_zeroSpace=false)
bool next(void)
Wrap QSqlQuery::next() so we can display the query results.
Definition: mythdbcon.cpp:810
static HostCheckBoxSetting * EnableMediaMon()
#define MUNUSED
Definition: mythexp.h:20
TransTextEditSetting * height_range
static HostCheckBoxSetting * LCDShowGeneric()
static QStringList GetDecoders(void)
static HostCheckBoxSetting * PersistentBrowseMode()
TransMythUISpinBoxSetting * max_cpus
ISO 639-1 and ISO 639-2 support functions.
void vrenderChanged(const QString &renderer)
static HostCheckBoxSetting * LCDShowTime()
static HostCheckBoxSetting * LCDShowMenu()
static HostCheckBoxSetting * EnableMHEG()
HostCheckBoxSetting(const QString &name)
void bindValue(const QString &placeholder, const QVariant &val)
Definition: mythdbcon.cpp:915
static HostComboBoxSetting * ThemePainter()
#define D3D9_PAINTER
Definition: mythuidefines.h:6
#define OPENGL_PAINTER
Definition: mythuidefines.h:3
StandardSetting * m_height
static QString GetDeinterlacerName(const QString &short_name)
unsigned int slots[4]
Definition: element.c:38
void orenderChanged(const QString &renderer)
ChannelCheckBoxSetting(uint chanid, const QString &channum, const QString &name)
void DeleteProfileItem(PlaybackProfileItemConfig *profile)
static HostSpinBoxSetting * NetworkControlPort()
StandardSetting * InitProfileItem(uint, StandardSetting *)
TransMythUICheckBoxSetting * osdfade
static QStringList GetOSDs(const QString &video_renderer)
static GlobalComboBoxSetting * CommercialSkipMethod()
static HostComboBoxSetting * PlayBoxEpisodeSort()
static HostCheckBoxSetting * UseVideoModes()
static uint GetProfileGroupID(const QString &profilename, const QString &hostname)
Dialog asking for user confirmation.
virtual void childChanged(StandardSetting *)
ChannelGroupSetting(const QString &groupName, int groupId)
static HostCheckBoxSetting * RememberRecGroup()
virtual void clearSettings()
static HostCheckBoxSetting * PBBStartInTitle()
static void CreateProfiles(const QString &hostname)
static HostCheckBoxSetting * LCDEnable()
static HostCheckBoxSetting * UseFixedWindowSize()
MythConfirmationDialog * ShowOkPopup(const QString &message, QObject *parent, const char *slot, bool showCancel)
Non-blocking version of MythPopupBox::showOkPopup()
static HostSpinBoxSetting * HorizScanPercentage()
QString toString(MarkTypes type)
void deint1Changed(const QString &deint)
static GlobalComboBoxSetting * ISO639PreferredLanguage(uint i)
static QStringList GetDecoderNames(void)
static GlobalSpinBoxSetting * AutoExpireExtraSpace()
const std::vector< double > GetRefreshRates(int width, int height) const
Returns refresh rates available at a specific screen resolution.
Definition: DisplayRes.cpp:238
StandardSetting * m_HorizScan
TransMythUIComboBoxSetting * deint0
static void SetDefaultProfileName(const QString &profilename, const QString &hostname)
static HostCheckBoxSetting * LCDBacklightOn()
virtual void updateButton(MythUIButtonListItem *item)
This method is called whenever the UI need to reflect a change Reimplement this If you widget need a ...
static HostTextEditSetting * LircDaemonDevice()
StandardSetting * getParent() const
void decoderChanged(const QString &dec)
QSqlQuery wrapper that fetches a DB connection from the connection pool.
Definition: mythdbcon.h:125
StandardSetting * m_rebootCommand
TransTextEditSetting * width_range
virtual void Load(void)
Basic menu dialog, message and a list of options.
static HostComboBoxSetting * PlaybackExitPrompt()
void addSelection(const QString &label, QString value=QString(), bool select=false)
virtual void ChangeResolution(StandardSetting *)
static QString GetDecoderName(const QString &decoder)
static GlobalCheckBoxSetting * AutoExpireWatchedPriority()
virtual void setHelpText(const QString &str)
static QString GetDecoderHelp(QString decoder=QString())
virtual bool Create(void)
static item_list_t LoadDB(uint groupid)
virtual bool canDelete(void)
const QLocale GetQLocale(void)
StandardSetting * m_width
QString getLabel(void) const
int GetItemPos(MythUIButtonListItem *item) const
void widthChanged(const QString &dec)
virtual void addChild(Configurable *child)
static bool IsFilterAllowed(const QString &video_renderer)
static GlobalSpinBoxSetting * GRSignLangRecPriority()
vector< ChannelGroupItem > ChannelGroupList
Definition: channelgroup.h:32
TransTextEditSetting * m_groupName
void setChanged(bool changed)
static GlobalSpinBoxSetting * GRCCRecPriority()
MythScreenStack * GetStack(const QString &stackname)
StandardSetting * m_offsetY
static GroupSetting * CategoryOverTimeSettings()
static HostComboBoxSetting * PlayBoxOrdering()
void setDrawArrow(bool flag)
static HostCheckBoxSetting * ChannelGroupRememberLast()
static HostTextEditSetting * IgnoreMedia()
QString SkipTypeToString(int flags)
unsigned int uint
Definition: compat.h:136
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
void AddItem(const QString &title, QVariant data=0, MythMenu *subMenu=NULL, bool selected=false, bool checked=false)
static bool DeleteDB(uint groupid, const item_list_t &)
static HostSpinBoxSetting * FFRewReposTime()
static HostCheckBoxSetting * AutomaticSetWatched()
static QString GetOSDHelp(const QString &osd)
static GlobalSpinBoxSetting * GRHDTVRecPriority()
static HostCheckBoxSetting * DefaultCCMode()
TransMythUIComboBoxSetting * decoder
StandardSetting * m_VertScan
static HostCheckBoxSetting * NetworkControlEnabled()
static GlobalSpinBoxSetting * GRWSRecPriority()
static GlobalSpinBoxSetting * GRAudioDescRecPriority()
static GlobalSpinBoxSetting * AutoExpireLiveTVMaxAge()
static HostComboBoxSetting * SubtitleCodec()
static GlobalSpinBoxSetting * DeferAutoTranscodeDays()
virtual void setValue(const QString &)
const DisplayResVector GetVideoModes(void)
Definition: DisplayRes.cpp:262
PlaybackProfileConfig * parentConfig
VideoModeSettings(const char *c)
static HostTextEditSetting * SetupPinCode()
static HostCheckBoxSetting * UseProgStartMark()
static const vector< double > GetRefreshRates(const QString &resolution)
static HostRefreshRateComboBoxSetting * TVVidModeRefreshRate(int idx=-1)
virtual void childChanged(StandardSetting *)
static GlobalSpinBoxSetting * GRHardHearRecPriority()
static HostSpinBoxSetting * LiveTVIdleTimeout()
static HostCheckBoxSetting * ClearSavedPosition()
MythUIComboBoxSetting * m_playbackProfiles
static HostComboBoxSetting * CurrentPlaybackProfile()
virtual QString getValue(void) const
static QStringList GetDeinterlacers(const QString &video_renderer)
#define OPENGL2_PAINTER
Definition: mythuidefines.h:4
static GlobalSpinBoxSetting * GROnScrSubRecPriority()
static HostCheckBoxSetting * RecGroupMod()
static HostSpinBoxSetting * YScanDisplacement()
virtual void updateButton(MythUIButtonListItem *item)
This method is called whenever the UI need to reflect a change Reimplement this If you widget need a ...
QVariant value(int i) const
Definition: mythdbcon.h:182
static HostTextEditSetting * ScreenShotPath()
TransMythUIComboBoxSetting * deint1
AspectOverrideMode
Definition: videoouttypes.h:46
bool SendReceiveStringList(QStringList &strlist, bool quickTimeout=false, bool block=true)
Send a message to the backend and wait for a response.
static GlobalComboBoxSetting * MythLanguage()
virtual void AddScreen(MythScreenType *screen, bool allowFade=true)
static HostSpinBoxSetting * CommNotifyAmount()
static GlobalCheckBoxSetting * CommFlagFast()
static HostCheckBoxSetting * RealtimePriority()
static HostTextEditSetting * HaltCommand()
void GetResolutionSetting(const QString &type, int &width, int &height, double &forced_aspect, double &refreshrate, int index=-1)
static HostSpinBoxSetting * AudioReadAhead()
static HostCheckBoxSetting * LCDShowRecStatus()
static bool DeleteChannel(uint chanid, int changrpid)
static HostCheckBoxSetting * GuiSizeForTV()
TransMythUICheckBoxSetting * skiploop
MythUIComboBoxSetting * codecs
void ShouldRedraw(StandardSetting *)
static HostComboBoxSetting * DisplayRecGroup()
StandardSetting * m_YScan
static HostSpinBoxSetting * FrontendIdleTimeout()
virtual void setLabel(QString str)
static HostSpinBoxSetting * GuiWidth()
static ChannelGroupList GetChannelGroups(bool includeEmpty=true)
virtual void deleteEntry(void)
static GlobalSpinBoxSetting * MaximumCommercialSkip()
static HostComboBoxSetting * DisplayGroupTitleSort()
QDateTime current(bool stripped)
Returns current Date and Time in UTC.
Definition: mythdate.cpp:10
static HostComboBoxSetting * MythDateFormatCB()
QString GetSetting(const QString &key, const QString &defaultval="")
static GlobalSpinBoxSetting * GRPrefInputRecPriority()
static HostCheckBoxSetting * LCDHeartBeatOn()
static HostComboBoxSetting * LCDShowMusicItems()
QList< ThemeInfo > GetThemes(ThemeType type)
TransMythUIComboBoxSetting * vidrend
static int GetNumberXineramaScreens(void)
virtual void updateButton(MythUIButtonListItem *item)
This method is called whenever the UI need to reflect a change Reimplement this If you widget need a ...
bool haveChanged()
Return true if the setting have changed or any of its children.
bool isActive(void) const
Definition: mythdbcon.h:188
MythUIButtonList * m_buttonList
static HostSpinBoxSetting * XScanDisplacement()
PlaybackProfileItemConfig(PlaybackProfileConfig *parent, uint idx, ProfileItem &_item)
static QMap< QString, QString > getLanguages(void)
static QString GetDefaultProfileName(const QString &hostname)
static QString GetPreferredVideoRenderer(const QString &decoder)
QVariant GetDataValue() const
virtual void setEnabled(bool enabled)
static HostComboBoxSetting * MenuTheme()
TransMythUICheckBoxSetting * m_markForDeletion
void SetText(const QString &text, const QString &name="", const QString &state="")
static HostSpinBoxSetting * PlaybackWLBlackOut()
static MSqlQueryInfo InitCon(ConnectionReuse=kNormalConnection)
Only use this in combination with MSqlQuery constructor.
Definition: mythdbcon.cpp:555
static HostCheckBoxSetting * UseVirtualKeyboard()
void JumpTo(const QString &destination, bool pop=true)
static HostTextEditSetting * UDPNotifyPort()
static HostCheckBoxSetting * LCDBigClock()
static HostComboBoxSetting * AspectOverride()
static uint CreateProfileGroup(const QString &groupname, const QString &hostname)
static HostComboBoxSetting * MythShortDateFormat()
void CreateNewGroup(QString name)
static QString i18n(const QString &)
Translations for play,recording, & storage groups +.
PlaybackProfileConfig(const QString &profilename, StandardSetting *parent)
const char * name
Definition: ParseText.cpp:339
static HostCheckBoxSetting * QueryInitialFilter()
void deint0Changed(const QString &deint)
static HostCheckBoxSetting * BrowseChannelGroup()
static GlobalSpinBoxSetting * DeletedMaxAge()
static HostComboBoxSetting * ChannelFormat()
virtual void updateButton(MythUIButtonListItem *item)
This method is called whenever the UI need to reflect a change Reimplement this If you widget need a ...
static HostComboBoxSetting * MythTimeFormat()
static GlobalSpinBoxSetting * RecordPreRoll()
static HostSpinBoxSetting * VidModeHeight(int idx)
static HostTextEditSetting * LCDKeyString()
static GlobalSpinBoxSetting * MergeShortCommBreaks()
TransMythUIComboBoxSetting * osdrend
static HostComboBoxSetting * TVVidModeForceAspect(int idx=-1)
static HostCheckBoxSetting * EnableMHEGic()
virtual QList< StandardSetting * > * getSubSettings()
MythUIHelper * GetMythUI()
static HostCheckBoxSetting * FFRewReverse()
static HostTextEditSetting * RebootCommand()
static HostCheckBoxSetting * HideMouseCursor()
virtual void childChanged(StandardSetting *)
virtual void addChild(StandardSetting *child)
static GlobalSpinBoxSetting * AutoExpireDayPriority()
MythMainWindow * GetMythMainWindow(void)
static GlobalComboBoxSetting * GRSchedOpenEnd()
StandardSetting * m_overrideExitMenu
static HostCheckBoxSetting * JumpToProgramOSD()
static HostSpinBoxSetting * LCDPopupTime()
static HostCheckBoxSetting * PlaybackWLAutoExpire()
deque< int > GetPreferredSkipTypeCombinations(void)
static HostCheckBoxSetting * ContinueEmbeddedTVPlay()
PIPLocation
Definition: videoouttypes.h:19
static HostCheckBoxSetting * EndOfRecordingExitPrompt()
AdjustFillMode
Definition: videoouttypes.h:57
static GlobalComboBoxSetting * AutoExpireMethod()
bool checkRange(QString key, float fvalue, bool *ok=Q_NULLPTR) const
static HostComboBoxSetting * ChannelOrdering()
static MythThemedMenu * menu
Dialog prompting the user to enter a text string.
void setVisible(bool visible)
bool prepare(const QString &query)
QSqlQuery::prepare() is not thread safe in Qt <= 3.3.2.
Definition: mythdbcon.cpp:835
virtual void Load(void)
static HostSpinBoxSetting * EPGRecThreshold()
static GlobalSpinBoxSetting * RecordOverTime()
static HostSpinBoxSetting * PlaybackWLMaxAge()
static HostSpinBoxSetting * GuiOffsetX()
static HostCheckBoxSetting * LCDShowMusic()
#define LOG(_MASK_, _LEVEL_, _STRING_)
Definition: mythlogging.h:38
static HostComboBoxSetting * OverrideExitMenu()
static HostComboBoxSetting * XineramaMonitorAspectRatio()
static HostTextEditSetting * DefaultTVChannel()
QString iso639_str2_to_str3(const QString &str2)
Definition: iso639.cpp:70
StandardSetting * m_haltCommand
static HostCheckBoxSetting * AlwaysOnTop()
static int FindBestMatch(const DisplayResVector &dsr, const DisplayResScreen &d, double &target_rate)
static QString GetDeinterlacerHelp(const QString &deint)
static HostSpinBoxSetting * GuiOffsetY()
static HostCheckBoxSetting * RunInWindow()
void settingsChanged(StandardSetting *selectedSetting=NULL)
static QString GetVideoRendererHelp(const QString &renderer)
void SetReturnEvent(QObject *retobject, const QString &resultid)
static GlobalCheckBoxSetting * AggressiveCommDetect()
static bool AddChannel(uint chanid, int changrpid)
QString Get(const QString &value) const
virtual void setLabel(QString str)
Definition: settings.h:57
void swap(int indexA, int intexB)
static HostSpinBoxSetting * GuiHeight()
void ShowPlaybackProfileMenu(MythUIButtonListItem *item)
void Set(const QString &value, const QString &data)
LetterBoxColour
Definition: videoouttypes.h:72
static HostComboBoxSetting * LongChannelFormat()
static bool DeleteProfileGroup(const QString &groupname, const QString &hostname)
void framerateChanged(const QString &dec)
static HostCheckBoxSetting * LCDShowVolume()
static HostComboBoxSetting * ChannelGroupDefault()
void removeTargetedChild(const QString &value, StandardSetting *child)
static GlobalComboBoxSetting * OverTimeCategory()
static HostComboBoxSetting * AutoCommercialSkip()
void SetItemCurrent(MythUIButtonListItem *item)
Scheduler * sched
#define QT_PAINTER
Definition: mythuidefines.h:2
static bool SaveDB(uint groupid, item_list_t &)
static QString iso639_key_to_str3(int code)
Definition: iso639.h:46
void setTrigger(Configurable *_trigger)
static QStringList GetProfiles(const QString &hostname)
ButtonStandardSetting * m_addNewEntry
static HostComboBoxSetting * LetterboxingColour()
bool exec(void)
Wrap QSqlQuery::exec() so we can display SQL.
Definition: mythdbcon.cpp:623
virtual void applyChange()
static HostCheckBoxSetting * PlaybackWatchList()
#define AUTO_PAINTER
Definition: mythuidefines.h:5
StandardSetting * m_XScan
The DisplayRes module allows for the display resolution and refresh rateto be changed "on the fly"...
Definition: DisplayRes.h:32
ButtonStandardSetting * m_newPlaybackProfileButton
TransTextEditSetting * filters
static GlobalSpinBoxSetting * CategoryOverTime()
virtual void updateButton(MythUIButtonListItem *item)
This method is called whenever the UI need to reflect a change Reimplement this If you widget need a ...
static void DBError(const QString &where, const MSqlQuery &query)
Definition: mythdb.cpp:181
int GetCurrentPos() const
static HostCheckBoxSetting * BrowseAllTuners()
static QStringList GetVideoRenderers(const QString &decoder)
void NewPlaybackProfileSlot(void)
static void ISO639_fill_selections(MythUIComboBoxSetting *widget, uint i)
QString GetLanguage(void)
Returns two character ISO-639 language descriptor for UI language.
void heightChanged(const QString &dec)
static HostCheckBoxSetting * LCDShowChannel()
QString GetHostName(void)
bool keyPressEvent(QKeyEvent *)
static HostCheckBoxSetting * SmartForward()
void addTargetedChild(const QString &value, StandardSetting *setting)
static HostComboBoxSetting * GuiVidModeResolution()
static HostComboBoxSetting * PIPLocationComboBox()
static HostSpinBoxSetting * VidModeWidth(int idx)
PlaybackSettingsDialog(MythScreenStack *stack)
virtual void setValue(const QString &newValue)
StandardSetting * m_offsetX
virtual void applyChange()
void childChanged(StandardSetting *)
static GlobalCheckBoxSetting * RerecordWatched()
static HostSpinBoxSetting * CommRewindAmount()
static HostComboBoxSetting * AdjustFill()
TransTextEditSetting * framerate
static HostComboBoxSetting * XineramaScreen()
static HostCheckBoxSetting * PlaybackWLStart()
void ShowMenu(void)
Definition: globalsett