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
73 static HostCheckBoxSetting *FFmpegDemuxer()
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
374 static GlobalCheckBoxSetting *AutoExpireInsteadOfDelete()
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...
413 class DeletedExpireOptions : public TriggeredConfigurationGroup
414 {
415  public:
416  DeletedExpireOptions() :
417  TriggeredConfigurationGroup(false, false, false, false)
418  {
419  setLabel("DeletedExpireOptions");
420  Setting* enabled = AutoExpireInsteadOfDelete();
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...
504 static GlobalSpinBoxSetting *MinRecordDiskThreshold()
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 {
637  max_cpus = new TransMythUISpinBoxSetting(1, HAVE_THREADS ? 4 : 1, 1, true);
645 
646  const QString rangeHelp(tr(" Valid formats for the setting are "
647  "[nnnn - nnnn], [> nnnn], [>= nnnn], [< nnnn], "
648  "[<= nnnn]. Also [nnnn] for an exact match. "
649  "You can also use more than 1 expression with & between."));
650  const QString rangeHelpDec(tr("Numbers can have up to 3 decimal places."));
651  width_range->setLabel(tr("Width Range"));
652  width_range->setHelpText(tr("Optional setting to restrict this profile "
653  "to videos with a selected width range. ") + rangeHelp);
654  height_range->setLabel(tr("Height Range"));
655  height_range->setHelpText(tr("Optional setting to restrict this profile "
656  "to videos with a selected height range. ") + rangeHelp);
657  codecs->setLabel(tr("Video Formats"));
658  codecs->addSelection("","",true);
659  codecs->addSelection("mpeg2video");
660  codecs->addSelection("mpeg4");
661  codecs->addSelection("h264");
662  codecs->addSelection("hevc");
663  codecs->setHelpText(tr("Optional setting to restrict this profile "
664  "to a video format or formats. You can also type in a format "
665  "or several formats separated by space. "
666  "To find the format for a video use ffprobe and look at the "
667  "word after \"Video:\". Also you can get a complete list "
668  "of available formats with ffmpeg -codecs."));
669  framerate->setLabel(tr("Frame Rate Range"));
670  framerate->setHelpText(tr("Optional setting to restrict this profile "
671  "to a range of frame rates. ") + rangeHelp +" "+rangeHelpDec);
672  decoder->setLabel(tr("Decoder"));
673  max_cpus->setLabel(tr("Max CPUs"));
674  skiploop->setLabel(tr("Deblocking filter"));
675  vidrend->setLabel(tr("Video renderer"));
676  osdrend->setLabel(tr("OSD renderer"));
677  osdfade->setLabel(tr("OSD fade"));
678  deint0->setLabel(tr("Primary deinterlacer"));
679  deint1->setLabel(tr("Fallback deinterlacer"));
680  filters->setLabel(tr("Custom filters"));
681 
683  tr("Maximum number of CPU cores used for video decoding and filtering.") +
684  (HAVE_THREADS ? "" :
685  tr(" Multithreaded decoding disabled-only one CPU "
686  "will be used, please recompile with "
687  "--enable-ffmpeg-pthreads to enable.")));
688 
690  tr("Example custom filter list: 'ivtc,denoise3d'"));
691 
693  tr("When unchecked the deblocking loopfilter will be disabled ") + "\n" +
694  tr("Disabling will significantly reduce the load on the CPU "
695  "when watching HD H.264 but may significantly reduce video quality."));
696 
698  tr("When unchecked the OSD will not fade away but instead "
699  "will disappear abruptly.") + '\n' +
700  tr("Uncheck this if the video studders while the OSD is "
701  "fading away."));
702 
705  addChild(codecs);
707  addChild(decoder);
710  addChild(vidrend);
711  addChild(osdrend);
712  addChild(osdfade);
713 
714  addChild(deint0);
715  addChild(deint1);
716  addChild(filters);
717 
718  connect(width_range, SIGNAL(valueChanged(const QString&)),
719  this, SLOT(widthChanged(const QString&)));
720  connect(height_range, SIGNAL(valueChanged(const QString&)),
721  this, SLOT(heightChanged(const QString&)));
722  connect(codecs, SIGNAL(valueChanged(const QString&)),
723  this, SLOT(InitLabel()));
724  connect(framerate, SIGNAL(valueChanged(const QString&)),
725  this, SLOT(framerateChanged(const QString&)));
726  connect(decoder, SIGNAL(valueChanged(const QString&)),
727  this, SLOT(decoderChanged(const QString&)));
728  connect(vidrend, SIGNAL(valueChanged(const QString&)),
729  this, SLOT(vrenderChanged(const QString&)));
730  connect(osdrend, SIGNAL(valueChanged(const QString&)),
731  this, SLOT(orenderChanged(const QString&)));
732  connect(deint0, SIGNAL(valueChanged(const QString&)),
733  this, SLOT(deint0Changed(const QString&)));
734  connect(deint1, SIGNAL(valueChanged(const QString&)),
735  this, SLOT(deint1Changed(const QString&)));
736 }
737 
739 {
740  return index;
741 }
742 
744 {
745  QString width_value;
746  QString height_value;
747  // pref_cmp0 and pref_cmp1 are no longer used. This code
748  // is here to convery them to the new settings cond_width
749  // and cond_height
750  for (uint i = 0; i < 2; ++i)
751  {
752  QString pcmp = item.Get(QString("pref_cmp%1").arg(i));
753  if (pcmp == "> 0 0")
754  continue;
755  QStringList clist = pcmp.split(" ");
756 
757  if (clist.size() < 3)
758  continue;
759  if (!width_value.isEmpty())
760  {
761  width_value.append("&");
762  height_value.append("&");
763  }
764  width_value.append(clist[0]+clist[1]);
765  height_value.append(clist[0]+clist[2]);
766  }
767 
768  QString tmp = item.Get("cond_width").trimmed();
769  if (!tmp.isEmpty())
770  {
771  if (!width_value.isEmpty())
772  width_value.append("&");
773  width_value.append(tmp);
774  }
775  tmp = item.Get("cond_height").trimmed();
776  if (!tmp.isEmpty())
777  {
778  if (!height_value.isEmpty())
779  height_value.append("&");
780  height_value.append(tmp);
781  }
782 
783  width_range->setValue(width_value);
784  height_range->setValue(height_value);
785  codecs->setValue(item.Get("cond_codecs"));
786  framerate->setValue(item.Get("cond_framerate"));
787 
788  QString pdecoder = item.Get("pref_decoder");
789  QString pmax_cpus = item.Get("pref_max_cpus");
790  QString pskiploop = item.Get("pref_skiploop");
791  QString prenderer = item.Get("pref_videorenderer");
792  QString posd = item.Get("pref_osdrenderer");
793  QString posdfade = item.Get("pref_osdfade");
794  QString pdeint0 = item.Get("pref_deint0");
795  QString pdeint1 = item.Get("pref_deint1");
796  QString pfilter = item.Get("pref_filters");
797  bool found = false;
798 
799  QString dech = VideoDisplayProfile::GetDecoderHelp();
800  QStringList decr = VideoDisplayProfile::GetDecoders();
801  QStringList decn = VideoDisplayProfile::GetDecoderNames();
802  QStringList::const_iterator itr = decr.begin();
803  QStringList::const_iterator itn = decn.begin();
805  for (; (itr != decr.end()) && (itn != decn.end()); ++itr, ++itn)
806  {
807  decoder->addSelection(*itn, *itr, (*itr == pdecoder));
808  found |= (*itr == pdecoder);
809  }
810  if (!found && !pdecoder.isEmpty())
811  {
813  VideoDisplayProfile::GetDecoderName(pdecoder), pdecoder, true);
814  }
816 
817  if (!pmax_cpus.isEmpty())
818  max_cpus->setValue(pmax_cpus.toUInt());
819 
820  skiploop->setValue((!pskiploop.isEmpty()) ? (bool) pskiploop.toInt() : true);
821 
822  if (!prenderer.isEmpty())
823  vidrend->setValue(prenderer);
824  if (!posd.isEmpty())
825  osdrend->setValue(posd);
826 
827  osdfade->setValue((!posdfade.isEmpty()) ? (bool) posdfade.toInt() : true);
828 
829  if (!pdeint0.isEmpty())
830  deint0->setValue(pdeint0);
831  if (!pdeint1.isEmpty())
832  deint1->setValue(pdeint1);
833  if (!pfilter.isEmpty())
834  filters->setValue(pfilter);
835 
837 }
838 
840 {
841  item.Set("pref_cmp0", QString());
842  item.Set("pref_cmp1", QString());
843  item.Set("cond_width", width_range->getValue());
844  item.Set("cond_height", height_range->getValue());
845  item.Set("cond_codecs", codecs->getValue());
846  item.Set("cond_framerate", framerate->getValue());
847  item.Set("pref_decoder", decoder->getValue());
848  item.Set("pref_max_cpus", max_cpus->getValue());
849  item.Set("pref_skiploop", (skiploop->boolValue()) ? "1" : "0");
850  item.Set("pref_videorenderer", vidrend->getValue());
851  item.Set("pref_osdrenderer", osdrend->getValue());
852  item.Set("pref_osdfade", (osdfade->boolValue()) ? "1" : "0");
853  item.Set("pref_deint0", deint0->getValue());
854  item.Set("pref_deint1", deint1->getValue());
855 
856  QString tmp0 = filters->getValue();
857  QString tmp1 = vidrend->getValue();
858  QString tmp3 = VideoDisplayProfile::IsFilterAllowed(tmp1) ? tmp0 : "";
859  item.Set("pref_filters", tmp3);
860 }
861 
863 {
864  bool ok = true;
865  QString oldvalue = item.Get("cond_width");
866  item.Set("cond_width",val);
867  item.checkRange("cond_width", 640, &ok);
868  if (!ok)
869  {
870  ShowOkPopup(tr("Invalid width specification(%1), discarded").arg(val));
871  width_range->setValue(oldvalue);
872  }
873  InitLabel();
874 }
875 
877 {
878  bool ok = true;
879  QString oldvalue = item.Get("cond_height");
880  item.Set("cond_height",val);
881  item.checkRange("cond_height", 480, &ok);
882  if (!ok)
883  {
884  ShowOkPopup(tr("Invalid height specification(%1), discarded").arg(val));
885  height_range->setValue(oldvalue);
886  }
887  InitLabel();
888 }
889 
891 {
892  bool ok = true;
893  QString oldvalue = item.Get("cond_framerate");
894  item.Set("cond_framerate",val);
895  item.checkRange("cond_framerate", 25.0f, &ok);
896  if (!ok)
897  {
898  ShowOkPopup(tr("Invalid frame rate specification(%1), discarded").arg(val));
899  framerate->setValue(oldvalue);
900  }
901  InitLabel();
902 }
903 
905 {
906  QString vrenderer = vidrend->getValue();
907  QStringList renderers = VideoDisplayProfile::GetVideoRenderers(dec);
908  QStringList::const_iterator it;
909 
910  QString prenderer;
911  for (it = renderers.begin(); it != renderers.end(); ++it)
912  prenderer = (*it == vrenderer) ? vrenderer : prenderer;
913  if (prenderer.isEmpty())
915 
917  for (it = renderers.begin(); it != renderers.end(); ++it)
918  {
919  if ((*it != "null") && (*it != "nullvaapi") && (*it != "nullvdpau"))
920  vidrend->addSelection(*it, *it, (*it == prenderer));
921  }
922 
924 
925  InitLabel();
926 }
927 
928 void PlaybackProfileItemConfig::vrenderChanged(const QString &renderer)
929 {
930  QStringList osds = VideoDisplayProfile::GetOSDs(renderer);
931  QStringList deints = VideoDisplayProfile::GetDeinterlacers(renderer);
932  QString losd = osdrend->getValue();
933  QString ldeint0 = deint0->getValue();
934  QString ldeint1 = deint1->getValue();
935  QStringList::const_iterator it;
936 
938  for (it = osds.begin(); it != osds.end(); ++it)
939  osdrend->addSelection(*it, *it, (*it == losd));
940 
942  for (it = deints.begin(); it != deints.end(); ++it)
943  {
945  *it, (*it == ldeint0));
946  }
947 
949  for (it = deints.begin(); it != deints.end(); ++it)
950  {
951  if (!(*it).contains("bobdeint") && !(*it).contains("doublerate") &&
952  !(*it).contains("doubleprocess"))
954  *it, (*it == ldeint1));
955  }
956 
959 
960  InitLabel();
961 }
962 
963 void PlaybackProfileItemConfig::orenderChanged(const QString &renderer)
964 {
966 }
967 
969 {
971  tr("Main deinterlacing method. %1")
973 }
974 
976 {
978  tr("Fallback deinterlacing method. %1")
980 }
981 
983 {
984  QStringList actions;
985 
986  if (GetMythMainWindow()->TranslateKeyPress("Global", e, actions))
987  return true;
988 
989  foreach (const QString &action, actions)
990  {
991  if (action == "DELETE")
992  {
994  return true;
995  }
996  }
997 
998  return false;
999 }
1000 
1002 {
1003  QString message = tr("Remove this profile item?");
1004  MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack");
1005  MythConfirmationDialog *confirmDelete =
1006  new MythConfirmationDialog(popupStack, message, true);
1007 
1008  if (confirmDelete->Create())
1009  {
1010  connect(confirmDelete, SIGNAL(haveResult(bool)),
1011  SLOT(DoDeleteSlot(bool)));
1012  popupStack->AddScreen(confirmDelete);
1013  }
1014  else
1015  delete confirmDelete;
1016 }
1017 
1019 {
1020  if (doDelete)
1022 }
1023 
1025 {
1026  parentConfig->swap(index, index + 1);
1027 }
1028 
1030 {
1031  parentConfig->swap(index, index - 1);
1032 }
1033 
1035  StandardSetting *parent) :
1036  profile_name(profilename),
1037  groupid(0)
1038 {
1039  setVisible(false);
1043  InitUI(parent);
1044 }
1045 
1047 {
1048 }
1049 
1051 {
1052  QString andStr = tr("&", "and");
1053  QString str;
1054 
1055  QString width = width_range->getValue();
1056  if (!width.isEmpty())
1057  str += " " + tr("width","video formats") + " " + width;
1058  QString height = height_range->getValue();
1059  if (!height.isEmpty())
1060  str += " " + tr("height","video formats") + " " + height;
1061 
1062  QString codecsval = codecs->getValue();
1063  if (!codecsval.isEmpty())
1064  str += " " + tr("formats","video formats") + " " + codecsval;
1065  QString framerateval = framerate->getValue();
1066  if (!framerateval.isEmpty())
1067  str += " " + tr("framerate") + " " + framerateval;
1068 
1069  str += " -> ";
1070  str += decoder->getValue();
1071  str += " " + andStr + ' ';
1072  str += vidrend->getValue();
1073  str.replace("-blit", "");
1074  str.replace("ivtv " + andStr + " ivtv", "ivtv");
1075  str.replace("xvmc " + andStr + " xvmc", "xvmc");
1076  str.replace("xvmc", "XvMC");
1077  str.replace("xv", "XVideo");
1078 
1079  setLabel(str);
1080 }
1081 
1083 {
1085  m_markForDeletion->setLabel(tr("Mark for deletion"));
1086  m_addNewEntry = new ButtonStandardSetting(tr("Add New Entry"));
1087 
1090 
1091  connect(m_addNewEntry, SIGNAL(clicked()), SLOT(AddNewEntry()));
1092 
1093  for (uint i = 0; i < items.size(); ++i)
1094  InitProfileItem(i, parent);
1095 }
1096 
1098  uint i, StandardSetting *parent)
1099 {
1101  new PlaybackProfileItemConfig(this, i, items[i]);
1102 
1103  items[i].Set("pref_priority", QString::number(i + 1));
1104 
1105  parent->addTargetedChild(profile_name, ppic);
1106  m_profiles.push_back(ppic);
1107  return ppic;
1108 }
1109 
1111 {
1113  {
1116  return;
1117  }
1118 
1120  {
1121  profile->Save();
1122  }
1123 
1125  if (!ok)
1126  {
1127  LOG(VB_GENERAL, LOG_ERR,
1128  "PlaybackProfileConfig::Save() -- failed to delete items");
1129  return;
1130  }
1131 
1133  if (!ok)
1134  {
1135  LOG(VB_GENERAL, LOG_ERR,
1136  "PlaybackProfileConfig::Save() -- failed to save items");
1137  return;
1138  }
1139 }
1140 
1142  PlaybackProfileItemConfig *profileToDelete)
1143 {
1145  {
1146  profile->Save();
1147  }
1148 
1149  uint i = profileToDelete->GetIndex();
1150  del_items.push_back(items[i]);
1151  items.erase(items.begin() + i);
1152 
1153  ReloadSettings();
1154 }
1155 
1157 {
1159  {
1160  profile->Save();
1161  }
1162 
1163  ProfileItem item;
1164 
1165  items.push_back(item);
1166 
1167  ReloadSettings();
1168 }
1169 
1171 {
1174 
1175  foreach (StandardSetting *setting, m_profiles)
1176  {
1178  }
1179  m_profiles.clear();
1180 
1181  InitUI(getParent());
1182 
1183  foreach (StandardSetting *setting, m_profiles)
1184  {
1185  setting->Load();
1186  }
1187 
1188  emit getParent()->settingsChanged();
1189  setChanged(true);
1190 }
1191 
1193 {
1195  {
1196  profile->Save();
1197  }
1198 
1199  QString pri_i = QString::number(items[i].GetPriority());
1200  QString pri_j = QString::number(items[j].GetPriority());
1201 
1202  ProfileItem item = items[j];
1203  items[j] = items[i];
1204  items[i] = item;
1205 
1206  items[i].Set("pref_priority", pri_i);
1207  items[j].Set("pref_priority", pri_j);
1208 
1209  ReloadSettings();
1210 }
1211 
1213 {
1214  HostComboBoxSetting *grouptrigger =
1215  new HostComboBoxSetting("DefaultVideoPlaybackProfile");
1216  grouptrigger->setLabel(
1217  QCoreApplication::translate("PlaybackProfileConfigs",
1218  "Current Video Playback Profile"));
1219 
1220  QString host = gCoreContext->GetHostName();
1221  QStringList profiles = VideoDisplayProfile::GetProfiles(host);
1222  if (profiles.empty())
1223  {
1225  profiles = VideoDisplayProfile::GetProfiles(host);
1226  }
1227  if (profiles.empty())
1228  return grouptrigger;
1229 
1230  if (!profiles.contains("Normal") &&
1231  !profiles.contains("High Quality") &&
1232  !profiles.contains("Slim"))
1233  {
1235  profiles = VideoDisplayProfile::GetProfiles(host);
1236  }
1237 
1238 #ifdef USING_VDPAU
1239  if (!profiles.contains("VDPAU Normal") &&
1240  !profiles.contains("VDPAU High Quality") &&
1241  !profiles.contains("VDPAU Slim"))
1242  {
1244  profiles = VideoDisplayProfile::GetProfiles(host);
1245  }
1246 #endif
1247 
1248 #if defined(Q_OS_MACX)
1249  if (VDALibrary::GetVDALibrary() != NULL)
1250  {
1251  if (!profiles.contains("VDA Normal") &&
1252  !profiles.contains("VDA High Quality") &&
1253  !profiles.contains("VDA Slim"))
1254  {
1256  profiles = VideoDisplayProfile::GetProfiles(host);
1257  }
1258  }
1259 #endif
1260 
1261 #ifdef USING_OPENGL_VIDEO
1262  if (!profiles.contains("OpenGL Normal") &&
1263  !profiles.contains("OpenGL High Quality") &&
1264  !profiles.contains("OpenGL Slim"))
1265  {
1267  profiles = VideoDisplayProfile::GetProfiles(host);
1268  }
1269 #endif
1270 
1271 #ifdef USING_GLVAAPI
1272  if (!profiles.contains("VAAPI Normal"))
1273  {
1275  profiles = VideoDisplayProfile::GetProfiles(host);
1276  }
1277 #endif
1278 
1279 #ifdef USING_OPENMAX
1280  if (!profiles.contains("OpenMAX Normal") &&
1281  !profiles.contains("OpenMAX High Quality"))
1282  {
1284  profiles = VideoDisplayProfile::GetProfiles(host);
1285  }
1286  // Special case for user upgrading from version that only
1287  // has OpenMAX Normal
1288  else if (!profiles.contains("OpenMAX High Quality"))
1289  {
1291  profiles = VideoDisplayProfile::GetProfiles(host);
1292  }
1293 #endif
1294 
1295 
1297  if (!profiles.contains(profile))
1298  {
1299  profile = (profiles.contains("Normal")) ? "Normal" : profiles[0];
1301  }
1302 
1303  QStringList::const_iterator it;
1304  for (it = profiles.begin(); it != profiles.end(); ++it)
1305  {
1306  grouptrigger->addSelection(ProgramInfo::i18n(*it), *it);
1307  grouptrigger->addTargetedChild(*it,
1308  new PlaybackProfileConfig(*it, grouptrigger));
1309  }
1310 
1311  return grouptrigger;
1312 }
1313 
1315 {
1316  QString msg = tr("Enter Playback Profile Name");
1317 
1318  MythScreenStack *popupStack =
1319  GetMythMainWindow()->GetStack("popup stack");
1320 
1321  MythTextInputDialog *settingdialog =
1322  new MythTextInputDialog(popupStack, msg);
1323 
1324  if (settingdialog->Create())
1325  {
1326  connect(settingdialog, SIGNAL(haveResult(QString)),
1327  SLOT(CreateNewPlaybackProfileSlot(const QString&)));
1328  popupStack->AddScreen(settingdialog);
1329  }
1330  else
1331  delete settingdialog;
1332 }
1333 
1335 {
1336  QString host = gCoreContext->GetHostName();
1337  QStringList not_ok_list = VideoDisplayProfile::GetProfiles(host);
1338 
1339  if (not_ok_list.contains(name) || name.isEmpty())
1340  {
1341  QString msg = (name.isEmpty()) ?
1342  tr("Sorry, playback group\nname cannot be blank.") :
1343  tr("Sorry, playback group name\n"
1344  "'%1' is already being used.").arg(name);
1345 
1346  ShowOkPopup(msg);
1347 
1348  return;
1349  }
1350 
1352  m_playbackProfiles->addTargetedChild(name,
1353  new PlaybackProfileConfig(name, m_playbackProfiles));
1354 
1355  m_playbackProfiles->addSelection(name, name, true);
1356 }
1357 
1359 {
1360  QString str[4] =
1361  {
1362  PlaybackSettings::tr("Sort all sub-titles/multi-titles Ascending"),
1363  PlaybackSettings::tr("Sort all sub-titles/multi-titles Descending"),
1364  PlaybackSettings::tr("Sort sub-titles Descending, multi-titles "
1365  "Ascending"),
1366  PlaybackSettings::tr("Sort sub-titles Ascending, multi-titles Descending"),
1367  };
1368 
1369  QString help = PlaybackSettings::tr("Selects how to sort show episodes. "
1370  "Sub-titles refers to the episodes "
1371  "listed under a specific show title. "
1372  "Multi-title refers to sections (e.g. "
1373  "\"All Programs\") which list multiple "
1374  "titles. Sections in parentheses are "
1375  "not affected.");
1376 
1377  HostComboBoxSetting *gc = new HostComboBoxSetting("PlayBoxOrdering");
1378 
1379  gc->setLabel(PlaybackSettings::tr("Episode sort orderings"));
1380 
1381  for (int i = 0; i < 4; ++i)
1382  gc->addSelection(str[i], QString::number(i));
1383 
1384  gc->setValue(1);
1385  gc->setHelpText(help);
1386 
1387  return gc;
1388 }
1389 
1391 {
1392  HostComboBoxSetting *gc = new HostComboBoxSetting("PlayBoxEpisodeSort");
1393 
1394  gc->setLabel(PlaybackSettings::tr("Sort episodes"));
1395 
1396  gc->addSelection(PlaybackSettings::tr("Record date"), "Date");
1397  gc->addSelection(PlaybackSettings::tr("Season/Episode"), "Season");
1398  gc->addSelection(PlaybackSettings::tr("Original air date"), "OrigAirDate");
1399  gc->addSelection(PlaybackSettings::tr("Program ID"), "Id");
1400 
1401  gc->setHelpText(PlaybackSettings::tr("Selects how to sort a show's "
1402  "episodes"));
1403 
1404  return gc;
1405 }
1406 
1408 {
1409  HostSpinBoxSetting *gs = new HostSpinBoxSetting("FFRewReposTime", 0, 200, 5);
1410 
1411  gs->setLabel(PlaybackSettings::tr("Fast forward/rewind reposition amount"));
1412 
1413  gs->setValue(100);
1414 
1415  gs->setHelpText(PlaybackSettings::tr("When exiting sticky keys fast "
1416  "forward/rewind mode, reposition "
1417  "this many 1/100th seconds before "
1418  "resuming normal playback. This "
1419  "compensates for the reaction time "
1420  "between seeing where to resume "
1421  "playback and actually exiting "
1422  "seeking."));
1423  return gs;
1424 }
1425 
1427 {
1428  HostCheckBoxSetting *gc = new HostCheckBoxSetting("FFRewReverse");
1429 
1430  gc->setLabel(PlaybackSettings::tr("Reverse direction in fast "
1431  "forward/rewind"));
1432 
1433  gc->setValue(true);
1434 
1435  gc->setHelpText(PlaybackSettings::tr("If enabled, pressing the sticky "
1436  "rewind key in fast forward mode "
1437  "switches to rewind mode, and "
1438  "vice versa. If disabled, it will "
1439  "decrease the current speed or "
1440  "switch to play mode if the speed "
1441  "can't be decreased further."));
1442  return gc;
1443 }
1444 
1446 {
1447  HostComboBoxSetting *gc = new HostComboBoxSetting("MenuTheme");
1448 
1449  gc->setLabel(AppearanceSettings::tr("Menu theme"));
1450 
1451  QList<ThemeInfo> themelist = GetMythUI()->GetThemes(THEME_MENU);
1452 
1453  QList<ThemeInfo>::iterator it;
1454  for( it = themelist.begin(); it != themelist.end(); ++it )
1455  {
1456  gc->addSelection((*it).GetName(), (*it).GetDirectoryName(),
1457  (*it).GetDirectoryName() == "defaultmenu");
1458  }
1459 
1460  return gc;
1461 }
1462 
1464 {
1465  QString beVBI = gCoreContext->GetSetting("VbiFormat");
1466  QString fmt = beVBI.toLower().left(4);
1467  int sel = (fmt == "pal ") ? 1 : ((fmt == "ntsc") ? 2 : 0);
1468 
1469  HostComboBoxSetting *gc = new HostComboBoxSetting("DecodeVBIFormat");
1470 
1471  gc->setLabel(OSDSettings::tr("Decode VBI format"));
1472 
1473  gc->addSelection(OSDSettings::tr("None"), "none",
1474  0 == sel);
1475  gc->addSelection(OSDSettings::tr("PAL teletext"), "pal_txt",
1476  1 == sel);
1477  gc->addSelection(OSDSettings::tr("NTSC closed caption"), "ntsc_cc",
1478  2 == sel);
1479 
1480  gc->setHelpText(
1481  OSDSettings::tr("If enabled, this overrides the mythtv-setup setting "
1482  "used during recording when decoding captions."));
1483 
1484  return gc;
1485 }
1486 
1488 {
1489  HostComboBoxSetting *gc = new HostComboBoxSetting("SubtitleCodec");
1490 
1491  gc->setLabel(OSDSettings::tr("Subtitle Codec"));
1492 
1493  QList<QByteArray> list = QTextCodec::availableCodecs();
1494 
1495  for (uint i = 0; i < (uint) list.size(); ++i)
1496  {
1497  QString val = QString(list[i]);
1498  gc->addSelection(val, val, val.toLower() == "utf-8");
1499  }
1500 
1501  return gc;
1502 }
1503 
1505 {
1506  HostComboBoxSetting *gc = new HostComboBoxSetting("ChannelOrdering");
1507 
1508  gc->setLabel(GeneralSettings::tr("Channel ordering"));
1509 
1510  gc->addSelection(GeneralSettings::tr("channel number"), "channum");
1511  gc->addSelection(GeneralSettings::tr("callsign"), "callsign");
1512 
1513  return gc;
1514 }
1515 
1517 {
1518  HostSpinBoxSetting *gs = new HostSpinBoxSetting("VertScanPercentage", -100, 100, 1);
1519 
1520  gs->setLabel(PlaybackSettings::tr("Vertical scaling"));
1521 
1522  gs->setValue(0);
1523 
1524  gs->setHelpText(PlaybackSettings::tr("Adjust this if the image does not "
1525  "fill your screen vertically. Range "
1526  "-100% to 100%"));
1527  return gs;
1528 }
1529 
1531 {
1532  HostSpinBoxSetting *gs = new HostSpinBoxSetting("HorizScanPercentage", -100, 100, 1);
1533 
1534  gs->setLabel(PlaybackSettings::tr("Horizontal scaling"));
1535 
1536  gs->setValue(0);
1537 
1538  gs->setHelpText(PlaybackSettings::tr("Adjust this if the image does not "
1539  "fill your screen horizontally. Range "
1540  "-100% to 100%"));
1541  return gs;
1542 };
1543 
1545 {
1546  HostSpinBoxSetting *gs = new HostSpinBoxSetting("XScanDisplacement", -50, 50, 1);
1547 
1548  gs->setLabel(PlaybackSettings::tr("Scan displacement (X)"));
1549 
1550  gs->setValue(0);
1551 
1552  gs->setHelpText(PlaybackSettings::tr("Adjust this to move the image "
1553  "horizontally."));
1554 
1555  return gs;
1556 }
1557 
1559 {
1560  HostSpinBoxSetting *gs = new HostSpinBoxSetting("YScanDisplacement", -50, 50, 1);
1561 
1562  gs->setLabel(PlaybackSettings::tr("Scan displacement (Y)"));
1563 
1564  gs->setValue(0);
1565 
1566  gs->setHelpText(PlaybackSettings::tr("Adjust this to move the image "
1567  "vertically."));
1568 
1569  return gs;
1570 };
1571 
1573 {
1574  HostCheckBoxSetting *gc = new HostCheckBoxSetting("DefaultCCMode");
1575 
1576  gc->setLabel(OSDSettings::tr("Always display closed captioning or "
1577  "subtitles"));
1578 
1579  gc->setValue(false);
1580 
1581  gc->setHelpText(OSDSettings::tr("If enabled, captions will be displayed "
1582  "when playing back recordings or watching "
1583  "Live TV. Closed Captioning can be turned "
1584  "on or off by pressing \"T\" during"
1585  "playback."));
1586  return gc;
1587 }
1588 
1590 {
1591  HostCheckBoxSetting *gc = new HostCheckBoxSetting("EnableMHEG");
1592 
1593  gc->setLabel(OSDSettings::tr("Enable interactive TV"));
1594 
1595  gc->setValue(false);
1596 
1597  gc->setHelpText(OSDSettings::tr("If enabled, interactive TV applications "
1598  "(MHEG) will be activated. This is used "
1599  "for teletext and logos for radio and "
1600  "channels that are currently off-air."));
1601  return gc;
1602 }
1603 
1605 {
1606  HostCheckBoxSetting *gc = new HostCheckBoxSetting("EnableMHEGic");
1607  gc->setLabel(OSDSettings::tr("Enable network access for interactive TV"));
1608  gc->setValue(true);
1609  gc->setHelpText(OSDSettings::tr("If enabled, interactive TV applications "
1610  "(MHEG) will be able to access interactive "
1611  "content over the Internet. This is used "
1612  "for BBC iPlayer."));
1613  return gc;
1614 }
1615 
1617 {
1618  HostCheckBoxSetting *gc = new HostCheckBoxSetting("PersistentBrowseMode");
1619 
1620  gc->setLabel(OSDSettings::tr("Always use browse mode in Live TV"));
1621 
1622  gc->setValue(true);
1623 
1624  gc->setHelpText(OSDSettings::tr("If enabled, browse mode will "
1625  "automatically be activated whenever "
1626  "you use channel up/down while watching "
1627  "Live TV."));
1628  return gc;
1629 }
1630 
1632 {
1633  HostCheckBoxSetting *gc = new HostCheckBoxSetting("BrowseAllTuners");
1634 
1635  gc->setLabel(OSDSettings::tr("Browse all channels"));
1636 
1637  gc->setValue(false);
1638 
1639  gc->setHelpText(OSDSettings::tr("If enabled, browse mode will show "
1640  "channels on all available recording "
1641  "devices, instead of showing channels "
1642  "on just the current recorder."));
1643  return gc;
1644 }
1645 
1647 {
1648  HostCheckBoxSetting *gc = new HostCheckBoxSetting("ClearSavedPosition");
1649 
1650  gc->setLabel(PlaybackSettings::tr("Clear bookmark on playback"));
1651 
1652  gc->setValue(true);
1653 
1654  gc->setHelpText(PlaybackSettings::tr("If enabled, automatically clear the "
1655  "bookmark on a recording when the "
1656  "recording is played back. If "
1657  "disabled, you can mark the "
1658  "beginning with rewind then save "
1659  "position."));
1660  return gc;
1661 }
1662 
1664 {
1665  HostCheckBoxSetting *gc = new HostCheckBoxSetting("AltClearSavedPosition");
1666 
1667  gc->setLabel(PlaybackSettings::tr("Alternate clear and save bookmark"));
1668 
1669  gc->setValue(true);
1670 
1671  gc->setHelpText(PlaybackSettings::tr("During playback the SELECT key "
1672  "(Enter or Space) will alternate "
1673  "between \"Bookmark Saved\" and "
1674  "\"Bookmark Cleared\". If disabled, "
1675  "the SELECT key will save the current "
1676  "position for each keypress."));
1677  return gc;
1678 }
1679 
1681 {
1682  HostComboBoxSetting *gc = new HostComboBoxSetting("PlaybackExitPrompt");
1683 
1684  gc->setLabel(PlaybackSettings::tr("Action on playback exit"));
1685 
1686  gc->addSelection(PlaybackSettings::tr("Just exit"), "0");
1687  gc->addSelection(PlaybackSettings::tr("Save position and exit"), "2");
1688  gc->addSelection(PlaybackSettings::tr("Always prompt (excluding Live TV)"),
1689  "1");
1690  gc->addSelection(PlaybackSettings::tr("Always prompt (including Live TV)"),
1691  "4");
1692  gc->addSelection(PlaybackSettings::tr("Prompt for Live TV only"), "8");
1693 
1694  gc->setHelpText(PlaybackSettings::tr("If set to prompt, a menu will be "
1695  "displayed when you exit playback "
1696  "mode. The options available will "
1697  "allow you to save your position, "
1698  "delete the recording, or continue "
1699  "watching."));
1700  return gc;
1701 }
1702 
1704 {
1705  HostCheckBoxSetting *gc = new HostCheckBoxSetting("EndOfRecordingExitPrompt");
1706 
1707  gc->setLabel(PlaybackSettings::tr("Prompt at end of recording"));
1708 
1709  gc->setValue(false);
1710 
1711  gc->setHelpText(PlaybackSettings::tr("If enabled, a menu will be displayed "
1712  "allowing you to delete the recording "
1713  "when it has finished playing."));
1714  return gc;
1715 }
1716 
1718 {
1719  HostCheckBoxSetting *gc = new HostCheckBoxSetting("JumpToProgramOSD");
1720 
1721  gc->setLabel(PlaybackSettings::tr("Jump to program OSD"));
1722 
1723  gc->setValue(true);
1724 
1725  gc->setHelpText(PlaybackSettings::tr("Set the choice between viewing the "
1726  "current recording group in the OSD, "
1727  "or showing the 'Watch Recording' "
1728  "screen when 'Jump to Program' is "
1729  "activated. If enabled, the "
1730  "recordings are shown in the OSD"));
1731  return gc;
1732 }
1733 
1735 {
1736  HostCheckBoxSetting *gc = new HostCheckBoxSetting("ContinueEmbeddedTVPlay");
1737 
1738  gc->setLabel(PlaybackSettings::tr("Continue playback when embedded"));
1739 
1740  gc->setValue(false);
1741 
1742  gc->setHelpText(PlaybackSettings::tr("If enabled, TV playback continues "
1743  "when the TV window is embedded in "
1744  "the upcoming program list or "
1745  "recorded list. The default is to "
1746  "pause the recorded show when "
1747  "embedded."));
1748  return gc;
1749 }
1750 
1752 {
1753  HostCheckBoxSetting *gc = new HostCheckBoxSetting("AutomaticSetWatched");
1754 
1755  gc->setLabel(PlaybackSettings::tr("Automatically mark a recording as "
1756  "watched"));
1757 
1758  gc->setValue(false);
1759 
1760  gc->setHelpText(PlaybackSettings::tr("If enabled, when you exit near the "
1761  "end of a recording it will be marked "
1762  "as watched. The automatic detection "
1763  "is not foolproof, so do not enable "
1764  "this setting if you don't want an "
1765  "unwatched recording marked as "
1766  "watched."));
1767  return gc;
1768 }
1769 
1771 {
1772  HostSpinBoxSetting *gs = new HostSpinBoxSetting("LiveTVIdleTimeout", 0, 3600, 1);
1773 
1774  gs->setLabel(PlaybackSettings::tr("Live TV idle timeout (mins)"));
1775 
1776  gs->setValue(0);
1777 
1778  gs->setHelpText(PlaybackSettings::tr("Exit Live TV automatically if left "
1779  "idle for the specified number of "
1780  "minutes. 0 disables the timeout."));
1781  return gs;
1782 }
1783 
1784 // static HostCheckBoxSetting *PlaybackPreview()
1785 // {
1786 // HostCheckBoxSetting *gc = new HostCheckBoxSetting("PlaybackPreview");
1787 //
1788 // gc->setLabel(PlaybackSettings::tr("Display live preview of recordings"));
1789 //
1790 // gc->setValue(true);
1791 //
1792 // gc->setHelpText(PlaybackSettings::tr("If enabled, a preview of the recording "
1793 // "will play in a small window on the \"Watch a "
1794 // "Recording\" menu."));
1795 //
1796 // return gc;
1797 // }
1798 //
1799 // static HostCheckBoxSetting *HWAccelPlaybackPreview()
1800 // {
1801 // HostCheckBoxSetting *gc = new HostCheckBoxSetting("HWAccelPlaybackPreview");
1802 //
1803 // gc->setLabel(PlaybackSettings::tr("Use HW Acceleration for live recording preview"));
1804 //
1805 // gc->setValue(false);
1806 //
1807 // gc->setHelpText(
1808 // PlaybackSettings::tr(
1809 // "If enabled, live recording preview will use hardware "
1810 // "acceleration. The video renderer used is determined by the "
1811 // "selected CPU profile. Disable if playback is sluggish or "
1812 // "causes high CPU load"));
1813 //
1814 // return gc;
1815 // }
1816 
1818 {
1819  HostCheckBoxSetting *gc = new HostCheckBoxSetting("UseVirtualKeyboard");
1820 
1821  gc->setLabel(MainGeneralSettings::tr("Use line edit virtual keyboards"));
1822 
1823  gc->setValue(true);
1824 
1825  gc->setHelpText(MainGeneralSettings::tr("If enabled, you can use a virtual "
1826  "keyboard in MythTV's line edit "
1827  "boxes. To use, hit SELECT (Enter "
1828  "or Space) while a line edit is in "
1829  "focus."));
1830  return gc;
1831 }
1832 
1834 {
1835  HostSpinBoxSetting *gs = new HostSpinBoxSetting("FrontendIdleTimeout", 0, 360, 5);
1836 
1837  gs->setLabel(MainGeneralSettings::tr("Idle time before entering standby "
1838  "mode (minutes)"));
1839 
1840  gs->setValue(90);
1841 
1842  gs->setHelpText(MainGeneralSettings::tr("Number of minutes to wait when "
1843  "the frontend is idle before "
1844  "entering standby mode. Standby "
1845  "mode allows the backend to power "
1846  "down if configured to do so. Any "
1847  "remote or mouse input will cause "
1848  "the countdown to start again "
1849  "and/or exit idle mode. Video "
1850  "playback suspends the countdown. "
1851  "A value of zero prevents the "
1852  "frontend automatically entering "
1853  "standby."));
1854  return gs;
1855 }
1856 
1858 {
1859  HostComboBoxSetting *gc = new HostComboBoxSetting("OverrideExitMenu");
1860 
1861  gc->setLabel(MainGeneralSettings::tr("Customize exit menu options"));
1862 
1863  gc->addSelection(MainGeneralSettings::tr("Default"), "0");
1864  gc->addSelection(MainGeneralSettings::tr("Show quit"), "1");
1865  gc->addSelection(MainGeneralSettings::tr("Show quit and shutdown"), "2");
1866  gc->addSelection(MainGeneralSettings::tr("Show quit, reboot and shutdown"),
1867  "3");
1868  gc->addSelection(MainGeneralSettings::tr("Show shutdown"), "4");
1869  gc->addSelection(MainGeneralSettings::tr("Show reboot"), "5");
1870  gc->addSelection(MainGeneralSettings::tr("Show reboot and shutdown"), "6");
1871  gc->addSelection(MainGeneralSettings::tr("Show standby"), "7");
1872 
1873  gc->setHelpText(
1874  MainGeneralSettings::tr("By default, only remote frontends are shown "
1875  "the shutdown option on the exit menu. Here "
1876  "you can force specific shutdown and reboot "
1877  "options to be displayed."));
1878  return gc;
1879 }
1880 
1882 {
1883  HostTextEditSetting *ge = new HostTextEditSetting("RebootCommand");
1884 
1885  ge->setLabel(MainGeneralSettings::tr("Reboot command"));
1886 
1887  ge->setValue("");
1888 
1889  ge->setHelpText(MainGeneralSettings::tr("Optional. Script to run if you "
1890  "select the reboot option from the "
1891  "exit menu, if the option is "
1892  "displayed. You must configure an "
1893  "exit key to display the exit "
1894  "menu."));
1895  return ge;
1896 }
1897 
1899 {
1900  HostTextEditSetting *ge = new HostTextEditSetting("HaltCommand");
1901 
1902  ge->setLabel(MainGeneralSettings::tr("Halt command"));
1903 
1904  ge->setValue("");
1905 
1906  ge->setHelpText(MainGeneralSettings::tr("Optional. Script to run if you "
1907  "select the shutdown option from "
1908  "the exit menu, if the option is "
1909  "displayed. You must configure an "
1910  "exit key to display the exit "
1911  "menu."));
1912  return ge;
1913 }
1914 
1916 {
1917  HostTextEditSetting *ge = new HostTextEditSetting("LircSocket");
1918 
1919  ge->setLabel(MainGeneralSettings::tr("LIRC daemon socket"));
1920 
1921  /* lircd socket moved from /dev/ to /var/run/lirc/ in lirc 0.8.6 */
1922  QString lirc_socket = "/dev/lircd";
1923 
1924  if (!QFile::exists(lirc_socket))
1925  lirc_socket = "/var/run/lirc/lircd";
1926 
1927  ge->setValue(lirc_socket);
1928 
1929  QString help = MainGeneralSettings::tr("UNIX socket or IP address[:port] "
1930  "to connect in order to communicate "
1931  "with the LIRC Daemon.");
1932  ge->setHelpText(help);
1933 
1934  return ge;
1935 }
1936 
1938 {
1939  HostTextEditSetting *ge = new HostTextEditSetting("ScreenShotPath");
1940 
1941  ge->setLabel(MainGeneralSettings::tr("Screen shot path"));
1942 
1943  ge->setValue("/tmp/");
1944 
1945  ge->setHelpText(MainGeneralSettings::tr("Path to screenshot storage "
1946  "location. Should be writable "
1947  "by the frontend"));
1948 
1949  return ge;
1950 }
1951 
1953 {
1954  HostTextEditSetting *ge = new HostTextEditSetting("SetupPinCode");
1955 
1956  ge->setLabel(MainGeneralSettings::tr("Setup PIN code"));
1957 
1958  ge->setHelpText(MainGeneralSettings::tr("This PIN is used to control "
1959  "access to the setup menus. "
1960  "If you want to use this feature, "
1961  "then setting the value to all "
1962  "numbers will make your life much "
1963  "easier. Set it to blank to "
1964  "disable. If enabled, you will not "
1965  "be able to return to this screen "
1966  "and reset the Setup PIN without "
1967  "first entering the current PIN."));
1968  return ge;
1969 }
1970 
1972 {
1973  HostComboBoxSetting *gc = new HostComboBoxSetting("XineramaScreen", false);
1975 
1976  for (int i=0; i<num; ++i)
1977  gc->addSelection(QString::number(i), QString::number(i));
1978 
1979  gc->addSelection(AppearanceSettings::tr("All"), QString::number(-1));
1980 
1981  gc->setLabel(AppearanceSettings::tr("Display on screen"));
1982 
1983  gc->setValue(0);
1984 
1985  gc->setHelpText(AppearanceSettings::tr("Run on the specified screen or "
1986  "spanning all screens."));
1987  return gc;
1988 }
1989 
1990 
1992 {
1993  HostComboBoxSetting *gc = new HostComboBoxSetting("XineramaMonitorAspectRatio");
1994 
1995  gc->setLabel(AppearanceSettings::tr("Monitor aspect ratio"));
1996 
1997  gc->addSelection(AppearanceSettings::tr("16:9"), "1.7777");
1998  gc->addSelection(AppearanceSettings::tr("16:10"), "1.6");
1999  gc->addSelection(AppearanceSettings::tr("4:3"), "1.3333");
2000 
2001  gc->setHelpText(AppearanceSettings::tr("The aspect ratio of a Xinerama "
2002  "display cannot be queried from "
2003  "the display, so it must be "
2004  "specified."));
2005  return gc;
2006 }
2007 
2009 {
2010  HostComboBoxSetting *gc = new HostComboBoxSetting("LetterboxColour");
2011 
2012  gc->setLabel(PlaybackSettings::tr("Letterboxing color"));
2013 
2014  for (int m = kLetterBoxColour_Black; m < kLetterBoxColour_END; ++m)
2015  gc->addSelection(toString((LetterBoxColour)m), QString::number(m));
2016 
2017  gc->setHelpText(PlaybackSettings::tr("By default MythTV uses black "
2018  "letterboxing to match broadcaster "
2019  "letterboxing, but those with plasma "
2020  "screens may prefer gray to minimize "
2021  "burn-in. Currently only works with "
2022  "XVideo video renderer."));
2023  return gc;
2024 }
2025 
2027 {
2028  HostComboBoxSetting *gc = new HostComboBoxSetting("AspectOverride");
2029 
2030  gc->setLabel(PlaybackSettings::tr("Video aspect override"));
2031 
2032  for (int m = kAspect_Off; m < kAspect_END; ++m)
2033  gc->addSelection(toString((AspectOverrideMode)m), QString::number(m));
2034 
2035  gc->setHelpText(PlaybackSettings::tr("When enabled, these will override "
2036  "the aspect ratio specified by any "
2037  "broadcaster for all video streams."));
2038  return gc;
2039 }
2040 
2042 {
2043  HostComboBoxSetting *gc = new HostComboBoxSetting("AdjustFill");
2044 
2045  gc->setLabel(PlaybackSettings::tr("Zoom"));
2046 
2047  for (int m = kAdjustFill_Off; m < kAdjustFill_END; ++m)
2048  gc->addSelection(toString((AdjustFillMode)m), QString::number(m));
2050  QString::number(kAdjustFill_AutoDetect_DefaultOff));
2052  QString::number(kAdjustFill_AutoDetect_DefaultHalf));
2053 
2054  gc->setHelpText(PlaybackSettings::tr("When enabled, these will apply a "
2055  "predefined zoom to all video "
2056  "playback in MythTV."));
2057  return gc;
2058 }
2059 
2060 // Theme settings
2061 
2063 {
2064  HostSpinBoxSetting *gs = new HostSpinBoxSetting("GuiWidth", 0, 1920, 8, true);
2065 
2066  gs->setLabel(AppearanceSettings::tr("GUI width (pixels)"));
2067 
2068  gs->setValue(0);
2069 
2070  gs->setHelpText(AppearanceSettings::tr("The width of the GUI. Do not make "
2071  "the GUI wider than your actual "
2072  "screen resolution. Set to 0 to "
2073  "automatically scale to "
2074  "fullscreen."));
2075  return gs;
2076 }
2077 
2079 {
2080  HostSpinBoxSetting *gs = new HostSpinBoxSetting("GuiHeight", 0, 1600, 8, true);
2081 
2082  gs->setLabel(AppearanceSettings::tr("GUI height (pixels)"));
2083 
2084  gs->setValue(0);
2085 
2086  gs->setHelpText(AppearanceSettings::tr("The height of the GUI. Do not make "
2087  "the GUI taller than your actual "
2088  "screen resolution. Set to 0 to "
2089  "automatically scale to "
2090  "fullscreen."));
2091  return gs;
2092 }
2093 
2095 {
2096  HostSpinBoxSetting *gs = new HostSpinBoxSetting("GuiOffsetX", -3840, 3840, 32, true);
2097 
2098  gs->setLabel(AppearanceSettings::tr("GUI X offset"));
2099 
2100  gs->setValue(0);
2101 
2102  gs->setHelpText(AppearanceSettings::tr("The horizontal offset where the "
2103  "GUI will be displayed. May only "
2104  "work if run in a window."));
2105  return gs;
2106 }
2107 
2109 {
2110  HostSpinBoxSetting *gs = new HostSpinBoxSetting("GuiOffsetY", -1600, 1600, 8, true);
2111 
2112  gs->setLabel(AppearanceSettings::tr("GUI Y offset"));
2113 
2114  gs->setValue(0);
2115 
2116  gs->setHelpText(AppearanceSettings::tr("The vertical offset where the "
2117  "GUI will be displayed."));
2118  return gs;
2119 }
2120 
2121 #if 0
2122 static HostSpinBoxSetting *DisplaySizeWidth()
2123 {
2124  HostSpinBoxSetting *gs = new HostSpinBoxSetting("DisplaySizeWidth", 0, 10000, 1);
2125 
2126  gs->setLabel(AppearanceSettings::tr("Display size - width"));
2127 
2128  gs->setValue(0);
2129 
2130  gs->setHelpText(AppearanceSettings::tr("Horizontal size of the monitor or TV. Used "
2131  "to calculate the actual aspect ratio of the display. This "
2132  "will override the DisplaySize from the system."));
2133 
2134  return gs;
2135 }
2136 
2137 static HostSpinBoxSetting *DisplaySizeHeight()
2138 {
2139  HostSpinBoxSetting *gs = new HostSpinBoxSetting("DisplaySizeHeight", 0, 10000, 1);
2140 
2141  gs->setLabel(AppearanceSettings::tr("Display size - height"));
2142 
2143  gs->setValue(0);
2144 
2145  gs->setHelpText(AppearanceSettings::tr("Vertical size of the monitor or TV. Used "
2146  "to calculate the actual aspect ratio of the display. This "
2147  "will override the DisplaySize from the system."));
2148 
2149  return gs;
2150 }
2151 #endif
2152 
2154 {
2155  HostCheckBoxSetting *gc = new HostCheckBoxSetting("GuiSizeForTV");
2156 
2157  gc->setLabel(AppearanceSettings::tr("Use GUI size for TV playback"));
2158 
2159  gc->setValue(true);
2160 
2161  gc->setHelpText(AppearanceSettings::tr("If enabled, use the above size for "
2162  "TV, otherwise use full screen."));
2163  return gc;
2164 }
2165 
2166 #if defined(USING_XRANDR) || CONFIG_DARWIN
2168 {
2169  HostCheckBoxSetting *gc = new VideoModeSettings("UseVideoModes");
2170 
2171  gc->setLabel(VideoModeSettings::tr("Separate video modes for GUI and "
2172  "TV playback"));
2173 
2174  gc->setValue(false);
2175 
2176  gc->setHelpText(VideoModeSettings::tr("Switch X Window video modes for TV. "
2177  "Requires \"xrandr\" support."));
2178  return gc;
2179 }
2180 
2182 {
2183  HostSpinBoxSetting *gs =
2184  new HostSpinBoxSetting(QString("VidModeWidth%1").arg(idx),
2185  0, 1920, 16, true);
2186 
2187  gs->setLabel(VideoModeSettings::tr("In X", "Video mode width"));
2188 
2189  gs->setValue(0);
2190 
2191  gs->setHelpText(VideoModeSettings::tr("Horizontal resolution of video "
2192  "which needs a special output "
2193  "resolution."));
2194  return gs;
2195 }
2196 
2198 {
2199  HostSpinBoxSetting *gs =
2200  new HostSpinBoxSetting(QString("VidModeHeight%1").arg(idx),
2201  0, 1080, 16, true);
2202 
2203  gs->setLabel(VideoModeSettings::tr("In Y", "Video mode height"));
2204 
2205  gs->setValue(0);
2206 
2207  gs->setHelpText(VideoModeSettings::tr("Vertical resolution of video "
2208  "which needs a special output "
2209  "resolution."));
2210  return gs;
2211 }
2212 
2214 {
2215  HostComboBoxSetting *gc = new HostComboBoxSetting("GuiVidModeResolution");
2216 
2217  gc->setLabel(VideoModeSettings::tr("GUI"));
2218 
2219  gc->setHelpText(VideoModeSettings::tr("Resolution of screen when not "
2220  "watching a video."));
2221 
2222  const vector<DisplayResScreen> scr = GetVideoModes();
2223  for (uint i=0; i<scr.size(); ++i)
2224  {
2225  int w = scr[i].Width(), h = scr[i].Height();
2226  QString sel = QString("%1x%2").arg(w).arg(h);
2227  gc->addSelection(sel, sel);
2228  }
2229 
2230  // if no resolution setting, set it with a reasonable initial value
2231  if (scr.size() && (gCoreContext->GetSetting("GuiVidModeResolution").isEmpty()))
2232  {
2233  int w = 0, h = 0;
2234  gCoreContext->GetResolutionSetting("GuiVidMode", w, h);
2235  if ((w <= 0) || (h <= 0))
2236  (w = 640), (h = 480);
2237 
2238  DisplayResScreen dscr(w, h, -1, -1, -1.0, 0);
2239  double rate = -1.0;
2240  int i = DisplayResScreen::FindBestMatch(scr, dscr, rate);
2241  gc->setValue((i >= 0) ? i : scr.size()-1);
2242  }
2243 
2244  return gc;
2245 }
2246 
2248 {
2249  QString dhelp = VideoModeSettings::tr("Default screen resolution "
2250  "when watching a video.");
2251  QString ohelp = VideoModeSettings::tr("Screen resolution when watching a "
2252  "video at a specific resolution.");
2253 
2254  QString qstr = (idx<0) ? "TVVidModeResolution" :
2255  QString("TVVidModeResolution%1").arg(idx);
2256  HostComboBoxSetting *gc = new HostComboBoxSetting(qstr);
2257  QString lstr = (idx<0) ? VideoModeSettings::tr("Video output") :
2258  VideoModeSettings::tr("Output");
2259  QString hstr = (idx<0) ? dhelp : ohelp;
2260 
2261  gc->setLabel(lstr);
2262 
2263  gc->setHelpText(hstr);
2264 
2265  const vector<DisplayResScreen> scr = GetVideoModes();
2266 
2267  for (uint i=0; i<scr.size(); ++i)
2268  {
2269  QString sel = QString("%1x%2").arg(scr[i].Width()).arg(scr[i].Height());
2270  gc->addSelection(sel, sel);
2271  }
2272 
2273  return gc;
2274 }
2275 
2277 {
2278  const QString previousValue = getValue();
2279  const bool wasUnchanged = !haveChanged();
2280 
2281  clearSelections();
2282  QString resolution = setting->getValue();
2283  int hz50 = -1, hz60 = -1;
2284  const vector<double> list = GetRefreshRates(resolution);
2285  addSelection(QObject::tr("Auto"), "0");
2286  for (uint i = 0; i < list.size(); ++i)
2287  {
2288  QString sel = QString::number((double) list[i], 'f', 3);
2289  addSelection(sel + " Hz", sel, sel == previousValue);
2290  hz50 = (fabs(50.0 - list[i]) < 0.01) ? i : hz50;
2291  hz60 = (fabs(60.0 - list[i]) < 0.01) ? i : hz60;
2292  }
2293 
2294  // addSelection() will cause setValue() to be called, marking the setting as
2295  // changed even though the previous value might still be available. Mark it
2296  // as unchanged in this case if it wasn't already changed.
2297  if (wasUnchanged && previousValue == getValue())
2298  setChanged(false);
2299  else
2300  {
2301  if ("640x480" == resolution || "720x480" == resolution)
2302  setValue(hz60+1);
2303  if ("640x576" == resolution || "720x576" == resolution)
2304  setValue(hz50+1);
2305  }
2306 
2307  setEnabled(list.size());
2308 }
2309 
2311  const QString &res)
2312 {
2313  QStringList slist = res.split("x");
2314  int w = 0, h = 0;
2315  bool ok0 = false, ok1 = false;
2316  if (2 == slist.size())
2317  {
2318  w = slist[0].toInt(&ok0);
2319  h = slist[1].toInt(&ok1);
2320  }
2321 
2322  DisplayRes *display_res = DisplayRes::GetDisplayRes();
2323  if (display_res && ok0 && ok1)
2324  return display_res->GetRefreshRates(w, h);
2325 
2326  vector<double> list;
2327  return list;
2328 }
2329 
2331 {
2332  QString dhelp = VideoModeSettings::tr("Default refresh rate when watching "
2333  "a video. Leave at \"Auto\" to "
2334  "automatically use the best "
2335  "available");
2336  QString ohelp = VideoModeSettings::tr("Refresh rate when watching a "
2337  "video at a specific resolution. "
2338  "Leave at \"Auto\" to automatically "
2339  "use the best available");
2340 
2341  QString qstr = (idx<0) ? "TVVidModeRefreshRate" :
2342  QString("TVVidModeRefreshRate%1").arg(idx);
2345  QString lstr = VideoModeSettings::tr("Rate");
2346  QString hstr = (idx<0) ? dhelp : ohelp;
2347 
2348  gc->setLabel(lstr);
2349  gc->setHelpText(hstr);
2350  gc->setEnabled(false);
2351  return gc;
2352 }
2353 
2355 {
2356  QString dhelp = VideoModeSettings::tr("Aspect ratio when watching a "
2357  "video. Leave at \"%1\" to "
2358  "use ratio reported by the monitor. "
2359  "Set to 16:9 or 4:3 to force a "
2360  "specific aspect ratio.");
2361 
2362 
2363 
2364  QString ohelp = VideoModeSettings::tr("Aspect ratio when watching a "
2365  "video at a specific resolution. "
2366  "Leave at \"%1\" to use ratio "
2367  "reported by the monitor. Set to "
2368  "16:9 or 4:3 to force a specific "
2369  "aspect ratio.");
2370 
2371  QString qstr = (idx<0) ? "TVVidModeForceAspect" :
2372  QString("TVVidModeForceAspect%1").arg(idx);
2373 
2374  HostComboBoxSetting *gc = new HostComboBoxSetting(qstr);
2375 
2376  gc->setLabel(VideoModeSettings::tr("Aspect"));
2377 
2378  QString hstr = (idx<0) ? dhelp : ohelp;
2379 
2380  gc->setHelpText(hstr.arg(VideoModeSettings::tr("Default")));
2381 
2382  gc->addSelection(VideoModeSettings::tr("Default"), "0.0");
2383  gc->addSelection("16:9", "1.77777777777");
2384  gc->addSelection("4:3", "1.33333333333");
2385 
2386  return gc;
2387 }
2388 
2390 {
2392  item->setDrawArrow(getValue() == "1");
2393 }
2394 
2396 {
2399 
2401  addChild(res);
2402  addChild(rate);
2404  connect(res, SIGNAL(valueChanged(StandardSetting *)),
2405  rate, SLOT(ChangeResolution(StandardSetting *)));
2406 
2407  GroupSetting* overrides = new GroupSetting();
2408 
2409  overrides->setLabel(tr("Overrides for specific video sizes"));
2410 
2411  for (int idx = 0; idx < 3; ++idx)
2412  {
2413  //input side
2414  overrides->addChild(VidModeWidth(idx));
2415  overrides->addChild(VidModeHeight(idx));
2416  // output side
2417  overrides->addChild(res = TVVidModeResolution(idx));
2418  overrides->addChild(rate = TVVidModeRefreshRate(idx));
2419  overrides->addChild(TVVidModeForceAspect(idx));
2420 
2421  connect(res, SIGNAL(valueChanged(StandardSetting *)),
2422  rate, SLOT(ChangeResolution(StandardSetting *)));
2423  }
2424 
2425  addChild(overrides);
2426 };
2427 #endif
2428 
2430 {
2431  HostCheckBoxSetting *gc = new HostCheckBoxSetting("HideMouseCursor");
2432 
2433  gc->setLabel(AppearanceSettings::tr("Hide mouse cursor in MythTV"));
2434 
2435  gc->setValue(false);
2436 
2437  gc->setHelpText(AppearanceSettings::tr("Toggles mouse cursor visibility "
2438  "for touchscreens. By default "
2439  "MythTV will auto-hide the cursor "
2440  "if the mouse doesn't move for a "
2441  "period, this setting disables the "
2442  "cursor entirely."));
2443  return gc;
2444 };
2445 
2446 
2448 {
2449  HostCheckBoxSetting *gc = new HostCheckBoxSetting("RunFrontendInWindow");
2450 
2451  gc->setLabel(AppearanceSettings::tr("Use window border"));
2452 
2453  gc->setValue(false);
2454 
2455  gc->setHelpText(AppearanceSettings::tr("Toggles between windowed and "
2456  "borderless operation."));
2457  return gc;
2458 }
2459 
2461 {
2462  HostCheckBoxSetting *gc = new HostCheckBoxSetting("UseFixedWindowSize");
2463 
2464  gc->setLabel(AppearanceSettings::tr("Use fixed window size"));
2465 
2466  gc->setValue(true);
2467 
2468  gc->setHelpText(AppearanceSettings::tr("If disabled, the video playback "
2469  "window can be resized"));
2470  return gc;
2471 }
2472 
2474 {
2475  HostCheckBoxSetting *gc = new HostCheckBoxSetting("AlwaysOnTop");
2476 
2477  gc->setLabel(AppearanceSettings::tr("Always On Top"));
2478 
2479  gc->setValue(false);
2480 
2481  gc->setHelpText(AppearanceSettings::tr("If enabled, MythTV will always be "
2482  "on top"));
2483  return gc;
2484 }
2485 
2487 {
2488  HostComboBoxSetting *gc = new HostComboBoxSetting("DateFormat");
2489  gc->setLabel(AppearanceSettings::tr("Date format"));
2490 
2491  QDate sampdate = MythDate::current().toLocalTime().date();
2492  QString sampleStr = AppearanceSettings::tr("Samples are shown using "
2493  "today's date.");
2494 
2495  if (sampdate.month() == sampdate.day())
2496  {
2497  sampdate = sampdate.addDays(1);
2498  sampleStr = AppearanceSettings::tr("Samples are shown using "
2499  "tomorrow's date.");
2500  }
2501 
2502  QLocale locale = gCoreContext->GetQLocale();
2503 
2504  gc->addSelection(locale.toString(sampdate, "ddd MMM d"), "ddd MMM d");
2505  gc->addSelection(locale.toString(sampdate, "ddd d MMM"), "ddd d MMM");
2506  gc->addSelection(locale.toString(sampdate, "ddd MMMM d"), "ddd MMMM d");
2507  gc->addSelection(locale.toString(sampdate, "ddd d MMMM"), "ddd d MMMM");
2508  gc->addSelection(locale.toString(sampdate, "dddd MMM d"), "dddd MMM d");
2509  gc->addSelection(locale.toString(sampdate, "dddd d MMM"), "dddd d MMM");
2510  gc->addSelection(locale.toString(sampdate, "MMM d"), "MMM d");
2511  gc->addSelection(locale.toString(sampdate, "d MMM"), "d MMM");
2512  gc->addSelection(locale.toString(sampdate, "MM/dd"), "MM/dd");
2513  gc->addSelection(locale.toString(sampdate, "dd/MM"), "dd/MM");
2514  gc->addSelection(locale.toString(sampdate, "MM.dd"), "MM.dd");
2515  gc->addSelection(locale.toString(sampdate, "dd.MM"), "dd.MM");
2516  gc->addSelection(locale.toString(sampdate, "M/d/yyyy"), "M/d/yyyy");
2517  gc->addSelection(locale.toString(sampdate, "d/M/yyyy"), "d/M/yyyy");
2518  gc->addSelection(locale.toString(sampdate, "MM.dd.yyyy"), "MM.dd.yyyy");
2519  gc->addSelection(locale.toString(sampdate, "dd.MM.yyyy"), "dd.MM.yyyy");
2520  gc->addSelection(locale.toString(sampdate, "yyyy-MM-dd"), "yyyy-MM-dd");
2521  gc->addSelection(locale.toString(sampdate, "ddd MMM d yyyy"), "ddd MMM d yyyy");
2522  gc->addSelection(locale.toString(sampdate, "ddd d MMM yyyy"), "ddd d MMM yyyy");
2523  gc->addSelection(locale.toString(sampdate, "ddd yyyy-MM-dd"), "ddd yyyy-MM-dd");
2524 
2525  QString cn_long = QString("dddd yyyy") + QChar(0x5E74) +
2526  "M" + QChar(0x6708) + "d"+ QChar(0x65E5); // dddd yyyy年M月d日
2527  gc->addSelection(locale.toString(sampdate, cn_long), cn_long);
2528  QString cn_med = QString("dddd ") +
2529  "M" + QChar(0x6708) + "d"+ QChar(0x65E5); // dddd M月d日
2530 
2531  gc->addSelection(locale.toString(sampdate, cn_med), cn_med);
2532 
2533  //: %1 gives additional information regarding the date format
2534  gc->setHelpText(AppearanceSettings::tr("Your preferred date format. %1")
2535  .arg(sampleStr));
2536 
2537  return gc;
2538 }
2539 
2541 {
2542  HostComboBoxSetting *gc = new HostComboBoxSetting("ShortDateFormat");
2543  gc->setLabel(AppearanceSettings::tr("Short date format"));
2544 
2545  QDate sampdate = MythDate::current().toLocalTime().date();
2546 
2547  QString sampleStr = AppearanceSettings::tr("Samples are shown using "
2548  "today's date.");
2549 
2550  if (sampdate.month() == sampdate.day())
2551  {
2552  sampdate = sampdate.addDays(1);
2553  sampleStr = AppearanceSettings::tr("Samples are shown using "
2554  "tomorrow's date.");
2555  }
2556  QLocale locale = gCoreContext->GetQLocale();
2557 
2558  gc->addSelection(locale.toString(sampdate, "M/d"), "M/d");
2559  gc->addSelection(locale.toString(sampdate, "d/M"), "d/M");
2560  gc->addSelection(locale.toString(sampdate, "MM/dd"), "MM/dd");
2561  gc->addSelection(locale.toString(sampdate, "dd/MM"), "dd/MM");
2562  gc->addSelection(locale.toString(sampdate, "MM.dd"), "MM.dd");
2563  gc->addSelection(locale.toString(sampdate, "dd.MM."), "dd.MM.");
2564  gc->addSelection(locale.toString(sampdate, "M.d."), "M.d.");
2565  gc->addSelection(locale.toString(sampdate, "d.M."), "d.M.");
2566  gc->addSelection(locale.toString(sampdate, "MM-dd"), "MM-dd");
2567  gc->addSelection(locale.toString(sampdate, "dd-MM"), "dd-MM");
2568  gc->addSelection(locale.toString(sampdate, "MMM d"), "MMM d");
2569  gc->addSelection(locale.toString(sampdate, "d MMM"), "d MMM");
2570  gc->addSelection(locale.toString(sampdate, "ddd d"), "ddd d");
2571  gc->addSelection(locale.toString(sampdate, "d ddd"), "d ddd");
2572  gc->addSelection(locale.toString(sampdate, "ddd M/d"), "ddd M/d");
2573  gc->addSelection(locale.toString(sampdate, "ddd d/M"), "ddd d/M");
2574  gc->addSelection(locale.toString(sampdate, "ddd d.M"), "ddd d.M");
2575  gc->addSelection(locale.toString(sampdate, "ddd dd.MM"), "ddd dd.MM");
2576  gc->addSelection(locale.toString(sampdate, "M/d ddd"), "M/d ddd");
2577  gc->addSelection(locale.toString(sampdate, "d/M ddd"), "d/M ddd");
2578 
2579  QString cn_short1 = QString("M") + QChar(0x6708) + "d" + QChar(0x65E5); // M月d日
2580 
2581  gc->addSelection(locale.toString(sampdate, cn_short1), cn_short1);
2582 
2583  QString cn_short2 = QString("ddd M") + QChar(0x6708) + "d" + QChar(0x65E5); // ddd M月d日
2584 
2585  gc->addSelection(locale.toString(sampdate, cn_short2), cn_short2);
2586 
2587  //: %1 gives additional information regarding the date format
2588  gc->setHelpText(AppearanceSettings::tr("Your preferred short date format. %1")
2589  .arg(sampleStr));
2590  return gc;
2591 }
2592 
2594 {
2595  HostComboBoxSetting *gc = new HostComboBoxSetting("TimeFormat");
2596 
2597  gc->setLabel(AppearanceSettings::tr("Time format"));
2598 
2599  QTime samptime = QTime::currentTime();
2600 
2601  QLocale locale = gCoreContext->GetQLocale();
2602 
2603  gc->addSelection(locale.toString(samptime, "h:mm AP"), "h:mm AP");
2604  gc->addSelection(locale.toString(samptime, "h:mm ap"), "h:mm ap");
2605  gc->addSelection(locale.toString(samptime, "hh:mm AP"), "hh:mm AP");
2606  gc->addSelection(locale.toString(samptime, "hh:mm ap"), "hh:mm ap");
2607  gc->addSelection(locale.toString(samptime, "h:mm"), "h:mm");
2608  gc->addSelection(locale.toString(samptime, "hh:mm"), "hh:mm");
2609  gc->addSelection(locale.toString(samptime, "hh.mm"), "hh.mm");
2610  gc->addSelection(locale.toString(samptime, "AP h:mm"), "AP h:mm");
2611 
2612  gc->setHelpText(AppearanceSettings::tr("Your preferred time format. You "
2613  "must choose a format with \"AM\" "
2614  "or \"PM\" in it, otherwise your "
2615  "time display will be 24-hour or "
2616  "\"military\" time."));
2617  return gc;
2618 }
2619 
2620 #if ! CONFIG_DARWIN
2622 {
2623  HostComboBoxSetting *gc = new HostComboBoxSetting("ThemePainter");
2624 
2625  gc->setLabel(AppearanceSettings::tr("Paint engine"));
2626 
2627  gc->addSelection(QCoreApplication::translate("(Common)", "Qt"), QT_PAINTER);
2628  gc->addSelection(QCoreApplication::translate("(Common)", "Auto", "Automatic"),
2629  AUTO_PAINTER);
2630 #if defined USING_OPENGL && ! defined USING_OPENGLES
2631  gc->addSelection(QCoreApplication::translate("(Common)", "OpenGL 2"),
2632  OPENGL2_PAINTER);
2633  gc->addSelection(QCoreApplication::translate("(Common)", "OpenGL 1"),
2634  OPENGL_PAINTER);
2635 #endif
2636 #ifdef _WIN32
2637  gc->addSelection(QCoreApplication::translate("(Common)", "Direct3D"),
2638  D3D9_PAINTER);
2639 #endif
2640  gc->setHelpText(
2641  AppearanceSettings::tr("This selects what MythTV uses to draw. "
2642  "Choosing '%1' is recommended, unless running "
2643  "on systems with broken OpenGL implementations "
2644  "(broken hardware or drivers or windowing "
2645  "systems) where only Qt works.")
2646  .arg(QCoreApplication::translate("(Common)", "Auto", "Automatic")));
2647 
2648  return gc;
2649 }
2650 #endif
2651 
2653 {
2654  HostComboBoxSetting *gc = new HostComboBoxSetting("ChannelFormat");
2655 
2656  gc->setLabel(GeneralSettings::tr("Channel format"));
2657 
2658  gc->addSelection(GeneralSettings::tr("number"), "<num>");
2659  gc->addSelection(GeneralSettings::tr("number callsign"), "<num> <sign>");
2660  gc->addSelection(GeneralSettings::tr("number name"), "<num> <name>");
2661  gc->addSelection(GeneralSettings::tr("callsign"), "<sign>");
2662  gc->addSelection(GeneralSettings::tr("name"), "<name>");
2663 
2664  gc->setHelpText(GeneralSettings::tr("Your preferred channel format."));
2665 
2666  gc->setValue(1);
2667 
2668  return gc;
2669 }
2670 
2672 {
2673  HostComboBoxSetting *gc = new HostComboBoxSetting("LongChannelFormat");
2674 
2675  gc->setLabel(GeneralSettings::tr("Long channel format"));
2676 
2677  gc->addSelection(GeneralSettings::tr("number"), "<num>");
2678  gc->addSelection(GeneralSettings::tr("number callsign"), "<num> <sign>");
2679  gc->addSelection(GeneralSettings::tr("number name"), "<num> <name>");
2680  gc->addSelection(GeneralSettings::tr("callsign"), "<sign>");
2681  gc->addSelection(GeneralSettings::tr("name"), "<name>");
2682 
2683  gc->setHelpText(GeneralSettings::tr("Your preferred long channel format."));
2684 
2685  gc->setValue(2);
2686 
2687  return gc;
2688 }
2689 
2691 {
2692  HostCheckBoxSetting *gc = new HostCheckBoxSetting("ChannelGroupRememberLast");
2693 
2694  gc->setLabel(ChannelGroupSettings::tr("Remember last channel group"));
2695 
2696  gc->setHelpText(ChannelGroupSettings::tr("If enabled, the EPG will "
2697  "initially display only the "
2698  "channels from the last channel "
2699  "group selected. Pressing \"4\" "
2700  "will toggle channel group."));
2701 
2702  gc->setValue(false);
2703 
2704  return gc;
2705 }
2706 
2708 {
2709  HostComboBoxSetting *gc = new HostComboBoxSetting("ChannelGroupDefault");
2710 
2711  gc->setLabel(ChannelGroupSettings::tr("Default channel group"));
2712 
2713  ChannelGroupList changrplist;
2714 
2715  changrplist = ChannelGroup::GetChannelGroups();
2716 
2717  gc->addSelection(ChannelGroupSettings::tr("All Channels"), "-1");
2718 
2719  ChannelGroupList::iterator it;
2720 
2721  for (it = changrplist.begin(); it < changrplist.end(); ++it)
2722  gc->addSelection(it->name, QString("%1").arg(it->grpid));
2723 
2724  gc->setHelpText(ChannelGroupSettings::tr("Default channel group to be "
2725  "shown in the EPG. Pressing "
2726  "GUIDE key will toggle channel "
2727  "group."));
2728  gc->setValue(false);
2729 
2730  return gc;
2731 }
2732 
2734 {
2735  HostCheckBoxSetting *gc = new HostCheckBoxSetting("BrowseChannelGroup");
2736 
2737  gc->setLabel(GeneralSettings::tr("Browse/change channels from Channel "
2738  "Group"));
2739 
2740  gc->setHelpText(GeneralSettings::tr("If enabled, Live TV will browse or "
2741  "change channels from the selected "
2742  "channel group. The \"All Channels\" "
2743  "channel group may be selected to "
2744  "browse all channels."));
2745  gc->setValue(false);
2746 
2747  return gc;
2748 }
2749 
2750 // General RecPriorities settings
2751 
2753 {
2754  GlobalComboBoxSetting *bc = new GlobalComboBoxSetting("SchedOpenEnd");
2755 
2756  bc->setLabel(GeneralRecPrioritiesSettings::tr("Avoid back to back "
2757  "recordings"));
2758 
2759  bc->setHelpText(
2760  GeneralRecPrioritiesSettings::tr("Selects the situations where the "
2761  "scheduler will avoid assigning shows "
2762  "to the same card if their end time "
2763  "and start time match. This will be "
2764  "allowed when necessary in order to "
2765  "resolve conflicts."));
2766 
2767  bc->addSelection(GeneralRecPrioritiesSettings::tr("Never"), "0");
2768  bc->addSelection(GeneralRecPrioritiesSettings::tr("Different Channels"),
2769  "1");
2770  bc->addSelection(GeneralRecPrioritiesSettings::tr("Always"), "2");
2771 
2772  bc->setValue(0);
2773 
2774  return bc;
2775 }
2776 
2778 {
2779  GlobalSpinBoxSetting *bs = new GlobalSpinBoxSetting("PrefInputPriority", 1, 99, 1);
2780 
2781  bs->setLabel(GeneralRecPrioritiesSettings::tr("Preferred input priority"));
2782 
2783  bs->setHelpText(GeneralRecPrioritiesSettings::tr("Additional priority when "
2784  "a showing matches the "
2785  "preferred input selected "
2786  "in the 'Scheduling "
2787  "Options' section of the "
2788  "recording rule."));
2789 
2790  bs->setValue(2);
2791  return bs;
2792 }
2793 
2795 {
2796  GlobalSpinBoxSetting *bs = new GlobalSpinBoxSetting("HDTVRecPriority", -99, 99, 1);
2797 
2798  bs->setLabel(GeneralRecPrioritiesSettings::tr("HDTV recording priority"));
2799 
2800  bs->setHelpText(GeneralRecPrioritiesSettings::tr("Additional priority when "
2801  "a showing is marked as an "
2802  "HDTV broadcast in the TV "
2803  "listings."));
2804 
2805  bs->setValue(0);
2806 
2807  return bs;
2808 }
2809 
2811 {
2812  GlobalSpinBoxSetting *bs = new GlobalSpinBoxSetting("WSRecPriority", -99, 99, 1);
2813 
2814  bs->setLabel(GeneralRecPrioritiesSettings::tr("Widescreen recording "
2815  "priority"));
2816 
2817  bs->setHelpText(GeneralRecPrioritiesSettings::tr("Additional priority when "
2818  "a showing is marked as "
2819  "widescreen in the TV "
2820  "listings."));
2821 
2822  bs->setValue(0);
2823 
2824  return bs;
2825 }
2826 
2828 {
2829  GlobalSpinBoxSetting *bs = new GlobalSpinBoxSetting("SignLangRecPriority",
2830  -99, 99, 1);
2831 
2832  bs->setLabel(GeneralRecPrioritiesSettings::tr("Sign language recording "
2833  "priority"));
2834 
2835  bs->setHelpText(GeneralRecPrioritiesSettings::tr("Additional priority "
2836  "when a showing is "
2837  "marked as having "
2838  "in-vision sign "
2839  "language."));
2840 
2841  bs->setValue(0);
2842 
2843  return bs;
2844 }
2845 
2847 {
2848  GlobalSpinBoxSetting *bs = new GlobalSpinBoxSetting("OnScrSubRecPriority",
2849  -99, 99, 1);
2850 
2851  bs->setLabel(GeneralRecPrioritiesSettings::tr("In-vision Subtitles "
2852  "Recording Priority"));
2853 
2854  bs->setHelpText(GeneralRecPrioritiesSettings::tr("Additional priority "
2855  "when a showing is marked "
2856  "as having in-vision "
2857  "subtitles."));
2858 
2859  bs->setValue(0);
2860 
2861  return bs;
2862 }
2863 
2865 {
2866  GlobalSpinBoxSetting *bs = new GlobalSpinBoxSetting("CCRecPriority",
2867  -99, 99, 1);
2868 
2869  bs->setLabel(GeneralRecPrioritiesSettings::tr("Subtitles/CC recording "
2870  "priority"));
2871 
2872  bs->setHelpText(GeneralRecPrioritiesSettings::tr("Additional priority when "
2873  "a showing is marked as "
2874  "having subtitles or "
2875  "closed captioning (CC) "
2876  "available."));
2877 
2878  bs->setValue(0);
2879 
2880  return bs;
2881 }
2882 
2884 {
2885  GlobalSpinBoxSetting *bs = new GlobalSpinBoxSetting("HardHearRecPriority",
2886  -99, 99, 1);
2887 
2888  bs->setLabel(GeneralRecPrioritiesSettings::tr("Hard of hearing priority"));
2889 
2890  bs->setHelpText(GeneralRecPrioritiesSettings::tr("Additional priority when "
2891  "a showing is marked as "
2892  "having support for "
2893  "viewers with impaired "
2894  "hearing."));
2895 
2896  bs->setValue(0);
2897 
2898  return bs;
2899 }
2900 
2902 {
2903  GlobalSpinBoxSetting *bs = new GlobalSpinBoxSetting("AudioDescRecPriority",
2904  -99, 99, 1);
2905 
2906  bs->setLabel(GeneralRecPrioritiesSettings::tr("Audio described priority"));
2907 
2908  bs->setHelpText(GeneralRecPrioritiesSettings::tr("Additional priority when "
2909  "a showing is marked as "
2910  "being Audio Described."));
2911 
2912  bs->setValue(0);
2913 
2914  return bs;
2915 }
2916 
2918 {
2919  HostTextEditSetting *ge = new HostTextEditSetting("DefaultTVChannel");
2920 
2921  ge->setLabel(EPGSettings::tr("Guide starts at channel"));
2922 
2923  ge->setValue("3");
2924 
2925  ge->setHelpText(EPGSettings::tr("The program guide starts on this channel "
2926  "if it is run from outside of Live TV "
2927  "mode. Leave blank to enable Live TV "
2928  "automatic start channel."));
2929 
2930  return ge;
2931 }
2932 
2934 {
2935  HostSpinBoxSetting *gs = new HostSpinBoxSetting("SelChangeRecThreshold", 1, 600, 1);
2936 
2937  gs->setLabel(EPGSettings::tr("Record threshold"));
2938 
2939  gs->setValue(16);
2940 
2941  gs->setHelpText(EPGSettings::tr("Pressing SELECT on a show that is at "
2942  "least this many minutes into the future "
2943  "will schedule a recording."));
2944  return gs;
2945 }
2946 
2948 {
2949  GlobalComboBoxSetting *gc = new GlobalComboBoxSetting("Language");
2950 
2951  gc->setLabel(AppearanceSettings::tr("Language"));
2952 
2953  QMap<QString, QString> langMap = MythTranslation::getLanguages();
2954  QStringList langs = langMap.values();
2955  langs.sort();
2956  QString langCode = gCoreContext->GetSetting("Language").toLower();
2957 
2958  if (langCode.isEmpty())
2959  langCode = "en_US";
2960 
2961  gc->clearSelections();
2962 
2963  for (QStringList::Iterator it = langs.begin(); it != langs.end(); ++it)
2964  {
2965  QString label = *it;
2966  QString value = langMap.key(label);
2967  gc->addSelection(label, value, (value.toLower() == langCode));
2968  }
2969 
2970  gc->setHelpText(AppearanceSettings::tr("Your preferred language for the "
2971  "user interface."));
2972  return gc;
2973 }
2974 
2976 {
2977  widget->clearSelections();
2978  QString q = QString("ISO639Language%1").arg(i);
2979  QString lang = gCoreContext->GetSetting(q, "").toLower();
2980 
2981  if ((lang.isEmpty() || lang == "aar") &&
2982  !gCoreContext->GetSetting("Language", "").isEmpty())
2983  {
2984  lang = iso639_str2_to_str3(gCoreContext->GetLanguage().toLower());
2985  }
2986 
2987  QMap<int,QString>::iterator it = _iso639_key_to_english_name.begin();
2988  QMap<int,QString>::iterator ite = _iso639_key_to_english_name.end();
2989 
2990  for (; it != ite; ++it)
2991  {
2992  QString desc = (*it);
2993  int idx = desc.indexOf(";");
2994  if (idx > 0)
2995  desc = desc.left(idx);
2996 
2997  const QString il = iso639_key_to_str3(it.key());
2998  widget->addSelection(desc, il, il == lang);
2999  }
3000 }
3001 
3003 {
3004  GlobalComboBoxSetting *gc = new GlobalComboBoxSetting(QString("ISO639Language%1").arg(i));
3005 
3006  gc->setLabel(AppearanceSettings::tr("Guide language #%1").arg(i+1));
3007 
3008  // We should try to get language from "MythLanguage"
3009  // then use code 2 to code 3 map in iso639.h
3010  ISO639_fill_selections(gc, i);
3011 
3012  gc->setHelpText(AppearanceSettings::tr("Your #%1 preferred language for "
3013  "Program Guide data and captions.")
3014  .arg(i+1));
3015  return gc;
3016 }
3017 
3019 {
3020  HostCheckBoxSetting *gc = new HostCheckBoxSetting("NetworkControlEnabled");
3021 
3022  gc->setLabel(MainGeneralSettings::tr("Enable Network Remote Control "
3023  "interface"));
3024 
3025  gc->setHelpText(MainGeneralSettings::tr("This enables support for "
3026  "controlling MythFrontend "
3027  "over the network."));
3028 
3029  gc->setValue(false);
3030 
3031  return gc;
3032 }
3033 
3035 {
3036  HostSpinBoxSetting *gs = new HostSpinBoxSetting("NetworkControlPort", 1025, 65535, 1);
3037 
3038  gs->setLabel(MainGeneralSettings::tr("Network Remote Control port"));
3039 
3040  gs->setValue(6546);
3041 
3042  gs->setHelpText(MainGeneralSettings::tr("This specifies what port the "
3043  "Network Remote Control "
3044  "interface will listen on for "
3045  "new connections."));
3046  return gs;
3047 }
3048 
3050 {
3051  HostTextEditSetting *ge = new HostTextEditSetting("UDPNotifyPort");
3052 
3053  ge->setLabel(MainGeneralSettings::tr("UDP notify port"));
3054 
3055  ge->setValue("6948");
3056 
3057  ge->setHelpText(MainGeneralSettings::tr("MythTV will listen for "
3058  "connections from the "
3059  "\"mythutil\" program on "
3060  "this port."));
3061  return ge;
3062 }
3063 
3064 #ifdef USING_AIRPLAY
3065 // AirPlay Settings
3066 static HostCheckBoxSetting *AirPlayEnabled()
3067 {
3068  HostCheckBoxSetting *gc = new HostCheckBoxSetting("AirPlayEnabled");
3069 
3070  gc->setLabel(MainGeneralSettings::tr("Enable AirPlay"));
3071 
3072  gc->setHelpText(MainGeneralSettings::tr("AirPlay lets you wirelessly view "
3073  "content on your TV from your "
3074  "iPhone, iPad, iPod Touch, or "
3075  "iTunes on your computer."));
3076 
3077  gc->setValue(true);
3078 
3079  return gc;
3080 }
3081 
3082 static HostCheckBoxSetting *AirPlayAudioOnly()
3083 {
3084  HostCheckBoxSetting *gc = new HostCheckBoxSetting("AirPlayAudioOnly");
3085 
3086  gc->setLabel(MainGeneralSettings::tr("Only support AirTunes (no video)"));
3087 
3088  gc->setHelpText(MainGeneralSettings::tr("Only stream audio from your "
3089  "iPhone, iPad, iPod Touch, or "
3090  "iTunes on your computer"));
3091 
3092  gc->setValue(false);
3093 
3094  return gc;
3095 }
3096 
3097 static HostCheckBoxSetting *AirPlayPasswordEnabled()
3098 {
3099  HostCheckBoxSetting *gc = new HostCheckBoxSetting("AirPlayPasswordEnabled");
3100 
3101  gc->setLabel(MainGeneralSettings::tr("Require password"));
3102 
3103  gc->setValue(false);
3104 
3105  gc->setHelpText(MainGeneralSettings::tr("Require a password to use "
3106  "AirPlay. Your iPhone, iPad, iPod "
3107  "Touch, or iTunes on your computer "
3108  "will prompt you when required"));
3109  return gc;
3110 }
3111 
3112 static HostTextEditSetting *AirPlayPassword()
3113 {
3114  HostTextEditSetting *ge = new HostTextEditSetting("AirPlayPassword");
3115 
3116  ge->setLabel(MainGeneralSettings::tr("Password"));
3117 
3118  ge->setValue("0000");
3119 
3120  ge->setHelpText(MainGeneralSettings::tr("Your iPhone, iPad, iPod Touch, or "
3121  "iTunes on your computer will "
3122  "prompt you for this password "
3123  "when required"));
3124  return ge;
3125 }
3126 
3127 static GroupSetting *AirPlayPasswordSettings()
3128 {
3129  GroupSetting *hc = new GroupSetting();
3130 
3131  hc->setLabel(MainGeneralSettings::tr("AirPlay - Password"));
3132  hc->addChild(AirPlayPasswordEnabled());
3133  hc->addChild(AirPlayPassword());
3134 
3135  return hc;
3136 }
3137 
3138 static HostCheckBoxSetting *AirPlayFullScreen()
3139 {
3140  HostCheckBoxSetting *gc = new HostCheckBoxSetting("AirPlayFullScreen");
3141 
3142  gc->setLabel(MainGeneralSettings::tr("AirPlay full screen playback"));
3143 
3144  gc->setValue(false);
3145 
3146  gc->setHelpText(MainGeneralSettings::tr("During music playback, displays "
3147  "album cover and various media "
3148  "information in full screen mode"));
3149  return gc;
3150 }
3151 
3152 //static TransLabelSetting *AirPlayInfo()
3153 //{
3154 // TransLabelSetting *ts = new TransLabelSetting();
3155 //
3156 // ts->setValue(MainGeneralSettings::tr("All AirPlay settings take effect "
3157 // "when you restart MythFrontend."));
3158 // return ts;
3159 //}
3160 
3161 //static TransLabelSetting *AirPlayRSAInfo()
3162 //{
3163 // TransLabelSetting *ts = new TransLabelSetting();
3164 //
3165 // if (MythRAOPConnection::LoadKey() == NULL)
3166 // {
3167 // ts->setValue(MainGeneralSettings::tr("AirTunes RSA key couldn't be "
3168 // "loaded. Check http://www.mythtv.org/wiki/AirTunes/AirPlay. "
3169 // "Last Error: %1")
3170 // .arg(MythRAOPConnection::RSALastError()));
3171 // }
3172 // else
3173 // {
3174 // ts->setValue(MainGeneralSettings::tr("AirTunes RSA key successfully "
3175 // "loaded."));
3176 // }
3177 //
3178 // return ts;
3179 //}
3180 #endif
3181 
3183 {
3184  HostCheckBoxSetting *gc = new HostCheckBoxSetting("RealtimePriority");
3185 
3186  gc->setLabel(PlaybackSettings::tr("Enable realtime priority threads"));
3187 
3188  gc->setHelpText(PlaybackSettings::tr("When running mythfrontend with root "
3189  "privileges, some threads can be "
3190  "given enhanced priority. Disable "
3191  "this if MythFrontend freezes during "
3192  "video playback."));
3193  gc->setValue(true);
3194 
3195  return gc;
3196 }
3197 
3199 {
3200  HostTextEditSetting *ge = new HostTextEditSetting("IgnoreDevices");
3201 
3202  ge->setLabel(MainGeneralSettings::tr("Ignore devices"));
3203 
3204  ge->setValue("");
3205 
3206  ge->setHelpText(MainGeneralSettings::tr("If there are any devices that you "
3207  "do not want to be monitored, list "
3208  "them here with commas in-between. "
3209  "The plugins will ignore them. "
3210  "Requires restart."));
3211  return ge;
3212 }
3213 
3215 {
3216  HostComboBoxSetting *gc = new HostComboBoxSetting("DisplayGroupTitleSort");
3217 
3218  gc->setLabel(PlaybackSettings::tr("Sort titles"));
3219 
3220  gc->addSelection(PlaybackSettings::tr("Alphabetically"),
3221  QString::number(PlaybackBox::TitleSortAlphabetical));
3222  gc->addSelection(PlaybackSettings::tr("By recording priority"),
3223  QString::number(PlaybackBox::TitleSortRecPriority));
3224 
3225  gc->setHelpText(PlaybackSettings::tr("Sets the title sorting order when "
3226  "the view is set to Titles only."));
3227  return gc;
3228 }
3229 
3231 {
3232  HostCheckBoxSetting *gc = new HostCheckBoxSetting("PlaybackWatchList");
3233 
3234  gc->setLabel(WatchListSettings::tr("Include the 'Watch List' group"));
3235 
3236  gc->setValue(true);
3237 
3238  gc->setHelpText(WatchListSettings::tr("The 'Watch List' is an abbreviated "
3239  "list of recordings sorted to "
3240  "highlight series and shows that "
3241  "need attention in order to keep up "
3242  "to date."));
3243  return gc;
3244 }
3245 
3247 {
3248  HostCheckBoxSetting *gc = new HostCheckBoxSetting("PlaybackWLStart");
3249 
3250  gc->setLabel(WatchListSettings::tr("Start from the Watch List view"));
3251 
3252  gc->setValue(false);
3253 
3254  gc->setHelpText(WatchListSettings::tr("If enabled, the 'Watch List' will "
3255  "be the initial view each time you "
3256  "enter the Watch Recordings screen"));
3257  return gc;
3258 }
3259 
3261 {
3262  HostCheckBoxSetting *gc = new HostCheckBoxSetting("PlaybackWLAutoExpire");
3263 
3264  gc->setLabel(WatchListSettings::tr("Exclude recordings not set for "
3265  "Auto-Expire"));
3266 
3267  gc->setValue(false);
3268 
3269  gc->setHelpText(WatchListSettings::tr("Set this if you turn off "
3270  "Auto-Expire only for recordings "
3271  "that you've seen and intend to "
3272  "keep. This option will exclude "
3273  "these recordings from the "
3274  "'Watch List'."));
3275  return gc;
3276 }
3277 
3279 {
3280  HostSpinBoxSetting *gs = new HostSpinBoxSetting("PlaybackWLMaxAge", 30, 180, 10);
3281 
3282  gs->setLabel(WatchListSettings::tr("Maximum days counted in the score"));
3283 
3284  gs->setValue(60);
3285 
3286  gs->setHelpText(WatchListSettings::tr("The 'Watch List' scores are based "
3287  "on 1 point equals one day since "
3288  "recording. This option limits the "
3289  "maximum score due to age and "
3290  "affects other weighting factors."));
3291  return gs;
3292 }
3293 
3295 {
3296  HostSpinBoxSetting *gs = new HostSpinBoxSetting("PlaybackWLBlackOut", 0, 5, 1);
3297 
3298  gs->setLabel(WatchListSettings::tr("Days to exclude weekly episodes after "
3299  "delete"));
3300 
3301  gs->setValue(2);
3302 
3303  gs->setHelpText(WatchListSettings::tr("When an episode is deleted or "
3304  "marked as watched, other episodes "
3305  "of the series are excluded from the "
3306  "'Watch List' for this interval of "
3307  "time. Daily shows also have a "
3308  "smaller interval based on this "
3309  "setting."));
3310  return gs;
3311 }
3312 
3314 {
3315  HostCheckBoxSetting *gc = new HostCheckBoxSetting("MonitorDrives");
3316 
3317  gc->setLabel(MainGeneralSettings::tr("Media Monitor"));
3318 
3319  gc->setHelpText(MainGeneralSettings::tr("This enables support for "
3320  "monitoring your CD/DVD drives for "
3321  "new disks and launching the "
3322  "proper plugin to handle them. "
3323  "Requires restart."));
3324 
3325  gc->setValue(false);
3326 
3327  gc->addTargetedChild("1", IgnoreMedia());
3328 
3329  return gc;
3330 }
3331 
3333 {
3334  HostCheckBoxSetting *gc = new HostCheckBoxSetting("LCDShowTime");
3335 
3336  gc->setLabel(LcdSettings::tr("Display time"));
3337 
3338  gc->setHelpText(LcdSettings::tr("Display current time on idle LCD "
3339  "display."));
3340 
3341  gc->setValue(true);
3342 
3343  return gc;
3344 }
3345 
3347 {
3348  HostCheckBoxSetting *gc = new HostCheckBoxSetting("LCDShowRecStatus");
3349 
3350  gc->setLabel(LcdSettings::tr("Display recording status"));
3351 
3352  gc->setHelpText(LcdSettings::tr("Display current recordings information "
3353  "on LCD display."));
3354 
3355  gc->setValue(false);
3356 
3357  return gc;
3358 }
3359 
3361 {
3362  HostCheckBoxSetting *gc = new HostCheckBoxSetting("LCDShowMenu");
3363 
3364  gc->setLabel(LcdSettings::tr("Display menus"));
3365 
3366  gc->setHelpText(LcdSettings::tr("Display selected menu on LCD display. "));
3367 
3368  gc->setValue(true);
3369 
3370  return gc;
3371 }
3372 
3374 {
3375  HostSpinBoxSetting *gs = new HostSpinBoxSetting("LCDPopupTime", 1, 300, 1, true);
3376 
3377  gs->setLabel(LcdSettings::tr("Menu pop-up time"));
3378 
3379  gs->setHelpText(LcdSettings::tr("How many seconds the menu will remain "
3380  "visible after navigation."));
3381 
3382  gs->setValue(5);
3383 
3384  return gs;
3385 }
3386 
3388 {
3389  HostCheckBoxSetting *gc = new HostCheckBoxSetting("LCDShowMusic");
3390 
3391  gc->setLabel(LcdSettings::tr("Display music artist and title"));
3392 
3393  gc->setHelpText(LcdSettings::tr("Display playing artist and song title in "
3394  "MythMusic on LCD display."));
3395 
3396  gc->setValue(true);
3397 
3398  return gc;
3399 }
3400 
3402 {
3403  HostComboBoxSetting *gc = new HostComboBoxSetting("LCDShowMusicItems");
3404 
3405  gc->setLabel(LcdSettings::tr("Items"));
3406 
3407  gc->addSelection(LcdSettings::tr("Artist - Title"), "ArtistTitle");
3408  gc->addSelection(LcdSettings::tr("Artist [Album] Title"),
3409  "ArtistAlbumTitle");
3410 
3411  gc->setHelpText(LcdSettings::tr("Which items to show when playing music."));
3412 
3413  return gc;
3414 }
3415 
3417 {
3418  HostCheckBoxSetting *gc = new HostCheckBoxSetting("LCDShowChannel");
3419 
3420  gc->setLabel(LcdSettings::tr("Display channel information"));
3421 
3422  gc->setHelpText(LcdSettings::tr("Display tuned channel information on LCD "
3423  "display."));
3424 
3425  gc->setValue(true);
3426 
3427  return gc;
3428 }
3429 
3431 {
3432  HostCheckBoxSetting *gc = new HostCheckBoxSetting("LCDShowVolume");
3433 
3434  gc->setLabel(LcdSettings::tr("Display volume information"));
3435 
3436  gc->setHelpText(LcdSettings::tr("Display volume level information "
3437  "on LCD display."));
3438 
3439  gc->setValue(true);
3440 
3441  return gc;
3442 }
3443 
3445 {
3446  HostCheckBoxSetting *gc = new HostCheckBoxSetting("LCDShowGeneric");
3447 
3448  gc->setLabel(LcdSettings::tr("Display generic information"));
3449 
3450  gc->setHelpText(LcdSettings::tr("Display generic information on LCD display."));
3451 
3452  gc->setValue(true);
3453 
3454  return gc;
3455 }
3456 
3458 {
3459  HostCheckBoxSetting *gc = new HostCheckBoxSetting("LCDBacklightOn");
3460 
3461  gc->setLabel(LcdSettings::tr("Backlight always on"));
3462 
3463  gc->setHelpText(LcdSettings::tr("Turn on the backlight permanently on the "
3464  "LCD display."));
3465  gc->setValue(true);
3466 
3467  return gc;
3468 }
3469 
3471 {
3472  HostCheckBoxSetting *gc = new HostCheckBoxSetting("LCDHeartBeatOn");
3473 
3474  gc->setLabel(LcdSettings::tr("Heartbeat always on"));
3475 
3476  gc->setHelpText(LcdSettings::tr("Turn on the LCD heartbeat."));
3477 
3478  gc->setValue(false);
3479 
3480  return gc;
3481 }
3482 
3484 {
3485  HostCheckBoxSetting *gc = new HostCheckBoxSetting("LCDBigClock");
3486 
3487  gc->setLabel(LcdSettings::tr("Display large clock"));
3488 
3489  gc->setHelpText(LcdSettings::tr("On multiline displays try and display the "
3490  "time as large as possible."));
3491 
3492  gc->setValue(false);
3493 
3494  return gc;
3495 }
3496 
3498 {
3499  HostTextEditSetting *ge = new HostTextEditSetting("LCDKeyString");
3500 
3501  ge->setLabel(LcdSettings::tr("LCD key order"));
3502 
3503  ge->setValue("ABCDEF");
3504 
3505  ge->setHelpText(
3506  LcdSettings::tr("Enter the 6 Keypad Return Codes for your LCD keypad "
3507  "in the order in which you want the functions "
3508  "up/down/left/right/yes/no to operate. (See "
3509  "lcdproc/server/drivers/hd44780.c/keyMapMatrix[] "
3510  "or the matrix for your display)"));
3511  return ge;
3512 }
3513 
3515 {
3516  HostCheckBoxSetting *gc = new HostCheckBoxSetting("LCDEnable");
3517 
3518  gc->setLabel(LcdSettings::tr("Enable LCD device"));
3519 
3520  gc->setHelpText(LcdSettings::tr("Use an LCD display to view MythTV status "
3521  "information."));
3522 
3523  gc->setValue(false);
3524  gc->addTargetedChild("1", LCDShowTime());
3525  gc->addTargetedChild("1", LCDShowMenu());
3526  gc->addTargetedChild("1", LCDShowMusic());
3527  gc->addTargetedChild("1", LCDShowMusicItems());
3528  gc->addTargetedChild("1", LCDShowChannel());
3529  gc->addTargetedChild("1", LCDShowRecStatus());
3530  gc->addTargetedChild("1", LCDShowVolume());
3531  gc->addTargetedChild("1", LCDShowGeneric());
3532  gc->addTargetedChild("1", LCDBacklightOn());
3533  gc->addTargetedChild("1", LCDHeartBeatOn());
3534  gc->addTargetedChild("1", LCDBigClock());
3535  gc->addTargetedChild("1", LCDKeyString());
3536  gc->addTargetedChild("1", LCDPopupTime());
3537  return gc;
3538 }
3539 
3540 
3541 #if CONFIG_DARWIN
3542 static HostCheckBoxSetting *MacGammaCorrect()
3543 {
3544  HostCheckBoxSetting *gc = new HostCheckBoxSetting("MacGammaCorrect");
3545 
3546  gc->setLabel(PlaybackSettings::tr("Enable gamma correction for video"));
3547 
3548  gc->setValue(false);
3549 
3550  gc->setHelpText(PlaybackSettings::tr("If enabled, QuickTime will correct "
3551  "the gamma of the video to match "
3552  "your monitor. Turning this off can "
3553  "save some CPU cycles."));
3554  return gc;
3555 }
3556 
3557 static HostCheckBoxSetting *MacScaleUp()
3558 {
3559  HostCheckBoxSetting *gc = new HostCheckBoxSetting("MacScaleUp");
3560 
3561  gc->setLabel(PlaybackSettings::tr("Scale video as necessary"));
3562 
3563  gc->setValue(true);
3564 
3565  gc->setHelpText(PlaybackSettings::tr("If enabled, video will be scaled to "
3566  "fit your window or screen. If "
3567  "unchecked, video will never be made "
3568  "larger than its actual pixel size."));
3569  return gc;
3570 }
3571 
3572 static HostSpinBoxSetting *MacFullSkip()
3573 {
3574  HostSpinBoxSetting *gs = new HostSpinBoxSetting("MacFullSkip", 0, 30, 1, true);
3575 
3576  gs->setLabel(PlaybackSettings::tr("Frames to skip in fullscreen mode"));
3577 
3578  gs->setValue(0);
3579 
3580  gs->setHelpText(PlaybackSettings::tr("Video displayed in fullscreen or "
3581  "non-windowed mode will skip this "
3582  "many frames for each frame drawn. "
3583  "Set to 0 to show every frame. Only "
3584  "valid when either \"Use GUI size for "
3585  "TV playback\" or \"Run the frontend "
3586  "in a window\" is not checked."));
3587  return gs;
3588 }
3589 
3590 static HostCheckBoxSetting *MacMainEnabled()
3591 {
3592  HostCheckBoxSetting *gc = new HostCheckBoxSetting("MacMainEnabled");
3593 
3594  gc->setLabel(MacMainSettings::tr("Video in main window"));
3595 
3596  gc->setValue(true);
3597 
3598  gc->setHelpText(MacMainSettings::tr("If enabled, video will be displayed "
3599  "in the main GUI window. Disable this "
3600  "when you only want video on the "
3601  "desktop or in a floating window. Only "
3602  "valid when \"Use GUI size for TV "
3603  "playback\" and \"Run the frontend in "
3604  "a window\" are checked."));
3605  return gc;
3606 }
3607 
3608 static HostSpinBoxSetting *MacMainSkip()
3609 {
3610  HostSpinBoxSetting *gs = new HostSpinBoxSetting("MacMainSkip", 0, 30, 1, true);
3611 
3612  gs->setLabel(MacMainSettings::tr("Frames to skip"));
3613 
3614  gs->setValue(0);
3615 
3616  gs->setHelpText(MacMainSettings::tr("Video in the main window will skip "
3617  "this many frames for each frame "
3618  "drawn. Set to 0 to show every "
3619  "frame."));
3620  return gs;
3621 }
3622 
3623 static HostSpinBoxSetting *MacMainOpacity()
3624 {
3625  HostSpinBoxSetting *gs = new HostSpinBoxSetting("MacMainOpacity", 0, 100, 5, false);
3626 
3627  gs->setLabel(MacMainSettings::tr("Opacity"));
3628 
3629  gs->setValue(100);
3630 
3631  gs->setHelpText(MacMainSettings::tr("The opacity of the main window. Set "
3632  "to 100 for completely opaque, set "
3633  "to 0 for completely transparent."));
3634  return gs;
3635 }
3636 
3637 static HostCheckBoxSetting *MacFloatEnabled()
3638 {
3639  HostCheckBoxSetting *gc = new HostCheckBoxSetting("MacFloatEnabled");
3640 
3641  gc->setLabel(MacFloatSettings::tr("Video in floating window"));
3642 
3643  gc->setValue(false);
3644 
3645  gc->setHelpText(MacFloatSettings::tr("If enabled, video will be displayed "
3646  "in a floating window. Only valid "
3647  "when \"Use GUI size for TV "
3648  "playback\" and \"Run the frontend "
3649  "in a window\" are checked."));
3650  return gc;
3651 }
3652 
3653 static HostSpinBoxSetting *MacFloatSkip()
3654 {
3655  HostSpinBoxSetting *gs = new HostSpinBoxSetting("MacFloatSkip", 0, 30, 1, true);
3656 
3657  gs->setLabel(MacFloatSettings::tr("Frames to skip"));
3658 
3659  gs->setValue(0);
3660 
3661  gs->setHelpText(MacFloatSettings::tr("Video in the floating window will "
3662  "skip this many frames for each "
3663  "frame drawn. Set to 0 to show "
3664  "every frame."));
3665  return gs;
3666 }
3667 
3668 static HostSpinBoxSetting *MacFloatOpacity()
3669 {
3670  HostSpinBoxSetting *gs = new HostSpinBoxSetting("MacFloatOpacity", 0, 100, 5, false);
3671 
3672  gs->setLabel(MacFloatSettings::tr("Opacity"));
3673 
3674  gs->setValue(100);
3675 
3676  gs->setHelpText(MacFloatSettings::tr("The opacity of the floating window. "
3677  "Set to 100 for completely opaque, "
3678  "set to 0 for completely "
3679  "transparent."));
3680  return gs;
3681 }
3682 
3683 static HostCheckBoxSetting *MacDockEnabled()
3684 {
3685  HostCheckBoxSetting *gc = new HostCheckBoxSetting("MacDockEnabled");
3686 
3687  gc->setLabel(MacDockSettings::tr("Video in the dock"));
3688 
3689  gc->setValue(true);
3690 
3691  gc->setHelpText(MacDockSettings::tr("If enabled, video will be displayed "
3692  "in the application's dock icon. Only "
3693  "valid when \"Use GUI size for TV "
3694  "playback\" and \"Run the frontend in "
3695  "a window\" are checked."));
3696  return gc;
3697 }
3698 
3699 static HostSpinBoxSetting *MacDockSkip()
3700 {
3701  HostSpinBoxSetting *gs = new HostSpinBoxSetting("MacDockSkip", 0, 30, 1, true);
3702 
3703  gs->setLabel(MacDockSettings::tr("Frames to skip"));
3704 
3705  gs->setValue(3);
3706 
3707  gs->setHelpText(MacDockSettings::tr("Video in the dock icon will skip this "
3708  "many frames for each frame drawn. Set "
3709  "to 0 to show every frame."));
3710  return gs;
3711 }
3712 
3713 static HostCheckBoxSetting *MacDesktopEnabled()
3714 {
3715  HostCheckBoxSetting *gc = new HostCheckBoxSetting("MacDesktopEnabled");
3716 
3717  gc->setLabel(MacDesktopSettings::tr("Video on the desktop"));
3718 
3719  gc->setValue(false);
3720 
3721  gc->setHelpText(MacDesktopSettings::tr("If enabled, video will be "
3722  "displayed on the desktop, "
3723  "behind the Finder icons. "
3724  "Only valid when \"Use GUI "
3725  "size for TV playback\" and "
3726  "\"Run the frontend in a "
3727  "window\" are checked."));
3728  return gc;
3729 }
3730 
3731 static HostSpinBoxSetting *MacDesktopSkip()
3732 {
3733  HostSpinBoxSetting *gs = new HostSpinBoxSetting("MacDesktopSkip", 0, 30, 1, true);
3734 
3735  gs->setLabel(MacDesktopSettings::tr("Frames to skip"));
3736 
3737  gs->setValue(0);
3738 
3739  gs->setHelpText(MacDesktopSettings::tr("Video on the desktop will skip "
3740  "this many frames for each frame "
3741  "drawn. Set to 0 to show every "
3742  "frame."));
3743  return gs;
3744 }
3745 #endif
3746 
3747 
3749 {
3750  public:
3752  private slots:
3753  void childChanged(StandardSetting *);
3754  private:
3758 };
3759 
3761  : GroupSetting()
3762 {
3763  setLabel(MainGeneralSettings::tr("Shutdown/Reboot Settings"));
3768  connect(m_overrideExitMenu,SIGNAL(valueChanged(StandardSetting *)),
3769  SLOT(childChanged(StandardSetting *)));
3770 }
3771 
3773 {
3774  switch (m_overrideExitMenu->getValue().toInt())
3775  {
3776  case 2:
3777  case 4:
3778  m_haltCommand->setEnabled(true);
3779  m_rebootCommand->setEnabled(false);
3780  break;
3781  case 3:
3782  case 6:
3783  m_haltCommand->setEnabled(true);
3784  m_rebootCommand->setEnabled(true);
3785  break;
3786  case 5:
3787  m_haltCommand->setEnabled(false);
3788  m_rebootCommand->setEnabled(true);
3789  break;
3790  case 0:
3791  case 1:
3792  default:
3793  m_haltCommand->setEnabled(false);
3794  m_rebootCommand->setEnabled(false);
3795  break;
3796  }
3797 }
3798 
3800 {
3801 // DatabaseSettings::addDatabaseSettings(this);
3802  setLabel(tr("Main Settings"));
3803 
3804  addChild(new DatabaseSettings());
3805 
3806  GroupSetting *pin = new GroupSetting();
3807  pin->setLabel(tr("Settings Access"));
3808  pin->addChild(SetupPinCode());
3809  addChild(pin);
3810 
3811  GroupSetting *general = new GroupSetting();
3812  general->setLabel(tr("General"));
3813  general->addChild(UseVirtualKeyboard());
3814  general->addChild(ScreenShotPath());
3815  addChild(general);
3816 
3818 
3820 
3821  GroupSetting *remotecontrol = new GroupSetting();
3822  remotecontrol->setLabel(tr("Remote Control"));
3823  remotecontrol->addChild(LircDaemonDevice());
3824  remotecontrol->addChild(NetworkControlEnabled());
3825  remotecontrol->addChild(NetworkControlPort());
3826  remotecontrol->addChild(UDPNotifyPort());
3827  addChild(remotecontrol);
3828 
3829 #ifdef USING_AIRPLAY
3830  GroupSetting *airplay = new GroupSetting();
3831  airplay->setLabel(tr("AirPlay Settings"));
3832  airplay->addChild(AirPlayEnabled());
3833  airplay->addChild(AirPlayFullScreen());
3834  airplay->addChild(AirPlayAudioOnly());
3835  airplay->addChild(AirPlayPasswordSettings());
3836 // airplay->addChild(AirPlayInfo());
3837 // airplay->addChild(AirPlayRSAInfo());
3838  addChild(airplay);
3839 #endif
3840 }
3841 
3843 {
3844  QStringList strlist( QString("REFRESH_BACKEND") );
3846 }
3847 
3848 
3850 {
3851  public:
3852  PlayBackScaling();
3853  virtual void updateButton(MythUIButtonListItem *item);
3854 
3855  private slots:
3856  virtual void childChanged(StandardSetting *);
3857 
3858  private:
3863 };
3864 
3866  :GroupSetting()
3867 {
3868  setLabel(tr("Scaling"));
3873  connect(m_VertScan, SIGNAL(valueChanged(StandardSetting *)),
3874  this, SLOT(childChanged(StandardSetting *)));
3875  connect(m_YScan, SIGNAL(valueChanged(StandardSetting *)),
3876  this, SLOT(childChanged(StandardSetting *)));
3877  connect(m_HorizScan, SIGNAL(valueChanged(StandardSetting *)),
3878  this, SLOT(childChanged(StandardSetting *)));
3879  connect(m_XScan,SIGNAL(valueChanged(StandardSetting *)),
3880  this, SLOT(childChanged(StandardSetting *)));
3881 }
3882 
3883 
3885 {
3887  if (m_VertScan->getValue() == "0" &&
3888  m_HorizScan->getValue() == "0" &&
3889  m_YScan->getValue() == "0" &&
3890  m_XScan->getValue() == "0")
3891  item->SetText(tr("No scaling"),"value");
3892  else
3893  item->SetText(QString("%1%x%2%+%3%+%4%")
3894  .arg(m_HorizScan->getValue())
3895  .arg(m_VertScan->getValue())
3896  .arg(m_XScan->getValue())
3897  .arg(m_YScan->getValue()), "value");
3898 }
3899 
3901 {
3902  emit ShouldRedraw(this);
3903 }
3904 
3906  : StandardSettingDialog(stack, "playbacksettings", new PlaybackSettings())
3907 {
3908 }
3909 
3911 {
3913  if (item)
3914  {
3915  PlaybackProfileItemConfig *config =
3916  item->GetData().value<PlaybackProfileItemConfig*>();
3917  if (config)
3919  }
3920 }
3921 
3922 
3924 {
3925  MythMenu *menu = new MythMenu(tr("Playback Profile Menu"), this,
3926  "mainmenu");
3927 
3928  if (m_buttonList->GetItemPos(item) > 2)
3929  menu->AddItem(tr("Move Up"), SLOT(MoveProfileItemUp()));
3930  if (m_buttonList->GetItemPos(item) + 1 < m_buttonList->GetCount())
3931  menu->AddItem(tr("Move Down"), SLOT(MoveProfileItemDown()));
3932 
3933  menu->AddItem(tr("Delete"), SLOT(DeleteProfileItem()));
3934 
3935  MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack");
3936 
3937  MythDialogBox *menuPopup = new MythDialogBox(menu, popupStack,
3938  "menudialog");
3939  menuPopup->SetReturnEvent(this, "mainmenu");
3940 
3941  if (menuPopup->Create())
3942  popupStack->AddScreen(menuPopup);
3943  else
3944  delete menuPopup;
3945 }
3946 
3948 {
3950  if (item)
3951  {
3952  PlaybackProfileItemConfig *config =
3953  item->GetData().value<PlaybackProfileItemConfig*>();
3954  if (config)
3955  {
3956  const int currentPos = m_buttonList->GetCurrentPos();
3957 
3958  config->DecreasePriority();
3959 
3960  m_buttonList->SetItemCurrent(currentPos + 1);
3961  }
3962  }
3963 }
3964 
3966 {
3968  if (item)
3969  {
3970  PlaybackProfileItemConfig *config =
3971  item->GetData().value<PlaybackProfileItemConfig*>();
3972  if (config)
3973  {
3974  const int currentPos = m_buttonList->GetCurrentPos();
3975 
3976  config->IncreasePriority();
3977 
3978  m_buttonList->SetItemCurrent(currentPos - 1);
3979  }
3980  }
3981 }
3982 
3984 {
3985  PlaybackProfileItemConfig *config =
3987  if (config)
3988  config->ShowDeleteDialog();
3989 }
3990 
3992  : m_newPlaybackProfileButton(NULL),
3993  m_playbackProfiles(NULL)
3994 {
3995  setLabel(tr("Playback settings"));
3996 }
3997 
3999 {
4000  GroupSetting* general = new GroupSetting();
4001  general->setLabel(tr("General Playback"));
4002  general->addChild(RealtimePriority());
4003  general->addChild(DecodeExtraAudio());
4004  general->addChild(JumpToProgramOSD());
4005  general->addChild(ClearSavedPosition());
4006  general->addChild(AltClearSavedPosition());
4007  general->addChild(AutomaticSetWatched());
4008  general->addChild(ContinueEmbeddedTVPlay());
4009  general->addChild(LiveTVIdleTimeout());
4010 
4011 #if CONFIG_DEBUGTYPE
4012  general->addChild(FFmpegDemuxer());
4013 #endif
4014 
4015  general->addChild(new PlayBackScaling());
4016 
4017  general->addChild(AspectOverride());
4018  general->addChild(AdjustFill());
4019 
4020  general->addChild(LetterboxingColour());
4021  general->addChild(PIPLocationComboBox());
4022  general->addChild(PlaybackExitPrompt());
4023  general->addChild(EndOfRecordingExitPrompt());
4024  addChild(general);
4025 
4028 
4030  new ButtonStandardSetting(tr("Add a new playback profile"));
4032  connect(m_newPlaybackProfileButton, SIGNAL(clicked()),
4033  SLOT(NewPlaybackProfileSlot()));
4034 
4035  GroupSetting* pbox = new GroupSetting();
4036  pbox->setLabel(tr("View Recordings"));
4037  pbox->addChild(PlayBoxOrdering());
4038  pbox->addChild(PlayBoxEpisodeSort());
4039  // Disabled until we re-enable live previews
4040  // pbox->addChild(PlaybackPreview());
4041  // pbox->addChild(HWAccelPlaybackPreview());
4042  pbox->addChild(PBBStartInTitle());
4043 
4044  GroupSetting* pbox2 = new GroupSetting();
4045  pbox2->setLabel(tr("Recording Groups"));
4046  pbox2->addChild(DisplayRecGroup());
4047  pbox2->addChild(QueryInitialFilter());
4048  pbox2->addChild(RememberRecGroup());
4049 
4050  pbox->addChild(pbox2);
4051 
4053 
4054  StandardSetting *playbackWatchList = PlaybackWatchList();
4055  playbackWatchList->addTargetedChild("1", PlaybackWLStart());
4056  playbackWatchList->addTargetedChild("1", PlaybackWLAutoExpire());
4057  playbackWatchList->addTargetedChild("1", PlaybackWLMaxAge());
4058  playbackWatchList->addTargetedChild("1", PlaybackWLBlackOut());
4059  pbox->addChild(playbackWatchList);
4060  addChild(pbox);
4061 
4062  GroupSetting* seek = new GroupSetting();
4063  seek->setLabel(tr("Seeking"));
4064  seek->addChild(SmartForward());
4065  seek->addChild(FFRewReposTime());
4066  seek->addChild(FFRewReverse());
4067 
4068  addChild(seek);
4069 
4070  GroupSetting* comms = new GroupSetting();
4071  comms->setLabel(tr("Commercial Skip"));
4072  comms->addChild(AutoCommercialSkip());
4073  comms->addChild(CommRewindAmount());
4074  comms->addChild(CommNotifyAmount());
4075  comms->addChild(MaximumCommercialSkip());
4076  comms->addChild(MergeShortCommBreaks());
4077 
4078  addChild(comms);
4079 
4080 #if CONFIG_DARWIN
4081  GroupSetting* mac = new GroupSetting();
4082  mac->setLabel(tr("Mac OS X Video Settings"));
4083  mac->addChild(MacGammaCorrect());
4084  mac->addChild(MacScaleUp());
4085  mac->addChild(MacFullSkip());
4086 
4087  StandardSetting *floatEnabled = MacFloatEnabled();
4088  floatEnabled->addTargetedChild("1", MacFloatSkip());
4089  floatEnabled->addTargetedChild("1", MacFloatOpacity());
4090  mac->addChild(floatEnabled);
4091 
4092  StandardSetting *macMainEnabled = MacMainEnabled();
4093  macMainEnabled->addTargetedChild("1", MacMainSkip());
4094  macMainEnabled->addTargetedChild("1", MacMainOpacity());
4095  mac->addChild(macMainEnabled);
4096 
4097  StandardSetting *dockEnabled = MacDockEnabled();
4098  dockEnabled->addTargetedChild("1", MacDockSkip());
4099  mac->addChild(dockEnabled);
4100 
4101  StandardSetting* desktopEnabled = MacDesktopEnabled();
4102  desktopEnabled->addTargetedChild("1", MacDesktopSkip());
4103  mac->addChild(desktopEnabled);
4104 
4105  addChild(mac);
4106 #endif
4107 
4109 }
4110 
4112 {
4113  setLabel(tr("On-screen Display"));
4114 
4115  addChild(EnableMHEG());
4121 
4122  //GroupSetting *cc = new GroupSetting();
4123  //cc->setLabel(tr("Closed Captions"));
4124  //cc->addChild(DecodeVBIFormat());
4125  //addChild(cc);
4126 
4127 #if defined(Q_OS_MACX)
4128  // Any Mac OS-specific OSD stuff would go here.
4129 #endif
4130 }
4131 
4133 {
4134  setLabel(tr("General (Basic)"));
4135  GroupSetting* general = new GroupSetting();
4136  general->setLabel(tr("General (Basic)"));
4137  general->addChild(ChannelOrdering());
4138  general->addChild(ChannelFormat());
4139  general->addChild(LongChannelFormat());
4140 
4141  addChild(general);
4142 
4143  GroupSetting* autoexp = new GroupSetting();
4144 
4145  autoexp->setLabel(tr("General (Auto-Expire)"));
4146 
4147  autoexp->addChild(AutoExpireMethod());
4148 
4149  autoexp->addChild(RerecordWatched());
4150  autoexp->addChild(AutoExpireWatchedPriority());
4151 
4152  autoexp->addChild(AutoExpireLiveTVMaxAge());
4153  autoexp->addChild(AutoExpireDayPriority());
4154  autoexp->addChild(AutoExpireExtraSpace());
4155 
4156 // autoexp->addChild(new DeletedExpireOptions());
4157  autoexp->addChild(DeletedMaxAge());
4158 
4159  addChild(autoexp);
4160 
4161  GroupSetting* jobs = new GroupSetting();
4162 
4163  jobs->setLabel(tr("General (Jobs)"));
4164 
4165  jobs->addChild(CommercialSkipMethod());
4166  jobs->addChild(CommFlagFast());
4167  jobs->addChild(AggressiveCommDetect());
4169 
4170  addChild(jobs);
4171 
4172  GroupSetting* general2 = new GroupSetting();
4173 
4174  general2->setLabel(tr("General (Advanced)"));
4175 
4176  general2->addChild(RecordPreRoll());
4177  general2->addChild(RecordOverTime());
4178  general2->addChild(CategoryOverTimeSettings());
4179  addChild(general2);
4180 
4181  GroupSetting* changrp = new GroupSetting();
4182 
4183  changrp->setLabel(tr("General (Channel Groups)"));
4184 
4185  changrp->addChild(ChannelGroupRememberLast());
4186  changrp->addChild(ChannelGroupDefault());
4187  changrp->addChild(BrowseChannelGroup());
4188 
4189  addChild(changrp);
4190 }
4191 
4193 {
4194  setLabel(tr("Program Guide"));
4195 
4198 }
4199 
4201 {
4202  GroupSetting* sched = new GroupSetting();
4203 
4204  sched->setLabel(tr("Scheduler Options"));
4205 
4206  sched->addChild(GRSchedOpenEnd());
4207  sched->addChild(GRPrefInputRecPriority());
4208  sched->addChild(GRHDTVRecPriority());
4209  sched->addChild(GRWSRecPriority());
4210 
4211  addChild(sched);
4212 
4213  GroupSetting* access = new GroupSetting();
4214 
4215  access->setLabel(tr("Accessibility Options"));
4216 
4217  access->addChild(GRSignLangRecPriority());
4218  access->addChild(GROnScrSubRecPriority());
4219  access->addChild(GRCCRecPriority());
4220  access->addChild(GRHardHearRecPriority());
4221  access->addChild(GRAudioDescRecPriority());
4222 
4223  addChild(access);
4224 }
4225 
4227 {
4228  public:
4229  GuiDimension();
4230  //virtual QString getValue();
4231  virtual void updateButton(MythUIButtonListItem *item);
4232 
4233  private slots:
4234  virtual void childChanged(StandardSetting *);
4235  private:
4240 };
4241 
4243  :GroupSetting()
4244 {
4245  setLabel(AppearanceSettings::tr("GUI dimension"));
4246  addChild(m_width = GuiWidth());
4250  connect(m_width, SIGNAL(valueChanged(StandardSetting *)),
4251  SLOT(childChanged(StandardSetting *)));
4252  connect(m_height, SIGNAL(valueChanged(StandardSetting *)),
4253  SLOT(childChanged(StandardSetting *)));
4254  connect(m_offsetX, SIGNAL(valueChanged(StandardSetting *)),
4255  SLOT(childChanged(StandardSetting *)));
4256  connect(m_offsetY, SIGNAL(valueChanged(StandardSetting *)),
4257  SLOT(childChanged(StandardSetting *)));
4258 }
4259 
4261 {
4263  if ((m_width->getValue() == "0" ||
4264  m_height->getValue() == "0") &&
4265  m_offsetX->getValue() == "0" &&
4266  m_offsetY->getValue() == "0")
4267  item->SetText(AppearanceSettings::tr("Fullscreen"), "value");
4268  else
4269  item->SetText(QString("%1x%2+%3+%4")
4270  .arg(m_width->getValue())
4271  .arg(m_height->getValue())
4272  .arg(m_offsetX->getValue())
4273  .arg(m_offsetY->getValue()), "value");
4274 }
4275 
4277 {
4278  emit ShouldRedraw(this);
4279 }
4280 
4282 {
4283  qApp->processEvents();
4284  GetMythMainWindow()->JumpTo("Reload Theme");
4285 }
4286 
4288 {
4289  GroupSetting* screen = new GroupSetting();
4290  screen->setLabel(tr("Theme / Screen Settings"));
4291  addChild(screen);
4292 
4293 #if ! CONFIG_DARWIN
4294  screen->addChild(ThemePainter());
4295 #endif
4296  screen->addChild(MenuTheme());
4297 
4299  {
4300  screen->addChild(XineramaScreen());
4302  }
4303 
4304 // screen->addChild(DisplaySizeHeight());
4305 // screen->addChild(DisplaySizeWidth());
4306 
4307  screen->addChild(new GuiDimension());
4308 
4309  screen->addChild(GuiSizeForTV());
4310  screen->addChild(HideMouseCursor());
4311  screen->addChild(RunInWindow());
4312  screen->addChild(UseFixedWindowSize());
4313  screen->addChild(AlwaysOnTop());
4314 #ifdef USING_AIRPLAY
4315  screen->addChild(AirPlayFullScreen());
4316 #endif
4317 
4318 #if defined(USING_XRANDR) || CONFIG_DARWIN
4319  const vector<DisplayResScreen> scr = GetVideoModes();
4320  if (!scr.empty())
4322 #endif
4323  GroupSetting* dates = new GroupSetting();
4324 
4325  dates->setLabel(tr("Localization"));
4326 
4327  dates->addChild(MythLanguage());
4328  dates->addChild(ISO639PreferredLanguage(0));
4329  dates->addChild(ISO639PreferredLanguage(1));
4330  dates->addChild(MythDateFormatCB());
4331  dates->addChild(MythShortDateFormat());
4332  dates->addChild(MythTimeFormat());
4333 
4334  addChild(dates);
4335 
4336  addChild(LCDEnable());
4337 }
4338 
4339 /*******************************************************************************
4340 * Channel Groups *
4341 *******************************************************************************/
4342 
4344 {
4345  public:
4347  const QString &channum, const QString &name);
4348  uint getChannelId(){return m_channelId;};
4349  private:
4350  uint m_channelId;
4351 
4352 };
4353 
4355  const QString &channum, const QString &channame)
4357  m_channelId(chanid)
4358 {
4359  setLabel(QString("%1 %2").arg(channum).arg(channame));
4360  setHelpText(tr("Select/Unselect channels for this channel group"));
4361 }
4362 
4364  int groupId = -1)
4365  :GroupSetting(),
4366  m_groupId(groupId),
4367  m_groupName(NULL)
4368 {
4369  setLabel(groupName);//TODO this should be the translated name if Favorite
4370  setValue(groupName);
4372  m_groupName->setLabel(groupName);
4373 }
4374 
4376 {
4377  //Change the name
4378  if ((m_groupName && m_groupName->haveChanged())
4379  || m_groupId == -1)
4380  {
4381  if (m_groupId == -1)//create a new group
4382  {
4383  MSqlQuery query(MSqlQuery::InitCon());
4384  QString qstr =
4385  "INSERT INTO channelgroupnames (name) VALUE (:NEWNAME);";
4386  query.prepare(qstr);
4387  query.bindValue(":NEWNAME", m_groupName->getValue());
4388 
4389  if (!query.exec())
4390  MythDB::DBError("ChannelGroupSetting::Close", query);
4391  else
4392  {
4393  //update m_groupId
4394  QString qstr = "SELECT grpid FROM channelgroupnames "
4395  "WHERE name = :NEWNAME;";
4396  query.prepare(qstr);
4397  query.bindValue(":NEWNAME", m_groupName->getValue());
4398  if (!query.exec())
4399  MythDB::DBError("ChannelGroupSetting::Close", query);
4400  else
4401  if (query.next())
4402  m_groupId = query.value(0).toUInt();
4403  }
4404  }
4405  else
4406  {
4407  MSqlQuery query(MSqlQuery::InitCon());
4408  QString qstr = "UPDATE channelgroupnames set name = :NEWNAME "
4409  " WHERE name = :OLDNAME ;";
4410  query.prepare(qstr);
4411  query.bindValue(":NEWNAME", m_groupName->getValue());
4412  query.bindValue(":OLDNAME", getValue());
4413 
4414  if (!query.exec())
4415  MythDB::DBError("ChannelGroupSetting::Close", query);
4416  else
4417  if (query.next())
4418  m_groupId = query.value(0).toUInt();
4419  }
4420  }
4421 
4422  if (m_groupId == -1)
4423  return;
4424 
4425  QList<StandardSetting *> *children = getSubSettings();
4426  if (!children)
4427  return;
4428 
4429  QList<StandardSetting *>::const_iterator i;
4430  for (i = children->constBegin(); i != children->constEnd(); ++i)
4431  {
4432  if ((*i)->haveChanged())
4433  {
4434  if ((*i) != m_groupName)
4435  {
4436  ChannelCheckBoxSetting *channel =
4437  dynamic_cast<ChannelCheckBoxSetting *>(*i);
4438  if (channel)
4439  {
4440  if (channel->boolValue())
4441  {
4443  m_groupId);
4444  }
4445  else
4446  {
4448  m_groupId);
4449  }
4450  }
4451  }
4452  }
4453  }
4454 }
4455 
4457 {
4458  clearSettings();
4459  //We can not rename the Favorite group
4460  //if (m_groupId!=1)
4461  //{
4463  m_groupName->setLabel(tr("Group name"));
4464 // if (m_groupId > -1)
4468  //}
4469 
4470  MSqlQuery query(MSqlQuery::InitCon());
4471 
4472  QString qstr =
4473  "SELECT channel.chanid, channum, name, grpid FROM channel "
4474  "LEFT JOIN channelgroup "
4475  "ON (channel.chanid = channelgroup.chanid AND grpid = :GRPID) "
4476  "ORDER BY channum+0; "; //to order by numeric value of channel number
4477 
4478  query.prepare(qstr);
4479 
4480  query.bindValue(":GRPID", m_groupId);
4481 
4482  if (!query.exec() || !query.isActive())
4483  MythDB::DBError("ChannelGroupSetting::Load", query);
4484  else
4485  {
4486  while (query.next())
4487  {
4488  ChannelCheckBoxSetting *channelCheckBox =
4489  new ChannelCheckBoxSetting(query.value(0).toUInt(),
4490  query.value(1).toString(),
4491  query.value(2).toString());
4492  channelCheckBox->setValue(!query.value(3).isNull());
4493  addChild(channelCheckBox);
4494  }
4495  }
4496 
4498 }
4499 
4501 {
4502  //can not delete new group or Favorite
4503  return (m_groupId > 1);
4504 }
4505 
4507 {
4508  MSqlQuery query(MSqlQuery::InitCon());
4509  // Delete channels from this group
4510  query.prepare("DELETE FROM channelgroup WHERE grpid = :GRPID;");
4511  query.bindValue(":GRPID", m_groupId);
4512  if (!query.exec())
4513  MythDB::DBError("ChannelGroupSetting::deleteEntry", query);
4514 
4515  // Now delete the group from channelgroupnames
4516  query.prepare("DELETE FROM channelgroupnames WHERE grpid = :GRPID;");
4517  query.bindValue(":GRPID", m_groupId);
4518  if (!query.exec())
4519  MythDB::DBError("ChannelGroupSetting::Close", query);
4520 }
4521 
4522 
4524  : GroupSetting(),
4525  m_addGroupButton(NULL)
4526 {
4527  setLabel(tr("Channel Groups"));
4528 }
4529 
4531 {
4532  clearSettings();
4533  ButtonStandardSetting *newGroup =
4534  new ButtonStandardSetting(tr("(Create New Channel Group)"));
4535  connect(newGroup, SIGNAL(clicked()), SLOT(ShowNewGroupDialog()));
4536  addChild(newGroup);
4537 
4538  addChild(new ChannelGroupSetting(tr("Favorites"), 1));
4539 
4540  MSqlQuery query(MSqlQuery::InitCon());
4541 
4542  QString qstr = "SELECT grpid, name FROM channelgroupnames "
4543  " WHERE grpid <> 1 "
4544  " ORDER BY name ; ";
4545 
4546  query.prepare(qstr);
4547 
4548  if (!query.exec() || !query.isActive())
4549  MythDB::DBError("ChannelGroupsSetting::Load", query);
4550  else
4551  {
4552  while(query.next())
4553  {
4554  addChild(new ChannelGroupSetting(query.value(1).toString(),
4555  query.value(0).toUInt()));
4556  }
4557  }
4558 
4559  //Load all the groups
4561  //TODO select the new one or the edited one
4562  emit settingsChanged(NULL);
4563 }
4564 
4565 
4567 {
4568  MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack");
4569  MythTextInputDialog *settingdialog =
4570  new MythTextInputDialog(popupStack,
4571  tr("Enter the name of the new channel group"));
4572 
4573  if (settingdialog->Create())
4574  {
4575  connect(settingdialog, SIGNAL(haveResult(QString)),
4576  SLOT(CreateNewGroup(QString)));
4577  popupStack->AddScreen(settingdialog);
4578  }
4579  else
4580  {
4581  delete settingdialog;
4582  }
4583 }
4584 
4586 {
4587  ChannelGroupSetting *button = new ChannelGroupSetting(name,-1);
4588  button->setLabel(name);
4589  button->Load();
4590  addChild(button);
4591  emit settingsChanged(this);
4592 }
4593 
4594 
4595 // vim:set sw=4 ts=4 expandtab:
static DisplayRes * GetDisplayRes(bool lock=false)
Factory method that returns a DisplayRes singleton.
Definition: DisplayRes.cpp:18
static HostComboBoxSetting MUNUSED * DecodeVBIFormat()
TriggeredConfigurationGroup(bool uselabel=true, bool useframe=true, bool zeroMargin=false, bool zeroSpace=false, bool stack_uselabel=true, bool stack_useframe=true, bool stack_zeroMargin=false, bool stack_zeroSpace=false)
bool next(void)
Wrap QSqlQuery::next() so we can display the query results.
Definition: mythdbcon.cpp:798
static HostCheckBoxSetting * EnableMediaMon()
#define MUNUSED
Definition: mythexp.h:20
TransTextEditSetting * height_range
static HostCheckBoxSetting * LCDShowGeneric()
static QStringList GetDecoders(void)
static HostCheckBoxSetting * PersistentBrowseMode()
TransMythUISpinBoxSetting * max_cpus
ISO 639-1 and ISO 639-2 support functions.
void vrenderChanged(const QString &renderer)
static HostCheckBoxSetting * LCDShowTime()
static HostCheckBoxSetting * LCDShowMenu()
static HostCheckBoxSetting * EnableMHEG()
HostCheckBoxSetting(const QString &name)
void bindValue(const QString &placeholder, const QVariant &val)
Definition: mythdbcon.cpp:897
static HostComboBoxSetting * ThemePainter()
#define D3D9_PAINTER
Definition: mythuidefines.h:6
#define OPENGL_PAINTER
Definition: mythuidefines.h:3
StandardSetting * m_height
static QString GetDeinterlacerName(const QString &short_name)
unsigned int slots[4]
Definition: element.c:38
void orenderChanged(const QString &renderer)
ChannelCheckBoxSetting(uint chanid, const QString &channum, const QString &name)
void DeleteProfileItem(PlaybackProfileItemConfig *profile)
static HostSpinBoxSetting * NetworkControlPort()
StandardSetting * InitProfileItem(uint, StandardSetting *)
TransMythUICheckBoxSetting * osdfade
static QStringList GetOSDs(const QString &video_renderer)
static GlobalComboBoxSetting * CommercialSkipMethod()
static HostComboBoxSetting * PlayBoxEpisodeSort()
static HostCheckBoxSetting * UseVideoModes()
static uint GetProfileGroupID(const QString &profilename, const QString &hostname)
Dialog asking for user confirmation.
virtual void childChanged(StandardSetting *)
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()
MythConfirmationDialog * ShowOkPopup(const QString &message, QObject *parent, const char *slot, bool showCancel)
Non-blocking version of MythPopupBox::showOkPopup()
static HostSpinBoxSetting * HorizScanPercentage()
QString toString(MarkTypes type)
void deint1Changed(const QString &deint)
static 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
TransTextEditSetting * width_range
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)
virtual bool Create(void)
static item_list_t LoadDB(uint groupid)
virtual bool canDelete(void)
const QLocale GetQLocale(void)
StandardSetting * m_width
QString getLabel(void) const
int GetItemPos(MythUIButtonListItem *item) const
void widthChanged(const QString &dec)
virtual void addChild(Configurable *child)
static bool IsFilterAllowed(const QString &video_renderer)
static GlobalSpinBoxSetting * GRSignLangRecPriority()
vector< ChannelGroupItem > ChannelGroupList
Definition: channelgroup.h:32
TransTextEditSetting * m_groupName
void setChanged(bool changed)
static GlobalSpinBoxSetting * GRCCRecPriority()
MythScreenStack * GetStack(const QString &stackname)
StandardSetting * m_offsetY
static GroupSetting * CategoryOverTimeSettings()
static HostComboBoxSetting * PlayBoxOrdering()
void setDrawArrow(bool flag)
static HostCheckBoxSetting * ChannelGroupRememberLast()
static HostTextEditSetting * IgnoreMedia()
QString SkipTypeToString(int flags)
unsigned int uint
Definition: compat.h:136
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
void AddItem(const QString &title, QVariant data=0, MythMenu *subMenu=NULL, bool selected=false, bool checked=false)
static bool DeleteDB(uint groupid, const item_list_t &)
static HostSpinBoxSetting * FFRewReposTime()
static HostCheckBoxSetting * AutomaticSetWatched()
static QString GetOSDHelp(const QString &osd)
static GlobalSpinBoxSetting * GRHDTVRecPriority()
static HostCheckBoxSetting * DefaultCCMode()
static void CreateVAAPIProfiles(const QString &hostname)
TransMythUIComboBoxSetting * decoder
StandardSetting * m_VertScan
static HostCheckBoxSetting * NetworkControlEnabled()
static GlobalSpinBoxSetting * GRWSRecPriority()
static GlobalSpinBoxSetting * GRAudioDescRecPriority()
static GlobalSpinBoxSetting * AutoExpireLiveTVMaxAge()
static HostComboBoxSetting * SubtitleCodec()
static GlobalSpinBoxSetting * DeferAutoTranscodeDays()
virtual void setValue(const QString &)
const DisplayResVector GetVideoModes(void)
Definition: DisplayRes.cpp:262
PlaybackProfileConfig * parentConfig
VideoModeSettings(const char *c)
static HostTextEditSetting * SetupPinCode()
static 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()
MythUIComboBoxSetting * m_playbackProfiles
static HostComboBoxSetting * CurrentPlaybackProfile()
virtual QString getValue(void) const
static QStringList GetDeinterlacers(const QString &video_renderer)
#define OPENGL2_PAINTER
Definition: mythuidefines.h:4
static GlobalSpinBoxSetting * GROnScrSubRecPriority()
static HostSpinBoxSetting * YScanDisplacement()
virtual void updateButton(MythUIButtonListItem *item)
This method is called whenever the UI need to reflect a change Reimplement this If you widget need a ...
QVariant value(int i) const
Definition: mythdbcon.h:182
static HostTextEditSetting * ScreenShotPath()
TransMythUIComboBoxSetting * deint1
AspectOverrideMode
Definition: videoouttypes.h:46
bool SendReceiveStringList(QStringList &strlist, bool quickTimeout=false, bool block=true)
Send a message to the backend and wait for a response.
static GlobalComboBoxSetting * MythLanguage()
virtual void AddScreen(MythScreenType *screen, bool allowFade=true)
static HostSpinBoxSetting * CommNotifyAmount()
static GlobalCheckBoxSetting * CommFlagFast()
static HostCheckBoxSetting * RealtimePriority()
static HostTextEditSetting * HaltCommand()
void GetResolutionSetting(const QString &type, int &width, int &height, double &forced_aspect, double &refreshrate, int index=-1)
static HostCheckBoxSetting * LCDShowRecStatus()
static bool DeleteChannel(uint chanid, int changrpid)
static HostCheckBoxSetting * GuiSizeForTV()
TransMythUICheckBoxSetting * skiploop
MythUIComboBoxSetting * codecs
void ShouldRedraw(StandardSetting *)
static HostComboBoxSetting * DisplayRecGroup()
StandardSetting * m_YScan
static HostSpinBoxSetting * FrontendIdleTimeout()
virtual void setLabel(QString str)
static HostSpinBoxSetting * GuiWidth()
static ChannelGroupList GetChannelGroups(bool includeEmpty=true)
virtual void deleteEntry(void)
static GlobalSpinBoxSetting * MaximumCommercialSkip()
static HostComboBoxSetting * DisplayGroupTitleSort()
QDateTime current(bool stripped)
Returns current Date and Time in UTC.
Definition: mythdate.cpp:10
static HostComboBoxSetting * MythDateFormatCB()
QString GetSetting(const QString &key, const QString &defaultval="")
static GlobalSpinBoxSetting * GRPrefInputRecPriority()
static HostCheckBoxSetting * LCDHeartBeatOn()
static HostComboBoxSetting * LCDShowMusicItems()
QList< ThemeInfo > GetThemes(ThemeType type)
TransMythUIComboBoxSetting * vidrend
static int GetNumberXineramaScreens(void)
virtual void updateButton(MythUIButtonListItem *item)
This method is called whenever the UI need to reflect a change Reimplement this If you widget need a ...
bool haveChanged()
Return true if the setting have changed or any of its children.
bool isActive(void) const
Definition: mythdbcon.h:188
MythUIButtonList * m_buttonList
static HostSpinBoxSetting * XScanDisplacement()
PlaybackProfileItemConfig(PlaybackProfileConfig *parent, uint idx, ProfileItem &_item)
static 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:555
static HostCheckBoxSetting * UseVirtualKeyboard()
void JumpTo(const QString &destination, bool pop=true)
static HostTextEditSetting * UDPNotifyPort()
static HostCheckBoxSetting * LCDBigClock()
static HostComboBoxSetting * AspectOverride()
static uint CreateProfileGroup(const QString &groupname, const QString &hostname)
static HostComboBoxSetting * MythShortDateFormat()
void CreateNewGroup(QString name)
static QString i18n(const QString &)
Translations for play,recording, & storage groups +.
PlaybackProfileConfig(const QString &profilename, StandardSetting *parent)
const char * name
Definition: ParseText.cpp:339
static HostCheckBoxSetting * QueryInitialFilter()
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()
StandardSetting * m_overrideExitMenu
static HostCheckBoxSetting * JumpToProgramOSD()
static HostSpinBoxSetting * LCDPopupTime()
static HostCheckBoxSetting * PlaybackWLAutoExpire()
deque< int > GetPreferredSkipTypeCombinations(void)
static HostCheckBoxSetting * ContinueEmbeddedTVPlay()
PIPLocation
Definition: videoouttypes.h:19
static HostCheckBoxSetting * EndOfRecordingExitPrompt()
AdjustFillMode
Definition: videoouttypes.h:57
static GlobalComboBoxSetting * AutoExpireMethod()
bool checkRange(QString key, float fvalue, bool *ok=Q_NULLPTR) const
static HostComboBoxSetting * ChannelOrdering()
static MythThemedMenu * menu
Dialog prompting the user to enter a text string.
void setVisible(bool visible)
bool prepare(const QString &query)
QSqlQuery::prepare() is not thread safe in Qt <= 3.3.2.
Definition: mythdbcon.cpp:823
virtual void Load(void)
static HostSpinBoxSetting * EPGRecThreshold()
static GlobalSpinBoxSetting * RecordOverTime()
static HostSpinBoxSetting * PlaybackWLMaxAge()
static HostSpinBoxSetting * GuiOffsetX()
static HostCheckBoxSetting * LCDShowMusic()
#define LOG(_MASK_, _LEVEL_, _STRING_)
Definition: mythlogging.h:38
static HostComboBoxSetting * OverrideExitMenu()
static HostComboBoxSetting * XineramaMonitorAspectRatio()
static HostTextEditSetting * DefaultTVChannel()
QString iso639_str2_to_str3(const QString &str2)
Definition: iso639.cpp:70
StandardSetting * m_haltCommand
static MTV_PUBLIC VDALibrary * GetVDALibrary(void)
static HostCheckBoxSetting * AlwaysOnTop()
static int FindBestMatch(const DisplayResVector &dsr, const DisplayResScreen &d, double &target_rate)
static QString GetDeinterlacerHelp(const QString &deint)
static HostSpinBoxSetting * GuiOffsetY()
static HostCheckBoxSetting * RunInWindow()
void settingsChanged(StandardSetting *selectedSetting=NULL)
static QString GetVideoRendererHelp(const QString &renderer)
void SetReturnEvent(QObject *retobject, const QString &resultid)
static GlobalCheckBoxSetting * AggressiveCommDetect()
static bool AddChannel(uint chanid, int changrpid)
QString Get(const QString &value) const
virtual void setLabel(QString str)
Definition: settings.h:57
void swap(int indexA, int intexB)
static HostSpinBoxSetting * GuiHeight()
void ShowPlaybackProfileMenu(MythUIButtonListItem *item)
void Set(const QString &value, const QString &data)
LetterBoxColour
Definition: videoouttypes.h:72
static HostComboBoxSetting * LongChannelFormat()
static bool DeleteProfileGroup(const QString &groupname, const QString &hostname)
void framerateChanged(const QString &dec)
static HostCheckBoxSetting * LCDShowVolume()
static HostComboBoxSetting * ChannelGroupDefault()
void removeTargetedChild(const QString &value, StandardSetting *child)
static GlobalComboBoxSetting * OverTimeCategory()
static HostComboBoxSetting * AutoCommercialSkip()
void SetItemCurrent(MythUIButtonListItem *item)
Scheduler * sched
static QString GetDecoderHelp(QString decoder=QString::null)
#define QT_PAINTER
Definition: mythuidefines.h:2
static bool SaveDB(uint groupid, item_list_t &)
static QString iso639_key_to_str3(int code)
Definition: iso639.h:46
void setTrigger(Configurable *_trigger)
static QStringList GetProfiles(const QString &hostname)
ButtonStandardSetting * m_addNewEntry
static HostComboBoxSetting * LetterboxingColour()
bool exec(void)
Wrap QSqlQuery::exec() so we can display SQL.
Definition: mythdbcon.cpp:623
virtual void applyChange()
static HostCheckBoxSetting * PlaybackWatchList()
#define AUTO_PAINTER
Definition: mythuidefines.h:5
StandardSetting * m_XScan
The DisplayRes module allows for the display resolution and refresh rateto be changed "on the fly"...
Definition: DisplayRes.h:32
ButtonStandardSetting * m_newPlaybackProfileButton
TransTextEditSetting * filters
static GlobalSpinBoxSetting * CategoryOverTime()
virtual void updateButton(MythUIButtonListItem *item)
This method is called whenever the UI need to reflect a change Reimplement this If you widget need a ...
static void DBError(const QString &where, const MSqlQuery &query)
Definition: mythdb.cpp:181
int GetCurrentPos() const
static HostCheckBoxSetting * BrowseAllTuners()
static 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.
void heightChanged(const QString &dec)