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