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