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